diff --git a/sdk/resourcemanager/appservice/armappservice/CHANGELOG.md b/sdk/resourcemanager/appservice/armappservice/CHANGELOG.md new file mode 100644 index 000000000000..a6e1d71509a6 --- /dev/null +++ b/sdk/resourcemanager/appservice/armappservice/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 0.1.0 (2021-12-24) + +- Init release. \ No newline at end of file diff --git a/sdk/resourcemanager/appservice/armappservice/LICENSE.txt b/sdk/resourcemanager/appservice/armappservice/LICENSE.txt new file mode 100644 index 000000000000..dc0c2ffb3dc1 --- /dev/null +++ b/sdk/resourcemanager/appservice/armappservice/LICENSE.txt @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) Microsoft Corporation. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/sdk/resourcemanager/appservice/armappservice/README.md b/sdk/resourcemanager/appservice/armappservice/README.md new file mode 100644 index 000000000000..5e8aa248ca33 --- /dev/null +++ b/sdk/resourcemanager/appservice/armappservice/README.md @@ -0,0 +1,75 @@ +# Azure Appservice Module for Go + +[![PkgGoDev](https://pkg.go.dev/badge/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/appservice/armappservice)](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/appservice/armappservice) + +The `armappservice` module provides operations for working with Azure Appservice. + +[Source code](https://github.com/Azure/azure-sdk-for-go/tree/main/sdk/resourcemanager/appservice/armappservice) + +# Getting started + +## Prerequisites + +- an [Azure subscription](https://azure.microsoft.com/free/) +- Go 1.16 or above + +## Install the package + +This project uses [Go modules](https://github.com/golang/go/wiki/Modules) for versioning and dependency management. + +Install the Azure Appservice module: + +```sh +go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/appservice/armappservice +``` + +## Authorization + +When creating a client, you will need to provide a credential for authenticating with Azure Appservice. The `azidentity` module provides facilities for various ways of authenticating with Azure including client/secret, certificate, managed identity, and more. + +```go +cred, err := azidentity.NewDefaultAzureCredential(nil) +``` + +For more information on authentication, please see the documentation for `azidentity` at [pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity). + +## Clients + +Azure Appservice modules consist of one or more clients. A client groups a set of related APIs, providing access to its functionality within the specified subscription. Create one or more clients to access the APIs you require using your credential. + +```go +client := armappservice.NewDomainsClient(, cred, nil) +``` + +You can use `ClientOptions` in package `github.com/Azure/azure-sdk-for-go/sdk/azcore/arm` to set endpoint to connect with public and sovereign clouds as well as Azure Stack. For more information, please see the documentation for `azcore` at [pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azcore](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azcore). + +```go +options = arm.ClientOptions{ + Host: arm.AzureChina, +} +client := armappservice.NewDomainsClient(, cred, &options) +``` + +## Provide Feedback + +If you encounter bugs or have suggestions, please +[open an issue](https://github.com/Azure/azure-sdk-for-go/issues) and assign the `Appservice` label. + +# Contributing + +This project welcomes contributions and suggestions. Most contributions require +you to agree to a Contributor License Agreement (CLA) declaring that you have +the right to, and actually do, grant us the rights to use your contribution. +For details, visit [https://cla.microsoft.com](https://cla.microsoft.com). + +When you submit a pull request, a CLA-bot will automatically determine whether +you need to provide a CLA and decorate the PR appropriately (e.g., label, +comment). Simply follow the instructions provided by the bot. You will only +need to do this once across all repos using our CLA. + +This project has adopted the +[Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). +For more information, see the +[Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) +or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any +additional questions or comments. \ No newline at end of file diff --git a/sdk/resourcemanager/appservice/armappservice/autorest.md b/sdk/resourcemanager/appservice/armappservice/autorest.md new file mode 100644 index 000000000000..543fb2abe262 --- /dev/null +++ b/sdk/resourcemanager/appservice/armappservice/autorest.md @@ -0,0 +1,13 @@ +### AutoRest Configuration + +> see https://aka.ms/autorest + +``` yaml +azure-arm: true +require: +- /home/vsts/work/1/s/azure-rest-api-specs/specification/web/resource-manager/readme.md +- /home/vsts/work/1/s/azure-rest-api-specs/specification/web/resource-manager/readme.go.md +license-header: MICROSOFT_MIT_NO_VERSION +module-version: 0.1.0 + +``` \ No newline at end of file diff --git a/sdk/resourcemanager/appservice/armappservice/build.go b/sdk/resourcemanager/appservice/armappservice/build.go new file mode 100644 index 000000000000..e5cb612eba06 --- /dev/null +++ b/sdk/resourcemanager/appservice/armappservice/build.go @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +// This file enables 'go generate' to regenerate this specific SDK +//go:generate pwsh.exe ../../../../eng/scripts/build.ps1 -skipBuild -cleanGenerated -format -tidy -generate resourcemanager/appservice/armappservice + +package armappservice diff --git a/sdk/resourcemanager/appservice/armappservice/ci.yml b/sdk/resourcemanager/appservice/armappservice/ci.yml new file mode 100644 index 000000000000..f45ba89fe9b8 --- /dev/null +++ b/sdk/resourcemanager/appservice/armappservice/ci.yml @@ -0,0 +1,27 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. +trigger: + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/resourcemanager/appservice/armappservice/ + +pr: + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/resourcemanager/appservice/armappservice/ + +stages: +- template: /eng/pipelines/templates/jobs/archetype-sdk-client.yml + parameters: + ServiceDirectory: 'resourcemanager/appservice/armappservice' diff --git a/sdk/resourcemanager/appservice/armappservice/go.mod b/sdk/resourcemanager/appservice/armappservice/go.mod new file mode 100644 index 000000000000..cdd26656962b --- /dev/null +++ b/sdk/resourcemanager/appservice/armappservice/go.mod @@ -0,0 +1,8 @@ +module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/appservice/armappservice + +go 1.16 + +require ( + github.com/Azure/azure-sdk-for-go v60.3.0+incompatible + github.com/Azure/azure-sdk-for-go/sdk/azcore v0.20.0 +) diff --git a/sdk/resourcemanager/appservice/armappservice/go.sum b/sdk/resourcemanager/appservice/armappservice/go.sum new file mode 100644 index 000000000000..358d1ee211fa --- /dev/null +++ b/sdk/resourcemanager/appservice/armappservice/go.sum @@ -0,0 +1,37 @@ +github.com/Azure/azure-sdk-for-go v60.3.0+incompatible h1:u6EXgnASaUOh38GXCwEpRs+u2bbfJpJpXeB42kU2cjg= +github.com/Azure/azure-sdk-for-go v60.3.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= +github.com/Azure/azure-sdk-for-go/sdk/azcore v0.20.0 h1:KQgdWmEOmaJKxaUUZwHAYh12t+b+ZJf8q3friycK1kA= +github.com/Azure/azure-sdk-for-go/sdk/azcore v0.20.0/go.mod h1:ZPW/Z0kLCTdDZaDbYTetxc9Cxl/2lNqxYHYNOF2bti0= +github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.1 h1:BUYIbDf/mMZ8945v3QkG3OuqGVyS4Iek0AOLwdRAYoc= +github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.1/go.mod h1:KLF4gFr6DcKFZwSuH8w8yEK6DpFl3LP5rhdvAb7Yz5I= +github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/dnaeon/go-vcr v1.1.0/go.mod h1:M7tiix8f0r6mKKJ3Yq/kqU1OYf3MnfmBWVbPx/yU9ko= +github.com/modocache/gover v0.0.0-20171022184752-b58185e213c5/go.mod h1:caMODM3PzxT8aQXRPkAt8xlV/e7d7w8GM5g0fa5F0D8= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20201010224723-4f7140c49acb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20210610132358-84b48f89b13b h1:k+E048sYJHyVnsr1GDrRZWQ32D2C7lWs9JRc0bel53A= +golang.org/x/net v0.0.0-20210610132358-84b48f89b13b/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M= +golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/sdk/resourcemanager/appservice/armappservice/go_mod_tidy_hack.go b/sdk/resourcemanager/appservice/armappservice/go_mod_tidy_hack.go new file mode 100644 index 000000000000..b8490074ad93 --- /dev/null +++ b/sdk/resourcemanager/appservice/armappservice/go_mod_tidy_hack.go @@ -0,0 +1,13 @@ +//go:build modhack +// +build modhack + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +// This file, and the github.com/Azure/azure-sdk-for-go import, won't actually become part of +// the resultant binary. + +package armappservice + +// Necessary for safely adding multi-module repo. See: https://github.com/golang/go/wiki/Modules#is-it-possible-to-add-a-module-to-a-multi-module-repository +import _ "github.com/Azure/azure-sdk-for-go" diff --git a/sdk/resourcemanager/appservice/armappservice/zz_generated_appservicecertificateorders_client.go b/sdk/resourcemanager/appservice/armappservice/zz_generated_appservicecertificateorders_client.go new file mode 100644 index 000000000000..515760baeca9 --- /dev/null +++ b/sdk/resourcemanager/appservice/armappservice/zz_generated_appservicecertificateorders_client.go @@ -0,0 +1,1286 @@ +//go:build go1.16 +// +build go1.16 + +// 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. + +package armappservice + +import ( + "context" + "errors" + "fmt" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// AppServiceCertificateOrdersClient contains the methods for the AppServiceCertificateOrders group. +// Don't use this type directly, use NewAppServiceCertificateOrdersClient() instead. +type AppServiceCertificateOrdersClient struct { + ep string + pl runtime.Pipeline + subscriptionID string +} + +// NewAppServiceCertificateOrdersClient creates a new instance of AppServiceCertificateOrdersClient with the specified values. +func NewAppServiceCertificateOrdersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *AppServiceCertificateOrdersClient { + cp := arm.ClientOptions{} + if options != nil { + cp = *options + } + if len(cp.Host) == 0 { + cp.Host = arm.AzurePublicCloud + } + return &AppServiceCertificateOrdersClient{subscriptionID: subscriptionID, ep: string(cp.Host), pl: armruntime.NewPipeline(module, version, credential, &cp)} +} + +// BeginCreateOrUpdate - Description for Create or update a certificate purchase order. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *AppServiceCertificateOrdersClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, certificateOrderName string, certificateDistinguishedName AppServiceCertificateOrder, options *AppServiceCertificateOrdersBeginCreateOrUpdateOptions) (AppServiceCertificateOrdersCreateOrUpdatePollerResponse, error) { + resp, err := client.createOrUpdate(ctx, resourceGroupName, certificateOrderName, certificateDistinguishedName, options) + if err != nil { + return AppServiceCertificateOrdersCreateOrUpdatePollerResponse{}, err + } + result := AppServiceCertificateOrdersCreateOrUpdatePollerResponse{ + RawResponse: resp, + } + pt, err := armruntime.NewPoller("AppServiceCertificateOrdersClient.CreateOrUpdate", "", resp, client.pl, client.createOrUpdateHandleError) + if err != nil { + return AppServiceCertificateOrdersCreateOrUpdatePollerResponse{}, err + } + result.Poller = &AppServiceCertificateOrdersCreateOrUpdatePoller{ + pt: pt, + } + return result, nil +} + +// CreateOrUpdate - Description for Create or update a certificate purchase order. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *AppServiceCertificateOrdersClient) createOrUpdate(ctx context.Context, resourceGroupName string, certificateOrderName string, certificateDistinguishedName AppServiceCertificateOrder, options *AppServiceCertificateOrdersBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, certificateOrderName, certificateDistinguishedName, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, client.createOrUpdateHandleError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *AppServiceCertificateOrdersClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, certificateOrderName string, certificateDistinguishedName AppServiceCertificateOrder, options *AppServiceCertificateOrdersBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if certificateOrderName == "" { + return nil, errors.New("parameter certificateOrderName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{certificateOrderName}", url.PathEscape(certificateOrderName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, certificateDistinguishedName) +} + +// createOrUpdateHandleError handles the CreateOrUpdate error response. +func (client *AppServiceCertificateOrdersClient) createOrUpdateHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// BeginCreateOrUpdateCertificate - Description for Creates or updates a certificate and associates with key vault secret. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *AppServiceCertificateOrdersClient) BeginCreateOrUpdateCertificate(ctx context.Context, resourceGroupName string, certificateOrderName string, name string, keyVaultCertificate AppServiceCertificateResource, options *AppServiceCertificateOrdersBeginCreateOrUpdateCertificateOptions) (AppServiceCertificateOrdersCreateOrUpdateCertificatePollerResponse, error) { + resp, err := client.createOrUpdateCertificate(ctx, resourceGroupName, certificateOrderName, name, keyVaultCertificate, options) + if err != nil { + return AppServiceCertificateOrdersCreateOrUpdateCertificatePollerResponse{}, err + } + result := AppServiceCertificateOrdersCreateOrUpdateCertificatePollerResponse{ + RawResponse: resp, + } + pt, err := armruntime.NewPoller("AppServiceCertificateOrdersClient.CreateOrUpdateCertificate", "", resp, client.pl, client.createOrUpdateCertificateHandleError) + if err != nil { + return AppServiceCertificateOrdersCreateOrUpdateCertificatePollerResponse{}, err + } + result.Poller = &AppServiceCertificateOrdersCreateOrUpdateCertificatePoller{ + pt: pt, + } + return result, nil +} + +// CreateOrUpdateCertificate - Description for Creates or updates a certificate and associates with key vault secret. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *AppServiceCertificateOrdersClient) createOrUpdateCertificate(ctx context.Context, resourceGroupName string, certificateOrderName string, name string, keyVaultCertificate AppServiceCertificateResource, options *AppServiceCertificateOrdersBeginCreateOrUpdateCertificateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCertificateCreateRequest(ctx, resourceGroupName, certificateOrderName, name, keyVaultCertificate, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, client.createOrUpdateCertificateHandleError(resp) + } + return resp, nil +} + +// createOrUpdateCertificateCreateRequest creates the CreateOrUpdateCertificate request. +func (client *AppServiceCertificateOrdersClient) createOrUpdateCertificateCreateRequest(ctx context.Context, resourceGroupName string, certificateOrderName string, name string, keyVaultCertificate AppServiceCertificateResource, options *AppServiceCertificateOrdersBeginCreateOrUpdateCertificateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/certificates/{name}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if certificateOrderName == "" { + return nil, errors.New("parameter certificateOrderName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{certificateOrderName}", url.PathEscape(certificateOrderName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, keyVaultCertificate) +} + +// createOrUpdateCertificateHandleError handles the CreateOrUpdateCertificate error response. +func (client *AppServiceCertificateOrdersClient) createOrUpdateCertificateHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// Delete - Description for Delete an existing certificate order. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *AppServiceCertificateOrdersClient) Delete(ctx context.Context, resourceGroupName string, certificateOrderName string, options *AppServiceCertificateOrdersDeleteOptions) (AppServiceCertificateOrdersDeleteResponse, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, certificateOrderName, options) + if err != nil { + return AppServiceCertificateOrdersDeleteResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return AppServiceCertificateOrdersDeleteResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { + return AppServiceCertificateOrdersDeleteResponse{}, client.deleteHandleError(resp) + } + return AppServiceCertificateOrdersDeleteResponse{RawResponse: resp}, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *AppServiceCertificateOrdersClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, certificateOrderName string, options *AppServiceCertificateOrdersDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if certificateOrderName == "" { + return nil, errors.New("parameter certificateOrderName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{certificateOrderName}", url.PathEscape(certificateOrderName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// deleteHandleError handles the Delete error response. +func (client *AppServiceCertificateOrdersClient) deleteHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// DeleteCertificate - Description for Delete the certificate associated with a certificate order. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *AppServiceCertificateOrdersClient) DeleteCertificate(ctx context.Context, resourceGroupName string, certificateOrderName string, name string, options *AppServiceCertificateOrdersDeleteCertificateOptions) (AppServiceCertificateOrdersDeleteCertificateResponse, error) { + req, err := client.deleteCertificateCreateRequest(ctx, resourceGroupName, certificateOrderName, name, options) + if err != nil { + return AppServiceCertificateOrdersDeleteCertificateResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return AppServiceCertificateOrdersDeleteCertificateResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { + return AppServiceCertificateOrdersDeleteCertificateResponse{}, client.deleteCertificateHandleError(resp) + } + return AppServiceCertificateOrdersDeleteCertificateResponse{RawResponse: resp}, nil +} + +// deleteCertificateCreateRequest creates the DeleteCertificate request. +func (client *AppServiceCertificateOrdersClient) deleteCertificateCreateRequest(ctx context.Context, resourceGroupName string, certificateOrderName string, name string, options *AppServiceCertificateOrdersDeleteCertificateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/certificates/{name}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if certificateOrderName == "" { + return nil, errors.New("parameter certificateOrderName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{certificateOrderName}", url.PathEscape(certificateOrderName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// deleteCertificateHandleError handles the DeleteCertificate error response. +func (client *AppServiceCertificateOrdersClient) deleteCertificateHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// Get - Description for Get a certificate order. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *AppServiceCertificateOrdersClient) Get(ctx context.Context, resourceGroupName string, certificateOrderName string, options *AppServiceCertificateOrdersGetOptions) (AppServiceCertificateOrdersGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, certificateOrderName, options) + if err != nil { + return AppServiceCertificateOrdersGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return AppServiceCertificateOrdersGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return AppServiceCertificateOrdersGetResponse{}, client.getHandleError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *AppServiceCertificateOrdersClient) getCreateRequest(ctx context.Context, resourceGroupName string, certificateOrderName string, options *AppServiceCertificateOrdersGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if certificateOrderName == "" { + return nil, errors.New("parameter certificateOrderName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{certificateOrderName}", url.PathEscape(certificateOrderName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *AppServiceCertificateOrdersClient) getHandleResponse(resp *http.Response) (AppServiceCertificateOrdersGetResponse, error) { + result := AppServiceCertificateOrdersGetResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.AppServiceCertificateOrder); err != nil { + return AppServiceCertificateOrdersGetResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getHandleError handles the Get error response. +func (client *AppServiceCertificateOrdersClient) getHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetCertificate - Description for Get the certificate associated with a certificate order. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *AppServiceCertificateOrdersClient) GetCertificate(ctx context.Context, resourceGroupName string, certificateOrderName string, name string, options *AppServiceCertificateOrdersGetCertificateOptions) (AppServiceCertificateOrdersGetCertificateResponse, error) { + req, err := client.getCertificateCreateRequest(ctx, resourceGroupName, certificateOrderName, name, options) + if err != nil { + return AppServiceCertificateOrdersGetCertificateResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return AppServiceCertificateOrdersGetCertificateResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return AppServiceCertificateOrdersGetCertificateResponse{}, client.getCertificateHandleError(resp) + } + return client.getCertificateHandleResponse(resp) +} + +// getCertificateCreateRequest creates the GetCertificate request. +func (client *AppServiceCertificateOrdersClient) getCertificateCreateRequest(ctx context.Context, resourceGroupName string, certificateOrderName string, name string, options *AppServiceCertificateOrdersGetCertificateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/certificates/{name}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if certificateOrderName == "" { + return nil, errors.New("parameter certificateOrderName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{certificateOrderName}", url.PathEscape(certificateOrderName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getCertificateHandleResponse handles the GetCertificate response. +func (client *AppServiceCertificateOrdersClient) getCertificateHandleResponse(resp *http.Response) (AppServiceCertificateOrdersGetCertificateResponse, error) { + result := AppServiceCertificateOrdersGetCertificateResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.AppServiceCertificateResource); err != nil { + return AppServiceCertificateOrdersGetCertificateResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getCertificateHandleError handles the GetCertificate error response. +func (client *AppServiceCertificateOrdersClient) getCertificateHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// List - Description for List all certificate orders in a subscription. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *AppServiceCertificateOrdersClient) List(options *AppServiceCertificateOrdersListOptions) *AppServiceCertificateOrdersListPager { + return &AppServiceCertificateOrdersListPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listCreateRequest(ctx, options) + }, + advancer: func(ctx context.Context, resp AppServiceCertificateOrdersListResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.AppServiceCertificateOrderCollection.NextLink) + }, + } +} + +// listCreateRequest creates the List request. +func (client *AppServiceCertificateOrdersClient) listCreateRequest(ctx context.Context, options *AppServiceCertificateOrdersListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.CertificateRegistration/certificateOrders" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listHandleResponse handles the List response. +func (client *AppServiceCertificateOrdersClient) listHandleResponse(resp *http.Response) (AppServiceCertificateOrdersListResponse, error) { + result := AppServiceCertificateOrdersListResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.AppServiceCertificateOrderCollection); err != nil { + return AppServiceCertificateOrdersListResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listHandleError handles the List error response. +func (client *AppServiceCertificateOrdersClient) listHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListByResourceGroup - Description for Get certificate orders in a resource group. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *AppServiceCertificateOrdersClient) ListByResourceGroup(resourceGroupName string, options *AppServiceCertificateOrdersListByResourceGroupOptions) *AppServiceCertificateOrdersListByResourceGroupPager { + return &AppServiceCertificateOrdersListByResourceGroupPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) + }, + advancer: func(ctx context.Context, resp AppServiceCertificateOrdersListByResourceGroupResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.AppServiceCertificateOrderCollection.NextLink) + }, + } +} + +// listByResourceGroupCreateRequest creates the ListByResourceGroup request. +func (client *AppServiceCertificateOrdersClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *AppServiceCertificateOrdersListByResourceGroupOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listByResourceGroupHandleResponse handles the ListByResourceGroup response. +func (client *AppServiceCertificateOrdersClient) listByResourceGroupHandleResponse(resp *http.Response) (AppServiceCertificateOrdersListByResourceGroupResponse, error) { + result := AppServiceCertificateOrdersListByResourceGroupResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.AppServiceCertificateOrderCollection); err != nil { + return AppServiceCertificateOrdersListByResourceGroupResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listByResourceGroupHandleError handles the ListByResourceGroup error response. +func (client *AppServiceCertificateOrdersClient) listByResourceGroupHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListCertificates - Description for List all certificates associated with a certificate order. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *AppServiceCertificateOrdersClient) ListCertificates(resourceGroupName string, certificateOrderName string, options *AppServiceCertificateOrdersListCertificatesOptions) *AppServiceCertificateOrdersListCertificatesPager { + return &AppServiceCertificateOrdersListCertificatesPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listCertificatesCreateRequest(ctx, resourceGroupName, certificateOrderName, options) + }, + advancer: func(ctx context.Context, resp AppServiceCertificateOrdersListCertificatesResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.AppServiceCertificateCollection.NextLink) + }, + } +} + +// listCertificatesCreateRequest creates the ListCertificates request. +func (client *AppServiceCertificateOrdersClient) listCertificatesCreateRequest(ctx context.Context, resourceGroupName string, certificateOrderName string, options *AppServiceCertificateOrdersListCertificatesOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/certificates" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if certificateOrderName == "" { + return nil, errors.New("parameter certificateOrderName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{certificateOrderName}", url.PathEscape(certificateOrderName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listCertificatesHandleResponse handles the ListCertificates response. +func (client *AppServiceCertificateOrdersClient) listCertificatesHandleResponse(resp *http.Response) (AppServiceCertificateOrdersListCertificatesResponse, error) { + result := AppServiceCertificateOrdersListCertificatesResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.AppServiceCertificateCollection); err != nil { + return AppServiceCertificateOrdersListCertificatesResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listCertificatesHandleError handles the ListCertificates error response. +func (client *AppServiceCertificateOrdersClient) listCertificatesHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// Reissue - Description for Reissue an existing certificate order. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *AppServiceCertificateOrdersClient) Reissue(ctx context.Context, resourceGroupName string, certificateOrderName string, reissueCertificateOrderRequest ReissueCertificateOrderRequest, options *AppServiceCertificateOrdersReissueOptions) (AppServiceCertificateOrdersReissueResponse, error) { + req, err := client.reissueCreateRequest(ctx, resourceGroupName, certificateOrderName, reissueCertificateOrderRequest, options) + if err != nil { + return AppServiceCertificateOrdersReissueResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return AppServiceCertificateOrdersReissueResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusNoContent) { + return AppServiceCertificateOrdersReissueResponse{}, client.reissueHandleError(resp) + } + return AppServiceCertificateOrdersReissueResponse{RawResponse: resp}, nil +} + +// reissueCreateRequest creates the Reissue request. +func (client *AppServiceCertificateOrdersClient) reissueCreateRequest(ctx context.Context, resourceGroupName string, certificateOrderName string, reissueCertificateOrderRequest ReissueCertificateOrderRequest, options *AppServiceCertificateOrdersReissueOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/reissue" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if certificateOrderName == "" { + return nil, errors.New("parameter certificateOrderName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{certificateOrderName}", url.PathEscape(certificateOrderName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, reissueCertificateOrderRequest) +} + +// reissueHandleError handles the Reissue error response. +func (client *AppServiceCertificateOrdersClient) reissueHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// Renew - Description for Renew an existing certificate order. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *AppServiceCertificateOrdersClient) Renew(ctx context.Context, resourceGroupName string, certificateOrderName string, renewCertificateOrderRequest RenewCertificateOrderRequest, options *AppServiceCertificateOrdersRenewOptions) (AppServiceCertificateOrdersRenewResponse, error) { + req, err := client.renewCreateRequest(ctx, resourceGroupName, certificateOrderName, renewCertificateOrderRequest, options) + if err != nil { + return AppServiceCertificateOrdersRenewResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return AppServiceCertificateOrdersRenewResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusNoContent) { + return AppServiceCertificateOrdersRenewResponse{}, client.renewHandleError(resp) + } + return AppServiceCertificateOrdersRenewResponse{RawResponse: resp}, nil +} + +// renewCreateRequest creates the Renew request. +func (client *AppServiceCertificateOrdersClient) renewCreateRequest(ctx context.Context, resourceGroupName string, certificateOrderName string, renewCertificateOrderRequest RenewCertificateOrderRequest, options *AppServiceCertificateOrdersRenewOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/renew" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if certificateOrderName == "" { + return nil, errors.New("parameter certificateOrderName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{certificateOrderName}", url.PathEscape(certificateOrderName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, renewCertificateOrderRequest) +} + +// renewHandleError handles the Renew error response. +func (client *AppServiceCertificateOrdersClient) renewHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ResendEmail - Description for Resend certificate email. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *AppServiceCertificateOrdersClient) ResendEmail(ctx context.Context, resourceGroupName string, certificateOrderName string, options *AppServiceCertificateOrdersResendEmailOptions) (AppServiceCertificateOrdersResendEmailResponse, error) { + req, err := client.resendEmailCreateRequest(ctx, resourceGroupName, certificateOrderName, options) + if err != nil { + return AppServiceCertificateOrdersResendEmailResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return AppServiceCertificateOrdersResendEmailResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusNoContent) { + return AppServiceCertificateOrdersResendEmailResponse{}, client.resendEmailHandleError(resp) + } + return AppServiceCertificateOrdersResendEmailResponse{RawResponse: resp}, nil +} + +// resendEmailCreateRequest creates the ResendEmail request. +func (client *AppServiceCertificateOrdersClient) resendEmailCreateRequest(ctx context.Context, resourceGroupName string, certificateOrderName string, options *AppServiceCertificateOrdersResendEmailOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/resendEmail" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if certificateOrderName == "" { + return nil, errors.New("parameter certificateOrderName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{certificateOrderName}", url.PathEscape(certificateOrderName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// resendEmailHandleError handles the ResendEmail error response. +func (client *AppServiceCertificateOrdersClient) resendEmailHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ResendRequestEmails - Resend domain verification ownership email containing steps on how to verify a domain for a given certificate order +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *AppServiceCertificateOrdersClient) ResendRequestEmails(ctx context.Context, resourceGroupName string, certificateOrderName string, nameIdentifier NameIdentifier, options *AppServiceCertificateOrdersResendRequestEmailsOptions) (AppServiceCertificateOrdersResendRequestEmailsResponse, error) { + req, err := client.resendRequestEmailsCreateRequest(ctx, resourceGroupName, certificateOrderName, nameIdentifier, options) + if err != nil { + return AppServiceCertificateOrdersResendRequestEmailsResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return AppServiceCertificateOrdersResendRequestEmailsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusNoContent) { + return AppServiceCertificateOrdersResendRequestEmailsResponse{}, client.resendRequestEmailsHandleError(resp) + } + return AppServiceCertificateOrdersResendRequestEmailsResponse{RawResponse: resp}, nil +} + +// resendRequestEmailsCreateRequest creates the ResendRequestEmails request. +func (client *AppServiceCertificateOrdersClient) resendRequestEmailsCreateRequest(ctx context.Context, resourceGroupName string, certificateOrderName string, nameIdentifier NameIdentifier, options *AppServiceCertificateOrdersResendRequestEmailsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/resendRequestEmails" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if certificateOrderName == "" { + return nil, errors.New("parameter certificateOrderName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{certificateOrderName}", url.PathEscape(certificateOrderName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, nameIdentifier) +} + +// resendRequestEmailsHandleError handles the ResendRequestEmails error response. +func (client *AppServiceCertificateOrdersClient) resendRequestEmailsHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// RetrieveCertificateActions - Description for Retrieve the list of certificate actions. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *AppServiceCertificateOrdersClient) RetrieveCertificateActions(ctx context.Context, resourceGroupName string, name string, options *AppServiceCertificateOrdersRetrieveCertificateActionsOptions) (AppServiceCertificateOrdersRetrieveCertificateActionsResponse, error) { + req, err := client.retrieveCertificateActionsCreateRequest(ctx, resourceGroupName, name, options) + if err != nil { + return AppServiceCertificateOrdersRetrieveCertificateActionsResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return AppServiceCertificateOrdersRetrieveCertificateActionsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return AppServiceCertificateOrdersRetrieveCertificateActionsResponse{}, client.retrieveCertificateActionsHandleError(resp) + } + return client.retrieveCertificateActionsHandleResponse(resp) +} + +// retrieveCertificateActionsCreateRequest creates the RetrieveCertificateActions request. +func (client *AppServiceCertificateOrdersClient) retrieveCertificateActionsCreateRequest(ctx context.Context, resourceGroupName string, name string, options *AppServiceCertificateOrdersRetrieveCertificateActionsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{name}/retrieveCertificateActions" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// retrieveCertificateActionsHandleResponse handles the RetrieveCertificateActions response. +func (client *AppServiceCertificateOrdersClient) retrieveCertificateActionsHandleResponse(resp *http.Response) (AppServiceCertificateOrdersRetrieveCertificateActionsResponse, error) { + result := AppServiceCertificateOrdersRetrieveCertificateActionsResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.CertificateOrderActionArray); err != nil { + return AppServiceCertificateOrdersRetrieveCertificateActionsResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// retrieveCertificateActionsHandleError handles the RetrieveCertificateActions error response. +func (client *AppServiceCertificateOrdersClient) retrieveCertificateActionsHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// RetrieveCertificateEmailHistory - Description for Retrieve email history. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *AppServiceCertificateOrdersClient) RetrieveCertificateEmailHistory(ctx context.Context, resourceGroupName string, name string, options *AppServiceCertificateOrdersRetrieveCertificateEmailHistoryOptions) (AppServiceCertificateOrdersRetrieveCertificateEmailHistoryResponse, error) { + req, err := client.retrieveCertificateEmailHistoryCreateRequest(ctx, resourceGroupName, name, options) + if err != nil { + return AppServiceCertificateOrdersRetrieveCertificateEmailHistoryResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return AppServiceCertificateOrdersRetrieveCertificateEmailHistoryResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return AppServiceCertificateOrdersRetrieveCertificateEmailHistoryResponse{}, client.retrieveCertificateEmailHistoryHandleError(resp) + } + return client.retrieveCertificateEmailHistoryHandleResponse(resp) +} + +// retrieveCertificateEmailHistoryCreateRequest creates the RetrieveCertificateEmailHistory request. +func (client *AppServiceCertificateOrdersClient) retrieveCertificateEmailHistoryCreateRequest(ctx context.Context, resourceGroupName string, name string, options *AppServiceCertificateOrdersRetrieveCertificateEmailHistoryOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{name}/retrieveEmailHistory" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// retrieveCertificateEmailHistoryHandleResponse handles the RetrieveCertificateEmailHistory response. +func (client *AppServiceCertificateOrdersClient) retrieveCertificateEmailHistoryHandleResponse(resp *http.Response) (AppServiceCertificateOrdersRetrieveCertificateEmailHistoryResponse, error) { + result := AppServiceCertificateOrdersRetrieveCertificateEmailHistoryResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.CertificateEmailArray); err != nil { + return AppServiceCertificateOrdersRetrieveCertificateEmailHistoryResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// retrieveCertificateEmailHistoryHandleError handles the RetrieveCertificateEmailHistory error response. +func (client *AppServiceCertificateOrdersClient) retrieveCertificateEmailHistoryHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// RetrieveSiteSeal - This method is used to obtain the site seal information for an issued certificate. A site seal is a graphic that the certificate purchaser +// can embed on their web site to show their visitors +// information about their SSL certificate. If a web site visitor clicks on the site seal image, a pop-up page is displayed that contains detailed information +// about the SSL certificate. The site seal +// token is used to link the site seal graphic image to the appropriate certificate details pop-up page display when a user clicks on the site seal. The +// site seal images are expected to be static images +// and hosted by the reseller, to minimize delays for customer page load times. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *AppServiceCertificateOrdersClient) RetrieveSiteSeal(ctx context.Context, resourceGroupName string, certificateOrderName string, siteSealRequest SiteSealRequest, options *AppServiceCertificateOrdersRetrieveSiteSealOptions) (AppServiceCertificateOrdersRetrieveSiteSealResponse, error) { + req, err := client.retrieveSiteSealCreateRequest(ctx, resourceGroupName, certificateOrderName, siteSealRequest, options) + if err != nil { + return AppServiceCertificateOrdersRetrieveSiteSealResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return AppServiceCertificateOrdersRetrieveSiteSealResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return AppServiceCertificateOrdersRetrieveSiteSealResponse{}, client.retrieveSiteSealHandleError(resp) + } + return client.retrieveSiteSealHandleResponse(resp) +} + +// retrieveSiteSealCreateRequest creates the RetrieveSiteSeal request. +func (client *AppServiceCertificateOrdersClient) retrieveSiteSealCreateRequest(ctx context.Context, resourceGroupName string, certificateOrderName string, siteSealRequest SiteSealRequest, options *AppServiceCertificateOrdersRetrieveSiteSealOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/retrieveSiteSeal" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if certificateOrderName == "" { + return nil, errors.New("parameter certificateOrderName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{certificateOrderName}", url.PathEscape(certificateOrderName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, siteSealRequest) +} + +// retrieveSiteSealHandleResponse handles the RetrieveSiteSeal response. +func (client *AppServiceCertificateOrdersClient) retrieveSiteSealHandleResponse(resp *http.Response) (AppServiceCertificateOrdersRetrieveSiteSealResponse, error) { + result := AppServiceCertificateOrdersRetrieveSiteSealResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.SiteSeal); err != nil { + return AppServiceCertificateOrdersRetrieveSiteSealResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// retrieveSiteSealHandleError handles the RetrieveSiteSeal error response. +func (client *AppServiceCertificateOrdersClient) retrieveSiteSealHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// Update - Description for Create or update a certificate purchase order. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *AppServiceCertificateOrdersClient) Update(ctx context.Context, resourceGroupName string, certificateOrderName string, certificateDistinguishedName AppServiceCertificateOrderPatchResource, options *AppServiceCertificateOrdersUpdateOptions) (AppServiceCertificateOrdersUpdateResponse, error) { + req, err := client.updateCreateRequest(ctx, resourceGroupName, certificateOrderName, certificateDistinguishedName, options) + if err != nil { + return AppServiceCertificateOrdersUpdateResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return AppServiceCertificateOrdersUpdateResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return AppServiceCertificateOrdersUpdateResponse{}, client.updateHandleError(resp) + } + return client.updateHandleResponse(resp) +} + +// updateCreateRequest creates the Update request. +func (client *AppServiceCertificateOrdersClient) updateCreateRequest(ctx context.Context, resourceGroupName string, certificateOrderName string, certificateDistinguishedName AppServiceCertificateOrderPatchResource, options *AppServiceCertificateOrdersUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if certificateOrderName == "" { + return nil, errors.New("parameter certificateOrderName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{certificateOrderName}", url.PathEscape(certificateOrderName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, certificateDistinguishedName) +} + +// updateHandleResponse handles the Update response. +func (client *AppServiceCertificateOrdersClient) updateHandleResponse(resp *http.Response) (AppServiceCertificateOrdersUpdateResponse, error) { + result := AppServiceCertificateOrdersUpdateResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.AppServiceCertificateOrder); err != nil { + return AppServiceCertificateOrdersUpdateResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// updateHandleError handles the Update error response. +func (client *AppServiceCertificateOrdersClient) updateHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// UpdateCertificate - Description for Creates or updates a certificate and associates with key vault secret. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *AppServiceCertificateOrdersClient) UpdateCertificate(ctx context.Context, resourceGroupName string, certificateOrderName string, name string, keyVaultCertificate AppServiceCertificatePatchResource, options *AppServiceCertificateOrdersUpdateCertificateOptions) (AppServiceCertificateOrdersUpdateCertificateResponse, error) { + req, err := client.updateCertificateCreateRequest(ctx, resourceGroupName, certificateOrderName, name, keyVaultCertificate, options) + if err != nil { + return AppServiceCertificateOrdersUpdateCertificateResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return AppServiceCertificateOrdersUpdateCertificateResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return AppServiceCertificateOrdersUpdateCertificateResponse{}, client.updateCertificateHandleError(resp) + } + return client.updateCertificateHandleResponse(resp) +} + +// updateCertificateCreateRequest creates the UpdateCertificate request. +func (client *AppServiceCertificateOrdersClient) updateCertificateCreateRequest(ctx context.Context, resourceGroupName string, certificateOrderName string, name string, keyVaultCertificate AppServiceCertificatePatchResource, options *AppServiceCertificateOrdersUpdateCertificateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/certificates/{name}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if certificateOrderName == "" { + return nil, errors.New("parameter certificateOrderName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{certificateOrderName}", url.PathEscape(certificateOrderName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, keyVaultCertificate) +} + +// updateCertificateHandleResponse handles the UpdateCertificate response. +func (client *AppServiceCertificateOrdersClient) updateCertificateHandleResponse(resp *http.Response) (AppServiceCertificateOrdersUpdateCertificateResponse, error) { + result := AppServiceCertificateOrdersUpdateCertificateResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.AppServiceCertificateResource); err != nil { + return AppServiceCertificateOrdersUpdateCertificateResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// updateCertificateHandleError handles the UpdateCertificate error response. +func (client *AppServiceCertificateOrdersClient) updateCertificateHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ValidatePurchaseInformation - Description for Validate information for a certificate order. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *AppServiceCertificateOrdersClient) ValidatePurchaseInformation(ctx context.Context, appServiceCertificateOrder AppServiceCertificateOrder, options *AppServiceCertificateOrdersValidatePurchaseInformationOptions) (AppServiceCertificateOrdersValidatePurchaseInformationResponse, error) { + req, err := client.validatePurchaseInformationCreateRequest(ctx, appServiceCertificateOrder, options) + if err != nil { + return AppServiceCertificateOrdersValidatePurchaseInformationResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return AppServiceCertificateOrdersValidatePurchaseInformationResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusNoContent) { + return AppServiceCertificateOrdersValidatePurchaseInformationResponse{}, client.validatePurchaseInformationHandleError(resp) + } + return AppServiceCertificateOrdersValidatePurchaseInformationResponse{RawResponse: resp}, nil +} + +// validatePurchaseInformationCreateRequest creates the ValidatePurchaseInformation request. +func (client *AppServiceCertificateOrdersClient) validatePurchaseInformationCreateRequest(ctx context.Context, appServiceCertificateOrder AppServiceCertificateOrder, options *AppServiceCertificateOrdersValidatePurchaseInformationOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.CertificateRegistration/validateCertificateRegistrationInformation" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, appServiceCertificateOrder) +} + +// validatePurchaseInformationHandleError handles the ValidatePurchaseInformation error response. +func (client *AppServiceCertificateOrdersClient) validatePurchaseInformationHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// VerifyDomainOwnership - Description for Verify domain ownership for this certificate order. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *AppServiceCertificateOrdersClient) VerifyDomainOwnership(ctx context.Context, resourceGroupName string, certificateOrderName string, options *AppServiceCertificateOrdersVerifyDomainOwnershipOptions) (AppServiceCertificateOrdersVerifyDomainOwnershipResponse, error) { + req, err := client.verifyDomainOwnershipCreateRequest(ctx, resourceGroupName, certificateOrderName, options) + if err != nil { + return AppServiceCertificateOrdersVerifyDomainOwnershipResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return AppServiceCertificateOrdersVerifyDomainOwnershipResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusNoContent) { + return AppServiceCertificateOrdersVerifyDomainOwnershipResponse{}, client.verifyDomainOwnershipHandleError(resp) + } + return AppServiceCertificateOrdersVerifyDomainOwnershipResponse{RawResponse: resp}, nil +} + +// verifyDomainOwnershipCreateRequest creates the VerifyDomainOwnership request. +func (client *AppServiceCertificateOrdersClient) verifyDomainOwnershipCreateRequest(ctx context.Context, resourceGroupName string, certificateOrderName string, options *AppServiceCertificateOrdersVerifyDomainOwnershipOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/verifyDomainOwnership" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if certificateOrderName == "" { + return nil, errors.New("parameter certificateOrderName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{certificateOrderName}", url.PathEscape(certificateOrderName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// verifyDomainOwnershipHandleError handles the VerifyDomainOwnership error response. +func (client *AppServiceCertificateOrdersClient) verifyDomainOwnershipHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} diff --git a/sdk/resourcemanager/appservice/armappservice/zz_generated_appserviceenvironments_client.go b/sdk/resourcemanager/appservice/armappservice/zz_generated_appserviceenvironments_client.go new file mode 100644 index 000000000000..40a9a1a8b155 --- /dev/null +++ b/sdk/resourcemanager/appservice/armappservice/zz_generated_appserviceenvironments_client.go @@ -0,0 +1,2953 @@ +//go:build go1.16 +// +build go1.16 + +// 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. + +package armappservice + +import ( + "context" + "errors" + "fmt" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strconv" + "strings" +) + +// AppServiceEnvironmentsClient contains the methods for the AppServiceEnvironments group. +// Don't use this type directly, use NewAppServiceEnvironmentsClient() instead. +type AppServiceEnvironmentsClient struct { + ep string + pl runtime.Pipeline + subscriptionID string +} + +// NewAppServiceEnvironmentsClient creates a new instance of AppServiceEnvironmentsClient with the specified values. +func NewAppServiceEnvironmentsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *AppServiceEnvironmentsClient { + cp := arm.ClientOptions{} + if options != nil { + cp = *options + } + if len(cp.Host) == 0 { + cp.Host = arm.AzurePublicCloud + } + return &AppServiceEnvironmentsClient{subscriptionID: subscriptionID, ep: string(cp.Host), pl: armruntime.NewPipeline(module, version, credential, &cp)} +} + +// BeginApproveOrRejectPrivateEndpointConnection - Description for Approves or rejects a private endpoint connection +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *AppServiceEnvironmentsClient) BeginApproveOrRejectPrivateEndpointConnection(ctx context.Context, resourceGroupName string, name string, privateEndpointConnectionName string, privateEndpointWrapper PrivateLinkConnectionApprovalRequestResource, options *AppServiceEnvironmentsBeginApproveOrRejectPrivateEndpointConnectionOptions) (AppServiceEnvironmentsApproveOrRejectPrivateEndpointConnectionPollerResponse, error) { + resp, err := client.approveOrRejectPrivateEndpointConnection(ctx, resourceGroupName, name, privateEndpointConnectionName, privateEndpointWrapper, options) + if err != nil { + return AppServiceEnvironmentsApproveOrRejectPrivateEndpointConnectionPollerResponse{}, err + } + result := AppServiceEnvironmentsApproveOrRejectPrivateEndpointConnectionPollerResponse{ + RawResponse: resp, + } + pt, err := armruntime.NewPoller("AppServiceEnvironmentsClient.ApproveOrRejectPrivateEndpointConnection", "", resp, client.pl, client.approveOrRejectPrivateEndpointConnectionHandleError) + if err != nil { + return AppServiceEnvironmentsApproveOrRejectPrivateEndpointConnectionPollerResponse{}, err + } + result.Poller = &AppServiceEnvironmentsApproveOrRejectPrivateEndpointConnectionPoller{ + pt: pt, + } + return result, nil +} + +// ApproveOrRejectPrivateEndpointConnection - Description for Approves or rejects a private endpoint connection +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *AppServiceEnvironmentsClient) approveOrRejectPrivateEndpointConnection(ctx context.Context, resourceGroupName string, name string, privateEndpointConnectionName string, privateEndpointWrapper PrivateLinkConnectionApprovalRequestResource, options *AppServiceEnvironmentsBeginApproveOrRejectPrivateEndpointConnectionOptions) (*http.Response, error) { + req, err := client.approveOrRejectPrivateEndpointConnectionCreateRequest(ctx, resourceGroupName, name, privateEndpointConnectionName, privateEndpointWrapper, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, client.approveOrRejectPrivateEndpointConnectionHandleError(resp) + } + return resp, nil +} + +// approveOrRejectPrivateEndpointConnectionCreateRequest creates the ApproveOrRejectPrivateEndpointConnection request. +func (client *AppServiceEnvironmentsClient) approveOrRejectPrivateEndpointConnectionCreateRequest(ctx context.Context, resourceGroupName string, name string, privateEndpointConnectionName string, privateEndpointWrapper PrivateLinkConnectionApprovalRequestResource, options *AppServiceEnvironmentsBeginApproveOrRejectPrivateEndpointConnectionOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/privateEndpointConnections/{privateEndpointConnectionName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if privateEndpointConnectionName == "" { + return nil, errors.New("parameter privateEndpointConnectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{privateEndpointConnectionName}", url.PathEscape(privateEndpointConnectionName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, privateEndpointWrapper) +} + +// approveOrRejectPrivateEndpointConnectionHandleError handles the ApproveOrRejectPrivateEndpointConnection error response. +func (client *AppServiceEnvironmentsClient) approveOrRejectPrivateEndpointConnectionHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// BeginChangeVnet - Description for Move an App Service Environment to a different VNET. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *AppServiceEnvironmentsClient) BeginChangeVnet(ctx context.Context, resourceGroupName string, name string, vnetInfo VirtualNetworkProfile, options *AppServiceEnvironmentsBeginChangeVnetOptions) (AppServiceEnvironmentsChangeVnetPollerResponse, error) { + resp, err := client.changeVnet(ctx, resourceGroupName, name, vnetInfo, options) + if err != nil { + return AppServiceEnvironmentsChangeVnetPollerResponse{}, err + } + result := AppServiceEnvironmentsChangeVnetPollerResponse{ + RawResponse: resp, + } + pt, err := armruntime.NewPoller("AppServiceEnvironmentsClient.ChangeVnet", "", resp, client.pl, client.changeVnetHandleError) + if err != nil { + return AppServiceEnvironmentsChangeVnetPollerResponse{}, err + } + result.Poller = &AppServiceEnvironmentsChangeVnetPoller{ + pt: pt, + client: client, + } + return result, nil +} + +// ChangeVnet - Description for Move an App Service Environment to a different VNET. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *AppServiceEnvironmentsClient) changeVnet(ctx context.Context, resourceGroupName string, name string, vnetInfo VirtualNetworkProfile, options *AppServiceEnvironmentsBeginChangeVnetOptions) (*http.Response, error) { + req, err := client.changeVnetCreateRequest(ctx, resourceGroupName, name, vnetInfo, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, client.changeVnetHandleError(resp) + } + return resp, nil +} + +// changeVnetCreateRequest creates the ChangeVnet request. +func (client *AppServiceEnvironmentsClient) changeVnetCreateRequest(ctx context.Context, resourceGroupName string, name string, vnetInfo VirtualNetworkProfile, options *AppServiceEnvironmentsBeginChangeVnetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/changeVirtualNetwork" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, vnetInfo) +} + +// changeVnetHandleResponse handles the ChangeVnet response. +func (client *AppServiceEnvironmentsClient) changeVnetHandleResponse(resp *http.Response) (AppServiceEnvironmentsChangeVnetResponse, error) { + result := AppServiceEnvironmentsChangeVnetResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.WebAppCollection); err != nil { + return AppServiceEnvironmentsChangeVnetResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// changeVnetHandleError handles the ChangeVnet error response. +func (client *AppServiceEnvironmentsClient) changeVnetHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// BeginCreateOrUpdate - Description for Create or update an App Service Environment. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *AppServiceEnvironmentsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, name string, hostingEnvironmentEnvelope AppServiceEnvironmentResource, options *AppServiceEnvironmentsBeginCreateOrUpdateOptions) (AppServiceEnvironmentsCreateOrUpdatePollerResponse, error) { + resp, err := client.createOrUpdate(ctx, resourceGroupName, name, hostingEnvironmentEnvelope, options) + if err != nil { + return AppServiceEnvironmentsCreateOrUpdatePollerResponse{}, err + } + result := AppServiceEnvironmentsCreateOrUpdatePollerResponse{ + RawResponse: resp, + } + pt, err := armruntime.NewPoller("AppServiceEnvironmentsClient.CreateOrUpdate", "", resp, client.pl, client.createOrUpdateHandleError) + if err != nil { + return AppServiceEnvironmentsCreateOrUpdatePollerResponse{}, err + } + result.Poller = &AppServiceEnvironmentsCreateOrUpdatePoller{ + pt: pt, + } + return result, nil +} + +// CreateOrUpdate - Description for Create or update an App Service Environment. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *AppServiceEnvironmentsClient) createOrUpdate(ctx context.Context, resourceGroupName string, name string, hostingEnvironmentEnvelope AppServiceEnvironmentResource, options *AppServiceEnvironmentsBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, name, hostingEnvironmentEnvelope, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { + return nil, client.createOrUpdateHandleError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *AppServiceEnvironmentsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, name string, hostingEnvironmentEnvelope AppServiceEnvironmentResource, options *AppServiceEnvironmentsBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, hostingEnvironmentEnvelope) +} + +// createOrUpdateHandleError handles the CreateOrUpdate error response. +func (client *AppServiceEnvironmentsClient) createOrUpdateHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// BeginCreateOrUpdateMultiRolePool - Description for Create or update a multi-role pool. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *AppServiceEnvironmentsClient) BeginCreateOrUpdateMultiRolePool(ctx context.Context, resourceGroupName string, name string, multiRolePoolEnvelope WorkerPoolResource, options *AppServiceEnvironmentsBeginCreateOrUpdateMultiRolePoolOptions) (AppServiceEnvironmentsCreateOrUpdateMultiRolePoolPollerResponse, error) { + resp, err := client.createOrUpdateMultiRolePool(ctx, resourceGroupName, name, multiRolePoolEnvelope, options) + if err != nil { + return AppServiceEnvironmentsCreateOrUpdateMultiRolePoolPollerResponse{}, err + } + result := AppServiceEnvironmentsCreateOrUpdateMultiRolePoolPollerResponse{ + RawResponse: resp, + } + pt, err := armruntime.NewPoller("AppServiceEnvironmentsClient.CreateOrUpdateMultiRolePool", "", resp, client.pl, client.createOrUpdateMultiRolePoolHandleError) + if err != nil { + return AppServiceEnvironmentsCreateOrUpdateMultiRolePoolPollerResponse{}, err + } + result.Poller = &AppServiceEnvironmentsCreateOrUpdateMultiRolePoolPoller{ + pt: pt, + } + return result, nil +} + +// CreateOrUpdateMultiRolePool - Description for Create or update a multi-role pool. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *AppServiceEnvironmentsClient) createOrUpdateMultiRolePool(ctx context.Context, resourceGroupName string, name string, multiRolePoolEnvelope WorkerPoolResource, options *AppServiceEnvironmentsBeginCreateOrUpdateMultiRolePoolOptions) (*http.Response, error) { + req, err := client.createOrUpdateMultiRolePoolCreateRequest(ctx, resourceGroupName, name, multiRolePoolEnvelope, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, client.createOrUpdateMultiRolePoolHandleError(resp) + } + return resp, nil +} + +// createOrUpdateMultiRolePoolCreateRequest creates the CreateOrUpdateMultiRolePool request. +func (client *AppServiceEnvironmentsClient) createOrUpdateMultiRolePoolCreateRequest(ctx context.Context, resourceGroupName string, name string, multiRolePoolEnvelope WorkerPoolResource, options *AppServiceEnvironmentsBeginCreateOrUpdateMultiRolePoolOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, multiRolePoolEnvelope) +} + +// createOrUpdateMultiRolePoolHandleError handles the CreateOrUpdateMultiRolePool error response. +func (client *AppServiceEnvironmentsClient) createOrUpdateMultiRolePoolHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// BeginCreateOrUpdateWorkerPool - Description for Create or update a worker pool. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *AppServiceEnvironmentsClient) BeginCreateOrUpdateWorkerPool(ctx context.Context, resourceGroupName string, name string, workerPoolName string, workerPoolEnvelope WorkerPoolResource, options *AppServiceEnvironmentsBeginCreateOrUpdateWorkerPoolOptions) (AppServiceEnvironmentsCreateOrUpdateWorkerPoolPollerResponse, error) { + resp, err := client.createOrUpdateWorkerPool(ctx, resourceGroupName, name, workerPoolName, workerPoolEnvelope, options) + if err != nil { + return AppServiceEnvironmentsCreateOrUpdateWorkerPoolPollerResponse{}, err + } + result := AppServiceEnvironmentsCreateOrUpdateWorkerPoolPollerResponse{ + RawResponse: resp, + } + pt, err := armruntime.NewPoller("AppServiceEnvironmentsClient.CreateOrUpdateWorkerPool", "", resp, client.pl, client.createOrUpdateWorkerPoolHandleError) + if err != nil { + return AppServiceEnvironmentsCreateOrUpdateWorkerPoolPollerResponse{}, err + } + result.Poller = &AppServiceEnvironmentsCreateOrUpdateWorkerPoolPoller{ + pt: pt, + } + return result, nil +} + +// CreateOrUpdateWorkerPool - Description for Create or update a worker pool. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *AppServiceEnvironmentsClient) createOrUpdateWorkerPool(ctx context.Context, resourceGroupName string, name string, workerPoolName string, workerPoolEnvelope WorkerPoolResource, options *AppServiceEnvironmentsBeginCreateOrUpdateWorkerPoolOptions) (*http.Response, error) { + req, err := client.createOrUpdateWorkerPoolCreateRequest(ctx, resourceGroupName, name, workerPoolName, workerPoolEnvelope, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, client.createOrUpdateWorkerPoolHandleError(resp) + } + return resp, nil +} + +// createOrUpdateWorkerPoolCreateRequest creates the CreateOrUpdateWorkerPool request. +func (client *AppServiceEnvironmentsClient) createOrUpdateWorkerPoolCreateRequest(ctx context.Context, resourceGroupName string, name string, workerPoolName string, workerPoolEnvelope WorkerPoolResource, options *AppServiceEnvironmentsBeginCreateOrUpdateWorkerPoolOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if workerPoolName == "" { + return nil, errors.New("parameter workerPoolName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workerPoolName}", url.PathEscape(workerPoolName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, workerPoolEnvelope) +} + +// createOrUpdateWorkerPoolHandleError handles the CreateOrUpdateWorkerPool error response. +func (client *AppServiceEnvironmentsClient) createOrUpdateWorkerPoolHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// BeginDelete - Description for Delete an App Service Environment. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *AppServiceEnvironmentsClient) BeginDelete(ctx context.Context, resourceGroupName string, name string, options *AppServiceEnvironmentsBeginDeleteOptions) (AppServiceEnvironmentsDeletePollerResponse, error) { + resp, err := client.deleteOperation(ctx, resourceGroupName, name, options) + if err != nil { + return AppServiceEnvironmentsDeletePollerResponse{}, err + } + result := AppServiceEnvironmentsDeletePollerResponse{ + RawResponse: resp, + } + pt, err := armruntime.NewPoller("AppServiceEnvironmentsClient.Delete", "", resp, client.pl, client.deleteHandleError) + if err != nil { + return AppServiceEnvironmentsDeletePollerResponse{}, err + } + result.Poller = &AppServiceEnvironmentsDeletePoller{ + pt: pt, + } + return result, nil +} + +// Delete - Description for Delete an App Service Environment. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *AppServiceEnvironmentsClient) deleteOperation(ctx context.Context, resourceGroupName string, name string, options *AppServiceEnvironmentsBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, name, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusAccepted, http.StatusNoContent) { + return nil, client.deleteHandleError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *AppServiceEnvironmentsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, name string, options *AppServiceEnvironmentsBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + if options != nil && options.ForceDelete != nil { + reqQP.Set("forceDelete", strconv.FormatBool(*options.ForceDelete)) + } + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// deleteHandleError handles the Delete error response. +func (client *AppServiceEnvironmentsClient) deleteHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// BeginDeletePrivateEndpointConnection - Description for Deletes a private endpoint connection +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *AppServiceEnvironmentsClient) BeginDeletePrivateEndpointConnection(ctx context.Context, resourceGroupName string, name string, privateEndpointConnectionName string, options *AppServiceEnvironmentsBeginDeletePrivateEndpointConnectionOptions) (AppServiceEnvironmentsDeletePrivateEndpointConnectionPollerResponse, error) { + resp, err := client.deletePrivateEndpointConnection(ctx, resourceGroupName, name, privateEndpointConnectionName, options) + if err != nil { + return AppServiceEnvironmentsDeletePrivateEndpointConnectionPollerResponse{}, err + } + result := AppServiceEnvironmentsDeletePrivateEndpointConnectionPollerResponse{ + RawResponse: resp, + } + pt, err := armruntime.NewPoller("AppServiceEnvironmentsClient.DeletePrivateEndpointConnection", "", resp, client.pl, client.deletePrivateEndpointConnectionHandleError) + if err != nil { + return AppServiceEnvironmentsDeletePrivateEndpointConnectionPollerResponse{}, err + } + result.Poller = &AppServiceEnvironmentsDeletePrivateEndpointConnectionPoller{ + pt: pt, + } + return result, nil +} + +// DeletePrivateEndpointConnection - Description for Deletes a private endpoint connection +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *AppServiceEnvironmentsClient) deletePrivateEndpointConnection(ctx context.Context, resourceGroupName string, name string, privateEndpointConnectionName string, options *AppServiceEnvironmentsBeginDeletePrivateEndpointConnectionOptions) (*http.Response, error) { + req, err := client.deletePrivateEndpointConnectionCreateRequest(ctx, resourceGroupName, name, privateEndpointConnectionName, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, client.deletePrivateEndpointConnectionHandleError(resp) + } + return resp, nil +} + +// deletePrivateEndpointConnectionCreateRequest creates the DeletePrivateEndpointConnection request. +func (client *AppServiceEnvironmentsClient) deletePrivateEndpointConnectionCreateRequest(ctx context.Context, resourceGroupName string, name string, privateEndpointConnectionName string, options *AppServiceEnvironmentsBeginDeletePrivateEndpointConnectionOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/privateEndpointConnections/{privateEndpointConnectionName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if privateEndpointConnectionName == "" { + return nil, errors.New("parameter privateEndpointConnectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{privateEndpointConnectionName}", url.PathEscape(privateEndpointConnectionName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// deletePrivateEndpointConnectionHandleError handles the DeletePrivateEndpointConnection error response. +func (client *AppServiceEnvironmentsClient) deletePrivateEndpointConnectionHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// Get - Description for Get the properties of an App Service Environment. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *AppServiceEnvironmentsClient) Get(ctx context.Context, resourceGroupName string, name string, options *AppServiceEnvironmentsGetOptions) (AppServiceEnvironmentsGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, name, options) + if err != nil { + return AppServiceEnvironmentsGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return AppServiceEnvironmentsGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return AppServiceEnvironmentsGetResponse{}, client.getHandleError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *AppServiceEnvironmentsClient) getCreateRequest(ctx context.Context, resourceGroupName string, name string, options *AppServiceEnvironmentsGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *AppServiceEnvironmentsClient) getHandleResponse(resp *http.Response) (AppServiceEnvironmentsGetResponse, error) { + result := AppServiceEnvironmentsGetResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.AppServiceEnvironmentResource); err != nil { + return AppServiceEnvironmentsGetResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getHandleError handles the Get error response. +func (client *AppServiceEnvironmentsClient) getHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetAseV3NetworkingConfiguration - Description for Get networking configuration of an App Service Environment +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *AppServiceEnvironmentsClient) GetAseV3NetworkingConfiguration(ctx context.Context, resourceGroupName string, name string, options *AppServiceEnvironmentsGetAseV3NetworkingConfigurationOptions) (AppServiceEnvironmentsGetAseV3NetworkingConfigurationResponse, error) { + req, err := client.getAseV3NetworkingConfigurationCreateRequest(ctx, resourceGroupName, name, options) + if err != nil { + return AppServiceEnvironmentsGetAseV3NetworkingConfigurationResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return AppServiceEnvironmentsGetAseV3NetworkingConfigurationResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return AppServiceEnvironmentsGetAseV3NetworkingConfigurationResponse{}, client.getAseV3NetworkingConfigurationHandleError(resp) + } + return client.getAseV3NetworkingConfigurationHandleResponse(resp) +} + +// getAseV3NetworkingConfigurationCreateRequest creates the GetAseV3NetworkingConfiguration request. +func (client *AppServiceEnvironmentsClient) getAseV3NetworkingConfigurationCreateRequest(ctx context.Context, resourceGroupName string, name string, options *AppServiceEnvironmentsGetAseV3NetworkingConfigurationOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/configurations/networking" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getAseV3NetworkingConfigurationHandleResponse handles the GetAseV3NetworkingConfiguration response. +func (client *AppServiceEnvironmentsClient) getAseV3NetworkingConfigurationHandleResponse(resp *http.Response) (AppServiceEnvironmentsGetAseV3NetworkingConfigurationResponse, error) { + result := AppServiceEnvironmentsGetAseV3NetworkingConfigurationResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.AseV3NetworkingConfiguration); err != nil { + return AppServiceEnvironmentsGetAseV3NetworkingConfigurationResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getAseV3NetworkingConfigurationHandleError handles the GetAseV3NetworkingConfiguration error response. +func (client *AppServiceEnvironmentsClient) getAseV3NetworkingConfigurationHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetDiagnosticsItem - Description for Get a diagnostics item for an App Service Environment. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *AppServiceEnvironmentsClient) GetDiagnosticsItem(ctx context.Context, resourceGroupName string, name string, diagnosticsName string, options *AppServiceEnvironmentsGetDiagnosticsItemOptions) (AppServiceEnvironmentsGetDiagnosticsItemResponse, error) { + req, err := client.getDiagnosticsItemCreateRequest(ctx, resourceGroupName, name, diagnosticsName, options) + if err != nil { + return AppServiceEnvironmentsGetDiagnosticsItemResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return AppServiceEnvironmentsGetDiagnosticsItemResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return AppServiceEnvironmentsGetDiagnosticsItemResponse{}, client.getDiagnosticsItemHandleError(resp) + } + return client.getDiagnosticsItemHandleResponse(resp) +} + +// getDiagnosticsItemCreateRequest creates the GetDiagnosticsItem request. +func (client *AppServiceEnvironmentsClient) getDiagnosticsItemCreateRequest(ctx context.Context, resourceGroupName string, name string, diagnosticsName string, options *AppServiceEnvironmentsGetDiagnosticsItemOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/diagnostics/{diagnosticsName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if diagnosticsName == "" { + return nil, errors.New("parameter diagnosticsName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{diagnosticsName}", url.PathEscape(diagnosticsName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getDiagnosticsItemHandleResponse handles the GetDiagnosticsItem response. +func (client *AppServiceEnvironmentsClient) getDiagnosticsItemHandleResponse(resp *http.Response) (AppServiceEnvironmentsGetDiagnosticsItemResponse, error) { + result := AppServiceEnvironmentsGetDiagnosticsItemResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.HostingEnvironmentDiagnostics); err != nil { + return AppServiceEnvironmentsGetDiagnosticsItemResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getDiagnosticsItemHandleError handles the GetDiagnosticsItem error response. +func (client *AppServiceEnvironmentsClient) getDiagnosticsItemHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetInboundNetworkDependenciesEndpoints - Description for Get the network endpoints of all inbound dependencies of an App Service Environment. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *AppServiceEnvironmentsClient) GetInboundNetworkDependenciesEndpoints(resourceGroupName string, name string, options *AppServiceEnvironmentsGetInboundNetworkDependenciesEndpointsOptions) *AppServiceEnvironmentsGetInboundNetworkDependenciesEndpointsPager { + return &AppServiceEnvironmentsGetInboundNetworkDependenciesEndpointsPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.getInboundNetworkDependenciesEndpointsCreateRequest(ctx, resourceGroupName, name, options) + }, + advancer: func(ctx context.Context, resp AppServiceEnvironmentsGetInboundNetworkDependenciesEndpointsResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.InboundEnvironmentEndpointCollection.NextLink) + }, + } +} + +// getInboundNetworkDependenciesEndpointsCreateRequest creates the GetInboundNetworkDependenciesEndpoints request. +func (client *AppServiceEnvironmentsClient) getInboundNetworkDependenciesEndpointsCreateRequest(ctx context.Context, resourceGroupName string, name string, options *AppServiceEnvironmentsGetInboundNetworkDependenciesEndpointsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/inboundNetworkDependenciesEndpoints" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getInboundNetworkDependenciesEndpointsHandleResponse handles the GetInboundNetworkDependenciesEndpoints response. +func (client *AppServiceEnvironmentsClient) getInboundNetworkDependenciesEndpointsHandleResponse(resp *http.Response) (AppServiceEnvironmentsGetInboundNetworkDependenciesEndpointsResponse, error) { + result := AppServiceEnvironmentsGetInboundNetworkDependenciesEndpointsResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.InboundEnvironmentEndpointCollection); err != nil { + return AppServiceEnvironmentsGetInboundNetworkDependenciesEndpointsResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getInboundNetworkDependenciesEndpointsHandleError handles the GetInboundNetworkDependenciesEndpoints error response. +func (client *AppServiceEnvironmentsClient) getInboundNetworkDependenciesEndpointsHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetMultiRolePool - Description for Get properties of a multi-role pool. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *AppServiceEnvironmentsClient) GetMultiRolePool(ctx context.Context, resourceGroupName string, name string, options *AppServiceEnvironmentsGetMultiRolePoolOptions) (AppServiceEnvironmentsGetMultiRolePoolResponse, error) { + req, err := client.getMultiRolePoolCreateRequest(ctx, resourceGroupName, name, options) + if err != nil { + return AppServiceEnvironmentsGetMultiRolePoolResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return AppServiceEnvironmentsGetMultiRolePoolResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return AppServiceEnvironmentsGetMultiRolePoolResponse{}, client.getMultiRolePoolHandleError(resp) + } + return client.getMultiRolePoolHandleResponse(resp) +} + +// getMultiRolePoolCreateRequest creates the GetMultiRolePool request. +func (client *AppServiceEnvironmentsClient) getMultiRolePoolCreateRequest(ctx context.Context, resourceGroupName string, name string, options *AppServiceEnvironmentsGetMultiRolePoolOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getMultiRolePoolHandleResponse handles the GetMultiRolePool response. +func (client *AppServiceEnvironmentsClient) getMultiRolePoolHandleResponse(resp *http.Response) (AppServiceEnvironmentsGetMultiRolePoolResponse, error) { + result := AppServiceEnvironmentsGetMultiRolePoolResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.WorkerPoolResource); err != nil { + return AppServiceEnvironmentsGetMultiRolePoolResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getMultiRolePoolHandleError handles the GetMultiRolePool error response. +func (client *AppServiceEnvironmentsClient) getMultiRolePoolHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetOutboundNetworkDependenciesEndpoints - Description for Get the network endpoints of all outbound dependencies of an App Service Environment. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *AppServiceEnvironmentsClient) GetOutboundNetworkDependenciesEndpoints(resourceGroupName string, name string, options *AppServiceEnvironmentsGetOutboundNetworkDependenciesEndpointsOptions) *AppServiceEnvironmentsGetOutboundNetworkDependenciesEndpointsPager { + return &AppServiceEnvironmentsGetOutboundNetworkDependenciesEndpointsPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.getOutboundNetworkDependenciesEndpointsCreateRequest(ctx, resourceGroupName, name, options) + }, + advancer: func(ctx context.Context, resp AppServiceEnvironmentsGetOutboundNetworkDependenciesEndpointsResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.OutboundEnvironmentEndpointCollection.NextLink) + }, + } +} + +// getOutboundNetworkDependenciesEndpointsCreateRequest creates the GetOutboundNetworkDependenciesEndpoints request. +func (client *AppServiceEnvironmentsClient) getOutboundNetworkDependenciesEndpointsCreateRequest(ctx context.Context, resourceGroupName string, name string, options *AppServiceEnvironmentsGetOutboundNetworkDependenciesEndpointsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/outboundNetworkDependenciesEndpoints" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getOutboundNetworkDependenciesEndpointsHandleResponse handles the GetOutboundNetworkDependenciesEndpoints response. +func (client *AppServiceEnvironmentsClient) getOutboundNetworkDependenciesEndpointsHandleResponse(resp *http.Response) (AppServiceEnvironmentsGetOutboundNetworkDependenciesEndpointsResponse, error) { + result := AppServiceEnvironmentsGetOutboundNetworkDependenciesEndpointsResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.OutboundEnvironmentEndpointCollection); err != nil { + return AppServiceEnvironmentsGetOutboundNetworkDependenciesEndpointsResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getOutboundNetworkDependenciesEndpointsHandleError handles the GetOutboundNetworkDependenciesEndpoints error response. +func (client *AppServiceEnvironmentsClient) getOutboundNetworkDependenciesEndpointsHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetPrivateEndpointConnection - Description for Gets a private endpoint connection +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *AppServiceEnvironmentsClient) GetPrivateEndpointConnection(ctx context.Context, resourceGroupName string, name string, privateEndpointConnectionName string, options *AppServiceEnvironmentsGetPrivateEndpointConnectionOptions) (AppServiceEnvironmentsGetPrivateEndpointConnectionResponse, error) { + req, err := client.getPrivateEndpointConnectionCreateRequest(ctx, resourceGroupName, name, privateEndpointConnectionName, options) + if err != nil { + return AppServiceEnvironmentsGetPrivateEndpointConnectionResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return AppServiceEnvironmentsGetPrivateEndpointConnectionResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return AppServiceEnvironmentsGetPrivateEndpointConnectionResponse{}, client.getPrivateEndpointConnectionHandleError(resp) + } + return client.getPrivateEndpointConnectionHandleResponse(resp) +} + +// getPrivateEndpointConnectionCreateRequest creates the GetPrivateEndpointConnection request. +func (client *AppServiceEnvironmentsClient) getPrivateEndpointConnectionCreateRequest(ctx context.Context, resourceGroupName string, name string, privateEndpointConnectionName string, options *AppServiceEnvironmentsGetPrivateEndpointConnectionOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/privateEndpointConnections/{privateEndpointConnectionName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if privateEndpointConnectionName == "" { + return nil, errors.New("parameter privateEndpointConnectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{privateEndpointConnectionName}", url.PathEscape(privateEndpointConnectionName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getPrivateEndpointConnectionHandleResponse handles the GetPrivateEndpointConnection response. +func (client *AppServiceEnvironmentsClient) getPrivateEndpointConnectionHandleResponse(resp *http.Response) (AppServiceEnvironmentsGetPrivateEndpointConnectionResponse, error) { + result := AppServiceEnvironmentsGetPrivateEndpointConnectionResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.RemotePrivateEndpointConnectionARMResource); err != nil { + return AppServiceEnvironmentsGetPrivateEndpointConnectionResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getPrivateEndpointConnectionHandleError handles the GetPrivateEndpointConnection error response. +func (client *AppServiceEnvironmentsClient) getPrivateEndpointConnectionHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetPrivateEndpointConnectionList - Description for Gets the list of private endpoints associated with a hosting environment +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *AppServiceEnvironmentsClient) GetPrivateEndpointConnectionList(resourceGroupName string, name string, options *AppServiceEnvironmentsGetPrivateEndpointConnectionListOptions) *AppServiceEnvironmentsGetPrivateEndpointConnectionListPager { + return &AppServiceEnvironmentsGetPrivateEndpointConnectionListPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.getPrivateEndpointConnectionListCreateRequest(ctx, resourceGroupName, name, options) + }, + advancer: func(ctx context.Context, resp AppServiceEnvironmentsGetPrivateEndpointConnectionListResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.PrivateEndpointConnectionCollection.NextLink) + }, + } +} + +// getPrivateEndpointConnectionListCreateRequest creates the GetPrivateEndpointConnectionList request. +func (client *AppServiceEnvironmentsClient) getPrivateEndpointConnectionListCreateRequest(ctx context.Context, resourceGroupName string, name string, options *AppServiceEnvironmentsGetPrivateEndpointConnectionListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/privateEndpointConnections" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getPrivateEndpointConnectionListHandleResponse handles the GetPrivateEndpointConnectionList response. +func (client *AppServiceEnvironmentsClient) getPrivateEndpointConnectionListHandleResponse(resp *http.Response) (AppServiceEnvironmentsGetPrivateEndpointConnectionListResponse, error) { + result := AppServiceEnvironmentsGetPrivateEndpointConnectionListResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.PrivateEndpointConnectionCollection); err != nil { + return AppServiceEnvironmentsGetPrivateEndpointConnectionListResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getPrivateEndpointConnectionListHandleError handles the GetPrivateEndpointConnectionList error response. +func (client *AppServiceEnvironmentsClient) getPrivateEndpointConnectionListHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetPrivateLinkResources - Description for Gets the private link resources +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *AppServiceEnvironmentsClient) GetPrivateLinkResources(ctx context.Context, resourceGroupName string, name string, options *AppServiceEnvironmentsGetPrivateLinkResourcesOptions) (AppServiceEnvironmentsGetPrivateLinkResourcesResponse, error) { + req, err := client.getPrivateLinkResourcesCreateRequest(ctx, resourceGroupName, name, options) + if err != nil { + return AppServiceEnvironmentsGetPrivateLinkResourcesResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return AppServiceEnvironmentsGetPrivateLinkResourcesResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return AppServiceEnvironmentsGetPrivateLinkResourcesResponse{}, client.getPrivateLinkResourcesHandleError(resp) + } + return client.getPrivateLinkResourcesHandleResponse(resp) +} + +// getPrivateLinkResourcesCreateRequest creates the GetPrivateLinkResources request. +func (client *AppServiceEnvironmentsClient) getPrivateLinkResourcesCreateRequest(ctx context.Context, resourceGroupName string, name string, options *AppServiceEnvironmentsGetPrivateLinkResourcesOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/privateLinkResources" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getPrivateLinkResourcesHandleResponse handles the GetPrivateLinkResources response. +func (client *AppServiceEnvironmentsClient) getPrivateLinkResourcesHandleResponse(resp *http.Response) (AppServiceEnvironmentsGetPrivateLinkResourcesResponse, error) { + result := AppServiceEnvironmentsGetPrivateLinkResourcesResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.PrivateLinkResourcesWrapper); err != nil { + return AppServiceEnvironmentsGetPrivateLinkResourcesResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getPrivateLinkResourcesHandleError handles the GetPrivateLinkResources error response. +func (client *AppServiceEnvironmentsClient) getPrivateLinkResourcesHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetVipInfo - Description for Get IP addresses assigned to an App Service Environment. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *AppServiceEnvironmentsClient) GetVipInfo(ctx context.Context, resourceGroupName string, name string, options *AppServiceEnvironmentsGetVipInfoOptions) (AppServiceEnvironmentsGetVipInfoResponse, error) { + req, err := client.getVipInfoCreateRequest(ctx, resourceGroupName, name, options) + if err != nil { + return AppServiceEnvironmentsGetVipInfoResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return AppServiceEnvironmentsGetVipInfoResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return AppServiceEnvironmentsGetVipInfoResponse{}, client.getVipInfoHandleError(resp) + } + return client.getVipInfoHandleResponse(resp) +} + +// getVipInfoCreateRequest creates the GetVipInfo request. +func (client *AppServiceEnvironmentsClient) getVipInfoCreateRequest(ctx context.Context, resourceGroupName string, name string, options *AppServiceEnvironmentsGetVipInfoOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/capacities/virtualip" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getVipInfoHandleResponse handles the GetVipInfo response. +func (client *AppServiceEnvironmentsClient) getVipInfoHandleResponse(resp *http.Response) (AppServiceEnvironmentsGetVipInfoResponse, error) { + result := AppServiceEnvironmentsGetVipInfoResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.AddressResponse); err != nil { + return AppServiceEnvironmentsGetVipInfoResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getVipInfoHandleError handles the GetVipInfo error response. +func (client *AppServiceEnvironmentsClient) getVipInfoHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetWorkerPool - Description for Get properties of a worker pool. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *AppServiceEnvironmentsClient) GetWorkerPool(ctx context.Context, resourceGroupName string, name string, workerPoolName string, options *AppServiceEnvironmentsGetWorkerPoolOptions) (AppServiceEnvironmentsGetWorkerPoolResponse, error) { + req, err := client.getWorkerPoolCreateRequest(ctx, resourceGroupName, name, workerPoolName, options) + if err != nil { + return AppServiceEnvironmentsGetWorkerPoolResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return AppServiceEnvironmentsGetWorkerPoolResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return AppServiceEnvironmentsGetWorkerPoolResponse{}, client.getWorkerPoolHandleError(resp) + } + return client.getWorkerPoolHandleResponse(resp) +} + +// getWorkerPoolCreateRequest creates the GetWorkerPool request. +func (client *AppServiceEnvironmentsClient) getWorkerPoolCreateRequest(ctx context.Context, resourceGroupName string, name string, workerPoolName string, options *AppServiceEnvironmentsGetWorkerPoolOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if workerPoolName == "" { + return nil, errors.New("parameter workerPoolName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workerPoolName}", url.PathEscape(workerPoolName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getWorkerPoolHandleResponse handles the GetWorkerPool response. +func (client *AppServiceEnvironmentsClient) getWorkerPoolHandleResponse(resp *http.Response) (AppServiceEnvironmentsGetWorkerPoolResponse, error) { + result := AppServiceEnvironmentsGetWorkerPoolResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.WorkerPoolResource); err != nil { + return AppServiceEnvironmentsGetWorkerPoolResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getWorkerPoolHandleError handles the GetWorkerPool error response. +func (client *AppServiceEnvironmentsClient) getWorkerPoolHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// List - Description for Get all App Service Environments for a subscription. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *AppServiceEnvironmentsClient) List(options *AppServiceEnvironmentsListOptions) *AppServiceEnvironmentsListPager { + return &AppServiceEnvironmentsListPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listCreateRequest(ctx, options) + }, + advancer: func(ctx context.Context, resp AppServiceEnvironmentsListResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.AppServiceEnvironmentCollection.NextLink) + }, + } +} + +// listCreateRequest creates the List request. +func (client *AppServiceEnvironmentsClient) listCreateRequest(ctx context.Context, options *AppServiceEnvironmentsListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Web/hostingEnvironments" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listHandleResponse handles the List response. +func (client *AppServiceEnvironmentsClient) listHandleResponse(resp *http.Response) (AppServiceEnvironmentsListResponse, error) { + result := AppServiceEnvironmentsListResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.AppServiceEnvironmentCollection); err != nil { + return AppServiceEnvironmentsListResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listHandleError handles the List error response. +func (client *AppServiceEnvironmentsClient) listHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListAppServicePlans - Description for Get all App Service plans in an App Service Environment. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *AppServiceEnvironmentsClient) ListAppServicePlans(resourceGroupName string, name string, options *AppServiceEnvironmentsListAppServicePlansOptions) *AppServiceEnvironmentsListAppServicePlansPager { + return &AppServiceEnvironmentsListAppServicePlansPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listAppServicePlansCreateRequest(ctx, resourceGroupName, name, options) + }, + advancer: func(ctx context.Context, resp AppServiceEnvironmentsListAppServicePlansResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.AppServicePlanCollection.NextLink) + }, + } +} + +// listAppServicePlansCreateRequest creates the ListAppServicePlans request. +func (client *AppServiceEnvironmentsClient) listAppServicePlansCreateRequest(ctx context.Context, resourceGroupName string, name string, options *AppServiceEnvironmentsListAppServicePlansOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/serverfarms" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listAppServicePlansHandleResponse handles the ListAppServicePlans response. +func (client *AppServiceEnvironmentsClient) listAppServicePlansHandleResponse(resp *http.Response) (AppServiceEnvironmentsListAppServicePlansResponse, error) { + result := AppServiceEnvironmentsListAppServicePlansResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.AppServicePlanCollection); err != nil { + return AppServiceEnvironmentsListAppServicePlansResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listAppServicePlansHandleError handles the ListAppServicePlans error response. +func (client *AppServiceEnvironmentsClient) listAppServicePlansHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListByResourceGroup - Description for Get all App Service Environments in a resource group. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *AppServiceEnvironmentsClient) ListByResourceGroup(resourceGroupName string, options *AppServiceEnvironmentsListByResourceGroupOptions) *AppServiceEnvironmentsListByResourceGroupPager { + return &AppServiceEnvironmentsListByResourceGroupPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) + }, + advancer: func(ctx context.Context, resp AppServiceEnvironmentsListByResourceGroupResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.AppServiceEnvironmentCollection.NextLink) + }, + } +} + +// listByResourceGroupCreateRequest creates the ListByResourceGroup request. +func (client *AppServiceEnvironmentsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *AppServiceEnvironmentsListByResourceGroupOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listByResourceGroupHandleResponse handles the ListByResourceGroup response. +func (client *AppServiceEnvironmentsClient) listByResourceGroupHandleResponse(resp *http.Response) (AppServiceEnvironmentsListByResourceGroupResponse, error) { + result := AppServiceEnvironmentsListByResourceGroupResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.AppServiceEnvironmentCollection); err != nil { + return AppServiceEnvironmentsListByResourceGroupResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listByResourceGroupHandleError handles the ListByResourceGroup error response. +func (client *AppServiceEnvironmentsClient) listByResourceGroupHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListCapacities - Description for Get the used, available, and total worker capacity an App Service Environment. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *AppServiceEnvironmentsClient) ListCapacities(resourceGroupName string, name string, options *AppServiceEnvironmentsListCapacitiesOptions) *AppServiceEnvironmentsListCapacitiesPager { + return &AppServiceEnvironmentsListCapacitiesPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listCapacitiesCreateRequest(ctx, resourceGroupName, name, options) + }, + advancer: func(ctx context.Context, resp AppServiceEnvironmentsListCapacitiesResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.StampCapacityCollection.NextLink) + }, + } +} + +// listCapacitiesCreateRequest creates the ListCapacities request. +func (client *AppServiceEnvironmentsClient) listCapacitiesCreateRequest(ctx context.Context, resourceGroupName string, name string, options *AppServiceEnvironmentsListCapacitiesOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/capacities/compute" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listCapacitiesHandleResponse handles the ListCapacities response. +func (client *AppServiceEnvironmentsClient) listCapacitiesHandleResponse(resp *http.Response) (AppServiceEnvironmentsListCapacitiesResponse, error) { + result := AppServiceEnvironmentsListCapacitiesResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.StampCapacityCollection); err != nil { + return AppServiceEnvironmentsListCapacitiesResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listCapacitiesHandleError handles the ListCapacities error response. +func (client *AppServiceEnvironmentsClient) listCapacitiesHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListDiagnostics - Description for Get diagnostic information for an App Service Environment. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *AppServiceEnvironmentsClient) ListDiagnostics(ctx context.Context, resourceGroupName string, name string, options *AppServiceEnvironmentsListDiagnosticsOptions) (AppServiceEnvironmentsListDiagnosticsResponse, error) { + req, err := client.listDiagnosticsCreateRequest(ctx, resourceGroupName, name, options) + if err != nil { + return AppServiceEnvironmentsListDiagnosticsResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return AppServiceEnvironmentsListDiagnosticsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return AppServiceEnvironmentsListDiagnosticsResponse{}, client.listDiagnosticsHandleError(resp) + } + return client.listDiagnosticsHandleResponse(resp) +} + +// listDiagnosticsCreateRequest creates the ListDiagnostics request. +func (client *AppServiceEnvironmentsClient) listDiagnosticsCreateRequest(ctx context.Context, resourceGroupName string, name string, options *AppServiceEnvironmentsListDiagnosticsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/diagnostics" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listDiagnosticsHandleResponse handles the ListDiagnostics response. +func (client *AppServiceEnvironmentsClient) listDiagnosticsHandleResponse(resp *http.Response) (AppServiceEnvironmentsListDiagnosticsResponse, error) { + result := AppServiceEnvironmentsListDiagnosticsResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.HostingEnvironmentDiagnosticsArray); err != nil { + return AppServiceEnvironmentsListDiagnosticsResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listDiagnosticsHandleError handles the ListDiagnostics error response. +func (client *AppServiceEnvironmentsClient) listDiagnosticsHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListMultiRoleMetricDefinitions - Description for Get metric definitions for a multi-role pool of an App Service Environment. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *AppServiceEnvironmentsClient) ListMultiRoleMetricDefinitions(resourceGroupName string, name string, options *AppServiceEnvironmentsListMultiRoleMetricDefinitionsOptions) *AppServiceEnvironmentsListMultiRoleMetricDefinitionsPager { + return &AppServiceEnvironmentsListMultiRoleMetricDefinitionsPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listMultiRoleMetricDefinitionsCreateRequest(ctx, resourceGroupName, name, options) + }, + advancer: func(ctx context.Context, resp AppServiceEnvironmentsListMultiRoleMetricDefinitionsResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.ResourceMetricDefinitionCollection.NextLink) + }, + } +} + +// listMultiRoleMetricDefinitionsCreateRequest creates the ListMultiRoleMetricDefinitions request. +func (client *AppServiceEnvironmentsClient) listMultiRoleMetricDefinitionsCreateRequest(ctx context.Context, resourceGroupName string, name string, options *AppServiceEnvironmentsListMultiRoleMetricDefinitionsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default/metricdefinitions" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listMultiRoleMetricDefinitionsHandleResponse handles the ListMultiRoleMetricDefinitions response. +func (client *AppServiceEnvironmentsClient) listMultiRoleMetricDefinitionsHandleResponse(resp *http.Response) (AppServiceEnvironmentsListMultiRoleMetricDefinitionsResponse, error) { + result := AppServiceEnvironmentsListMultiRoleMetricDefinitionsResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.ResourceMetricDefinitionCollection); err != nil { + return AppServiceEnvironmentsListMultiRoleMetricDefinitionsResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listMultiRoleMetricDefinitionsHandleError handles the ListMultiRoleMetricDefinitions error response. +func (client *AppServiceEnvironmentsClient) listMultiRoleMetricDefinitionsHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListMultiRolePoolInstanceMetricDefinitions - Description for Get metric definitions for a specific instance of a multi-role pool of an App Service Environment. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *AppServiceEnvironmentsClient) ListMultiRolePoolInstanceMetricDefinitions(resourceGroupName string, name string, instance string, options *AppServiceEnvironmentsListMultiRolePoolInstanceMetricDefinitionsOptions) *AppServiceEnvironmentsListMultiRolePoolInstanceMetricDefinitionsPager { + return &AppServiceEnvironmentsListMultiRolePoolInstanceMetricDefinitionsPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listMultiRolePoolInstanceMetricDefinitionsCreateRequest(ctx, resourceGroupName, name, instance, options) + }, + advancer: func(ctx context.Context, resp AppServiceEnvironmentsListMultiRolePoolInstanceMetricDefinitionsResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.ResourceMetricDefinitionCollection.NextLink) + }, + } +} + +// listMultiRolePoolInstanceMetricDefinitionsCreateRequest creates the ListMultiRolePoolInstanceMetricDefinitions request. +func (client *AppServiceEnvironmentsClient) listMultiRolePoolInstanceMetricDefinitionsCreateRequest(ctx context.Context, resourceGroupName string, name string, instance string, options *AppServiceEnvironmentsListMultiRolePoolInstanceMetricDefinitionsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default/instances/{instance}/metricdefinitions" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if instance == "" { + return nil, errors.New("parameter instance cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{instance}", url.PathEscape(instance)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listMultiRolePoolInstanceMetricDefinitionsHandleResponse handles the ListMultiRolePoolInstanceMetricDefinitions response. +func (client *AppServiceEnvironmentsClient) listMultiRolePoolInstanceMetricDefinitionsHandleResponse(resp *http.Response) (AppServiceEnvironmentsListMultiRolePoolInstanceMetricDefinitionsResponse, error) { + result := AppServiceEnvironmentsListMultiRolePoolInstanceMetricDefinitionsResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.ResourceMetricDefinitionCollection); err != nil { + return AppServiceEnvironmentsListMultiRolePoolInstanceMetricDefinitionsResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listMultiRolePoolInstanceMetricDefinitionsHandleError handles the ListMultiRolePoolInstanceMetricDefinitions error response. +func (client *AppServiceEnvironmentsClient) listMultiRolePoolInstanceMetricDefinitionsHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListMultiRolePoolSKUs - Description for Get available SKUs for scaling a multi-role pool. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *AppServiceEnvironmentsClient) ListMultiRolePoolSKUs(resourceGroupName string, name string, options *AppServiceEnvironmentsListMultiRolePoolSKUsOptions) *AppServiceEnvironmentsListMultiRolePoolSKUsPager { + return &AppServiceEnvironmentsListMultiRolePoolSKUsPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listMultiRolePoolSKUsCreateRequest(ctx, resourceGroupName, name, options) + }, + advancer: func(ctx context.Context, resp AppServiceEnvironmentsListMultiRolePoolSKUsResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.SKUInfoCollection.NextLink) + }, + } +} + +// listMultiRolePoolSKUsCreateRequest creates the ListMultiRolePoolSKUs request. +func (client *AppServiceEnvironmentsClient) listMultiRolePoolSKUsCreateRequest(ctx context.Context, resourceGroupName string, name string, options *AppServiceEnvironmentsListMultiRolePoolSKUsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default/skus" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listMultiRolePoolSKUsHandleResponse handles the ListMultiRolePoolSKUs response. +func (client *AppServiceEnvironmentsClient) listMultiRolePoolSKUsHandleResponse(resp *http.Response) (AppServiceEnvironmentsListMultiRolePoolSKUsResponse, error) { + result := AppServiceEnvironmentsListMultiRolePoolSKUsResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.SKUInfoCollection); err != nil { + return AppServiceEnvironmentsListMultiRolePoolSKUsResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listMultiRolePoolSKUsHandleError handles the ListMultiRolePoolSKUs error response. +func (client *AppServiceEnvironmentsClient) listMultiRolePoolSKUsHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListMultiRolePools - Description for Get all multi-role pools. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *AppServiceEnvironmentsClient) ListMultiRolePools(resourceGroupName string, name string, options *AppServiceEnvironmentsListMultiRolePoolsOptions) *AppServiceEnvironmentsListMultiRolePoolsPager { + return &AppServiceEnvironmentsListMultiRolePoolsPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listMultiRolePoolsCreateRequest(ctx, resourceGroupName, name, options) + }, + advancer: func(ctx context.Context, resp AppServiceEnvironmentsListMultiRolePoolsResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.WorkerPoolCollection.NextLink) + }, + } +} + +// listMultiRolePoolsCreateRequest creates the ListMultiRolePools request. +func (client *AppServiceEnvironmentsClient) listMultiRolePoolsCreateRequest(ctx context.Context, resourceGroupName string, name string, options *AppServiceEnvironmentsListMultiRolePoolsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listMultiRolePoolsHandleResponse handles the ListMultiRolePools response. +func (client *AppServiceEnvironmentsClient) listMultiRolePoolsHandleResponse(resp *http.Response) (AppServiceEnvironmentsListMultiRolePoolsResponse, error) { + result := AppServiceEnvironmentsListMultiRolePoolsResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.WorkerPoolCollection); err != nil { + return AppServiceEnvironmentsListMultiRolePoolsResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listMultiRolePoolsHandleError handles the ListMultiRolePools error response. +func (client *AppServiceEnvironmentsClient) listMultiRolePoolsHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListMultiRoleUsages - Description for Get usage metrics for a multi-role pool of an App Service Environment. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *AppServiceEnvironmentsClient) ListMultiRoleUsages(resourceGroupName string, name string, options *AppServiceEnvironmentsListMultiRoleUsagesOptions) *AppServiceEnvironmentsListMultiRoleUsagesPager { + return &AppServiceEnvironmentsListMultiRoleUsagesPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listMultiRoleUsagesCreateRequest(ctx, resourceGroupName, name, options) + }, + advancer: func(ctx context.Context, resp AppServiceEnvironmentsListMultiRoleUsagesResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.UsageCollection.NextLink) + }, + } +} + +// listMultiRoleUsagesCreateRequest creates the ListMultiRoleUsages request. +func (client *AppServiceEnvironmentsClient) listMultiRoleUsagesCreateRequest(ctx context.Context, resourceGroupName string, name string, options *AppServiceEnvironmentsListMultiRoleUsagesOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default/usages" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listMultiRoleUsagesHandleResponse handles the ListMultiRoleUsages response. +func (client *AppServiceEnvironmentsClient) listMultiRoleUsagesHandleResponse(resp *http.Response) (AppServiceEnvironmentsListMultiRoleUsagesResponse, error) { + result := AppServiceEnvironmentsListMultiRoleUsagesResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.UsageCollection); err != nil { + return AppServiceEnvironmentsListMultiRoleUsagesResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listMultiRoleUsagesHandleError handles the ListMultiRoleUsages error response. +func (client *AppServiceEnvironmentsClient) listMultiRoleUsagesHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListOperations - Description for List all currently running operations on the App Service Environment. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *AppServiceEnvironmentsClient) ListOperations(ctx context.Context, resourceGroupName string, name string, options *AppServiceEnvironmentsListOperationsOptions) (AppServiceEnvironmentsListOperationsResponse, error) { + req, err := client.listOperationsCreateRequest(ctx, resourceGroupName, name, options) + if err != nil { + return AppServiceEnvironmentsListOperationsResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return AppServiceEnvironmentsListOperationsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return AppServiceEnvironmentsListOperationsResponse{}, client.listOperationsHandleError(resp) + } + return client.listOperationsHandleResponse(resp) +} + +// listOperationsCreateRequest creates the ListOperations request. +func (client *AppServiceEnvironmentsClient) listOperationsCreateRequest(ctx context.Context, resourceGroupName string, name string, options *AppServiceEnvironmentsListOperationsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/operations" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listOperationsHandleResponse handles the ListOperations response. +func (client *AppServiceEnvironmentsClient) listOperationsHandleResponse(resp *http.Response) (AppServiceEnvironmentsListOperationsResponse, error) { + result := AppServiceEnvironmentsListOperationsResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.OperationArray); err != nil { + return AppServiceEnvironmentsListOperationsResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listOperationsHandleError handles the ListOperations error response. +func (client *AppServiceEnvironmentsClient) listOperationsHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListUsages - Description for Get global usage metrics of an App Service Environment. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *AppServiceEnvironmentsClient) ListUsages(resourceGroupName string, name string, options *AppServiceEnvironmentsListUsagesOptions) *AppServiceEnvironmentsListUsagesPager { + return &AppServiceEnvironmentsListUsagesPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listUsagesCreateRequest(ctx, resourceGroupName, name, options) + }, + advancer: func(ctx context.Context, resp AppServiceEnvironmentsListUsagesResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.CsmUsageQuotaCollection.NextLink) + }, + } +} + +// listUsagesCreateRequest creates the ListUsages request. +func (client *AppServiceEnvironmentsClient) listUsagesCreateRequest(ctx context.Context, resourceGroupName string, name string, options *AppServiceEnvironmentsListUsagesOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/usages" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + unencodedParams := []string{req.Raw().URL.RawQuery} + if options != nil && options.Filter != nil { + unencodedParams = append(unencodedParams, "$filter="+*options.Filter) + } + req.Raw().URL.RawQuery = strings.Join(unencodedParams, "&") + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listUsagesHandleResponse handles the ListUsages response. +func (client *AppServiceEnvironmentsClient) listUsagesHandleResponse(resp *http.Response) (AppServiceEnvironmentsListUsagesResponse, error) { + result := AppServiceEnvironmentsListUsagesResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.CsmUsageQuotaCollection); err != nil { + return AppServiceEnvironmentsListUsagesResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listUsagesHandleError handles the ListUsages error response. +func (client *AppServiceEnvironmentsClient) listUsagesHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListWebApps - Description for Get all apps in an App Service Environment. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *AppServiceEnvironmentsClient) ListWebApps(resourceGroupName string, name string, options *AppServiceEnvironmentsListWebAppsOptions) *AppServiceEnvironmentsListWebAppsPager { + return &AppServiceEnvironmentsListWebAppsPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listWebAppsCreateRequest(ctx, resourceGroupName, name, options) + }, + advancer: func(ctx context.Context, resp AppServiceEnvironmentsListWebAppsResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.WebAppCollection.NextLink) + }, + } +} + +// listWebAppsCreateRequest creates the ListWebApps request. +func (client *AppServiceEnvironmentsClient) listWebAppsCreateRequest(ctx context.Context, resourceGroupName string, name string, options *AppServiceEnvironmentsListWebAppsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/sites" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + if options != nil && options.PropertiesToInclude != nil { + reqQP.Set("propertiesToInclude", *options.PropertiesToInclude) + } + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listWebAppsHandleResponse handles the ListWebApps response. +func (client *AppServiceEnvironmentsClient) listWebAppsHandleResponse(resp *http.Response) (AppServiceEnvironmentsListWebAppsResponse, error) { + result := AppServiceEnvironmentsListWebAppsResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.WebAppCollection); err != nil { + return AppServiceEnvironmentsListWebAppsResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listWebAppsHandleError handles the ListWebApps error response. +func (client *AppServiceEnvironmentsClient) listWebAppsHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListWebWorkerMetricDefinitions - Description for Get metric definitions for a worker pool of an App Service Environment. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *AppServiceEnvironmentsClient) ListWebWorkerMetricDefinitions(resourceGroupName string, name string, workerPoolName string, options *AppServiceEnvironmentsListWebWorkerMetricDefinitionsOptions) *AppServiceEnvironmentsListWebWorkerMetricDefinitionsPager { + return &AppServiceEnvironmentsListWebWorkerMetricDefinitionsPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listWebWorkerMetricDefinitionsCreateRequest(ctx, resourceGroupName, name, workerPoolName, options) + }, + advancer: func(ctx context.Context, resp AppServiceEnvironmentsListWebWorkerMetricDefinitionsResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.ResourceMetricDefinitionCollection.NextLink) + }, + } +} + +// listWebWorkerMetricDefinitionsCreateRequest creates the ListWebWorkerMetricDefinitions request. +func (client *AppServiceEnvironmentsClient) listWebWorkerMetricDefinitionsCreateRequest(ctx context.Context, resourceGroupName string, name string, workerPoolName string, options *AppServiceEnvironmentsListWebWorkerMetricDefinitionsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}/metricdefinitions" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if workerPoolName == "" { + return nil, errors.New("parameter workerPoolName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workerPoolName}", url.PathEscape(workerPoolName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listWebWorkerMetricDefinitionsHandleResponse handles the ListWebWorkerMetricDefinitions response. +func (client *AppServiceEnvironmentsClient) listWebWorkerMetricDefinitionsHandleResponse(resp *http.Response) (AppServiceEnvironmentsListWebWorkerMetricDefinitionsResponse, error) { + result := AppServiceEnvironmentsListWebWorkerMetricDefinitionsResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.ResourceMetricDefinitionCollection); err != nil { + return AppServiceEnvironmentsListWebWorkerMetricDefinitionsResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listWebWorkerMetricDefinitionsHandleError handles the ListWebWorkerMetricDefinitions error response. +func (client *AppServiceEnvironmentsClient) listWebWorkerMetricDefinitionsHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListWebWorkerUsages - Description for Get usage metrics for a worker pool of an App Service Environment. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *AppServiceEnvironmentsClient) ListWebWorkerUsages(resourceGroupName string, name string, workerPoolName string, options *AppServiceEnvironmentsListWebWorkerUsagesOptions) *AppServiceEnvironmentsListWebWorkerUsagesPager { + return &AppServiceEnvironmentsListWebWorkerUsagesPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listWebWorkerUsagesCreateRequest(ctx, resourceGroupName, name, workerPoolName, options) + }, + advancer: func(ctx context.Context, resp AppServiceEnvironmentsListWebWorkerUsagesResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.UsageCollection.NextLink) + }, + } +} + +// listWebWorkerUsagesCreateRequest creates the ListWebWorkerUsages request. +func (client *AppServiceEnvironmentsClient) listWebWorkerUsagesCreateRequest(ctx context.Context, resourceGroupName string, name string, workerPoolName string, options *AppServiceEnvironmentsListWebWorkerUsagesOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}/usages" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if workerPoolName == "" { + return nil, errors.New("parameter workerPoolName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workerPoolName}", url.PathEscape(workerPoolName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listWebWorkerUsagesHandleResponse handles the ListWebWorkerUsages response. +func (client *AppServiceEnvironmentsClient) listWebWorkerUsagesHandleResponse(resp *http.Response) (AppServiceEnvironmentsListWebWorkerUsagesResponse, error) { + result := AppServiceEnvironmentsListWebWorkerUsagesResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.UsageCollection); err != nil { + return AppServiceEnvironmentsListWebWorkerUsagesResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listWebWorkerUsagesHandleError handles the ListWebWorkerUsages error response. +func (client *AppServiceEnvironmentsClient) listWebWorkerUsagesHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListWorkerPoolInstanceMetricDefinitions - Description for Get metric definitions for a specific instance of a worker pool of an App Service Environment. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *AppServiceEnvironmentsClient) ListWorkerPoolInstanceMetricDefinitions(resourceGroupName string, name string, workerPoolName string, instance string, options *AppServiceEnvironmentsListWorkerPoolInstanceMetricDefinitionsOptions) *AppServiceEnvironmentsListWorkerPoolInstanceMetricDefinitionsPager { + return &AppServiceEnvironmentsListWorkerPoolInstanceMetricDefinitionsPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listWorkerPoolInstanceMetricDefinitionsCreateRequest(ctx, resourceGroupName, name, workerPoolName, instance, options) + }, + advancer: func(ctx context.Context, resp AppServiceEnvironmentsListWorkerPoolInstanceMetricDefinitionsResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.ResourceMetricDefinitionCollection.NextLink) + }, + } +} + +// listWorkerPoolInstanceMetricDefinitionsCreateRequest creates the ListWorkerPoolInstanceMetricDefinitions request. +func (client *AppServiceEnvironmentsClient) listWorkerPoolInstanceMetricDefinitionsCreateRequest(ctx context.Context, resourceGroupName string, name string, workerPoolName string, instance string, options *AppServiceEnvironmentsListWorkerPoolInstanceMetricDefinitionsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}/instances/{instance}/metricdefinitions" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if workerPoolName == "" { + return nil, errors.New("parameter workerPoolName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workerPoolName}", url.PathEscape(workerPoolName)) + if instance == "" { + return nil, errors.New("parameter instance cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{instance}", url.PathEscape(instance)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listWorkerPoolInstanceMetricDefinitionsHandleResponse handles the ListWorkerPoolInstanceMetricDefinitions response. +func (client *AppServiceEnvironmentsClient) listWorkerPoolInstanceMetricDefinitionsHandleResponse(resp *http.Response) (AppServiceEnvironmentsListWorkerPoolInstanceMetricDefinitionsResponse, error) { + result := AppServiceEnvironmentsListWorkerPoolInstanceMetricDefinitionsResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.ResourceMetricDefinitionCollection); err != nil { + return AppServiceEnvironmentsListWorkerPoolInstanceMetricDefinitionsResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listWorkerPoolInstanceMetricDefinitionsHandleError handles the ListWorkerPoolInstanceMetricDefinitions error response. +func (client *AppServiceEnvironmentsClient) listWorkerPoolInstanceMetricDefinitionsHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListWorkerPoolSKUs - Description for Get available SKUs for scaling a worker pool. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *AppServiceEnvironmentsClient) ListWorkerPoolSKUs(resourceGroupName string, name string, workerPoolName string, options *AppServiceEnvironmentsListWorkerPoolSKUsOptions) *AppServiceEnvironmentsListWorkerPoolSKUsPager { + return &AppServiceEnvironmentsListWorkerPoolSKUsPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listWorkerPoolSKUsCreateRequest(ctx, resourceGroupName, name, workerPoolName, options) + }, + advancer: func(ctx context.Context, resp AppServiceEnvironmentsListWorkerPoolSKUsResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.SKUInfoCollection.NextLink) + }, + } +} + +// listWorkerPoolSKUsCreateRequest creates the ListWorkerPoolSKUs request. +func (client *AppServiceEnvironmentsClient) listWorkerPoolSKUsCreateRequest(ctx context.Context, resourceGroupName string, name string, workerPoolName string, options *AppServiceEnvironmentsListWorkerPoolSKUsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}/skus" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if workerPoolName == "" { + return nil, errors.New("parameter workerPoolName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workerPoolName}", url.PathEscape(workerPoolName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listWorkerPoolSKUsHandleResponse handles the ListWorkerPoolSKUs response. +func (client *AppServiceEnvironmentsClient) listWorkerPoolSKUsHandleResponse(resp *http.Response) (AppServiceEnvironmentsListWorkerPoolSKUsResponse, error) { + result := AppServiceEnvironmentsListWorkerPoolSKUsResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.SKUInfoCollection); err != nil { + return AppServiceEnvironmentsListWorkerPoolSKUsResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listWorkerPoolSKUsHandleError handles the ListWorkerPoolSKUs error response. +func (client *AppServiceEnvironmentsClient) listWorkerPoolSKUsHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListWorkerPools - Description for Get all worker pools of an App Service Environment. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *AppServiceEnvironmentsClient) ListWorkerPools(resourceGroupName string, name string, options *AppServiceEnvironmentsListWorkerPoolsOptions) *AppServiceEnvironmentsListWorkerPoolsPager { + return &AppServiceEnvironmentsListWorkerPoolsPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listWorkerPoolsCreateRequest(ctx, resourceGroupName, name, options) + }, + advancer: func(ctx context.Context, resp AppServiceEnvironmentsListWorkerPoolsResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.WorkerPoolCollection.NextLink) + }, + } +} + +// listWorkerPoolsCreateRequest creates the ListWorkerPools request. +func (client *AppServiceEnvironmentsClient) listWorkerPoolsCreateRequest(ctx context.Context, resourceGroupName string, name string, options *AppServiceEnvironmentsListWorkerPoolsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listWorkerPoolsHandleResponse handles the ListWorkerPools response. +func (client *AppServiceEnvironmentsClient) listWorkerPoolsHandleResponse(resp *http.Response) (AppServiceEnvironmentsListWorkerPoolsResponse, error) { + result := AppServiceEnvironmentsListWorkerPoolsResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.WorkerPoolCollection); err != nil { + return AppServiceEnvironmentsListWorkerPoolsResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listWorkerPoolsHandleError handles the ListWorkerPools error response. +func (client *AppServiceEnvironmentsClient) listWorkerPoolsHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// Reboot - Description for Reboot all machines in an App Service Environment. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *AppServiceEnvironmentsClient) Reboot(ctx context.Context, resourceGroupName string, name string, options *AppServiceEnvironmentsRebootOptions) (AppServiceEnvironmentsRebootResponse, error) { + req, err := client.rebootCreateRequest(ctx, resourceGroupName, name, options) + if err != nil { + return AppServiceEnvironmentsRebootResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return AppServiceEnvironmentsRebootResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusAccepted) { + return AppServiceEnvironmentsRebootResponse{}, client.rebootHandleError(resp) + } + return AppServiceEnvironmentsRebootResponse{RawResponse: resp}, nil +} + +// rebootCreateRequest creates the Reboot request. +func (client *AppServiceEnvironmentsClient) rebootCreateRequest(ctx context.Context, resourceGroupName string, name string, options *AppServiceEnvironmentsRebootOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/reboot" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// rebootHandleError handles the Reboot error response. +func (client *AppServiceEnvironmentsClient) rebootHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// BeginResume - Description for Resume an App Service Environment. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *AppServiceEnvironmentsClient) BeginResume(ctx context.Context, resourceGroupName string, name string, options *AppServiceEnvironmentsBeginResumeOptions) (AppServiceEnvironmentsResumePollerResponse, error) { + resp, err := client.resume(ctx, resourceGroupName, name, options) + if err != nil { + return AppServiceEnvironmentsResumePollerResponse{}, err + } + result := AppServiceEnvironmentsResumePollerResponse{ + RawResponse: resp, + } + pt, err := armruntime.NewPoller("AppServiceEnvironmentsClient.Resume", "", resp, client.pl, client.resumeHandleError) + if err != nil { + return AppServiceEnvironmentsResumePollerResponse{}, err + } + result.Poller = &AppServiceEnvironmentsResumePoller{ + pt: pt, + client: client, + } + return result, nil +} + +// Resume - Description for Resume an App Service Environment. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *AppServiceEnvironmentsClient) resume(ctx context.Context, resourceGroupName string, name string, options *AppServiceEnvironmentsBeginResumeOptions) (*http.Response, error) { + req, err := client.resumeCreateRequest(ctx, resourceGroupName, name, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, client.resumeHandleError(resp) + } + return resp, nil +} + +// resumeCreateRequest creates the Resume request. +func (client *AppServiceEnvironmentsClient) resumeCreateRequest(ctx context.Context, resourceGroupName string, name string, options *AppServiceEnvironmentsBeginResumeOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/resume" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// resumeHandleResponse handles the Resume response. +func (client *AppServiceEnvironmentsClient) resumeHandleResponse(resp *http.Response) (AppServiceEnvironmentsResumeResponse, error) { + result := AppServiceEnvironmentsResumeResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.WebAppCollection); err != nil { + return AppServiceEnvironmentsResumeResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// resumeHandleError handles the Resume error response. +func (client *AppServiceEnvironmentsClient) resumeHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// BeginSuspend - Description for Suspend an App Service Environment. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *AppServiceEnvironmentsClient) BeginSuspend(ctx context.Context, resourceGroupName string, name string, options *AppServiceEnvironmentsBeginSuspendOptions) (AppServiceEnvironmentsSuspendPollerResponse, error) { + resp, err := client.suspend(ctx, resourceGroupName, name, options) + if err != nil { + return AppServiceEnvironmentsSuspendPollerResponse{}, err + } + result := AppServiceEnvironmentsSuspendPollerResponse{ + RawResponse: resp, + } + pt, err := armruntime.NewPoller("AppServiceEnvironmentsClient.Suspend", "", resp, client.pl, client.suspendHandleError) + if err != nil { + return AppServiceEnvironmentsSuspendPollerResponse{}, err + } + result.Poller = &AppServiceEnvironmentsSuspendPoller{ + pt: pt, + client: client, + } + return result, nil +} + +// Suspend - Description for Suspend an App Service Environment. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *AppServiceEnvironmentsClient) suspend(ctx context.Context, resourceGroupName string, name string, options *AppServiceEnvironmentsBeginSuspendOptions) (*http.Response, error) { + req, err := client.suspendCreateRequest(ctx, resourceGroupName, name, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, client.suspendHandleError(resp) + } + return resp, nil +} + +// suspendCreateRequest creates the Suspend request. +func (client *AppServiceEnvironmentsClient) suspendCreateRequest(ctx context.Context, resourceGroupName string, name string, options *AppServiceEnvironmentsBeginSuspendOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/suspend" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// suspendHandleResponse handles the Suspend response. +func (client *AppServiceEnvironmentsClient) suspendHandleResponse(resp *http.Response) (AppServiceEnvironmentsSuspendResponse, error) { + result := AppServiceEnvironmentsSuspendResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.WebAppCollection); err != nil { + return AppServiceEnvironmentsSuspendResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// suspendHandleError handles the Suspend error response. +func (client *AppServiceEnvironmentsClient) suspendHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// Update - Description for Create or update an App Service Environment. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *AppServiceEnvironmentsClient) Update(ctx context.Context, resourceGroupName string, name string, hostingEnvironmentEnvelope AppServiceEnvironmentPatchResource, options *AppServiceEnvironmentsUpdateOptions) (AppServiceEnvironmentsUpdateResponse, error) { + req, err := client.updateCreateRequest(ctx, resourceGroupName, name, hostingEnvironmentEnvelope, options) + if err != nil { + return AppServiceEnvironmentsUpdateResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return AppServiceEnvironmentsUpdateResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { + return AppServiceEnvironmentsUpdateResponse{}, client.updateHandleError(resp) + } + return client.updateHandleResponse(resp) +} + +// updateCreateRequest creates the Update request. +func (client *AppServiceEnvironmentsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, name string, hostingEnvironmentEnvelope AppServiceEnvironmentPatchResource, options *AppServiceEnvironmentsUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, hostingEnvironmentEnvelope) +} + +// updateHandleResponse handles the Update response. +func (client *AppServiceEnvironmentsClient) updateHandleResponse(resp *http.Response) (AppServiceEnvironmentsUpdateResponse, error) { + result := AppServiceEnvironmentsUpdateResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.AppServiceEnvironmentResource); err != nil { + return AppServiceEnvironmentsUpdateResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// updateHandleError handles the Update error response. +func (client *AppServiceEnvironmentsClient) updateHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// UpdateAseNetworkingConfiguration - Description for Update networking configuration of an App Service Environment +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *AppServiceEnvironmentsClient) UpdateAseNetworkingConfiguration(ctx context.Context, resourceGroupName string, name string, aseNetworkingConfiguration AseV3NetworkingConfiguration, options *AppServiceEnvironmentsUpdateAseNetworkingConfigurationOptions) (AppServiceEnvironmentsUpdateAseNetworkingConfigurationResponse, error) { + req, err := client.updateAseNetworkingConfigurationCreateRequest(ctx, resourceGroupName, name, aseNetworkingConfiguration, options) + if err != nil { + return AppServiceEnvironmentsUpdateAseNetworkingConfigurationResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return AppServiceEnvironmentsUpdateAseNetworkingConfigurationResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return AppServiceEnvironmentsUpdateAseNetworkingConfigurationResponse{}, client.updateAseNetworkingConfigurationHandleError(resp) + } + return client.updateAseNetworkingConfigurationHandleResponse(resp) +} + +// updateAseNetworkingConfigurationCreateRequest creates the UpdateAseNetworkingConfiguration request. +func (client *AppServiceEnvironmentsClient) updateAseNetworkingConfigurationCreateRequest(ctx context.Context, resourceGroupName string, name string, aseNetworkingConfiguration AseV3NetworkingConfiguration, options *AppServiceEnvironmentsUpdateAseNetworkingConfigurationOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/configurations/networking" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, aseNetworkingConfiguration) +} + +// updateAseNetworkingConfigurationHandleResponse handles the UpdateAseNetworkingConfiguration response. +func (client *AppServiceEnvironmentsClient) updateAseNetworkingConfigurationHandleResponse(resp *http.Response) (AppServiceEnvironmentsUpdateAseNetworkingConfigurationResponse, error) { + result := AppServiceEnvironmentsUpdateAseNetworkingConfigurationResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.AseV3NetworkingConfiguration); err != nil { + return AppServiceEnvironmentsUpdateAseNetworkingConfigurationResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// updateAseNetworkingConfigurationHandleError handles the UpdateAseNetworkingConfiguration error response. +func (client *AppServiceEnvironmentsClient) updateAseNetworkingConfigurationHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// UpdateMultiRolePool - Description for Create or update a multi-role pool. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *AppServiceEnvironmentsClient) UpdateMultiRolePool(ctx context.Context, resourceGroupName string, name string, multiRolePoolEnvelope WorkerPoolResource, options *AppServiceEnvironmentsUpdateMultiRolePoolOptions) (AppServiceEnvironmentsUpdateMultiRolePoolResponse, error) { + req, err := client.updateMultiRolePoolCreateRequest(ctx, resourceGroupName, name, multiRolePoolEnvelope, options) + if err != nil { + return AppServiceEnvironmentsUpdateMultiRolePoolResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return AppServiceEnvironmentsUpdateMultiRolePoolResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return AppServiceEnvironmentsUpdateMultiRolePoolResponse{}, client.updateMultiRolePoolHandleError(resp) + } + return client.updateMultiRolePoolHandleResponse(resp) +} + +// updateMultiRolePoolCreateRequest creates the UpdateMultiRolePool request. +func (client *AppServiceEnvironmentsClient) updateMultiRolePoolCreateRequest(ctx context.Context, resourceGroupName string, name string, multiRolePoolEnvelope WorkerPoolResource, options *AppServiceEnvironmentsUpdateMultiRolePoolOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, multiRolePoolEnvelope) +} + +// updateMultiRolePoolHandleResponse handles the UpdateMultiRolePool response. +func (client *AppServiceEnvironmentsClient) updateMultiRolePoolHandleResponse(resp *http.Response) (AppServiceEnvironmentsUpdateMultiRolePoolResponse, error) { + result := AppServiceEnvironmentsUpdateMultiRolePoolResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.WorkerPoolResource); err != nil { + return AppServiceEnvironmentsUpdateMultiRolePoolResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// updateMultiRolePoolHandleError handles the UpdateMultiRolePool error response. +func (client *AppServiceEnvironmentsClient) updateMultiRolePoolHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// UpdateWorkerPool - Description for Create or update a worker pool. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *AppServiceEnvironmentsClient) UpdateWorkerPool(ctx context.Context, resourceGroupName string, name string, workerPoolName string, workerPoolEnvelope WorkerPoolResource, options *AppServiceEnvironmentsUpdateWorkerPoolOptions) (AppServiceEnvironmentsUpdateWorkerPoolResponse, error) { + req, err := client.updateWorkerPoolCreateRequest(ctx, resourceGroupName, name, workerPoolName, workerPoolEnvelope, options) + if err != nil { + return AppServiceEnvironmentsUpdateWorkerPoolResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return AppServiceEnvironmentsUpdateWorkerPoolResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return AppServiceEnvironmentsUpdateWorkerPoolResponse{}, client.updateWorkerPoolHandleError(resp) + } + return client.updateWorkerPoolHandleResponse(resp) +} + +// updateWorkerPoolCreateRequest creates the UpdateWorkerPool request. +func (client *AppServiceEnvironmentsClient) updateWorkerPoolCreateRequest(ctx context.Context, resourceGroupName string, name string, workerPoolName string, workerPoolEnvelope WorkerPoolResource, options *AppServiceEnvironmentsUpdateWorkerPoolOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if workerPoolName == "" { + return nil, errors.New("parameter workerPoolName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workerPoolName}", url.PathEscape(workerPoolName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, workerPoolEnvelope) +} + +// updateWorkerPoolHandleResponse handles the UpdateWorkerPool response. +func (client *AppServiceEnvironmentsClient) updateWorkerPoolHandleResponse(resp *http.Response) (AppServiceEnvironmentsUpdateWorkerPoolResponse, error) { + result := AppServiceEnvironmentsUpdateWorkerPoolResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.WorkerPoolResource); err != nil { + return AppServiceEnvironmentsUpdateWorkerPoolResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// updateWorkerPoolHandleError handles the UpdateWorkerPool error response. +func (client *AppServiceEnvironmentsClient) updateWorkerPoolHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} diff --git a/sdk/resourcemanager/appservice/armappservice/zz_generated_appserviceplans_client.go b/sdk/resourcemanager/appservice/armappservice/zz_generated_appserviceplans_client.go new file mode 100644 index 000000000000..716cae4235c3 --- /dev/null +++ b/sdk/resourcemanager/appservice/armappservice/zz_generated_appserviceplans_client.go @@ -0,0 +1,1897 @@ +//go:build go1.16 +// +build go1.16 + +// 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. + +package armappservice + +import ( + "context" + "errors" + "fmt" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strconv" + "strings" +) + +// AppServicePlansClient contains the methods for the AppServicePlans group. +// Don't use this type directly, use NewAppServicePlansClient() instead. +type AppServicePlansClient struct { + ep string + pl runtime.Pipeline + subscriptionID string +} + +// NewAppServicePlansClient creates a new instance of AppServicePlansClient with the specified values. +func NewAppServicePlansClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *AppServicePlansClient { + cp := arm.ClientOptions{} + if options != nil { + cp = *options + } + if len(cp.Host) == 0 { + cp.Host = arm.AzurePublicCloud + } + return &AppServicePlansClient{subscriptionID: subscriptionID, ep: string(cp.Host), pl: armruntime.NewPipeline(module, version, credential, &cp)} +} + +// BeginCreateOrUpdate - Description for Creates or updates an App Service Plan. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *AppServicePlansClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, name string, appServicePlan AppServicePlan, options *AppServicePlansBeginCreateOrUpdateOptions) (AppServicePlansCreateOrUpdatePollerResponse, error) { + resp, err := client.createOrUpdate(ctx, resourceGroupName, name, appServicePlan, options) + if err != nil { + return AppServicePlansCreateOrUpdatePollerResponse{}, err + } + result := AppServicePlansCreateOrUpdatePollerResponse{ + RawResponse: resp, + } + pt, err := armruntime.NewPoller("AppServicePlansClient.CreateOrUpdate", "", resp, client.pl, client.createOrUpdateHandleError) + if err != nil { + return AppServicePlansCreateOrUpdatePollerResponse{}, err + } + result.Poller = &AppServicePlansCreateOrUpdatePoller{ + pt: pt, + } + return result, nil +} + +// CreateOrUpdate - Description for Creates or updates an App Service Plan. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *AppServicePlansClient) createOrUpdate(ctx context.Context, resourceGroupName string, name string, appServicePlan AppServicePlan, options *AppServicePlansBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, name, appServicePlan, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, client.createOrUpdateHandleError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *AppServicePlansClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, name string, appServicePlan AppServicePlan, options *AppServicePlansBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, appServicePlan) +} + +// createOrUpdateHandleError handles the CreateOrUpdate error response. +func (client *AppServicePlansClient) createOrUpdateHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// CreateOrUpdateVnetRoute - Description for Create or update a Virtual Network route in an App Service plan. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *AppServicePlansClient) CreateOrUpdateVnetRoute(ctx context.Context, resourceGroupName string, name string, vnetName string, routeName string, route VnetRoute, options *AppServicePlansCreateOrUpdateVnetRouteOptions) (AppServicePlansCreateOrUpdateVnetRouteResponse, error) { + req, err := client.createOrUpdateVnetRouteCreateRequest(ctx, resourceGroupName, name, vnetName, routeName, route, options) + if err != nil { + return AppServicePlansCreateOrUpdateVnetRouteResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return AppServicePlansCreateOrUpdateVnetRouteResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return AppServicePlansCreateOrUpdateVnetRouteResponse{}, client.createOrUpdateVnetRouteHandleError(resp) + } + return client.createOrUpdateVnetRouteHandleResponse(resp) +} + +// createOrUpdateVnetRouteCreateRequest creates the CreateOrUpdateVnetRoute request. +func (client *AppServicePlansClient) createOrUpdateVnetRouteCreateRequest(ctx context.Context, resourceGroupName string, name string, vnetName string, routeName string, route VnetRoute, options *AppServicePlansCreateOrUpdateVnetRouteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/routes/{routeName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if vnetName == "" { + return nil, errors.New("parameter vnetName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{vnetName}", url.PathEscape(vnetName)) + if routeName == "" { + return nil, errors.New("parameter routeName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{routeName}", url.PathEscape(routeName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, route) +} + +// createOrUpdateVnetRouteHandleResponse handles the CreateOrUpdateVnetRoute response. +func (client *AppServicePlansClient) createOrUpdateVnetRouteHandleResponse(resp *http.Response) (AppServicePlansCreateOrUpdateVnetRouteResponse, error) { + result := AppServicePlansCreateOrUpdateVnetRouteResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.VnetRoute); err != nil { + return AppServicePlansCreateOrUpdateVnetRouteResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// createOrUpdateVnetRouteHandleError handles the CreateOrUpdateVnetRoute error response. +func (client *AppServicePlansClient) createOrUpdateVnetRouteHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + switch resp.StatusCode { + case http.StatusBadRequest, http.StatusNotFound: + if len(body) == 0 { + return runtime.NewResponseError(errors.New(resp.Status), resp) + } + return runtime.NewResponseError(errors.New(string(body)), resp) + default: + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) + } +} + +// Delete - Description for Delete an App Service plan. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *AppServicePlansClient) Delete(ctx context.Context, resourceGroupName string, name string, options *AppServicePlansDeleteOptions) (AppServicePlansDeleteResponse, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, name, options) + if err != nil { + return AppServicePlansDeleteResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return AppServicePlansDeleteResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { + return AppServicePlansDeleteResponse{}, client.deleteHandleError(resp) + } + return AppServicePlansDeleteResponse{RawResponse: resp}, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *AppServicePlansClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, name string, options *AppServicePlansDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// deleteHandleError handles the Delete error response. +func (client *AppServicePlansClient) deleteHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// DeleteHybridConnection - Description for Delete a Hybrid Connection in use in an App Service plan. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *AppServicePlansClient) DeleteHybridConnection(ctx context.Context, resourceGroupName string, name string, namespaceName string, relayName string, options *AppServicePlansDeleteHybridConnectionOptions) (AppServicePlansDeleteHybridConnectionResponse, error) { + req, err := client.deleteHybridConnectionCreateRequest(ctx, resourceGroupName, name, namespaceName, relayName, options) + if err != nil { + return AppServicePlansDeleteHybridConnectionResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return AppServicePlansDeleteHybridConnectionResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { + return AppServicePlansDeleteHybridConnectionResponse{}, client.deleteHybridConnectionHandleError(resp) + } + return AppServicePlansDeleteHybridConnectionResponse{RawResponse: resp}, nil +} + +// deleteHybridConnectionCreateRequest creates the DeleteHybridConnection request. +func (client *AppServicePlansClient) deleteHybridConnectionCreateRequest(ctx context.Context, resourceGroupName string, name string, namespaceName string, relayName string, options *AppServicePlansDeleteHybridConnectionOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if namespaceName == "" { + return nil, errors.New("parameter namespaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{namespaceName}", url.PathEscape(namespaceName)) + if relayName == "" { + return nil, errors.New("parameter relayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{relayName}", url.PathEscape(relayName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// deleteHybridConnectionHandleError handles the DeleteHybridConnection error response. +func (client *AppServicePlansClient) deleteHybridConnectionHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// DeleteVnetRoute - Description for Delete a Virtual Network route in an App Service plan. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *AppServicePlansClient) DeleteVnetRoute(ctx context.Context, resourceGroupName string, name string, vnetName string, routeName string, options *AppServicePlansDeleteVnetRouteOptions) (AppServicePlansDeleteVnetRouteResponse, error) { + req, err := client.deleteVnetRouteCreateRequest(ctx, resourceGroupName, name, vnetName, routeName, options) + if err != nil { + return AppServicePlansDeleteVnetRouteResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return AppServicePlansDeleteVnetRouteResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return AppServicePlansDeleteVnetRouteResponse{}, client.deleteVnetRouteHandleError(resp) + } + return AppServicePlansDeleteVnetRouteResponse{RawResponse: resp}, nil +} + +// deleteVnetRouteCreateRequest creates the DeleteVnetRoute request. +func (client *AppServicePlansClient) deleteVnetRouteCreateRequest(ctx context.Context, resourceGroupName string, name string, vnetName string, routeName string, options *AppServicePlansDeleteVnetRouteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/routes/{routeName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if vnetName == "" { + return nil, errors.New("parameter vnetName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{vnetName}", url.PathEscape(vnetName)) + if routeName == "" { + return nil, errors.New("parameter routeName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{routeName}", url.PathEscape(routeName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// deleteVnetRouteHandleError handles the DeleteVnetRoute error response. +func (client *AppServicePlansClient) deleteVnetRouteHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + switch resp.StatusCode { + case http.StatusNotFound: + if len(body) == 0 { + return runtime.NewResponseError(errors.New(resp.Status), resp) + } + return runtime.NewResponseError(errors.New(string(body)), resp) + default: + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) + } +} + +// Get - Description for Get an App Service plan. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *AppServicePlansClient) Get(ctx context.Context, resourceGroupName string, name string, options *AppServicePlansGetOptions) (AppServicePlansGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, name, options) + if err != nil { + return AppServicePlansGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return AppServicePlansGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return AppServicePlansGetResponse{}, client.getHandleError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *AppServicePlansClient) getCreateRequest(ctx context.Context, resourceGroupName string, name string, options *AppServicePlansGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *AppServicePlansClient) getHandleResponse(resp *http.Response) (AppServicePlansGetResponse, error) { + result := AppServicePlansGetResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.AppServicePlan); err != nil { + return AppServicePlansGetResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getHandleError handles the Get error response. +func (client *AppServicePlansClient) getHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + switch resp.StatusCode { + case http.StatusNotFound: + if len(body) == 0 { + return runtime.NewResponseError(errors.New(resp.Status), resp) + } + return runtime.NewResponseError(errors.New(string(body)), resp) + default: + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) + } +} + +// GetHybridConnection - Description for Retrieve a Hybrid Connection in use in an App Service plan. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *AppServicePlansClient) GetHybridConnection(ctx context.Context, resourceGroupName string, name string, namespaceName string, relayName string, options *AppServicePlansGetHybridConnectionOptions) (AppServicePlansGetHybridConnectionResponse, error) { + req, err := client.getHybridConnectionCreateRequest(ctx, resourceGroupName, name, namespaceName, relayName, options) + if err != nil { + return AppServicePlansGetHybridConnectionResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return AppServicePlansGetHybridConnectionResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return AppServicePlansGetHybridConnectionResponse{}, client.getHybridConnectionHandleError(resp) + } + return client.getHybridConnectionHandleResponse(resp) +} + +// getHybridConnectionCreateRequest creates the GetHybridConnection request. +func (client *AppServicePlansClient) getHybridConnectionCreateRequest(ctx context.Context, resourceGroupName string, name string, namespaceName string, relayName string, options *AppServicePlansGetHybridConnectionOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if namespaceName == "" { + return nil, errors.New("parameter namespaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{namespaceName}", url.PathEscape(namespaceName)) + if relayName == "" { + return nil, errors.New("parameter relayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{relayName}", url.PathEscape(relayName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getHybridConnectionHandleResponse handles the GetHybridConnection response. +func (client *AppServicePlansClient) getHybridConnectionHandleResponse(resp *http.Response) (AppServicePlansGetHybridConnectionResponse, error) { + result := AppServicePlansGetHybridConnectionResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.HybridConnection); err != nil { + return AppServicePlansGetHybridConnectionResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getHybridConnectionHandleError handles the GetHybridConnection error response. +func (client *AppServicePlansClient) getHybridConnectionHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetHybridConnectionPlanLimit - Description for Get the maximum number of Hybrid Connections allowed in an App Service plan. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *AppServicePlansClient) GetHybridConnectionPlanLimit(ctx context.Context, resourceGroupName string, name string, options *AppServicePlansGetHybridConnectionPlanLimitOptions) (AppServicePlansGetHybridConnectionPlanLimitResponse, error) { + req, err := client.getHybridConnectionPlanLimitCreateRequest(ctx, resourceGroupName, name, options) + if err != nil { + return AppServicePlansGetHybridConnectionPlanLimitResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return AppServicePlansGetHybridConnectionPlanLimitResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return AppServicePlansGetHybridConnectionPlanLimitResponse{}, client.getHybridConnectionPlanLimitHandleError(resp) + } + return client.getHybridConnectionPlanLimitHandleResponse(resp) +} + +// getHybridConnectionPlanLimitCreateRequest creates the GetHybridConnectionPlanLimit request. +func (client *AppServicePlansClient) getHybridConnectionPlanLimitCreateRequest(ctx context.Context, resourceGroupName string, name string, options *AppServicePlansGetHybridConnectionPlanLimitOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/hybridConnectionPlanLimits/limit" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getHybridConnectionPlanLimitHandleResponse handles the GetHybridConnectionPlanLimit response. +func (client *AppServicePlansClient) getHybridConnectionPlanLimitHandleResponse(resp *http.Response) (AppServicePlansGetHybridConnectionPlanLimitResponse, error) { + result := AppServicePlansGetHybridConnectionPlanLimitResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.HybridConnectionLimits); err != nil { + return AppServicePlansGetHybridConnectionPlanLimitResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getHybridConnectionPlanLimitHandleError handles the GetHybridConnectionPlanLimit error response. +func (client *AppServicePlansClient) getHybridConnectionPlanLimitHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetRouteForVnet - Description for Get a Virtual Network route in an App Service plan. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *AppServicePlansClient) GetRouteForVnet(ctx context.Context, resourceGroupName string, name string, vnetName string, routeName string, options *AppServicePlansGetRouteForVnetOptions) (AppServicePlansGetRouteForVnetResponse, error) { + req, err := client.getRouteForVnetCreateRequest(ctx, resourceGroupName, name, vnetName, routeName, options) + if err != nil { + return AppServicePlansGetRouteForVnetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return AppServicePlansGetRouteForVnetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return AppServicePlansGetRouteForVnetResponse{}, client.getRouteForVnetHandleError(resp) + } + return client.getRouteForVnetHandleResponse(resp) +} + +// getRouteForVnetCreateRequest creates the GetRouteForVnet request. +func (client *AppServicePlansClient) getRouteForVnetCreateRequest(ctx context.Context, resourceGroupName string, name string, vnetName string, routeName string, options *AppServicePlansGetRouteForVnetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/routes/{routeName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if vnetName == "" { + return nil, errors.New("parameter vnetName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{vnetName}", url.PathEscape(vnetName)) + if routeName == "" { + return nil, errors.New("parameter routeName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{routeName}", url.PathEscape(routeName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getRouteForVnetHandleResponse handles the GetRouteForVnet response. +func (client *AppServicePlansClient) getRouteForVnetHandleResponse(resp *http.Response) (AppServicePlansGetRouteForVnetResponse, error) { + result := AppServicePlansGetRouteForVnetResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.VnetRouteArray); err != nil { + return AppServicePlansGetRouteForVnetResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getRouteForVnetHandleError handles the GetRouteForVnet error response. +func (client *AppServicePlansClient) getRouteForVnetHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + switch resp.StatusCode { + case http.StatusNotFound: + if len(body) == 0 { + return runtime.NewResponseError(errors.New(resp.Status), resp) + } + return runtime.NewResponseError(errors.New(string(body)), resp) + default: + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) + } +} + +// GetServerFarmSKUs - Description for Gets all selectable SKUs for a given App Service Plan +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *AppServicePlansClient) GetServerFarmSKUs(ctx context.Context, resourceGroupName string, name string, options *AppServicePlansGetServerFarmSKUsOptions) (AppServicePlansGetServerFarmSKUsResponse, error) { + req, err := client.getServerFarmSKUsCreateRequest(ctx, resourceGroupName, name, options) + if err != nil { + return AppServicePlansGetServerFarmSKUsResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return AppServicePlansGetServerFarmSKUsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return AppServicePlansGetServerFarmSKUsResponse{}, client.getServerFarmSKUsHandleError(resp) + } + return client.getServerFarmSKUsHandleResponse(resp) +} + +// getServerFarmSKUsCreateRequest creates the GetServerFarmSKUs request. +func (client *AppServicePlansClient) getServerFarmSKUsCreateRequest(ctx context.Context, resourceGroupName string, name string, options *AppServicePlansGetServerFarmSKUsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/skus" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getServerFarmSKUsHandleResponse handles the GetServerFarmSKUs response. +func (client *AppServicePlansClient) getServerFarmSKUsHandleResponse(resp *http.Response) (AppServicePlansGetServerFarmSKUsResponse, error) { + result := AppServicePlansGetServerFarmSKUsResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.Object); err != nil { + return AppServicePlansGetServerFarmSKUsResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getServerFarmSKUsHandleError handles the GetServerFarmSKUs error response. +func (client *AppServicePlansClient) getServerFarmSKUsHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetVnetFromServerFarm - Description for Get a Virtual Network associated with an App Service plan. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *AppServicePlansClient) GetVnetFromServerFarm(ctx context.Context, resourceGroupName string, name string, vnetName string, options *AppServicePlansGetVnetFromServerFarmOptions) (AppServicePlansGetVnetFromServerFarmResponse, error) { + req, err := client.getVnetFromServerFarmCreateRequest(ctx, resourceGroupName, name, vnetName, options) + if err != nil { + return AppServicePlansGetVnetFromServerFarmResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return AppServicePlansGetVnetFromServerFarmResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return AppServicePlansGetVnetFromServerFarmResponse{}, client.getVnetFromServerFarmHandleError(resp) + } + return client.getVnetFromServerFarmHandleResponse(resp) +} + +// getVnetFromServerFarmCreateRequest creates the GetVnetFromServerFarm request. +func (client *AppServicePlansClient) getVnetFromServerFarmCreateRequest(ctx context.Context, resourceGroupName string, name string, vnetName string, options *AppServicePlansGetVnetFromServerFarmOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if vnetName == "" { + return nil, errors.New("parameter vnetName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{vnetName}", url.PathEscape(vnetName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getVnetFromServerFarmHandleResponse handles the GetVnetFromServerFarm response. +func (client *AppServicePlansClient) getVnetFromServerFarmHandleResponse(resp *http.Response) (AppServicePlansGetVnetFromServerFarmResponse, error) { + result := AppServicePlansGetVnetFromServerFarmResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.VnetInfoResource); err != nil { + return AppServicePlansGetVnetFromServerFarmResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getVnetFromServerFarmHandleError handles the GetVnetFromServerFarm error response. +func (client *AppServicePlansClient) getVnetFromServerFarmHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + switch resp.StatusCode { + case http.StatusNotFound: + if len(body) == 0 { + return runtime.NewResponseError(errors.New(resp.Status), resp) + } + return runtime.NewResponseError(errors.New(string(body)), resp) + default: + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) + } +} + +// GetVnetGateway - Description for Get a Virtual Network gateway. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *AppServicePlansClient) GetVnetGateway(ctx context.Context, resourceGroupName string, name string, vnetName string, gatewayName string, options *AppServicePlansGetVnetGatewayOptions) (AppServicePlansGetVnetGatewayResponse, error) { + req, err := client.getVnetGatewayCreateRequest(ctx, resourceGroupName, name, vnetName, gatewayName, options) + if err != nil { + return AppServicePlansGetVnetGatewayResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return AppServicePlansGetVnetGatewayResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return AppServicePlansGetVnetGatewayResponse{}, client.getVnetGatewayHandleError(resp) + } + return client.getVnetGatewayHandleResponse(resp) +} + +// getVnetGatewayCreateRequest creates the GetVnetGateway request. +func (client *AppServicePlansClient) getVnetGatewayCreateRequest(ctx context.Context, resourceGroupName string, name string, vnetName string, gatewayName string, options *AppServicePlansGetVnetGatewayOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if vnetName == "" { + return nil, errors.New("parameter vnetName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{vnetName}", url.PathEscape(vnetName)) + if gatewayName == "" { + return nil, errors.New("parameter gatewayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{gatewayName}", url.PathEscape(gatewayName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getVnetGatewayHandleResponse handles the GetVnetGateway response. +func (client *AppServicePlansClient) getVnetGatewayHandleResponse(resp *http.Response) (AppServicePlansGetVnetGatewayResponse, error) { + result := AppServicePlansGetVnetGatewayResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.VnetGateway); err != nil { + return AppServicePlansGetVnetGatewayResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getVnetGatewayHandleError handles the GetVnetGateway error response. +func (client *AppServicePlansClient) getVnetGatewayHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// List - Description for Get all App Service plans for a subscription. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *AppServicePlansClient) List(options *AppServicePlansListOptions) *AppServicePlansListPager { + return &AppServicePlansListPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listCreateRequest(ctx, options) + }, + advancer: func(ctx context.Context, resp AppServicePlansListResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.AppServicePlanCollection.NextLink) + }, + } +} + +// listCreateRequest creates the List request. +func (client *AppServicePlansClient) listCreateRequest(ctx context.Context, options *AppServicePlansListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Web/serverfarms" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + if options != nil && options.Detailed != nil { + reqQP.Set("detailed", strconv.FormatBool(*options.Detailed)) + } + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listHandleResponse handles the List response. +func (client *AppServicePlansClient) listHandleResponse(resp *http.Response) (AppServicePlansListResponse, error) { + result := AppServicePlansListResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.AppServicePlanCollection); err != nil { + return AppServicePlansListResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listHandleError handles the List error response. +func (client *AppServicePlansClient) listHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListByResourceGroup - Description for Get all App Service plans in a resource group. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *AppServicePlansClient) ListByResourceGroup(resourceGroupName string, options *AppServicePlansListByResourceGroupOptions) *AppServicePlansListByResourceGroupPager { + return &AppServicePlansListByResourceGroupPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) + }, + advancer: func(ctx context.Context, resp AppServicePlansListByResourceGroupResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.AppServicePlanCollection.NextLink) + }, + } +} + +// listByResourceGroupCreateRequest creates the ListByResourceGroup request. +func (client *AppServicePlansClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *AppServicePlansListByResourceGroupOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listByResourceGroupHandleResponse handles the ListByResourceGroup response. +func (client *AppServicePlansClient) listByResourceGroupHandleResponse(resp *http.Response) (AppServicePlansListByResourceGroupResponse, error) { + result := AppServicePlansListByResourceGroupResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.AppServicePlanCollection); err != nil { + return AppServicePlansListByResourceGroupResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listByResourceGroupHandleError handles the ListByResourceGroup error response. +func (client *AppServicePlansClient) listByResourceGroupHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListCapabilities - Description for List all capabilities of an App Service plan. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *AppServicePlansClient) ListCapabilities(ctx context.Context, resourceGroupName string, name string, options *AppServicePlansListCapabilitiesOptions) (AppServicePlansListCapabilitiesResponse, error) { + req, err := client.listCapabilitiesCreateRequest(ctx, resourceGroupName, name, options) + if err != nil { + return AppServicePlansListCapabilitiesResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return AppServicePlansListCapabilitiesResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return AppServicePlansListCapabilitiesResponse{}, client.listCapabilitiesHandleError(resp) + } + return client.listCapabilitiesHandleResponse(resp) +} + +// listCapabilitiesCreateRequest creates the ListCapabilities request. +func (client *AppServicePlansClient) listCapabilitiesCreateRequest(ctx context.Context, resourceGroupName string, name string, options *AppServicePlansListCapabilitiesOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/capabilities" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listCapabilitiesHandleResponse handles the ListCapabilities response. +func (client *AppServicePlansClient) listCapabilitiesHandleResponse(resp *http.Response) (AppServicePlansListCapabilitiesResponse, error) { + result := AppServicePlansListCapabilitiesResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.CapabilityArray); err != nil { + return AppServicePlansListCapabilitiesResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listCapabilitiesHandleError handles the ListCapabilities error response. +func (client *AppServicePlansClient) listCapabilitiesHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListHybridConnectionKeys - Description for Get the send key name and value of a Hybrid Connection. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *AppServicePlansClient) ListHybridConnectionKeys(ctx context.Context, resourceGroupName string, name string, namespaceName string, relayName string, options *AppServicePlansListHybridConnectionKeysOptions) (AppServicePlansListHybridConnectionKeysResponse, error) { + req, err := client.listHybridConnectionKeysCreateRequest(ctx, resourceGroupName, name, namespaceName, relayName, options) + if err != nil { + return AppServicePlansListHybridConnectionKeysResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return AppServicePlansListHybridConnectionKeysResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return AppServicePlansListHybridConnectionKeysResponse{}, client.listHybridConnectionKeysHandleError(resp) + } + return client.listHybridConnectionKeysHandleResponse(resp) +} + +// listHybridConnectionKeysCreateRequest creates the ListHybridConnectionKeys request. +func (client *AppServicePlansClient) listHybridConnectionKeysCreateRequest(ctx context.Context, resourceGroupName string, name string, namespaceName string, relayName string, options *AppServicePlansListHybridConnectionKeysOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}/listKeys" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if namespaceName == "" { + return nil, errors.New("parameter namespaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{namespaceName}", url.PathEscape(namespaceName)) + if relayName == "" { + return nil, errors.New("parameter relayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{relayName}", url.PathEscape(relayName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listHybridConnectionKeysHandleResponse handles the ListHybridConnectionKeys response. +func (client *AppServicePlansClient) listHybridConnectionKeysHandleResponse(resp *http.Response) (AppServicePlansListHybridConnectionKeysResponse, error) { + result := AppServicePlansListHybridConnectionKeysResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.HybridConnectionKey); err != nil { + return AppServicePlansListHybridConnectionKeysResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listHybridConnectionKeysHandleError handles the ListHybridConnectionKeys error response. +func (client *AppServicePlansClient) listHybridConnectionKeysHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListHybridConnections - Description for Retrieve all Hybrid Connections in use in an App Service plan. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *AppServicePlansClient) ListHybridConnections(resourceGroupName string, name string, options *AppServicePlansListHybridConnectionsOptions) *AppServicePlansListHybridConnectionsPager { + return &AppServicePlansListHybridConnectionsPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listHybridConnectionsCreateRequest(ctx, resourceGroupName, name, options) + }, + advancer: func(ctx context.Context, resp AppServicePlansListHybridConnectionsResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.HybridConnectionCollection.NextLink) + }, + } +} + +// listHybridConnectionsCreateRequest creates the ListHybridConnections request. +func (client *AppServicePlansClient) listHybridConnectionsCreateRequest(ctx context.Context, resourceGroupName string, name string, options *AppServicePlansListHybridConnectionsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/hybridConnectionRelays" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listHybridConnectionsHandleResponse handles the ListHybridConnections response. +func (client *AppServicePlansClient) listHybridConnectionsHandleResponse(resp *http.Response) (AppServicePlansListHybridConnectionsResponse, error) { + result := AppServicePlansListHybridConnectionsResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.HybridConnectionCollection); err != nil { + return AppServicePlansListHybridConnectionsResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listHybridConnectionsHandleError handles the ListHybridConnections error response. +func (client *AppServicePlansClient) listHybridConnectionsHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListRoutesForVnet - Description for Get all routes that are associated with a Virtual Network in an App Service plan. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *AppServicePlansClient) ListRoutesForVnet(ctx context.Context, resourceGroupName string, name string, vnetName string, options *AppServicePlansListRoutesForVnetOptions) (AppServicePlansListRoutesForVnetResponse, error) { + req, err := client.listRoutesForVnetCreateRequest(ctx, resourceGroupName, name, vnetName, options) + if err != nil { + return AppServicePlansListRoutesForVnetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return AppServicePlansListRoutesForVnetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return AppServicePlansListRoutesForVnetResponse{}, client.listRoutesForVnetHandleError(resp) + } + return client.listRoutesForVnetHandleResponse(resp) +} + +// listRoutesForVnetCreateRequest creates the ListRoutesForVnet request. +func (client *AppServicePlansClient) listRoutesForVnetCreateRequest(ctx context.Context, resourceGroupName string, name string, vnetName string, options *AppServicePlansListRoutesForVnetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/routes" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if vnetName == "" { + return nil, errors.New("parameter vnetName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{vnetName}", url.PathEscape(vnetName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listRoutesForVnetHandleResponse handles the ListRoutesForVnet response. +func (client *AppServicePlansClient) listRoutesForVnetHandleResponse(resp *http.Response) (AppServicePlansListRoutesForVnetResponse, error) { + result := AppServicePlansListRoutesForVnetResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.VnetRouteArray); err != nil { + return AppServicePlansListRoutesForVnetResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listRoutesForVnetHandleError handles the ListRoutesForVnet error response. +func (client *AppServicePlansClient) listRoutesForVnetHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListUsages - Description for Gets server farm usage information +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *AppServicePlansClient) ListUsages(resourceGroupName string, name string, options *AppServicePlansListUsagesOptions) *AppServicePlansListUsagesPager { + return &AppServicePlansListUsagesPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listUsagesCreateRequest(ctx, resourceGroupName, name, options) + }, + advancer: func(ctx context.Context, resp AppServicePlansListUsagesResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.CsmUsageQuotaCollection.NextLink) + }, + } +} + +// listUsagesCreateRequest creates the ListUsages request. +func (client *AppServicePlansClient) listUsagesCreateRequest(ctx context.Context, resourceGroupName string, name string, options *AppServicePlansListUsagesOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/usages" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + unencodedParams := []string{req.Raw().URL.RawQuery} + if options != nil && options.Filter != nil { + unencodedParams = append(unencodedParams, "$filter="+*options.Filter) + } + req.Raw().URL.RawQuery = strings.Join(unencodedParams, "&") + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listUsagesHandleResponse handles the ListUsages response. +func (client *AppServicePlansClient) listUsagesHandleResponse(resp *http.Response) (AppServicePlansListUsagesResponse, error) { + result := AppServicePlansListUsagesResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.CsmUsageQuotaCollection); err != nil { + return AppServicePlansListUsagesResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listUsagesHandleError handles the ListUsages error response. +func (client *AppServicePlansClient) listUsagesHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListVnets - Description for Get all Virtual Networks associated with an App Service plan. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *AppServicePlansClient) ListVnets(ctx context.Context, resourceGroupName string, name string, options *AppServicePlansListVnetsOptions) (AppServicePlansListVnetsResponse, error) { + req, err := client.listVnetsCreateRequest(ctx, resourceGroupName, name, options) + if err != nil { + return AppServicePlansListVnetsResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return AppServicePlansListVnetsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return AppServicePlansListVnetsResponse{}, client.listVnetsHandleError(resp) + } + return client.listVnetsHandleResponse(resp) +} + +// listVnetsCreateRequest creates the ListVnets request. +func (client *AppServicePlansClient) listVnetsCreateRequest(ctx context.Context, resourceGroupName string, name string, options *AppServicePlansListVnetsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listVnetsHandleResponse handles the ListVnets response. +func (client *AppServicePlansClient) listVnetsHandleResponse(resp *http.Response) (AppServicePlansListVnetsResponse, error) { + result := AppServicePlansListVnetsResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.VnetInfoResourceArray); err != nil { + return AppServicePlansListVnetsResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listVnetsHandleError handles the ListVnets error response. +func (client *AppServicePlansClient) listVnetsHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListWebApps - Description for Get all apps associated with an App Service plan. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *AppServicePlansClient) ListWebApps(resourceGroupName string, name string, options *AppServicePlansListWebAppsOptions) *AppServicePlansListWebAppsPager { + return &AppServicePlansListWebAppsPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listWebAppsCreateRequest(ctx, resourceGroupName, name, options) + }, + advancer: func(ctx context.Context, resp AppServicePlansListWebAppsResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.WebAppCollection.NextLink) + }, + } +} + +// listWebAppsCreateRequest creates the ListWebApps request. +func (client *AppServicePlansClient) listWebAppsCreateRequest(ctx context.Context, resourceGroupName string, name string, options *AppServicePlansListWebAppsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/sites" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + if options != nil && options.SkipToken != nil { + reqQP.Set("$skipToken", *options.SkipToken) + } + if options != nil && options.Top != nil { + reqQP.Set("$top", *options.Top) + } + req.Raw().URL.RawQuery = reqQP.Encode() + unencodedParams := []string{req.Raw().URL.RawQuery} + if options != nil && options.Filter != nil { + unencodedParams = append(unencodedParams, "$filter="+*options.Filter) + } + req.Raw().URL.RawQuery = strings.Join(unencodedParams, "&") + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listWebAppsHandleResponse handles the ListWebApps response. +func (client *AppServicePlansClient) listWebAppsHandleResponse(resp *http.Response) (AppServicePlansListWebAppsResponse, error) { + result := AppServicePlansListWebAppsResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.WebAppCollection); err != nil { + return AppServicePlansListWebAppsResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listWebAppsHandleError handles the ListWebApps error response. +func (client *AppServicePlansClient) listWebAppsHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListWebAppsByHybridConnection - Description for Get all apps that use a Hybrid Connection in an App Service Plan. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *AppServicePlansClient) ListWebAppsByHybridConnection(resourceGroupName string, name string, namespaceName string, relayName string, options *AppServicePlansListWebAppsByHybridConnectionOptions) *AppServicePlansListWebAppsByHybridConnectionPager { + return &AppServicePlansListWebAppsByHybridConnectionPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listWebAppsByHybridConnectionCreateRequest(ctx, resourceGroupName, name, namespaceName, relayName, options) + }, + advancer: func(ctx context.Context, resp AppServicePlansListWebAppsByHybridConnectionResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.ResourceCollection.NextLink) + }, + } +} + +// listWebAppsByHybridConnectionCreateRequest creates the ListWebAppsByHybridConnection request. +func (client *AppServicePlansClient) listWebAppsByHybridConnectionCreateRequest(ctx context.Context, resourceGroupName string, name string, namespaceName string, relayName string, options *AppServicePlansListWebAppsByHybridConnectionOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}/sites" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if namespaceName == "" { + return nil, errors.New("parameter namespaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{namespaceName}", url.PathEscape(namespaceName)) + if relayName == "" { + return nil, errors.New("parameter relayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{relayName}", url.PathEscape(relayName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listWebAppsByHybridConnectionHandleResponse handles the ListWebAppsByHybridConnection response. +func (client *AppServicePlansClient) listWebAppsByHybridConnectionHandleResponse(resp *http.Response) (AppServicePlansListWebAppsByHybridConnectionResponse, error) { + result := AppServicePlansListWebAppsByHybridConnectionResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.ResourceCollection); err != nil { + return AppServicePlansListWebAppsByHybridConnectionResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listWebAppsByHybridConnectionHandleError handles the ListWebAppsByHybridConnection error response. +func (client *AppServicePlansClient) listWebAppsByHybridConnectionHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// RebootWorker - Description for Reboot a worker machine in an App Service plan. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *AppServicePlansClient) RebootWorker(ctx context.Context, resourceGroupName string, name string, workerName string, options *AppServicePlansRebootWorkerOptions) (AppServicePlansRebootWorkerResponse, error) { + req, err := client.rebootWorkerCreateRequest(ctx, resourceGroupName, name, workerName, options) + if err != nil { + return AppServicePlansRebootWorkerResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return AppServicePlansRebootWorkerResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusNoContent) { + return AppServicePlansRebootWorkerResponse{}, client.rebootWorkerHandleError(resp) + } + return AppServicePlansRebootWorkerResponse{RawResponse: resp}, nil +} + +// rebootWorkerCreateRequest creates the RebootWorker request. +func (client *AppServicePlansClient) rebootWorkerCreateRequest(ctx context.Context, resourceGroupName string, name string, workerName string, options *AppServicePlansRebootWorkerOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/workers/{workerName}/reboot" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if workerName == "" { + return nil, errors.New("parameter workerName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workerName}", url.PathEscape(workerName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// rebootWorkerHandleError handles the RebootWorker error response. +func (client *AppServicePlansClient) rebootWorkerHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// RestartWebApps - Description for Restart all apps in an App Service plan. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *AppServicePlansClient) RestartWebApps(ctx context.Context, resourceGroupName string, name string, options *AppServicePlansRestartWebAppsOptions) (AppServicePlansRestartWebAppsResponse, error) { + req, err := client.restartWebAppsCreateRequest(ctx, resourceGroupName, name, options) + if err != nil { + return AppServicePlansRestartWebAppsResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return AppServicePlansRestartWebAppsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusNoContent) { + return AppServicePlansRestartWebAppsResponse{}, client.restartWebAppsHandleError(resp) + } + return AppServicePlansRestartWebAppsResponse{RawResponse: resp}, nil +} + +// restartWebAppsCreateRequest creates the RestartWebApps request. +func (client *AppServicePlansClient) restartWebAppsCreateRequest(ctx context.Context, resourceGroupName string, name string, options *AppServicePlansRestartWebAppsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/restartSites" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + if options != nil && options.SoftRestart != nil { + reqQP.Set("softRestart", strconv.FormatBool(*options.SoftRestart)) + } + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// restartWebAppsHandleError handles the RestartWebApps error response. +func (client *AppServicePlansClient) restartWebAppsHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// Update - Description for Creates or updates an App Service Plan. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *AppServicePlansClient) Update(ctx context.Context, resourceGroupName string, name string, appServicePlan AppServicePlanPatchResource, options *AppServicePlansUpdateOptions) (AppServicePlansUpdateResponse, error) { + req, err := client.updateCreateRequest(ctx, resourceGroupName, name, appServicePlan, options) + if err != nil { + return AppServicePlansUpdateResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return AppServicePlansUpdateResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return AppServicePlansUpdateResponse{}, client.updateHandleError(resp) + } + return client.updateHandleResponse(resp) +} + +// updateCreateRequest creates the Update request. +func (client *AppServicePlansClient) updateCreateRequest(ctx context.Context, resourceGroupName string, name string, appServicePlan AppServicePlanPatchResource, options *AppServicePlansUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, appServicePlan) +} + +// updateHandleResponse handles the Update response. +func (client *AppServicePlansClient) updateHandleResponse(resp *http.Response) (AppServicePlansUpdateResponse, error) { + result := AppServicePlansUpdateResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.AppServicePlan); err != nil { + return AppServicePlansUpdateResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// updateHandleError handles the Update error response. +func (client *AppServicePlansClient) updateHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// UpdateVnetGateway - Description for Update a Virtual Network gateway. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *AppServicePlansClient) UpdateVnetGateway(ctx context.Context, resourceGroupName string, name string, vnetName string, gatewayName string, connectionEnvelope VnetGateway, options *AppServicePlansUpdateVnetGatewayOptions) (AppServicePlansUpdateVnetGatewayResponse, error) { + req, err := client.updateVnetGatewayCreateRequest(ctx, resourceGroupName, name, vnetName, gatewayName, connectionEnvelope, options) + if err != nil { + return AppServicePlansUpdateVnetGatewayResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return AppServicePlansUpdateVnetGatewayResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return AppServicePlansUpdateVnetGatewayResponse{}, client.updateVnetGatewayHandleError(resp) + } + return client.updateVnetGatewayHandleResponse(resp) +} + +// updateVnetGatewayCreateRequest creates the UpdateVnetGateway request. +func (client *AppServicePlansClient) updateVnetGatewayCreateRequest(ctx context.Context, resourceGroupName string, name string, vnetName string, gatewayName string, connectionEnvelope VnetGateway, options *AppServicePlansUpdateVnetGatewayOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if vnetName == "" { + return nil, errors.New("parameter vnetName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{vnetName}", url.PathEscape(vnetName)) + if gatewayName == "" { + return nil, errors.New("parameter gatewayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{gatewayName}", url.PathEscape(gatewayName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, connectionEnvelope) +} + +// updateVnetGatewayHandleResponse handles the UpdateVnetGateway response. +func (client *AppServicePlansClient) updateVnetGatewayHandleResponse(resp *http.Response) (AppServicePlansUpdateVnetGatewayResponse, error) { + result := AppServicePlansUpdateVnetGatewayResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.VnetGateway); err != nil { + return AppServicePlansUpdateVnetGatewayResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// updateVnetGatewayHandleError handles the UpdateVnetGateway error response. +func (client *AppServicePlansClient) updateVnetGatewayHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// UpdateVnetRoute - Description for Create or update a Virtual Network route in an App Service plan. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *AppServicePlansClient) UpdateVnetRoute(ctx context.Context, resourceGroupName string, name string, vnetName string, routeName string, route VnetRoute, options *AppServicePlansUpdateVnetRouteOptions) (AppServicePlansUpdateVnetRouteResponse, error) { + req, err := client.updateVnetRouteCreateRequest(ctx, resourceGroupName, name, vnetName, routeName, route, options) + if err != nil { + return AppServicePlansUpdateVnetRouteResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return AppServicePlansUpdateVnetRouteResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return AppServicePlansUpdateVnetRouteResponse{}, client.updateVnetRouteHandleError(resp) + } + return client.updateVnetRouteHandleResponse(resp) +} + +// updateVnetRouteCreateRequest creates the UpdateVnetRoute request. +func (client *AppServicePlansClient) updateVnetRouteCreateRequest(ctx context.Context, resourceGroupName string, name string, vnetName string, routeName string, route VnetRoute, options *AppServicePlansUpdateVnetRouteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/routes/{routeName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if vnetName == "" { + return nil, errors.New("parameter vnetName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{vnetName}", url.PathEscape(vnetName)) + if routeName == "" { + return nil, errors.New("parameter routeName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{routeName}", url.PathEscape(routeName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, route) +} + +// updateVnetRouteHandleResponse handles the UpdateVnetRoute response. +func (client *AppServicePlansClient) updateVnetRouteHandleResponse(resp *http.Response) (AppServicePlansUpdateVnetRouteResponse, error) { + result := AppServicePlansUpdateVnetRouteResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.VnetRoute); err != nil { + return AppServicePlansUpdateVnetRouteResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// updateVnetRouteHandleError handles the UpdateVnetRoute error response. +func (client *AppServicePlansClient) updateVnetRouteHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + switch resp.StatusCode { + case http.StatusBadRequest, http.StatusNotFound: + if len(body) == 0 { + return runtime.NewResponseError(errors.New(resp.Status), resp) + } + return runtime.NewResponseError(errors.New(string(body)), resp) + default: + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) + } +} diff --git a/sdk/resourcemanager/appservice/armappservice/zz_generated_certificateordersdiagnostics_client.go b/sdk/resourcemanager/appservice/armappservice/zz_generated_certificateordersdiagnostics_client.go new file mode 100644 index 000000000000..957939d822ab --- /dev/null +++ b/sdk/resourcemanager/appservice/armappservice/zz_generated_certificateordersdiagnostics_client.go @@ -0,0 +1,184 @@ +//go:build go1.16 +// +build go1.16 + +// 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. + +package armappservice + +import ( + "context" + "errors" + "fmt" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" + "time" +) + +// CertificateOrdersDiagnosticsClient contains the methods for the CertificateOrdersDiagnostics group. +// Don't use this type directly, use NewCertificateOrdersDiagnosticsClient() instead. +type CertificateOrdersDiagnosticsClient struct { + ep string + pl runtime.Pipeline + subscriptionID string +} + +// NewCertificateOrdersDiagnosticsClient creates a new instance of CertificateOrdersDiagnosticsClient with the specified values. +func NewCertificateOrdersDiagnosticsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *CertificateOrdersDiagnosticsClient { + cp := arm.ClientOptions{} + if options != nil { + cp = *options + } + if len(cp.Host) == 0 { + cp.Host = arm.AzurePublicCloud + } + return &CertificateOrdersDiagnosticsClient{subscriptionID: subscriptionID, ep: string(cp.Host), pl: armruntime.NewPipeline(module, version, credential, &cp)} +} + +// GetAppServiceCertificateOrderDetectorResponse - Description for Microsoft.CertificateRegistration call to get a detector response from App Lens. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *CertificateOrdersDiagnosticsClient) GetAppServiceCertificateOrderDetectorResponse(ctx context.Context, resourceGroupName string, certificateOrderName string, detectorName string, options *CertificateOrdersDiagnosticsGetAppServiceCertificateOrderDetectorResponseOptions) (CertificateOrdersDiagnosticsGetAppServiceCertificateOrderDetectorResponseResponse, error) { + req, err := client.getAppServiceCertificateOrderDetectorResponseCreateRequest(ctx, resourceGroupName, certificateOrderName, detectorName, options) + if err != nil { + return CertificateOrdersDiagnosticsGetAppServiceCertificateOrderDetectorResponseResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return CertificateOrdersDiagnosticsGetAppServiceCertificateOrderDetectorResponseResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return CertificateOrdersDiagnosticsGetAppServiceCertificateOrderDetectorResponseResponse{}, client.getAppServiceCertificateOrderDetectorResponseHandleError(resp) + } + return client.getAppServiceCertificateOrderDetectorResponseHandleResponse(resp) +} + +// getAppServiceCertificateOrderDetectorResponseCreateRequest creates the GetAppServiceCertificateOrderDetectorResponse request. +func (client *CertificateOrdersDiagnosticsClient) getAppServiceCertificateOrderDetectorResponseCreateRequest(ctx context.Context, resourceGroupName string, certificateOrderName string, detectorName string, options *CertificateOrdersDiagnosticsGetAppServiceCertificateOrderDetectorResponseOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/detectors/{detectorName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if certificateOrderName == "" { + return nil, errors.New("parameter certificateOrderName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{certificateOrderName}", url.PathEscape(certificateOrderName)) + if detectorName == "" { + return nil, errors.New("parameter detectorName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{detectorName}", url.PathEscape(detectorName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + if options != nil && options.StartTime != nil { + reqQP.Set("startTime", options.StartTime.Format(time.RFC3339Nano)) + } + if options != nil && options.EndTime != nil { + reqQP.Set("endTime", options.EndTime.Format(time.RFC3339Nano)) + } + if options != nil && options.TimeGrain != nil { + reqQP.Set("timeGrain", *options.TimeGrain) + } + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getAppServiceCertificateOrderDetectorResponseHandleResponse handles the GetAppServiceCertificateOrderDetectorResponse response. +func (client *CertificateOrdersDiagnosticsClient) getAppServiceCertificateOrderDetectorResponseHandleResponse(resp *http.Response) (CertificateOrdersDiagnosticsGetAppServiceCertificateOrderDetectorResponseResponse, error) { + result := CertificateOrdersDiagnosticsGetAppServiceCertificateOrderDetectorResponseResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.DetectorResponse); err != nil { + return CertificateOrdersDiagnosticsGetAppServiceCertificateOrderDetectorResponseResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getAppServiceCertificateOrderDetectorResponseHandleError handles the GetAppServiceCertificateOrderDetectorResponse error response. +func (client *CertificateOrdersDiagnosticsClient) getAppServiceCertificateOrderDetectorResponseHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListAppServiceCertificateOrderDetectorResponse - Description for Microsoft.CertificateRegistration to get the list of detectors for this RP. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *CertificateOrdersDiagnosticsClient) ListAppServiceCertificateOrderDetectorResponse(resourceGroupName string, certificateOrderName string, options *CertificateOrdersDiagnosticsListAppServiceCertificateOrderDetectorResponseOptions) *CertificateOrdersDiagnosticsListAppServiceCertificateOrderDetectorResponsePager { + return &CertificateOrdersDiagnosticsListAppServiceCertificateOrderDetectorResponsePager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listAppServiceCertificateOrderDetectorResponseCreateRequest(ctx, resourceGroupName, certificateOrderName, options) + }, + advancer: func(ctx context.Context, resp CertificateOrdersDiagnosticsListAppServiceCertificateOrderDetectorResponseResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.DetectorResponseCollection.NextLink) + }, + } +} + +// listAppServiceCertificateOrderDetectorResponseCreateRequest creates the ListAppServiceCertificateOrderDetectorResponse request. +func (client *CertificateOrdersDiagnosticsClient) listAppServiceCertificateOrderDetectorResponseCreateRequest(ctx context.Context, resourceGroupName string, certificateOrderName string, options *CertificateOrdersDiagnosticsListAppServiceCertificateOrderDetectorResponseOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/detectors" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if certificateOrderName == "" { + return nil, errors.New("parameter certificateOrderName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{certificateOrderName}", url.PathEscape(certificateOrderName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listAppServiceCertificateOrderDetectorResponseHandleResponse handles the ListAppServiceCertificateOrderDetectorResponse response. +func (client *CertificateOrdersDiagnosticsClient) listAppServiceCertificateOrderDetectorResponseHandleResponse(resp *http.Response) (CertificateOrdersDiagnosticsListAppServiceCertificateOrderDetectorResponseResponse, error) { + result := CertificateOrdersDiagnosticsListAppServiceCertificateOrderDetectorResponseResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.DetectorResponseCollection); err != nil { + return CertificateOrdersDiagnosticsListAppServiceCertificateOrderDetectorResponseResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listAppServiceCertificateOrderDetectorResponseHandleError handles the ListAppServiceCertificateOrderDetectorResponse error response. +func (client *CertificateOrdersDiagnosticsClient) listAppServiceCertificateOrderDetectorResponseHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} diff --git a/sdk/resourcemanager/appservice/armappservice/zz_generated_certificateregistrationprovider_client.go b/sdk/resourcemanager/appservice/armappservice/zz_generated_certificateregistrationprovider_client.go new file mode 100644 index 000000000000..1a853d070eac --- /dev/null +++ b/sdk/resourcemanager/appservice/armappservice/zz_generated_certificateregistrationprovider_client.go @@ -0,0 +1,89 @@ +//go:build go1.16 +// +build go1.16 + +// 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. + +package armappservice + +import ( + "context" + "fmt" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" +) + +// CertificateRegistrationProviderClient contains the methods for the CertificateRegistrationProvider group. +// Don't use this type directly, use NewCertificateRegistrationProviderClient() instead. +type CertificateRegistrationProviderClient struct { + ep string + pl runtime.Pipeline +} + +// NewCertificateRegistrationProviderClient creates a new instance of CertificateRegistrationProviderClient with the specified values. +func NewCertificateRegistrationProviderClient(credential azcore.TokenCredential, options *arm.ClientOptions) *CertificateRegistrationProviderClient { + cp := arm.ClientOptions{} + if options != nil { + cp = *options + } + if len(cp.Host) == 0 { + cp.Host = arm.AzurePublicCloud + } + return &CertificateRegistrationProviderClient{ep: string(cp.Host), pl: armruntime.NewPipeline(module, version, credential, &cp)} +} + +// ListOperations - Description for Implements Csm operations Api to exposes the list of available Csm Apis under the resource provider +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *CertificateRegistrationProviderClient) ListOperations(options *CertificateRegistrationProviderListOperationsOptions) *CertificateRegistrationProviderListOperationsPager { + return &CertificateRegistrationProviderListOperationsPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listOperationsCreateRequest(ctx, options) + }, + advancer: func(ctx context.Context, resp CertificateRegistrationProviderListOperationsResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.CsmOperationCollection.NextLink) + }, + } +} + +// listOperationsCreateRequest creates the ListOperations request. +func (client *CertificateRegistrationProviderClient) listOperationsCreateRequest(ctx context.Context, options *CertificateRegistrationProviderListOperationsOptions) (*policy.Request, error) { + urlPath := "/providers/Microsoft.CertificateRegistration/operations" + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listOperationsHandleResponse handles the ListOperations response. +func (client *CertificateRegistrationProviderClient) listOperationsHandleResponse(resp *http.Response) (CertificateRegistrationProviderListOperationsResponse, error) { + result := CertificateRegistrationProviderListOperationsResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.CsmOperationCollection); err != nil { + return CertificateRegistrationProviderListOperationsResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listOperationsHandleError handles the ListOperations error response. +func (client *CertificateRegistrationProviderClient) listOperationsHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} diff --git a/sdk/resourcemanager/appservice/armappservice/zz_generated_certificates_client.go b/sdk/resourcemanager/appservice/armappservice/zz_generated_certificates_client.go new file mode 100644 index 000000000000..e49afa69ab55 --- /dev/null +++ b/sdk/resourcemanager/appservice/armappservice/zz_generated_certificates_client.go @@ -0,0 +1,411 @@ +//go:build go1.16 +// +build go1.16 + +// 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. + +package armappservice + +import ( + "context" + "errors" + "fmt" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// CertificatesClient contains the methods for the Certificates group. +// Don't use this type directly, use NewCertificatesClient() instead. +type CertificatesClient struct { + ep string + pl runtime.Pipeline + subscriptionID string +} + +// NewCertificatesClient creates a new instance of CertificatesClient with the specified values. +func NewCertificatesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *CertificatesClient { + cp := arm.ClientOptions{} + if options != nil { + cp = *options + } + if len(cp.Host) == 0 { + cp.Host = arm.AzurePublicCloud + } + return &CertificatesClient{subscriptionID: subscriptionID, ep: string(cp.Host), pl: armruntime.NewPipeline(module, version, credential, &cp)} +} + +// CreateOrUpdate - Description for Create or update a certificate. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *CertificatesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, name string, certificateEnvelope Certificate, options *CertificatesCreateOrUpdateOptions) (CertificatesCreateOrUpdateResponse, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, name, certificateEnvelope, options) + if err != nil { + return CertificatesCreateOrUpdateResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return CertificatesCreateOrUpdateResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return CertificatesCreateOrUpdateResponse{}, client.createOrUpdateHandleError(resp) + } + return client.createOrUpdateHandleResponse(resp) +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *CertificatesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, name string, certificateEnvelope Certificate, options *CertificatesCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/certificates/{name}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, certificateEnvelope) +} + +// createOrUpdateHandleResponse handles the CreateOrUpdate response. +func (client *CertificatesClient) createOrUpdateHandleResponse(resp *http.Response) (CertificatesCreateOrUpdateResponse, error) { + result := CertificatesCreateOrUpdateResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.Certificate); err != nil { + return CertificatesCreateOrUpdateResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// createOrUpdateHandleError handles the CreateOrUpdate error response. +func (client *CertificatesClient) createOrUpdateHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// Delete - Description for Delete a certificate. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *CertificatesClient) Delete(ctx context.Context, resourceGroupName string, name string, options *CertificatesDeleteOptions) (CertificatesDeleteResponse, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, name, options) + if err != nil { + return CertificatesDeleteResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return CertificatesDeleteResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { + return CertificatesDeleteResponse{}, client.deleteHandleError(resp) + } + return CertificatesDeleteResponse{RawResponse: resp}, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *CertificatesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, name string, options *CertificatesDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/certificates/{name}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// deleteHandleError handles the Delete error response. +func (client *CertificatesClient) deleteHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// Get - Description for Get a certificate. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *CertificatesClient) Get(ctx context.Context, resourceGroupName string, name string, options *CertificatesGetOptions) (CertificatesGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, name, options) + if err != nil { + return CertificatesGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return CertificatesGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return CertificatesGetResponse{}, client.getHandleError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *CertificatesClient) getCreateRequest(ctx context.Context, resourceGroupName string, name string, options *CertificatesGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/certificates/{name}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *CertificatesClient) getHandleResponse(resp *http.Response) (CertificatesGetResponse, error) { + result := CertificatesGetResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.Certificate); err != nil { + return CertificatesGetResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getHandleError handles the Get error response. +func (client *CertificatesClient) getHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// List - Description for Get all certificates for a subscription. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *CertificatesClient) List(options *CertificatesListOptions) *CertificatesListPager { + return &CertificatesListPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listCreateRequest(ctx, options) + }, + advancer: func(ctx context.Context, resp CertificatesListResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.CertificateCollection.NextLink) + }, + } +} + +// listCreateRequest creates the List request. +func (client *CertificatesClient) listCreateRequest(ctx context.Context, options *CertificatesListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Web/certificates" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + unencodedParams := []string{req.Raw().URL.RawQuery} + if options != nil && options.Filter != nil { + unencodedParams = append(unencodedParams, "$filter="+*options.Filter) + } + req.Raw().URL.RawQuery = strings.Join(unencodedParams, "&") + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listHandleResponse handles the List response. +func (client *CertificatesClient) listHandleResponse(resp *http.Response) (CertificatesListResponse, error) { + result := CertificatesListResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.CertificateCollection); err != nil { + return CertificatesListResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listHandleError handles the List error response. +func (client *CertificatesClient) listHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListByResourceGroup - Description for Get all certificates in a resource group. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *CertificatesClient) ListByResourceGroup(resourceGroupName string, options *CertificatesListByResourceGroupOptions) *CertificatesListByResourceGroupPager { + return &CertificatesListByResourceGroupPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) + }, + advancer: func(ctx context.Context, resp CertificatesListByResourceGroupResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.CertificateCollection.NextLink) + }, + } +} + +// listByResourceGroupCreateRequest creates the ListByResourceGroup request. +func (client *CertificatesClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *CertificatesListByResourceGroupOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/certificates" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listByResourceGroupHandleResponse handles the ListByResourceGroup response. +func (client *CertificatesClient) listByResourceGroupHandleResponse(resp *http.Response) (CertificatesListByResourceGroupResponse, error) { + result := CertificatesListByResourceGroupResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.CertificateCollection); err != nil { + return CertificatesListByResourceGroupResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listByResourceGroupHandleError handles the ListByResourceGroup error response. +func (client *CertificatesClient) listByResourceGroupHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// Update - Description for Create or update a certificate. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *CertificatesClient) Update(ctx context.Context, resourceGroupName string, name string, certificateEnvelope CertificatePatchResource, options *CertificatesUpdateOptions) (CertificatesUpdateResponse, error) { + req, err := client.updateCreateRequest(ctx, resourceGroupName, name, certificateEnvelope, options) + if err != nil { + return CertificatesUpdateResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return CertificatesUpdateResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return CertificatesUpdateResponse{}, client.updateHandleError(resp) + } + return client.updateHandleResponse(resp) +} + +// updateCreateRequest creates the Update request. +func (client *CertificatesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, name string, certificateEnvelope CertificatePatchResource, options *CertificatesUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/certificates/{name}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, certificateEnvelope) +} + +// updateHandleResponse handles the Update response. +func (client *CertificatesClient) updateHandleResponse(resp *http.Response) (CertificatesUpdateResponse, error) { + result := CertificatesUpdateResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.Certificate); err != nil { + return CertificatesUpdateResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// updateHandleError handles the Update error response. +func (client *CertificatesClient) updateHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} diff --git a/sdk/resourcemanager/appservice/armappservice/zz_generated_constants.go b/sdk/resourcemanager/appservice/armappservice/zz_generated_constants.go new file mode 100644 index 000000000000..c40a2e8c1369 --- /dev/null +++ b/sdk/resourcemanager/appservice/armappservice/zz_generated_constants.go @@ -0,0 +1,2283 @@ +//go:build go1.16 +// +build go1.16 + +// 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. + +package armappservice + +const ( + module = "armappservice" + version = "v0.1.0" +) + +type AppServiceCertificateOrderPatchResourcePropertiesAppServiceCertificateNotRenewableReasonsItem string + +const ( + AppServiceCertificateOrderPatchResourcePropertiesAppServiceCertificateNotRenewableReasonsItemExpirationNotInRenewalTimeRange AppServiceCertificateOrderPatchResourcePropertiesAppServiceCertificateNotRenewableReasonsItem = "ExpirationNotInRenewalTimeRange" + AppServiceCertificateOrderPatchResourcePropertiesAppServiceCertificateNotRenewableReasonsItemRegistrationStatusNotSupportedForRenewal AppServiceCertificateOrderPatchResourcePropertiesAppServiceCertificateNotRenewableReasonsItem = "RegistrationStatusNotSupportedForRenewal" + AppServiceCertificateOrderPatchResourcePropertiesAppServiceCertificateNotRenewableReasonsItemSubscriptionNotActive AppServiceCertificateOrderPatchResourcePropertiesAppServiceCertificateNotRenewableReasonsItem = "SubscriptionNotActive" +) + +// PossibleAppServiceCertificateOrderPatchResourcePropertiesAppServiceCertificateNotRenewableReasonsItemValues returns the possible values for the AppServiceCertificateOrderPatchResourcePropertiesAppServiceCertificateNotRenewableReasonsItem const type. +func PossibleAppServiceCertificateOrderPatchResourcePropertiesAppServiceCertificateNotRenewableReasonsItemValues() []AppServiceCertificateOrderPatchResourcePropertiesAppServiceCertificateNotRenewableReasonsItem { + return []AppServiceCertificateOrderPatchResourcePropertiesAppServiceCertificateNotRenewableReasonsItem{ + AppServiceCertificateOrderPatchResourcePropertiesAppServiceCertificateNotRenewableReasonsItemExpirationNotInRenewalTimeRange, + AppServiceCertificateOrderPatchResourcePropertiesAppServiceCertificateNotRenewableReasonsItemRegistrationStatusNotSupportedForRenewal, + AppServiceCertificateOrderPatchResourcePropertiesAppServiceCertificateNotRenewableReasonsItemSubscriptionNotActive, + } +} + +// ToPtr returns a *AppServiceCertificateOrderPatchResourcePropertiesAppServiceCertificateNotRenewableReasonsItem pointing to the current value. +func (c AppServiceCertificateOrderPatchResourcePropertiesAppServiceCertificateNotRenewableReasonsItem) ToPtr() *AppServiceCertificateOrderPatchResourcePropertiesAppServiceCertificateNotRenewableReasonsItem { + return &c +} + +type AppServiceCertificateOrderPropertiesAppServiceCertificateNotRenewableReasonsItem string + +const ( + AppServiceCertificateOrderPropertiesAppServiceCertificateNotRenewableReasonsItemExpirationNotInRenewalTimeRange AppServiceCertificateOrderPropertiesAppServiceCertificateNotRenewableReasonsItem = "ExpirationNotInRenewalTimeRange" + AppServiceCertificateOrderPropertiesAppServiceCertificateNotRenewableReasonsItemRegistrationStatusNotSupportedForRenewal AppServiceCertificateOrderPropertiesAppServiceCertificateNotRenewableReasonsItem = "RegistrationStatusNotSupportedForRenewal" + AppServiceCertificateOrderPropertiesAppServiceCertificateNotRenewableReasonsItemSubscriptionNotActive AppServiceCertificateOrderPropertiesAppServiceCertificateNotRenewableReasonsItem = "SubscriptionNotActive" +) + +// PossibleAppServiceCertificateOrderPropertiesAppServiceCertificateNotRenewableReasonsItemValues returns the possible values for the AppServiceCertificateOrderPropertiesAppServiceCertificateNotRenewableReasonsItem const type. +func PossibleAppServiceCertificateOrderPropertiesAppServiceCertificateNotRenewableReasonsItemValues() []AppServiceCertificateOrderPropertiesAppServiceCertificateNotRenewableReasonsItem { + return []AppServiceCertificateOrderPropertiesAppServiceCertificateNotRenewableReasonsItem{ + AppServiceCertificateOrderPropertiesAppServiceCertificateNotRenewableReasonsItemExpirationNotInRenewalTimeRange, + AppServiceCertificateOrderPropertiesAppServiceCertificateNotRenewableReasonsItemRegistrationStatusNotSupportedForRenewal, + AppServiceCertificateOrderPropertiesAppServiceCertificateNotRenewableReasonsItemSubscriptionNotActive, + } +} + +// ToPtr returns a *AppServiceCertificateOrderPropertiesAppServiceCertificateNotRenewableReasonsItem pointing to the current value. +func (c AppServiceCertificateOrderPropertiesAppServiceCertificateNotRenewableReasonsItem) ToPtr() *AppServiceCertificateOrderPropertiesAppServiceCertificateNotRenewableReasonsItem { + return &c +} + +// AppServicePlanRestrictions - App Service plans this offer is restricted to. +type AppServicePlanRestrictions string + +const ( + AppServicePlanRestrictionsNone AppServicePlanRestrictions = "None" + AppServicePlanRestrictionsFree AppServicePlanRestrictions = "Free" + AppServicePlanRestrictionsShared AppServicePlanRestrictions = "Shared" + AppServicePlanRestrictionsBasic AppServicePlanRestrictions = "Basic" + AppServicePlanRestrictionsStandard AppServicePlanRestrictions = "Standard" + AppServicePlanRestrictionsPremium AppServicePlanRestrictions = "Premium" +) + +// PossibleAppServicePlanRestrictionsValues returns the possible values for the AppServicePlanRestrictions const type. +func PossibleAppServicePlanRestrictionsValues() []AppServicePlanRestrictions { + return []AppServicePlanRestrictions{ + AppServicePlanRestrictionsNone, + AppServicePlanRestrictionsFree, + AppServicePlanRestrictionsShared, + AppServicePlanRestrictionsBasic, + AppServicePlanRestrictionsStandard, + AppServicePlanRestrictionsPremium, + } +} + +// ToPtr returns a *AppServicePlanRestrictions pointing to the current value. +func (c AppServicePlanRestrictions) ToPtr() *AppServicePlanRestrictions { + return &c +} + +// AutoHealActionType - Predefined action to be taken. +type AutoHealActionType string + +const ( + AutoHealActionTypeRecycle AutoHealActionType = "Recycle" + AutoHealActionTypeLogEvent AutoHealActionType = "LogEvent" + AutoHealActionTypeCustomAction AutoHealActionType = "CustomAction" +) + +// PossibleAutoHealActionTypeValues returns the possible values for the AutoHealActionType const type. +func PossibleAutoHealActionTypeValues() []AutoHealActionType { + return []AutoHealActionType{ + AutoHealActionTypeRecycle, + AutoHealActionTypeLogEvent, + AutoHealActionTypeCustomAction, + } +} + +// ToPtr returns a *AutoHealActionType pointing to the current value. +func (c AutoHealActionType) ToPtr() *AutoHealActionType { + return &c +} + +// AzureResourceType - Type of the Azure resource the hostname is assigned to. +type AzureResourceType string + +const ( + AzureResourceTypeWebsite AzureResourceType = "Website" + AzureResourceTypeTrafficManager AzureResourceType = "TrafficManager" +) + +// PossibleAzureResourceTypeValues returns the possible values for the AzureResourceType const type. +func PossibleAzureResourceTypeValues() []AzureResourceType { + return []AzureResourceType{ + AzureResourceTypeWebsite, + AzureResourceTypeTrafficManager, + } +} + +// ToPtr returns a *AzureResourceType pointing to the current value. +func (c AzureResourceType) ToPtr() *AzureResourceType { + return &c +} + +// AzureStorageState - State of the storage account. +type AzureStorageState string + +const ( + AzureStorageStateOk AzureStorageState = "Ok" + AzureStorageStateInvalidCredentials AzureStorageState = "InvalidCredentials" + AzureStorageStateInvalidShare AzureStorageState = "InvalidShare" + AzureStorageStateNotValidated AzureStorageState = "NotValidated" +) + +// PossibleAzureStorageStateValues returns the possible values for the AzureStorageState const type. +func PossibleAzureStorageStateValues() []AzureStorageState { + return []AzureStorageState{ + AzureStorageStateOk, + AzureStorageStateInvalidCredentials, + AzureStorageStateInvalidShare, + AzureStorageStateNotValidated, + } +} + +// ToPtr returns a *AzureStorageState pointing to the current value. +func (c AzureStorageState) ToPtr() *AzureStorageState { + return &c +} + +// AzureStorageType - Type of storage. +type AzureStorageType string + +const ( + AzureStorageTypeAzureFiles AzureStorageType = "AzureFiles" + AzureStorageTypeAzureBlob AzureStorageType = "AzureBlob" +) + +// PossibleAzureStorageTypeValues returns the possible values for the AzureStorageType const type. +func PossibleAzureStorageTypeValues() []AzureStorageType { + return []AzureStorageType{ + AzureStorageTypeAzureFiles, + AzureStorageTypeAzureBlob, + } +} + +// ToPtr returns a *AzureStorageType pointing to the current value. +func (c AzureStorageType) ToPtr() *AzureStorageType { + return &c +} + +// BackupItemStatus - Backup status. +type BackupItemStatus string + +const ( + BackupItemStatusInProgress BackupItemStatus = "InProgress" + BackupItemStatusFailed BackupItemStatus = "Failed" + BackupItemStatusSucceeded BackupItemStatus = "Succeeded" + BackupItemStatusTimedOut BackupItemStatus = "TimedOut" + BackupItemStatusCreated BackupItemStatus = "Created" + BackupItemStatusSkipped BackupItemStatus = "Skipped" + BackupItemStatusPartiallySucceeded BackupItemStatus = "PartiallySucceeded" + BackupItemStatusDeleteInProgress BackupItemStatus = "DeleteInProgress" + BackupItemStatusDeleteFailed BackupItemStatus = "DeleteFailed" + BackupItemStatusDeleted BackupItemStatus = "Deleted" +) + +// PossibleBackupItemStatusValues returns the possible values for the BackupItemStatus const type. +func PossibleBackupItemStatusValues() []BackupItemStatus { + return []BackupItemStatus{ + BackupItemStatusInProgress, + BackupItemStatusFailed, + BackupItemStatusSucceeded, + BackupItemStatusTimedOut, + BackupItemStatusCreated, + BackupItemStatusSkipped, + BackupItemStatusPartiallySucceeded, + BackupItemStatusDeleteInProgress, + BackupItemStatusDeleteFailed, + BackupItemStatusDeleted, + } +} + +// ToPtr returns a *BackupItemStatus pointing to the current value. +func (c BackupItemStatus) ToPtr() *BackupItemStatus { + return &c +} + +// BackupRestoreOperationType - Operation type. +type BackupRestoreOperationType string + +const ( + BackupRestoreOperationTypeDefault BackupRestoreOperationType = "Default" + BackupRestoreOperationTypeClone BackupRestoreOperationType = "Clone" + BackupRestoreOperationTypeRelocation BackupRestoreOperationType = "Relocation" + BackupRestoreOperationTypeSnapshot BackupRestoreOperationType = "Snapshot" + BackupRestoreOperationTypeCloudFS BackupRestoreOperationType = "CloudFS" +) + +// PossibleBackupRestoreOperationTypeValues returns the possible values for the BackupRestoreOperationType const type. +func PossibleBackupRestoreOperationTypeValues() []BackupRestoreOperationType { + return []BackupRestoreOperationType{ + BackupRestoreOperationTypeDefault, + BackupRestoreOperationTypeClone, + BackupRestoreOperationTypeRelocation, + BackupRestoreOperationTypeSnapshot, + BackupRestoreOperationTypeCloudFS, + } +} + +// ToPtr returns a *BackupRestoreOperationType pointing to the current value. +func (c BackupRestoreOperationType) ToPtr() *BackupRestoreOperationType { + return &c +} + +// BuildStatus - The status of the static site build. +type BuildStatus string + +const ( + BuildStatusDeleting BuildStatus = "Deleting" + BuildStatusDeploying BuildStatus = "Deploying" + BuildStatusDetached BuildStatus = "Detached" + BuildStatusFailed BuildStatus = "Failed" + BuildStatusReady BuildStatus = "Ready" + BuildStatusUploading BuildStatus = "Uploading" + BuildStatusWaitingForDeployment BuildStatus = "WaitingForDeployment" +) + +// PossibleBuildStatusValues returns the possible values for the BuildStatus const type. +func PossibleBuildStatusValues() []BuildStatus { + return []BuildStatus{ + BuildStatusDeleting, + BuildStatusDeploying, + BuildStatusDetached, + BuildStatusFailed, + BuildStatusReady, + BuildStatusUploading, + BuildStatusWaitingForDeployment, + } +} + +// ToPtr returns a *BuildStatus pointing to the current value. +func (c BuildStatus) ToPtr() *BuildStatus { + return &c +} + +// BuiltInAuthenticationProvider - The default authentication provider to use when multiple providers are configured. This setting is only needed if multiple +// providers are configured and the unauthenticated client action is set to +// "RedirectToLoginPage". +type BuiltInAuthenticationProvider string + +const ( + BuiltInAuthenticationProviderAzureActiveDirectory BuiltInAuthenticationProvider = "AzureActiveDirectory" + BuiltInAuthenticationProviderFacebook BuiltInAuthenticationProvider = "Facebook" + BuiltInAuthenticationProviderGoogle BuiltInAuthenticationProvider = "Google" + BuiltInAuthenticationProviderMicrosoftAccount BuiltInAuthenticationProvider = "MicrosoftAccount" + BuiltInAuthenticationProviderTwitter BuiltInAuthenticationProvider = "Twitter" + BuiltInAuthenticationProviderGithub BuiltInAuthenticationProvider = "Github" +) + +// PossibleBuiltInAuthenticationProviderValues returns the possible values for the BuiltInAuthenticationProvider const type. +func PossibleBuiltInAuthenticationProviderValues() []BuiltInAuthenticationProvider { + return []BuiltInAuthenticationProvider{ + BuiltInAuthenticationProviderAzureActiveDirectory, + BuiltInAuthenticationProviderFacebook, + BuiltInAuthenticationProviderGoogle, + BuiltInAuthenticationProviderMicrosoftAccount, + BuiltInAuthenticationProviderTwitter, + BuiltInAuthenticationProviderGithub, + } +} + +// ToPtr returns a *BuiltInAuthenticationProvider pointing to the current value. +func (c BuiltInAuthenticationProvider) ToPtr() *BuiltInAuthenticationProvider { + return &c +} + +// CertificateOrderActionType - Action type. +type CertificateOrderActionType string + +const ( + CertificateOrderActionTypeCertificateIssued CertificateOrderActionType = "CertificateIssued" + CertificateOrderActionTypeCertificateOrderCanceled CertificateOrderActionType = "CertificateOrderCanceled" + CertificateOrderActionTypeCertificateOrderCreated CertificateOrderActionType = "CertificateOrderCreated" + CertificateOrderActionTypeCertificateRevoked CertificateOrderActionType = "CertificateRevoked" + CertificateOrderActionTypeDomainValidationComplete CertificateOrderActionType = "DomainValidationComplete" + CertificateOrderActionTypeFraudDetected CertificateOrderActionType = "FraudDetected" + CertificateOrderActionTypeOrgNameChange CertificateOrderActionType = "OrgNameChange" + CertificateOrderActionTypeOrgValidationComplete CertificateOrderActionType = "OrgValidationComplete" + CertificateOrderActionTypeSanDrop CertificateOrderActionType = "SanDrop" + CertificateOrderActionTypeFraudCleared CertificateOrderActionType = "FraudCleared" + CertificateOrderActionTypeCertificateExpired CertificateOrderActionType = "CertificateExpired" + CertificateOrderActionTypeCertificateExpirationWarning CertificateOrderActionType = "CertificateExpirationWarning" + CertificateOrderActionTypeFraudDocumentationRequired CertificateOrderActionType = "FraudDocumentationRequired" + CertificateOrderActionTypeUnknown CertificateOrderActionType = "Unknown" +) + +// PossibleCertificateOrderActionTypeValues returns the possible values for the CertificateOrderActionType const type. +func PossibleCertificateOrderActionTypeValues() []CertificateOrderActionType { + return []CertificateOrderActionType{ + CertificateOrderActionTypeCertificateIssued, + CertificateOrderActionTypeCertificateOrderCanceled, + CertificateOrderActionTypeCertificateOrderCreated, + CertificateOrderActionTypeCertificateRevoked, + CertificateOrderActionTypeDomainValidationComplete, + CertificateOrderActionTypeFraudDetected, + CertificateOrderActionTypeOrgNameChange, + CertificateOrderActionTypeOrgValidationComplete, + CertificateOrderActionTypeSanDrop, + CertificateOrderActionTypeFraudCleared, + CertificateOrderActionTypeCertificateExpired, + CertificateOrderActionTypeCertificateExpirationWarning, + CertificateOrderActionTypeFraudDocumentationRequired, + CertificateOrderActionTypeUnknown, + } +} + +// ToPtr returns a *CertificateOrderActionType pointing to the current value. +func (c CertificateOrderActionType) ToPtr() *CertificateOrderActionType { + return &c +} + +// CertificateOrderStatus - Current order status. +type CertificateOrderStatus string + +const ( + CertificateOrderStatusPendingissuance CertificateOrderStatus = "Pendingissuance" + CertificateOrderStatusIssued CertificateOrderStatus = "Issued" + CertificateOrderStatusRevoked CertificateOrderStatus = "Revoked" + CertificateOrderStatusCanceled CertificateOrderStatus = "Canceled" + CertificateOrderStatusDenied CertificateOrderStatus = "Denied" + CertificateOrderStatusPendingrevocation CertificateOrderStatus = "Pendingrevocation" + CertificateOrderStatusPendingRekey CertificateOrderStatus = "PendingRekey" + CertificateOrderStatusUnused CertificateOrderStatus = "Unused" + CertificateOrderStatusExpired CertificateOrderStatus = "Expired" + CertificateOrderStatusNotSubmitted CertificateOrderStatus = "NotSubmitted" +) + +// PossibleCertificateOrderStatusValues returns the possible values for the CertificateOrderStatus const type. +func PossibleCertificateOrderStatusValues() []CertificateOrderStatus { + return []CertificateOrderStatus{ + CertificateOrderStatusPendingissuance, + CertificateOrderStatusIssued, + CertificateOrderStatusRevoked, + CertificateOrderStatusCanceled, + CertificateOrderStatusDenied, + CertificateOrderStatusPendingrevocation, + CertificateOrderStatusPendingRekey, + CertificateOrderStatusUnused, + CertificateOrderStatusExpired, + CertificateOrderStatusNotSubmitted, + } +} + +// ToPtr returns a *CertificateOrderStatus pointing to the current value. +func (c CertificateOrderStatus) ToPtr() *CertificateOrderStatus { + return &c +} + +// CertificateProductType - Certificate product type. +type CertificateProductType string + +const ( + CertificateProductTypeStandardDomainValidatedSSL CertificateProductType = "StandardDomainValidatedSsl" + CertificateProductTypeStandardDomainValidatedWildCardSSL CertificateProductType = "StandardDomainValidatedWildCardSsl" +) + +// PossibleCertificateProductTypeValues returns the possible values for the CertificateProductType const type. +func PossibleCertificateProductTypeValues() []CertificateProductType { + return []CertificateProductType{ + CertificateProductTypeStandardDomainValidatedSSL, + CertificateProductTypeStandardDomainValidatedWildCardSSL, + } +} + +// ToPtr returns a *CertificateProductType pointing to the current value. +func (c CertificateProductType) ToPtr() *CertificateProductType { + return &c +} + +// Channels - List of channels that this recommendation can apply. +type Channels string + +const ( + ChannelsNotification Channels = "Notification" + ChannelsAPI Channels = "Api" + ChannelsEmail Channels = "Email" + ChannelsWebhook Channels = "Webhook" + ChannelsAll Channels = "All" +) + +// PossibleChannelsValues returns the possible values for the Channels const type. +func PossibleChannelsValues() []Channels { + return []Channels{ + ChannelsNotification, + ChannelsAPI, + ChannelsEmail, + ChannelsWebhook, + ChannelsAll, + } +} + +// ToPtr returns a *Channels pointing to the current value. +func (c Channels) ToPtr() *Channels { + return &c +} + +// CheckNameResourceTypes - Resource type used for verification. +type CheckNameResourceTypes string + +const ( + CheckNameResourceTypesHostingEnvironment CheckNameResourceTypes = "HostingEnvironment" + CheckNameResourceTypesMicrosoftWebHostingEnvironments CheckNameResourceTypes = "Microsoft.Web/hostingEnvironments" + CheckNameResourceTypesMicrosoftWebPublishingUsers CheckNameResourceTypes = "Microsoft.Web/publishingUsers" + CheckNameResourceTypesMicrosoftWebSites CheckNameResourceTypes = "Microsoft.Web/sites" + CheckNameResourceTypesMicrosoftWebSitesSlots CheckNameResourceTypes = "Microsoft.Web/sites/slots" + CheckNameResourceTypesPublishingUser CheckNameResourceTypes = "PublishingUser" + CheckNameResourceTypesSite CheckNameResourceTypes = "Site" + CheckNameResourceTypesSlot CheckNameResourceTypes = "Slot" +) + +// PossibleCheckNameResourceTypesValues returns the possible values for the CheckNameResourceTypes const type. +func PossibleCheckNameResourceTypesValues() []CheckNameResourceTypes { + return []CheckNameResourceTypes{ + CheckNameResourceTypesHostingEnvironment, + CheckNameResourceTypesMicrosoftWebHostingEnvironments, + CheckNameResourceTypesMicrosoftWebPublishingUsers, + CheckNameResourceTypesMicrosoftWebSites, + CheckNameResourceTypesMicrosoftWebSitesSlots, + CheckNameResourceTypesPublishingUser, + CheckNameResourceTypesSite, + CheckNameResourceTypesSlot, + } +} + +// ToPtr returns a *CheckNameResourceTypes pointing to the current value. +func (c CheckNameResourceTypes) ToPtr() *CheckNameResourceTypes { + return &c +} + +// ClientCertMode - This composes with ClientCertEnabled setting. +// * ClientCertEnabled: false means ClientCert is ignored. +// * ClientCertEnabled: true and ClientCertMode: Required means ClientCert is required. +// * ClientCertEnabled: true and ClientCertMode: Optional means ClientCert is optional or accepted. +type ClientCertMode string + +const ( + ClientCertModeRequired ClientCertMode = "Required" + ClientCertModeOptional ClientCertMode = "Optional" + ClientCertModeOptionalInteractiveUser ClientCertMode = "OptionalInteractiveUser" +) + +// PossibleClientCertModeValues returns the possible values for the ClientCertMode const type. +func PossibleClientCertModeValues() []ClientCertMode { + return []ClientCertMode{ + ClientCertModeRequired, + ClientCertModeOptional, + ClientCertModeOptionalInteractiveUser, + } +} + +// ToPtr returns a *ClientCertMode pointing to the current value. +func (c ClientCertMode) ToPtr() *ClientCertMode { + return &c +} + +// CloneAbilityResult - Name of app. +type CloneAbilityResult string + +const ( + CloneAbilityResultCloneable CloneAbilityResult = "Cloneable" + CloneAbilityResultPartiallyCloneable CloneAbilityResult = "PartiallyCloneable" + CloneAbilityResultNotCloneable CloneAbilityResult = "NotCloneable" +) + +// PossibleCloneAbilityResultValues returns the possible values for the CloneAbilityResult const type. +func PossibleCloneAbilityResultValues() []CloneAbilityResult { + return []CloneAbilityResult{ + CloneAbilityResultCloneable, + CloneAbilityResultPartiallyCloneable, + CloneAbilityResultNotCloneable, + } +} + +// ToPtr returns a *CloneAbilityResult pointing to the current value. +func (c CloneAbilityResult) ToPtr() *CloneAbilityResult { + return &c +} + +// ComputeModeOptions - Shared/dedicated workers. +type ComputeModeOptions string + +const ( + ComputeModeOptionsShared ComputeModeOptions = "Shared" + ComputeModeOptionsDedicated ComputeModeOptions = "Dedicated" + ComputeModeOptionsDynamic ComputeModeOptions = "Dynamic" +) + +// PossibleComputeModeOptionsValues returns the possible values for the ComputeModeOptions const type. +func PossibleComputeModeOptionsValues() []ComputeModeOptions { + return []ComputeModeOptions{ + ComputeModeOptionsShared, + ComputeModeOptionsDedicated, + ComputeModeOptionsDynamic, + } +} + +// ToPtr returns a *ComputeModeOptions pointing to the current value. +func (c ComputeModeOptions) ToPtr() *ComputeModeOptions { + return &c +} + +// ConnectionStringType - Type of database. +type ConnectionStringType string + +const ( + ConnectionStringTypeMySQL ConnectionStringType = "MySql" + ConnectionStringTypeSQLServer ConnectionStringType = "SQLServer" + ConnectionStringTypeSQLAzure ConnectionStringType = "SQLAzure" + ConnectionStringTypeCustom ConnectionStringType = "Custom" + ConnectionStringTypeNotificationHub ConnectionStringType = "NotificationHub" + ConnectionStringTypeServiceBus ConnectionStringType = "ServiceBus" + ConnectionStringTypeEventHub ConnectionStringType = "EventHub" + ConnectionStringTypeAPIHub ConnectionStringType = "ApiHub" + ConnectionStringTypeDocDb ConnectionStringType = "DocDb" + ConnectionStringTypeRedisCache ConnectionStringType = "RedisCache" + ConnectionStringTypePostgreSQL ConnectionStringType = "PostgreSQL" +) + +// PossibleConnectionStringTypeValues returns the possible values for the ConnectionStringType const type. +func PossibleConnectionStringTypeValues() []ConnectionStringType { + return []ConnectionStringType{ + ConnectionStringTypeMySQL, + ConnectionStringTypeSQLServer, + ConnectionStringTypeSQLAzure, + ConnectionStringTypeCustom, + ConnectionStringTypeNotificationHub, + ConnectionStringTypeServiceBus, + ConnectionStringTypeEventHub, + ConnectionStringTypeAPIHub, + ConnectionStringTypeDocDb, + ConnectionStringTypeRedisCache, + ConnectionStringTypePostgreSQL, + } +} + +// ToPtr returns a *ConnectionStringType pointing to the current value. +func (c ConnectionStringType) ToPtr() *ConnectionStringType { + return &c +} + +// ContinuousWebJobStatus - Job status. +type ContinuousWebJobStatus string + +const ( + ContinuousWebJobStatusInitializing ContinuousWebJobStatus = "Initializing" + ContinuousWebJobStatusStarting ContinuousWebJobStatus = "Starting" + ContinuousWebJobStatusRunning ContinuousWebJobStatus = "Running" + ContinuousWebJobStatusPendingRestart ContinuousWebJobStatus = "PendingRestart" + ContinuousWebJobStatusStopped ContinuousWebJobStatus = "Stopped" +) + +// PossibleContinuousWebJobStatusValues returns the possible values for the ContinuousWebJobStatus const type. +func PossibleContinuousWebJobStatusValues() []ContinuousWebJobStatus { + return []ContinuousWebJobStatus{ + ContinuousWebJobStatusInitializing, + ContinuousWebJobStatusStarting, + ContinuousWebJobStatusRunning, + ContinuousWebJobStatusPendingRestart, + ContinuousWebJobStatusStopped, + } +} + +// ToPtr returns a *ContinuousWebJobStatus pointing to the current value. +func (c ContinuousWebJobStatus) ToPtr() *ContinuousWebJobStatus { + return &c +} + +// CookieExpirationConvention - The convention used when determining the session cookie's expiration. +type CookieExpirationConvention string + +const ( + CookieExpirationConventionFixedTime CookieExpirationConvention = "FixedTime" + CookieExpirationConventionIdentityProviderDerived CookieExpirationConvention = "IdentityProviderDerived" +) + +// PossibleCookieExpirationConventionValues returns the possible values for the CookieExpirationConvention const type. +func PossibleCookieExpirationConventionValues() []CookieExpirationConvention { + return []CookieExpirationConvention{ + CookieExpirationConventionFixedTime, + CookieExpirationConventionIdentityProviderDerived, + } +} + +// ToPtr returns a *CookieExpirationConvention pointing to the current value. +func (c CookieExpirationConvention) ToPtr() *CookieExpirationConvention { + return &c +} + +// CustomDomainStatus - The status of the custom domain +type CustomDomainStatus string + +const ( + CustomDomainStatusAdding CustomDomainStatus = "Adding" + CustomDomainStatusDeleting CustomDomainStatus = "Deleting" + CustomDomainStatusFailed CustomDomainStatus = "Failed" + CustomDomainStatusReady CustomDomainStatus = "Ready" + CustomDomainStatusRetrievingValidationToken CustomDomainStatus = "RetrievingValidationToken" + CustomDomainStatusValidating CustomDomainStatus = "Validating" +) + +// PossibleCustomDomainStatusValues returns the possible values for the CustomDomainStatus const type. +func PossibleCustomDomainStatusValues() []CustomDomainStatus { + return []CustomDomainStatus{ + CustomDomainStatusAdding, + CustomDomainStatusDeleting, + CustomDomainStatusFailed, + CustomDomainStatusReady, + CustomDomainStatusRetrievingValidationToken, + CustomDomainStatusValidating, + } +} + +// ToPtr returns a *CustomDomainStatus pointing to the current value. +func (c CustomDomainStatus) ToPtr() *CustomDomainStatus { + return &c +} + +// CustomHostNameDNSRecordType - Type of the DNS record. +type CustomHostNameDNSRecordType string + +const ( + CustomHostNameDNSRecordTypeCName CustomHostNameDNSRecordType = "CName" + CustomHostNameDNSRecordTypeA CustomHostNameDNSRecordType = "A" +) + +// PossibleCustomHostNameDNSRecordTypeValues returns the possible values for the CustomHostNameDNSRecordType const type. +func PossibleCustomHostNameDNSRecordTypeValues() []CustomHostNameDNSRecordType { + return []CustomHostNameDNSRecordType{ + CustomHostNameDNSRecordTypeCName, + CustomHostNameDNSRecordTypeA, + } +} + +// ToPtr returns a *CustomHostNameDNSRecordType pointing to the current value. +func (c CustomHostNameDNSRecordType) ToPtr() *CustomHostNameDNSRecordType { + return &c +} + +// DNSType - Current DNS type +type DNSType string + +const ( + DNSTypeAzureDNS DNSType = "AzureDns" + DNSTypeDefaultDomainRegistrarDNS DNSType = "DefaultDomainRegistrarDns" +) + +// PossibleDNSTypeValues returns the possible values for the DNSType const type. +func PossibleDNSTypeValues() []DNSType { + return []DNSType{ + DNSTypeAzureDNS, + DNSTypeDefaultDomainRegistrarDNS, + } +} + +// ToPtr returns a *DNSType pointing to the current value. +func (c DNSType) ToPtr() *DNSType { + return &c +} + +// DNSVerificationTestResult - DNS verification test result. +type DNSVerificationTestResult string + +const ( + DNSVerificationTestResultPassed DNSVerificationTestResult = "Passed" + DNSVerificationTestResultFailed DNSVerificationTestResult = "Failed" + DNSVerificationTestResultSkipped DNSVerificationTestResult = "Skipped" +) + +// PossibleDNSVerificationTestResultValues returns the possible values for the DNSVerificationTestResult const type. +func PossibleDNSVerificationTestResultValues() []DNSVerificationTestResult { + return []DNSVerificationTestResult{ + DNSVerificationTestResultPassed, + DNSVerificationTestResultFailed, + DNSVerificationTestResultSkipped, + } +} + +// ToPtr returns a *DNSVerificationTestResult pointing to the current value. +func (c DNSVerificationTestResult) ToPtr() *DNSVerificationTestResult { + return &c +} + +// DatabaseType - Database type (e.g. SqlAzure / MySql). +type DatabaseType string + +const ( + DatabaseTypeLocalMySQL DatabaseType = "LocalMySql" + DatabaseTypeMySQL DatabaseType = "MySql" + DatabaseTypePostgreSQL DatabaseType = "PostgreSql" + DatabaseTypeSQLAzure DatabaseType = "SqlAzure" +) + +// PossibleDatabaseTypeValues returns the possible values for the DatabaseType const type. +func PossibleDatabaseTypeValues() []DatabaseType { + return []DatabaseType{ + DatabaseTypeLocalMySQL, + DatabaseTypeMySQL, + DatabaseTypePostgreSQL, + DatabaseTypeSQLAzure, + } +} + +// ToPtr returns a *DatabaseType pointing to the current value. +func (c DatabaseType) ToPtr() *DatabaseType { + return &c +} + +// DetectorType - Whether this detector is an Analysis Detector or not. +type DetectorType string + +const ( + DetectorTypeDetector DetectorType = "Detector" + DetectorTypeAnalysis DetectorType = "Analysis" + DetectorTypeCategoryOverview DetectorType = "CategoryOverview" +) + +// PossibleDetectorTypeValues returns the possible values for the DetectorType const type. +func PossibleDetectorTypeValues() []DetectorType { + return []DetectorType{ + DetectorTypeDetector, + DetectorTypeAnalysis, + DetectorTypeCategoryOverview, + } +} + +// ToPtr returns a *DetectorType pointing to the current value. +func (c DetectorType) ToPtr() *DetectorType { + return &c +} + +type DomainPatchResourcePropertiesDomainNotRenewableReasonsItem string + +const ( + DomainPatchResourcePropertiesDomainNotRenewableReasonsItemExpirationNotInRenewalTimeRange DomainPatchResourcePropertiesDomainNotRenewableReasonsItem = "ExpirationNotInRenewalTimeRange" + DomainPatchResourcePropertiesDomainNotRenewableReasonsItemRegistrationStatusNotSupportedForRenewal DomainPatchResourcePropertiesDomainNotRenewableReasonsItem = "RegistrationStatusNotSupportedForRenewal" + DomainPatchResourcePropertiesDomainNotRenewableReasonsItemSubscriptionNotActive DomainPatchResourcePropertiesDomainNotRenewableReasonsItem = "SubscriptionNotActive" +) + +// PossibleDomainPatchResourcePropertiesDomainNotRenewableReasonsItemValues returns the possible values for the DomainPatchResourcePropertiesDomainNotRenewableReasonsItem const type. +func PossibleDomainPatchResourcePropertiesDomainNotRenewableReasonsItemValues() []DomainPatchResourcePropertiesDomainNotRenewableReasonsItem { + return []DomainPatchResourcePropertiesDomainNotRenewableReasonsItem{ + DomainPatchResourcePropertiesDomainNotRenewableReasonsItemExpirationNotInRenewalTimeRange, + DomainPatchResourcePropertiesDomainNotRenewableReasonsItemRegistrationStatusNotSupportedForRenewal, + DomainPatchResourcePropertiesDomainNotRenewableReasonsItemSubscriptionNotActive, + } +} + +// ToPtr returns a *DomainPatchResourcePropertiesDomainNotRenewableReasonsItem pointing to the current value. +func (c DomainPatchResourcePropertiesDomainNotRenewableReasonsItem) ToPtr() *DomainPatchResourcePropertiesDomainNotRenewableReasonsItem { + return &c +} + +type DomainPropertiesDomainNotRenewableReasonsItem string + +const ( + DomainPropertiesDomainNotRenewableReasonsItemExpirationNotInRenewalTimeRange DomainPropertiesDomainNotRenewableReasonsItem = "ExpirationNotInRenewalTimeRange" + DomainPropertiesDomainNotRenewableReasonsItemRegistrationStatusNotSupportedForRenewal DomainPropertiesDomainNotRenewableReasonsItem = "RegistrationStatusNotSupportedForRenewal" + DomainPropertiesDomainNotRenewableReasonsItemSubscriptionNotActive DomainPropertiesDomainNotRenewableReasonsItem = "SubscriptionNotActive" +) + +// PossibleDomainPropertiesDomainNotRenewableReasonsItemValues returns the possible values for the DomainPropertiesDomainNotRenewableReasonsItem const type. +func PossibleDomainPropertiesDomainNotRenewableReasonsItemValues() []DomainPropertiesDomainNotRenewableReasonsItem { + return []DomainPropertiesDomainNotRenewableReasonsItem{ + DomainPropertiesDomainNotRenewableReasonsItemExpirationNotInRenewalTimeRange, + DomainPropertiesDomainNotRenewableReasonsItemRegistrationStatusNotSupportedForRenewal, + DomainPropertiesDomainNotRenewableReasonsItemSubscriptionNotActive, + } +} + +// ToPtr returns a *DomainPropertiesDomainNotRenewableReasonsItem pointing to the current value. +func (c DomainPropertiesDomainNotRenewableReasonsItem) ToPtr() *DomainPropertiesDomainNotRenewableReasonsItem { + return &c +} + +// DomainStatus - Domain registration status. +type DomainStatus string + +const ( + DomainStatusActive DomainStatus = "Active" + DomainStatusAwaiting DomainStatus = "Awaiting" + DomainStatusCancelled DomainStatus = "Cancelled" + DomainStatusConfiscated DomainStatus = "Confiscated" + DomainStatusDisabled DomainStatus = "Disabled" + DomainStatusExcluded DomainStatus = "Excluded" + DomainStatusExpired DomainStatus = "Expired" + DomainStatusFailed DomainStatus = "Failed" + DomainStatusHeld DomainStatus = "Held" + DomainStatusLocked DomainStatus = "Locked" + DomainStatusParked DomainStatus = "Parked" + DomainStatusPending DomainStatus = "Pending" + DomainStatusReserved DomainStatus = "Reserved" + DomainStatusReverted DomainStatus = "Reverted" + DomainStatusSuspended DomainStatus = "Suspended" + DomainStatusTransferred DomainStatus = "Transferred" + DomainStatusUnknown DomainStatus = "Unknown" + DomainStatusUnlocked DomainStatus = "Unlocked" + DomainStatusUnparked DomainStatus = "Unparked" + DomainStatusUpdated DomainStatus = "Updated" + DomainStatusJSONConverterFailed DomainStatus = "JsonConverterFailed" +) + +// PossibleDomainStatusValues returns the possible values for the DomainStatus const type. +func PossibleDomainStatusValues() []DomainStatus { + return []DomainStatus{ + DomainStatusActive, + DomainStatusAwaiting, + DomainStatusCancelled, + DomainStatusConfiscated, + DomainStatusDisabled, + DomainStatusExcluded, + DomainStatusExpired, + DomainStatusFailed, + DomainStatusHeld, + DomainStatusLocked, + DomainStatusParked, + DomainStatusPending, + DomainStatusReserved, + DomainStatusReverted, + DomainStatusSuspended, + DomainStatusTransferred, + DomainStatusUnknown, + DomainStatusUnlocked, + DomainStatusUnparked, + DomainStatusUpdated, + DomainStatusJSONConverterFailed, + } +} + +// ToPtr returns a *DomainStatus pointing to the current value. +func (c DomainStatus) ToPtr() *DomainStatus { + return &c +} + +// DomainType - Valid values are Regular domain: Azure will charge the full price of domain registration, SoftDeleted: Purchasing this domain will simply +// restore it and this operation will not cost anything. +type DomainType string + +const ( + DomainTypeRegular DomainType = "Regular" + DomainTypeSoftDeleted DomainType = "SoftDeleted" +) + +// PossibleDomainTypeValues returns the possible values for the DomainType const type. +func PossibleDomainTypeValues() []DomainType { + return []DomainType{ + DomainTypeRegular, + DomainTypeSoftDeleted, + } +} + +// ToPtr returns a *DomainType pointing to the current value. +func (c DomainType) ToPtr() *DomainType { + return &c +} + +// ForwardProxyConvention - The convention used to determine the url of the request made. +type ForwardProxyConvention string + +const ( + ForwardProxyConventionNoProxy ForwardProxyConvention = "NoProxy" + ForwardProxyConventionStandard ForwardProxyConvention = "Standard" + ForwardProxyConventionCustom ForwardProxyConvention = "Custom" +) + +// PossibleForwardProxyConventionValues returns the possible values for the ForwardProxyConvention const type. +func PossibleForwardProxyConventionValues() []ForwardProxyConvention { + return []ForwardProxyConvention{ + ForwardProxyConventionNoProxy, + ForwardProxyConventionStandard, + ForwardProxyConventionCustom, + } +} + +// ToPtr returns a *ForwardProxyConvention pointing to the current value. +func (c ForwardProxyConvention) ToPtr() *ForwardProxyConvention { + return &c +} + +// FrequencyUnit - The unit of time for how often the backup should be executed (e.g. for weekly backup, this should be set to Day and FrequencyInterval +// should be set to 7) +type FrequencyUnit string + +const ( + FrequencyUnitDay FrequencyUnit = "Day" + FrequencyUnitHour FrequencyUnit = "Hour" +) + +// PossibleFrequencyUnitValues returns the possible values for the FrequencyUnit const type. +func PossibleFrequencyUnitValues() []FrequencyUnit { + return []FrequencyUnit{ + FrequencyUnitDay, + FrequencyUnitHour, + } +} + +// ToPtr returns a *FrequencyUnit pointing to the current value. +func (c FrequencyUnit) ToPtr() *FrequencyUnit { + return &c +} + +type FrontEndServiceType string + +const ( + FrontEndServiceTypeNodePort FrontEndServiceType = "NodePort" + FrontEndServiceTypeLoadBalancer FrontEndServiceType = "LoadBalancer" +) + +// PossibleFrontEndServiceTypeValues returns the possible values for the FrontEndServiceType const type. +func PossibleFrontEndServiceTypeValues() []FrontEndServiceType { + return []FrontEndServiceType{ + FrontEndServiceTypeNodePort, + FrontEndServiceTypeLoadBalancer, + } +} + +// ToPtr returns a *FrontEndServiceType pointing to the current value. +func (c FrontEndServiceType) ToPtr() *FrontEndServiceType { + return &c +} + +// FtpsState - State of FTP / FTPS service +type FtpsState string + +const ( + FtpsStateAllAllowed FtpsState = "AllAllowed" + FtpsStateDisabled FtpsState = "Disabled" + FtpsStateFtpsOnly FtpsState = "FtpsOnly" +) + +// PossibleFtpsStateValues returns the possible values for the FtpsState const type. +func PossibleFtpsStateValues() []FtpsState { + return []FtpsState{ + FtpsStateAllAllowed, + FtpsStateDisabled, + FtpsStateFtpsOnly, + } +} + +// ToPtr returns a *FtpsState pointing to the current value. +func (c FtpsState) ToPtr() *FtpsState { + return &c +} + +// HostNameType - Type of the hostname. +type HostNameType string + +const ( + HostNameTypeVerified HostNameType = "Verified" + HostNameTypeManaged HostNameType = "Managed" +) + +// PossibleHostNameTypeValues returns the possible values for the HostNameType const type. +func PossibleHostNameTypeValues() []HostNameType { + return []HostNameType{ + HostNameTypeVerified, + HostNameTypeManaged, + } +} + +// ToPtr returns a *HostNameType pointing to the current value. +func (c HostNameType) ToPtr() *HostNameType { + return &c +} + +// HostType - Indicates whether the hostname is a standard or repository hostname. +type HostType string + +const ( + HostTypeStandard HostType = "Standard" + HostTypeRepository HostType = "Repository" +) + +// PossibleHostTypeValues returns the possible values for the HostType const type. +func PossibleHostTypeValues() []HostType { + return []HostType{ + HostTypeStandard, + HostTypeRepository, + } +} + +// ToPtr returns a *HostType pointing to the current value. +func (c HostType) ToPtr() *HostType { + return &c +} + +// HostingEnvironmentStatus - Current status of the App Service Environment. +type HostingEnvironmentStatus string + +const ( + HostingEnvironmentStatusPreparing HostingEnvironmentStatus = "Preparing" + HostingEnvironmentStatusReady HostingEnvironmentStatus = "Ready" + HostingEnvironmentStatusScaling HostingEnvironmentStatus = "Scaling" + HostingEnvironmentStatusDeleting HostingEnvironmentStatus = "Deleting" +) + +// PossibleHostingEnvironmentStatusValues returns the possible values for the HostingEnvironmentStatus const type. +func PossibleHostingEnvironmentStatusValues() []HostingEnvironmentStatus { + return []HostingEnvironmentStatus{ + HostingEnvironmentStatusPreparing, + HostingEnvironmentStatusReady, + HostingEnvironmentStatusScaling, + HostingEnvironmentStatusDeleting, + } +} + +// ToPtr returns a *HostingEnvironmentStatus pointing to the current value. +func (c HostingEnvironmentStatus) ToPtr() *HostingEnvironmentStatus { + return &c +} + +// IPFilterTag - Defines what this IP filter will be used for. This is to support IP filtering on proxies. +type IPFilterTag string + +const ( + IPFilterTagDefault IPFilterTag = "Default" + IPFilterTagServiceTag IPFilterTag = "ServiceTag" + IPFilterTagXffProxy IPFilterTag = "XffProxy" +) + +// PossibleIPFilterTagValues returns the possible values for the IPFilterTag const type. +func PossibleIPFilterTagValues() []IPFilterTag { + return []IPFilterTag{ + IPFilterTagDefault, + IPFilterTagServiceTag, + IPFilterTagXffProxy, + } +} + +// ToPtr returns a *IPFilterTag pointing to the current value. +func (c IPFilterTag) ToPtr() *IPFilterTag { + return &c +} + +// InAvailabilityReasonType - Invalid indicates the name provided does not match Azure App Service naming requirements. AlreadyExists indicates that the +// name is already in use and is therefore unavailable. +type InAvailabilityReasonType string + +const ( + InAvailabilityReasonTypeAlreadyExists InAvailabilityReasonType = "AlreadyExists" + InAvailabilityReasonTypeInvalid InAvailabilityReasonType = "Invalid" +) + +// PossibleInAvailabilityReasonTypeValues returns the possible values for the InAvailabilityReasonType const type. +func PossibleInAvailabilityReasonTypeValues() []InAvailabilityReasonType { + return []InAvailabilityReasonType{ + InAvailabilityReasonTypeAlreadyExists, + InAvailabilityReasonTypeInvalid, + } +} + +// ToPtr returns a *InAvailabilityReasonType pointing to the current value. +func (c InAvailabilityReasonType) ToPtr() *InAvailabilityReasonType { + return &c +} + +// InsightStatus - Level of the most severe insight generated by the detector. +type InsightStatus string + +const ( + InsightStatusCritical InsightStatus = "Critical" + InsightStatusWarning InsightStatus = "Warning" + InsightStatusInfo InsightStatus = "Info" + InsightStatusSuccess InsightStatus = "Success" + InsightStatusNone InsightStatus = "None" +) + +// PossibleInsightStatusValues returns the possible values for the InsightStatus const type. +func PossibleInsightStatusValues() []InsightStatus { + return []InsightStatus{ + InsightStatusCritical, + InsightStatusWarning, + InsightStatusInfo, + InsightStatusSuccess, + InsightStatusNone, + } +} + +// ToPtr returns a *InsightStatus pointing to the current value. +func (c InsightStatus) ToPtr() *InsightStatus { + return &c +} + +// IssueType - Represents the type of the Detector +type IssueType string + +const ( + IssueTypeServiceIncident IssueType = "ServiceIncident" + IssueTypeAppDeployment IssueType = "AppDeployment" + IssueTypeAppCrash IssueType = "AppCrash" + IssueTypeRuntimeIssueDetected IssueType = "RuntimeIssueDetected" + IssueTypeAseDeployment IssueType = "AseDeployment" + IssueTypeUserIssue IssueType = "UserIssue" + IssueTypePlatformIssue IssueType = "PlatformIssue" + IssueTypeOther IssueType = "Other" +) + +// PossibleIssueTypeValues returns the possible values for the IssueType const type. +func PossibleIssueTypeValues() []IssueType { + return []IssueType{ + IssueTypeServiceIncident, + IssueTypeAppDeployment, + IssueTypeAppCrash, + IssueTypeRuntimeIssueDetected, + IssueTypeAseDeployment, + IssueTypeUserIssue, + IssueTypePlatformIssue, + IssueTypeOther, + } +} + +// ToPtr returns a *IssueType pointing to the current value. +func (c IssueType) ToPtr() *IssueType { + return &c +} + +// KeyVaultSecretStatus - Status of the Key Vault secret. +type KeyVaultSecretStatus string + +const ( + KeyVaultSecretStatusInitialized KeyVaultSecretStatus = "Initialized" + KeyVaultSecretStatusWaitingOnCertificateOrder KeyVaultSecretStatus = "WaitingOnCertificateOrder" + KeyVaultSecretStatusSucceeded KeyVaultSecretStatus = "Succeeded" + KeyVaultSecretStatusCertificateOrderFailed KeyVaultSecretStatus = "CertificateOrderFailed" + KeyVaultSecretStatusOperationNotPermittedOnKeyVault KeyVaultSecretStatus = "OperationNotPermittedOnKeyVault" + KeyVaultSecretStatusAzureServiceUnauthorizedToAccessKeyVault KeyVaultSecretStatus = "AzureServiceUnauthorizedToAccessKeyVault" + KeyVaultSecretStatusKeyVaultDoesNotExist KeyVaultSecretStatus = "KeyVaultDoesNotExist" + KeyVaultSecretStatusKeyVaultSecretDoesNotExist KeyVaultSecretStatus = "KeyVaultSecretDoesNotExist" + KeyVaultSecretStatusUnknownError KeyVaultSecretStatus = "UnknownError" + KeyVaultSecretStatusExternalPrivateKey KeyVaultSecretStatus = "ExternalPrivateKey" + KeyVaultSecretStatusUnknown KeyVaultSecretStatus = "Unknown" +) + +// PossibleKeyVaultSecretStatusValues returns the possible values for the KeyVaultSecretStatus const type. +func PossibleKeyVaultSecretStatusValues() []KeyVaultSecretStatus { + return []KeyVaultSecretStatus{ + KeyVaultSecretStatusInitialized, + KeyVaultSecretStatusWaitingOnCertificateOrder, + KeyVaultSecretStatusSucceeded, + KeyVaultSecretStatusCertificateOrderFailed, + KeyVaultSecretStatusOperationNotPermittedOnKeyVault, + KeyVaultSecretStatusAzureServiceUnauthorizedToAccessKeyVault, + KeyVaultSecretStatusKeyVaultDoesNotExist, + KeyVaultSecretStatusKeyVaultSecretDoesNotExist, + KeyVaultSecretStatusUnknownError, + KeyVaultSecretStatusExternalPrivateKey, + KeyVaultSecretStatusUnknown, + } +} + +// ToPtr returns a *KeyVaultSecretStatus pointing to the current value. +func (c KeyVaultSecretStatus) ToPtr() *KeyVaultSecretStatus { + return &c +} + +// KubeEnvironmentProvisioningState - Provisioning state of the Kubernetes Environment. +type KubeEnvironmentProvisioningState string + +const ( + KubeEnvironmentProvisioningStateSucceeded KubeEnvironmentProvisioningState = "Succeeded" + KubeEnvironmentProvisioningStateFailed KubeEnvironmentProvisioningState = "Failed" + KubeEnvironmentProvisioningStateCanceled KubeEnvironmentProvisioningState = "Canceled" + KubeEnvironmentProvisioningStateWaiting KubeEnvironmentProvisioningState = "Waiting" + KubeEnvironmentProvisioningStateInitializationInProgress KubeEnvironmentProvisioningState = "InitializationInProgress" + KubeEnvironmentProvisioningStateInfrastructureSetupInProgress KubeEnvironmentProvisioningState = "InfrastructureSetupInProgress" + KubeEnvironmentProvisioningStateInfrastructureSetupComplete KubeEnvironmentProvisioningState = "InfrastructureSetupComplete" + KubeEnvironmentProvisioningStateScheduledForDelete KubeEnvironmentProvisioningState = "ScheduledForDelete" + KubeEnvironmentProvisioningStateUpgradeRequested KubeEnvironmentProvisioningState = "UpgradeRequested" + KubeEnvironmentProvisioningStateUpgradeFailed KubeEnvironmentProvisioningState = "UpgradeFailed" +) + +// PossibleKubeEnvironmentProvisioningStateValues returns the possible values for the KubeEnvironmentProvisioningState const type. +func PossibleKubeEnvironmentProvisioningStateValues() []KubeEnvironmentProvisioningState { + return []KubeEnvironmentProvisioningState{ + KubeEnvironmentProvisioningStateSucceeded, + KubeEnvironmentProvisioningStateFailed, + KubeEnvironmentProvisioningStateCanceled, + KubeEnvironmentProvisioningStateWaiting, + KubeEnvironmentProvisioningStateInitializationInProgress, + KubeEnvironmentProvisioningStateInfrastructureSetupInProgress, + KubeEnvironmentProvisioningStateInfrastructureSetupComplete, + KubeEnvironmentProvisioningStateScheduledForDelete, + KubeEnvironmentProvisioningStateUpgradeRequested, + KubeEnvironmentProvisioningStateUpgradeFailed, + } +} + +// ToPtr returns a *KubeEnvironmentProvisioningState pointing to the current value. +func (c KubeEnvironmentProvisioningState) ToPtr() *KubeEnvironmentProvisioningState { + return &c +} + +// LoadBalancingMode - Specifies which endpoints to serve internally in the Virtual Network for the App Service Environment. +type LoadBalancingMode string + +const ( + LoadBalancingModeNone LoadBalancingMode = "None" + LoadBalancingModePublishing LoadBalancingMode = "Publishing" + LoadBalancingModeWeb LoadBalancingMode = "Web" + LoadBalancingModeWebPublishing LoadBalancingMode = "Web, Publishing" +) + +// PossibleLoadBalancingModeValues returns the possible values for the LoadBalancingMode const type. +func PossibleLoadBalancingModeValues() []LoadBalancingMode { + return []LoadBalancingMode{ + LoadBalancingModeNone, + LoadBalancingModePublishing, + LoadBalancingModeWeb, + LoadBalancingModeWebPublishing, + } +} + +// ToPtr returns a *LoadBalancingMode pointing to the current value. +func (c LoadBalancingMode) ToPtr() *LoadBalancingMode { + return &c +} + +// LogLevel - Log level. +type LogLevel string + +const ( + LogLevelOff LogLevel = "Off" + LogLevelVerbose LogLevel = "Verbose" + LogLevelInformation LogLevel = "Information" + LogLevelWarning LogLevel = "Warning" + LogLevelError LogLevel = "Error" +) + +// PossibleLogLevelValues returns the possible values for the LogLevel const type. +func PossibleLogLevelValues() []LogLevel { + return []LogLevel{ + LogLevelOff, + LogLevelVerbose, + LogLevelInformation, + LogLevelWarning, + LogLevelError, + } +} + +// ToPtr returns a *LogLevel pointing to the current value. +func (c LogLevel) ToPtr() *LogLevel { + return &c +} + +// MSDeployLogEntryType - Log entry type +type MSDeployLogEntryType string + +const ( + MSDeployLogEntryTypeMessage MSDeployLogEntryType = "Message" + MSDeployLogEntryTypeWarning MSDeployLogEntryType = "Warning" + MSDeployLogEntryTypeError MSDeployLogEntryType = "Error" +) + +// PossibleMSDeployLogEntryTypeValues returns the possible values for the MSDeployLogEntryType const type. +func PossibleMSDeployLogEntryTypeValues() []MSDeployLogEntryType { + return []MSDeployLogEntryType{ + MSDeployLogEntryTypeMessage, + MSDeployLogEntryTypeWarning, + MSDeployLogEntryTypeError, + } +} + +// ToPtr returns a *MSDeployLogEntryType pointing to the current value. +func (c MSDeployLogEntryType) ToPtr() *MSDeployLogEntryType { + return &c +} + +// MSDeployProvisioningState - Provisioning state +type MSDeployProvisioningState string + +const ( + MSDeployProvisioningStateAccepted MSDeployProvisioningState = "accepted" + MSDeployProvisioningStateRunning MSDeployProvisioningState = "running" + MSDeployProvisioningStateSucceeded MSDeployProvisioningState = "succeeded" + MSDeployProvisioningStateFailed MSDeployProvisioningState = "failed" + MSDeployProvisioningStateCanceled MSDeployProvisioningState = "canceled" +) + +// PossibleMSDeployProvisioningStateValues returns the possible values for the MSDeployProvisioningState const type. +func PossibleMSDeployProvisioningStateValues() []MSDeployProvisioningState { + return []MSDeployProvisioningState{ + MSDeployProvisioningStateAccepted, + MSDeployProvisioningStateRunning, + MSDeployProvisioningStateSucceeded, + MSDeployProvisioningStateFailed, + MSDeployProvisioningStateCanceled, + } +} + +// ToPtr returns a *MSDeployProvisioningState pointing to the current value. +func (c MSDeployProvisioningState) ToPtr() *MSDeployProvisioningState { + return &c +} + +// ManagedPipelineMode - Managed pipeline mode. +type ManagedPipelineMode string + +const ( + ManagedPipelineModeIntegrated ManagedPipelineMode = "Integrated" + ManagedPipelineModeClassic ManagedPipelineMode = "Classic" +) + +// PossibleManagedPipelineModeValues returns the possible values for the ManagedPipelineMode const type. +func PossibleManagedPipelineModeValues() []ManagedPipelineMode { + return []ManagedPipelineMode{ + ManagedPipelineModeIntegrated, + ManagedPipelineModeClassic, + } +} + +// ToPtr returns a *ManagedPipelineMode pointing to the current value. +func (c ManagedPipelineMode) ToPtr() *ManagedPipelineMode { + return &c +} + +// ManagedServiceIdentityType - Type of managed service identity. +type ManagedServiceIdentityType string + +const ( + ManagedServiceIdentityTypeSystemAssigned ManagedServiceIdentityType = "SystemAssigned" + ManagedServiceIdentityTypeUserAssigned ManagedServiceIdentityType = "UserAssigned" + ManagedServiceIdentityTypeSystemAssignedUserAssigned ManagedServiceIdentityType = "SystemAssigned, UserAssigned" + ManagedServiceIdentityTypeNone ManagedServiceIdentityType = "None" +) + +// PossibleManagedServiceIdentityTypeValues returns the possible values for the ManagedServiceIdentityType const type. +func PossibleManagedServiceIdentityTypeValues() []ManagedServiceIdentityType { + return []ManagedServiceIdentityType{ + ManagedServiceIdentityTypeSystemAssigned, + ManagedServiceIdentityTypeUserAssigned, + ManagedServiceIdentityTypeSystemAssignedUserAssigned, + ManagedServiceIdentityTypeNone, + } +} + +// ToPtr returns a *ManagedServiceIdentityType pointing to the current value. +func (c ManagedServiceIdentityType) ToPtr() *ManagedServiceIdentityType { + return &c +} + +// MySQLMigrationType - The type of migration operation to be done +type MySQLMigrationType string + +const ( + MySQLMigrationTypeLocalToRemote MySQLMigrationType = "LocalToRemote" + MySQLMigrationTypeRemoteToLocal MySQLMigrationType = "RemoteToLocal" +) + +// PossibleMySQLMigrationTypeValues returns the possible values for the MySQLMigrationType const type. +func PossibleMySQLMigrationTypeValues() []MySQLMigrationType { + return []MySQLMigrationType{ + MySQLMigrationTypeLocalToRemote, + MySQLMigrationTypeRemoteToLocal, + } +} + +// ToPtr returns a *MySQLMigrationType pointing to the current value. +func (c MySQLMigrationType) ToPtr() *MySQLMigrationType { + return &c +} + +// NotificationLevel - Level indicating how critical this recommendation can impact. +type NotificationLevel string + +const ( + NotificationLevelCritical NotificationLevel = "Critical" + NotificationLevelWarning NotificationLevel = "Warning" + NotificationLevelInformation NotificationLevel = "Information" + NotificationLevelNonUrgentSuggestion NotificationLevel = "NonUrgentSuggestion" +) + +// PossibleNotificationLevelValues returns the possible values for the NotificationLevel const type. +func PossibleNotificationLevelValues() []NotificationLevel { + return []NotificationLevel{ + NotificationLevelCritical, + NotificationLevelWarning, + NotificationLevelInformation, + NotificationLevelNonUrgentSuggestion, + } +} + +// ToPtr returns a *NotificationLevel pointing to the current value. +func (c NotificationLevel) ToPtr() *NotificationLevel { + return &c +} + +// OperationStatus - The current status of the operation. +type OperationStatus string + +const ( + OperationStatusInProgress OperationStatus = "InProgress" + OperationStatusFailed OperationStatus = "Failed" + OperationStatusSucceeded OperationStatus = "Succeeded" + OperationStatusTimedOut OperationStatus = "TimedOut" + OperationStatusCreated OperationStatus = "Created" +) + +// PossibleOperationStatusValues returns the possible values for the OperationStatus const type. +func PossibleOperationStatusValues() []OperationStatus { + return []OperationStatus{ + OperationStatusInProgress, + OperationStatusFailed, + OperationStatusSucceeded, + OperationStatusTimedOut, + OperationStatusCreated, + } +} + +// ToPtr returns a *OperationStatus pointing to the current value. +func (c OperationStatus) ToPtr() *OperationStatus { + return &c +} + +type ProviderOsTypeSelected string + +const ( + ProviderOsTypeSelectedAll ProviderOsTypeSelected = "All" + ProviderOsTypeSelectedLinux ProviderOsTypeSelected = "Linux" + ProviderOsTypeSelectedLinuxFunctions ProviderOsTypeSelected = "LinuxFunctions" + ProviderOsTypeSelectedWindows ProviderOsTypeSelected = "Windows" + ProviderOsTypeSelectedWindowsFunctions ProviderOsTypeSelected = "WindowsFunctions" +) + +// PossibleProviderOsTypeSelectedValues returns the possible values for the ProviderOsTypeSelected const type. +func PossibleProviderOsTypeSelectedValues() []ProviderOsTypeSelected { + return []ProviderOsTypeSelected{ + ProviderOsTypeSelectedAll, + ProviderOsTypeSelectedLinux, + ProviderOsTypeSelectedLinuxFunctions, + ProviderOsTypeSelectedWindows, + ProviderOsTypeSelectedWindowsFunctions, + } +} + +// ToPtr returns a *ProviderOsTypeSelected pointing to the current value. +func (c ProviderOsTypeSelected) ToPtr() *ProviderOsTypeSelected { + return &c +} + +type ProviderStackOsType string + +const ( + ProviderStackOsTypeAll ProviderStackOsType = "All" + ProviderStackOsTypeLinux ProviderStackOsType = "Linux" + ProviderStackOsTypeWindows ProviderStackOsType = "Windows" +) + +// PossibleProviderStackOsTypeValues returns the possible values for the ProviderStackOsType const type. +func PossibleProviderStackOsTypeValues() []ProviderStackOsType { + return []ProviderStackOsType{ + ProviderStackOsTypeAll, + ProviderStackOsTypeLinux, + ProviderStackOsTypeWindows, + } +} + +// ToPtr returns a *ProviderStackOsType pointing to the current value. +func (c ProviderStackOsType) ToPtr() *ProviderStackOsType { + return &c +} + +// ProvisioningState - Status of certificate order. +type ProvisioningState string + +const ( + ProvisioningStateSucceeded ProvisioningState = "Succeeded" + ProvisioningStateFailed ProvisioningState = "Failed" + ProvisioningStateCanceled ProvisioningState = "Canceled" + ProvisioningStateInProgress ProvisioningState = "InProgress" + ProvisioningStateDeleting ProvisioningState = "Deleting" +) + +// PossibleProvisioningStateValues returns the possible values for the ProvisioningState const type. +func PossibleProvisioningStateValues() []ProvisioningState { + return []ProvisioningState{ + ProvisioningStateSucceeded, + ProvisioningStateFailed, + ProvisioningStateCanceled, + ProvisioningStateInProgress, + ProvisioningStateDeleting, + } +} + +// ToPtr returns a *ProvisioningState pointing to the current value. +func (c ProvisioningState) ToPtr() *ProvisioningState { + return &c +} + +// PublicCertificateLocation - Public Certificate Location +type PublicCertificateLocation string + +const ( + PublicCertificateLocationCurrentUserMy PublicCertificateLocation = "CurrentUserMy" + PublicCertificateLocationLocalMachineMy PublicCertificateLocation = "LocalMachineMy" + PublicCertificateLocationUnknown PublicCertificateLocation = "Unknown" +) + +// PossiblePublicCertificateLocationValues returns the possible values for the PublicCertificateLocation const type. +func PossiblePublicCertificateLocationValues() []PublicCertificateLocation { + return []PublicCertificateLocation{ + PublicCertificateLocationCurrentUserMy, + PublicCertificateLocationLocalMachineMy, + PublicCertificateLocationUnknown, + } +} + +// ToPtr returns a *PublicCertificateLocation pointing to the current value. +func (c PublicCertificateLocation) ToPtr() *PublicCertificateLocation { + return &c +} + +// PublishingProfileFormat - Name of the format. Valid values are: FileZilla3 WebDeploy -- default Ftp +type PublishingProfileFormat string + +const ( + PublishingProfileFormatFileZilla3 PublishingProfileFormat = "FileZilla3" + PublishingProfileFormatFtp PublishingProfileFormat = "Ftp" + PublishingProfileFormatWebDeploy PublishingProfileFormat = "WebDeploy" +) + +// PossiblePublishingProfileFormatValues returns the possible values for the PublishingProfileFormat const type. +func PossiblePublishingProfileFormatValues() []PublishingProfileFormat { + return []PublishingProfileFormat{ + PublishingProfileFormatFileZilla3, + PublishingProfileFormatFtp, + PublishingProfileFormatWebDeploy, + } +} + +// ToPtr returns a *PublishingProfileFormat pointing to the current value. +func (c PublishingProfileFormat) ToPtr() *PublishingProfileFormat { + return &c +} + +// RedundancyMode - Site redundancy mode +type RedundancyMode string + +const ( + RedundancyModeNone RedundancyMode = "None" + RedundancyModeManual RedundancyMode = "Manual" + RedundancyModeFailover RedundancyMode = "Failover" + RedundancyModeActiveActive RedundancyMode = "ActiveActive" + RedundancyModeGeoRedundant RedundancyMode = "GeoRedundant" +) + +// PossibleRedundancyModeValues returns the possible values for the RedundancyMode const type. +func PossibleRedundancyModeValues() []RedundancyMode { + return []RedundancyMode{ + RedundancyModeNone, + RedundancyModeManual, + RedundancyModeFailover, + RedundancyModeActiveActive, + RedundancyModeGeoRedundant, + } +} + +// ToPtr returns a *RedundancyMode pointing to the current value. +func (c RedundancyMode) ToPtr() *RedundancyMode { + return &c +} + +// RenderingType - Rendering Type +type RenderingType string + +const ( + RenderingTypeNoGraph RenderingType = "NoGraph" + RenderingTypeTable RenderingType = "Table" + RenderingTypeTimeSeries RenderingType = "TimeSeries" + RenderingTypeTimeSeriesPerInstance RenderingType = "TimeSeriesPerInstance" + RenderingTypePieChart RenderingType = "PieChart" + RenderingTypeDataSummary RenderingType = "DataSummary" + RenderingTypeEmail RenderingType = "Email" + RenderingTypeInsights RenderingType = "Insights" + RenderingTypeDynamicInsight RenderingType = "DynamicInsight" + RenderingTypeMarkdown RenderingType = "Markdown" + RenderingTypeDetector RenderingType = "Detector" + RenderingTypeDropDown RenderingType = "DropDown" + RenderingTypeCard RenderingType = "Card" + RenderingTypeSolution RenderingType = "Solution" + RenderingTypeGuage RenderingType = "Guage" + RenderingTypeForm RenderingType = "Form" + RenderingTypeChangeSets RenderingType = "ChangeSets" + RenderingTypeChangeAnalysisOnboarding RenderingType = "ChangeAnalysisOnboarding" + RenderingTypeChangesView RenderingType = "ChangesView" + RenderingTypeAppInsight RenderingType = "AppInsight" + RenderingTypeDependencyGraph RenderingType = "DependencyGraph" + RenderingTypeDownTime RenderingType = "DownTime" + RenderingTypeSummaryCard RenderingType = "SummaryCard" + RenderingTypeSearchComponent RenderingType = "SearchComponent" + RenderingTypeAppInsightEnablement RenderingType = "AppInsightEnablement" +) + +// PossibleRenderingTypeValues returns the possible values for the RenderingType const type. +func PossibleRenderingTypeValues() []RenderingType { + return []RenderingType{ + RenderingTypeNoGraph, + RenderingTypeTable, + RenderingTypeTimeSeries, + RenderingTypeTimeSeriesPerInstance, + RenderingTypePieChart, + RenderingTypeDataSummary, + RenderingTypeEmail, + RenderingTypeInsights, + RenderingTypeDynamicInsight, + RenderingTypeMarkdown, + RenderingTypeDetector, + RenderingTypeDropDown, + RenderingTypeCard, + RenderingTypeSolution, + RenderingTypeGuage, + RenderingTypeForm, + RenderingTypeChangeSets, + RenderingTypeChangeAnalysisOnboarding, + RenderingTypeChangesView, + RenderingTypeAppInsight, + RenderingTypeDependencyGraph, + RenderingTypeDownTime, + RenderingTypeSummaryCard, + RenderingTypeSearchComponent, + RenderingTypeAppInsightEnablement, + } +} + +// ToPtr returns a *RenderingType pointing to the current value. +func (c RenderingType) ToPtr() *RenderingType { + return &c +} + +type ResolveStatus string + +const ( + ResolveStatusInitialized ResolveStatus = "Initialized" + ResolveStatusResolved ResolveStatus = "Resolved" + ResolveStatusInvalidSyntax ResolveStatus = "InvalidSyntax" + ResolveStatusMSINotEnabled ResolveStatus = "MSINotEnabled" + ResolveStatusVaultNotFound ResolveStatus = "VaultNotFound" + ResolveStatusSecretNotFound ResolveStatus = "SecretNotFound" + ResolveStatusSecretVersionNotFound ResolveStatus = "SecretVersionNotFound" + ResolveStatusAccessToKeyVaultDenied ResolveStatus = "AccessToKeyVaultDenied" + ResolveStatusOtherReasons ResolveStatus = "OtherReasons" + ResolveStatusFetchTimedOut ResolveStatus = "FetchTimedOut" + ResolveStatusUnauthorizedClient ResolveStatus = "UnauthorizedClient" +) + +// PossibleResolveStatusValues returns the possible values for the ResolveStatus const type. +func PossibleResolveStatusValues() []ResolveStatus { + return []ResolveStatus{ + ResolveStatusInitialized, + ResolveStatusResolved, + ResolveStatusInvalidSyntax, + ResolveStatusMSINotEnabled, + ResolveStatusVaultNotFound, + ResolveStatusSecretNotFound, + ResolveStatusSecretVersionNotFound, + ResolveStatusAccessToKeyVaultDenied, + ResolveStatusOtherReasons, + ResolveStatusFetchTimedOut, + ResolveStatusUnauthorizedClient, + } +} + +// ToPtr returns a *ResolveStatus pointing to the current value. +func (c ResolveStatus) ToPtr() *ResolveStatus { + return &c +} + +// ResourceScopeType - Name of a resource type this recommendation applies, e.g. Subscription, ServerFarm, Site. +type ResourceScopeType string + +const ( + ResourceScopeTypeServerFarm ResourceScopeType = "ServerFarm" + ResourceScopeTypeSubscription ResourceScopeType = "Subscription" + ResourceScopeTypeWebSite ResourceScopeType = "WebSite" +) + +// PossibleResourceScopeTypeValues returns the possible values for the ResourceScopeType const type. +func PossibleResourceScopeTypeValues() []ResourceScopeType { + return []ResourceScopeType{ + ResourceScopeTypeServerFarm, + ResourceScopeTypeSubscription, + ResourceScopeTypeWebSite, + } +} + +// ToPtr returns a *ResourceScopeType pointing to the current value. +func (c ResourceScopeType) ToPtr() *ResourceScopeType { + return &c +} + +// RouteType - The type of route this is: DEFAULT - By default, every app has routes to the local address ranges specified by RFC1918 INHERITED - Routes +// inherited from the real Virtual Network routes STATIC - Static +// route set on the app only +// These values will be used for syncing an app's routes with those from a Virtual Network. +type RouteType string + +const ( + RouteTypeDEFAULT RouteType = "DEFAULT" + RouteTypeINHERITED RouteType = "INHERITED" + RouteTypeSTATIC RouteType = "STATIC" +) + +// PossibleRouteTypeValues returns the possible values for the RouteType const type. +func PossibleRouteTypeValues() []RouteType { + return []RouteType{ + RouteTypeDEFAULT, + RouteTypeINHERITED, + RouteTypeSTATIC, + } +} + +// ToPtr returns a *RouteType pointing to the current value. +func (c RouteType) ToPtr() *RouteType { + return &c +} + +type SKUName string + +const ( + SKUNameBasic SKUName = "Basic" + SKUNameDynamic SKUName = "Dynamic" + SKUNameElasticIsolated SKUName = "ElasticIsolated" + SKUNameElasticPremium SKUName = "ElasticPremium" + SKUNameFree SKUName = "Free" + SKUNameIsolated SKUName = "Isolated" + SKUNameIsolatedV2 SKUName = "IsolatedV2" + SKUNamePremium SKUName = "Premium" + SKUNamePremiumContainer SKUName = "PremiumContainer" + SKUNamePremiumV2 SKUName = "PremiumV2" + SKUNamePremiumV3 SKUName = "PremiumV3" + SKUNameShared SKUName = "Shared" + SKUNameStandard SKUName = "Standard" +) + +// PossibleSKUNameValues returns the possible values for the SKUName const type. +func PossibleSKUNameValues() []SKUName { + return []SKUName{ + SKUNameBasic, + SKUNameDynamic, + SKUNameElasticIsolated, + SKUNameElasticPremium, + SKUNameFree, + SKUNameIsolated, + SKUNameIsolatedV2, + SKUNamePremium, + SKUNamePremiumContainer, + SKUNamePremiumV2, + SKUNamePremiumV3, + SKUNameShared, + SKUNameStandard, + } +} + +// ToPtr returns a *SKUName pointing to the current value. +func (c SKUName) ToPtr() *SKUName { + return &c +} + +// SSLState - SSL type. +type SSLState string + +const ( + SSLStateDisabled SSLState = "Disabled" + SSLStateSniEnabled SSLState = "SniEnabled" + SSLStateIPBasedEnabled SSLState = "IpBasedEnabled" +) + +// PossibleSSLStateValues returns the possible values for the SSLState const type. +func PossibleSSLStateValues() []SSLState { + return []SSLState{ + SSLStateDisabled, + SSLStateSniEnabled, + SSLStateIPBasedEnabled, + } +} + +// ToPtr returns a *SSLState pointing to the current value. +func (c SSLState) ToPtr() *SSLState { + return &c +} + +// ScmType - SCM type. +type ScmType string + +const ( + ScmTypeBitbucketGit ScmType = "BitbucketGit" + ScmTypeBitbucketHg ScmType = "BitbucketHg" + ScmTypeCodePlexGit ScmType = "CodePlexGit" + ScmTypeCodePlexHg ScmType = "CodePlexHg" + ScmTypeDropbox ScmType = "Dropbox" + ScmTypeExternalGit ScmType = "ExternalGit" + ScmTypeExternalHg ScmType = "ExternalHg" + ScmTypeGitHub ScmType = "GitHub" + ScmTypeLocalGit ScmType = "LocalGit" + ScmTypeNone ScmType = "None" + ScmTypeOneDrive ScmType = "OneDrive" + ScmTypeTfs ScmType = "Tfs" + ScmTypeVSO ScmType = "VSO" + ScmTypeVSTSRM ScmType = "VSTSRM" +) + +// PossibleScmTypeValues returns the possible values for the ScmType const type. +func PossibleScmTypeValues() []ScmType { + return []ScmType{ + ScmTypeBitbucketGit, + ScmTypeBitbucketHg, + ScmTypeCodePlexGit, + ScmTypeCodePlexHg, + ScmTypeDropbox, + ScmTypeExternalGit, + ScmTypeExternalHg, + ScmTypeGitHub, + ScmTypeLocalGit, + ScmTypeNone, + ScmTypeOneDrive, + ScmTypeTfs, + ScmTypeVSO, + ScmTypeVSTSRM, + } +} + +// ToPtr returns a *ScmType pointing to the current value. +func (c ScmType) ToPtr() *ScmType { + return &c +} + +// SiteAvailabilityState - Management information availability state for the app. +type SiteAvailabilityState string + +const ( + SiteAvailabilityStateNormal SiteAvailabilityState = "Normal" + SiteAvailabilityStateLimited SiteAvailabilityState = "Limited" + SiteAvailabilityStateDisasterRecoveryMode SiteAvailabilityState = "DisasterRecoveryMode" +) + +// PossibleSiteAvailabilityStateValues returns the possible values for the SiteAvailabilityState const type. +func PossibleSiteAvailabilityStateValues() []SiteAvailabilityState { + return []SiteAvailabilityState{ + SiteAvailabilityStateNormal, + SiteAvailabilityStateLimited, + SiteAvailabilityStateDisasterRecoveryMode, + } +} + +// ToPtr returns a *SiteAvailabilityState pointing to the current value. +func (c SiteAvailabilityState) ToPtr() *SiteAvailabilityState { + return &c +} + +// SiteExtensionType - Site extension type. +type SiteExtensionType string + +const ( + SiteExtensionTypeGallery SiteExtensionType = "Gallery" + SiteExtensionTypeWebRoot SiteExtensionType = "WebRoot" +) + +// PossibleSiteExtensionTypeValues returns the possible values for the SiteExtensionType const type. +func PossibleSiteExtensionTypeValues() []SiteExtensionType { + return []SiteExtensionType{ + SiteExtensionTypeGallery, + SiteExtensionTypeWebRoot, + } +} + +// ToPtr returns a *SiteExtensionType pointing to the current value. +func (c SiteExtensionType) ToPtr() *SiteExtensionType { + return &c +} + +// SiteLoadBalancing - Site load balancing. +type SiteLoadBalancing string + +const ( + SiteLoadBalancingWeightedRoundRobin SiteLoadBalancing = "WeightedRoundRobin" + SiteLoadBalancingLeastRequests SiteLoadBalancing = "LeastRequests" + SiteLoadBalancingLeastResponseTime SiteLoadBalancing = "LeastResponseTime" + SiteLoadBalancingWeightedTotalTraffic SiteLoadBalancing = "WeightedTotalTraffic" + SiteLoadBalancingRequestHash SiteLoadBalancing = "RequestHash" + SiteLoadBalancingPerSiteRoundRobin SiteLoadBalancing = "PerSiteRoundRobin" +) + +// PossibleSiteLoadBalancingValues returns the possible values for the SiteLoadBalancing const type. +func PossibleSiteLoadBalancingValues() []SiteLoadBalancing { + return []SiteLoadBalancing{ + SiteLoadBalancingWeightedRoundRobin, + SiteLoadBalancingLeastRequests, + SiteLoadBalancingLeastResponseTime, + SiteLoadBalancingWeightedTotalTraffic, + SiteLoadBalancingRequestHash, + SiteLoadBalancingPerSiteRoundRobin, + } +} + +// ToPtr returns a *SiteLoadBalancing pointing to the current value. +func (c SiteLoadBalancing) ToPtr() *SiteLoadBalancing { + return &c +} + +type SiteRuntimeState string + +const ( + SiteRuntimeStateREADY SiteRuntimeState = "READY" + SiteRuntimeStateSTOPPED SiteRuntimeState = "STOPPED" + SiteRuntimeStateUNKNOWN SiteRuntimeState = "UNKNOWN" +) + +// PossibleSiteRuntimeStateValues returns the possible values for the SiteRuntimeState const type. +func PossibleSiteRuntimeStateValues() []SiteRuntimeState { + return []SiteRuntimeState{ + SiteRuntimeStateREADY, + SiteRuntimeStateSTOPPED, + SiteRuntimeStateUNKNOWN, + } +} + +// ToPtr returns a *SiteRuntimeState pointing to the current value. +func (c SiteRuntimeState) ToPtr() *SiteRuntimeState { + return &c +} + +// SolutionType - Type of Solution +type SolutionType string + +const ( + SolutionTypeQuickSolution SolutionType = "QuickSolution" + SolutionTypeDeepInvestigation SolutionType = "DeepInvestigation" + SolutionTypeBestPractices SolutionType = "BestPractices" +) + +// PossibleSolutionTypeValues returns the possible values for the SolutionType const type. +func PossibleSolutionTypeValues() []SolutionType { + return []SolutionType{ + SolutionTypeQuickSolution, + SolutionTypeDeepInvestigation, + SolutionTypeBestPractices, + } +} + +// ToPtr returns a *SolutionType pointing to the current value. +func (c SolutionType) ToPtr() *SolutionType { + return &c +} + +// StackPreferredOs - Function App stack preferred OS. +type StackPreferredOs string + +const ( + StackPreferredOsWindows StackPreferredOs = "Windows" + StackPreferredOsLinux StackPreferredOs = "Linux" +) + +// PossibleStackPreferredOsValues returns the possible values for the StackPreferredOs const type. +func PossibleStackPreferredOsValues() []StackPreferredOs { + return []StackPreferredOs{ + StackPreferredOsWindows, + StackPreferredOsLinux, + } +} + +// ToPtr returns a *StackPreferredOs pointing to the current value. +func (c StackPreferredOs) ToPtr() *StackPreferredOs { + return &c +} + +// StagingEnvironmentPolicy - State indicating whether staging environments are allowed or not allowed for a static web app. +type StagingEnvironmentPolicy string + +const ( + StagingEnvironmentPolicyEnabled StagingEnvironmentPolicy = "Enabled" + StagingEnvironmentPolicyDisabled StagingEnvironmentPolicy = "Disabled" +) + +// PossibleStagingEnvironmentPolicyValues returns the possible values for the StagingEnvironmentPolicy const type. +func PossibleStagingEnvironmentPolicyValues() []StagingEnvironmentPolicy { + return []StagingEnvironmentPolicy{ + StagingEnvironmentPolicyEnabled, + StagingEnvironmentPolicyDisabled, + } +} + +// ToPtr returns a *StagingEnvironmentPolicy pointing to the current value. +func (c StagingEnvironmentPolicy) ToPtr() *StagingEnvironmentPolicy { + return &c +} + +// StatusOptions - App Service plan status. +type StatusOptions string + +const ( + StatusOptionsReady StatusOptions = "Ready" + StatusOptionsPending StatusOptions = "Pending" + StatusOptionsCreating StatusOptions = "Creating" +) + +// PossibleStatusOptionsValues returns the possible values for the StatusOptions const type. +func PossibleStatusOptionsValues() []StatusOptions { + return []StatusOptions{ + StatusOptionsReady, + StatusOptionsPending, + StatusOptionsCreating, + } +} + +// ToPtr returns a *StatusOptions pointing to the current value. +func (c StatusOptions) ToPtr() *StatusOptions { + return &c +} + +type StorageType string + +const ( + StorageTypeLocalNode StorageType = "LocalNode" + StorageTypeNetworkFileSystem StorageType = "NetworkFileSystem" +) + +// PossibleStorageTypeValues returns the possible values for the StorageType const type. +func PossibleStorageTypeValues() []StorageType { + return []StorageType{ + StorageTypeLocalNode, + StorageTypeNetworkFileSystem, + } +} + +// ToPtr returns a *StorageType pointing to the current value. +func (c StorageType) ToPtr() *StorageType { + return &c +} + +// SupportedTLSVersions - MinTlsVersion: configures the minimum version of TLS required for SSL requests +type SupportedTLSVersions string + +const ( + SupportedTLSVersionsOne0 SupportedTLSVersions = "1.0" + SupportedTLSVersionsOne1 SupportedTLSVersions = "1.1" + SupportedTLSVersionsOne2 SupportedTLSVersions = "1.2" +) + +// PossibleSupportedTLSVersionsValues returns the possible values for the SupportedTLSVersions const type. +func PossibleSupportedTLSVersionsValues() []SupportedTLSVersions { + return []SupportedTLSVersions{ + SupportedTLSVersionsOne0, + SupportedTLSVersionsOne1, + SupportedTLSVersionsOne2, + } +} + +// ToPtr returns a *SupportedTLSVersions pointing to the current value. +func (c SupportedTLSVersions) ToPtr() *SupportedTLSVersions { + return &c +} + +// TriggerTypes - The trigger type of the function +type TriggerTypes string + +const ( + TriggerTypesHTTPTrigger TriggerTypes = "HttpTrigger" + TriggerTypesUnknown TriggerTypes = "Unknown" +) + +// PossibleTriggerTypesValues returns the possible values for the TriggerTypes const type. +func PossibleTriggerTypesValues() []TriggerTypes { + return []TriggerTypes{ + TriggerTypesHTTPTrigger, + TriggerTypesUnknown, + } +} + +// ToPtr returns a *TriggerTypes pointing to the current value. +func (c TriggerTypes) ToPtr() *TriggerTypes { + return &c +} + +// TriggeredWebJobStatus - Job status. +type TriggeredWebJobStatus string + +const ( + TriggeredWebJobStatusSuccess TriggeredWebJobStatus = "Success" + TriggeredWebJobStatusFailed TriggeredWebJobStatus = "Failed" + TriggeredWebJobStatusError TriggeredWebJobStatus = "Error" +) + +// PossibleTriggeredWebJobStatusValues returns the possible values for the TriggeredWebJobStatus const type. +func PossibleTriggeredWebJobStatusValues() []TriggeredWebJobStatus { + return []TriggeredWebJobStatus{ + TriggeredWebJobStatusSuccess, + TriggeredWebJobStatusFailed, + TriggeredWebJobStatusError, + } +} + +// ToPtr returns a *TriggeredWebJobStatus pointing to the current value. +func (c TriggeredWebJobStatus) ToPtr() *TriggeredWebJobStatus { + return &c +} + +// UnauthenticatedClientAction - The action to take when an unauthenticated client attempts to access the app. +type UnauthenticatedClientAction string + +const ( + UnauthenticatedClientActionRedirectToLoginPage UnauthenticatedClientAction = "RedirectToLoginPage" + UnauthenticatedClientActionAllowAnonymous UnauthenticatedClientAction = "AllowAnonymous" +) + +// PossibleUnauthenticatedClientActionValues returns the possible values for the UnauthenticatedClientAction const type. +func PossibleUnauthenticatedClientActionValues() []UnauthenticatedClientAction { + return []UnauthenticatedClientAction{ + UnauthenticatedClientActionRedirectToLoginPage, + UnauthenticatedClientActionAllowAnonymous, + } +} + +// ToPtr returns a *UnauthenticatedClientAction pointing to the current value. +func (c UnauthenticatedClientAction) ToPtr() *UnauthenticatedClientAction { + return &c +} + +// UnauthenticatedClientActionV2 - The action to take when an unauthenticated client attempts to access the app. +type UnauthenticatedClientActionV2 string + +const ( + UnauthenticatedClientActionV2RedirectToLoginPage UnauthenticatedClientActionV2 = "RedirectToLoginPage" + UnauthenticatedClientActionV2AllowAnonymous UnauthenticatedClientActionV2 = "AllowAnonymous" + UnauthenticatedClientActionV2Return401 UnauthenticatedClientActionV2 = "Return401" + UnauthenticatedClientActionV2Return403 UnauthenticatedClientActionV2 = "Return403" +) + +// PossibleUnauthenticatedClientActionV2Values returns the possible values for the UnauthenticatedClientActionV2 const type. +func PossibleUnauthenticatedClientActionV2Values() []UnauthenticatedClientActionV2 { + return []UnauthenticatedClientActionV2{ + UnauthenticatedClientActionV2RedirectToLoginPage, + UnauthenticatedClientActionV2AllowAnonymous, + UnauthenticatedClientActionV2Return401, + UnauthenticatedClientActionV2Return403, + } +} + +// ToPtr returns a *UnauthenticatedClientActionV2 pointing to the current value. +func (c UnauthenticatedClientActionV2) ToPtr() *UnauthenticatedClientActionV2 { + return &c +} + +// UsageState - State indicating whether the app has exceeded its quota usage. Read-only. +type UsageState string + +const ( + UsageStateNormal UsageState = "Normal" + UsageStateExceeded UsageState = "Exceeded" +) + +// PossibleUsageStateValues returns the possible values for the UsageState const type. +func PossibleUsageStateValues() []UsageState { + return []UsageState{ + UsageStateNormal, + UsageStateExceeded, + } +} + +// ToPtr returns a *UsageState pointing to the current value. +func (c UsageState) ToPtr() *UsageState { + return &c +} + +// ValidateResourceTypes - Resource type used for verification. +type ValidateResourceTypes string + +const ( + ValidateResourceTypesMicrosoftWebHostingEnvironments ValidateResourceTypes = "Microsoft.Web/hostingEnvironments" + ValidateResourceTypesServerFarm ValidateResourceTypes = "ServerFarm" + ValidateResourceTypesSite ValidateResourceTypes = "Site" +) + +// PossibleValidateResourceTypesValues returns the possible values for the ValidateResourceTypes const type. +func PossibleValidateResourceTypesValues() []ValidateResourceTypes { + return []ValidateResourceTypes{ + ValidateResourceTypesMicrosoftWebHostingEnvironments, + ValidateResourceTypesServerFarm, + ValidateResourceTypesSite, + } +} + +// ToPtr returns a *ValidateResourceTypes pointing to the current value. +func (c ValidateResourceTypes) ToPtr() *ValidateResourceTypes { + return &c +} + +// WebJobType - Job type. +type WebJobType string + +const ( + WebJobTypeContinuous WebJobType = "Continuous" + WebJobTypeTriggered WebJobType = "Triggered" +) + +// PossibleWebJobTypeValues returns the possible values for the WebJobType const type. +func PossibleWebJobTypeValues() []WebJobType { + return []WebJobType{ + WebJobTypeContinuous, + WebJobTypeTriggered, + } +} + +// ToPtr returns a *WebJobType pointing to the current value. +func (c WebJobType) ToPtr() *WebJobType { + return &c +} + +// WorkerSizeOptions - Size of the machines. +type WorkerSizeOptions string + +const ( + WorkerSizeOptionsSmall WorkerSizeOptions = "Small" + WorkerSizeOptionsMedium WorkerSizeOptions = "Medium" + WorkerSizeOptionsLarge WorkerSizeOptions = "Large" + WorkerSizeOptionsD1 WorkerSizeOptions = "D1" + WorkerSizeOptionsD2 WorkerSizeOptions = "D2" + WorkerSizeOptionsD3 WorkerSizeOptions = "D3" + WorkerSizeOptionsSmallV3 WorkerSizeOptions = "SmallV3" + WorkerSizeOptionsMediumV3 WorkerSizeOptions = "MediumV3" + WorkerSizeOptionsLargeV3 WorkerSizeOptions = "LargeV3" + WorkerSizeOptionsNestedSmall WorkerSizeOptions = "NestedSmall" + WorkerSizeOptionsNestedSmallLinux WorkerSizeOptions = "NestedSmallLinux" + WorkerSizeOptionsDefault WorkerSizeOptions = "Default" +) + +// PossibleWorkerSizeOptionsValues returns the possible values for the WorkerSizeOptions const type. +func PossibleWorkerSizeOptionsValues() []WorkerSizeOptions { + return []WorkerSizeOptions{ + WorkerSizeOptionsSmall, + WorkerSizeOptionsMedium, + WorkerSizeOptionsLarge, + WorkerSizeOptionsD1, + WorkerSizeOptionsD2, + WorkerSizeOptionsD3, + WorkerSizeOptionsSmallV3, + WorkerSizeOptionsMediumV3, + WorkerSizeOptionsLargeV3, + WorkerSizeOptionsNestedSmall, + WorkerSizeOptionsNestedSmallLinux, + WorkerSizeOptionsDefault, + } +} + +// ToPtr returns a *WorkerSizeOptions pointing to the current value. +func (c WorkerSizeOptions) ToPtr() *WorkerSizeOptions { + return &c +} diff --git a/sdk/resourcemanager/appservice/armappservice/zz_generated_deletedwebapps_client.go b/sdk/resourcemanager/appservice/armappservice/zz_generated_deletedwebapps_client.go new file mode 100644 index 000000000000..836b2c74067d --- /dev/null +++ b/sdk/resourcemanager/appservice/armappservice/zz_generated_deletedwebapps_client.go @@ -0,0 +1,220 @@ +//go:build go1.16 +// +build go1.16 + +// 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. + +package armappservice + +import ( + "context" + "errors" + "fmt" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// DeletedWebAppsClient contains the methods for the DeletedWebApps group. +// Don't use this type directly, use NewDeletedWebAppsClient() instead. +type DeletedWebAppsClient struct { + ep string + pl runtime.Pipeline + subscriptionID string +} + +// NewDeletedWebAppsClient creates a new instance of DeletedWebAppsClient with the specified values. +func NewDeletedWebAppsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *DeletedWebAppsClient { + cp := arm.ClientOptions{} + if options != nil { + cp = *options + } + if len(cp.Host) == 0 { + cp.Host = arm.AzurePublicCloud + } + return &DeletedWebAppsClient{subscriptionID: subscriptionID, ep: string(cp.Host), pl: armruntime.NewPipeline(module, version, credential, &cp)} +} + +// GetDeletedWebAppByLocation - Description for Get deleted app for a subscription at location. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *DeletedWebAppsClient) GetDeletedWebAppByLocation(ctx context.Context, location string, deletedSiteID string, options *DeletedWebAppsGetDeletedWebAppByLocationOptions) (DeletedWebAppsGetDeletedWebAppByLocationResponse, error) { + req, err := client.getDeletedWebAppByLocationCreateRequest(ctx, location, deletedSiteID, options) + if err != nil { + return DeletedWebAppsGetDeletedWebAppByLocationResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return DeletedWebAppsGetDeletedWebAppByLocationResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return DeletedWebAppsGetDeletedWebAppByLocationResponse{}, client.getDeletedWebAppByLocationHandleError(resp) + } + return client.getDeletedWebAppByLocationHandleResponse(resp) +} + +// getDeletedWebAppByLocationCreateRequest creates the GetDeletedWebAppByLocation request. +func (client *DeletedWebAppsClient) getDeletedWebAppByLocationCreateRequest(ctx context.Context, location string, deletedSiteID string, options *DeletedWebAppsGetDeletedWebAppByLocationOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Web/locations/{location}/deletedSites/{deletedSiteId}" + if location == "" { + return nil, errors.New("parameter location cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) + if deletedSiteID == "" { + return nil, errors.New("parameter deletedSiteID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{deletedSiteId}", url.PathEscape(deletedSiteID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getDeletedWebAppByLocationHandleResponse handles the GetDeletedWebAppByLocation response. +func (client *DeletedWebAppsClient) getDeletedWebAppByLocationHandleResponse(resp *http.Response) (DeletedWebAppsGetDeletedWebAppByLocationResponse, error) { + result := DeletedWebAppsGetDeletedWebAppByLocationResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.DeletedSite); err != nil { + return DeletedWebAppsGetDeletedWebAppByLocationResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getDeletedWebAppByLocationHandleError handles the GetDeletedWebAppByLocation error response. +func (client *DeletedWebAppsClient) getDeletedWebAppByLocationHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// List - Description for Get all deleted apps for a subscription. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *DeletedWebAppsClient) List(options *DeletedWebAppsListOptions) *DeletedWebAppsListPager { + return &DeletedWebAppsListPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listCreateRequest(ctx, options) + }, + advancer: func(ctx context.Context, resp DeletedWebAppsListResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.DeletedWebAppCollection.NextLink) + }, + } +} + +// listCreateRequest creates the List request. +func (client *DeletedWebAppsClient) listCreateRequest(ctx context.Context, options *DeletedWebAppsListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Web/deletedSites" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listHandleResponse handles the List response. +func (client *DeletedWebAppsClient) listHandleResponse(resp *http.Response) (DeletedWebAppsListResponse, error) { + result := DeletedWebAppsListResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.DeletedWebAppCollection); err != nil { + return DeletedWebAppsListResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listHandleError handles the List error response. +func (client *DeletedWebAppsClient) listHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListByLocation - Description for Get all deleted apps for a subscription at location +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *DeletedWebAppsClient) ListByLocation(location string, options *DeletedWebAppsListByLocationOptions) *DeletedWebAppsListByLocationPager { + return &DeletedWebAppsListByLocationPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listByLocationCreateRequest(ctx, location, options) + }, + advancer: func(ctx context.Context, resp DeletedWebAppsListByLocationResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.DeletedWebAppCollection.NextLink) + }, + } +} + +// listByLocationCreateRequest creates the ListByLocation request. +func (client *DeletedWebAppsClient) listByLocationCreateRequest(ctx context.Context, location string, options *DeletedWebAppsListByLocationOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Web/locations/{location}/deletedSites" + if location == "" { + return nil, errors.New("parameter location cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listByLocationHandleResponse handles the ListByLocation response. +func (client *DeletedWebAppsClient) listByLocationHandleResponse(resp *http.Response) (DeletedWebAppsListByLocationResponse, error) { + result := DeletedWebAppsListByLocationResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.DeletedWebAppCollection); err != nil { + return DeletedWebAppsListByLocationResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listByLocationHandleError handles the ListByLocation error response. +func (client *DeletedWebAppsClient) listByLocationHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} diff --git a/sdk/resourcemanager/appservice/armappservice/zz_generated_diagnostics_client.go b/sdk/resourcemanager/appservice/armappservice/zz_generated_diagnostics_client.go new file mode 100644 index 000000000000..8141d0aecd85 --- /dev/null +++ b/sdk/resourcemanager/appservice/armappservice/zz_generated_diagnostics_client.go @@ -0,0 +1,1650 @@ +//go:build go1.16 +// +build go1.16 + +// 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. + +package armappservice + +import ( + "context" + "errors" + "fmt" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" + "time" +) + +// DiagnosticsClient contains the methods for the Diagnostics group. +// Don't use this type directly, use NewDiagnosticsClient() instead. +type DiagnosticsClient struct { + ep string + pl runtime.Pipeline + subscriptionID string +} + +// NewDiagnosticsClient creates a new instance of DiagnosticsClient with the specified values. +func NewDiagnosticsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *DiagnosticsClient { + cp := arm.ClientOptions{} + if options != nil { + cp = *options + } + if len(cp.Host) == 0 { + cp.Host = arm.AzurePublicCloud + } + return &DiagnosticsClient{subscriptionID: subscriptionID, ep: string(cp.Host), pl: armruntime.NewPipeline(module, version, credential, &cp)} +} + +// ExecuteSiteAnalysis - Description for Execute Analysis +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *DiagnosticsClient) ExecuteSiteAnalysis(ctx context.Context, resourceGroupName string, siteName string, diagnosticCategory string, analysisName string, options *DiagnosticsExecuteSiteAnalysisOptions) (DiagnosticsExecuteSiteAnalysisResponse, error) { + req, err := client.executeSiteAnalysisCreateRequest(ctx, resourceGroupName, siteName, diagnosticCategory, analysisName, options) + if err != nil { + return DiagnosticsExecuteSiteAnalysisResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return DiagnosticsExecuteSiteAnalysisResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return DiagnosticsExecuteSiteAnalysisResponse{}, client.executeSiteAnalysisHandleError(resp) + } + return client.executeSiteAnalysisHandleResponse(resp) +} + +// executeSiteAnalysisCreateRequest creates the ExecuteSiteAnalysis request. +func (client *DiagnosticsClient) executeSiteAnalysisCreateRequest(ctx context.Context, resourceGroupName string, siteName string, diagnosticCategory string, analysisName string, options *DiagnosticsExecuteSiteAnalysisOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/diagnostics/{diagnosticCategory}/analyses/{analysisName}/execute" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if siteName == "" { + return nil, errors.New("parameter siteName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{siteName}", url.PathEscape(siteName)) + if diagnosticCategory == "" { + return nil, errors.New("parameter diagnosticCategory cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{diagnosticCategory}", url.PathEscape(diagnosticCategory)) + if analysisName == "" { + return nil, errors.New("parameter analysisName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{analysisName}", url.PathEscape(analysisName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + if options != nil && options.StartTime != nil { + reqQP.Set("startTime", options.StartTime.Format(time.RFC3339Nano)) + } + if options != nil && options.EndTime != nil { + reqQP.Set("endTime", options.EndTime.Format(time.RFC3339Nano)) + } + if options != nil && options.TimeGrain != nil { + reqQP.Set("timeGrain", *options.TimeGrain) + } + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// executeSiteAnalysisHandleResponse handles the ExecuteSiteAnalysis response. +func (client *DiagnosticsClient) executeSiteAnalysisHandleResponse(resp *http.Response) (DiagnosticsExecuteSiteAnalysisResponse, error) { + result := DiagnosticsExecuteSiteAnalysisResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.DiagnosticAnalysis); err != nil { + return DiagnosticsExecuteSiteAnalysisResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// executeSiteAnalysisHandleError handles the ExecuteSiteAnalysis error response. +func (client *DiagnosticsClient) executeSiteAnalysisHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ExecuteSiteAnalysisSlot - Description for Execute Analysis +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *DiagnosticsClient) ExecuteSiteAnalysisSlot(ctx context.Context, resourceGroupName string, siteName string, diagnosticCategory string, analysisName string, slot string, options *DiagnosticsExecuteSiteAnalysisSlotOptions) (DiagnosticsExecuteSiteAnalysisSlotResponse, error) { + req, err := client.executeSiteAnalysisSlotCreateRequest(ctx, resourceGroupName, siteName, diagnosticCategory, analysisName, slot, options) + if err != nil { + return DiagnosticsExecuteSiteAnalysisSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return DiagnosticsExecuteSiteAnalysisSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return DiagnosticsExecuteSiteAnalysisSlotResponse{}, client.executeSiteAnalysisSlotHandleError(resp) + } + return client.executeSiteAnalysisSlotHandleResponse(resp) +} + +// executeSiteAnalysisSlotCreateRequest creates the ExecuteSiteAnalysisSlot request. +func (client *DiagnosticsClient) executeSiteAnalysisSlotCreateRequest(ctx context.Context, resourceGroupName string, siteName string, diagnosticCategory string, analysisName string, slot string, options *DiagnosticsExecuteSiteAnalysisSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slot}/diagnostics/{diagnosticCategory}/analyses/{analysisName}/execute" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if siteName == "" { + return nil, errors.New("parameter siteName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{siteName}", url.PathEscape(siteName)) + if diagnosticCategory == "" { + return nil, errors.New("parameter diagnosticCategory cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{diagnosticCategory}", url.PathEscape(diagnosticCategory)) + if analysisName == "" { + return nil, errors.New("parameter analysisName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{analysisName}", url.PathEscape(analysisName)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + if options != nil && options.StartTime != nil { + reqQP.Set("startTime", options.StartTime.Format(time.RFC3339Nano)) + } + if options != nil && options.EndTime != nil { + reqQP.Set("endTime", options.EndTime.Format(time.RFC3339Nano)) + } + if options != nil && options.TimeGrain != nil { + reqQP.Set("timeGrain", *options.TimeGrain) + } + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// executeSiteAnalysisSlotHandleResponse handles the ExecuteSiteAnalysisSlot response. +func (client *DiagnosticsClient) executeSiteAnalysisSlotHandleResponse(resp *http.Response) (DiagnosticsExecuteSiteAnalysisSlotResponse, error) { + result := DiagnosticsExecuteSiteAnalysisSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.DiagnosticAnalysis); err != nil { + return DiagnosticsExecuteSiteAnalysisSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// executeSiteAnalysisSlotHandleError handles the ExecuteSiteAnalysisSlot error response. +func (client *DiagnosticsClient) executeSiteAnalysisSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ExecuteSiteDetector - Description for Execute Detector +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *DiagnosticsClient) ExecuteSiteDetector(ctx context.Context, resourceGroupName string, siteName string, detectorName string, diagnosticCategory string, options *DiagnosticsExecuteSiteDetectorOptions) (DiagnosticsExecuteSiteDetectorResponse, error) { + req, err := client.executeSiteDetectorCreateRequest(ctx, resourceGroupName, siteName, detectorName, diagnosticCategory, options) + if err != nil { + return DiagnosticsExecuteSiteDetectorResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return DiagnosticsExecuteSiteDetectorResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return DiagnosticsExecuteSiteDetectorResponse{}, client.executeSiteDetectorHandleError(resp) + } + return client.executeSiteDetectorHandleResponse(resp) +} + +// executeSiteDetectorCreateRequest creates the ExecuteSiteDetector request. +func (client *DiagnosticsClient) executeSiteDetectorCreateRequest(ctx context.Context, resourceGroupName string, siteName string, detectorName string, diagnosticCategory string, options *DiagnosticsExecuteSiteDetectorOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/diagnostics/{diagnosticCategory}/detectors/{detectorName}/execute" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if siteName == "" { + return nil, errors.New("parameter siteName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{siteName}", url.PathEscape(siteName)) + if detectorName == "" { + return nil, errors.New("parameter detectorName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{detectorName}", url.PathEscape(detectorName)) + if diagnosticCategory == "" { + return nil, errors.New("parameter diagnosticCategory cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{diagnosticCategory}", url.PathEscape(diagnosticCategory)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + if options != nil && options.StartTime != nil { + reqQP.Set("startTime", options.StartTime.Format(time.RFC3339Nano)) + } + if options != nil && options.EndTime != nil { + reqQP.Set("endTime", options.EndTime.Format(time.RFC3339Nano)) + } + if options != nil && options.TimeGrain != nil { + reqQP.Set("timeGrain", *options.TimeGrain) + } + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// executeSiteDetectorHandleResponse handles the ExecuteSiteDetector response. +func (client *DiagnosticsClient) executeSiteDetectorHandleResponse(resp *http.Response) (DiagnosticsExecuteSiteDetectorResponse, error) { + result := DiagnosticsExecuteSiteDetectorResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.DiagnosticDetectorResponse); err != nil { + return DiagnosticsExecuteSiteDetectorResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// executeSiteDetectorHandleError handles the ExecuteSiteDetector error response. +func (client *DiagnosticsClient) executeSiteDetectorHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ExecuteSiteDetectorSlot - Description for Execute Detector +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *DiagnosticsClient) ExecuteSiteDetectorSlot(ctx context.Context, resourceGroupName string, siteName string, detectorName string, diagnosticCategory string, slot string, options *DiagnosticsExecuteSiteDetectorSlotOptions) (DiagnosticsExecuteSiteDetectorSlotResponse, error) { + req, err := client.executeSiteDetectorSlotCreateRequest(ctx, resourceGroupName, siteName, detectorName, diagnosticCategory, slot, options) + if err != nil { + return DiagnosticsExecuteSiteDetectorSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return DiagnosticsExecuteSiteDetectorSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return DiagnosticsExecuteSiteDetectorSlotResponse{}, client.executeSiteDetectorSlotHandleError(resp) + } + return client.executeSiteDetectorSlotHandleResponse(resp) +} + +// executeSiteDetectorSlotCreateRequest creates the ExecuteSiteDetectorSlot request. +func (client *DiagnosticsClient) executeSiteDetectorSlotCreateRequest(ctx context.Context, resourceGroupName string, siteName string, detectorName string, diagnosticCategory string, slot string, options *DiagnosticsExecuteSiteDetectorSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slot}/diagnostics/{diagnosticCategory}/detectors/{detectorName}/execute" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if siteName == "" { + return nil, errors.New("parameter siteName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{siteName}", url.PathEscape(siteName)) + if detectorName == "" { + return nil, errors.New("parameter detectorName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{detectorName}", url.PathEscape(detectorName)) + if diagnosticCategory == "" { + return nil, errors.New("parameter diagnosticCategory cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{diagnosticCategory}", url.PathEscape(diagnosticCategory)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + if options != nil && options.StartTime != nil { + reqQP.Set("startTime", options.StartTime.Format(time.RFC3339Nano)) + } + if options != nil && options.EndTime != nil { + reqQP.Set("endTime", options.EndTime.Format(time.RFC3339Nano)) + } + if options != nil && options.TimeGrain != nil { + reqQP.Set("timeGrain", *options.TimeGrain) + } + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// executeSiteDetectorSlotHandleResponse handles the ExecuteSiteDetectorSlot response. +func (client *DiagnosticsClient) executeSiteDetectorSlotHandleResponse(resp *http.Response) (DiagnosticsExecuteSiteDetectorSlotResponse, error) { + result := DiagnosticsExecuteSiteDetectorSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.DiagnosticDetectorResponse); err != nil { + return DiagnosticsExecuteSiteDetectorSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// executeSiteDetectorSlotHandleError handles the ExecuteSiteDetectorSlot error response. +func (client *DiagnosticsClient) executeSiteDetectorSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetHostingEnvironmentDetectorResponse - Description for Get Hosting Environment Detector Response +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *DiagnosticsClient) GetHostingEnvironmentDetectorResponse(ctx context.Context, resourceGroupName string, name string, detectorName string, options *DiagnosticsGetHostingEnvironmentDetectorResponseOptions) (DiagnosticsGetHostingEnvironmentDetectorResponseResponse, error) { + req, err := client.getHostingEnvironmentDetectorResponseCreateRequest(ctx, resourceGroupName, name, detectorName, options) + if err != nil { + return DiagnosticsGetHostingEnvironmentDetectorResponseResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return DiagnosticsGetHostingEnvironmentDetectorResponseResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return DiagnosticsGetHostingEnvironmentDetectorResponseResponse{}, client.getHostingEnvironmentDetectorResponseHandleError(resp) + } + return client.getHostingEnvironmentDetectorResponseHandleResponse(resp) +} + +// getHostingEnvironmentDetectorResponseCreateRequest creates the GetHostingEnvironmentDetectorResponse request. +func (client *DiagnosticsClient) getHostingEnvironmentDetectorResponseCreateRequest(ctx context.Context, resourceGroupName string, name string, detectorName string, options *DiagnosticsGetHostingEnvironmentDetectorResponseOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/detectors/{detectorName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if detectorName == "" { + return nil, errors.New("parameter detectorName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{detectorName}", url.PathEscape(detectorName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + if options != nil && options.StartTime != nil { + reqQP.Set("startTime", options.StartTime.Format(time.RFC3339Nano)) + } + if options != nil && options.EndTime != nil { + reqQP.Set("endTime", options.EndTime.Format(time.RFC3339Nano)) + } + if options != nil && options.TimeGrain != nil { + reqQP.Set("timeGrain", *options.TimeGrain) + } + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getHostingEnvironmentDetectorResponseHandleResponse handles the GetHostingEnvironmentDetectorResponse response. +func (client *DiagnosticsClient) getHostingEnvironmentDetectorResponseHandleResponse(resp *http.Response) (DiagnosticsGetHostingEnvironmentDetectorResponseResponse, error) { + result := DiagnosticsGetHostingEnvironmentDetectorResponseResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.DetectorResponse); err != nil { + return DiagnosticsGetHostingEnvironmentDetectorResponseResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getHostingEnvironmentDetectorResponseHandleError handles the GetHostingEnvironmentDetectorResponse error response. +func (client *DiagnosticsClient) getHostingEnvironmentDetectorResponseHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetSiteAnalysis - Description for Get Site Analysis +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *DiagnosticsClient) GetSiteAnalysis(ctx context.Context, resourceGroupName string, siteName string, diagnosticCategory string, analysisName string, options *DiagnosticsGetSiteAnalysisOptions) (DiagnosticsGetSiteAnalysisResponse, error) { + req, err := client.getSiteAnalysisCreateRequest(ctx, resourceGroupName, siteName, diagnosticCategory, analysisName, options) + if err != nil { + return DiagnosticsGetSiteAnalysisResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return DiagnosticsGetSiteAnalysisResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return DiagnosticsGetSiteAnalysisResponse{}, client.getSiteAnalysisHandleError(resp) + } + return client.getSiteAnalysisHandleResponse(resp) +} + +// getSiteAnalysisCreateRequest creates the GetSiteAnalysis request. +func (client *DiagnosticsClient) getSiteAnalysisCreateRequest(ctx context.Context, resourceGroupName string, siteName string, diagnosticCategory string, analysisName string, options *DiagnosticsGetSiteAnalysisOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/diagnostics/{diagnosticCategory}/analyses/{analysisName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if siteName == "" { + return nil, errors.New("parameter siteName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{siteName}", url.PathEscape(siteName)) + if diagnosticCategory == "" { + return nil, errors.New("parameter diagnosticCategory cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{diagnosticCategory}", url.PathEscape(diagnosticCategory)) + if analysisName == "" { + return nil, errors.New("parameter analysisName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{analysisName}", url.PathEscape(analysisName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getSiteAnalysisHandleResponse handles the GetSiteAnalysis response. +func (client *DiagnosticsClient) getSiteAnalysisHandleResponse(resp *http.Response) (DiagnosticsGetSiteAnalysisResponse, error) { + result := DiagnosticsGetSiteAnalysisResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.AnalysisDefinition); err != nil { + return DiagnosticsGetSiteAnalysisResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getSiteAnalysisHandleError handles the GetSiteAnalysis error response. +func (client *DiagnosticsClient) getSiteAnalysisHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetSiteAnalysisSlot - Description for Get Site Analysis +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *DiagnosticsClient) GetSiteAnalysisSlot(ctx context.Context, resourceGroupName string, siteName string, diagnosticCategory string, analysisName string, slot string, options *DiagnosticsGetSiteAnalysisSlotOptions) (DiagnosticsGetSiteAnalysisSlotResponse, error) { + req, err := client.getSiteAnalysisSlotCreateRequest(ctx, resourceGroupName, siteName, diagnosticCategory, analysisName, slot, options) + if err != nil { + return DiagnosticsGetSiteAnalysisSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return DiagnosticsGetSiteAnalysisSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return DiagnosticsGetSiteAnalysisSlotResponse{}, client.getSiteAnalysisSlotHandleError(resp) + } + return client.getSiteAnalysisSlotHandleResponse(resp) +} + +// getSiteAnalysisSlotCreateRequest creates the GetSiteAnalysisSlot request. +func (client *DiagnosticsClient) getSiteAnalysisSlotCreateRequest(ctx context.Context, resourceGroupName string, siteName string, diagnosticCategory string, analysisName string, slot string, options *DiagnosticsGetSiteAnalysisSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slot}/diagnostics/{diagnosticCategory}/analyses/{analysisName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if siteName == "" { + return nil, errors.New("parameter siteName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{siteName}", url.PathEscape(siteName)) + if diagnosticCategory == "" { + return nil, errors.New("parameter diagnosticCategory cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{diagnosticCategory}", url.PathEscape(diagnosticCategory)) + if analysisName == "" { + return nil, errors.New("parameter analysisName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{analysisName}", url.PathEscape(analysisName)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getSiteAnalysisSlotHandleResponse handles the GetSiteAnalysisSlot response. +func (client *DiagnosticsClient) getSiteAnalysisSlotHandleResponse(resp *http.Response) (DiagnosticsGetSiteAnalysisSlotResponse, error) { + result := DiagnosticsGetSiteAnalysisSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.AnalysisDefinition); err != nil { + return DiagnosticsGetSiteAnalysisSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getSiteAnalysisSlotHandleError handles the GetSiteAnalysisSlot error response. +func (client *DiagnosticsClient) getSiteAnalysisSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetSiteDetector - Description for Get Detector +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *DiagnosticsClient) GetSiteDetector(ctx context.Context, resourceGroupName string, siteName string, diagnosticCategory string, detectorName string, options *DiagnosticsGetSiteDetectorOptions) (DiagnosticsGetSiteDetectorResponse, error) { + req, err := client.getSiteDetectorCreateRequest(ctx, resourceGroupName, siteName, diagnosticCategory, detectorName, options) + if err != nil { + return DiagnosticsGetSiteDetectorResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return DiagnosticsGetSiteDetectorResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return DiagnosticsGetSiteDetectorResponse{}, client.getSiteDetectorHandleError(resp) + } + return client.getSiteDetectorHandleResponse(resp) +} + +// getSiteDetectorCreateRequest creates the GetSiteDetector request. +func (client *DiagnosticsClient) getSiteDetectorCreateRequest(ctx context.Context, resourceGroupName string, siteName string, diagnosticCategory string, detectorName string, options *DiagnosticsGetSiteDetectorOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/diagnostics/{diagnosticCategory}/detectors/{detectorName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if siteName == "" { + return nil, errors.New("parameter siteName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{siteName}", url.PathEscape(siteName)) + if diagnosticCategory == "" { + return nil, errors.New("parameter diagnosticCategory cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{diagnosticCategory}", url.PathEscape(diagnosticCategory)) + if detectorName == "" { + return nil, errors.New("parameter detectorName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{detectorName}", url.PathEscape(detectorName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getSiteDetectorHandleResponse handles the GetSiteDetector response. +func (client *DiagnosticsClient) getSiteDetectorHandleResponse(resp *http.Response) (DiagnosticsGetSiteDetectorResponse, error) { + result := DiagnosticsGetSiteDetectorResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.DetectorDefinitionResource); err != nil { + return DiagnosticsGetSiteDetectorResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getSiteDetectorHandleError handles the GetSiteDetector error response. +func (client *DiagnosticsClient) getSiteDetectorHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetSiteDetectorResponse - Description for Get site detector response +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *DiagnosticsClient) GetSiteDetectorResponse(ctx context.Context, resourceGroupName string, siteName string, detectorName string, options *DiagnosticsGetSiteDetectorResponseOptions) (DiagnosticsGetSiteDetectorResponseResponse, error) { + req, err := client.getSiteDetectorResponseCreateRequest(ctx, resourceGroupName, siteName, detectorName, options) + if err != nil { + return DiagnosticsGetSiteDetectorResponseResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return DiagnosticsGetSiteDetectorResponseResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return DiagnosticsGetSiteDetectorResponseResponse{}, client.getSiteDetectorResponseHandleError(resp) + } + return client.getSiteDetectorResponseHandleResponse(resp) +} + +// getSiteDetectorResponseCreateRequest creates the GetSiteDetectorResponse request. +func (client *DiagnosticsClient) getSiteDetectorResponseCreateRequest(ctx context.Context, resourceGroupName string, siteName string, detectorName string, options *DiagnosticsGetSiteDetectorResponseOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/detectors/{detectorName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if siteName == "" { + return nil, errors.New("parameter siteName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{siteName}", url.PathEscape(siteName)) + if detectorName == "" { + return nil, errors.New("parameter detectorName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{detectorName}", url.PathEscape(detectorName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + if options != nil && options.StartTime != nil { + reqQP.Set("startTime", options.StartTime.Format(time.RFC3339Nano)) + } + if options != nil && options.EndTime != nil { + reqQP.Set("endTime", options.EndTime.Format(time.RFC3339Nano)) + } + if options != nil && options.TimeGrain != nil { + reqQP.Set("timeGrain", *options.TimeGrain) + } + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getSiteDetectorResponseHandleResponse handles the GetSiteDetectorResponse response. +func (client *DiagnosticsClient) getSiteDetectorResponseHandleResponse(resp *http.Response) (DiagnosticsGetSiteDetectorResponseResponse, error) { + result := DiagnosticsGetSiteDetectorResponseResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.DetectorResponse); err != nil { + return DiagnosticsGetSiteDetectorResponseResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getSiteDetectorResponseHandleError handles the GetSiteDetectorResponse error response. +func (client *DiagnosticsClient) getSiteDetectorResponseHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetSiteDetectorResponseSlot - Description for Get site detector response +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *DiagnosticsClient) GetSiteDetectorResponseSlot(ctx context.Context, resourceGroupName string, siteName string, detectorName string, slot string, options *DiagnosticsGetSiteDetectorResponseSlotOptions) (DiagnosticsGetSiteDetectorResponseSlotResponse, error) { + req, err := client.getSiteDetectorResponseSlotCreateRequest(ctx, resourceGroupName, siteName, detectorName, slot, options) + if err != nil { + return DiagnosticsGetSiteDetectorResponseSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return DiagnosticsGetSiteDetectorResponseSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return DiagnosticsGetSiteDetectorResponseSlotResponse{}, client.getSiteDetectorResponseSlotHandleError(resp) + } + return client.getSiteDetectorResponseSlotHandleResponse(resp) +} + +// getSiteDetectorResponseSlotCreateRequest creates the GetSiteDetectorResponseSlot request. +func (client *DiagnosticsClient) getSiteDetectorResponseSlotCreateRequest(ctx context.Context, resourceGroupName string, siteName string, detectorName string, slot string, options *DiagnosticsGetSiteDetectorResponseSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slot}/detectors/{detectorName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if siteName == "" { + return nil, errors.New("parameter siteName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{siteName}", url.PathEscape(siteName)) + if detectorName == "" { + return nil, errors.New("parameter detectorName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{detectorName}", url.PathEscape(detectorName)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + if options != nil && options.StartTime != nil { + reqQP.Set("startTime", options.StartTime.Format(time.RFC3339Nano)) + } + if options != nil && options.EndTime != nil { + reqQP.Set("endTime", options.EndTime.Format(time.RFC3339Nano)) + } + if options != nil && options.TimeGrain != nil { + reqQP.Set("timeGrain", *options.TimeGrain) + } + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getSiteDetectorResponseSlotHandleResponse handles the GetSiteDetectorResponseSlot response. +func (client *DiagnosticsClient) getSiteDetectorResponseSlotHandleResponse(resp *http.Response) (DiagnosticsGetSiteDetectorResponseSlotResponse, error) { + result := DiagnosticsGetSiteDetectorResponseSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.DetectorResponse); err != nil { + return DiagnosticsGetSiteDetectorResponseSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getSiteDetectorResponseSlotHandleError handles the GetSiteDetectorResponseSlot error response. +func (client *DiagnosticsClient) getSiteDetectorResponseSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetSiteDetectorSlot - Description for Get Detector +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *DiagnosticsClient) GetSiteDetectorSlot(ctx context.Context, resourceGroupName string, siteName string, diagnosticCategory string, detectorName string, slot string, options *DiagnosticsGetSiteDetectorSlotOptions) (DiagnosticsGetSiteDetectorSlotResponse, error) { + req, err := client.getSiteDetectorSlotCreateRequest(ctx, resourceGroupName, siteName, diagnosticCategory, detectorName, slot, options) + if err != nil { + return DiagnosticsGetSiteDetectorSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return DiagnosticsGetSiteDetectorSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return DiagnosticsGetSiteDetectorSlotResponse{}, client.getSiteDetectorSlotHandleError(resp) + } + return client.getSiteDetectorSlotHandleResponse(resp) +} + +// getSiteDetectorSlotCreateRequest creates the GetSiteDetectorSlot request. +func (client *DiagnosticsClient) getSiteDetectorSlotCreateRequest(ctx context.Context, resourceGroupName string, siteName string, diagnosticCategory string, detectorName string, slot string, options *DiagnosticsGetSiteDetectorSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slot}/diagnostics/{diagnosticCategory}/detectors/{detectorName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if siteName == "" { + return nil, errors.New("parameter siteName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{siteName}", url.PathEscape(siteName)) + if diagnosticCategory == "" { + return nil, errors.New("parameter diagnosticCategory cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{diagnosticCategory}", url.PathEscape(diagnosticCategory)) + if detectorName == "" { + return nil, errors.New("parameter detectorName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{detectorName}", url.PathEscape(detectorName)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getSiteDetectorSlotHandleResponse handles the GetSiteDetectorSlot response. +func (client *DiagnosticsClient) getSiteDetectorSlotHandleResponse(resp *http.Response) (DiagnosticsGetSiteDetectorSlotResponse, error) { + result := DiagnosticsGetSiteDetectorSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.DetectorDefinitionResource); err != nil { + return DiagnosticsGetSiteDetectorSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getSiteDetectorSlotHandleError handles the GetSiteDetectorSlot error response. +func (client *DiagnosticsClient) getSiteDetectorSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetSiteDiagnosticCategory - Description for Get Diagnostics Category +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *DiagnosticsClient) GetSiteDiagnosticCategory(ctx context.Context, resourceGroupName string, siteName string, diagnosticCategory string, options *DiagnosticsGetSiteDiagnosticCategoryOptions) (DiagnosticsGetSiteDiagnosticCategoryResponse, error) { + req, err := client.getSiteDiagnosticCategoryCreateRequest(ctx, resourceGroupName, siteName, diagnosticCategory, options) + if err != nil { + return DiagnosticsGetSiteDiagnosticCategoryResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return DiagnosticsGetSiteDiagnosticCategoryResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return DiagnosticsGetSiteDiagnosticCategoryResponse{}, client.getSiteDiagnosticCategoryHandleError(resp) + } + return client.getSiteDiagnosticCategoryHandleResponse(resp) +} + +// getSiteDiagnosticCategoryCreateRequest creates the GetSiteDiagnosticCategory request. +func (client *DiagnosticsClient) getSiteDiagnosticCategoryCreateRequest(ctx context.Context, resourceGroupName string, siteName string, diagnosticCategory string, options *DiagnosticsGetSiteDiagnosticCategoryOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/diagnostics/{diagnosticCategory}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if siteName == "" { + return nil, errors.New("parameter siteName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{siteName}", url.PathEscape(siteName)) + if diagnosticCategory == "" { + return nil, errors.New("parameter diagnosticCategory cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{diagnosticCategory}", url.PathEscape(diagnosticCategory)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getSiteDiagnosticCategoryHandleResponse handles the GetSiteDiagnosticCategory response. +func (client *DiagnosticsClient) getSiteDiagnosticCategoryHandleResponse(resp *http.Response) (DiagnosticsGetSiteDiagnosticCategoryResponse, error) { + result := DiagnosticsGetSiteDiagnosticCategoryResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.DiagnosticCategory); err != nil { + return DiagnosticsGetSiteDiagnosticCategoryResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getSiteDiagnosticCategoryHandleError handles the GetSiteDiagnosticCategory error response. +func (client *DiagnosticsClient) getSiteDiagnosticCategoryHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetSiteDiagnosticCategorySlot - Description for Get Diagnostics Category +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *DiagnosticsClient) GetSiteDiagnosticCategorySlot(ctx context.Context, resourceGroupName string, siteName string, diagnosticCategory string, slot string, options *DiagnosticsGetSiteDiagnosticCategorySlotOptions) (DiagnosticsGetSiteDiagnosticCategorySlotResponse, error) { + req, err := client.getSiteDiagnosticCategorySlotCreateRequest(ctx, resourceGroupName, siteName, diagnosticCategory, slot, options) + if err != nil { + return DiagnosticsGetSiteDiagnosticCategorySlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return DiagnosticsGetSiteDiagnosticCategorySlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return DiagnosticsGetSiteDiagnosticCategorySlotResponse{}, client.getSiteDiagnosticCategorySlotHandleError(resp) + } + return client.getSiteDiagnosticCategorySlotHandleResponse(resp) +} + +// getSiteDiagnosticCategorySlotCreateRequest creates the GetSiteDiagnosticCategorySlot request. +func (client *DiagnosticsClient) getSiteDiagnosticCategorySlotCreateRequest(ctx context.Context, resourceGroupName string, siteName string, diagnosticCategory string, slot string, options *DiagnosticsGetSiteDiagnosticCategorySlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slot}/diagnostics/{diagnosticCategory}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if siteName == "" { + return nil, errors.New("parameter siteName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{siteName}", url.PathEscape(siteName)) + if diagnosticCategory == "" { + return nil, errors.New("parameter diagnosticCategory cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{diagnosticCategory}", url.PathEscape(diagnosticCategory)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getSiteDiagnosticCategorySlotHandleResponse handles the GetSiteDiagnosticCategorySlot response. +func (client *DiagnosticsClient) getSiteDiagnosticCategorySlotHandleResponse(resp *http.Response) (DiagnosticsGetSiteDiagnosticCategorySlotResponse, error) { + result := DiagnosticsGetSiteDiagnosticCategorySlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.DiagnosticCategory); err != nil { + return DiagnosticsGetSiteDiagnosticCategorySlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getSiteDiagnosticCategorySlotHandleError handles the GetSiteDiagnosticCategorySlot error response. +func (client *DiagnosticsClient) getSiteDiagnosticCategorySlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListHostingEnvironmentDetectorResponses - Description for List Hosting Environment Detector Responses +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *DiagnosticsClient) ListHostingEnvironmentDetectorResponses(resourceGroupName string, name string, options *DiagnosticsListHostingEnvironmentDetectorResponsesOptions) *DiagnosticsListHostingEnvironmentDetectorResponsesPager { + return &DiagnosticsListHostingEnvironmentDetectorResponsesPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listHostingEnvironmentDetectorResponsesCreateRequest(ctx, resourceGroupName, name, options) + }, + advancer: func(ctx context.Context, resp DiagnosticsListHostingEnvironmentDetectorResponsesResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.DetectorResponseCollection.NextLink) + }, + } +} + +// listHostingEnvironmentDetectorResponsesCreateRequest creates the ListHostingEnvironmentDetectorResponses request. +func (client *DiagnosticsClient) listHostingEnvironmentDetectorResponsesCreateRequest(ctx context.Context, resourceGroupName string, name string, options *DiagnosticsListHostingEnvironmentDetectorResponsesOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/detectors" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listHostingEnvironmentDetectorResponsesHandleResponse handles the ListHostingEnvironmentDetectorResponses response. +func (client *DiagnosticsClient) listHostingEnvironmentDetectorResponsesHandleResponse(resp *http.Response) (DiagnosticsListHostingEnvironmentDetectorResponsesResponse, error) { + result := DiagnosticsListHostingEnvironmentDetectorResponsesResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.DetectorResponseCollection); err != nil { + return DiagnosticsListHostingEnvironmentDetectorResponsesResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listHostingEnvironmentDetectorResponsesHandleError handles the ListHostingEnvironmentDetectorResponses error response. +func (client *DiagnosticsClient) listHostingEnvironmentDetectorResponsesHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListSiteAnalyses - Description for Get Site Analyses +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *DiagnosticsClient) ListSiteAnalyses(resourceGroupName string, siteName string, diagnosticCategory string, options *DiagnosticsListSiteAnalysesOptions) *DiagnosticsListSiteAnalysesPager { + return &DiagnosticsListSiteAnalysesPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listSiteAnalysesCreateRequest(ctx, resourceGroupName, siteName, diagnosticCategory, options) + }, + advancer: func(ctx context.Context, resp DiagnosticsListSiteAnalysesResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.DiagnosticAnalysisCollection.NextLink) + }, + } +} + +// listSiteAnalysesCreateRequest creates the ListSiteAnalyses request. +func (client *DiagnosticsClient) listSiteAnalysesCreateRequest(ctx context.Context, resourceGroupName string, siteName string, diagnosticCategory string, options *DiagnosticsListSiteAnalysesOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/diagnostics/{diagnosticCategory}/analyses" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if siteName == "" { + return nil, errors.New("parameter siteName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{siteName}", url.PathEscape(siteName)) + if diagnosticCategory == "" { + return nil, errors.New("parameter diagnosticCategory cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{diagnosticCategory}", url.PathEscape(diagnosticCategory)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listSiteAnalysesHandleResponse handles the ListSiteAnalyses response. +func (client *DiagnosticsClient) listSiteAnalysesHandleResponse(resp *http.Response) (DiagnosticsListSiteAnalysesResponse, error) { + result := DiagnosticsListSiteAnalysesResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.DiagnosticAnalysisCollection); err != nil { + return DiagnosticsListSiteAnalysesResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listSiteAnalysesHandleError handles the ListSiteAnalyses error response. +func (client *DiagnosticsClient) listSiteAnalysesHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListSiteAnalysesSlot - Description for Get Site Analyses +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *DiagnosticsClient) ListSiteAnalysesSlot(resourceGroupName string, siteName string, diagnosticCategory string, slot string, options *DiagnosticsListSiteAnalysesSlotOptions) *DiagnosticsListSiteAnalysesSlotPager { + return &DiagnosticsListSiteAnalysesSlotPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listSiteAnalysesSlotCreateRequest(ctx, resourceGroupName, siteName, diagnosticCategory, slot, options) + }, + advancer: func(ctx context.Context, resp DiagnosticsListSiteAnalysesSlotResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.DiagnosticAnalysisCollection.NextLink) + }, + } +} + +// listSiteAnalysesSlotCreateRequest creates the ListSiteAnalysesSlot request. +func (client *DiagnosticsClient) listSiteAnalysesSlotCreateRequest(ctx context.Context, resourceGroupName string, siteName string, diagnosticCategory string, slot string, options *DiagnosticsListSiteAnalysesSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slot}/diagnostics/{diagnosticCategory}/analyses" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if siteName == "" { + return nil, errors.New("parameter siteName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{siteName}", url.PathEscape(siteName)) + if diagnosticCategory == "" { + return nil, errors.New("parameter diagnosticCategory cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{diagnosticCategory}", url.PathEscape(diagnosticCategory)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listSiteAnalysesSlotHandleResponse handles the ListSiteAnalysesSlot response. +func (client *DiagnosticsClient) listSiteAnalysesSlotHandleResponse(resp *http.Response) (DiagnosticsListSiteAnalysesSlotResponse, error) { + result := DiagnosticsListSiteAnalysesSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.DiagnosticAnalysisCollection); err != nil { + return DiagnosticsListSiteAnalysesSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listSiteAnalysesSlotHandleError handles the ListSiteAnalysesSlot error response. +func (client *DiagnosticsClient) listSiteAnalysesSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListSiteDetectorResponses - Description for List Site Detector Responses +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *DiagnosticsClient) ListSiteDetectorResponses(resourceGroupName string, siteName string, options *DiagnosticsListSiteDetectorResponsesOptions) *DiagnosticsListSiteDetectorResponsesPager { + return &DiagnosticsListSiteDetectorResponsesPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listSiteDetectorResponsesCreateRequest(ctx, resourceGroupName, siteName, options) + }, + advancer: func(ctx context.Context, resp DiagnosticsListSiteDetectorResponsesResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.DetectorResponseCollection.NextLink) + }, + } +} + +// listSiteDetectorResponsesCreateRequest creates the ListSiteDetectorResponses request. +func (client *DiagnosticsClient) listSiteDetectorResponsesCreateRequest(ctx context.Context, resourceGroupName string, siteName string, options *DiagnosticsListSiteDetectorResponsesOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/detectors" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if siteName == "" { + return nil, errors.New("parameter siteName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{siteName}", url.PathEscape(siteName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listSiteDetectorResponsesHandleResponse handles the ListSiteDetectorResponses response. +func (client *DiagnosticsClient) listSiteDetectorResponsesHandleResponse(resp *http.Response) (DiagnosticsListSiteDetectorResponsesResponse, error) { + result := DiagnosticsListSiteDetectorResponsesResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.DetectorResponseCollection); err != nil { + return DiagnosticsListSiteDetectorResponsesResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listSiteDetectorResponsesHandleError handles the ListSiteDetectorResponses error response. +func (client *DiagnosticsClient) listSiteDetectorResponsesHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListSiteDetectorResponsesSlot - Description for List Site Detector Responses +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *DiagnosticsClient) ListSiteDetectorResponsesSlot(resourceGroupName string, siteName string, slot string, options *DiagnosticsListSiteDetectorResponsesSlotOptions) *DiagnosticsListSiteDetectorResponsesSlotPager { + return &DiagnosticsListSiteDetectorResponsesSlotPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listSiteDetectorResponsesSlotCreateRequest(ctx, resourceGroupName, siteName, slot, options) + }, + advancer: func(ctx context.Context, resp DiagnosticsListSiteDetectorResponsesSlotResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.DetectorResponseCollection.NextLink) + }, + } +} + +// listSiteDetectorResponsesSlotCreateRequest creates the ListSiteDetectorResponsesSlot request. +func (client *DiagnosticsClient) listSiteDetectorResponsesSlotCreateRequest(ctx context.Context, resourceGroupName string, siteName string, slot string, options *DiagnosticsListSiteDetectorResponsesSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slot}/detectors" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if siteName == "" { + return nil, errors.New("parameter siteName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{siteName}", url.PathEscape(siteName)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listSiteDetectorResponsesSlotHandleResponse handles the ListSiteDetectorResponsesSlot response. +func (client *DiagnosticsClient) listSiteDetectorResponsesSlotHandleResponse(resp *http.Response) (DiagnosticsListSiteDetectorResponsesSlotResponse, error) { + result := DiagnosticsListSiteDetectorResponsesSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.DetectorResponseCollection); err != nil { + return DiagnosticsListSiteDetectorResponsesSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listSiteDetectorResponsesSlotHandleError handles the ListSiteDetectorResponsesSlot error response. +func (client *DiagnosticsClient) listSiteDetectorResponsesSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListSiteDetectors - Description for Get Detectors +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *DiagnosticsClient) ListSiteDetectors(resourceGroupName string, siteName string, diagnosticCategory string, options *DiagnosticsListSiteDetectorsOptions) *DiagnosticsListSiteDetectorsPager { + return &DiagnosticsListSiteDetectorsPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listSiteDetectorsCreateRequest(ctx, resourceGroupName, siteName, diagnosticCategory, options) + }, + advancer: func(ctx context.Context, resp DiagnosticsListSiteDetectorsResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.DiagnosticDetectorCollection.NextLink) + }, + } +} + +// listSiteDetectorsCreateRequest creates the ListSiteDetectors request. +func (client *DiagnosticsClient) listSiteDetectorsCreateRequest(ctx context.Context, resourceGroupName string, siteName string, diagnosticCategory string, options *DiagnosticsListSiteDetectorsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/diagnostics/{diagnosticCategory}/detectors" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if siteName == "" { + return nil, errors.New("parameter siteName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{siteName}", url.PathEscape(siteName)) + if diagnosticCategory == "" { + return nil, errors.New("parameter diagnosticCategory cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{diagnosticCategory}", url.PathEscape(diagnosticCategory)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listSiteDetectorsHandleResponse handles the ListSiteDetectors response. +func (client *DiagnosticsClient) listSiteDetectorsHandleResponse(resp *http.Response) (DiagnosticsListSiteDetectorsResponse, error) { + result := DiagnosticsListSiteDetectorsResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.DiagnosticDetectorCollection); err != nil { + return DiagnosticsListSiteDetectorsResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listSiteDetectorsHandleError handles the ListSiteDetectors error response. +func (client *DiagnosticsClient) listSiteDetectorsHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListSiteDetectorsSlot - Description for Get Detectors +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *DiagnosticsClient) ListSiteDetectorsSlot(resourceGroupName string, siteName string, diagnosticCategory string, slot string, options *DiagnosticsListSiteDetectorsSlotOptions) *DiagnosticsListSiteDetectorsSlotPager { + return &DiagnosticsListSiteDetectorsSlotPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listSiteDetectorsSlotCreateRequest(ctx, resourceGroupName, siteName, diagnosticCategory, slot, options) + }, + advancer: func(ctx context.Context, resp DiagnosticsListSiteDetectorsSlotResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.DiagnosticDetectorCollection.NextLink) + }, + } +} + +// listSiteDetectorsSlotCreateRequest creates the ListSiteDetectorsSlot request. +func (client *DiagnosticsClient) listSiteDetectorsSlotCreateRequest(ctx context.Context, resourceGroupName string, siteName string, diagnosticCategory string, slot string, options *DiagnosticsListSiteDetectorsSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slot}/diagnostics/{diagnosticCategory}/detectors" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if siteName == "" { + return nil, errors.New("parameter siteName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{siteName}", url.PathEscape(siteName)) + if diagnosticCategory == "" { + return nil, errors.New("parameter diagnosticCategory cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{diagnosticCategory}", url.PathEscape(diagnosticCategory)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listSiteDetectorsSlotHandleResponse handles the ListSiteDetectorsSlot response. +func (client *DiagnosticsClient) listSiteDetectorsSlotHandleResponse(resp *http.Response) (DiagnosticsListSiteDetectorsSlotResponse, error) { + result := DiagnosticsListSiteDetectorsSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.DiagnosticDetectorCollection); err != nil { + return DiagnosticsListSiteDetectorsSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listSiteDetectorsSlotHandleError handles the ListSiteDetectorsSlot error response. +func (client *DiagnosticsClient) listSiteDetectorsSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListSiteDiagnosticCategories - Description for Get Diagnostics Categories +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *DiagnosticsClient) ListSiteDiagnosticCategories(resourceGroupName string, siteName string, options *DiagnosticsListSiteDiagnosticCategoriesOptions) *DiagnosticsListSiteDiagnosticCategoriesPager { + return &DiagnosticsListSiteDiagnosticCategoriesPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listSiteDiagnosticCategoriesCreateRequest(ctx, resourceGroupName, siteName, options) + }, + advancer: func(ctx context.Context, resp DiagnosticsListSiteDiagnosticCategoriesResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.DiagnosticCategoryCollection.NextLink) + }, + } +} + +// listSiteDiagnosticCategoriesCreateRequest creates the ListSiteDiagnosticCategories request. +func (client *DiagnosticsClient) listSiteDiagnosticCategoriesCreateRequest(ctx context.Context, resourceGroupName string, siteName string, options *DiagnosticsListSiteDiagnosticCategoriesOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/diagnostics" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if siteName == "" { + return nil, errors.New("parameter siteName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{siteName}", url.PathEscape(siteName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listSiteDiagnosticCategoriesHandleResponse handles the ListSiteDiagnosticCategories response. +func (client *DiagnosticsClient) listSiteDiagnosticCategoriesHandleResponse(resp *http.Response) (DiagnosticsListSiteDiagnosticCategoriesResponse, error) { + result := DiagnosticsListSiteDiagnosticCategoriesResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.DiagnosticCategoryCollection); err != nil { + return DiagnosticsListSiteDiagnosticCategoriesResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listSiteDiagnosticCategoriesHandleError handles the ListSiteDiagnosticCategories error response. +func (client *DiagnosticsClient) listSiteDiagnosticCategoriesHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListSiteDiagnosticCategoriesSlot - Description for Get Diagnostics Categories +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *DiagnosticsClient) ListSiteDiagnosticCategoriesSlot(resourceGroupName string, siteName string, slot string, options *DiagnosticsListSiteDiagnosticCategoriesSlotOptions) *DiagnosticsListSiteDiagnosticCategoriesSlotPager { + return &DiagnosticsListSiteDiagnosticCategoriesSlotPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listSiteDiagnosticCategoriesSlotCreateRequest(ctx, resourceGroupName, siteName, slot, options) + }, + advancer: func(ctx context.Context, resp DiagnosticsListSiteDiagnosticCategoriesSlotResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.DiagnosticCategoryCollection.NextLink) + }, + } +} + +// listSiteDiagnosticCategoriesSlotCreateRequest creates the ListSiteDiagnosticCategoriesSlot request. +func (client *DiagnosticsClient) listSiteDiagnosticCategoriesSlotCreateRequest(ctx context.Context, resourceGroupName string, siteName string, slot string, options *DiagnosticsListSiteDiagnosticCategoriesSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slot}/diagnostics" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if siteName == "" { + return nil, errors.New("parameter siteName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{siteName}", url.PathEscape(siteName)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listSiteDiagnosticCategoriesSlotHandleResponse handles the ListSiteDiagnosticCategoriesSlot response. +func (client *DiagnosticsClient) listSiteDiagnosticCategoriesSlotHandleResponse(resp *http.Response) (DiagnosticsListSiteDiagnosticCategoriesSlotResponse, error) { + result := DiagnosticsListSiteDiagnosticCategoriesSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.DiagnosticCategoryCollection); err != nil { + return DiagnosticsListSiteDiagnosticCategoriesSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listSiteDiagnosticCategoriesSlotHandleError handles the ListSiteDiagnosticCategoriesSlot error response. +func (client *DiagnosticsClient) listSiteDiagnosticCategoriesSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} diff --git a/sdk/resourcemanager/appservice/armappservice/zz_generated_domainregistrationprovider_client.go b/sdk/resourcemanager/appservice/armappservice/zz_generated_domainregistrationprovider_client.go new file mode 100644 index 000000000000..9f1b6381a87b --- /dev/null +++ b/sdk/resourcemanager/appservice/armappservice/zz_generated_domainregistrationprovider_client.go @@ -0,0 +1,89 @@ +//go:build go1.16 +// +build go1.16 + +// 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. + +package armappservice + +import ( + "context" + "fmt" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" +) + +// DomainRegistrationProviderClient contains the methods for the DomainRegistrationProvider group. +// Don't use this type directly, use NewDomainRegistrationProviderClient() instead. +type DomainRegistrationProviderClient struct { + ep string + pl runtime.Pipeline +} + +// NewDomainRegistrationProviderClient creates a new instance of DomainRegistrationProviderClient with the specified values. +func NewDomainRegistrationProviderClient(credential azcore.TokenCredential, options *arm.ClientOptions) *DomainRegistrationProviderClient { + cp := arm.ClientOptions{} + if options != nil { + cp = *options + } + if len(cp.Host) == 0 { + cp.Host = arm.AzurePublicCloud + } + return &DomainRegistrationProviderClient{ep: string(cp.Host), pl: armruntime.NewPipeline(module, version, credential, &cp)} +} + +// ListOperations - Description for Implements Csm operations Api to exposes the list of available Csm Apis under the resource provider +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *DomainRegistrationProviderClient) ListOperations(options *DomainRegistrationProviderListOperationsOptions) *DomainRegistrationProviderListOperationsPager { + return &DomainRegistrationProviderListOperationsPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listOperationsCreateRequest(ctx, options) + }, + advancer: func(ctx context.Context, resp DomainRegistrationProviderListOperationsResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.CsmOperationCollection.NextLink) + }, + } +} + +// listOperationsCreateRequest creates the ListOperations request. +func (client *DomainRegistrationProviderClient) listOperationsCreateRequest(ctx context.Context, options *DomainRegistrationProviderListOperationsOptions) (*policy.Request, error) { + urlPath := "/providers/Microsoft.DomainRegistration/operations" + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listOperationsHandleResponse handles the ListOperations response. +func (client *DomainRegistrationProviderClient) listOperationsHandleResponse(resp *http.Response) (DomainRegistrationProviderListOperationsResponse, error) { + result := DomainRegistrationProviderListOperationsResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.CsmOperationCollection); err != nil { + return DomainRegistrationProviderListOperationsResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listOperationsHandleError handles the ListOperations error response. +func (client *DomainRegistrationProviderClient) listOperationsHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} diff --git a/sdk/resourcemanager/appservice/armappservice/zz_generated_domains_client.go b/sdk/resourcemanager/appservice/armappservice/zz_generated_domains_client.go new file mode 100644 index 000000000000..ee16c5a500a0 --- /dev/null +++ b/sdk/resourcemanager/appservice/armappservice/zz_generated_domains_client.go @@ -0,0 +1,974 @@ +//go:build go1.16 +// +build go1.16 + +// 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. + +package armappservice + +import ( + "context" + "errors" + "fmt" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strconv" + "strings" +) + +// DomainsClient contains the methods for the Domains group. +// Don't use this type directly, use NewDomainsClient() instead. +type DomainsClient struct { + ep string + pl runtime.Pipeline + subscriptionID string +} + +// NewDomainsClient creates a new instance of DomainsClient with the specified values. +func NewDomainsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *DomainsClient { + cp := arm.ClientOptions{} + if options != nil { + cp = *options + } + if len(cp.Host) == 0 { + cp.Host = arm.AzurePublicCloud + } + return &DomainsClient{subscriptionID: subscriptionID, ep: string(cp.Host), pl: armruntime.NewPipeline(module, version, credential, &cp)} +} + +// CheckAvailability - Description for Check if a domain is available for registration. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *DomainsClient) CheckAvailability(ctx context.Context, identifier NameIdentifier, options *DomainsCheckAvailabilityOptions) (DomainsCheckAvailabilityResponse, error) { + req, err := client.checkAvailabilityCreateRequest(ctx, identifier, options) + if err != nil { + return DomainsCheckAvailabilityResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return DomainsCheckAvailabilityResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return DomainsCheckAvailabilityResponse{}, client.checkAvailabilityHandleError(resp) + } + return client.checkAvailabilityHandleResponse(resp) +} + +// checkAvailabilityCreateRequest creates the CheckAvailability request. +func (client *DomainsClient) checkAvailabilityCreateRequest(ctx context.Context, identifier NameIdentifier, options *DomainsCheckAvailabilityOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.DomainRegistration/checkDomainAvailability" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, identifier) +} + +// checkAvailabilityHandleResponse handles the CheckAvailability response. +func (client *DomainsClient) checkAvailabilityHandleResponse(resp *http.Response) (DomainsCheckAvailabilityResponse, error) { + result := DomainsCheckAvailabilityResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.DomainAvailabilityCheckResult); err != nil { + return DomainsCheckAvailabilityResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// checkAvailabilityHandleError handles the CheckAvailability error response. +func (client *DomainsClient) checkAvailabilityHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// BeginCreateOrUpdate - Description for Creates or updates a domain. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *DomainsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, domainName string, domain Domain, options *DomainsBeginCreateOrUpdateOptions) (DomainsCreateOrUpdatePollerResponse, error) { + resp, err := client.createOrUpdate(ctx, resourceGroupName, domainName, domain, options) + if err != nil { + return DomainsCreateOrUpdatePollerResponse{}, err + } + result := DomainsCreateOrUpdatePollerResponse{ + RawResponse: resp, + } + pt, err := armruntime.NewPoller("DomainsClient.CreateOrUpdate", "", resp, client.pl, client.createOrUpdateHandleError) + if err != nil { + return DomainsCreateOrUpdatePollerResponse{}, err + } + result.Poller = &DomainsCreateOrUpdatePoller{ + pt: pt, + } + return result, nil +} + +// CreateOrUpdate - Description for Creates or updates a domain. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *DomainsClient) createOrUpdate(ctx context.Context, resourceGroupName string, domainName string, domain Domain, options *DomainsBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, domainName, domain, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, client.createOrUpdateHandleError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *DomainsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, domainName string, domain Domain, options *DomainsBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if domainName == "" { + return nil, errors.New("parameter domainName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{domainName}", url.PathEscape(domainName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, domain) +} + +// createOrUpdateHandleError handles the CreateOrUpdate error response. +func (client *DomainsClient) createOrUpdateHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// CreateOrUpdateOwnershipIdentifier - Description for Creates an ownership identifier for a domain or updates identifier details for an existing identifier +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *DomainsClient) CreateOrUpdateOwnershipIdentifier(ctx context.Context, resourceGroupName string, domainName string, name string, domainOwnershipIdentifier DomainOwnershipIdentifier, options *DomainsCreateOrUpdateOwnershipIdentifierOptions) (DomainsCreateOrUpdateOwnershipIdentifierResponse, error) { + req, err := client.createOrUpdateOwnershipIdentifierCreateRequest(ctx, resourceGroupName, domainName, name, domainOwnershipIdentifier, options) + if err != nil { + return DomainsCreateOrUpdateOwnershipIdentifierResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return DomainsCreateOrUpdateOwnershipIdentifierResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return DomainsCreateOrUpdateOwnershipIdentifierResponse{}, client.createOrUpdateOwnershipIdentifierHandleError(resp) + } + return client.createOrUpdateOwnershipIdentifierHandleResponse(resp) +} + +// createOrUpdateOwnershipIdentifierCreateRequest creates the CreateOrUpdateOwnershipIdentifier request. +func (client *DomainsClient) createOrUpdateOwnershipIdentifierCreateRequest(ctx context.Context, resourceGroupName string, domainName string, name string, domainOwnershipIdentifier DomainOwnershipIdentifier, options *DomainsCreateOrUpdateOwnershipIdentifierOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}/domainOwnershipIdentifiers/{name}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if domainName == "" { + return nil, errors.New("parameter domainName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{domainName}", url.PathEscape(domainName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, domainOwnershipIdentifier) +} + +// createOrUpdateOwnershipIdentifierHandleResponse handles the CreateOrUpdateOwnershipIdentifier response. +func (client *DomainsClient) createOrUpdateOwnershipIdentifierHandleResponse(resp *http.Response) (DomainsCreateOrUpdateOwnershipIdentifierResponse, error) { + result := DomainsCreateOrUpdateOwnershipIdentifierResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.DomainOwnershipIdentifier); err != nil { + return DomainsCreateOrUpdateOwnershipIdentifierResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// createOrUpdateOwnershipIdentifierHandleError handles the CreateOrUpdateOwnershipIdentifier error response. +func (client *DomainsClient) createOrUpdateOwnershipIdentifierHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// Delete - Description for Delete a domain. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *DomainsClient) Delete(ctx context.Context, resourceGroupName string, domainName string, options *DomainsDeleteOptions) (DomainsDeleteResponse, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, domainName, options) + if err != nil { + return DomainsDeleteResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return DomainsDeleteResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { + return DomainsDeleteResponse{}, client.deleteHandleError(resp) + } + return DomainsDeleteResponse{RawResponse: resp}, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *DomainsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, domainName string, options *DomainsDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if domainName == "" { + return nil, errors.New("parameter domainName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{domainName}", url.PathEscape(domainName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + if options != nil && options.ForceHardDeleteDomain != nil { + reqQP.Set("forceHardDeleteDomain", strconv.FormatBool(*options.ForceHardDeleteDomain)) + } + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// deleteHandleError handles the Delete error response. +func (client *DomainsClient) deleteHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// DeleteOwnershipIdentifier - Description for Delete ownership identifier for domain +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *DomainsClient) DeleteOwnershipIdentifier(ctx context.Context, resourceGroupName string, domainName string, name string, options *DomainsDeleteOwnershipIdentifierOptions) (DomainsDeleteOwnershipIdentifierResponse, error) { + req, err := client.deleteOwnershipIdentifierCreateRequest(ctx, resourceGroupName, domainName, name, options) + if err != nil { + return DomainsDeleteOwnershipIdentifierResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return DomainsDeleteOwnershipIdentifierResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { + return DomainsDeleteOwnershipIdentifierResponse{}, client.deleteOwnershipIdentifierHandleError(resp) + } + return DomainsDeleteOwnershipIdentifierResponse{RawResponse: resp}, nil +} + +// deleteOwnershipIdentifierCreateRequest creates the DeleteOwnershipIdentifier request. +func (client *DomainsClient) deleteOwnershipIdentifierCreateRequest(ctx context.Context, resourceGroupName string, domainName string, name string, options *DomainsDeleteOwnershipIdentifierOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}/domainOwnershipIdentifiers/{name}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if domainName == "" { + return nil, errors.New("parameter domainName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{domainName}", url.PathEscape(domainName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// deleteOwnershipIdentifierHandleError handles the DeleteOwnershipIdentifier error response. +func (client *DomainsClient) deleteOwnershipIdentifierHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// Get - Description for Get a domain. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *DomainsClient) Get(ctx context.Context, resourceGroupName string, domainName string, options *DomainsGetOptions) (DomainsGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, domainName, options) + if err != nil { + return DomainsGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return DomainsGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return DomainsGetResponse{}, client.getHandleError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *DomainsClient) getCreateRequest(ctx context.Context, resourceGroupName string, domainName string, options *DomainsGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if domainName == "" { + return nil, errors.New("parameter domainName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{domainName}", url.PathEscape(domainName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *DomainsClient) getHandleResponse(resp *http.Response) (DomainsGetResponse, error) { + result := DomainsGetResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.Domain); err != nil { + return DomainsGetResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getHandleError handles the Get error response. +func (client *DomainsClient) getHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetControlCenterSsoRequest - Description for Generate a single sign-on request for the domain management portal. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *DomainsClient) GetControlCenterSsoRequest(ctx context.Context, options *DomainsGetControlCenterSsoRequestOptions) (DomainsGetControlCenterSsoRequestResponse, error) { + req, err := client.getControlCenterSsoRequestCreateRequest(ctx, options) + if err != nil { + return DomainsGetControlCenterSsoRequestResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return DomainsGetControlCenterSsoRequestResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return DomainsGetControlCenterSsoRequestResponse{}, client.getControlCenterSsoRequestHandleError(resp) + } + return client.getControlCenterSsoRequestHandleResponse(resp) +} + +// getControlCenterSsoRequestCreateRequest creates the GetControlCenterSsoRequest request. +func (client *DomainsClient) getControlCenterSsoRequestCreateRequest(ctx context.Context, options *DomainsGetControlCenterSsoRequestOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.DomainRegistration/generateSsoRequest" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getControlCenterSsoRequestHandleResponse handles the GetControlCenterSsoRequest response. +func (client *DomainsClient) getControlCenterSsoRequestHandleResponse(resp *http.Response) (DomainsGetControlCenterSsoRequestResponse, error) { + result := DomainsGetControlCenterSsoRequestResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.DomainControlCenterSsoRequest); err != nil { + return DomainsGetControlCenterSsoRequestResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getControlCenterSsoRequestHandleError handles the GetControlCenterSsoRequest error response. +func (client *DomainsClient) getControlCenterSsoRequestHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetOwnershipIdentifier - Description for Get ownership identifier for domain +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *DomainsClient) GetOwnershipIdentifier(ctx context.Context, resourceGroupName string, domainName string, name string, options *DomainsGetOwnershipIdentifierOptions) (DomainsGetOwnershipIdentifierResponse, error) { + req, err := client.getOwnershipIdentifierCreateRequest(ctx, resourceGroupName, domainName, name, options) + if err != nil { + return DomainsGetOwnershipIdentifierResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return DomainsGetOwnershipIdentifierResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return DomainsGetOwnershipIdentifierResponse{}, client.getOwnershipIdentifierHandleError(resp) + } + return client.getOwnershipIdentifierHandleResponse(resp) +} + +// getOwnershipIdentifierCreateRequest creates the GetOwnershipIdentifier request. +func (client *DomainsClient) getOwnershipIdentifierCreateRequest(ctx context.Context, resourceGroupName string, domainName string, name string, options *DomainsGetOwnershipIdentifierOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}/domainOwnershipIdentifiers/{name}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if domainName == "" { + return nil, errors.New("parameter domainName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{domainName}", url.PathEscape(domainName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getOwnershipIdentifierHandleResponse handles the GetOwnershipIdentifier response. +func (client *DomainsClient) getOwnershipIdentifierHandleResponse(resp *http.Response) (DomainsGetOwnershipIdentifierResponse, error) { + result := DomainsGetOwnershipIdentifierResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.DomainOwnershipIdentifier); err != nil { + return DomainsGetOwnershipIdentifierResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getOwnershipIdentifierHandleError handles the GetOwnershipIdentifier error response. +func (client *DomainsClient) getOwnershipIdentifierHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// List - Description for Get all domains in a subscription. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *DomainsClient) List(options *DomainsListOptions) *DomainsListPager { + return &DomainsListPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listCreateRequest(ctx, options) + }, + advancer: func(ctx context.Context, resp DomainsListResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.DomainCollection.NextLink) + }, + } +} + +// listCreateRequest creates the List request. +func (client *DomainsClient) listCreateRequest(ctx context.Context, options *DomainsListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.DomainRegistration/domains" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listHandleResponse handles the List response. +func (client *DomainsClient) listHandleResponse(resp *http.Response) (DomainsListResponse, error) { + result := DomainsListResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.DomainCollection); err != nil { + return DomainsListResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listHandleError handles the List error response. +func (client *DomainsClient) listHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListByResourceGroup - Description for Get all domains in a resource group. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *DomainsClient) ListByResourceGroup(resourceGroupName string, options *DomainsListByResourceGroupOptions) *DomainsListByResourceGroupPager { + return &DomainsListByResourceGroupPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) + }, + advancer: func(ctx context.Context, resp DomainsListByResourceGroupResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.DomainCollection.NextLink) + }, + } +} + +// listByResourceGroupCreateRequest creates the ListByResourceGroup request. +func (client *DomainsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *DomainsListByResourceGroupOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listByResourceGroupHandleResponse handles the ListByResourceGroup response. +func (client *DomainsClient) listByResourceGroupHandleResponse(resp *http.Response) (DomainsListByResourceGroupResponse, error) { + result := DomainsListByResourceGroupResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.DomainCollection); err != nil { + return DomainsListByResourceGroupResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listByResourceGroupHandleError handles the ListByResourceGroup error response. +func (client *DomainsClient) listByResourceGroupHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListOwnershipIdentifiers - Description for Lists domain ownership identifiers. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *DomainsClient) ListOwnershipIdentifiers(resourceGroupName string, domainName string, options *DomainsListOwnershipIdentifiersOptions) *DomainsListOwnershipIdentifiersPager { + return &DomainsListOwnershipIdentifiersPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listOwnershipIdentifiersCreateRequest(ctx, resourceGroupName, domainName, options) + }, + advancer: func(ctx context.Context, resp DomainsListOwnershipIdentifiersResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.DomainOwnershipIdentifierCollection.NextLink) + }, + } +} + +// listOwnershipIdentifiersCreateRequest creates the ListOwnershipIdentifiers request. +func (client *DomainsClient) listOwnershipIdentifiersCreateRequest(ctx context.Context, resourceGroupName string, domainName string, options *DomainsListOwnershipIdentifiersOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}/domainOwnershipIdentifiers" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if domainName == "" { + return nil, errors.New("parameter domainName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{domainName}", url.PathEscape(domainName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listOwnershipIdentifiersHandleResponse handles the ListOwnershipIdentifiers response. +func (client *DomainsClient) listOwnershipIdentifiersHandleResponse(resp *http.Response) (DomainsListOwnershipIdentifiersResponse, error) { + result := DomainsListOwnershipIdentifiersResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.DomainOwnershipIdentifierCollection); err != nil { + return DomainsListOwnershipIdentifiersResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listOwnershipIdentifiersHandleError handles the ListOwnershipIdentifiers error response. +func (client *DomainsClient) listOwnershipIdentifiersHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListRecommendations - Description for Get domain name recommendations based on keywords. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *DomainsClient) ListRecommendations(parameters DomainRecommendationSearchParameters, options *DomainsListRecommendationsOptions) *DomainsListRecommendationsPager { + return &DomainsListRecommendationsPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listRecommendationsCreateRequest(ctx, parameters, options) + }, + advancer: func(ctx context.Context, resp DomainsListRecommendationsResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.NameIdentifierCollection.NextLink) + }, + } +} + +// listRecommendationsCreateRequest creates the ListRecommendations request. +func (client *DomainsClient) listRecommendationsCreateRequest(ctx context.Context, parameters DomainRecommendationSearchParameters, options *DomainsListRecommendationsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.DomainRegistration/listDomainRecommendations" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, parameters) +} + +// listRecommendationsHandleResponse handles the ListRecommendations response. +func (client *DomainsClient) listRecommendationsHandleResponse(resp *http.Response) (DomainsListRecommendationsResponse, error) { + result := DomainsListRecommendationsResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.NameIdentifierCollection); err != nil { + return DomainsListRecommendationsResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listRecommendationsHandleError handles the ListRecommendations error response. +func (client *DomainsClient) listRecommendationsHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// Renew - Description for Renew a domain. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *DomainsClient) Renew(ctx context.Context, resourceGroupName string, domainName string, options *DomainsRenewOptions) (DomainsRenewResponse, error) { + req, err := client.renewCreateRequest(ctx, resourceGroupName, domainName, options) + if err != nil { + return DomainsRenewResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return DomainsRenewResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return DomainsRenewResponse{}, client.renewHandleError(resp) + } + return DomainsRenewResponse{RawResponse: resp}, nil +} + +// renewCreateRequest creates the Renew request. +func (client *DomainsClient) renewCreateRequest(ctx context.Context, resourceGroupName string, domainName string, options *DomainsRenewOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}/renew" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if domainName == "" { + return nil, errors.New("parameter domainName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{domainName}", url.PathEscape(domainName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// renewHandleError handles the Renew error response. +func (client *DomainsClient) renewHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// Update - Description for Creates or updates a domain. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *DomainsClient) Update(ctx context.Context, resourceGroupName string, domainName string, domain DomainPatchResource, options *DomainsUpdateOptions) (DomainsUpdateResponse, error) { + req, err := client.updateCreateRequest(ctx, resourceGroupName, domainName, domain, options) + if err != nil { + return DomainsUpdateResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return DomainsUpdateResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return DomainsUpdateResponse{}, client.updateHandleError(resp) + } + return client.updateHandleResponse(resp) +} + +// updateCreateRequest creates the Update request. +func (client *DomainsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, domainName string, domain DomainPatchResource, options *DomainsUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if domainName == "" { + return nil, errors.New("parameter domainName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{domainName}", url.PathEscape(domainName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, domain) +} + +// updateHandleResponse handles the Update response. +func (client *DomainsClient) updateHandleResponse(resp *http.Response) (DomainsUpdateResponse, error) { + result := DomainsUpdateResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.Domain); err != nil { + return DomainsUpdateResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// updateHandleError handles the Update error response. +func (client *DomainsClient) updateHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// UpdateOwnershipIdentifier - Description for Creates an ownership identifier for a domain or updates identifier details for an existing identifier +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *DomainsClient) UpdateOwnershipIdentifier(ctx context.Context, resourceGroupName string, domainName string, name string, domainOwnershipIdentifier DomainOwnershipIdentifier, options *DomainsUpdateOwnershipIdentifierOptions) (DomainsUpdateOwnershipIdentifierResponse, error) { + req, err := client.updateOwnershipIdentifierCreateRequest(ctx, resourceGroupName, domainName, name, domainOwnershipIdentifier, options) + if err != nil { + return DomainsUpdateOwnershipIdentifierResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return DomainsUpdateOwnershipIdentifierResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return DomainsUpdateOwnershipIdentifierResponse{}, client.updateOwnershipIdentifierHandleError(resp) + } + return client.updateOwnershipIdentifierHandleResponse(resp) +} + +// updateOwnershipIdentifierCreateRequest creates the UpdateOwnershipIdentifier request. +func (client *DomainsClient) updateOwnershipIdentifierCreateRequest(ctx context.Context, resourceGroupName string, domainName string, name string, domainOwnershipIdentifier DomainOwnershipIdentifier, options *DomainsUpdateOwnershipIdentifierOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}/domainOwnershipIdentifiers/{name}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if domainName == "" { + return nil, errors.New("parameter domainName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{domainName}", url.PathEscape(domainName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, domainOwnershipIdentifier) +} + +// updateOwnershipIdentifierHandleResponse handles the UpdateOwnershipIdentifier response. +func (client *DomainsClient) updateOwnershipIdentifierHandleResponse(resp *http.Response) (DomainsUpdateOwnershipIdentifierResponse, error) { + result := DomainsUpdateOwnershipIdentifierResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.DomainOwnershipIdentifier); err != nil { + return DomainsUpdateOwnershipIdentifierResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// updateOwnershipIdentifierHandleError handles the UpdateOwnershipIdentifier error response. +func (client *DomainsClient) updateOwnershipIdentifierHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} diff --git a/sdk/resourcemanager/appservice/armappservice/zz_generated_global_client.go b/sdk/resourcemanager/appservice/armappservice/zz_generated_global_client.go new file mode 100644 index 000000000000..bc18599c9a84 --- /dev/null +++ b/sdk/resourcemanager/appservice/armappservice/zz_generated_global_client.go @@ -0,0 +1,221 @@ +//go:build go1.16 +// +build go1.16 + +// 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. + +package armappservice + +import ( + "context" + "errors" + "fmt" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// GlobalClient contains the methods for the Global group. +// Don't use this type directly, use NewGlobalClient() instead. +type GlobalClient struct { + ep string + pl runtime.Pipeline + subscriptionID string +} + +// NewGlobalClient creates a new instance of GlobalClient with the specified values. +func NewGlobalClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *GlobalClient { + cp := arm.ClientOptions{} + if options != nil { + cp = *options + } + if len(cp.Host) == 0 { + cp.Host = arm.AzurePublicCloud + } + return &GlobalClient{subscriptionID: subscriptionID, ep: string(cp.Host), pl: armruntime.NewPipeline(module, version, credential, &cp)} +} + +// GetDeletedWebApp - Description for Get deleted app for a subscription. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *GlobalClient) GetDeletedWebApp(ctx context.Context, deletedSiteID string, options *GlobalGetDeletedWebAppOptions) (GlobalGetDeletedWebAppResponse, error) { + req, err := client.getDeletedWebAppCreateRequest(ctx, deletedSiteID, options) + if err != nil { + return GlobalGetDeletedWebAppResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return GlobalGetDeletedWebAppResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return GlobalGetDeletedWebAppResponse{}, client.getDeletedWebAppHandleError(resp) + } + return client.getDeletedWebAppHandleResponse(resp) +} + +// getDeletedWebAppCreateRequest creates the GetDeletedWebApp request. +func (client *GlobalClient) getDeletedWebAppCreateRequest(ctx context.Context, deletedSiteID string, options *GlobalGetDeletedWebAppOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Web/deletedSites/{deletedSiteId}" + if deletedSiteID == "" { + return nil, errors.New("parameter deletedSiteID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{deletedSiteId}", url.PathEscape(deletedSiteID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getDeletedWebAppHandleResponse handles the GetDeletedWebApp response. +func (client *GlobalClient) getDeletedWebAppHandleResponse(resp *http.Response) (GlobalGetDeletedWebAppResponse, error) { + result := GlobalGetDeletedWebAppResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.DeletedSite); err != nil { + return GlobalGetDeletedWebAppResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getDeletedWebAppHandleError handles the GetDeletedWebApp error response. +func (client *GlobalClient) getDeletedWebAppHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetDeletedWebAppSnapshots - Description for Get all deleted apps for a subscription. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *GlobalClient) GetDeletedWebAppSnapshots(ctx context.Context, deletedSiteID string, options *GlobalGetDeletedWebAppSnapshotsOptions) (GlobalGetDeletedWebAppSnapshotsResponse, error) { + req, err := client.getDeletedWebAppSnapshotsCreateRequest(ctx, deletedSiteID, options) + if err != nil { + return GlobalGetDeletedWebAppSnapshotsResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return GlobalGetDeletedWebAppSnapshotsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return GlobalGetDeletedWebAppSnapshotsResponse{}, client.getDeletedWebAppSnapshotsHandleError(resp) + } + return client.getDeletedWebAppSnapshotsHandleResponse(resp) +} + +// getDeletedWebAppSnapshotsCreateRequest creates the GetDeletedWebAppSnapshots request. +func (client *GlobalClient) getDeletedWebAppSnapshotsCreateRequest(ctx context.Context, deletedSiteID string, options *GlobalGetDeletedWebAppSnapshotsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Web/deletedSites/{deletedSiteId}/snapshots" + if deletedSiteID == "" { + return nil, errors.New("parameter deletedSiteID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{deletedSiteId}", url.PathEscape(deletedSiteID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getDeletedWebAppSnapshotsHandleResponse handles the GetDeletedWebAppSnapshots response. +func (client *GlobalClient) getDeletedWebAppSnapshotsHandleResponse(resp *http.Response) (GlobalGetDeletedWebAppSnapshotsResponse, error) { + result := GlobalGetDeletedWebAppSnapshotsResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.SnapshotArray); err != nil { + return GlobalGetDeletedWebAppSnapshotsResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getDeletedWebAppSnapshotsHandleError handles the GetDeletedWebAppSnapshots error response. +func (client *GlobalClient) getDeletedWebAppSnapshotsHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetSubscriptionOperationWithAsyncResponse - Description for Gets an operation in a subscription and given region +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *GlobalClient) GetSubscriptionOperationWithAsyncResponse(ctx context.Context, location string, operationID string, options *GlobalGetSubscriptionOperationWithAsyncResponseOptions) (GlobalGetSubscriptionOperationWithAsyncResponseResponse, error) { + req, err := client.getSubscriptionOperationWithAsyncResponseCreateRequest(ctx, location, operationID, options) + if err != nil { + return GlobalGetSubscriptionOperationWithAsyncResponseResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return GlobalGetSubscriptionOperationWithAsyncResponseResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusNoContent) { + return GlobalGetSubscriptionOperationWithAsyncResponseResponse{}, client.getSubscriptionOperationWithAsyncResponseHandleError(resp) + } + return GlobalGetSubscriptionOperationWithAsyncResponseResponse{RawResponse: resp}, nil +} + +// getSubscriptionOperationWithAsyncResponseCreateRequest creates the GetSubscriptionOperationWithAsyncResponse request. +func (client *GlobalClient) getSubscriptionOperationWithAsyncResponseCreateRequest(ctx context.Context, location string, operationID string, options *GlobalGetSubscriptionOperationWithAsyncResponseOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Web/locations/{location}/operations/{operationId}" + if location == "" { + return nil, errors.New("parameter location cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) + if operationID == "" { + return nil, errors.New("parameter operationID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{operationId}", url.PathEscape(operationID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getSubscriptionOperationWithAsyncResponseHandleError handles the GetSubscriptionOperationWithAsyncResponse error response. +func (client *GlobalClient) getSubscriptionOperationWithAsyncResponseHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} diff --git a/sdk/resourcemanager/appservice/armappservice/zz_generated_kubeenvironments_client.go b/sdk/resourcemanager/appservice/armappservice/zz_generated_kubeenvironments_client.go new file mode 100644 index 000000000000..b6d6e2738276 --- /dev/null +++ b/sdk/resourcemanager/appservice/armappservice/zz_generated_kubeenvironments_client.go @@ -0,0 +1,437 @@ +//go:build go1.16 +// +build go1.16 + +// 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. + +package armappservice + +import ( + "context" + "errors" + "fmt" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// KubeEnvironmentsClient contains the methods for the KubeEnvironments group. +// Don't use this type directly, use NewKubeEnvironmentsClient() instead. +type KubeEnvironmentsClient struct { + ep string + pl runtime.Pipeline + subscriptionID string +} + +// NewKubeEnvironmentsClient creates a new instance of KubeEnvironmentsClient with the specified values. +func NewKubeEnvironmentsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *KubeEnvironmentsClient { + cp := arm.ClientOptions{} + if options != nil { + cp = *options + } + if len(cp.Host) == 0 { + cp.Host = arm.AzurePublicCloud + } + return &KubeEnvironmentsClient{subscriptionID: subscriptionID, ep: string(cp.Host), pl: armruntime.NewPipeline(module, version, credential, &cp)} +} + +// BeginCreateOrUpdate - Description for Creates or updates a Kubernetes Environment. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *KubeEnvironmentsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, name string, kubeEnvironmentEnvelope KubeEnvironment, options *KubeEnvironmentsBeginCreateOrUpdateOptions) (KubeEnvironmentsCreateOrUpdatePollerResponse, error) { + resp, err := client.createOrUpdate(ctx, resourceGroupName, name, kubeEnvironmentEnvelope, options) + if err != nil { + return KubeEnvironmentsCreateOrUpdatePollerResponse{}, err + } + result := KubeEnvironmentsCreateOrUpdatePollerResponse{ + RawResponse: resp, + } + pt, err := armruntime.NewPoller("KubeEnvironmentsClient.CreateOrUpdate", "", resp, client.pl, client.createOrUpdateHandleError) + if err != nil { + return KubeEnvironmentsCreateOrUpdatePollerResponse{}, err + } + result.Poller = &KubeEnvironmentsCreateOrUpdatePoller{ + pt: pt, + } + return result, nil +} + +// CreateOrUpdate - Description for Creates or updates a Kubernetes Environment. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *KubeEnvironmentsClient) createOrUpdate(ctx context.Context, resourceGroupName string, name string, kubeEnvironmentEnvelope KubeEnvironment, options *KubeEnvironmentsBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, name, kubeEnvironmentEnvelope, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, client.createOrUpdateHandleError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *KubeEnvironmentsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, name string, kubeEnvironmentEnvelope KubeEnvironment, options *KubeEnvironmentsBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/kubeEnvironments/{name}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, kubeEnvironmentEnvelope) +} + +// createOrUpdateHandleError handles the CreateOrUpdate error response. +func (client *KubeEnvironmentsClient) createOrUpdateHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// BeginDelete - Description for Delete a Kubernetes Environment. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *KubeEnvironmentsClient) BeginDelete(ctx context.Context, resourceGroupName string, name string, options *KubeEnvironmentsBeginDeleteOptions) (KubeEnvironmentsDeletePollerResponse, error) { + resp, err := client.deleteOperation(ctx, resourceGroupName, name, options) + if err != nil { + return KubeEnvironmentsDeletePollerResponse{}, err + } + result := KubeEnvironmentsDeletePollerResponse{ + RawResponse: resp, + } + pt, err := armruntime.NewPoller("KubeEnvironmentsClient.Delete", "", resp, client.pl, client.deleteHandleError) + if err != nil { + return KubeEnvironmentsDeletePollerResponse{}, err + } + result.Poller = &KubeEnvironmentsDeletePoller{ + pt: pt, + } + return result, nil +} + +// Delete - Description for Delete a Kubernetes Environment. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *KubeEnvironmentsClient) deleteOperation(ctx context.Context, resourceGroupName string, name string, options *KubeEnvironmentsBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, name, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, client.deleteHandleError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *KubeEnvironmentsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, name string, options *KubeEnvironmentsBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/kubeEnvironments/{name}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// deleteHandleError handles the Delete error response. +func (client *KubeEnvironmentsClient) deleteHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// Get - Description for Get the properties of a Kubernetes Environment. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *KubeEnvironmentsClient) Get(ctx context.Context, resourceGroupName string, name string, options *KubeEnvironmentsGetOptions) (KubeEnvironmentsGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, name, options) + if err != nil { + return KubeEnvironmentsGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return KubeEnvironmentsGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return KubeEnvironmentsGetResponse{}, client.getHandleError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *KubeEnvironmentsClient) getCreateRequest(ctx context.Context, resourceGroupName string, name string, options *KubeEnvironmentsGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/kubeEnvironments/{name}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *KubeEnvironmentsClient) getHandleResponse(resp *http.Response) (KubeEnvironmentsGetResponse, error) { + result := KubeEnvironmentsGetResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.KubeEnvironment); err != nil { + return KubeEnvironmentsGetResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getHandleError handles the Get error response. +func (client *KubeEnvironmentsClient) getHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListByResourceGroup - Description for Get all the Kubernetes Environments in a resource group. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *KubeEnvironmentsClient) ListByResourceGroup(resourceGroupName string, options *KubeEnvironmentsListByResourceGroupOptions) *KubeEnvironmentsListByResourceGroupPager { + return &KubeEnvironmentsListByResourceGroupPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) + }, + advancer: func(ctx context.Context, resp KubeEnvironmentsListByResourceGroupResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.KubeEnvironmentCollection.NextLink) + }, + } +} + +// listByResourceGroupCreateRequest creates the ListByResourceGroup request. +func (client *KubeEnvironmentsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *KubeEnvironmentsListByResourceGroupOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/kubeEnvironments" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listByResourceGroupHandleResponse handles the ListByResourceGroup response. +func (client *KubeEnvironmentsClient) listByResourceGroupHandleResponse(resp *http.Response) (KubeEnvironmentsListByResourceGroupResponse, error) { + result := KubeEnvironmentsListByResourceGroupResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.KubeEnvironmentCollection); err != nil { + return KubeEnvironmentsListByResourceGroupResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listByResourceGroupHandleError handles the ListByResourceGroup error response. +func (client *KubeEnvironmentsClient) listByResourceGroupHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListBySubscription - Description for Get all Kubernetes Environments for a subscription. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *KubeEnvironmentsClient) ListBySubscription(options *KubeEnvironmentsListBySubscriptionOptions) *KubeEnvironmentsListBySubscriptionPager { + return &KubeEnvironmentsListBySubscriptionPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listBySubscriptionCreateRequest(ctx, options) + }, + advancer: func(ctx context.Context, resp KubeEnvironmentsListBySubscriptionResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.KubeEnvironmentCollection.NextLink) + }, + } +} + +// listBySubscriptionCreateRequest creates the ListBySubscription request. +func (client *KubeEnvironmentsClient) listBySubscriptionCreateRequest(ctx context.Context, options *KubeEnvironmentsListBySubscriptionOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Web/kubeEnvironments" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listBySubscriptionHandleResponse handles the ListBySubscription response. +func (client *KubeEnvironmentsClient) listBySubscriptionHandleResponse(resp *http.Response) (KubeEnvironmentsListBySubscriptionResponse, error) { + result := KubeEnvironmentsListBySubscriptionResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.KubeEnvironmentCollection); err != nil { + return KubeEnvironmentsListBySubscriptionResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listBySubscriptionHandleError handles the ListBySubscription error response. +func (client *KubeEnvironmentsClient) listBySubscriptionHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// Update - Description for Creates or updates a Kubernetes Environment. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *KubeEnvironmentsClient) Update(ctx context.Context, resourceGroupName string, name string, kubeEnvironmentEnvelope KubeEnvironmentPatchResource, options *KubeEnvironmentsUpdateOptions) (KubeEnvironmentsUpdateResponse, error) { + req, err := client.updateCreateRequest(ctx, resourceGroupName, name, kubeEnvironmentEnvelope, options) + if err != nil { + return KubeEnvironmentsUpdateResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return KubeEnvironmentsUpdateResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return KubeEnvironmentsUpdateResponse{}, client.updateHandleError(resp) + } + return client.updateHandleResponse(resp) +} + +// updateCreateRequest creates the Update request. +func (client *KubeEnvironmentsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, name string, kubeEnvironmentEnvelope KubeEnvironmentPatchResource, options *KubeEnvironmentsUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/kubeEnvironments/{name}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, kubeEnvironmentEnvelope) +} + +// updateHandleResponse handles the Update response. +func (client *KubeEnvironmentsClient) updateHandleResponse(resp *http.Response) (KubeEnvironmentsUpdateResponse, error) { + result := KubeEnvironmentsUpdateResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.KubeEnvironment); err != nil { + return KubeEnvironmentsUpdateResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// updateHandleError handles the Update error response. +func (client *KubeEnvironmentsClient) updateHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} diff --git a/sdk/resourcemanager/appservice/armappservice/zz_generated_models.go b/sdk/resourcemanager/appservice/armappservice/zz_generated_models.go new file mode 100644 index 000000000000..d3feb5fdcb46 --- /dev/null +++ b/sdk/resourcemanager/appservice/armappservice/zz_generated_models.go @@ -0,0 +1,17100 @@ +//go:build go1.16 +// +build go1.16 + +// 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. + +package armappservice + +import ( + "encoding/json" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "reflect" + "time" +) + +// APIDefinitionInfo - Information about the formal API definition for the app. +type APIDefinitionInfo struct { + // The URL of the API definition. + URL *string `json:"url,omitempty"` +} + +// APIKVReference - Description of site key vault references. +type APIKVReference struct { + ProxyOnlyResource + // ApiKVReference resource specific properties + Properties *APIKVReferenceProperties `json:"properties,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type APIKVReference. +func (a APIKVReference) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + a.ProxyOnlyResource.marshalInternal(objectMap) + populate(objectMap, "properties", a.Properties) + return json.Marshal(objectMap) +} + +type APIKVReferenceCollection struct { + // REQUIRED; Collection of resources. + Value []*APIKVReference `json:"value,omitempty"` + + // READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type APIKVReferenceCollection. +func (a APIKVReferenceCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", a.NextLink) + populate(objectMap, "value", a.Value) + return json.Marshal(objectMap) +} + +// APIKVReferenceProperties - ApiKVReference resource specific properties +type APIKVReferenceProperties struct { + ActiveVersion *string `json:"activeVersion,omitempty"` + Details *string `json:"details,omitempty"` + + // Managed service identity. + IdentityType *ManagedServiceIdentity `json:"identityType,omitempty"` + Reference *string `json:"reference,omitempty"` + SecretName *string `json:"secretName,omitempty"` + SecretVersion *string `json:"secretVersion,omitempty"` + Source *string `json:"source,omitempty"` + Status *ResolveStatus `json:"status,omitempty"` + VaultName *string `json:"vaultName,omitempty"` +} + +// APIManagementConfig - Azure API management (APIM) configuration linked to the app. +type APIManagementConfig struct { + // APIM-Api Identifier. + ID *string `json:"id,omitempty"` +} + +// AbnormalTimePeriod - Class representing Abnormal Time Period identified in diagnosis +type AbnormalTimePeriod struct { + // End time of the downtime + EndTime *time.Time `json:"endTime,omitempty"` + + // List of Possible Cause of downtime + Events []*DetectorAbnormalTimePeriod `json:"events,omitempty"` + + // List of proposed solutions + Solutions []*Solution `json:"solutions,omitempty"` + + // Start time of the downtime + StartTime *time.Time `json:"startTime,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type AbnormalTimePeriod. +func (a AbnormalTimePeriod) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populateTimeRFC3339(objectMap, "endTime", a.EndTime) + populate(objectMap, "events", a.Events) + populate(objectMap, "solutions", a.Solutions) + populateTimeRFC3339(objectMap, "startTime", a.StartTime) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AbnormalTimePeriod. +func (a *AbnormalTimePeriod) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "endTime": + err = unpopulateTimeRFC3339(val, &a.EndTime) + delete(rawMsg, key) + case "events": + err = unpopulate(val, &a.Events) + delete(rawMsg, key) + case "solutions": + err = unpopulate(val, &a.Solutions) + delete(rawMsg, key) + case "startTime": + err = unpopulateTimeRFC3339(val, &a.StartTime) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// Address information for domain registration. +type Address struct { + // REQUIRED; First line of an Address. + Address1 *string `json:"address1,omitempty"` + + // REQUIRED; The city for the address. + City *string `json:"city,omitempty"` + + // REQUIRED; The country for the address. + Country *string `json:"country,omitempty"` + + // REQUIRED; The postal code for the address. + PostalCode *string `json:"postalCode,omitempty"` + + // REQUIRED; The state or province for the address. + State *string `json:"state,omitempty"` + + // The second line of the Address. Optional. + Address2 *string `json:"address2,omitempty"` +} + +// AddressResponse - Describes main public IP address and any extra virtual IPs. +type AddressResponse struct { + ProxyOnlyResource + // AddressResponse resource specific properties + Properties *AddressResponseProperties `json:"properties,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type AddressResponse. +func (a AddressResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + a.ProxyOnlyResource.marshalInternal(objectMap) + populate(objectMap, "properties", a.Properties) + return json.Marshal(objectMap) +} + +// AddressResponseProperties - AddressResponse resource specific properties +type AddressResponseProperties struct { + // Virtual Network internal IP address of the App Service Environment if it is in internal load-balancing mode. + InternalIPAddress *string `json:"internalIpAddress,omitempty"` + + // IP addresses appearing on outbound connections. + OutboundIPAddresses []*string `json:"outboundIpAddresses,omitempty"` + + // Main public virtual IP. + ServiceIPAddress *string `json:"serviceIpAddress,omitempty"` + + // Additional virtual IPs. + VipMappings []*VirtualIPMapping `json:"vipMappings,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type AddressResponseProperties. +func (a AddressResponseProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "internalIpAddress", a.InternalIPAddress) + populate(objectMap, "outboundIpAddresses", a.OutboundIPAddresses) + populate(objectMap, "serviceIpAddress", a.ServiceIPAddress) + populate(objectMap, "vipMappings", a.VipMappings) + return json.Marshal(objectMap) +} + +// AllowedAudiencesValidation - The configuration settings of the Allowed Audiences validation flow. +type AllowedAudiencesValidation struct { + // The configuration settings of the allowed list of audiences from which to validate the JWT token. + AllowedAudiences []*string `json:"allowedAudiences,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type AllowedAudiencesValidation. +func (a AllowedAudiencesValidation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "allowedAudiences", a.AllowedAudiences) + return json.Marshal(objectMap) +} + +// AllowedPrincipals - The configuration settings of the Azure Active Directory allowed principals. +type AllowedPrincipals struct { + // The list of the allowed groups. + Groups []*string `json:"groups,omitempty"` + + // The list of the allowed identities. + Identities []*string `json:"identities,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type AllowedPrincipals. +func (a AllowedPrincipals) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "groups", a.Groups) + populate(objectMap, "identities", a.Identities) + return json.Marshal(objectMap) +} + +// AnalysisData - Class Representing Detector Evidence used for analysis +type AnalysisData struct { + // Additional Source Data + Data [][]*NameValuePair `json:"data,omitempty"` + + // Detector Definition + DetectorDefinition *DetectorDefinition `json:"detectorDefinition,omitempty"` + + // Detector Meta Data + DetectorMetaData *ResponseMetaData `json:"detectorMetaData,omitempty"` + + // Source Metrics + Metrics []*DiagnosticMetricSet `json:"metrics,omitempty"` + + // Name of the Detector + Source *string `json:"source,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type AnalysisData. +func (a AnalysisData) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "data", a.Data) + populate(objectMap, "detectorDefinition", a.DetectorDefinition) + populate(objectMap, "detectorMetaData", a.DetectorMetaData) + populate(objectMap, "metrics", a.Metrics) + populate(objectMap, "source", a.Source) + return json.Marshal(objectMap) +} + +// AnalysisDefinition - Definition of Analysis +type AnalysisDefinition struct { + ProxyOnlyResource + // AnalysisDefinition resource specific properties + Properties *AnalysisDefinitionProperties `json:"properties,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type AnalysisDefinition. +func (a AnalysisDefinition) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + a.ProxyOnlyResource.marshalInternal(objectMap) + populate(objectMap, "properties", a.Properties) + return json.Marshal(objectMap) +} + +// AnalysisDefinitionProperties - AnalysisDefinition resource specific properties +type AnalysisDefinitionProperties struct { + // READ-ONLY; Description of the Analysis + Description *string `json:"description,omitempty" azure:"ro"` +} + +// AppInsightsWebAppStackSettings - App Insights Web App stack settings. +type AppInsightsWebAppStackSettings struct { + // READ-ONLY; true if Application Insights is disabled by default for the stack; otherwise, false. + IsDefaultOff *bool `json:"isDefaultOff,omitempty" azure:"ro"` + + // READ-ONLY; true if remote Application Insights is supported for the stack; otherwise, false. + IsSupported *bool `json:"isSupported,omitempty" azure:"ro"` +} + +type AppLogsConfiguration struct { + Destination *string `json:"destination,omitempty"` + LogAnalyticsConfiguration *LogAnalyticsConfiguration `json:"logAnalyticsConfiguration,omitempty"` +} + +// AppRegistration - The configuration settings of the app registration for providers that have app ids and app secrets +type AppRegistration struct { + // The App ID of the app used for login. + AppID *string `json:"appId,omitempty"` + + // The app setting name that contains the app secret. + AppSecretSettingName *string `json:"appSecretSettingName,omitempty"` +} + +// AppServiceCertificate - Key Vault container for a certificate that is purchased through Azure. +type AppServiceCertificate struct { + // Key Vault resource Id. + KeyVaultID *string `json:"keyVaultId,omitempty"` + + // Key Vault secret name. + KeyVaultSecretName *string `json:"keyVaultSecretName,omitempty"` + + // READ-ONLY; Status of the Key Vault secret. + ProvisioningState *KeyVaultSecretStatus `json:"provisioningState,omitempty" azure:"ro"` +} + +// AppServiceCertificateCollection - Collection of certificate order certificates. +type AppServiceCertificateCollection struct { + // REQUIRED; Collection of resources. + Value []*AppServiceCertificateResource `json:"value,omitempty"` + + // READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type AppServiceCertificateCollection. +func (a AppServiceCertificateCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", a.NextLink) + populate(objectMap, "value", a.Value) + return json.Marshal(objectMap) +} + +// AppServiceCertificateOrder - SSL certificate purchase order. +type AppServiceCertificateOrder struct { + Resource + // AppServiceCertificateOrder resource specific properties + Properties *AppServiceCertificateOrderProperties `json:"properties,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type AppServiceCertificateOrder. +func (a AppServiceCertificateOrder) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + a.Resource.marshalInternal(objectMap) + populate(objectMap, "properties", a.Properties) + return json.Marshal(objectMap) +} + +// AppServiceCertificateOrderCollection - Collection of certificate orders. +type AppServiceCertificateOrderCollection struct { + // REQUIRED; Collection of resources. + Value []*AppServiceCertificateOrder `json:"value,omitempty"` + + // READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type AppServiceCertificateOrderCollection. +func (a AppServiceCertificateOrderCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", a.NextLink) + populate(objectMap, "value", a.Value) + return json.Marshal(objectMap) +} + +// AppServiceCertificateOrderPatchResource - ARM resource for a certificate order that is purchased through Azure. +type AppServiceCertificateOrderPatchResource struct { + ProxyOnlyResource + // AppServiceCertificateOrderPatchResource resource specific properties + Properties *AppServiceCertificateOrderPatchResourceProperties `json:"properties,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type AppServiceCertificateOrderPatchResource. +func (a AppServiceCertificateOrderPatchResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + a.ProxyOnlyResource.marshalInternal(objectMap) + populate(objectMap, "properties", a.Properties) + return json.Marshal(objectMap) +} + +// AppServiceCertificateOrderPatchResourceProperties - AppServiceCertificateOrderPatchResource resource specific properties +type AppServiceCertificateOrderPatchResourceProperties struct { + // REQUIRED; Certificate product type. + ProductType *CertificateProductType `json:"productType,omitempty"` + + // true if the certificate should be automatically renewed when it expires; otherwise, false. + AutoRenew *bool `json:"autoRenew,omitempty"` + + // State of the Key Vault secret. + Certificates map[string]*AppServiceCertificate `json:"certificates,omitempty"` + + // Last CSR that was created for this order. + Csr *string `json:"csr,omitempty"` + + // Certificate distinguished name. + DistinguishedName *string `json:"distinguishedName,omitempty"` + + // Certificate key size. + KeySize *int32 `json:"keySize,omitempty"` + + // Duration in years (must be 1). + ValidityInYears *int32 `json:"validityInYears,omitempty"` + + // READ-ONLY; Reasons why App Service Certificate is not renewable at the current moment. + AppServiceCertificateNotRenewableReasons []*AppServiceCertificateOrderPatchResourcePropertiesAppServiceCertificateNotRenewableReasonsItem `json:"appServiceCertificateNotRenewableReasons,omitempty" azure:"ro"` + + // READ-ONLY; Contact info + Contact *CertificateOrderContact `json:"contact,omitempty" azure:"ro"` + + // READ-ONLY; Domain verification token. + DomainVerificationToken *string `json:"domainVerificationToken,omitempty" azure:"ro"` + + // READ-ONLY; Certificate expiration time. + ExpirationTime *time.Time `json:"expirationTime,omitempty" azure:"ro"` + + // READ-ONLY; Intermediate certificate. + Intermediate *CertificateDetails `json:"intermediate,omitempty" azure:"ro"` + + // READ-ONLY; true if private key is external; otherwise, false. + IsPrivateKeyExternal *bool `json:"isPrivateKeyExternal,omitempty" azure:"ro"` + + // READ-ONLY; Certificate last issuance time. + LastCertificateIssuanceTime *time.Time `json:"lastCertificateIssuanceTime,omitempty" azure:"ro"` + + // READ-ONLY; Time stamp when the certificate would be auto renewed next + NextAutoRenewalTimeStamp *time.Time `json:"nextAutoRenewalTimeStamp,omitempty" azure:"ro"` + + // READ-ONLY; Status of certificate order. + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` + + // READ-ONLY; Root certificate. + Root *CertificateDetails `json:"root,omitempty" azure:"ro"` + + // READ-ONLY; Current serial number of the certificate. + SerialNumber *string `json:"serialNumber,omitempty" azure:"ro"` + + // READ-ONLY; Signed certificate. + SignedCertificate *CertificateDetails `json:"signedCertificate,omitempty" azure:"ro"` + + // READ-ONLY; Current order status. + Status *CertificateOrderStatus `json:"status,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type AppServiceCertificateOrderPatchResourceProperties. +func (a AppServiceCertificateOrderPatchResourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "appServiceCertificateNotRenewableReasons", a.AppServiceCertificateNotRenewableReasons) + populate(objectMap, "autoRenew", a.AutoRenew) + populate(objectMap, "certificates", a.Certificates) + populate(objectMap, "contact", a.Contact) + populate(objectMap, "csr", a.Csr) + populate(objectMap, "distinguishedName", a.DistinguishedName) + populate(objectMap, "domainVerificationToken", a.DomainVerificationToken) + populateTimeRFC3339(objectMap, "expirationTime", a.ExpirationTime) + populate(objectMap, "intermediate", a.Intermediate) + populate(objectMap, "isPrivateKeyExternal", a.IsPrivateKeyExternal) + populate(objectMap, "keySize", a.KeySize) + populateTimeRFC3339(objectMap, "lastCertificateIssuanceTime", a.LastCertificateIssuanceTime) + populateTimeRFC3339(objectMap, "nextAutoRenewalTimeStamp", a.NextAutoRenewalTimeStamp) + populate(objectMap, "productType", a.ProductType) + populate(objectMap, "provisioningState", a.ProvisioningState) + populate(objectMap, "root", a.Root) + populate(objectMap, "serialNumber", a.SerialNumber) + populate(objectMap, "signedCertificate", a.SignedCertificate) + populate(objectMap, "status", a.Status) + populate(objectMap, "validityInYears", a.ValidityInYears) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AppServiceCertificateOrderPatchResourceProperties. +func (a *AppServiceCertificateOrderPatchResourceProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "appServiceCertificateNotRenewableReasons": + err = unpopulate(val, &a.AppServiceCertificateNotRenewableReasons) + delete(rawMsg, key) + case "autoRenew": + err = unpopulate(val, &a.AutoRenew) + delete(rawMsg, key) + case "certificates": + err = unpopulate(val, &a.Certificates) + delete(rawMsg, key) + case "contact": + err = unpopulate(val, &a.Contact) + delete(rawMsg, key) + case "csr": + err = unpopulate(val, &a.Csr) + delete(rawMsg, key) + case "distinguishedName": + err = unpopulate(val, &a.DistinguishedName) + delete(rawMsg, key) + case "domainVerificationToken": + err = unpopulate(val, &a.DomainVerificationToken) + delete(rawMsg, key) + case "expirationTime": + err = unpopulateTimeRFC3339(val, &a.ExpirationTime) + delete(rawMsg, key) + case "intermediate": + err = unpopulate(val, &a.Intermediate) + delete(rawMsg, key) + case "isPrivateKeyExternal": + err = unpopulate(val, &a.IsPrivateKeyExternal) + delete(rawMsg, key) + case "keySize": + err = unpopulate(val, &a.KeySize) + delete(rawMsg, key) + case "lastCertificateIssuanceTime": + err = unpopulateTimeRFC3339(val, &a.LastCertificateIssuanceTime) + delete(rawMsg, key) + case "nextAutoRenewalTimeStamp": + err = unpopulateTimeRFC3339(val, &a.NextAutoRenewalTimeStamp) + delete(rawMsg, key) + case "productType": + err = unpopulate(val, &a.ProductType) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, &a.ProvisioningState) + delete(rawMsg, key) + case "root": + err = unpopulate(val, &a.Root) + delete(rawMsg, key) + case "serialNumber": + err = unpopulate(val, &a.SerialNumber) + delete(rawMsg, key) + case "signedCertificate": + err = unpopulate(val, &a.SignedCertificate) + delete(rawMsg, key) + case "status": + err = unpopulate(val, &a.Status) + delete(rawMsg, key) + case "validityInYears": + err = unpopulate(val, &a.ValidityInYears) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// AppServiceCertificateOrderProperties - AppServiceCertificateOrder resource specific properties +type AppServiceCertificateOrderProperties struct { + // REQUIRED; Certificate product type. + ProductType *CertificateProductType `json:"productType,omitempty"` + + // true if the certificate should be automatically renewed when it expires; otherwise, false. + AutoRenew *bool `json:"autoRenew,omitempty"` + + // State of the Key Vault secret. + Certificates map[string]*AppServiceCertificate `json:"certificates,omitempty"` + + // Last CSR that was created for this order. + Csr *string `json:"csr,omitempty"` + + // Certificate distinguished name. + DistinguishedName *string `json:"distinguishedName,omitempty"` + + // Certificate key size. + KeySize *int32 `json:"keySize,omitempty"` + + // Duration in years (must be 1). + ValidityInYears *int32 `json:"validityInYears,omitempty"` + + // READ-ONLY; Reasons why App Service Certificate is not renewable at the current moment. + AppServiceCertificateNotRenewableReasons []*AppServiceCertificateOrderPropertiesAppServiceCertificateNotRenewableReasonsItem `json:"appServiceCertificateNotRenewableReasons,omitempty" azure:"ro"` + + // READ-ONLY; Contact info + Contact *CertificateOrderContact `json:"contact,omitempty" azure:"ro"` + + // READ-ONLY; Domain verification token. + DomainVerificationToken *string `json:"domainVerificationToken,omitempty" azure:"ro"` + + // READ-ONLY; Certificate expiration time. + ExpirationTime *time.Time `json:"expirationTime,omitempty" azure:"ro"` + + // READ-ONLY; Intermediate certificate. + Intermediate *CertificateDetails `json:"intermediate,omitempty" azure:"ro"` + + // READ-ONLY; true if private key is external; otherwise, false. + IsPrivateKeyExternal *bool `json:"isPrivateKeyExternal,omitempty" azure:"ro"` + + // READ-ONLY; Certificate last issuance time. + LastCertificateIssuanceTime *time.Time `json:"lastCertificateIssuanceTime,omitempty" azure:"ro"` + + // READ-ONLY; Time stamp when the certificate would be auto renewed next + NextAutoRenewalTimeStamp *time.Time `json:"nextAutoRenewalTimeStamp,omitempty" azure:"ro"` + + // READ-ONLY; Status of certificate order. + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` + + // READ-ONLY; Root certificate. + Root *CertificateDetails `json:"root,omitempty" azure:"ro"` + + // READ-ONLY; Current serial number of the certificate. + SerialNumber *string `json:"serialNumber,omitempty" azure:"ro"` + + // READ-ONLY; Signed certificate. + SignedCertificate *CertificateDetails `json:"signedCertificate,omitempty" azure:"ro"` + + // READ-ONLY; Current order status. + Status *CertificateOrderStatus `json:"status,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type AppServiceCertificateOrderProperties. +func (a AppServiceCertificateOrderProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "appServiceCertificateNotRenewableReasons", a.AppServiceCertificateNotRenewableReasons) + populate(objectMap, "autoRenew", a.AutoRenew) + populate(objectMap, "certificates", a.Certificates) + populate(objectMap, "contact", a.Contact) + populate(objectMap, "csr", a.Csr) + populate(objectMap, "distinguishedName", a.DistinguishedName) + populate(objectMap, "domainVerificationToken", a.DomainVerificationToken) + populateTimeRFC3339(objectMap, "expirationTime", a.ExpirationTime) + populate(objectMap, "intermediate", a.Intermediate) + populate(objectMap, "isPrivateKeyExternal", a.IsPrivateKeyExternal) + populate(objectMap, "keySize", a.KeySize) + populateTimeRFC3339(objectMap, "lastCertificateIssuanceTime", a.LastCertificateIssuanceTime) + populateTimeRFC3339(objectMap, "nextAutoRenewalTimeStamp", a.NextAutoRenewalTimeStamp) + populate(objectMap, "productType", a.ProductType) + populate(objectMap, "provisioningState", a.ProvisioningState) + populate(objectMap, "root", a.Root) + populate(objectMap, "serialNumber", a.SerialNumber) + populate(objectMap, "signedCertificate", a.SignedCertificate) + populate(objectMap, "status", a.Status) + populate(objectMap, "validityInYears", a.ValidityInYears) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AppServiceCertificateOrderProperties. +func (a *AppServiceCertificateOrderProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "appServiceCertificateNotRenewableReasons": + err = unpopulate(val, &a.AppServiceCertificateNotRenewableReasons) + delete(rawMsg, key) + case "autoRenew": + err = unpopulate(val, &a.AutoRenew) + delete(rawMsg, key) + case "certificates": + err = unpopulate(val, &a.Certificates) + delete(rawMsg, key) + case "contact": + err = unpopulate(val, &a.Contact) + delete(rawMsg, key) + case "csr": + err = unpopulate(val, &a.Csr) + delete(rawMsg, key) + case "distinguishedName": + err = unpopulate(val, &a.DistinguishedName) + delete(rawMsg, key) + case "domainVerificationToken": + err = unpopulate(val, &a.DomainVerificationToken) + delete(rawMsg, key) + case "expirationTime": + err = unpopulateTimeRFC3339(val, &a.ExpirationTime) + delete(rawMsg, key) + case "intermediate": + err = unpopulate(val, &a.Intermediate) + delete(rawMsg, key) + case "isPrivateKeyExternal": + err = unpopulate(val, &a.IsPrivateKeyExternal) + delete(rawMsg, key) + case "keySize": + err = unpopulate(val, &a.KeySize) + delete(rawMsg, key) + case "lastCertificateIssuanceTime": + err = unpopulateTimeRFC3339(val, &a.LastCertificateIssuanceTime) + delete(rawMsg, key) + case "nextAutoRenewalTimeStamp": + err = unpopulateTimeRFC3339(val, &a.NextAutoRenewalTimeStamp) + delete(rawMsg, key) + case "productType": + err = unpopulate(val, &a.ProductType) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, &a.ProvisioningState) + delete(rawMsg, key) + case "root": + err = unpopulate(val, &a.Root) + delete(rawMsg, key) + case "serialNumber": + err = unpopulate(val, &a.SerialNumber) + delete(rawMsg, key) + case "signedCertificate": + err = unpopulate(val, &a.SignedCertificate) + delete(rawMsg, key) + case "status": + err = unpopulate(val, &a.Status) + delete(rawMsg, key) + case "validityInYears": + err = unpopulate(val, &a.ValidityInYears) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// AppServiceCertificateOrdersBeginCreateOrUpdateCertificateOptions contains the optional parameters for the AppServiceCertificateOrders.BeginCreateOrUpdateCertificate +// method. +type AppServiceCertificateOrdersBeginCreateOrUpdateCertificateOptions struct { + // placeholder for future optional parameters +} + +// AppServiceCertificateOrdersBeginCreateOrUpdateOptions contains the optional parameters for the AppServiceCertificateOrders.BeginCreateOrUpdate method. +type AppServiceCertificateOrdersBeginCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// AppServiceCertificateOrdersDeleteCertificateOptions contains the optional parameters for the AppServiceCertificateOrders.DeleteCertificate method. +type AppServiceCertificateOrdersDeleteCertificateOptions struct { + // placeholder for future optional parameters +} + +// AppServiceCertificateOrdersDeleteOptions contains the optional parameters for the AppServiceCertificateOrders.Delete method. +type AppServiceCertificateOrdersDeleteOptions struct { + // placeholder for future optional parameters +} + +// AppServiceCertificateOrdersGetCertificateOptions contains the optional parameters for the AppServiceCertificateOrders.GetCertificate method. +type AppServiceCertificateOrdersGetCertificateOptions struct { + // placeholder for future optional parameters +} + +// AppServiceCertificateOrdersGetOptions contains the optional parameters for the AppServiceCertificateOrders.Get method. +type AppServiceCertificateOrdersGetOptions struct { + // placeholder for future optional parameters +} + +// AppServiceCertificateOrdersListByResourceGroupOptions contains the optional parameters for the AppServiceCertificateOrders.ListByResourceGroup method. +type AppServiceCertificateOrdersListByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// AppServiceCertificateOrdersListCertificatesOptions contains the optional parameters for the AppServiceCertificateOrders.ListCertificates method. +type AppServiceCertificateOrdersListCertificatesOptions struct { + // placeholder for future optional parameters +} + +// AppServiceCertificateOrdersListOptions contains the optional parameters for the AppServiceCertificateOrders.List method. +type AppServiceCertificateOrdersListOptions struct { + // placeholder for future optional parameters +} + +// AppServiceCertificateOrdersReissueOptions contains the optional parameters for the AppServiceCertificateOrders.Reissue method. +type AppServiceCertificateOrdersReissueOptions struct { + // placeholder for future optional parameters +} + +// AppServiceCertificateOrdersRenewOptions contains the optional parameters for the AppServiceCertificateOrders.Renew method. +type AppServiceCertificateOrdersRenewOptions struct { + // placeholder for future optional parameters +} + +// AppServiceCertificateOrdersResendEmailOptions contains the optional parameters for the AppServiceCertificateOrders.ResendEmail method. +type AppServiceCertificateOrdersResendEmailOptions struct { + // placeholder for future optional parameters +} + +// AppServiceCertificateOrdersResendRequestEmailsOptions contains the optional parameters for the AppServiceCertificateOrders.ResendRequestEmails method. +type AppServiceCertificateOrdersResendRequestEmailsOptions struct { + // placeholder for future optional parameters +} + +// AppServiceCertificateOrdersRetrieveCertificateActionsOptions contains the optional parameters for the AppServiceCertificateOrders.RetrieveCertificateActions +// method. +type AppServiceCertificateOrdersRetrieveCertificateActionsOptions struct { + // placeholder for future optional parameters +} + +// AppServiceCertificateOrdersRetrieveCertificateEmailHistoryOptions contains the optional parameters for the AppServiceCertificateOrders.RetrieveCertificateEmailHistory +// method. +type AppServiceCertificateOrdersRetrieveCertificateEmailHistoryOptions struct { + // placeholder for future optional parameters +} + +// AppServiceCertificateOrdersRetrieveSiteSealOptions contains the optional parameters for the AppServiceCertificateOrders.RetrieveSiteSeal method. +type AppServiceCertificateOrdersRetrieveSiteSealOptions struct { + // placeholder for future optional parameters +} + +// AppServiceCertificateOrdersUpdateCertificateOptions contains the optional parameters for the AppServiceCertificateOrders.UpdateCertificate method. +type AppServiceCertificateOrdersUpdateCertificateOptions struct { + // placeholder for future optional parameters +} + +// AppServiceCertificateOrdersUpdateOptions contains the optional parameters for the AppServiceCertificateOrders.Update method. +type AppServiceCertificateOrdersUpdateOptions struct { + // placeholder for future optional parameters +} + +// AppServiceCertificateOrdersValidatePurchaseInformationOptions contains the optional parameters for the AppServiceCertificateOrders.ValidatePurchaseInformation +// method. +type AppServiceCertificateOrdersValidatePurchaseInformationOptions struct { + // placeholder for future optional parameters +} + +// AppServiceCertificateOrdersVerifyDomainOwnershipOptions contains the optional parameters for the AppServiceCertificateOrders.VerifyDomainOwnership method. +type AppServiceCertificateOrdersVerifyDomainOwnershipOptions struct { + // placeholder for future optional parameters +} + +// AppServiceCertificatePatchResource - Key Vault container ARM resource for a certificate that is purchased through Azure. +type AppServiceCertificatePatchResource struct { + ProxyOnlyResource + // Core resource properties + Properties *AppServiceCertificate `json:"properties,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type AppServiceCertificatePatchResource. +func (a AppServiceCertificatePatchResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + a.ProxyOnlyResource.marshalInternal(objectMap) + populate(objectMap, "properties", a.Properties) + return json.Marshal(objectMap) +} + +// AppServiceCertificateResource - Key Vault container ARM resource for a certificate that is purchased through Azure. +type AppServiceCertificateResource struct { + Resource + // Core resource properties + Properties *AppServiceCertificate `json:"properties,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type AppServiceCertificateResource. +func (a AppServiceCertificateResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + a.Resource.marshalInternal(objectMap) + populate(objectMap, "properties", a.Properties) + return json.Marshal(objectMap) +} + +// AppServiceEnvironment - Description of an App Service Environment. +type AppServiceEnvironment struct { + // REQUIRED; Description of the Virtual Network. + VirtualNetwork *VirtualNetworkProfile `json:"virtualNetwork,omitempty"` + + // Custom settings for changing the behavior of the App Service Environment. + ClusterSettings []*NameValuePair `json:"clusterSettings,omitempty"` + + // DNS suffix of the App Service Environment. + DNSSuffix *string `json:"dnsSuffix,omitempty"` + + // Dedicated Host Count + DedicatedHostCount *int32 `json:"dedicatedHostCount,omitempty"` + + // Scale factor for front-ends. + FrontEndScaleFactor *int32 `json:"frontEndScaleFactor,omitempty"` + + // Specifies which endpoints to serve internally in the Virtual Network for the App Service Environment. + InternalLoadBalancingMode *LoadBalancingMode `json:"internalLoadBalancingMode,omitempty"` + + // Number of IP SSL addresses reserved for the App Service Environment. + IpsslAddressCount *int32 `json:"ipsslAddressCount,omitempty"` + + // Front-end VM size, e.g. "Medium", "Large". + MultiSize *string `json:"multiSize,omitempty"` + + // User added ip ranges to whitelist on ASE db + UserWhitelistedIPRanges []*string `json:"userWhitelistedIpRanges,omitempty"` + + // Whether or not this App Service Environment is zone-redundant. + ZoneRedundant *bool `json:"zoneRedundant,omitempty"` + + // READ-ONLY; Flag that displays whether an ASE has linux workers or not + HasLinuxWorkers *bool `json:"hasLinuxWorkers,omitempty" azure:"ro"` + + // READ-ONLY; Maximum number of VMs in the App Service Environment. + MaximumNumberOfMachines *int32 `json:"maximumNumberOfMachines,omitempty" azure:"ro"` + + // READ-ONLY; Number of front-end instances. + MultiRoleCount *int32 `json:"multiRoleCount,omitempty" azure:"ro"` + + // READ-ONLY; Provisioning state of the App Service Environment. + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` + + // READ-ONLY; Current status of the App Service Environment. + Status *HostingEnvironmentStatus `json:"status,omitempty" azure:"ro"` + + // READ-ONLY; true if the App Service Environment is suspended; otherwise, false. The environment can be suspended, e.g. when the management endpoint is + // no longer available (most likely because NSG blocked the + // incoming traffic). + Suspended *bool `json:"suspended,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type AppServiceEnvironment. +func (a AppServiceEnvironment) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "clusterSettings", a.ClusterSettings) + populate(objectMap, "dnsSuffix", a.DNSSuffix) + populate(objectMap, "dedicatedHostCount", a.DedicatedHostCount) + populate(objectMap, "frontEndScaleFactor", a.FrontEndScaleFactor) + populate(objectMap, "hasLinuxWorkers", a.HasLinuxWorkers) + populate(objectMap, "internalLoadBalancingMode", a.InternalLoadBalancingMode) + populate(objectMap, "ipsslAddressCount", a.IpsslAddressCount) + populate(objectMap, "maximumNumberOfMachines", a.MaximumNumberOfMachines) + populate(objectMap, "multiRoleCount", a.MultiRoleCount) + populate(objectMap, "multiSize", a.MultiSize) + populate(objectMap, "provisioningState", a.ProvisioningState) + populate(objectMap, "status", a.Status) + populate(objectMap, "suspended", a.Suspended) + populate(objectMap, "userWhitelistedIpRanges", a.UserWhitelistedIPRanges) + populate(objectMap, "virtualNetwork", a.VirtualNetwork) + populate(objectMap, "zoneRedundant", a.ZoneRedundant) + return json.Marshal(objectMap) +} + +// AppServiceEnvironmentCollection - Collection of App Service Environments. +type AppServiceEnvironmentCollection struct { + // REQUIRED; Collection of resources. + Value []*AppServiceEnvironmentResource `json:"value,omitempty"` + + // READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type AppServiceEnvironmentCollection. +func (a AppServiceEnvironmentCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", a.NextLink) + populate(objectMap, "value", a.Value) + return json.Marshal(objectMap) +} + +// AppServiceEnvironmentPatchResource - ARM resource for a app service environment. +type AppServiceEnvironmentPatchResource struct { + ProxyOnlyResource + // Core resource properties + Properties *AppServiceEnvironment `json:"properties,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type AppServiceEnvironmentPatchResource. +func (a AppServiceEnvironmentPatchResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + a.ProxyOnlyResource.marshalInternal(objectMap) + populate(objectMap, "properties", a.Properties) + return json.Marshal(objectMap) +} + +// AppServiceEnvironmentResource - App Service Environment ARM resource. +type AppServiceEnvironmentResource struct { + Resource + // Core resource properties + Properties *AppServiceEnvironment `json:"properties,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type AppServiceEnvironmentResource. +func (a AppServiceEnvironmentResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + a.Resource.marshalInternal(objectMap) + populate(objectMap, "properties", a.Properties) + return json.Marshal(objectMap) +} + +// AppServiceEnvironmentsBeginApproveOrRejectPrivateEndpointConnectionOptions contains the optional parameters for the AppServiceEnvironments.BeginApproveOrRejectPrivateEndpointConnection +// method. +type AppServiceEnvironmentsBeginApproveOrRejectPrivateEndpointConnectionOptions struct { + // placeholder for future optional parameters +} + +// AppServiceEnvironmentsBeginChangeVnetOptions contains the optional parameters for the AppServiceEnvironments.BeginChangeVnet method. +type AppServiceEnvironmentsBeginChangeVnetOptions struct { + // placeholder for future optional parameters +} + +// AppServiceEnvironmentsBeginCreateOrUpdateMultiRolePoolOptions contains the optional parameters for the AppServiceEnvironments.BeginCreateOrUpdateMultiRolePool +// method. +type AppServiceEnvironmentsBeginCreateOrUpdateMultiRolePoolOptions struct { + // placeholder for future optional parameters +} + +// AppServiceEnvironmentsBeginCreateOrUpdateOptions contains the optional parameters for the AppServiceEnvironments.BeginCreateOrUpdate method. +type AppServiceEnvironmentsBeginCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// AppServiceEnvironmentsBeginCreateOrUpdateWorkerPoolOptions contains the optional parameters for the AppServiceEnvironments.BeginCreateOrUpdateWorkerPool +// method. +type AppServiceEnvironmentsBeginCreateOrUpdateWorkerPoolOptions struct { + // placeholder for future optional parameters +} + +// AppServiceEnvironmentsBeginDeleteOptions contains the optional parameters for the AppServiceEnvironments.BeginDelete method. +type AppServiceEnvironmentsBeginDeleteOptions struct { + // Specify true to force the deletion even if the App Service Environment contains resources. The default is false. + ForceDelete *bool +} + +// AppServiceEnvironmentsBeginDeletePrivateEndpointConnectionOptions contains the optional parameters for the AppServiceEnvironments.BeginDeletePrivateEndpointConnection +// method. +type AppServiceEnvironmentsBeginDeletePrivateEndpointConnectionOptions struct { + // placeholder for future optional parameters +} + +// AppServiceEnvironmentsBeginResumeOptions contains the optional parameters for the AppServiceEnvironments.BeginResume method. +type AppServiceEnvironmentsBeginResumeOptions struct { + // placeholder for future optional parameters +} + +// AppServiceEnvironmentsBeginSuspendOptions contains the optional parameters for the AppServiceEnvironments.BeginSuspend method. +type AppServiceEnvironmentsBeginSuspendOptions struct { + // placeholder for future optional parameters +} + +// AppServiceEnvironmentsGetAseV3NetworkingConfigurationOptions contains the optional parameters for the AppServiceEnvironments.GetAseV3NetworkingConfiguration +// method. +type AppServiceEnvironmentsGetAseV3NetworkingConfigurationOptions struct { + // placeholder for future optional parameters +} + +// AppServiceEnvironmentsGetDiagnosticsItemOptions contains the optional parameters for the AppServiceEnvironments.GetDiagnosticsItem method. +type AppServiceEnvironmentsGetDiagnosticsItemOptions struct { + // placeholder for future optional parameters +} + +// AppServiceEnvironmentsGetInboundNetworkDependenciesEndpointsOptions contains the optional parameters for the AppServiceEnvironments.GetInboundNetworkDependenciesEndpoints +// method. +type AppServiceEnvironmentsGetInboundNetworkDependenciesEndpointsOptions struct { + // placeholder for future optional parameters +} + +// AppServiceEnvironmentsGetMultiRolePoolOptions contains the optional parameters for the AppServiceEnvironments.GetMultiRolePool method. +type AppServiceEnvironmentsGetMultiRolePoolOptions struct { + // placeholder for future optional parameters +} + +// AppServiceEnvironmentsGetOptions contains the optional parameters for the AppServiceEnvironments.Get method. +type AppServiceEnvironmentsGetOptions struct { + // placeholder for future optional parameters +} + +// AppServiceEnvironmentsGetOutboundNetworkDependenciesEndpointsOptions contains the optional parameters for the AppServiceEnvironments.GetOutboundNetworkDependenciesEndpoints +// method. +type AppServiceEnvironmentsGetOutboundNetworkDependenciesEndpointsOptions struct { + // placeholder for future optional parameters +} + +// AppServiceEnvironmentsGetPrivateEndpointConnectionListOptions contains the optional parameters for the AppServiceEnvironments.GetPrivateEndpointConnectionList +// method. +type AppServiceEnvironmentsGetPrivateEndpointConnectionListOptions struct { + // placeholder for future optional parameters +} + +// AppServiceEnvironmentsGetPrivateEndpointConnectionOptions contains the optional parameters for the AppServiceEnvironments.GetPrivateEndpointConnection +// method. +type AppServiceEnvironmentsGetPrivateEndpointConnectionOptions struct { + // placeholder for future optional parameters +} + +// AppServiceEnvironmentsGetPrivateLinkResourcesOptions contains the optional parameters for the AppServiceEnvironments.GetPrivateLinkResources method. +type AppServiceEnvironmentsGetPrivateLinkResourcesOptions struct { + // placeholder for future optional parameters +} + +// AppServiceEnvironmentsGetVipInfoOptions contains the optional parameters for the AppServiceEnvironments.GetVipInfo method. +type AppServiceEnvironmentsGetVipInfoOptions struct { + // placeholder for future optional parameters +} + +// AppServiceEnvironmentsGetWorkerPoolOptions contains the optional parameters for the AppServiceEnvironments.GetWorkerPool method. +type AppServiceEnvironmentsGetWorkerPoolOptions struct { + // placeholder for future optional parameters +} + +// AppServiceEnvironmentsListAppServicePlansOptions contains the optional parameters for the AppServiceEnvironments.ListAppServicePlans method. +type AppServiceEnvironmentsListAppServicePlansOptions struct { + // placeholder for future optional parameters +} + +// AppServiceEnvironmentsListByResourceGroupOptions contains the optional parameters for the AppServiceEnvironments.ListByResourceGroup method. +type AppServiceEnvironmentsListByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// AppServiceEnvironmentsListCapacitiesOptions contains the optional parameters for the AppServiceEnvironments.ListCapacities method. +type AppServiceEnvironmentsListCapacitiesOptions struct { + // placeholder for future optional parameters +} + +// AppServiceEnvironmentsListDiagnosticsOptions contains the optional parameters for the AppServiceEnvironments.ListDiagnostics method. +type AppServiceEnvironmentsListDiagnosticsOptions struct { + // placeholder for future optional parameters +} + +// AppServiceEnvironmentsListMultiRoleMetricDefinitionsOptions contains the optional parameters for the AppServiceEnvironments.ListMultiRoleMetricDefinitions +// method. +type AppServiceEnvironmentsListMultiRoleMetricDefinitionsOptions struct { + // placeholder for future optional parameters +} + +// AppServiceEnvironmentsListMultiRolePoolInstanceMetricDefinitionsOptions contains the optional parameters for the AppServiceEnvironments.ListMultiRolePoolInstanceMetricDefinitions +// method. +type AppServiceEnvironmentsListMultiRolePoolInstanceMetricDefinitionsOptions struct { + // placeholder for future optional parameters +} + +// AppServiceEnvironmentsListMultiRolePoolSKUsOptions contains the optional parameters for the AppServiceEnvironments.ListMultiRolePoolSKUs method. +type AppServiceEnvironmentsListMultiRolePoolSKUsOptions struct { + // placeholder for future optional parameters +} + +// AppServiceEnvironmentsListMultiRolePoolsOptions contains the optional parameters for the AppServiceEnvironments.ListMultiRolePools method. +type AppServiceEnvironmentsListMultiRolePoolsOptions struct { + // placeholder for future optional parameters +} + +// AppServiceEnvironmentsListMultiRoleUsagesOptions contains the optional parameters for the AppServiceEnvironments.ListMultiRoleUsages method. +type AppServiceEnvironmentsListMultiRoleUsagesOptions struct { + // placeholder for future optional parameters +} + +// AppServiceEnvironmentsListOperationsOptions contains the optional parameters for the AppServiceEnvironments.ListOperations method. +type AppServiceEnvironmentsListOperationsOptions struct { + // placeholder for future optional parameters +} + +// AppServiceEnvironmentsListOptions contains the optional parameters for the AppServiceEnvironments.List method. +type AppServiceEnvironmentsListOptions struct { + // placeholder for future optional parameters +} + +// AppServiceEnvironmentsListUsagesOptions contains the optional parameters for the AppServiceEnvironments.ListUsages method. +type AppServiceEnvironmentsListUsagesOptions struct { + // Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') + // and startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. + Filter *string +} + +// AppServiceEnvironmentsListWebAppsOptions contains the optional parameters for the AppServiceEnvironments.ListWebApps method. +type AppServiceEnvironmentsListWebAppsOptions struct { + // Comma separated list of app properties to include. + PropertiesToInclude *string +} + +// AppServiceEnvironmentsListWebWorkerMetricDefinitionsOptions contains the optional parameters for the AppServiceEnvironments.ListWebWorkerMetricDefinitions +// method. +type AppServiceEnvironmentsListWebWorkerMetricDefinitionsOptions struct { + // placeholder for future optional parameters +} + +// AppServiceEnvironmentsListWebWorkerUsagesOptions contains the optional parameters for the AppServiceEnvironments.ListWebWorkerUsages method. +type AppServiceEnvironmentsListWebWorkerUsagesOptions struct { + // placeholder for future optional parameters +} + +// AppServiceEnvironmentsListWorkerPoolInstanceMetricDefinitionsOptions contains the optional parameters for the AppServiceEnvironments.ListWorkerPoolInstanceMetricDefinitions +// method. +type AppServiceEnvironmentsListWorkerPoolInstanceMetricDefinitionsOptions struct { + // placeholder for future optional parameters +} + +// AppServiceEnvironmentsListWorkerPoolSKUsOptions contains the optional parameters for the AppServiceEnvironments.ListWorkerPoolSKUs method. +type AppServiceEnvironmentsListWorkerPoolSKUsOptions struct { + // placeholder for future optional parameters +} + +// AppServiceEnvironmentsListWorkerPoolsOptions contains the optional parameters for the AppServiceEnvironments.ListWorkerPools method. +type AppServiceEnvironmentsListWorkerPoolsOptions struct { + // placeholder for future optional parameters +} + +// AppServiceEnvironmentsRebootOptions contains the optional parameters for the AppServiceEnvironments.Reboot method. +type AppServiceEnvironmentsRebootOptions struct { + // placeholder for future optional parameters +} + +// AppServiceEnvironmentsUpdateAseNetworkingConfigurationOptions contains the optional parameters for the AppServiceEnvironments.UpdateAseNetworkingConfiguration +// method. +type AppServiceEnvironmentsUpdateAseNetworkingConfigurationOptions struct { + // placeholder for future optional parameters +} + +// AppServiceEnvironmentsUpdateMultiRolePoolOptions contains the optional parameters for the AppServiceEnvironments.UpdateMultiRolePool method. +type AppServiceEnvironmentsUpdateMultiRolePoolOptions struct { + // placeholder for future optional parameters +} + +// AppServiceEnvironmentsUpdateOptions contains the optional parameters for the AppServiceEnvironments.Update method. +type AppServiceEnvironmentsUpdateOptions struct { + // placeholder for future optional parameters +} + +// AppServiceEnvironmentsUpdateWorkerPoolOptions contains the optional parameters for the AppServiceEnvironments.UpdateWorkerPool method. +type AppServiceEnvironmentsUpdateWorkerPoolOptions struct { + // placeholder for future optional parameters +} + +// AppServicePlan - App Service plan. +type AppServicePlan struct { + Resource + // Extended Location. + ExtendedLocation *ExtendedLocation `json:"extendedLocation,omitempty"` + + // AppServicePlan resource specific properties + Properties *AppServicePlanProperties `json:"properties,omitempty"` + + // Description of a SKU for a scalable resource. + SKU *SKUDescription `json:"sku,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type AppServicePlan. +func (a AppServicePlan) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + a.Resource.marshalInternal(objectMap) + populate(objectMap, "extendedLocation", a.ExtendedLocation) + populate(objectMap, "properties", a.Properties) + populate(objectMap, "sku", a.SKU) + return json.Marshal(objectMap) +} + +// AppServicePlanCollection - Collection of App Service plans. +type AppServicePlanCollection struct { + // REQUIRED; Collection of resources. + Value []*AppServicePlan `json:"value,omitempty"` + + // READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type AppServicePlanCollection. +func (a AppServicePlanCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", a.NextLink) + populate(objectMap, "value", a.Value) + return json.Marshal(objectMap) +} + +// AppServicePlanPatchResource - ARM resource for a app service plan. +type AppServicePlanPatchResource struct { + ProxyOnlyResource + // AppServicePlanPatchResource resource specific properties + Properties *AppServicePlanPatchResourceProperties `json:"properties,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type AppServicePlanPatchResource. +func (a AppServicePlanPatchResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + a.ProxyOnlyResource.marshalInternal(objectMap) + populate(objectMap, "properties", a.Properties) + return json.Marshal(objectMap) +} + +// AppServicePlanPatchResourceProperties - AppServicePlanPatchResource resource specific properties +type AppServicePlanPatchResourceProperties struct { + // ServerFarm supports ElasticScale. Apps in this plan will scale as if the ServerFarm was ElasticPremium sku + ElasticScaleEnabled *bool `json:"elasticScaleEnabled,omitempty"` + + // The time when the server farm free offer expires. + FreeOfferExpirationTime *time.Time `json:"freeOfferExpirationTime,omitempty"` + + // Specification for the App Service Environment to use for the App Service plan. + HostingEnvironmentProfile *HostingEnvironmentProfile `json:"hostingEnvironmentProfile,omitempty"` + + // If Hyper-V container app service plan true, false otherwise. + HyperV *bool `json:"hyperV,omitempty"` + + // If true, this App Service Plan owns spot instances. + IsSpot *bool `json:"isSpot,omitempty"` + + // Obsolete: If Hyper-V container app service plan true, false otherwise. + IsXenon *bool `json:"isXenon,omitempty"` + + // Specification for the Kubernetes Environment to use for the App Service plan. + KubeEnvironmentProfile *KubeEnvironmentProfile `json:"kubeEnvironmentProfile,omitempty"` + + // Maximum number of total workers allowed for this ElasticScaleEnabled App Service Plan + MaximumElasticWorkerCount *int32 `json:"maximumElasticWorkerCount,omitempty"` + + // If true, apps assigned to this App Service plan can be scaled independently. If false, apps assigned to this App Service plan will scale to all instances + // of the plan. + PerSiteScaling *bool `json:"perSiteScaling,omitempty"` + + // If Linux app service plan true, false otherwise. + Reserved *bool `json:"reserved,omitempty"` + + // The time when the server farm expires. Valid only if it is a spot server farm. + SpotExpirationTime *time.Time `json:"spotExpirationTime,omitempty"` + + // Scaling worker count. + TargetWorkerCount *int32 `json:"targetWorkerCount,omitempty"` + + // Scaling worker size ID. + TargetWorkerSizeID *int32 `json:"targetWorkerSizeId,omitempty"` + + // Target worker tier assigned to the App Service plan. + WorkerTierName *string `json:"workerTierName,omitempty"` + + // If true, this App Service Plan will perform availability zone balancing. If false, this App Service Plan will not perform availability zone balancing. + ZoneRedundant *bool `json:"zoneRedundant,omitempty"` + + // READ-ONLY; Geographical location for the App Service plan. + GeoRegion *string `json:"geoRegion,omitempty" azure:"ro"` + + // READ-ONLY; Maximum number of instances that can be assigned to this App Service plan. + MaximumNumberOfWorkers *int32 `json:"maximumNumberOfWorkers,omitempty" azure:"ro"` + + // READ-ONLY; Number of apps assigned to this App Service plan. + NumberOfSites *int32 `json:"numberOfSites,omitempty" azure:"ro"` + + // READ-ONLY; Provisioning state of the App Service Plan. + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` + + // READ-ONLY; Resource group of the App Service plan. + ResourceGroup *string `json:"resourceGroup,omitempty" azure:"ro"` + + // READ-ONLY; App Service plan status. + Status *StatusOptions `json:"status,omitempty" azure:"ro"` + + // READ-ONLY; App Service plan subscription. + Subscription *string `json:"subscription,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type AppServicePlanPatchResourceProperties. +func (a AppServicePlanPatchResourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "elasticScaleEnabled", a.ElasticScaleEnabled) + populateTimeRFC3339(objectMap, "freeOfferExpirationTime", a.FreeOfferExpirationTime) + populate(objectMap, "geoRegion", a.GeoRegion) + populate(objectMap, "hostingEnvironmentProfile", a.HostingEnvironmentProfile) + populate(objectMap, "hyperV", a.HyperV) + populate(objectMap, "isSpot", a.IsSpot) + populate(objectMap, "isXenon", a.IsXenon) + populate(objectMap, "kubeEnvironmentProfile", a.KubeEnvironmentProfile) + populate(objectMap, "maximumElasticWorkerCount", a.MaximumElasticWorkerCount) + populate(objectMap, "maximumNumberOfWorkers", a.MaximumNumberOfWorkers) + populate(objectMap, "numberOfSites", a.NumberOfSites) + populate(objectMap, "perSiteScaling", a.PerSiteScaling) + populate(objectMap, "provisioningState", a.ProvisioningState) + populate(objectMap, "reserved", a.Reserved) + populate(objectMap, "resourceGroup", a.ResourceGroup) + populateTimeRFC3339(objectMap, "spotExpirationTime", a.SpotExpirationTime) + populate(objectMap, "status", a.Status) + populate(objectMap, "subscription", a.Subscription) + populate(objectMap, "targetWorkerCount", a.TargetWorkerCount) + populate(objectMap, "targetWorkerSizeId", a.TargetWorkerSizeID) + populate(objectMap, "workerTierName", a.WorkerTierName) + populate(objectMap, "zoneRedundant", a.ZoneRedundant) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AppServicePlanPatchResourceProperties. +func (a *AppServicePlanPatchResourceProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "elasticScaleEnabled": + err = unpopulate(val, &a.ElasticScaleEnabled) + delete(rawMsg, key) + case "freeOfferExpirationTime": + err = unpopulateTimeRFC3339(val, &a.FreeOfferExpirationTime) + delete(rawMsg, key) + case "geoRegion": + err = unpopulate(val, &a.GeoRegion) + delete(rawMsg, key) + case "hostingEnvironmentProfile": + err = unpopulate(val, &a.HostingEnvironmentProfile) + delete(rawMsg, key) + case "hyperV": + err = unpopulate(val, &a.HyperV) + delete(rawMsg, key) + case "isSpot": + err = unpopulate(val, &a.IsSpot) + delete(rawMsg, key) + case "isXenon": + err = unpopulate(val, &a.IsXenon) + delete(rawMsg, key) + case "kubeEnvironmentProfile": + err = unpopulate(val, &a.KubeEnvironmentProfile) + delete(rawMsg, key) + case "maximumElasticWorkerCount": + err = unpopulate(val, &a.MaximumElasticWorkerCount) + delete(rawMsg, key) + case "maximumNumberOfWorkers": + err = unpopulate(val, &a.MaximumNumberOfWorkers) + delete(rawMsg, key) + case "numberOfSites": + err = unpopulate(val, &a.NumberOfSites) + delete(rawMsg, key) + case "perSiteScaling": + err = unpopulate(val, &a.PerSiteScaling) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, &a.ProvisioningState) + delete(rawMsg, key) + case "reserved": + err = unpopulate(val, &a.Reserved) + delete(rawMsg, key) + case "resourceGroup": + err = unpopulate(val, &a.ResourceGroup) + delete(rawMsg, key) + case "spotExpirationTime": + err = unpopulateTimeRFC3339(val, &a.SpotExpirationTime) + delete(rawMsg, key) + case "status": + err = unpopulate(val, &a.Status) + delete(rawMsg, key) + case "subscription": + err = unpopulate(val, &a.Subscription) + delete(rawMsg, key) + case "targetWorkerCount": + err = unpopulate(val, &a.TargetWorkerCount) + delete(rawMsg, key) + case "targetWorkerSizeId": + err = unpopulate(val, &a.TargetWorkerSizeID) + delete(rawMsg, key) + case "workerTierName": + err = unpopulate(val, &a.WorkerTierName) + delete(rawMsg, key) + case "zoneRedundant": + err = unpopulate(val, &a.ZoneRedundant) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// AppServicePlanProperties - AppServicePlan resource specific properties +type AppServicePlanProperties struct { + // ServerFarm supports ElasticScale. Apps in this plan will scale as if the ServerFarm was ElasticPremium sku + ElasticScaleEnabled *bool `json:"elasticScaleEnabled,omitempty"` + + // The time when the server farm free offer expires. + FreeOfferExpirationTime *time.Time `json:"freeOfferExpirationTime,omitempty"` + + // Specification for the App Service Environment to use for the App Service plan. + HostingEnvironmentProfile *HostingEnvironmentProfile `json:"hostingEnvironmentProfile,omitempty"` + + // If Hyper-V container app service plan true, false otherwise. + HyperV *bool `json:"hyperV,omitempty"` + + // If true, this App Service Plan owns spot instances. + IsSpot *bool `json:"isSpot,omitempty"` + + // Obsolete: If Hyper-V container app service plan true, false otherwise. + IsXenon *bool `json:"isXenon,omitempty"` + + // Specification for the Kubernetes Environment to use for the App Service plan. + KubeEnvironmentProfile *KubeEnvironmentProfile `json:"kubeEnvironmentProfile,omitempty"` + + // Maximum number of total workers allowed for this ElasticScaleEnabled App Service Plan + MaximumElasticWorkerCount *int32 `json:"maximumElasticWorkerCount,omitempty"` + + // If true, apps assigned to this App Service plan can be scaled independently. If false, apps assigned to this App Service plan will scale to all instances + // of the plan. + PerSiteScaling *bool `json:"perSiteScaling,omitempty"` + + // If Linux app service plan true, false otherwise. + Reserved *bool `json:"reserved,omitempty"` + + // The time when the server farm expires. Valid only if it is a spot server farm. + SpotExpirationTime *time.Time `json:"spotExpirationTime,omitempty"` + + // Scaling worker count. + TargetWorkerCount *int32 `json:"targetWorkerCount,omitempty"` + + // Scaling worker size ID. + TargetWorkerSizeID *int32 `json:"targetWorkerSizeId,omitempty"` + + // Target worker tier assigned to the App Service plan. + WorkerTierName *string `json:"workerTierName,omitempty"` + + // If true, this App Service Plan will perform availability zone balancing. If false, this App Service Plan will not perform availability zone balancing. + ZoneRedundant *bool `json:"zoneRedundant,omitempty"` + + // READ-ONLY; Geographical location for the App Service plan. + GeoRegion *string `json:"geoRegion,omitempty" azure:"ro"` + + // READ-ONLY; Maximum number of instances that can be assigned to this App Service plan. + MaximumNumberOfWorkers *int32 `json:"maximumNumberOfWorkers,omitempty" azure:"ro"` + + // READ-ONLY; Number of apps assigned to this App Service plan. + NumberOfSites *int32 `json:"numberOfSites,omitempty" azure:"ro"` + + // READ-ONLY; Provisioning state of the App Service Plan. + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` + + // READ-ONLY; Resource group of the App Service plan. + ResourceGroup *string `json:"resourceGroup,omitempty" azure:"ro"` + + // READ-ONLY; App Service plan status. + Status *StatusOptions `json:"status,omitempty" azure:"ro"` + + // READ-ONLY; App Service plan subscription. + Subscription *string `json:"subscription,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type AppServicePlanProperties. +func (a AppServicePlanProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "elasticScaleEnabled", a.ElasticScaleEnabled) + populateTimeRFC3339(objectMap, "freeOfferExpirationTime", a.FreeOfferExpirationTime) + populate(objectMap, "geoRegion", a.GeoRegion) + populate(objectMap, "hostingEnvironmentProfile", a.HostingEnvironmentProfile) + populate(objectMap, "hyperV", a.HyperV) + populate(objectMap, "isSpot", a.IsSpot) + populate(objectMap, "isXenon", a.IsXenon) + populate(objectMap, "kubeEnvironmentProfile", a.KubeEnvironmentProfile) + populate(objectMap, "maximumElasticWorkerCount", a.MaximumElasticWorkerCount) + populate(objectMap, "maximumNumberOfWorkers", a.MaximumNumberOfWorkers) + populate(objectMap, "numberOfSites", a.NumberOfSites) + populate(objectMap, "perSiteScaling", a.PerSiteScaling) + populate(objectMap, "provisioningState", a.ProvisioningState) + populate(objectMap, "reserved", a.Reserved) + populate(objectMap, "resourceGroup", a.ResourceGroup) + populateTimeRFC3339(objectMap, "spotExpirationTime", a.SpotExpirationTime) + populate(objectMap, "status", a.Status) + populate(objectMap, "subscription", a.Subscription) + populate(objectMap, "targetWorkerCount", a.TargetWorkerCount) + populate(objectMap, "targetWorkerSizeId", a.TargetWorkerSizeID) + populate(objectMap, "workerTierName", a.WorkerTierName) + populate(objectMap, "zoneRedundant", a.ZoneRedundant) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AppServicePlanProperties. +func (a *AppServicePlanProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "elasticScaleEnabled": + err = unpopulate(val, &a.ElasticScaleEnabled) + delete(rawMsg, key) + case "freeOfferExpirationTime": + err = unpopulateTimeRFC3339(val, &a.FreeOfferExpirationTime) + delete(rawMsg, key) + case "geoRegion": + err = unpopulate(val, &a.GeoRegion) + delete(rawMsg, key) + case "hostingEnvironmentProfile": + err = unpopulate(val, &a.HostingEnvironmentProfile) + delete(rawMsg, key) + case "hyperV": + err = unpopulate(val, &a.HyperV) + delete(rawMsg, key) + case "isSpot": + err = unpopulate(val, &a.IsSpot) + delete(rawMsg, key) + case "isXenon": + err = unpopulate(val, &a.IsXenon) + delete(rawMsg, key) + case "kubeEnvironmentProfile": + err = unpopulate(val, &a.KubeEnvironmentProfile) + delete(rawMsg, key) + case "maximumElasticWorkerCount": + err = unpopulate(val, &a.MaximumElasticWorkerCount) + delete(rawMsg, key) + case "maximumNumberOfWorkers": + err = unpopulate(val, &a.MaximumNumberOfWorkers) + delete(rawMsg, key) + case "numberOfSites": + err = unpopulate(val, &a.NumberOfSites) + delete(rawMsg, key) + case "perSiteScaling": + err = unpopulate(val, &a.PerSiteScaling) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, &a.ProvisioningState) + delete(rawMsg, key) + case "reserved": + err = unpopulate(val, &a.Reserved) + delete(rawMsg, key) + case "resourceGroup": + err = unpopulate(val, &a.ResourceGroup) + delete(rawMsg, key) + case "spotExpirationTime": + err = unpopulateTimeRFC3339(val, &a.SpotExpirationTime) + delete(rawMsg, key) + case "status": + err = unpopulate(val, &a.Status) + delete(rawMsg, key) + case "subscription": + err = unpopulate(val, &a.Subscription) + delete(rawMsg, key) + case "targetWorkerCount": + err = unpopulate(val, &a.TargetWorkerCount) + delete(rawMsg, key) + case "targetWorkerSizeId": + err = unpopulate(val, &a.TargetWorkerSizeID) + delete(rawMsg, key) + case "workerTierName": + err = unpopulate(val, &a.WorkerTierName) + delete(rawMsg, key) + case "zoneRedundant": + err = unpopulate(val, &a.ZoneRedundant) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// AppServicePlansBeginCreateOrUpdateOptions contains the optional parameters for the AppServicePlans.BeginCreateOrUpdate method. +type AppServicePlansBeginCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// AppServicePlansCreateOrUpdateVnetRouteOptions contains the optional parameters for the AppServicePlans.CreateOrUpdateVnetRoute method. +type AppServicePlansCreateOrUpdateVnetRouteOptions struct { + // placeholder for future optional parameters +} + +// AppServicePlansDeleteHybridConnectionOptions contains the optional parameters for the AppServicePlans.DeleteHybridConnection method. +type AppServicePlansDeleteHybridConnectionOptions struct { + // placeholder for future optional parameters +} + +// AppServicePlansDeleteOptions contains the optional parameters for the AppServicePlans.Delete method. +type AppServicePlansDeleteOptions struct { + // placeholder for future optional parameters +} + +// AppServicePlansDeleteVnetRouteOptions contains the optional parameters for the AppServicePlans.DeleteVnetRoute method. +type AppServicePlansDeleteVnetRouteOptions struct { + // placeholder for future optional parameters +} + +// AppServicePlansGetHybridConnectionOptions contains the optional parameters for the AppServicePlans.GetHybridConnection method. +type AppServicePlansGetHybridConnectionOptions struct { + // placeholder for future optional parameters +} + +// AppServicePlansGetHybridConnectionPlanLimitOptions contains the optional parameters for the AppServicePlans.GetHybridConnectionPlanLimit method. +type AppServicePlansGetHybridConnectionPlanLimitOptions struct { + // placeholder for future optional parameters +} + +// AppServicePlansGetOptions contains the optional parameters for the AppServicePlans.Get method. +type AppServicePlansGetOptions struct { + // placeholder for future optional parameters +} + +// AppServicePlansGetRouteForVnetOptions contains the optional parameters for the AppServicePlans.GetRouteForVnet method. +type AppServicePlansGetRouteForVnetOptions struct { + // placeholder for future optional parameters +} + +// AppServicePlansGetServerFarmSKUsOptions contains the optional parameters for the AppServicePlans.GetServerFarmSKUs method. +type AppServicePlansGetServerFarmSKUsOptions struct { + // placeholder for future optional parameters +} + +// AppServicePlansGetVnetFromServerFarmOptions contains the optional parameters for the AppServicePlans.GetVnetFromServerFarm method. +type AppServicePlansGetVnetFromServerFarmOptions struct { + // placeholder for future optional parameters +} + +// AppServicePlansGetVnetGatewayOptions contains the optional parameters for the AppServicePlans.GetVnetGateway method. +type AppServicePlansGetVnetGatewayOptions struct { + // placeholder for future optional parameters +} + +// AppServicePlansListByResourceGroupOptions contains the optional parameters for the AppServicePlans.ListByResourceGroup method. +type AppServicePlansListByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// AppServicePlansListCapabilitiesOptions contains the optional parameters for the AppServicePlans.ListCapabilities method. +type AppServicePlansListCapabilitiesOptions struct { + // placeholder for future optional parameters +} + +// AppServicePlansListHybridConnectionKeysOptions contains the optional parameters for the AppServicePlans.ListHybridConnectionKeys method. +type AppServicePlansListHybridConnectionKeysOptions struct { + // placeholder for future optional parameters +} + +// AppServicePlansListHybridConnectionsOptions contains the optional parameters for the AppServicePlans.ListHybridConnections method. +type AppServicePlansListHybridConnectionsOptions struct { + // placeholder for future optional parameters +} + +// AppServicePlansListOptions contains the optional parameters for the AppServicePlans.List method. +type AppServicePlansListOptions struct { + // Specify true to return all App Service plan properties. The default is false, which returns a subset of the properties. + // Retrieval of all properties may increase the API latency. + Detailed *bool +} + +// AppServicePlansListRoutesForVnetOptions contains the optional parameters for the AppServicePlans.ListRoutesForVnet method. +type AppServicePlansListRoutesForVnetOptions struct { + // placeholder for future optional parameters +} + +// AppServicePlansListUsagesOptions contains the optional parameters for the AppServicePlans.ListUsages method. +type AppServicePlansListUsagesOptions struct { + // Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2'). + Filter *string +} + +// AppServicePlansListVnetsOptions contains the optional parameters for the AppServicePlans.ListVnets method. +type AppServicePlansListVnetsOptions struct { + // placeholder for future optional parameters +} + +// AppServicePlansListWebAppsByHybridConnectionOptions contains the optional parameters for the AppServicePlans.ListWebAppsByHybridConnection method. +type AppServicePlansListWebAppsByHybridConnectionOptions struct { + // placeholder for future optional parameters +} + +// AppServicePlansListWebAppsOptions contains the optional parameters for the AppServicePlans.ListWebApps method. +type AppServicePlansListWebAppsOptions struct { + // Supported filter: $filter=state eq running. Returns only web apps that are currently running + Filter *string + // Skip to a web app in the list of webapps associated with app service plan. If specified, the resulting list will contain web apps starting from (including) + // the skipToken. Otherwise, the resulting list contains web apps from the start of the list + SkipToken *string + // List page size. If specified, results are paged. + Top *string +} + +// AppServicePlansRebootWorkerOptions contains the optional parameters for the AppServicePlans.RebootWorker method. +type AppServicePlansRebootWorkerOptions struct { + // placeholder for future optional parameters +} + +// AppServicePlansRestartWebAppsOptions contains the optional parameters for the AppServicePlans.RestartWebApps method. +type AppServicePlansRestartWebAppsOptions struct { + // Specify true to perform a soft restart, applies the configuration settings and restarts the apps if necessary. The default is false, + // which always restarts and reprovisions the apps + SoftRestart *bool +} + +// AppServicePlansUpdateOptions contains the optional parameters for the AppServicePlans.Update method. +type AppServicePlansUpdateOptions struct { + // placeholder for future optional parameters +} + +// AppServicePlansUpdateVnetGatewayOptions contains the optional parameters for the AppServicePlans.UpdateVnetGateway method. +type AppServicePlansUpdateVnetGatewayOptions struct { + // placeholder for future optional parameters +} + +// AppServicePlansUpdateVnetRouteOptions contains the optional parameters for the AppServicePlans.UpdateVnetRoute method. +type AppServicePlansUpdateVnetRouteOptions struct { + // placeholder for future optional parameters +} + +// Apple - The configuration settings of the Apple provider. +type Apple struct { + // false if the Apple provider should not be enabled despite the set registration; otherwise, true. + Enabled *bool `json:"enabled,omitempty"` + + // The configuration settings of the login flow. + Login *LoginScopes `json:"login,omitempty"` + + // The configuration settings of the Apple registration. + Registration *AppleRegistration `json:"registration,omitempty"` +} + +// AppleRegistration - The configuration settings of the registration for the Apple provider +type AppleRegistration struct { + // The Client ID of the app used for login. + ClientID *string `json:"clientId,omitempty"` + + // The app setting name that contains the client secret. + ClientSecretSettingName *string `json:"clientSecretSettingName,omitempty"` +} + +// ApplicationLogsConfig - Application logs configuration. +type ApplicationLogsConfig struct { + // Application logs to blob storage configuration. + AzureBlobStorage *AzureBlobStorageApplicationLogsConfig `json:"azureBlobStorage,omitempty"` + + // Application logs to azure table storage configuration. + AzureTableStorage *AzureTableStorageApplicationLogsConfig `json:"azureTableStorage,omitempty"` + + // Application logs to file system configuration. + FileSystem *FileSystemApplicationLogsConfig `json:"fileSystem,omitempty"` +} + +// ApplicationStack - Application stack. +type ApplicationStack struct { + // Application stack dependency. + Dependency *string `json:"dependency,omitempty"` + + // Application stack display name. + Display *string `json:"display,omitempty"` + + // List of frameworks associated with application stack. + Frameworks []*ApplicationStack `json:"frameworks,omitempty"` + + // true if this is the stack is deprecated; otherwise, false. + IsDeprecated []*ApplicationStack `json:"isDeprecated,omitempty"` + + // List of major versions available. + MajorVersions []*StackMajorVersion `json:"majorVersions,omitempty"` + + // Application stack name. + Name *string `json:"name,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type ApplicationStack. +func (a ApplicationStack) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "dependency", a.Dependency) + populate(objectMap, "display", a.Display) + populate(objectMap, "frameworks", a.Frameworks) + populate(objectMap, "isDeprecated", a.IsDeprecated) + populate(objectMap, "majorVersions", a.MajorVersions) + populate(objectMap, "name", a.Name) + return json.Marshal(objectMap) +} + +// ApplicationStackCollection - Collection of Application Stacks +type ApplicationStackCollection struct { + // REQUIRED; Collection of resources. + Value []*ApplicationStackResource `json:"value,omitempty"` + + // READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type ApplicationStackCollection. +func (a ApplicationStackCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", a.NextLink) + populate(objectMap, "value", a.Value) + return json.Marshal(objectMap) +} + +// ApplicationStackResource - ARM resource for a ApplicationStack. +type ApplicationStackResource struct { + ProxyOnlyResource + // Core resource properties + Properties *ApplicationStack `json:"properties,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type ApplicationStackResource. +func (a ApplicationStackResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + a.ProxyOnlyResource.marshalInternal(objectMap) + populate(objectMap, "properties", a.Properties) + return json.Marshal(objectMap) +} + +// AppserviceGithubToken - Github access token for Appservice CLI github integration. +type AppserviceGithubToken struct { + // Github access token for Appservice CLI github integration + AccessToken *string `json:"accessToken,omitempty"` + + // Error message if unable to get token + ErrorMessage *string `json:"errorMessage,omitempty"` + + // True if valid github token received, False otherwise + GotToken *bool `json:"gotToken,omitempty"` + + // Scope of the github access token + Scope *string `json:"scope,omitempty"` + + // token type + TokenType *string `json:"tokenType,omitempty"` +} + +// AppserviceGithubTokenRequest - Appservice Github token request content. +type AppserviceGithubTokenRequest struct { + // REQUIRED; Code string to exchange for Github Access token + Code *string `json:"code,omitempty"` + + // REQUIRED; State string used for verification. + State *string `json:"state,omitempty"` +} + +type ArcConfiguration struct { + ArtifactStorageAccessMode *string `json:"artifactStorageAccessMode,omitempty"` + ArtifactStorageClassName *string `json:"artifactStorageClassName,omitempty"` + ArtifactStorageMountPath *string `json:"artifactStorageMountPath,omitempty"` + ArtifactStorageNodeName *string `json:"artifactStorageNodeName,omitempty"` + ArtifactsStorageType *StorageType `json:"artifactsStorageType,omitempty"` + FrontEndServiceConfiguration *FrontEndConfiguration `json:"frontEndServiceConfiguration,omitempty"` + KubeConfig *string `json:"kubeConfig,omitempty"` +} + +// ArmIDWrapper - A wrapper for an ARM resource id +type ArmIDWrapper struct { + // READ-ONLY + ID *string `json:"id,omitempty" azure:"ro"` +} + +// ArmPlan - The plan object in Azure Resource Manager, represents a marketplace plan. +type ArmPlan struct { + // The name. + Name *string `json:"name,omitempty"` + + // The product. + Product *string `json:"product,omitempty"` + + // The promotion code. + PromotionCode *string `json:"promotionCode,omitempty"` + + // The publisher. + Publisher *string `json:"publisher,omitempty"` + + // Version of product. + Version *string `json:"version,omitempty"` +} + +// AseV3NetworkingConfiguration - Full view of networking configuration for an ASE. +type AseV3NetworkingConfiguration struct { + ProxyOnlyResource + // AseV3NetworkingConfiguration resource specific properties + Properties *AseV3NetworkingConfigurationProperties `json:"properties,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type AseV3NetworkingConfiguration. +func (a AseV3NetworkingConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + a.ProxyOnlyResource.marshalInternal(objectMap) + populate(objectMap, "properties", a.Properties) + return json.Marshal(objectMap) +} + +// AseV3NetworkingConfigurationProperties - AseV3NetworkingConfiguration resource specific properties +type AseV3NetworkingConfigurationProperties struct { + // Property to enable and disable new private endpoint connection creation on ASE + AllowNewPrivateEndpointConnections *bool `json:"allowNewPrivateEndpointConnections,omitempty"` + + // READ-ONLY + ExternalInboundIPAddresses []*string `json:"externalInboundIpAddresses,omitempty" azure:"ro"` + + // READ-ONLY + InternalInboundIPAddresses []*string `json:"internalInboundIpAddresses,omitempty" azure:"ro"` + + // READ-ONLY + LinuxOutboundIPAddresses []*string `json:"linuxOutboundIpAddresses,omitempty" azure:"ro"` + + // READ-ONLY + WindowsOutboundIPAddresses []*string `json:"windowsOutboundIpAddresses,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type AseV3NetworkingConfigurationProperties. +func (a AseV3NetworkingConfigurationProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "allowNewPrivateEndpointConnections", a.AllowNewPrivateEndpointConnections) + populate(objectMap, "externalInboundIpAddresses", a.ExternalInboundIPAddresses) + populate(objectMap, "internalInboundIpAddresses", a.InternalInboundIPAddresses) + populate(objectMap, "linuxOutboundIpAddresses", a.LinuxOutboundIPAddresses) + populate(objectMap, "windowsOutboundIpAddresses", a.WindowsOutboundIPAddresses) + return json.Marshal(objectMap) +} + +// AuthPlatform - The configuration settings of the platform of App Service Authentication/Authorization. +type AuthPlatform struct { + // The path of the config file containing auth settings if they come from a file. If the path is relative, base will the site's root directory. + ConfigFilePath *string `json:"configFilePath,omitempty"` + + // true if the Authentication / Authorization feature is enabled for the current app; otherwise, false. + Enabled *bool `json:"enabled,omitempty"` + + // The RuntimeVersion of the Authentication / Authorization feature in use for the current app. The setting in this value can control the behavior of certain + // features in the Authentication / + // Authorization module. + RuntimeVersion *string `json:"runtimeVersion,omitempty"` +} + +// AutoHealActions - Actions which to take by the auto-heal module when a rule is triggered. +type AutoHealActions struct { + // Predefined action to be taken. + ActionType *AutoHealActionType `json:"actionType,omitempty"` + + // Custom action to be taken. + CustomAction *AutoHealCustomAction `json:"customAction,omitempty"` + + // Minimum time the process must execute before taking the action + MinProcessExecutionTime *string `json:"minProcessExecutionTime,omitempty"` +} + +// AutoHealCustomAction - Custom action to be executed when an auto heal rule is triggered. +type AutoHealCustomAction struct { + // Executable to be run. + Exe *string `json:"exe,omitempty"` + + // Parameters for the executable. + Parameters *string `json:"parameters,omitempty"` +} + +// AutoHealRules - Rules that can be defined for auto-heal. +type AutoHealRules struct { + // Actions to be executed when a rule is triggered. + Actions *AutoHealActions `json:"actions,omitempty"` + + // Conditions that describe when to execute the auto-heal actions. + Triggers *AutoHealTriggers `json:"triggers,omitempty"` +} + +// AutoHealTriggers - Triggers for auto-heal. +type AutoHealTriggers struct { + // A rule based on private bytes. + PrivateBytesInKB *int32 `json:"privateBytesInKB,omitempty"` + + // A rule based on total requests. + Requests *RequestsBasedTrigger `json:"requests,omitempty"` + + // A rule based on request execution time. + SlowRequests *SlowRequestsBasedTrigger `json:"slowRequests,omitempty"` + + // A rule based on multiple Slow Requests Rule with path + SlowRequestsWithPath []*SlowRequestsBasedTrigger `json:"slowRequestsWithPath,omitempty"` + + // A rule based on status codes. + StatusCodes []*StatusCodesBasedTrigger `json:"statusCodes,omitempty"` + + // A rule based on status codes ranges. + StatusCodesRange []*StatusCodesRangeBasedTrigger `json:"statusCodesRange,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type AutoHealTriggers. +func (a AutoHealTriggers) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "privateBytesInKB", a.PrivateBytesInKB) + populate(objectMap, "requests", a.Requests) + populate(objectMap, "slowRequests", a.SlowRequests) + populate(objectMap, "slowRequestsWithPath", a.SlowRequestsWithPath) + populate(objectMap, "statusCodes", a.StatusCodes) + populate(objectMap, "statusCodesRange", a.StatusCodesRange) + return json.Marshal(objectMap) +} + +// AzureActiveDirectory - The configuration settings of the Azure Active directory provider. +type AzureActiveDirectory struct { + // false if the Azure Active Directory provider should not be enabled despite the set registration; otherwise, true. + Enabled *bool `json:"enabled,omitempty"` + + // Gets a value indicating whether the Azure AD configuration was auto-provisioned using 1st party tooling. This is an internal flag primarily intended + // to support the Azure Management Portal. Users + // should not read or write to this property. + IsAutoProvisioned *bool `json:"isAutoProvisioned,omitempty"` + + // The configuration settings of the Azure Active Directory login flow. + Login *AzureActiveDirectoryLogin `json:"login,omitempty"` + + // The configuration settings of the Azure Active Directory app registration. + Registration *AzureActiveDirectoryRegistration `json:"registration,omitempty"` + + // The configuration settings of the Azure Active Directory token validation flow. + Validation *AzureActiveDirectoryValidation `json:"validation,omitempty"` +} + +// AzureActiveDirectoryLogin - The configuration settings of the Azure Active Directory login flow. +type AzureActiveDirectoryLogin struct { + // true if the www-authenticate provider should be omitted from the request; otherwise, false. + DisableWWWAuthenticate *bool `json:"disableWWWAuthenticate,omitempty"` + + // Login parameters to send to the OpenID Connect authorization endpoint when a user logs in. Each parameter must be in the form "key=value". + LoginParameters []*string `json:"loginParameters,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type AzureActiveDirectoryLogin. +func (a AzureActiveDirectoryLogin) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "disableWWWAuthenticate", a.DisableWWWAuthenticate) + populate(objectMap, "loginParameters", a.LoginParameters) + return json.Marshal(objectMap) +} + +// AzureActiveDirectoryRegistration - The configuration settings of the Azure Active Directory app registration. +type AzureActiveDirectoryRegistration struct { + // The Client ID of this relying party application, known as the clientid. This setting is required for enabling OpenID Connection authentication with Azure + // Active Directory or other 3rd party OpenID + // Connect providers. More information on OpenID Connect: http://openid.net/specs/openid-connect-core-10.html + ClientID *string `json:"clientId,omitempty"` + + // An alternative to the client secret thumbprint, that is the issuer of a certificate used for signing purposes. This property acts as a replacement for + // the Client Secret Certificate Thumbprint. It is + // also optional. + ClientSecretCertificateIssuer *string `json:"clientSecretCertificateIssuer,omitempty"` + + // An alternative to the client secret thumbprint, that is the subject alternative name of a certificate used for signing purposes. This property acts as + // a replacement for the Client Secret Certificate + // Thumbprint. It is also optional. + ClientSecretCertificateSubjectAlternativeName *string `json:"clientSecretCertificateSubjectAlternativeName,omitempty"` + + // An alternative to the client secret, that is the thumbprint of a certificate used for signing purposes. This property acts as a replacement for the Client + // Secret. It is also optional. + ClientSecretCertificateThumbprint *string `json:"clientSecretCertificateThumbprint,omitempty"` + + // The app setting name that contains the client secret of the relying party application. + ClientSecretSettingName *string `json:"clientSecretSettingName,omitempty"` + + // The OpenID Connect Issuer URI that represents the entity which issues access tokens for this application. When using Azure Active Directory, this value + // is the URI of the directory tenant, e.g. + // https://login.microsoftonline.com/v2.0/{tenant-guid}/. This URI is a case-sensitive identifier for the token issuer. More information on OpenID Connect + // Discovery: + // http://openid.net/specs/openid-connect-discovery-1_0.html + OpenIDIssuer *string `json:"openIdIssuer,omitempty"` +} + +// AzureActiveDirectoryValidation - The configuration settings of the Azure Active Directory token validation flow. +type AzureActiveDirectoryValidation struct { + // The list of audiences that can make successful authentication/authorization requests. + AllowedAudiences []*string `json:"allowedAudiences,omitempty"` + + // The configuration settings of the default authorization policy. + DefaultAuthorizationPolicy *DefaultAuthorizationPolicy `json:"defaultAuthorizationPolicy,omitempty"` + + // The configuration settings of the checks that should be made while validating the JWT Claims. + JwtClaimChecks *JwtClaimChecks `json:"jwtClaimChecks,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type AzureActiveDirectoryValidation. +func (a AzureActiveDirectoryValidation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "allowedAudiences", a.AllowedAudiences) + populate(objectMap, "defaultAuthorizationPolicy", a.DefaultAuthorizationPolicy) + populate(objectMap, "jwtClaimChecks", a.JwtClaimChecks) + return json.Marshal(objectMap) +} + +// AzureBlobStorageApplicationLogsConfig - Application logs azure blob storage configuration. +type AzureBlobStorageApplicationLogsConfig struct { + // Log level. + Level *LogLevel `json:"level,omitempty"` + + // Retention in days. Remove blobs older than X days. 0 or lower means no retention. + RetentionInDays *int32 `json:"retentionInDays,omitempty"` + + // SAS url to a azure blob container with read/write/list/delete permissions. + SasURL *string `json:"sasUrl,omitempty"` +} + +// AzureBlobStorageHTTPLogsConfig - Http logs to azure blob storage configuration. +type AzureBlobStorageHTTPLogsConfig struct { + // True if configuration is enabled, false if it is disabled and null if configuration is not set. + Enabled *bool `json:"enabled,omitempty"` + + // Retention in days. Remove blobs older than X days. 0 or lower means no retention. + RetentionInDays *int32 `json:"retentionInDays,omitempty"` + + // SAS url to a azure blob container with read/write/list/delete permissions. + SasURL *string `json:"sasUrl,omitempty"` +} + +// AzureStaticWebApps - The configuration settings of the Azure Static Web Apps provider. +type AzureStaticWebApps struct { + // false if the Azure Static Web Apps provider should not be enabled despite the set registration; otherwise, true. + Enabled *bool `json:"enabled,omitempty"` + + // The configuration settings of the Azure Static Web Apps registration. + Registration *AzureStaticWebAppsRegistration `json:"registration,omitempty"` +} + +// AzureStaticWebAppsRegistration - The configuration settings of the registration for the Azure Static Web Apps provider +type AzureStaticWebAppsRegistration struct { + // The Client ID of the app used for login. + ClientID *string `json:"clientId,omitempty"` +} + +// AzureStorageInfoValue - Azure Files or Blob Storage access information value for dictionary storage. +type AzureStorageInfoValue struct { + // Access key for the storage account. + AccessKey *string `json:"accessKey,omitempty"` + + // Name of the storage account. + AccountName *string `json:"accountName,omitempty"` + + // Path to mount the storage within the site's runtime environment. + MountPath *string `json:"mountPath,omitempty"` + + // Name of the file share (container name, for Blob storage). + ShareName *string `json:"shareName,omitempty"` + + // Type of storage. + Type *AzureStorageType `json:"type,omitempty"` + + // READ-ONLY; State of the storage account. + State *AzureStorageState `json:"state,omitempty" azure:"ro"` +} + +// AzureStoragePropertyDictionaryResource - AzureStorageInfo dictionary resource. +type AzureStoragePropertyDictionaryResource struct { + ProxyOnlyResource + // Azure storage accounts. + Properties map[string]*AzureStorageInfoValue `json:"properties,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type AzureStoragePropertyDictionaryResource. +func (a AzureStoragePropertyDictionaryResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + a.ProxyOnlyResource.marshalInternal(objectMap) + populate(objectMap, "properties", a.Properties) + return json.Marshal(objectMap) +} + +// AzureTableStorageApplicationLogsConfig - Application logs to Azure table storage configuration. +type AzureTableStorageApplicationLogsConfig struct { + // REQUIRED; SAS URL to an Azure table with add/query/delete permissions. + SasURL *string `json:"sasUrl,omitempty"` + + // Log level. + Level *LogLevel `json:"level,omitempty"` +} + +// BackupItem - Backup description. +type BackupItem struct { + ProxyOnlyResource + // BackupItem resource specific properties + Properties *BackupItemProperties `json:"properties,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type BackupItem. +func (b BackupItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + b.ProxyOnlyResource.marshalInternal(objectMap) + populate(objectMap, "properties", b.Properties) + return json.Marshal(objectMap) +} + +// BackupItemCollection - Collection of backup items. +type BackupItemCollection struct { + // REQUIRED; Collection of resources. + Value []*BackupItem `json:"value,omitempty"` + + // READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type BackupItemCollection. +func (b BackupItemCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", b.NextLink) + populate(objectMap, "value", b.Value) + return json.Marshal(objectMap) +} + +// BackupItemProperties - BackupItem resource specific properties +type BackupItemProperties struct { + // READ-ONLY; Id of the backup. + BackupID *int32 `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; Name of the blob which contains data for this backup. + BlobName *string `json:"blobName,omitempty" azure:"ro"` + + // READ-ONLY; Unique correlation identifier. Please use this along with the timestamp while communicating with Azure support. + CorrelationID *string `json:"correlationId,omitempty" azure:"ro"` + + // READ-ONLY; Timestamp of the backup creation. + Created *time.Time `json:"created,omitempty" azure:"ro"` + + // READ-ONLY; List of databases included in the backup. + Databases []*DatabaseBackupSetting `json:"databases,omitempty" azure:"ro"` + + // READ-ONLY; Timestamp when this backup finished. + FinishedTimeStamp *time.Time `json:"finishedTimeStamp,omitempty" azure:"ro"` + + // READ-ONLY; Timestamp of a last restore operation which used this backup. + LastRestoreTimeStamp *time.Time `json:"lastRestoreTimeStamp,omitempty" azure:"ro"` + + // READ-ONLY; Details regarding this backup. Might contain an error message. + Log *string `json:"log,omitempty" azure:"ro"` + + // READ-ONLY; Name of this backup. + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; True if this backup has been created due to a schedule being triggered. + Scheduled *bool `json:"scheduled,omitempty" azure:"ro"` + + // READ-ONLY; Size of the backup in bytes. + SizeInBytes *int64 `json:"sizeInBytes,omitempty" azure:"ro"` + + // READ-ONLY; Backup status. + Status *BackupItemStatus `json:"status,omitempty" azure:"ro"` + + // READ-ONLY; SAS URL for the storage account container which contains this backup. + StorageAccountURL *string `json:"storageAccountUrl,omitempty" azure:"ro"` + + // READ-ONLY; Size of the original web app which has been backed up. + WebsiteSizeInBytes *int64 `json:"websiteSizeInBytes,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type BackupItemProperties. +func (b BackupItemProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", b.BackupID) + populate(objectMap, "blobName", b.BlobName) + populate(objectMap, "correlationId", b.CorrelationID) + populateTimeRFC3339(objectMap, "created", b.Created) + populate(objectMap, "databases", b.Databases) + populateTimeRFC3339(objectMap, "finishedTimeStamp", b.FinishedTimeStamp) + populateTimeRFC3339(objectMap, "lastRestoreTimeStamp", b.LastRestoreTimeStamp) + populate(objectMap, "log", b.Log) + populate(objectMap, "name", b.Name) + populate(objectMap, "scheduled", b.Scheduled) + populate(objectMap, "sizeInBytes", b.SizeInBytes) + populate(objectMap, "status", b.Status) + populate(objectMap, "storageAccountUrl", b.StorageAccountURL) + populate(objectMap, "websiteSizeInBytes", b.WebsiteSizeInBytes) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BackupItemProperties. +func (b *BackupItemProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, &b.BackupID) + delete(rawMsg, key) + case "blobName": + err = unpopulate(val, &b.BlobName) + delete(rawMsg, key) + case "correlationId": + err = unpopulate(val, &b.CorrelationID) + delete(rawMsg, key) + case "created": + err = unpopulateTimeRFC3339(val, &b.Created) + delete(rawMsg, key) + case "databases": + err = unpopulate(val, &b.Databases) + delete(rawMsg, key) + case "finishedTimeStamp": + err = unpopulateTimeRFC3339(val, &b.FinishedTimeStamp) + delete(rawMsg, key) + case "lastRestoreTimeStamp": + err = unpopulateTimeRFC3339(val, &b.LastRestoreTimeStamp) + delete(rawMsg, key) + case "log": + err = unpopulate(val, &b.Log) + delete(rawMsg, key) + case "name": + err = unpopulate(val, &b.Name) + delete(rawMsg, key) + case "scheduled": + err = unpopulate(val, &b.Scheduled) + delete(rawMsg, key) + case "sizeInBytes": + err = unpopulate(val, &b.SizeInBytes) + delete(rawMsg, key) + case "status": + err = unpopulate(val, &b.Status) + delete(rawMsg, key) + case "storageAccountUrl": + err = unpopulate(val, &b.StorageAccountURL) + delete(rawMsg, key) + case "websiteSizeInBytes": + err = unpopulate(val, &b.WebsiteSizeInBytes) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// BackupRequest - Description of a backup which will be performed. +type BackupRequest struct { + ProxyOnlyResource + // BackupRequest resource specific properties + Properties *BackupRequestProperties `json:"properties,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type BackupRequest. +func (b BackupRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + b.ProxyOnlyResource.marshalInternal(objectMap) + populate(objectMap, "properties", b.Properties) + return json.Marshal(objectMap) +} + +// BackupRequestProperties - BackupRequest resource specific properties +type BackupRequestProperties struct { + // REQUIRED; SAS URL to the container. + StorageAccountURL *string `json:"storageAccountUrl,omitempty"` + + // Name of the backup. + BackupName *string `json:"backupName,omitempty"` + + // Schedule for the backup if it is executed periodically. + BackupSchedule *BackupSchedule `json:"backupSchedule,omitempty"` + + // Databases included in the backup. + Databases []*DatabaseBackupSetting `json:"databases,omitempty"` + + // True if the backup schedule is enabled (must be included in that case), false if the backup schedule should be disabled. + Enabled *bool `json:"enabled,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type BackupRequestProperties. +func (b BackupRequestProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "backupName", b.BackupName) + populate(objectMap, "backupSchedule", b.BackupSchedule) + populate(objectMap, "databases", b.Databases) + populate(objectMap, "enabled", b.Enabled) + populate(objectMap, "storageAccountUrl", b.StorageAccountURL) + return json.Marshal(objectMap) +} + +// BackupSchedule - Description of a backup schedule. Describes how often should be the backup performed and what should be the retention policy. +type BackupSchedule struct { + // REQUIRED; How often the backup should be executed (e.g. for weekly backup, this should be set to 7 and FrequencyUnit should be set to Day) + FrequencyInterval *int32 `json:"frequencyInterval,omitempty"` + + // REQUIRED; The unit of time for how often the backup should be executed (e.g. for weekly backup, this should be set to Day and FrequencyInterval should + // be set to 7) + FrequencyUnit *FrequencyUnit `json:"frequencyUnit,omitempty"` + + // REQUIRED; True if the retention policy should always keep at least one backup in the storage account, regardless how old it is; false otherwise. + KeepAtLeastOneBackup *bool `json:"keepAtLeastOneBackup,omitempty"` + + // REQUIRED; After how many days backups should be deleted. + RetentionPeriodInDays *int32 `json:"retentionPeriodInDays,omitempty"` + + // When the schedule should start working. + StartTime *time.Time `json:"startTime,omitempty"` + + // READ-ONLY; Last time when this schedule was triggered. + LastExecutionTime *time.Time `json:"lastExecutionTime,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type BackupSchedule. +func (b BackupSchedule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "frequencyInterval", b.FrequencyInterval) + populate(objectMap, "frequencyUnit", b.FrequencyUnit) + populate(objectMap, "keepAtLeastOneBackup", b.KeepAtLeastOneBackup) + populateTimeRFC3339(objectMap, "lastExecutionTime", b.LastExecutionTime) + populate(objectMap, "retentionPeriodInDays", b.RetentionPeriodInDays) + populateTimeRFC3339(objectMap, "startTime", b.StartTime) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BackupSchedule. +func (b *BackupSchedule) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "frequencyInterval": + err = unpopulate(val, &b.FrequencyInterval) + delete(rawMsg, key) + case "frequencyUnit": + err = unpopulate(val, &b.FrequencyUnit) + delete(rawMsg, key) + case "keepAtLeastOneBackup": + err = unpopulate(val, &b.KeepAtLeastOneBackup) + delete(rawMsg, key) + case "lastExecutionTime": + err = unpopulateTimeRFC3339(val, &b.LastExecutionTime) + delete(rawMsg, key) + case "retentionPeriodInDays": + err = unpopulate(val, &b.RetentionPeriodInDays) + delete(rawMsg, key) + case "startTime": + err = unpopulateTimeRFC3339(val, &b.StartTime) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// BillingMeter - App Service billing entity that contains information about meter which the Azure billing system utilizes to charge users for services. +type BillingMeter struct { + ProxyOnlyResource + // BillingMeter resource specific properties + Properties *BillingMeterProperties `json:"properties,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type BillingMeter. +func (b BillingMeter) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + b.ProxyOnlyResource.marshalInternal(objectMap) + populate(objectMap, "properties", b.Properties) + return json.Marshal(objectMap) +} + +// BillingMeterCollection - Collection of Billing Meters +type BillingMeterCollection struct { + // REQUIRED; Collection of resources. + Value []*BillingMeter `json:"value,omitempty"` + + // READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type BillingMeterCollection. +func (b BillingMeterCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", b.NextLink) + populate(objectMap, "value", b.Value) + return json.Marshal(objectMap) +} + +// BillingMeterProperties - BillingMeter resource specific properties +type BillingMeterProperties struct { + // Azure Location of billable resource + BillingLocation *string `json:"billingLocation,omitempty"` + + // Friendly name of the meter + FriendlyName *string `json:"friendlyName,omitempty"` + + // Meter GUID onboarded in Commerce + MeterID *string `json:"meterId,omitempty"` + + // Meter Multiplier + Multiplier *float64 `json:"multiplier,omitempty"` + + // App Service OS type meter used for + OSType *string `json:"osType,omitempty"` + + // App Service ResourceType meter used for + ResourceType *string `json:"resourceType,omitempty"` + + // Short Name from App Service Azure pricing Page + ShortName *string `json:"shortName,omitempty"` +} + +// BlobStorageTokenStore - The configuration settings of the storage of the tokens if blob storage is used. +type BlobStorageTokenStore struct { + // The name of the app setting containing the SAS URL of the blob storage containing the tokens. + SasURLSettingName *string `json:"sasUrlSettingName,omitempty"` +} + +// Capability - Describes the capabilities/features allowed for a specific SKU. +type Capability struct { + // Name of the SKU capability. + Name *string `json:"name,omitempty"` + + // Reason of the SKU capability. + Reason *string `json:"reason,omitempty"` + + // Value of the SKU capability. + Value *string `json:"value,omitempty"` +} + +// Certificate - SSL certificate for an app. +type Certificate struct { + Resource + // Certificate resource specific properties + Properties *CertificateProperties `json:"properties,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type Certificate. +func (c Certificate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + c.Resource.marshalInternal(objectMap) + populate(objectMap, "properties", c.Properties) + return json.Marshal(objectMap) +} + +// CertificateCollection - Collection of certificates. +type CertificateCollection struct { + // REQUIRED; Collection of resources. + Value []*Certificate `json:"value,omitempty"` + + // READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type CertificateCollection. +func (c CertificateCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", c.NextLink) + populate(objectMap, "value", c.Value) + return json.Marshal(objectMap) +} + +// CertificateDetails - SSL certificate details. +type CertificateDetails struct { + // READ-ONLY; Certificate Issuer. + Issuer *string `json:"issuer,omitempty" azure:"ro"` + + // READ-ONLY; Date Certificate is valid to. + NotAfter *time.Time `json:"notAfter,omitempty" azure:"ro"` + + // READ-ONLY; Date Certificate is valid from. + NotBefore *time.Time `json:"notBefore,omitempty" azure:"ro"` + + // READ-ONLY; Raw certificate data. + RawData *string `json:"rawData,omitempty" azure:"ro"` + + // READ-ONLY; Certificate Serial Number. + SerialNumber *string `json:"serialNumber,omitempty" azure:"ro"` + + // READ-ONLY; Certificate Signature algorithm. + SignatureAlgorithm *string `json:"signatureAlgorithm,omitempty" azure:"ro"` + + // READ-ONLY; Certificate Subject. + Subject *string `json:"subject,omitempty" azure:"ro"` + + // READ-ONLY; Certificate Thumbprint. + Thumbprint *string `json:"thumbprint,omitempty" azure:"ro"` + + // READ-ONLY; Certificate Version. + Version *int32 `json:"version,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type CertificateDetails. +func (c CertificateDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "issuer", c.Issuer) + populateTimeRFC3339(objectMap, "notAfter", c.NotAfter) + populateTimeRFC3339(objectMap, "notBefore", c.NotBefore) + populate(objectMap, "rawData", c.RawData) + populate(objectMap, "serialNumber", c.SerialNumber) + populate(objectMap, "signatureAlgorithm", c.SignatureAlgorithm) + populate(objectMap, "subject", c.Subject) + populate(objectMap, "thumbprint", c.Thumbprint) + populate(objectMap, "version", c.Version) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CertificateDetails. +func (c *CertificateDetails) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "issuer": + err = unpopulate(val, &c.Issuer) + delete(rawMsg, key) + case "notAfter": + err = unpopulateTimeRFC3339(val, &c.NotAfter) + delete(rawMsg, key) + case "notBefore": + err = unpopulateTimeRFC3339(val, &c.NotBefore) + delete(rawMsg, key) + case "rawData": + err = unpopulate(val, &c.RawData) + delete(rawMsg, key) + case "serialNumber": + err = unpopulate(val, &c.SerialNumber) + delete(rawMsg, key) + case "signatureAlgorithm": + err = unpopulate(val, &c.SignatureAlgorithm) + delete(rawMsg, key) + case "subject": + err = unpopulate(val, &c.Subject) + delete(rawMsg, key) + case "thumbprint": + err = unpopulate(val, &c.Thumbprint) + delete(rawMsg, key) + case "version": + err = unpopulate(val, &c.Version) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// CertificateEmail - SSL certificate email. +type CertificateEmail struct { + ProxyOnlyResource + // CertificateEmail resource specific properties + Properties *CertificateEmailProperties `json:"properties,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type CertificateEmail. +func (c CertificateEmail) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + c.ProxyOnlyResource.marshalInternal(objectMap) + populate(objectMap, "properties", c.Properties) + return json.Marshal(objectMap) +} + +// CertificateEmailProperties - CertificateEmail resource specific properties +type CertificateEmailProperties struct { + // Email id. + EmailID *string `json:"emailId,omitempty"` + + // Time stamp. + TimeStamp *time.Time `json:"timeStamp,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type CertificateEmailProperties. +func (c CertificateEmailProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "emailId", c.EmailID) + populateTimeRFC3339(objectMap, "timeStamp", c.TimeStamp) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CertificateEmailProperties. +func (c *CertificateEmailProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "emailId": + err = unpopulate(val, &c.EmailID) + delete(rawMsg, key) + case "timeStamp": + err = unpopulateTimeRFC3339(val, &c.TimeStamp) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// CertificateOrderAction - Certificate order action. +type CertificateOrderAction struct { + ProxyOnlyResource + // CertificateOrderAction resource specific properties + Properties *CertificateOrderActionProperties `json:"properties,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type CertificateOrderAction. +func (c CertificateOrderAction) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + c.ProxyOnlyResource.marshalInternal(objectMap) + populate(objectMap, "properties", c.Properties) + return json.Marshal(objectMap) +} + +// CertificateOrderActionProperties - CertificateOrderAction resource specific properties +type CertificateOrderActionProperties struct { + // READ-ONLY; Action type. + ActionType *CertificateOrderActionType `json:"actionType,omitempty" azure:"ro"` + + // READ-ONLY; Time at which the certificate action was performed. + CreatedAt *time.Time `json:"createdAt,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type CertificateOrderActionProperties. +func (c CertificateOrderActionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "actionType", c.ActionType) + populateTimeRFC3339(objectMap, "createdAt", c.CreatedAt) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CertificateOrderActionProperties. +func (c *CertificateOrderActionProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "actionType": + err = unpopulate(val, &c.ActionType) + delete(rawMsg, key) + case "createdAt": + err = unpopulateTimeRFC3339(val, &c.CreatedAt) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +type CertificateOrderContact struct { + Email *string `json:"email,omitempty"` + NameFirst *string `json:"nameFirst,omitempty"` + NameLast *string `json:"nameLast,omitempty"` + Phone *string `json:"phone,omitempty"` +} + +// CertificateOrdersDiagnosticsGetAppServiceCertificateOrderDetectorResponseOptions contains the optional parameters for the CertificateOrdersDiagnostics.GetAppServiceCertificateOrderDetectorResponse +// method. +type CertificateOrdersDiagnosticsGetAppServiceCertificateOrderDetectorResponseOptions struct { + // The end time for the detector response. + EndTime *time.Time + // The start time for detector response. + StartTime *time.Time + // The time grain for the detector response. + TimeGrain *string +} + +// CertificateOrdersDiagnosticsListAppServiceCertificateOrderDetectorResponseOptions contains the optional parameters for the CertificateOrdersDiagnostics.ListAppServiceCertificateOrderDetectorResponse +// method. +type CertificateOrdersDiagnosticsListAppServiceCertificateOrderDetectorResponseOptions struct { + // placeholder for future optional parameters +} + +// CertificatePatchResource - ARM resource for a certificate. +type CertificatePatchResource struct { + ProxyOnlyResource + // CertificatePatchResource resource specific properties + Properties *CertificatePatchResourceProperties `json:"properties,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type CertificatePatchResource. +func (c CertificatePatchResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + c.ProxyOnlyResource.marshalInternal(objectMap) + populate(objectMap, "properties", c.Properties) + return json.Marshal(objectMap) +} + +// CertificatePatchResourceProperties - CertificatePatchResource resource specific properties +type CertificatePatchResourceProperties struct { + // CNAME of the certificate to be issued via free certificate + CanonicalName *string `json:"canonicalName,omitempty"` + + // Method of domain validation for free cert + DomainValidationMethod *string `json:"domainValidationMethod,omitempty"` + + // Host names the certificate applies to. + HostNames []*string `json:"hostNames,omitempty"` + + // Key Vault Csm resource Id. + KeyVaultID *string `json:"keyVaultId,omitempty"` + + // Key Vault secret name. + KeyVaultSecretName *string `json:"keyVaultSecretName,omitempty"` + + // Certificate password. + Password *string `json:"password,omitempty"` + + // Pfx blob. + PfxBlob []byte `json:"pfxBlob,omitempty"` + + // Resource ID of the associated App Service plan, formatted as: "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". + ServerFarmID *string `json:"serverFarmId,omitempty"` + + // READ-ONLY; Raw bytes of .cer file + CerBlob []byte `json:"cerBlob,omitempty" azure:"ro"` + + // READ-ONLY; Certificate expiration date. + ExpirationDate *time.Time `json:"expirationDate,omitempty" azure:"ro"` + + // READ-ONLY; Friendly name of the certificate. + FriendlyName *string `json:"friendlyName,omitempty" azure:"ro"` + + // READ-ONLY; Specification for the App Service Environment to use for the certificate. + HostingEnvironmentProfile *HostingEnvironmentProfile `json:"hostingEnvironmentProfile,omitempty" azure:"ro"` + + // READ-ONLY; Certificate issue Date. + IssueDate *time.Time `json:"issueDate,omitempty" azure:"ro"` + + // READ-ONLY; Certificate issuer. + Issuer *string `json:"issuer,omitempty" azure:"ro"` + + // READ-ONLY; Status of the Key Vault secret. + KeyVaultSecretStatus *KeyVaultSecretStatus `json:"keyVaultSecretStatus,omitempty" azure:"ro"` + + // READ-ONLY; Public key hash. + PublicKeyHash *string `json:"publicKeyHash,omitempty" azure:"ro"` + + // READ-ONLY; Self link. + SelfLink *string `json:"selfLink,omitempty" azure:"ro"` + + // READ-ONLY; App name. + SiteName *string `json:"siteName,omitempty" azure:"ro"` + + // READ-ONLY; Subject name of the certificate. + SubjectName *string `json:"subjectName,omitempty" azure:"ro"` + + // READ-ONLY; Certificate thumbprint. + Thumbprint *string `json:"thumbprint,omitempty" azure:"ro"` + + // READ-ONLY; Is the certificate valid?. + Valid *bool `json:"valid,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type CertificatePatchResourceProperties. +func (c CertificatePatchResourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "canonicalName", c.CanonicalName) + populateByteArray(objectMap, "cerBlob", c.CerBlob, runtime.Base64StdFormat) + populate(objectMap, "domainValidationMethod", c.DomainValidationMethod) + populateTimeRFC3339(objectMap, "expirationDate", c.ExpirationDate) + populate(objectMap, "friendlyName", c.FriendlyName) + populate(objectMap, "hostNames", c.HostNames) + populate(objectMap, "hostingEnvironmentProfile", c.HostingEnvironmentProfile) + populateTimeRFC3339(objectMap, "issueDate", c.IssueDate) + populate(objectMap, "issuer", c.Issuer) + populate(objectMap, "keyVaultId", c.KeyVaultID) + populate(objectMap, "keyVaultSecretName", c.KeyVaultSecretName) + populate(objectMap, "keyVaultSecretStatus", c.KeyVaultSecretStatus) + populate(objectMap, "password", c.Password) + populateByteArray(objectMap, "pfxBlob", c.PfxBlob, runtime.Base64StdFormat) + populate(objectMap, "publicKeyHash", c.PublicKeyHash) + populate(objectMap, "selfLink", c.SelfLink) + populate(objectMap, "serverFarmId", c.ServerFarmID) + populate(objectMap, "siteName", c.SiteName) + populate(objectMap, "subjectName", c.SubjectName) + populate(objectMap, "thumbprint", c.Thumbprint) + populate(objectMap, "valid", c.Valid) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CertificatePatchResourceProperties. +func (c *CertificatePatchResourceProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "canonicalName": + err = unpopulate(val, &c.CanonicalName) + delete(rawMsg, key) + case "cerBlob": + err = runtime.DecodeByteArray(string(val), &c.CerBlob, runtime.Base64StdFormat) + delete(rawMsg, key) + case "domainValidationMethod": + err = unpopulate(val, &c.DomainValidationMethod) + delete(rawMsg, key) + case "expirationDate": + err = unpopulateTimeRFC3339(val, &c.ExpirationDate) + delete(rawMsg, key) + case "friendlyName": + err = unpopulate(val, &c.FriendlyName) + delete(rawMsg, key) + case "hostNames": + err = unpopulate(val, &c.HostNames) + delete(rawMsg, key) + case "hostingEnvironmentProfile": + err = unpopulate(val, &c.HostingEnvironmentProfile) + delete(rawMsg, key) + case "issueDate": + err = unpopulateTimeRFC3339(val, &c.IssueDate) + delete(rawMsg, key) + case "issuer": + err = unpopulate(val, &c.Issuer) + delete(rawMsg, key) + case "keyVaultId": + err = unpopulate(val, &c.KeyVaultID) + delete(rawMsg, key) + case "keyVaultSecretName": + err = unpopulate(val, &c.KeyVaultSecretName) + delete(rawMsg, key) + case "keyVaultSecretStatus": + err = unpopulate(val, &c.KeyVaultSecretStatus) + delete(rawMsg, key) + case "password": + err = unpopulate(val, &c.Password) + delete(rawMsg, key) + case "pfxBlob": + err = runtime.DecodeByteArray(string(val), &c.PfxBlob, runtime.Base64StdFormat) + delete(rawMsg, key) + case "publicKeyHash": + err = unpopulate(val, &c.PublicKeyHash) + delete(rawMsg, key) + case "selfLink": + err = unpopulate(val, &c.SelfLink) + delete(rawMsg, key) + case "serverFarmId": + err = unpopulate(val, &c.ServerFarmID) + delete(rawMsg, key) + case "siteName": + err = unpopulate(val, &c.SiteName) + delete(rawMsg, key) + case "subjectName": + err = unpopulate(val, &c.SubjectName) + delete(rawMsg, key) + case "thumbprint": + err = unpopulate(val, &c.Thumbprint) + delete(rawMsg, key) + case "valid": + err = unpopulate(val, &c.Valid) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// CertificateProperties - Certificate resource specific properties +type CertificateProperties struct { + // CNAME of the certificate to be issued via free certificate + CanonicalName *string `json:"canonicalName,omitempty"` + + // Method of domain validation for free cert + DomainValidationMethod *string `json:"domainValidationMethod,omitempty"` + + // Host names the certificate applies to. + HostNames []*string `json:"hostNames,omitempty"` + + // Key Vault Csm resource Id. + KeyVaultID *string `json:"keyVaultId,omitempty"` + + // Key Vault secret name. + KeyVaultSecretName *string `json:"keyVaultSecretName,omitempty"` + + // Certificate password. + Password *string `json:"password,omitempty"` + + // Pfx blob. + PfxBlob []byte `json:"pfxBlob,omitempty"` + + // Resource ID of the associated App Service plan, formatted as: "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". + ServerFarmID *string `json:"serverFarmId,omitempty"` + + // READ-ONLY; Raw bytes of .cer file + CerBlob []byte `json:"cerBlob,omitempty" azure:"ro"` + + // READ-ONLY; Certificate expiration date. + ExpirationDate *time.Time `json:"expirationDate,omitempty" azure:"ro"` + + // READ-ONLY; Friendly name of the certificate. + FriendlyName *string `json:"friendlyName,omitempty" azure:"ro"` + + // READ-ONLY; Specification for the App Service Environment to use for the certificate. + HostingEnvironmentProfile *HostingEnvironmentProfile `json:"hostingEnvironmentProfile,omitempty" azure:"ro"` + + // READ-ONLY; Certificate issue Date. + IssueDate *time.Time `json:"issueDate,omitempty" azure:"ro"` + + // READ-ONLY; Certificate issuer. + Issuer *string `json:"issuer,omitempty" azure:"ro"` + + // READ-ONLY; Status of the Key Vault secret. + KeyVaultSecretStatus *KeyVaultSecretStatus `json:"keyVaultSecretStatus,omitempty" azure:"ro"` + + // READ-ONLY; Public key hash. + PublicKeyHash *string `json:"publicKeyHash,omitempty" azure:"ro"` + + // READ-ONLY; Self link. + SelfLink *string `json:"selfLink,omitempty" azure:"ro"` + + // READ-ONLY; App name. + SiteName *string `json:"siteName,omitempty" azure:"ro"` + + // READ-ONLY; Subject name of the certificate. + SubjectName *string `json:"subjectName,omitempty" azure:"ro"` + + // READ-ONLY; Certificate thumbprint. + Thumbprint *string `json:"thumbprint,omitempty" azure:"ro"` + + // READ-ONLY; Is the certificate valid?. + Valid *bool `json:"valid,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type CertificateProperties. +func (c CertificateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "canonicalName", c.CanonicalName) + populateByteArray(objectMap, "cerBlob", c.CerBlob, runtime.Base64StdFormat) + populate(objectMap, "domainValidationMethod", c.DomainValidationMethod) + populateTimeRFC3339(objectMap, "expirationDate", c.ExpirationDate) + populate(objectMap, "friendlyName", c.FriendlyName) + populate(objectMap, "hostNames", c.HostNames) + populate(objectMap, "hostingEnvironmentProfile", c.HostingEnvironmentProfile) + populateTimeRFC3339(objectMap, "issueDate", c.IssueDate) + populate(objectMap, "issuer", c.Issuer) + populate(objectMap, "keyVaultId", c.KeyVaultID) + populate(objectMap, "keyVaultSecretName", c.KeyVaultSecretName) + populate(objectMap, "keyVaultSecretStatus", c.KeyVaultSecretStatus) + populate(objectMap, "password", c.Password) + populateByteArray(objectMap, "pfxBlob", c.PfxBlob, runtime.Base64StdFormat) + populate(objectMap, "publicKeyHash", c.PublicKeyHash) + populate(objectMap, "selfLink", c.SelfLink) + populate(objectMap, "serverFarmId", c.ServerFarmID) + populate(objectMap, "siteName", c.SiteName) + populate(objectMap, "subjectName", c.SubjectName) + populate(objectMap, "thumbprint", c.Thumbprint) + populate(objectMap, "valid", c.Valid) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CertificateProperties. +func (c *CertificateProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "canonicalName": + err = unpopulate(val, &c.CanonicalName) + delete(rawMsg, key) + case "cerBlob": + err = runtime.DecodeByteArray(string(val), &c.CerBlob, runtime.Base64StdFormat) + delete(rawMsg, key) + case "domainValidationMethod": + err = unpopulate(val, &c.DomainValidationMethod) + delete(rawMsg, key) + case "expirationDate": + err = unpopulateTimeRFC3339(val, &c.ExpirationDate) + delete(rawMsg, key) + case "friendlyName": + err = unpopulate(val, &c.FriendlyName) + delete(rawMsg, key) + case "hostNames": + err = unpopulate(val, &c.HostNames) + delete(rawMsg, key) + case "hostingEnvironmentProfile": + err = unpopulate(val, &c.HostingEnvironmentProfile) + delete(rawMsg, key) + case "issueDate": + err = unpopulateTimeRFC3339(val, &c.IssueDate) + delete(rawMsg, key) + case "issuer": + err = unpopulate(val, &c.Issuer) + delete(rawMsg, key) + case "keyVaultId": + err = unpopulate(val, &c.KeyVaultID) + delete(rawMsg, key) + case "keyVaultSecretName": + err = unpopulate(val, &c.KeyVaultSecretName) + delete(rawMsg, key) + case "keyVaultSecretStatus": + err = unpopulate(val, &c.KeyVaultSecretStatus) + delete(rawMsg, key) + case "password": + err = unpopulate(val, &c.Password) + delete(rawMsg, key) + case "pfxBlob": + err = runtime.DecodeByteArray(string(val), &c.PfxBlob, runtime.Base64StdFormat) + delete(rawMsg, key) + case "publicKeyHash": + err = unpopulate(val, &c.PublicKeyHash) + delete(rawMsg, key) + case "selfLink": + err = unpopulate(val, &c.SelfLink) + delete(rawMsg, key) + case "serverFarmId": + err = unpopulate(val, &c.ServerFarmID) + delete(rawMsg, key) + case "siteName": + err = unpopulate(val, &c.SiteName) + delete(rawMsg, key) + case "subjectName": + err = unpopulate(val, &c.SubjectName) + delete(rawMsg, key) + case "thumbprint": + err = unpopulate(val, &c.Thumbprint) + delete(rawMsg, key) + case "valid": + err = unpopulate(val, &c.Valid) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// CertificateRegistrationProviderListOperationsOptions contains the optional parameters for the CertificateRegistrationProvider.ListOperations method. +type CertificateRegistrationProviderListOperationsOptions struct { + // placeholder for future optional parameters +} + +// CertificatesCreateOrUpdateOptions contains the optional parameters for the Certificates.CreateOrUpdate method. +type CertificatesCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// CertificatesDeleteOptions contains the optional parameters for the Certificates.Delete method. +type CertificatesDeleteOptions struct { + // placeholder for future optional parameters +} + +// CertificatesGetOptions contains the optional parameters for the Certificates.Get method. +type CertificatesGetOptions struct { + // placeholder for future optional parameters +} + +// CertificatesListByResourceGroupOptions contains the optional parameters for the Certificates.ListByResourceGroup method. +type CertificatesListByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// CertificatesListOptions contains the optional parameters for the Certificates.List method. +type CertificatesListOptions struct { + // Return only information specified in the filter (using OData syntax). For example: $filter=KeyVaultId eq 'KeyVaultId' + Filter *string +} + +// CertificatesUpdateOptions contains the optional parameters for the Certificates.Update method. +type CertificatesUpdateOptions struct { + // placeholder for future optional parameters +} + +// ClientRegistration - The configuration settings of the app registration for providers that have client ids and client secrets +type ClientRegistration struct { + // The Client ID of the app used for login. + ClientID *string `json:"clientId,omitempty"` + + // The app setting name that contains the client secret. + ClientSecretSettingName *string `json:"clientSecretSettingName,omitempty"` +} + +// CloningInfo - Information needed for cloning operation. +type CloningInfo struct { + // REQUIRED; ARM resource ID of the source app. App resource ID is of the form /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName} + // for production slots and + // /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slotName} for other slots. + SourceWebAppID *string `json:"sourceWebAppId,omitempty"` + + // Application setting overrides for cloned app. If specified, these settings override the settings cloned from source app. Otherwise, application settings + // from source app are retained. + AppSettingsOverrides map[string]*string `json:"appSettingsOverrides,omitempty"` + + // true to clone custom hostnames from source app; otherwise, false. + CloneCustomHostNames *bool `json:"cloneCustomHostNames,omitempty"` + + // true to clone source control from source app; otherwise, false. + CloneSourceControl *bool `json:"cloneSourceControl,omitempty"` + + // true to configure load balancing for source and destination app. + ConfigureLoadBalancing *bool `json:"configureLoadBalancing,omitempty"` + + // Correlation ID of cloning operation. This ID ties multiple cloning operations together to use the same snapshot. + CorrelationID *string `json:"correlationId,omitempty"` + + // App Service Environment. + HostingEnvironment *string `json:"hostingEnvironment,omitempty"` + + // true to overwrite destination app; otherwise, false. + Overwrite *bool `json:"overwrite,omitempty"` + + // Location of source app ex: West US or North Europe + SourceWebAppLocation *string `json:"sourceWebAppLocation,omitempty"` + + // ARM resource ID of the Traffic Manager profile to use, if it exists. Traffic Manager resource ID is of the form + // /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{profileName}. + TrafficManagerProfileID *string `json:"trafficManagerProfileId,omitempty"` + + // Name of Traffic Manager profile to create. This is only needed if Traffic Manager profile does not already exist. + TrafficManagerProfileName *string `json:"trafficManagerProfileName,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type CloningInfo. +func (c CloningInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "appSettingsOverrides", c.AppSettingsOverrides) + populate(objectMap, "cloneCustomHostNames", c.CloneCustomHostNames) + populate(objectMap, "cloneSourceControl", c.CloneSourceControl) + populate(objectMap, "configureLoadBalancing", c.ConfigureLoadBalancing) + populate(objectMap, "correlationId", c.CorrelationID) + populate(objectMap, "hostingEnvironment", c.HostingEnvironment) + populate(objectMap, "overwrite", c.Overwrite) + populate(objectMap, "sourceWebAppId", c.SourceWebAppID) + populate(objectMap, "sourceWebAppLocation", c.SourceWebAppLocation) + populate(objectMap, "trafficManagerProfileId", c.TrafficManagerProfileID) + populate(objectMap, "trafficManagerProfileName", c.TrafficManagerProfileName) + return json.Marshal(objectMap) +} + +// ConnStringInfo - Database connection string information. +type ConnStringInfo struct { + // Connection string value. + ConnectionString *string `json:"connectionString,omitempty"` + + // Name of connection string. + Name *string `json:"name,omitempty"` + + // Type of database. + Type *ConnectionStringType `json:"type,omitempty"` +} + +// ConnStringValueTypePair - Database connection string value to type pair. +type ConnStringValueTypePair struct { + // REQUIRED; Type of database. + Type *ConnectionStringType `json:"type,omitempty"` + + // REQUIRED; Value of pair. + Value *string `json:"value,omitempty"` +} + +// ConnectionStringDictionary - String dictionary resource. +type ConnectionStringDictionary struct { + ProxyOnlyResource + // Connection strings. + Properties map[string]*ConnStringValueTypePair `json:"properties,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type ConnectionStringDictionary. +func (c ConnectionStringDictionary) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + c.ProxyOnlyResource.marshalInternal(objectMap) + populate(objectMap, "properties", c.Properties) + return json.Marshal(objectMap) +} + +// Contact information for domain registration. If 'Domain Privacy' option is not selected then the contact information is made publicly available through +// the Whois directories as per ICANN requirements. +type Contact struct { + // REQUIRED; Email address. + Email *string `json:"email,omitempty"` + + // REQUIRED; First name. + NameFirst *string `json:"nameFirst,omitempty"` + + // REQUIRED; Last name. + NameLast *string `json:"nameLast,omitempty"` + + // REQUIRED; Phone number. + Phone *string `json:"phone,omitempty"` + + // Mailing address. + AddressMailing *Address `json:"addressMailing,omitempty"` + + // Fax number. + Fax *string `json:"fax,omitempty"` + + // Job title. + JobTitle *string `json:"jobTitle,omitempty"` + + // Middle name. + NameMiddle *string `json:"nameMiddle,omitempty"` + + // Organization contact belongs to. + Organization *string `json:"organization,omitempty"` +} + +type ContainerCPUStatistics struct { + CPUUsage *ContainerCPUUsage `json:"cpuUsage,omitempty"` + OnlineCPUCount *int32 `json:"onlineCpuCount,omitempty"` + SystemCPUUsage *int64 `json:"systemCpuUsage,omitempty"` + ThrottlingData *ContainerThrottlingData `json:"throttlingData,omitempty"` +} + +type ContainerCPUUsage struct { + KernelModeUsage *int64 `json:"kernelModeUsage,omitempty"` + PerCPUUsage []*int64 `json:"perCpuUsage,omitempty"` + TotalUsage *int64 `json:"totalUsage,omitempty"` + UserModeUsage *int64 `json:"userModeUsage,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type ContainerCPUUsage. +func (c ContainerCPUUsage) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "kernelModeUsage", c.KernelModeUsage) + populate(objectMap, "perCpuUsage", c.PerCPUUsage) + populate(objectMap, "totalUsage", c.TotalUsage) + populate(objectMap, "userModeUsage", c.UserModeUsage) + return json.Marshal(objectMap) +} + +type ContainerInfo struct { + CurrentCPUStats *ContainerCPUStatistics `json:"currentCpuStats,omitempty"` + CurrentTimeStamp *time.Time `json:"currentTimeStamp,omitempty"` + Eth0 *ContainerNetworkInterfaceStatistics `json:"eth0,omitempty"` + ID *string `json:"id,omitempty"` + MemoryStats *ContainerMemoryStatistics `json:"memoryStats,omitempty"` + Name *string `json:"name,omitempty"` + PreviousCPUStats *ContainerCPUStatistics `json:"previousCpuStats,omitempty"` + PreviousTimeStamp *time.Time `json:"previousTimeStamp,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type ContainerInfo. +func (c ContainerInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "currentCpuStats", c.CurrentCPUStats) + populateTimeRFC3339(objectMap, "currentTimeStamp", c.CurrentTimeStamp) + populate(objectMap, "eth0", c.Eth0) + populate(objectMap, "id", c.ID) + populate(objectMap, "memoryStats", c.MemoryStats) + populate(objectMap, "name", c.Name) + populate(objectMap, "previousCpuStats", c.PreviousCPUStats) + populateTimeRFC3339(objectMap, "previousTimeStamp", c.PreviousTimeStamp) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ContainerInfo. +func (c *ContainerInfo) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "currentCpuStats": + err = unpopulate(val, &c.CurrentCPUStats) + delete(rawMsg, key) + case "currentTimeStamp": + err = unpopulateTimeRFC3339(val, &c.CurrentTimeStamp) + delete(rawMsg, key) + case "eth0": + err = unpopulate(val, &c.Eth0) + delete(rawMsg, key) + case "id": + err = unpopulate(val, &c.ID) + delete(rawMsg, key) + case "memoryStats": + err = unpopulate(val, &c.MemoryStats) + delete(rawMsg, key) + case "name": + err = unpopulate(val, &c.Name) + delete(rawMsg, key) + case "previousCpuStats": + err = unpopulate(val, &c.PreviousCPUStats) + delete(rawMsg, key) + case "previousTimeStamp": + err = unpopulateTimeRFC3339(val, &c.PreviousTimeStamp) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +type ContainerMemoryStatistics struct { + Limit *int64 `json:"limit,omitempty"` + MaxUsage *int64 `json:"maxUsage,omitempty"` + Usage *int64 `json:"usage,omitempty"` +} + +type ContainerNetworkInterfaceStatistics struct { + RxBytes *int64 `json:"rxBytes,omitempty"` + RxDropped *int64 `json:"rxDropped,omitempty"` + RxErrors *int64 `json:"rxErrors,omitempty"` + RxPackets *int64 `json:"rxPackets,omitempty"` + TxBytes *int64 `json:"txBytes,omitempty"` + TxDropped *int64 `json:"txDropped,omitempty"` + TxErrors *int64 `json:"txErrors,omitempty"` + TxPackets *int64 `json:"txPackets,omitempty"` +} + +type ContainerThrottlingData struct { + Periods *int32 `json:"periods,omitempty"` + ThrottledPeriods *int32 `json:"throttledPeriods,omitempty"` + ThrottledTime *int32 `json:"throttledTime,omitempty"` +} + +// ContinuousWebJob - Continuous Web Job Information. +type ContinuousWebJob struct { + ProxyOnlyResource + // ContinuousWebJob resource specific properties + Properties *ContinuousWebJobProperties `json:"properties,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type ContinuousWebJob. +func (c ContinuousWebJob) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + c.ProxyOnlyResource.marshalInternal(objectMap) + populate(objectMap, "properties", c.Properties) + return json.Marshal(objectMap) +} + +// ContinuousWebJobCollection - Collection of Kudu continuous web job information elements. +type ContinuousWebJobCollection struct { + // REQUIRED; Collection of resources. + Value []*ContinuousWebJob `json:"value,omitempty"` + + // READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type ContinuousWebJobCollection. +func (c ContinuousWebJobCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", c.NextLink) + populate(objectMap, "value", c.Value) + return json.Marshal(objectMap) +} + +// ContinuousWebJobProperties - ContinuousWebJob resource specific properties +type ContinuousWebJobProperties struct { + // Detailed status. + DetailedStatus *string `json:"detailed_status,omitempty"` + + // Error information. + Error *string `json:"error,omitempty"` + + // Extra Info URL. + ExtraInfoURL *string `json:"extra_info_url,omitempty"` + + // Log URL. + LogURL *string `json:"log_url,omitempty"` + + // Run command. + RunCommand *string `json:"run_command,omitempty"` + + // Job settings. + Settings map[string]map[string]interface{} `json:"settings,omitempty"` + + // Job status. + Status *ContinuousWebJobStatus `json:"status,omitempty"` + + // Job URL. + URL *string `json:"url,omitempty"` + + // Using SDK? + UsingSdk *bool `json:"using_sdk,omitempty"` + + // Job type. + WebJobType *WebJobType `json:"web_job_type,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type ContinuousWebJobProperties. +func (c ContinuousWebJobProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "detailed_status", c.DetailedStatus) + populate(objectMap, "error", c.Error) + populate(objectMap, "extra_info_url", c.ExtraInfoURL) + populate(objectMap, "log_url", c.LogURL) + populate(objectMap, "run_command", c.RunCommand) + populate(objectMap, "settings", c.Settings) + populate(objectMap, "status", c.Status) + populate(objectMap, "url", c.URL) + populate(objectMap, "using_sdk", c.UsingSdk) + populate(objectMap, "web_job_type", c.WebJobType) + return json.Marshal(objectMap) +} + +// CookieExpiration - The configuration settings of the session cookie's expiration. +type CookieExpiration struct { + // The convention used when determining the session cookie's expiration. + Convention *CookieExpirationConvention `json:"convention,omitempty"` + + // The time after the request is made when the session cookie should expire. + TimeToExpiration *string `json:"timeToExpiration,omitempty"` +} + +// CorsSettings - Cross-Origin Resource Sharing (CORS) settings for the app. +type CorsSettings struct { + // Gets or sets the list of origins that should be allowed to make cross-origin calls (for example: http://example.com:12345). Use "*" to allow all. + AllowedOrigins []*string `json:"allowedOrigins,omitempty"` + + // Gets or sets whether CORS requests with credentials are allowed. See https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#Requestswithcredentials for + // more details. + SupportCredentials *bool `json:"supportCredentials,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type CorsSettings. +func (c CorsSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "allowedOrigins", c.AllowedOrigins) + populate(objectMap, "supportCredentials", c.SupportCredentials) + return json.Marshal(objectMap) +} + +// CsmMoveResourceEnvelope - Object with a list of the resources that need to be moved and the resource group they should be moved to. +type CsmMoveResourceEnvelope struct { + Resources []*string `json:"resources,omitempty"` + TargetResourceGroup *string `json:"targetResourceGroup,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type CsmMoveResourceEnvelope. +func (c CsmMoveResourceEnvelope) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "resources", c.Resources) + populate(objectMap, "targetResourceGroup", c.TargetResourceGroup) + return json.Marshal(objectMap) +} + +// CsmOperationCollection - Collection of Azure resource manager operation metadata. +type CsmOperationCollection struct { + // REQUIRED; Collection of resources. + Value []*CsmOperationDescription `json:"value,omitempty"` + + // READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type CsmOperationCollection. +func (c CsmOperationCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", c.NextLink) + populate(objectMap, "value", c.Value) + return json.Marshal(objectMap) +} + +// CsmOperationDescription - Description of an operation available for Microsoft.Web resource provider. +type CsmOperationDescription struct { + // Meta data about operation used for display in portal. + Display *CsmOperationDisplay `json:"display,omitempty"` + IsDataAction *bool `json:"isDataAction,omitempty"` + Name *string `json:"name,omitempty"` + Origin *string `json:"origin,omitempty"` + + // Properties available for a Microsoft.Web resource provider operation. + Properties *CsmOperationDescriptionProperties `json:"properties,omitempty"` +} + +// CsmOperationDescriptionProperties - Properties available for a Microsoft.Web resource provider operation. +type CsmOperationDescriptionProperties struct { + // Resource metrics service provided by Microsoft.Insights resource provider. + ServiceSpecification *ServiceSpecification `json:"serviceSpecification,omitempty"` +} + +// CsmOperationDisplay - Meta data about operation used for display in portal. +type CsmOperationDisplay struct { + Description *string `json:"description,omitempty"` + Operation *string `json:"operation,omitempty"` + Provider *string `json:"provider,omitempty"` + Resource *string `json:"resource,omitempty"` +} + +// CsmPublishingCredentialsPoliciesEntity - Publishing Credentials Policies parameters. +type CsmPublishingCredentialsPoliciesEntity struct { + ProxyOnlyResource + // CsmPublishingCredentialsPoliciesEntity resource specific properties + Properties *CsmPublishingCredentialsPoliciesEntityProperties `json:"properties,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type CsmPublishingCredentialsPoliciesEntity. +func (c CsmPublishingCredentialsPoliciesEntity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + c.ProxyOnlyResource.marshalInternal(objectMap) + populate(objectMap, "properties", c.Properties) + return json.Marshal(objectMap) +} + +// CsmPublishingCredentialsPoliciesEntityProperties - CsmPublishingCredentialsPoliciesEntity resource specific properties +type CsmPublishingCredentialsPoliciesEntityProperties struct { + // REQUIRED; true to allow access to a publishing method; otherwise, false. + Allow *bool `json:"allow,omitempty"` +} + +// CsmPublishingProfileOptions - Publishing options for requested profile. +type CsmPublishingProfileOptions struct { + // Name of the format. Valid values are: FileZilla3 WebDeploy -- default Ftp + Format *PublishingProfileFormat `json:"format,omitempty"` + + // Include the DisasterRecover endpoint if true + IncludeDisasterRecoveryEndpoints *bool `json:"includeDisasterRecoveryEndpoints,omitempty"` +} + +// CsmSlotEntity - Deployment slot parameters. +type CsmSlotEntity struct { + // REQUIRED; true to preserve Virtual Network to the slot during swap; otherwise, false. + PreserveVnet *bool `json:"preserveVnet,omitempty"` + + // REQUIRED; Destination deployment slot during swap operation. + TargetSlot *string `json:"targetSlot,omitempty"` +} + +// CsmUsageQuota - Usage of the quota resource. +type CsmUsageQuota struct { + // The current value of the resource counter. + CurrentValue *int64 `json:"currentValue,omitempty"` + + // The resource limit. + Limit *int64 `json:"limit,omitempty"` + + // Quota name. + Name *LocalizableString `json:"name,omitempty"` + + // Next reset time for the resource counter. + NextResetTime *time.Time `json:"nextResetTime,omitempty"` + + // Units of measurement for the quota resource. + Unit *string `json:"unit,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type CsmUsageQuota. +func (c CsmUsageQuota) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "currentValue", c.CurrentValue) + populate(objectMap, "limit", c.Limit) + populate(objectMap, "name", c.Name) + populateTimeRFC3339(objectMap, "nextResetTime", c.NextResetTime) + populate(objectMap, "unit", c.Unit) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CsmUsageQuota. +func (c *CsmUsageQuota) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "currentValue": + err = unpopulate(val, &c.CurrentValue) + delete(rawMsg, key) + case "limit": + err = unpopulate(val, &c.Limit) + delete(rawMsg, key) + case "name": + err = unpopulate(val, &c.Name) + delete(rawMsg, key) + case "nextResetTime": + err = unpopulateTimeRFC3339(val, &c.NextResetTime) + delete(rawMsg, key) + case "unit": + err = unpopulate(val, &c.Unit) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// CsmUsageQuotaCollection - Collection of CSM usage quotas. +type CsmUsageQuotaCollection struct { + // REQUIRED; Collection of resources. + Value []*CsmUsageQuota `json:"value,omitempty"` + + // READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type CsmUsageQuotaCollection. +func (c CsmUsageQuotaCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", c.NextLink) + populate(objectMap, "value", c.Value) + return json.Marshal(objectMap) +} + +// CustomHostnameAnalysisResult - Custom domain analysis. +type CustomHostnameAnalysisResult struct { + ProxyOnlyResource + // CustomHostnameAnalysisResult resource specific properties + Properties *CustomHostnameAnalysisResultProperties `json:"properties,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type CustomHostnameAnalysisResult. +func (c CustomHostnameAnalysisResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + c.ProxyOnlyResource.marshalInternal(objectMap) + populate(objectMap, "properties", c.Properties) + return json.Marshal(objectMap) +} + +// CustomHostnameAnalysisResultProperties - CustomHostnameAnalysisResult resource specific properties +type CustomHostnameAnalysisResultProperties struct { + // A records controller can see for this hostname. + ARecords []*string `json:"aRecords,omitempty"` + + // Alternate CName records controller can see for this hostname. + AlternateCNameRecords []*string `json:"alternateCNameRecords,omitempty"` + + // Alternate TXT records controller can see for this hostname. + AlternateTxtRecords []*string `json:"alternateTxtRecords,omitempty"` + + // CName records controller can see for this hostname. + CNameRecords []*string `json:"cNameRecords,omitempty"` + + // TXT records controller can see for this hostname. + TxtRecords []*string `json:"txtRecords,omitempty"` + + // READ-ONLY; Name of the conflicting app on scale unit if it's within the same subscription. + ConflictingAppResourceID *string `json:"conflictingAppResourceId,omitempty" azure:"ro"` + + // READ-ONLY; Raw failure information if DNS verification fails. + CustomDomainVerificationFailureInfo *ErrorEntity `json:"customDomainVerificationFailureInfo,omitempty" azure:"ro"` + + // READ-ONLY; DNS verification test result. + CustomDomainVerificationTest *DNSVerificationTestResult `json:"customDomainVerificationTest,omitempty" azure:"ro"` + + // READ-ONLY; true if there is a conflict across subscriptions; otherwise, false. + HasConflictAcrossSubscription *bool `json:"hasConflictAcrossSubscription,omitempty" azure:"ro"` + + // READ-ONLY; true if there is a conflict on a scale unit; otherwise, false. + HasConflictOnScaleUnit *bool `json:"hasConflictOnScaleUnit,omitempty" azure:"ro"` + + // READ-ONLY; true if hostname is already verified; otherwise, false. + IsHostnameAlreadyVerified *bool `json:"isHostnameAlreadyVerified,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type CustomHostnameAnalysisResultProperties. +func (c CustomHostnameAnalysisResultProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "aRecords", c.ARecords) + populate(objectMap, "alternateCNameRecords", c.AlternateCNameRecords) + populate(objectMap, "alternateTxtRecords", c.AlternateTxtRecords) + populate(objectMap, "cNameRecords", c.CNameRecords) + populate(objectMap, "conflictingAppResourceId", c.ConflictingAppResourceID) + populate(objectMap, "customDomainVerificationFailureInfo", c.CustomDomainVerificationFailureInfo) + populate(objectMap, "customDomainVerificationTest", c.CustomDomainVerificationTest) + populate(objectMap, "hasConflictAcrossSubscription", c.HasConflictAcrossSubscription) + populate(objectMap, "hasConflictOnScaleUnit", c.HasConflictOnScaleUnit) + populate(objectMap, "isHostnameAlreadyVerified", c.IsHostnameAlreadyVerified) + populate(objectMap, "txtRecords", c.TxtRecords) + return json.Marshal(objectMap) +} + +// CustomOpenIDConnectProvider - The configuration settings of the custom Open ID Connect provider. +type CustomOpenIDConnectProvider struct { + // false if the custom Open ID provider provider should not be enabled; otherwise, true. + Enabled *bool `json:"enabled,omitempty"` + + // The configuration settings of the login flow of the custom Open ID Connect provider. + Login *OpenIDConnectLogin `json:"login,omitempty"` + + // The configuration settings of the app registration for the custom Open ID Connect provider. + Registration *OpenIDConnectRegistration `json:"registration,omitempty"` +} + +// DataProviderMetadata - Additional configuration for a data providers +type DataProviderMetadata struct { + ProviderName *string `json:"providerName,omitempty"` + + // READ-ONLY; Settings for the data provider + PropertyBag []*KeyValuePairStringObject `json:"propertyBag,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type DataProviderMetadata. +func (d DataProviderMetadata) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "propertyBag", d.PropertyBag) + populate(objectMap, "providerName", d.ProviderName) + return json.Marshal(objectMap) +} + +// DataSource - Class representing data source used by the detectors +type DataSource struct { + // Datasource Uri Links + DataSourceURI []*NameValuePair `json:"dataSourceUri,omitempty"` + + // Instructions if any for the data source + Instructions []*string `json:"instructions,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type DataSource. +func (d DataSource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "dataSourceUri", d.DataSourceURI) + populate(objectMap, "instructions", d.Instructions) + return json.Marshal(objectMap) +} + +// DataTableResponseColumn - Column definition +type DataTableResponseColumn struct { + // Name of the column + ColumnName *string `json:"columnName,omitempty"` + + // Column Type + ColumnType *string `json:"columnType,omitempty"` + + // Data type which looks like 'String' or 'Int32'. + DataType *string `json:"dataType,omitempty"` +} + +// DataTableResponseObject - Data Table which defines columns and raw row values +type DataTableResponseObject struct { + // List of columns with data types + Columns []*DataTableResponseColumn `json:"columns,omitempty"` + + // Raw row values + Rows [][]*string `json:"rows,omitempty"` + + // Name of the table + TableName *string `json:"tableName,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type DataTableResponseObject. +func (d DataTableResponseObject) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "columns", d.Columns) + populate(objectMap, "rows", d.Rows) + populate(objectMap, "tableName", d.TableName) + return json.Marshal(objectMap) +} + +// DatabaseBackupSetting - Database backup settings. +type DatabaseBackupSetting struct { + // REQUIRED; Database type (e.g. SqlAzure / MySql). + DatabaseType *DatabaseType `json:"databaseType,omitempty"` + + // Contains a connection string to a database which is being backed up or restored. If the restore should happen to a new database, the database name inside + // is the new one. + ConnectionString *string `json:"connectionString,omitempty"` + + // Contains a connection string name that is linked to the SiteConfig.ConnectionStrings. This is used during restore with overwrite connection strings options. + ConnectionStringName *string `json:"connectionStringName,omitempty"` + Name *string `json:"name,omitempty"` +} + +// DefaultAuthorizationPolicy - The configuration settings of the Azure Active Directory default authorization policy. +type DefaultAuthorizationPolicy struct { + // The configuration settings of the Azure Active Directory allowed applications. + AllowedApplications []*string `json:"allowedApplications,omitempty"` + + // The configuration settings of the Azure Active Directory allowed principals. + AllowedPrincipals *AllowedPrincipals `json:"allowedPrincipals,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type DefaultAuthorizationPolicy. +func (d DefaultAuthorizationPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "allowedApplications", d.AllowedApplications) + populate(objectMap, "allowedPrincipals", d.AllowedPrincipals) + return json.Marshal(objectMap) +} + +// DefaultErrorResponse - App Service error response. +// Implements the error and azcore.HTTPResponse interfaces. +type DefaultErrorResponse struct { + raw string + // READ-ONLY; Error model. + InnerError *DefaultErrorResponseError `json:"error,omitempty" azure:"ro"` +} + +// Error implements the error interface for type DefaultErrorResponse. +// The contents of the error text are not contractual and subject to change. +func (e DefaultErrorResponse) Error() string { + return e.raw +} + +// DefaultErrorResponseError - Error model. +type DefaultErrorResponseError struct { + Details []*DefaultErrorResponseErrorDetailsItem `json:"details,omitempty"` + + // READ-ONLY; Standardized string to programmatically identify the error. + Code *string `json:"code,omitempty" azure:"ro"` + + // READ-ONLY; More information to debug error. + Innererror *string `json:"innererror,omitempty" azure:"ro"` + + // READ-ONLY; Detailed error description and debugging information. + Message *string `json:"message,omitempty" azure:"ro"` + + // READ-ONLY; Detailed error description and debugging information. + Target *string `json:"target,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type DefaultErrorResponseError. +func (d DefaultErrorResponseError) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "code", d.Code) + populate(objectMap, "details", d.Details) + populate(objectMap, "innererror", d.Innererror) + populate(objectMap, "message", d.Message) + populate(objectMap, "target", d.Target) + return json.Marshal(objectMap) +} + +// DefaultErrorResponseErrorDetailsItem - Detailed errors. +type DefaultErrorResponseErrorDetailsItem struct { + // READ-ONLY; Standardized string to programmatically identify the error. + Code *string `json:"code,omitempty" azure:"ro"` + + // READ-ONLY; Detailed error description and debugging information. + Message *string `json:"message,omitempty" azure:"ro"` + + // READ-ONLY; Detailed error description and debugging information. + Target *string `json:"target,omitempty" azure:"ro"` +} + +// DeletedAppRestoreRequest - Details about restoring a deleted app. +type DeletedAppRestoreRequest struct { + ProxyOnlyResource + // DeletedAppRestoreRequest resource specific properties + Properties *DeletedAppRestoreRequestProperties `json:"properties,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type DeletedAppRestoreRequest. +func (d DeletedAppRestoreRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + d.ProxyOnlyResource.marshalInternal(objectMap) + populate(objectMap, "properties", d.Properties) + return json.Marshal(objectMap) +} + +// DeletedAppRestoreRequestProperties - DeletedAppRestoreRequest resource specific properties +type DeletedAppRestoreRequestProperties struct { + // ARM resource ID of the deleted app. Example: /subscriptions/{subId}/providers/Microsoft.Web/deletedSites/{deletedSiteId} + DeletedSiteID *string `json:"deletedSiteId,omitempty"` + + // If true, deleted site configuration, in addition to content, will be restored. + RecoverConfiguration *bool `json:"recoverConfiguration,omitempty"` + + // Point in time to restore the deleted app from, formatted as a DateTime string. If unspecified, default value is the time that the app was deleted. + SnapshotTime *string `json:"snapshotTime,omitempty"` + + // If true, the snapshot is retrieved from DRSecondary endpoint. + UseDRSecondary *bool `json:"useDRSecondary,omitempty"` +} + +// DeletedSite - A deleted app. +type DeletedSite struct { + ProxyOnlyResource + // DeletedSite resource specific properties + Properties *DeletedSiteProperties `json:"properties,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type DeletedSite. +func (d DeletedSite) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + d.ProxyOnlyResource.marshalInternal(objectMap) + populate(objectMap, "properties", d.Properties) + return json.Marshal(objectMap) +} + +// DeletedSiteProperties - DeletedSite resource specific properties +type DeletedSiteProperties struct { + // READ-ONLY; Numeric id for the deleted site + DeletedSiteID *int32 `json:"deletedSiteId,omitempty" azure:"ro"` + + // READ-ONLY; Name of the deleted site + DeletedSiteName *string `json:"deletedSiteName,omitempty" azure:"ro"` + + // READ-ONLY; Time in UTC when the app was deleted. + DeletedTimestamp *string `json:"deletedTimestamp,omitempty" azure:"ro"` + + // READ-ONLY; Geo Region of the deleted site + GeoRegionName *string `json:"geoRegionName,omitempty" azure:"ro"` + + // READ-ONLY; Kind of site that was deleted + Kind *string `json:"kind,omitempty" azure:"ro"` + + // READ-ONLY; ResourceGroup that contained the deleted site + ResourceGroup *string `json:"resourceGroup,omitempty" azure:"ro"` + + // READ-ONLY; Slot of the deleted site + Slot *string `json:"slot,omitempty" azure:"ro"` + + // READ-ONLY; Subscription containing the deleted site + Subscription *string `json:"subscription,omitempty" azure:"ro"` +} + +// DeletedWebAppCollection - Collection of deleted apps. +type DeletedWebAppCollection struct { + // REQUIRED; Collection of resources. + Value []*DeletedSite `json:"value,omitempty"` + + // READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type DeletedWebAppCollection. +func (d DeletedWebAppCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", d.NextLink) + populate(objectMap, "value", d.Value) + return json.Marshal(objectMap) +} + +// DeletedWebAppsGetDeletedWebAppByLocationOptions contains the optional parameters for the DeletedWebApps.GetDeletedWebAppByLocation method. +type DeletedWebAppsGetDeletedWebAppByLocationOptions struct { + // placeholder for future optional parameters +} + +// DeletedWebAppsListByLocationOptions contains the optional parameters for the DeletedWebApps.ListByLocation method. +type DeletedWebAppsListByLocationOptions struct { + // placeholder for future optional parameters +} + +// DeletedWebAppsListOptions contains the optional parameters for the DeletedWebApps.List method. +type DeletedWebAppsListOptions struct { + // placeholder for future optional parameters +} + +// Deployment - User credentials used for publishing activity. +type Deployment struct { + ProxyOnlyResource + // Deployment resource specific properties + Properties *DeploymentProperties `json:"properties,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type Deployment. +func (d Deployment) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + d.ProxyOnlyResource.marshalInternal(objectMap) + populate(objectMap, "properties", d.Properties) + return json.Marshal(objectMap) +} + +// DeploymentCollection - Collection of app deployments. +type DeploymentCollection struct { + // REQUIRED; Collection of resources. + Value []*Deployment `json:"value,omitempty"` + + // READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type DeploymentCollection. +func (d DeploymentCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", d.NextLink) + populate(objectMap, "value", d.Value) + return json.Marshal(objectMap) +} + +// DeploymentLocations - List of available locations (regions or App Service Environments) for deployment of App Service resources. +type DeploymentLocations struct { + // Available App Service Environments with basic information. + HostingEnvironmentDeploymentInfos []*HostingEnvironmentDeploymentInfo `json:"hostingEnvironmentDeploymentInfos,omitempty"` + + // Available App Service Environments with full descriptions of the environments. + HostingEnvironments []*AppServiceEnvironment `json:"hostingEnvironments,omitempty"` + + // Available regions. + Locations []*GeoRegion `json:"locations,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type DeploymentLocations. +func (d DeploymentLocations) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "hostingEnvironmentDeploymentInfos", d.HostingEnvironmentDeploymentInfos) + populate(objectMap, "hostingEnvironments", d.HostingEnvironments) + populate(objectMap, "locations", d.Locations) + return json.Marshal(objectMap) +} + +// DeploymentProperties - Deployment resource specific properties +type DeploymentProperties struct { + // True if deployment is currently active, false if completed and null if not started. + Active *bool `json:"active,omitempty"` + + // Who authored the deployment. + Author *string `json:"author,omitempty"` + + // Author email. + AuthorEmail *string `json:"author_email,omitempty"` + + // Who performed the deployment. + Deployer *string `json:"deployer,omitempty"` + + // Details on deployment. + Details *string `json:"details,omitempty"` + + // End time. + EndTime *time.Time `json:"end_time,omitempty"` + + // Details about deployment status. + Message *string `json:"message,omitempty"` + + // Start time. + StartTime *time.Time `json:"start_time,omitempty"` + + // Deployment status. + Status *int32 `json:"status,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type DeploymentProperties. +func (d DeploymentProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "active", d.Active) + populate(objectMap, "author", d.Author) + populate(objectMap, "author_email", d.AuthorEmail) + populate(objectMap, "deployer", d.Deployer) + populate(objectMap, "details", d.Details) + populateTimeRFC3339(objectMap, "end_time", d.EndTime) + populate(objectMap, "message", d.Message) + populateTimeRFC3339(objectMap, "start_time", d.StartTime) + populate(objectMap, "status", d.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DeploymentProperties. +func (d *DeploymentProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "active": + err = unpopulate(val, &d.Active) + delete(rawMsg, key) + case "author": + err = unpopulate(val, &d.Author) + delete(rawMsg, key) + case "author_email": + err = unpopulate(val, &d.AuthorEmail) + delete(rawMsg, key) + case "deployer": + err = unpopulate(val, &d.Deployer) + delete(rawMsg, key) + case "details": + err = unpopulate(val, &d.Details) + delete(rawMsg, key) + case "end_time": + err = unpopulateTimeRFC3339(val, &d.EndTime) + delete(rawMsg, key) + case "message": + err = unpopulate(val, &d.Message) + delete(rawMsg, key) + case "start_time": + err = unpopulateTimeRFC3339(val, &d.StartTime) + delete(rawMsg, key) + case "status": + err = unpopulate(val, &d.Status) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// DetectorAbnormalTimePeriod - Class representing Abnormal Time Period detected. +type DetectorAbnormalTimePeriod struct { + // End time of the correlated event + EndTime *time.Time `json:"endTime,omitempty"` + + // Message describing the event + Message *string `json:"message,omitempty"` + + // Downtime metadata + MetaData [][]*NameValuePair `json:"metaData,omitempty"` + + // Represents the rank of the Detector + Priority *float64 `json:"priority,omitempty"` + + // List of proposed solutions + Solutions []*Solution `json:"solutions,omitempty"` + + // Represents the name of the Detector + Source *string `json:"source,omitempty"` + + // Start time of the correlated event + StartTime *time.Time `json:"startTime,omitempty"` + + // Represents the type of the Detector + Type *IssueType `json:"type,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type DetectorAbnormalTimePeriod. +func (d DetectorAbnormalTimePeriod) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populateTimeRFC3339(objectMap, "endTime", d.EndTime) + populate(objectMap, "message", d.Message) + populate(objectMap, "metaData", d.MetaData) + populate(objectMap, "priority", d.Priority) + populate(objectMap, "solutions", d.Solutions) + populate(objectMap, "source", d.Source) + populateTimeRFC3339(objectMap, "startTime", d.StartTime) + populate(objectMap, "type", d.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DetectorAbnormalTimePeriod. +func (d *DetectorAbnormalTimePeriod) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "endTime": + err = unpopulateTimeRFC3339(val, &d.EndTime) + delete(rawMsg, key) + case "message": + err = unpopulate(val, &d.Message) + delete(rawMsg, key) + case "metaData": + err = unpopulate(val, &d.MetaData) + delete(rawMsg, key) + case "priority": + err = unpopulate(val, &d.Priority) + delete(rawMsg, key) + case "solutions": + err = unpopulate(val, &d.Solutions) + delete(rawMsg, key) + case "source": + err = unpopulate(val, &d.Source) + delete(rawMsg, key) + case "startTime": + err = unpopulateTimeRFC3339(val, &d.StartTime) + delete(rawMsg, key) + case "type": + err = unpopulate(val, &d.Type) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// DetectorDefinition - Class representing detector definition +type DetectorDefinition struct { + // READ-ONLY; Description of the detector + Description *string `json:"description,omitempty" azure:"ro"` + + // READ-ONLY; Display name of the detector + DisplayName *string `json:"displayName,omitempty" azure:"ro"` + + // READ-ONLY; Flag representing whether detector is enabled or not. + IsEnabled *bool `json:"isEnabled,omitempty" azure:"ro"` + + // READ-ONLY; Detector Rank + Rank *float64 `json:"rank,omitempty" azure:"ro"` +} + +// DetectorDefinitionResource - ARM resource for a detector definition +type DetectorDefinitionResource struct { + ProxyOnlyResource + // Core resource properties + Properties *DetectorDefinition `json:"properties,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type DetectorDefinitionResource. +func (d DetectorDefinitionResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + d.ProxyOnlyResource.marshalInternal(objectMap) + populate(objectMap, "properties", d.Properties) + return json.Marshal(objectMap) +} + +// DetectorInfo - Definition of Detector +type DetectorInfo struct { + // READ-ONLY; Analysis Types for which this detector should apply to. + AnalysisType []*string `json:"analysisType,omitempty" azure:"ro"` + + // READ-ONLY; Author of the detector. + Author *string `json:"author,omitempty" azure:"ro"` + + // READ-ONLY; Problem category. This serves for organizing group for detectors. + Category *string `json:"category,omitempty" azure:"ro"` + + // READ-ONLY; Short description of the detector and its purpose. + Description *string `json:"description,omitempty" azure:"ro"` + + // READ-ONLY; Id of detector + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; Name of detector + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; Defines score of a detector to power ML based matching. + Score *float32 `json:"score,omitempty" azure:"ro"` + + // READ-ONLY; List of Support Topics for which this detector is enabled. + SupportTopicList []*SupportTopic `json:"supportTopicList,omitempty" azure:"ro"` + + // READ-ONLY; Whether this detector is an Analysis Detector or not. + Type *DetectorType `json:"type,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type DetectorInfo. +func (d DetectorInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "analysisType", d.AnalysisType) + populate(objectMap, "author", d.Author) + populate(objectMap, "category", d.Category) + populate(objectMap, "description", d.Description) + populate(objectMap, "id", d.ID) + populate(objectMap, "name", d.Name) + populate(objectMap, "score", d.Score) + populate(objectMap, "supportTopicList", d.SupportTopicList) + populate(objectMap, "type", d.Type) + return json.Marshal(objectMap) +} + +// DetectorResponse - Class representing Response from Detector +type DetectorResponse struct { + ProxyOnlyResource + // DetectorResponse resource specific properties + Properties *DetectorResponseProperties `json:"properties,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type DetectorResponse. +func (d DetectorResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + d.ProxyOnlyResource.marshalInternal(objectMap) + populate(objectMap, "properties", d.Properties) + return json.Marshal(objectMap) +} + +// DetectorResponseCollection - Collection of detector responses +type DetectorResponseCollection struct { + // REQUIRED; Collection of resources. + Value []*DetectorResponse `json:"value,omitempty"` + + // READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type DetectorResponseCollection. +func (d DetectorResponseCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", d.NextLink) + populate(objectMap, "value", d.Value) + return json.Marshal(objectMap) +} + +// DetectorResponseProperties - DetectorResponse resource specific properties +type DetectorResponseProperties struct { + // Additional configuration for different data providers to be used by the UI + DataProvidersMetadata []*DataProviderMetadata `json:"dataProvidersMetadata,omitempty"` + + // Data Set + Dataset []*DiagnosticData `json:"dataset,omitempty"` + + // metadata for the detector + Metadata *DetectorInfo `json:"metadata,omitempty"` + + // Indicates status of the most severe insight. + Status *Status `json:"status,omitempty"` + + // Suggested utterances where the detector can be applicable. + SuggestedUtterances *QueryUtterancesResults `json:"suggestedUtterances,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type DetectorResponseProperties. +func (d DetectorResponseProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "dataProvidersMetadata", d.DataProvidersMetadata) + populate(objectMap, "dataset", d.Dataset) + populate(objectMap, "metadata", d.Metadata) + populate(objectMap, "status", d.Status) + populate(objectMap, "suggestedUtterances", d.SuggestedUtterances) + return json.Marshal(objectMap) +} + +// DiagnosticAnalysis - Class representing a diagnostic analysis done on an application +type DiagnosticAnalysis struct { + ProxyOnlyResource + // DiagnosticAnalysis resource specific properties + Properties *DiagnosticAnalysisProperties `json:"properties,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type DiagnosticAnalysis. +func (d DiagnosticAnalysis) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + d.ProxyOnlyResource.marshalInternal(objectMap) + populate(objectMap, "properties", d.Properties) + return json.Marshal(objectMap) +} + +// DiagnosticAnalysisCollection - Collection of Diagnostic Analyses +type DiagnosticAnalysisCollection struct { + // REQUIRED; Collection of resources. + Value []*AnalysisDefinition `json:"value,omitempty"` + + // READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type DiagnosticAnalysisCollection. +func (d DiagnosticAnalysisCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", d.NextLink) + populate(objectMap, "value", d.Value) + return json.Marshal(objectMap) +} + +// DiagnosticAnalysisProperties - DiagnosticAnalysis resource specific properties +type DiagnosticAnalysisProperties struct { + // List of time periods. + AbnormalTimePeriods []*AbnormalTimePeriod `json:"abnormalTimePeriods,omitempty"` + + // End time of the period + EndTime *time.Time `json:"endTime,omitempty"` + + // Data by each detector for detectors that did not corelate + NonCorrelatedDetectors []*DetectorDefinition `json:"nonCorrelatedDetectors,omitempty"` + + // Data by each detector + Payload []*AnalysisData `json:"payload,omitempty"` + + // Start time of the period + StartTime *time.Time `json:"startTime,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type DiagnosticAnalysisProperties. +func (d DiagnosticAnalysisProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "abnormalTimePeriods", d.AbnormalTimePeriods) + populateTimeRFC3339(objectMap, "endTime", d.EndTime) + populate(objectMap, "nonCorrelatedDetectors", d.NonCorrelatedDetectors) + populate(objectMap, "payload", d.Payload) + populateTimeRFC3339(objectMap, "startTime", d.StartTime) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DiagnosticAnalysisProperties. +func (d *DiagnosticAnalysisProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "abnormalTimePeriods": + err = unpopulate(val, &d.AbnormalTimePeriods) + delete(rawMsg, key) + case "endTime": + err = unpopulateTimeRFC3339(val, &d.EndTime) + delete(rawMsg, key) + case "nonCorrelatedDetectors": + err = unpopulate(val, &d.NonCorrelatedDetectors) + delete(rawMsg, key) + case "payload": + err = unpopulate(val, &d.Payload) + delete(rawMsg, key) + case "startTime": + err = unpopulateTimeRFC3339(val, &d.StartTime) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// DiagnosticCategory - Class representing detector definition +type DiagnosticCategory struct { + ProxyOnlyResource + // DiagnosticCategory resource specific properties + Properties *DiagnosticCategoryProperties `json:"properties,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type DiagnosticCategory. +func (d DiagnosticCategory) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + d.ProxyOnlyResource.marshalInternal(objectMap) + populate(objectMap, "properties", d.Properties) + return json.Marshal(objectMap) +} + +// DiagnosticCategoryCollection - Collection of Diagnostic Categories +type DiagnosticCategoryCollection struct { + // REQUIRED; Collection of resources. + Value []*DiagnosticCategory `json:"value,omitempty"` + + // READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type DiagnosticCategoryCollection. +func (d DiagnosticCategoryCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", d.NextLink) + populate(objectMap, "value", d.Value) + return json.Marshal(objectMap) +} + +// DiagnosticCategoryProperties - DiagnosticCategory resource specific properties +type DiagnosticCategoryProperties struct { + // READ-ONLY; Description of the diagnostic category + Description *string `json:"description,omitempty" azure:"ro"` +} + +// DiagnosticData - Set of data with rendering instructions +type DiagnosticData struct { + // Properties that describe how the table should be rendered + RenderingProperties *Rendering `json:"renderingProperties,omitempty"` + + // Data in table form + Table *DataTableResponseObject `json:"table,omitempty"` +} + +// DiagnosticDetectorCollection - Collection of Diagnostic Detectors +type DiagnosticDetectorCollection struct { + // REQUIRED; Collection of resources. + Value []*DetectorDefinitionResource `json:"value,omitempty"` + + // READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type DiagnosticDetectorCollection. +func (d DiagnosticDetectorCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", d.NextLink) + populate(objectMap, "value", d.Value) + return json.Marshal(objectMap) +} + +// DiagnosticDetectorResponse - Class representing Response from Diagnostic Detectors +type DiagnosticDetectorResponse struct { + ProxyOnlyResource + // DiagnosticDetectorResponse resource specific properties + Properties *DiagnosticDetectorResponseProperties `json:"properties,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type DiagnosticDetectorResponse. +func (d DiagnosticDetectorResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + d.ProxyOnlyResource.marshalInternal(objectMap) + populate(objectMap, "properties", d.Properties) + return json.Marshal(objectMap) +} + +// DiagnosticDetectorResponseProperties - DiagnosticDetectorResponse resource specific properties +type DiagnosticDetectorResponseProperties struct { + // List of Correlated events found by the detector + AbnormalTimePeriods []*DetectorAbnormalTimePeriod `json:"abnormalTimePeriods,omitempty"` + + // Additional Data that detector wants to send. + Data [][]*NameValuePair `json:"data,omitempty"` + + // Detector's definition + DetectorDefinition *DetectorDefinition `json:"detectorDefinition,omitempty"` + + // End time of the period + EndTime *time.Time `json:"endTime,omitempty"` + + // Flag representing Issue was detected. + IssueDetected *bool `json:"issueDetected,omitempty"` + + // Metrics provided by the detector + Metrics []*DiagnosticMetricSet `json:"metrics,omitempty"` + + // Meta Data + ResponseMetaData *ResponseMetaData `json:"responseMetaData,omitempty"` + + // Start time of the period + StartTime *time.Time `json:"startTime,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type DiagnosticDetectorResponseProperties. +func (d DiagnosticDetectorResponseProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "abnormalTimePeriods", d.AbnormalTimePeriods) + populate(objectMap, "data", d.Data) + populate(objectMap, "detectorDefinition", d.DetectorDefinition) + populateTimeRFC3339(objectMap, "endTime", d.EndTime) + populate(objectMap, "issueDetected", d.IssueDetected) + populate(objectMap, "metrics", d.Metrics) + populate(objectMap, "responseMetaData", d.ResponseMetaData) + populateTimeRFC3339(objectMap, "startTime", d.StartTime) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DiagnosticDetectorResponseProperties. +func (d *DiagnosticDetectorResponseProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "abnormalTimePeriods": + err = unpopulate(val, &d.AbnormalTimePeriods) + delete(rawMsg, key) + case "data": + err = unpopulate(val, &d.Data) + delete(rawMsg, key) + case "detectorDefinition": + err = unpopulate(val, &d.DetectorDefinition) + delete(rawMsg, key) + case "endTime": + err = unpopulateTimeRFC3339(val, &d.EndTime) + delete(rawMsg, key) + case "issueDetected": + err = unpopulate(val, &d.IssueDetected) + delete(rawMsg, key) + case "metrics": + err = unpopulate(val, &d.Metrics) + delete(rawMsg, key) + case "responseMetaData": + err = unpopulate(val, &d.ResponseMetaData) + delete(rawMsg, key) + case "startTime": + err = unpopulateTimeRFC3339(val, &d.StartTime) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// DiagnosticMetricSample - Class representing Diagnostic Metric +type DiagnosticMetricSample struct { + // Whether the values are aggregates across all workers or not + IsAggregated *bool `json:"isAggregated,omitempty"` + + // Maximum of the metric sampled during the time period + Maximum *float64 `json:"maximum,omitempty"` + + // Minimum of the metric sampled during the time period + Minimum *float64 `json:"minimum,omitempty"` + + // Role Instance. Null if this counter is not per instance This is returned and should be whichever instance name we desire to be returned i.e. CPU and + // Memory return RDWORKERNAME (LargeDed…IN0) where + // RDWORKERNAME is Machine name below and RoleInstance name in parenthesis + RoleInstance *string `json:"roleInstance,omitempty"` + + // Time at which metric is measured + Timestamp *time.Time `json:"timestamp,omitempty"` + + // Total value of the metric. If multiple measurements are made this will have sum of all. + Total *float64 `json:"total,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type DiagnosticMetricSample. +func (d DiagnosticMetricSample) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "isAggregated", d.IsAggregated) + populate(objectMap, "maximum", d.Maximum) + populate(objectMap, "minimum", d.Minimum) + populate(objectMap, "roleInstance", d.RoleInstance) + populateTimeRFC3339(objectMap, "timestamp", d.Timestamp) + populate(objectMap, "total", d.Total) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DiagnosticMetricSample. +func (d *DiagnosticMetricSample) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "isAggregated": + err = unpopulate(val, &d.IsAggregated) + delete(rawMsg, key) + case "maximum": + err = unpopulate(val, &d.Maximum) + delete(rawMsg, key) + case "minimum": + err = unpopulate(val, &d.Minimum) + delete(rawMsg, key) + case "roleInstance": + err = unpopulate(val, &d.RoleInstance) + delete(rawMsg, key) + case "timestamp": + err = unpopulateTimeRFC3339(val, &d.Timestamp) + delete(rawMsg, key) + case "total": + err = unpopulate(val, &d.Total) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// DiagnosticMetricSet - Class representing Diagnostic Metric information +type DiagnosticMetricSet struct { + // End time of the period + EndTime *time.Time `json:"endTime,omitempty"` + + // Name of the metric + Name *string `json:"name,omitempty"` + + // Start time of the period + StartTime *time.Time `json:"startTime,omitempty"` + + // Presented time grain. Supported grains at the moment are PT1M, PT1H, P1D + TimeGrain *string `json:"timeGrain,omitempty"` + + // Metric's unit + Unit *string `json:"unit,omitempty"` + + // Collection of metric values for the selected period based on the {Microsoft.Web.Hosting.Administration.DiagnosticMetricSet.TimeGrain} + Values []*DiagnosticMetricSample `json:"values,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type DiagnosticMetricSet. +func (d DiagnosticMetricSet) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populateTimeRFC3339(objectMap, "endTime", d.EndTime) + populate(objectMap, "name", d.Name) + populateTimeRFC3339(objectMap, "startTime", d.StartTime) + populate(objectMap, "timeGrain", d.TimeGrain) + populate(objectMap, "unit", d.Unit) + populate(objectMap, "values", d.Values) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DiagnosticMetricSet. +func (d *DiagnosticMetricSet) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "endTime": + err = unpopulateTimeRFC3339(val, &d.EndTime) + delete(rawMsg, key) + case "name": + err = unpopulate(val, &d.Name) + delete(rawMsg, key) + case "startTime": + err = unpopulateTimeRFC3339(val, &d.StartTime) + delete(rawMsg, key) + case "timeGrain": + err = unpopulate(val, &d.TimeGrain) + delete(rawMsg, key) + case "unit": + err = unpopulate(val, &d.Unit) + delete(rawMsg, key) + case "values": + err = unpopulate(val, &d.Values) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// DiagnosticsExecuteSiteAnalysisOptions contains the optional parameters for the Diagnostics.ExecuteSiteAnalysis method. +type DiagnosticsExecuteSiteAnalysisOptions struct { + // End Time + EndTime *time.Time + // Start Time + StartTime *time.Time + // Time Grain + TimeGrain *string +} + +// DiagnosticsExecuteSiteAnalysisSlotOptions contains the optional parameters for the Diagnostics.ExecuteSiteAnalysisSlot method. +type DiagnosticsExecuteSiteAnalysisSlotOptions struct { + // End Time + EndTime *time.Time + // Start Time + StartTime *time.Time + // Time Grain + TimeGrain *string +} + +// DiagnosticsExecuteSiteDetectorOptions contains the optional parameters for the Diagnostics.ExecuteSiteDetector method. +type DiagnosticsExecuteSiteDetectorOptions struct { + // End Time + EndTime *time.Time + // Start Time + StartTime *time.Time + // Time Grain + TimeGrain *string +} + +// DiagnosticsExecuteSiteDetectorSlotOptions contains the optional parameters for the Diagnostics.ExecuteSiteDetectorSlot method. +type DiagnosticsExecuteSiteDetectorSlotOptions struct { + // End Time + EndTime *time.Time + // Start Time + StartTime *time.Time + // Time Grain + TimeGrain *string +} + +// DiagnosticsGetHostingEnvironmentDetectorResponseOptions contains the optional parameters for the Diagnostics.GetHostingEnvironmentDetectorResponse method. +type DiagnosticsGetHostingEnvironmentDetectorResponseOptions struct { + // End Time + EndTime *time.Time + // Start Time + StartTime *time.Time + // Time Grain + TimeGrain *string +} + +// DiagnosticsGetSiteAnalysisOptions contains the optional parameters for the Diagnostics.GetSiteAnalysis method. +type DiagnosticsGetSiteAnalysisOptions struct { + // placeholder for future optional parameters +} + +// DiagnosticsGetSiteAnalysisSlotOptions contains the optional parameters for the Diagnostics.GetSiteAnalysisSlot method. +type DiagnosticsGetSiteAnalysisSlotOptions struct { + // placeholder for future optional parameters +} + +// DiagnosticsGetSiteDetectorOptions contains the optional parameters for the Diagnostics.GetSiteDetector method. +type DiagnosticsGetSiteDetectorOptions struct { + // placeholder for future optional parameters +} + +// DiagnosticsGetSiteDetectorResponseOptions contains the optional parameters for the Diagnostics.GetSiteDetectorResponse method. +type DiagnosticsGetSiteDetectorResponseOptions struct { + // End Time + EndTime *time.Time + // Start Time + StartTime *time.Time + // Time Grain + TimeGrain *string +} + +// DiagnosticsGetSiteDetectorResponseSlotOptions contains the optional parameters for the Diagnostics.GetSiteDetectorResponseSlot method. +type DiagnosticsGetSiteDetectorResponseSlotOptions struct { + // End Time + EndTime *time.Time + // Start Time + StartTime *time.Time + // Time Grain + TimeGrain *string +} + +// DiagnosticsGetSiteDetectorSlotOptions contains the optional parameters for the Diagnostics.GetSiteDetectorSlot method. +type DiagnosticsGetSiteDetectorSlotOptions struct { + // placeholder for future optional parameters +} + +// DiagnosticsGetSiteDiagnosticCategoryOptions contains the optional parameters for the Diagnostics.GetSiteDiagnosticCategory method. +type DiagnosticsGetSiteDiagnosticCategoryOptions struct { + // placeholder for future optional parameters +} + +// DiagnosticsGetSiteDiagnosticCategorySlotOptions contains the optional parameters for the Diagnostics.GetSiteDiagnosticCategorySlot method. +type DiagnosticsGetSiteDiagnosticCategorySlotOptions struct { + // placeholder for future optional parameters +} + +// DiagnosticsListHostingEnvironmentDetectorResponsesOptions contains the optional parameters for the Diagnostics.ListHostingEnvironmentDetectorResponses +// method. +type DiagnosticsListHostingEnvironmentDetectorResponsesOptions struct { + // placeholder for future optional parameters +} + +// DiagnosticsListSiteAnalysesOptions contains the optional parameters for the Diagnostics.ListSiteAnalyses method. +type DiagnosticsListSiteAnalysesOptions struct { + // placeholder for future optional parameters +} + +// DiagnosticsListSiteAnalysesSlotOptions contains the optional parameters for the Diagnostics.ListSiteAnalysesSlot method. +type DiagnosticsListSiteAnalysesSlotOptions struct { + // placeholder for future optional parameters +} + +// DiagnosticsListSiteDetectorResponsesOptions contains the optional parameters for the Diagnostics.ListSiteDetectorResponses method. +type DiagnosticsListSiteDetectorResponsesOptions struct { + // placeholder for future optional parameters +} + +// DiagnosticsListSiteDetectorResponsesSlotOptions contains the optional parameters for the Diagnostics.ListSiteDetectorResponsesSlot method. +type DiagnosticsListSiteDetectorResponsesSlotOptions struct { + // placeholder for future optional parameters +} + +// DiagnosticsListSiteDetectorsOptions contains the optional parameters for the Diagnostics.ListSiteDetectors method. +type DiagnosticsListSiteDetectorsOptions struct { + // placeholder for future optional parameters +} + +// DiagnosticsListSiteDetectorsSlotOptions contains the optional parameters for the Diagnostics.ListSiteDetectorsSlot method. +type DiagnosticsListSiteDetectorsSlotOptions struct { + // placeholder for future optional parameters +} + +// DiagnosticsListSiteDiagnosticCategoriesOptions contains the optional parameters for the Diagnostics.ListSiteDiagnosticCategories method. +type DiagnosticsListSiteDiagnosticCategoriesOptions struct { + // placeholder for future optional parameters +} + +// DiagnosticsListSiteDiagnosticCategoriesSlotOptions contains the optional parameters for the Diagnostics.ListSiteDiagnosticCategoriesSlot method. +type DiagnosticsListSiteDiagnosticCategoriesSlotOptions struct { + // placeholder for future optional parameters +} + +// Dimension of a resource metric. For e.g. instance specific HTTP requests for a web app, where instance name is dimension of the metric HTTP request +type Dimension struct { + DisplayName *string `json:"displayName,omitempty"` + InternalName *string `json:"internalName,omitempty"` + Name *string `json:"name,omitempty"` + ToBeExportedForShoebox *bool `json:"toBeExportedForShoebox,omitempty"` +} + +// Domain - Information about a domain. +type Domain struct { + Resource + // Domain resource specific properties + Properties *DomainProperties `json:"properties,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type Domain. +func (d Domain) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + d.Resource.marshalInternal(objectMap) + populate(objectMap, "properties", d.Properties) + return json.Marshal(objectMap) +} + +// DomainAvailabilityCheckResult - Domain availability check result. +type DomainAvailabilityCheckResult struct { + // true if domain can be purchased using CreateDomain API; otherwise, false. + Available *bool `json:"available,omitempty"` + + // Valid values are Regular domain: Azure will charge the full price of domain registration, SoftDeleted: Purchasing this domain will simply restore it + // and this operation will not cost anything. + DomainType *DomainType `json:"domainType,omitempty"` + + // Name of the domain. + Name *string `json:"name,omitempty"` +} + +// DomainCollection - Collection of domains. +type DomainCollection struct { + // REQUIRED; Collection of resources. + Value []*Domain `json:"value,omitempty"` + + // READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type DomainCollection. +func (d DomainCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", d.NextLink) + populate(objectMap, "value", d.Value) + return json.Marshal(objectMap) +} + +// DomainControlCenterSsoRequest - Single sign-on request information for domain management. +type DomainControlCenterSsoRequest struct { + // READ-ONLY; Post parameter key. + PostParameterKey *string `json:"postParameterKey,omitempty" azure:"ro"` + + // READ-ONLY; Post parameter value. Client should use 'application/x-www-form-urlencoded' encoding for this value. + PostParameterValue *string `json:"postParameterValue,omitempty" azure:"ro"` + + // READ-ONLY; URL where the single sign-on request is to be made. + URL *string `json:"url,omitempty" azure:"ro"` +} + +// DomainOwnershipIdentifier - Domain ownership Identifier. +type DomainOwnershipIdentifier struct { + ProxyOnlyResource + // DomainOwnershipIdentifier resource specific properties + Properties *DomainOwnershipIdentifierProperties `json:"properties,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type DomainOwnershipIdentifier. +func (d DomainOwnershipIdentifier) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + d.ProxyOnlyResource.marshalInternal(objectMap) + populate(objectMap, "properties", d.Properties) + return json.Marshal(objectMap) +} + +// DomainOwnershipIdentifierCollection - Collection of domain ownership identifiers. +type DomainOwnershipIdentifierCollection struct { + // REQUIRED; Collection of resources. + Value []*DomainOwnershipIdentifier `json:"value,omitempty"` + + // READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type DomainOwnershipIdentifierCollection. +func (d DomainOwnershipIdentifierCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", d.NextLink) + populate(objectMap, "value", d.Value) + return json.Marshal(objectMap) +} + +// DomainOwnershipIdentifierProperties - DomainOwnershipIdentifier resource specific properties +type DomainOwnershipIdentifierProperties struct { + // Ownership Id. + OwnershipID *string `json:"ownershipId,omitempty"` +} + +// DomainPatchResource - ARM resource for a domain. +type DomainPatchResource struct { + ProxyOnlyResource + // DomainPatchResource resource specific properties + Properties *DomainPatchResourceProperties `json:"properties,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type DomainPatchResource. +func (d DomainPatchResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + d.ProxyOnlyResource.marshalInternal(objectMap) + populate(objectMap, "properties", d.Properties) + return json.Marshal(objectMap) +} + +// DomainPatchResourceProperties - DomainPatchResource resource specific properties +type DomainPatchResourceProperties struct { + // REQUIRED; Legal agreement consent. + Consent *DomainPurchaseConsent `json:"consent,omitempty"` + + // REQUIRED; Administrative contact. + ContactAdmin *Contact `json:"contactAdmin,omitempty"` + + // REQUIRED; Billing contact. + ContactBilling *Contact `json:"contactBilling,omitempty"` + + // REQUIRED; Registrant contact. + ContactRegistrant *Contact `json:"contactRegistrant,omitempty"` + + // REQUIRED; Technical contact. + ContactTech *Contact `json:"contactTech,omitempty"` + AuthCode *string `json:"authCode,omitempty"` + + // true if the domain should be automatically renewed; otherwise, false. + AutoRenew *bool `json:"autoRenew,omitempty"` + + // Current DNS type + DNSType *DNSType `json:"dnsType,omitempty"` + + // Azure DNS Zone to use + DNSZoneID *string `json:"dnsZoneId,omitempty"` + + // true if domain privacy is enabled for this domain; otherwise, false. + Privacy *bool `json:"privacy,omitempty"` + + // Target DNS type (would be used for migration) + TargetDNSType *DNSType `json:"targetDnsType,omitempty"` + + // READ-ONLY; Domain creation timestamp. + CreatedTime *time.Time `json:"createdTime,omitempty" azure:"ro"` + + // READ-ONLY; Reasons why domain is not renewable. + DomainNotRenewableReasons []*DomainPatchResourcePropertiesDomainNotRenewableReasonsItem `json:"domainNotRenewableReasons,omitempty" azure:"ro"` + + // READ-ONLY; Domain expiration timestamp. + ExpirationTime *time.Time `json:"expirationTime,omitempty" azure:"ro"` + + // READ-ONLY; Timestamp when the domain was renewed last time. + LastRenewedTime *time.Time `json:"lastRenewedTime,omitempty" azure:"ro"` + + // READ-ONLY; All hostnames derived from the domain and assigned to Azure resources. + ManagedHostNames []*HostName `json:"managedHostNames,omitempty" azure:"ro"` + + // READ-ONLY; Name servers. + NameServers []*string `json:"nameServers,omitempty" azure:"ro"` + + // READ-ONLY; Domain provisioning state. + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` + + // READ-ONLY; true if Azure can assign this domain to App Service apps; otherwise, false. This value will be true if domain registration status is active + // and it is hosted on name servers Azure has programmatic + // access to. + ReadyForDNSRecordManagement *bool `json:"readyForDnsRecordManagement,omitempty" azure:"ro"` + + // READ-ONLY; Domain registration status. + RegistrationStatus *DomainStatus `json:"registrationStatus,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type DomainPatchResourceProperties. +func (d DomainPatchResourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "authCode", d.AuthCode) + populate(objectMap, "autoRenew", d.AutoRenew) + populate(objectMap, "consent", d.Consent) + populate(objectMap, "contactAdmin", d.ContactAdmin) + populate(objectMap, "contactBilling", d.ContactBilling) + populate(objectMap, "contactRegistrant", d.ContactRegistrant) + populate(objectMap, "contactTech", d.ContactTech) + populateTimeRFC3339(objectMap, "createdTime", d.CreatedTime) + populate(objectMap, "dnsType", d.DNSType) + populate(objectMap, "dnsZoneId", d.DNSZoneID) + populate(objectMap, "domainNotRenewableReasons", d.DomainNotRenewableReasons) + populateTimeRFC3339(objectMap, "expirationTime", d.ExpirationTime) + populateTimeRFC3339(objectMap, "lastRenewedTime", d.LastRenewedTime) + populate(objectMap, "managedHostNames", d.ManagedHostNames) + populate(objectMap, "nameServers", d.NameServers) + populate(objectMap, "privacy", d.Privacy) + populate(objectMap, "provisioningState", d.ProvisioningState) + populate(objectMap, "readyForDnsRecordManagement", d.ReadyForDNSRecordManagement) + populate(objectMap, "registrationStatus", d.RegistrationStatus) + populate(objectMap, "targetDnsType", d.TargetDNSType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DomainPatchResourceProperties. +func (d *DomainPatchResourceProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "authCode": + err = unpopulate(val, &d.AuthCode) + delete(rawMsg, key) + case "autoRenew": + err = unpopulate(val, &d.AutoRenew) + delete(rawMsg, key) + case "consent": + err = unpopulate(val, &d.Consent) + delete(rawMsg, key) + case "contactAdmin": + err = unpopulate(val, &d.ContactAdmin) + delete(rawMsg, key) + case "contactBilling": + err = unpopulate(val, &d.ContactBilling) + delete(rawMsg, key) + case "contactRegistrant": + err = unpopulate(val, &d.ContactRegistrant) + delete(rawMsg, key) + case "contactTech": + err = unpopulate(val, &d.ContactTech) + delete(rawMsg, key) + case "createdTime": + err = unpopulateTimeRFC3339(val, &d.CreatedTime) + delete(rawMsg, key) + case "dnsType": + err = unpopulate(val, &d.DNSType) + delete(rawMsg, key) + case "dnsZoneId": + err = unpopulate(val, &d.DNSZoneID) + delete(rawMsg, key) + case "domainNotRenewableReasons": + err = unpopulate(val, &d.DomainNotRenewableReasons) + delete(rawMsg, key) + case "expirationTime": + err = unpopulateTimeRFC3339(val, &d.ExpirationTime) + delete(rawMsg, key) + case "lastRenewedTime": + err = unpopulateTimeRFC3339(val, &d.LastRenewedTime) + delete(rawMsg, key) + case "managedHostNames": + err = unpopulate(val, &d.ManagedHostNames) + delete(rawMsg, key) + case "nameServers": + err = unpopulate(val, &d.NameServers) + delete(rawMsg, key) + case "privacy": + err = unpopulate(val, &d.Privacy) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, &d.ProvisioningState) + delete(rawMsg, key) + case "readyForDnsRecordManagement": + err = unpopulate(val, &d.ReadyForDNSRecordManagement) + delete(rawMsg, key) + case "registrationStatus": + err = unpopulate(val, &d.RegistrationStatus) + delete(rawMsg, key) + case "targetDnsType": + err = unpopulate(val, &d.TargetDNSType) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// DomainProperties - Domain resource specific properties +type DomainProperties struct { + // REQUIRED; Legal agreement consent. + Consent *DomainPurchaseConsent `json:"consent,omitempty"` + + // REQUIRED; Administrative contact. + ContactAdmin *Contact `json:"contactAdmin,omitempty"` + + // REQUIRED; Billing contact. + ContactBilling *Contact `json:"contactBilling,omitempty"` + + // REQUIRED; Registrant contact. + ContactRegistrant *Contact `json:"contactRegistrant,omitempty"` + + // REQUIRED; Technical contact. + ContactTech *Contact `json:"contactTech,omitempty"` + AuthCode *string `json:"authCode,omitempty"` + + // true if the domain should be automatically renewed; otherwise, false. + AutoRenew *bool `json:"autoRenew,omitempty"` + + // Current DNS type + DNSType *DNSType `json:"dnsType,omitempty"` + + // Azure DNS Zone to use + DNSZoneID *string `json:"dnsZoneId,omitempty"` + + // true if domain privacy is enabled for this domain; otherwise, false. + Privacy *bool `json:"privacy,omitempty"` + + // Target DNS type (would be used for migration) + TargetDNSType *DNSType `json:"targetDnsType,omitempty"` + + // READ-ONLY; Domain creation timestamp. + CreatedTime *time.Time `json:"createdTime,omitempty" azure:"ro"` + + // READ-ONLY; Reasons why domain is not renewable. + DomainNotRenewableReasons []*DomainPropertiesDomainNotRenewableReasonsItem `json:"domainNotRenewableReasons,omitempty" azure:"ro"` + + // READ-ONLY; Domain expiration timestamp. + ExpirationTime *time.Time `json:"expirationTime,omitempty" azure:"ro"` + + // READ-ONLY; Timestamp when the domain was renewed last time. + LastRenewedTime *time.Time `json:"lastRenewedTime,omitempty" azure:"ro"` + + // READ-ONLY; All hostnames derived from the domain and assigned to Azure resources. + ManagedHostNames []*HostName `json:"managedHostNames,omitempty" azure:"ro"` + + // READ-ONLY; Name servers. + NameServers []*string `json:"nameServers,omitempty" azure:"ro"` + + // READ-ONLY; Domain provisioning state. + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` + + // READ-ONLY; true if Azure can assign this domain to App Service apps; otherwise, false. This value will be true if domain registration status is active + // and it is hosted on name servers Azure has programmatic + // access to. + ReadyForDNSRecordManagement *bool `json:"readyForDnsRecordManagement,omitempty" azure:"ro"` + + // READ-ONLY; Domain registration status. + RegistrationStatus *DomainStatus `json:"registrationStatus,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type DomainProperties. +func (d DomainProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "authCode", d.AuthCode) + populate(objectMap, "autoRenew", d.AutoRenew) + populate(objectMap, "consent", d.Consent) + populate(objectMap, "contactAdmin", d.ContactAdmin) + populate(objectMap, "contactBilling", d.ContactBilling) + populate(objectMap, "contactRegistrant", d.ContactRegistrant) + populate(objectMap, "contactTech", d.ContactTech) + populateTimeRFC3339(objectMap, "createdTime", d.CreatedTime) + populate(objectMap, "dnsType", d.DNSType) + populate(objectMap, "dnsZoneId", d.DNSZoneID) + populate(objectMap, "domainNotRenewableReasons", d.DomainNotRenewableReasons) + populateTimeRFC3339(objectMap, "expirationTime", d.ExpirationTime) + populateTimeRFC3339(objectMap, "lastRenewedTime", d.LastRenewedTime) + populate(objectMap, "managedHostNames", d.ManagedHostNames) + populate(objectMap, "nameServers", d.NameServers) + populate(objectMap, "privacy", d.Privacy) + populate(objectMap, "provisioningState", d.ProvisioningState) + populate(objectMap, "readyForDnsRecordManagement", d.ReadyForDNSRecordManagement) + populate(objectMap, "registrationStatus", d.RegistrationStatus) + populate(objectMap, "targetDnsType", d.TargetDNSType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DomainProperties. +func (d *DomainProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "authCode": + err = unpopulate(val, &d.AuthCode) + delete(rawMsg, key) + case "autoRenew": + err = unpopulate(val, &d.AutoRenew) + delete(rawMsg, key) + case "consent": + err = unpopulate(val, &d.Consent) + delete(rawMsg, key) + case "contactAdmin": + err = unpopulate(val, &d.ContactAdmin) + delete(rawMsg, key) + case "contactBilling": + err = unpopulate(val, &d.ContactBilling) + delete(rawMsg, key) + case "contactRegistrant": + err = unpopulate(val, &d.ContactRegistrant) + delete(rawMsg, key) + case "contactTech": + err = unpopulate(val, &d.ContactTech) + delete(rawMsg, key) + case "createdTime": + err = unpopulateTimeRFC3339(val, &d.CreatedTime) + delete(rawMsg, key) + case "dnsType": + err = unpopulate(val, &d.DNSType) + delete(rawMsg, key) + case "dnsZoneId": + err = unpopulate(val, &d.DNSZoneID) + delete(rawMsg, key) + case "domainNotRenewableReasons": + err = unpopulate(val, &d.DomainNotRenewableReasons) + delete(rawMsg, key) + case "expirationTime": + err = unpopulateTimeRFC3339(val, &d.ExpirationTime) + delete(rawMsg, key) + case "lastRenewedTime": + err = unpopulateTimeRFC3339(val, &d.LastRenewedTime) + delete(rawMsg, key) + case "managedHostNames": + err = unpopulate(val, &d.ManagedHostNames) + delete(rawMsg, key) + case "nameServers": + err = unpopulate(val, &d.NameServers) + delete(rawMsg, key) + case "privacy": + err = unpopulate(val, &d.Privacy) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, &d.ProvisioningState) + delete(rawMsg, key) + case "readyForDnsRecordManagement": + err = unpopulate(val, &d.ReadyForDNSRecordManagement) + delete(rawMsg, key) + case "registrationStatus": + err = unpopulate(val, &d.RegistrationStatus) + delete(rawMsg, key) + case "targetDnsType": + err = unpopulate(val, &d.TargetDNSType) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// DomainPurchaseConsent - Domain purchase consent object, representing acceptance of applicable legal agreements. +type DomainPurchaseConsent struct { + // Timestamp when the agreements were accepted. + AgreedAt *time.Time `json:"agreedAt,omitempty"` + + // Client IP address. + AgreedBy *string `json:"agreedBy,omitempty"` + + // List of applicable legal agreement keys. This list can be retrieved using ListLegalAgreements API under TopLevelDomain resource. + AgreementKeys []*string `json:"agreementKeys,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type DomainPurchaseConsent. +func (d DomainPurchaseConsent) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populateTimeRFC3339(objectMap, "agreedAt", d.AgreedAt) + populate(objectMap, "agreedBy", d.AgreedBy) + populate(objectMap, "agreementKeys", d.AgreementKeys) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DomainPurchaseConsent. +func (d *DomainPurchaseConsent) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "agreedAt": + err = unpopulateTimeRFC3339(val, &d.AgreedAt) + delete(rawMsg, key) + case "agreedBy": + err = unpopulate(val, &d.AgreedBy) + delete(rawMsg, key) + case "agreementKeys": + err = unpopulate(val, &d.AgreementKeys) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// DomainRecommendationSearchParameters - Domain recommendation search parameters. +type DomainRecommendationSearchParameters struct { + // Keywords to be used for generating domain recommendations. + Keywords *string `json:"keywords,omitempty"` + + // Maximum number of recommendations. + MaxDomainRecommendations *int32 `json:"maxDomainRecommendations,omitempty"` +} + +// DomainRegistrationProviderListOperationsOptions contains the optional parameters for the DomainRegistrationProvider.ListOperations method. +type DomainRegistrationProviderListOperationsOptions struct { + // placeholder for future optional parameters +} + +// DomainsBeginCreateOrUpdateOptions contains the optional parameters for the Domains.BeginCreateOrUpdate method. +type DomainsBeginCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// DomainsCheckAvailabilityOptions contains the optional parameters for the Domains.CheckAvailability method. +type DomainsCheckAvailabilityOptions struct { + // placeholder for future optional parameters +} + +// DomainsCreateOrUpdateOwnershipIdentifierOptions contains the optional parameters for the Domains.CreateOrUpdateOwnershipIdentifier method. +type DomainsCreateOrUpdateOwnershipIdentifierOptions struct { + // placeholder for future optional parameters +} + +// DomainsDeleteOptions contains the optional parameters for the Domains.Delete method. +type DomainsDeleteOptions struct { + // Specify true to delete the domain immediately. The default is false which deletes the domain after 24 hours. + ForceHardDeleteDomain *bool +} + +// DomainsDeleteOwnershipIdentifierOptions contains the optional parameters for the Domains.DeleteOwnershipIdentifier method. +type DomainsDeleteOwnershipIdentifierOptions struct { + // placeholder for future optional parameters +} + +// DomainsGetControlCenterSsoRequestOptions contains the optional parameters for the Domains.GetControlCenterSsoRequest method. +type DomainsGetControlCenterSsoRequestOptions struct { + // placeholder for future optional parameters +} + +// DomainsGetOptions contains the optional parameters for the Domains.Get method. +type DomainsGetOptions struct { + // placeholder for future optional parameters +} + +// DomainsGetOwnershipIdentifierOptions contains the optional parameters for the Domains.GetOwnershipIdentifier method. +type DomainsGetOwnershipIdentifierOptions struct { + // placeholder for future optional parameters +} + +// DomainsListByResourceGroupOptions contains the optional parameters for the Domains.ListByResourceGroup method. +type DomainsListByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// DomainsListOptions contains the optional parameters for the Domains.List method. +type DomainsListOptions struct { + // placeholder for future optional parameters +} + +// DomainsListOwnershipIdentifiersOptions contains the optional parameters for the Domains.ListOwnershipIdentifiers method. +type DomainsListOwnershipIdentifiersOptions struct { + // placeholder for future optional parameters +} + +// DomainsListRecommendationsOptions contains the optional parameters for the Domains.ListRecommendations method. +type DomainsListRecommendationsOptions struct { + // placeholder for future optional parameters +} + +// DomainsRenewOptions contains the optional parameters for the Domains.Renew method. +type DomainsRenewOptions struct { + // placeholder for future optional parameters +} + +// DomainsUpdateOptions contains the optional parameters for the Domains.Update method. +type DomainsUpdateOptions struct { + // placeholder for future optional parameters +} + +// DomainsUpdateOwnershipIdentifierOptions contains the optional parameters for the Domains.UpdateOwnershipIdentifier method. +type DomainsUpdateOwnershipIdentifierOptions struct { + // placeholder for future optional parameters +} + +// EnabledConfig - Enabled configuration. +type EnabledConfig struct { + // True if configuration is enabled, false if it is disabled and null if configuration is not set. + Enabled *bool `json:"enabled,omitempty"` +} + +// EndpointDependency - A domain name that a service is reached at, including details of the current connection status. +type EndpointDependency struct { + // The domain name of the dependency. + DomainName *string `json:"domainName,omitempty"` + + // The IP Addresses and Ports used when connecting to DomainName. + EndpointDetails []*EndpointDetail `json:"endpointDetails,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type EndpointDependency. +func (e EndpointDependency) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "domainName", e.DomainName) + populate(objectMap, "endpointDetails", e.EndpointDetails) + return json.Marshal(objectMap) +} + +// EndpointDetail - Current TCP connectivity information from the App Service Environment to a single endpoint. +type EndpointDetail struct { + // An IP Address that Domain Name currently resolves to. + IPAddress *string `json:"ipAddress,omitempty"` + + // Whether it is possible to create a TCP connection from the App Service Environment to this IpAddress at this Port. + IsAccessible *bool `json:"isAccessible,omitempty"` + + // The time in milliseconds it takes for a TCP connection to be created from the App Service Environment to this IpAddress at this Port. + Latency *float64 `json:"latency,omitempty"` + + // The port an endpoint is connected to. + Port *int32 `json:"port,omitempty"` +} + +// ErrorEntity - Body of the error response returned from the API. +type ErrorEntity struct { + // Basic error code. + Code *string `json:"code,omitempty"` + + // Error Details. + Details []*ErrorEntity `json:"details,omitempty"` + + // Type of error. + ExtendedCode *string `json:"extendedCode,omitempty"` + + // Inner errors. + InnerErrors []*ErrorEntity `json:"innerErrors,omitempty"` + + // Any details of the error. + Message *string `json:"message,omitempty"` + + // Message template. + MessageTemplate *string `json:"messageTemplate,omitempty"` + + // Parameters for the template. + Parameters []*string `json:"parameters,omitempty"` + + // The error target. + Target *string `json:"target,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type ErrorEntity. +func (e ErrorEntity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "code", e.Code) + populate(objectMap, "details", e.Details) + populate(objectMap, "extendedCode", e.ExtendedCode) + populate(objectMap, "innerErrors", e.InnerErrors) + populate(objectMap, "message", e.Message) + populate(objectMap, "messageTemplate", e.MessageTemplate) + populate(objectMap, "parameters", e.Parameters) + populate(objectMap, "target", e.Target) + return json.Marshal(objectMap) +} + +// Experiments - Routing rules in production experiments. +type Experiments struct { + // List of ramp-up rules. + RampUpRules []*RampUpRule `json:"rampUpRules,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type Experiments. +func (e Experiments) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "rampUpRules", e.RampUpRules) + return json.Marshal(objectMap) +} + +// ExtendedLocation - Extended Location. +type ExtendedLocation struct { + // Name of extended location. + Name *string `json:"name,omitempty"` + + // READ-ONLY; Type of extended location. + Type *string `json:"type,omitempty" azure:"ro"` +} + +// Facebook - The configuration settings of the Facebook provider. +type Facebook struct { + // false if the Facebook provider should not be enabled despite the set registration; otherwise, true. + Enabled *bool `json:"enabled,omitempty"` + + // The version of the Facebook api to be used while logging in. + GraphAPIVersion *string `json:"graphApiVersion,omitempty"` + + // The configuration settings of the login flow. + Login *LoginScopes `json:"login,omitempty"` + + // The configuration settings of the app registration for the Facebook provider. + Registration *AppRegistration `json:"registration,omitempty"` +} + +// FileSystemApplicationLogsConfig - Application logs to file system configuration. +type FileSystemApplicationLogsConfig struct { + // Log level. + Level *LogLevel `json:"level,omitempty"` +} + +// FileSystemHTTPLogsConfig - Http logs to file system configuration. +type FileSystemHTTPLogsConfig struct { + // True if configuration is enabled, false if it is disabled and null if configuration is not set. + Enabled *bool `json:"enabled,omitempty"` + + // Retention in days. Remove files older than X days. 0 or lower means no retention. + RetentionInDays *int32 `json:"retentionInDays,omitempty"` + + // Maximum size in megabytes that http log files can use. When reached old log files will be removed to make space for new ones. Value can range between + // 25 and 100. + RetentionInMb *int32 `json:"retentionInMb,omitempty"` +} + +// FileSystemTokenStore - The configuration settings of the storage of the tokens if a file system is used. +type FileSystemTokenStore struct { + // The directory in which the tokens will be stored. + Directory *string `json:"directory,omitempty"` +} + +// ForwardProxy - The configuration settings of a forward proxy used to make the requests. +type ForwardProxy struct { + // The convention used to determine the url of the request made. + Convention *ForwardProxyConvention `json:"convention,omitempty"` + + // The name of the header containing the host of the request. + CustomHostHeaderName *string `json:"customHostHeaderName,omitempty"` + + // The name of the header containing the scheme of the request. + CustomProtoHeaderName *string `json:"customProtoHeaderName,omitempty"` +} + +type FrontEndConfiguration struct { + Kind *FrontEndServiceType `json:"kind,omitempty"` +} + +// FunctionAppMajorVersion - Function App stack major version. +type FunctionAppMajorVersion struct { + // READ-ONLY; Function App stack major version (display only). + DisplayText *string `json:"displayText,omitempty" azure:"ro"` + + // READ-ONLY; Minor versions associated with the major version. + MinorVersions []*FunctionAppMinorVersion `json:"minorVersions,omitempty" azure:"ro"` + + // READ-ONLY; Function App stack major version name. + Value *string `json:"value,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type FunctionAppMajorVersion. +func (f FunctionAppMajorVersion) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "displayText", f.DisplayText) + populate(objectMap, "minorVersions", f.MinorVersions) + populate(objectMap, "value", f.Value) + return json.Marshal(objectMap) +} + +// FunctionAppMinorVersion - Function App stack minor version. +type FunctionAppMinorVersion struct { + // READ-ONLY; Function App stack (display only). + DisplayText *string `json:"displayText,omitempty" azure:"ro"` + + // READ-ONLY; Settings associated with the minor version. + StackSettings *FunctionAppRuntimes `json:"stackSettings,omitempty" azure:"ro"` + + // READ-ONLY; Function App stack name. + Value *string `json:"value,omitempty" azure:"ro"` +} + +// FunctionAppRuntimeSettings - Function App runtime settings. +type FunctionAppRuntimeSettings struct { + // READ-ONLY; Application Insights settings associated with the minor version. + AppInsightsSettings *AppInsightsWebAppStackSettings `json:"appInsightsSettings,omitempty" azure:"ro"` + + // READ-ONLY; Application settings associated with the minor version. + AppSettingsDictionary map[string]*string `json:"appSettingsDictionary,omitempty" azure:"ro"` + + // READ-ONLY; End-of-life date for the minor version. + EndOfLifeDate *time.Time `json:"endOfLifeDate,omitempty" azure:"ro"` + + // READ-ONLY; GitHub Actions settings associated with the minor version. + GitHubActionSettings *GitHubActionWebAppStackSettings `json:"gitHubActionSettings,omitempty" azure:"ro"` + + // READ-ONLY; true if the stack version is auto-updated; otherwise, false. + IsAutoUpdate *bool `json:"isAutoUpdate,omitempty" azure:"ro"` + + // READ-ONLY; true if the minor version the default; otherwise, false. + IsDefault *bool `json:"isDefault,omitempty" azure:"ro"` + + // READ-ONLY; true if the stack is deprecated; otherwise, false. + IsDeprecated *bool `json:"isDeprecated,omitempty" azure:"ro"` + + // READ-ONLY; true if the minor version is early-access; otherwise, false. + IsEarlyAccess *bool `json:"isEarlyAccess,omitempty" azure:"ro"` + + // READ-ONLY; true if the stack should be hidden; otherwise, false. + IsHidden *bool `json:"isHidden,omitempty" azure:"ro"` + + // READ-ONLY; true if the stack is in preview; otherwise, false. + IsPreview *bool `json:"isPreview,omitempty" azure:"ro"` + + // READ-ONLY; true if remote debugging is supported for the stack; otherwise, false. + RemoteDebuggingSupported *bool `json:"remoteDebuggingSupported,omitempty" azure:"ro"` + + // READ-ONLY; Function App stack minor version (runtime only). + RuntimeVersion *string `json:"runtimeVersion,omitempty" azure:"ro"` + + // READ-ONLY; Configuration settings associated with the minor version. + SiteConfigPropertiesDictionary *SiteConfigPropertiesDictionary `json:"siteConfigPropertiesDictionary,omitempty" azure:"ro"` + + // READ-ONLY; List of supported Functions extension versions. + SupportedFunctionsExtensionVersions []*string `json:"supportedFunctionsExtensionVersions,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type FunctionAppRuntimeSettings. +func (f FunctionAppRuntimeSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "appInsightsSettings", f.AppInsightsSettings) + populate(objectMap, "appSettingsDictionary", f.AppSettingsDictionary) + populateTimeRFC3339(objectMap, "endOfLifeDate", f.EndOfLifeDate) + populate(objectMap, "gitHubActionSettings", f.GitHubActionSettings) + populate(objectMap, "isAutoUpdate", f.IsAutoUpdate) + populate(objectMap, "isDefault", f.IsDefault) + populate(objectMap, "isDeprecated", f.IsDeprecated) + populate(objectMap, "isEarlyAccess", f.IsEarlyAccess) + populate(objectMap, "isHidden", f.IsHidden) + populate(objectMap, "isPreview", f.IsPreview) + populate(objectMap, "remoteDebuggingSupported", f.RemoteDebuggingSupported) + populate(objectMap, "runtimeVersion", f.RuntimeVersion) + populate(objectMap, "siteConfigPropertiesDictionary", f.SiteConfigPropertiesDictionary) + populate(objectMap, "supportedFunctionsExtensionVersions", f.SupportedFunctionsExtensionVersions) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FunctionAppRuntimeSettings. +func (f *FunctionAppRuntimeSettings) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "appInsightsSettings": + err = unpopulate(val, &f.AppInsightsSettings) + delete(rawMsg, key) + case "appSettingsDictionary": + err = unpopulate(val, &f.AppSettingsDictionary) + delete(rawMsg, key) + case "endOfLifeDate": + err = unpopulateTimeRFC3339(val, &f.EndOfLifeDate) + delete(rawMsg, key) + case "gitHubActionSettings": + err = unpopulate(val, &f.GitHubActionSettings) + delete(rawMsg, key) + case "isAutoUpdate": + err = unpopulate(val, &f.IsAutoUpdate) + delete(rawMsg, key) + case "isDefault": + err = unpopulate(val, &f.IsDefault) + delete(rawMsg, key) + case "isDeprecated": + err = unpopulate(val, &f.IsDeprecated) + delete(rawMsg, key) + case "isEarlyAccess": + err = unpopulate(val, &f.IsEarlyAccess) + delete(rawMsg, key) + case "isHidden": + err = unpopulate(val, &f.IsHidden) + delete(rawMsg, key) + case "isPreview": + err = unpopulate(val, &f.IsPreview) + delete(rawMsg, key) + case "remoteDebuggingSupported": + err = unpopulate(val, &f.RemoteDebuggingSupported) + delete(rawMsg, key) + case "runtimeVersion": + err = unpopulate(val, &f.RuntimeVersion) + delete(rawMsg, key) + case "siteConfigPropertiesDictionary": + err = unpopulate(val, &f.SiteConfigPropertiesDictionary) + delete(rawMsg, key) + case "supportedFunctionsExtensionVersions": + err = unpopulate(val, &f.SupportedFunctionsExtensionVersions) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// FunctionAppRuntimes - Function App stack runtimes. +type FunctionAppRuntimes struct { + // READ-ONLY; Linux-specific settings associated with the minor version. + LinuxRuntimeSettings *FunctionAppRuntimeSettings `json:"linuxRuntimeSettings,omitempty" azure:"ro"` + + // READ-ONLY; Windows-specific settings associated with the minor version. + WindowsRuntimeSettings *FunctionAppRuntimeSettings `json:"windowsRuntimeSettings,omitempty" azure:"ro"` +} + +// FunctionAppStack - Function App Stack. +type FunctionAppStack struct { + ProxyOnlyResource + // FunctionAppStack resource specific properties + Properties *FunctionAppStackProperties `json:"properties,omitempty"` + + // READ-ONLY; Function App stack location. + Location *string `json:"location,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type FunctionAppStack. +func (f FunctionAppStack) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + f.ProxyOnlyResource.marshalInternal(objectMap) + populate(objectMap, "location", f.Location) + populate(objectMap, "properties", f.Properties) + return json.Marshal(objectMap) +} + +// FunctionAppStackCollection - Collection of Function app Stacks +type FunctionAppStackCollection struct { + // REQUIRED; Collection of resources. + Value []*FunctionAppStack `json:"value,omitempty"` + + // READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type FunctionAppStackCollection. +func (f FunctionAppStackCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", f.NextLink) + populate(objectMap, "value", f.Value) + return json.Marshal(objectMap) +} + +// FunctionAppStackProperties - FunctionAppStack resource specific properties +type FunctionAppStackProperties struct { + // READ-ONLY; Function App stack (display only). + DisplayText *string `json:"displayText,omitempty" azure:"ro"` + + // READ-ONLY; List of major versions available. + MajorVersions []*FunctionAppMajorVersion `json:"majorVersions,omitempty" azure:"ro"` + + // READ-ONLY; Function App stack preferred OS. + PreferredOs *StackPreferredOs `json:"preferredOs,omitempty" azure:"ro"` + + // READ-ONLY; Function App stack name. + Value *string `json:"value,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type FunctionAppStackProperties. +func (f FunctionAppStackProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "displayText", f.DisplayText) + populate(objectMap, "majorVersions", f.MajorVersions) + populate(objectMap, "preferredOs", f.PreferredOs) + populate(objectMap, "value", f.Value) + return json.Marshal(objectMap) +} + +// FunctionEnvelope - Function information. +type FunctionEnvelope struct { + ProxyOnlyResource + // FunctionEnvelope resource specific properties + Properties *FunctionEnvelopeProperties `json:"properties,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type FunctionEnvelope. +func (f FunctionEnvelope) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + f.ProxyOnlyResource.marshalInternal(objectMap) + populate(objectMap, "properties", f.Properties) + return json.Marshal(objectMap) +} + +// FunctionEnvelopeCollection - Collection of Kudu function information elements. +type FunctionEnvelopeCollection struct { + // REQUIRED; Collection of resources. + Value []*FunctionEnvelope `json:"value,omitempty"` + + // READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type FunctionEnvelopeCollection. +func (f FunctionEnvelopeCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", f.NextLink) + populate(objectMap, "value", f.Value) + return json.Marshal(objectMap) +} + +// FunctionEnvelopeProperties - FunctionEnvelope resource specific properties +type FunctionEnvelopeProperties struct { + // Config information. + Config map[string]interface{} `json:"config,omitempty"` + + // Config URI. + ConfigHref *string `json:"config_href,omitempty"` + + // File list. + Files map[string]*string `json:"files,omitempty"` + + // Function App ID. + FunctionAppID *string `json:"function_app_id,omitempty"` + + // Function URI. + Href *string `json:"href,omitempty"` + + // The invocation URL + InvokeURLTemplate *string `json:"invoke_url_template,omitempty"` + + // Gets or sets a value indicating whether the function is disabled + IsDisabled *bool `json:"isDisabled,omitempty"` + + // The function language + Language *string `json:"language,omitempty"` + + // Script URI. + ScriptHref *string `json:"script_href,omitempty"` + + // Script root path URI. + ScriptRootPathHref *string `json:"script_root_path_href,omitempty"` + + // Secrets file URI. + SecretsFileHref *string `json:"secrets_file_href,omitempty"` + + // Test data used when testing via the Azure Portal. + TestData *string `json:"test_data,omitempty"` + + // Test data URI. + TestDataHref *string `json:"test_data_href,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type FunctionEnvelopeProperties. +func (f FunctionEnvelopeProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "config", f.Config) + populate(objectMap, "config_href", f.ConfigHref) + populate(objectMap, "files", f.Files) + populate(objectMap, "function_app_id", f.FunctionAppID) + populate(objectMap, "href", f.Href) + populate(objectMap, "invoke_url_template", f.InvokeURLTemplate) + populate(objectMap, "isDisabled", f.IsDisabled) + populate(objectMap, "language", f.Language) + populate(objectMap, "script_href", f.ScriptHref) + populate(objectMap, "script_root_path_href", f.ScriptRootPathHref) + populate(objectMap, "secrets_file_href", f.SecretsFileHref) + populate(objectMap, "test_data", f.TestData) + populate(objectMap, "test_data_href", f.TestDataHref) + return json.Marshal(objectMap) +} + +// FunctionSecrets - Function secrets. +type FunctionSecrets struct { + // Secret key. + Key *string `json:"key,omitempty"` + + // Trigger URL. + TriggerURL *string `json:"trigger_url,omitempty"` +} + +// GeoRegion - Geographical region. +type GeoRegion struct { + ProxyOnlyResource + // GeoRegion resource specific properties + Properties *GeoRegionProperties `json:"properties,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type GeoRegion. +func (g GeoRegion) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + g.ProxyOnlyResource.marshalInternal(objectMap) + populate(objectMap, "properties", g.Properties) + return json.Marshal(objectMap) +} + +// GeoRegionCollection - Collection of geographical regions. +type GeoRegionCollection struct { + // REQUIRED; Collection of resources. + Value []*GeoRegion `json:"value,omitempty"` + + // READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type GeoRegionCollection. +func (g GeoRegionCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", g.NextLink) + populate(objectMap, "value", g.Value) + return json.Marshal(objectMap) +} + +// GeoRegionProperties - GeoRegion resource specific properties +type GeoRegionProperties struct { + // READ-ONLY; Region description. + Description *string `json:"description,omitempty" azure:"ro"` + + // READ-ONLY; Display name for region. + DisplayName *string `json:"displayName,omitempty" azure:"ro"` + + // READ-ONLY; Display name for region. + OrgDomain *string `json:"orgDomain,omitempty" azure:"ro"` +} + +// GitHub - The configuration settings of the GitHub provider. +type GitHub struct { + // false if the GitHub provider should not be enabled despite the set registration; otherwise, true. + Enabled *bool `json:"enabled,omitempty"` + + // The configuration settings of the login flow. + Login *LoginScopes `json:"login,omitempty"` + + // The configuration settings of the app registration for the GitHub provider. + Registration *ClientRegistration `json:"registration,omitempty"` +} + +// GitHubActionCodeConfiguration - The GitHub action code configuration. +type GitHubActionCodeConfiguration struct { + // Runtime stack is used to determine the workflow file content for code base apps. + RuntimeStack *string `json:"runtimeStack,omitempty"` + + // Runtime version is used to determine what build version to set in the workflow file. + RuntimeVersion *string `json:"runtimeVersion,omitempty"` +} + +// GitHubActionConfiguration - The GitHub action configuration. +type GitHubActionConfiguration struct { + // GitHub Action code configuration. + CodeConfiguration *GitHubActionCodeConfiguration `json:"codeConfiguration,omitempty"` + + // GitHub Action container configuration. + ContainerConfiguration *GitHubActionContainerConfiguration `json:"containerConfiguration,omitempty"` + + // Workflow option to determine whether the workflow file should be generated and written to the repository. + GenerateWorkflowFile *bool `json:"generateWorkflowFile,omitempty"` + + // This will help determine the workflow configuration to select. + IsLinux *bool `json:"isLinux,omitempty"` +} + +// GitHubActionContainerConfiguration - The GitHub action container configuration. +type GitHubActionContainerConfiguration struct { + // The image name for the build. + ImageName *string `json:"imageName,omitempty"` + + // The password used to upload the image to the container registry. + Password *string `json:"password,omitempty"` + + // The server URL for the container registry where the build will be hosted. + ServerURL *string `json:"serverUrl,omitempty"` + + // The username used to upload the image to the container registry. + Username *string `json:"username,omitempty"` +} + +// GitHubActionWebAppStackSettings - GitHub Actions Web App stack settings. +type GitHubActionWebAppStackSettings struct { + // READ-ONLY; true if GitHub Actions is supported for the stack; otherwise, false. + IsSupported *bool `json:"isSupported,omitempty" azure:"ro"` + + // READ-ONLY; The minor version that is supported for GitHub Actions. + SupportedVersion *string `json:"supportedVersion,omitempty" azure:"ro"` +} + +// GlobalCsmSKUDescription - A Global SKU Description. +type GlobalCsmSKUDescription struct { + // Capabilities of the SKU, e.g., is traffic manager enabled? + Capabilities []*Capability `json:"capabilities,omitempty"` + + // Min, max, and default scale values of the SKU. + Capacity *SKUCapacity `json:"capacity,omitempty"` + + // Family code of the resource SKU. + Family *string `json:"family,omitempty"` + + // Locations of the SKU. + Locations []*string `json:"locations,omitempty"` + + // Name of the resource SKU. + Name *string `json:"name,omitempty"` + + // Size specifier of the resource SKU. + Size *string `json:"size,omitempty"` + + // Service Tier of the resource SKU. + Tier *string `json:"tier,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type GlobalCsmSKUDescription. +func (g GlobalCsmSKUDescription) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "capabilities", g.Capabilities) + populate(objectMap, "capacity", g.Capacity) + populate(objectMap, "family", g.Family) + populate(objectMap, "locations", g.Locations) + populate(objectMap, "name", g.Name) + populate(objectMap, "size", g.Size) + populate(objectMap, "tier", g.Tier) + return json.Marshal(objectMap) +} + +// GlobalGetDeletedWebAppOptions contains the optional parameters for the Global.GetDeletedWebApp method. +type GlobalGetDeletedWebAppOptions struct { + // placeholder for future optional parameters +} + +// GlobalGetDeletedWebAppSnapshotsOptions contains the optional parameters for the Global.GetDeletedWebAppSnapshots method. +type GlobalGetDeletedWebAppSnapshotsOptions struct { + // placeholder for future optional parameters +} + +// GlobalGetSubscriptionOperationWithAsyncResponseOptions contains the optional parameters for the Global.GetSubscriptionOperationWithAsyncResponse method. +type GlobalGetSubscriptionOperationWithAsyncResponseOptions struct { + // placeholder for future optional parameters +} + +// GlobalValidation - The configuration settings that determines the validation flow of users using App Service Authentication/Authorization. +type GlobalValidation struct { + // The paths for which unauthenticated flow would not be redirected to the login page. + ExcludedPaths []*string `json:"excludedPaths,omitempty"` + + // The default authentication provider to use when multiple providers are configured. This setting is only needed if multiple providers are configured and + // the unauthenticated client action is set to + // "RedirectToLoginPage". + RedirectToProvider *string `json:"redirectToProvider,omitempty"` + + // true if the authentication flow is required any request is made; otherwise, false. + RequireAuthentication *bool `json:"requireAuthentication,omitempty"` + + // The action to take when an unauthenticated client attempts to access the app. + UnauthenticatedClientAction *UnauthenticatedClientActionV2 `json:"unauthenticatedClientAction,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type GlobalValidation. +func (g GlobalValidation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "excludedPaths", g.ExcludedPaths) + populate(objectMap, "redirectToProvider", g.RedirectToProvider) + populate(objectMap, "requireAuthentication", g.RequireAuthentication) + populate(objectMap, "unauthenticatedClientAction", g.UnauthenticatedClientAction) + return json.Marshal(objectMap) +} + +// Google - The configuration settings of the Google provider. +type Google struct { + // false if the Google provider should not be enabled despite the set registration; otherwise, true. + Enabled *bool `json:"enabled,omitempty"` + + // The configuration settings of the login flow. + Login *LoginScopes `json:"login,omitempty"` + + // The configuration settings of the app registration for the Google provider. + Registration *ClientRegistration `json:"registration,omitempty"` + + // The configuration settings of the Azure Active Directory token validation flow. + Validation *AllowedAudiencesValidation `json:"validation,omitempty"` +} + +// HTTPLogsConfig - Http logs configuration. +type HTTPLogsConfig struct { + // Http logs to azure blob storage configuration. + AzureBlobStorage *AzureBlobStorageHTTPLogsConfig `json:"azureBlobStorage,omitempty"` + + // Http logs to file system configuration. + FileSystem *FileSystemHTTPLogsConfig `json:"fileSystem,omitempty"` +} + +// HTTPSettings - The configuration settings of the HTTP requests for authentication and authorization requests made against App Service Authentication/Authorization. +type HTTPSettings struct { + // The configuration settings of a forward proxy used to make the requests. + ForwardProxy *ForwardProxy `json:"forwardProxy,omitempty"` + + // false if the authentication/authorization responses not having the HTTPS scheme are permissible; otherwise, true. + RequireHTTPS *bool `json:"requireHttps,omitempty"` + + // The configuration settings of the paths HTTP requests. + Routes *HTTPSettingsRoutes `json:"routes,omitempty"` +} + +// HTTPSettingsRoutes - The configuration settings of the paths HTTP requests. +type HTTPSettingsRoutes struct { + // The prefix that should precede all the authentication/authorization paths. + APIPrefix *string `json:"apiPrefix,omitempty"` +} + +// HandlerMapping - The IIS handler mappings used to define which handler processes HTTP requests with certain extension. For example, it is used to configure +// php-cgi.exe process to handle all HTTP requests with *.php +// extension. +type HandlerMapping struct { + // Command-line arguments to be passed to the script processor. + Arguments *string `json:"arguments,omitempty"` + + // Requests with this extension will be handled using the specified FastCGI application. + Extension *string `json:"extension,omitempty"` + + // The absolute path to the FastCGI application. + ScriptProcessor *string `json:"scriptProcessor,omitempty"` +} + +// HostKeys - Functions host level keys. +type HostKeys struct { + // Host level function keys. + FunctionKeys map[string]*string `json:"functionKeys,omitempty"` + + // Secret key. + MasterKey *string `json:"masterKey,omitempty"` + + // System keys. + SystemKeys map[string]*string `json:"systemKeys,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type HostKeys. +func (h HostKeys) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "functionKeys", h.FunctionKeys) + populate(objectMap, "masterKey", h.MasterKey) + populate(objectMap, "systemKeys", h.SystemKeys) + return json.Marshal(objectMap) +} + +// HostName - Details of a hostname derived from a domain. +type HostName struct { + // Name of the Azure resource the hostname is assigned to. If it is assigned to a Traffic Manager then it will be the Traffic Manager name otherwise it + // will be the app name. + AzureResourceName *string `json:"azureResourceName,omitempty"` + + // Type of the Azure resource the hostname is assigned to. + AzureResourceType *AzureResourceType `json:"azureResourceType,omitempty"` + + // Type of the DNS record. + CustomHostNameDNSRecordType *CustomHostNameDNSRecordType `json:"customHostNameDnsRecordType,omitempty"` + + // Type of the hostname. + HostNameType *HostNameType `json:"hostNameType,omitempty"` + + // Name of the hostname. + Name *string `json:"name,omitempty"` + + // List of apps the hostname is assigned to. This list will have more than one app only if the hostname is pointing to a Traffic Manager. + SiteNames []*string `json:"siteNames,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type HostName. +func (h HostName) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "azureResourceName", h.AzureResourceName) + populate(objectMap, "azureResourceType", h.AzureResourceType) + populate(objectMap, "customHostNameDnsRecordType", h.CustomHostNameDNSRecordType) + populate(objectMap, "hostNameType", h.HostNameType) + populate(objectMap, "name", h.Name) + populate(objectMap, "siteNames", h.SiteNames) + return json.Marshal(objectMap) +} + +// HostNameBinding - A hostname binding object. +type HostNameBinding struct { + ProxyOnlyResource + // HostNameBinding resource specific properties + Properties *HostNameBindingProperties `json:"properties,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type HostNameBinding. +func (h HostNameBinding) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + h.ProxyOnlyResource.marshalInternal(objectMap) + populate(objectMap, "properties", h.Properties) + return json.Marshal(objectMap) +} + +// HostNameBindingCollection - Collection of hostname bindings. +type HostNameBindingCollection struct { + // REQUIRED; Collection of resources. + Value []*HostNameBinding `json:"value,omitempty"` + + // READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type HostNameBindingCollection. +func (h HostNameBindingCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", h.NextLink) + populate(objectMap, "value", h.Value) + return json.Marshal(objectMap) +} + +// HostNameBindingProperties - HostNameBinding resource specific properties +type HostNameBindingProperties struct { + // Azure resource name. + AzureResourceName *string `json:"azureResourceName,omitempty"` + + // Azure resource type. + AzureResourceType *AzureResourceType `json:"azureResourceType,omitempty"` + + // Custom DNS record type. + CustomHostNameDNSRecordType *CustomHostNameDNSRecordType `json:"customHostNameDnsRecordType,omitempty"` + + // Fully qualified ARM domain resource URI. + DomainID *string `json:"domainId,omitempty"` + + // Hostname type. + HostNameType *HostNameType `json:"hostNameType,omitempty"` + + // SSL type + SSLState *SSLState `json:"sslState,omitempty"` + + // App Service app name. + SiteName *string `json:"siteName,omitempty"` + + // SSL certificate thumbprint + Thumbprint *string `json:"thumbprint,omitempty"` + + // READ-ONLY; Virtual IP address assigned to the hostname if IP based SSL is enabled. + VirtualIP *string `json:"virtualIP,omitempty" azure:"ro"` +} + +// HostNameSSLState - SSL-enabled hostname. +type HostNameSSLState struct { + // Indicates whether the hostname is a standard or repository hostname. + HostType *HostType `json:"hostType,omitempty"` + + // Hostname. + Name *string `json:"name,omitempty"` + + // SSL type. + SSLState *SSLState `json:"sslState,omitempty"` + + // SSL certificate thumbprint. + Thumbprint *string `json:"thumbprint,omitempty"` + + // Set to true to update existing hostname. + ToUpdate *bool `json:"toUpdate,omitempty"` + + // Virtual IP address assigned to the hostname if IP based SSL is enabled. + VirtualIP *string `json:"virtualIP,omitempty"` +} + +// HostingEnvironmentDeploymentInfo - Information needed to create resources on an App Service Environment. +type HostingEnvironmentDeploymentInfo struct { + // Location of the App Service Environment. + Location *string `json:"location,omitempty"` + + // Name of the App Service Environment. + Name *string `json:"name,omitempty"` +} + +// HostingEnvironmentDiagnostics - Diagnostics for an App Service Environment. +type HostingEnvironmentDiagnostics struct { + // Diagnostics output. + DiagnosticsOutput *string `json:"diagnosticsOutput,omitempty"` + + // Name/identifier of the diagnostics. + Name *string `json:"name,omitempty"` +} + +// HostingEnvironmentProfile - Specification for an App Service Environment to use for this resource. +type HostingEnvironmentProfile struct { + // Resource ID of the App Service Environment. + ID *string `json:"id,omitempty"` + + // READ-ONLY; Name of the App Service Environment. + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; Resource type of the App Service Environment. + Type *string `json:"type,omitempty" azure:"ro"` +} + +// HybridConnection - Hybrid Connection contract. This is used to configure a Hybrid Connection. +type HybridConnection struct { + ProxyOnlyResource + // HybridConnection resource specific properties + Properties *HybridConnectionProperties `json:"properties,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type HybridConnection. +func (h HybridConnection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + h.ProxyOnlyResource.marshalInternal(objectMap) + populate(objectMap, "properties", h.Properties) + return json.Marshal(objectMap) +} + +// HybridConnectionCollection - Collection of hostname bindings. +type HybridConnectionCollection struct { + // REQUIRED; Collection of resources. + Value []*HybridConnection `json:"value,omitempty"` + + // READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type HybridConnectionCollection. +func (h HybridConnectionCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", h.NextLink) + populate(objectMap, "value", h.Value) + return json.Marshal(objectMap) +} + +// HybridConnectionKey - Hybrid Connection key contract. This has the send key name and value for a Hybrid Connection. +type HybridConnectionKey struct { + ProxyOnlyResource + // HybridConnectionKey resource specific properties + Properties *HybridConnectionKeyProperties `json:"properties,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type HybridConnectionKey. +func (h HybridConnectionKey) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + h.ProxyOnlyResource.marshalInternal(objectMap) + populate(objectMap, "properties", h.Properties) + return json.Marshal(objectMap) +} + +// HybridConnectionKeyProperties - HybridConnectionKey resource specific properties +type HybridConnectionKeyProperties struct { + // READ-ONLY; The name of the send key. + SendKeyName *string `json:"sendKeyName,omitempty" azure:"ro"` + + // READ-ONLY; The value of the send key. + SendKeyValue *string `json:"sendKeyValue,omitempty" azure:"ro"` +} + +// HybridConnectionLimits - Hybrid Connection limits contract. This is used to return the plan limits of Hybrid Connections. +type HybridConnectionLimits struct { + ProxyOnlyResource + // HybridConnectionLimits resource specific properties + Properties *HybridConnectionLimitsProperties `json:"properties,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type HybridConnectionLimits. +func (h HybridConnectionLimits) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + h.ProxyOnlyResource.marshalInternal(objectMap) + populate(objectMap, "properties", h.Properties) + return json.Marshal(objectMap) +} + +// HybridConnectionLimitsProperties - HybridConnectionLimits resource specific properties +type HybridConnectionLimitsProperties struct { + // READ-ONLY; The current number of Hybrid Connections. + Current *int32 `json:"current,omitempty" azure:"ro"` + + // READ-ONLY; The maximum number of Hybrid Connections allowed. + Maximum *int32 `json:"maximum,omitempty" azure:"ro"` +} + +// HybridConnectionProperties - HybridConnection resource specific properties +type HybridConnectionProperties struct { + // The hostname of the endpoint. + Hostname *string `json:"hostname,omitempty"` + + // The port of the endpoint. + Port *int32 `json:"port,omitempty"` + + // The ARM URI to the Service Bus relay. + RelayArmURI *string `json:"relayArmUri,omitempty"` + + // The name of the Service Bus relay. + RelayName *string `json:"relayName,omitempty"` + + // The name of the Service Bus key which has Send permissions. This is used to authenticate to Service Bus. + SendKeyName *string `json:"sendKeyName,omitempty"` + + // The value of the Service Bus key. This is used to authenticate to Service Bus. In ARM this key will not be returned normally, use the POST /listKeys + // API instead. + SendKeyValue *string `json:"sendKeyValue,omitempty"` + + // The name of the Service Bus namespace. + ServiceBusNamespace *string `json:"serviceBusNamespace,omitempty"` + + // The suffix for the service bus endpoint. By default this is .servicebus.windows.net + ServiceBusSuffix *string `json:"serviceBusSuffix,omitempty"` +} + +// IPSecurityRestriction - IP security restriction on an app. +type IPSecurityRestriction struct { + // Allow or Deny access for this IP range. + Action *string `json:"action,omitempty"` + + // IP restriction rule description. + Description *string `json:"description,omitempty"` + + // IP restriction rule headers. X-Forwarded-Host (https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-Host#Examples). The matching logic + // is .. + // * If the property is null or empty (default), all hosts(or lack of) are allowed. + // * A value is compared using ordinal-ignore-case (excluding port number). + // * Subdomain wildcards are permitted but don't match the root domain. For example, *.contoso.com matches the subdomain foo.contoso.com but not the root + // domain contoso.com or multi-level + // foo.bar.contoso.com + // * Unicode host names are allowed but are converted to Punycode for matching. + // X-Forwarded-For (https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-For#Examples). The matching logic is .. + // * If the property is null or empty (default), any forwarded-for chains (or lack of) are allowed. + // * If any address (excluding port number) in the chain (comma separated) matches the CIDR defined by the property. + // X-Azure-FDID and X-FD-HealthProbe. The matching logic is exact match. + Headers map[string][]*string `json:"headers,omitempty"` + + // IP address the security restriction is valid for. It can be in form of pure ipv4 address (required SubnetMask property) or CIDR notation such as ipv4/mask + // (leading bit match). For CIDR, SubnetMask + // property must not be specified. + IPAddress *string `json:"ipAddress,omitempty"` + + // IP restriction rule name. + Name *string `json:"name,omitempty"` + + // Priority of IP restriction rule. + Priority *int32 `json:"priority,omitempty"` + + // Subnet mask for the range of IP addresses the restriction is valid for. + SubnetMask *string `json:"subnetMask,omitempty"` + + // (internal) Subnet traffic tag + SubnetTrafficTag *int32 `json:"subnetTrafficTag,omitempty"` + + // Defines what this IP filter will be used for. This is to support IP filtering on proxies. + Tag *IPFilterTag `json:"tag,omitempty"` + + // Virtual network resource id + VnetSubnetResourceID *string `json:"vnetSubnetResourceId,omitempty"` + + // (internal) Vnet traffic tag + VnetTrafficTag *int32 `json:"vnetTrafficTag,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type IPSecurityRestriction. +func (i IPSecurityRestriction) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "action", i.Action) + populate(objectMap, "description", i.Description) + populate(objectMap, "headers", i.Headers) + populate(objectMap, "ipAddress", i.IPAddress) + populate(objectMap, "name", i.Name) + populate(objectMap, "priority", i.Priority) + populate(objectMap, "subnetMask", i.SubnetMask) + populate(objectMap, "subnetTrafficTag", i.SubnetTrafficTag) + populate(objectMap, "tag", i.Tag) + populate(objectMap, "vnetSubnetResourceId", i.VnetSubnetResourceID) + populate(objectMap, "vnetTrafficTag", i.VnetTrafficTag) + return json.Marshal(objectMap) +} + +// Identifier - A domain specific resource identifier. +type Identifier struct { + ProxyOnlyResource + // Identifier resource specific properties + Properties *IdentifierProperties `json:"properties,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type Identifier. +func (i Identifier) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + i.ProxyOnlyResource.marshalInternal(objectMap) + populate(objectMap, "properties", i.Properties) + return json.Marshal(objectMap) +} + +// IdentifierCollection - Collection of identifiers. +type IdentifierCollection struct { + // REQUIRED; Collection of resources. + Value []*Identifier `json:"value,omitempty"` + + // READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type IdentifierCollection. +func (i IdentifierCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", i.NextLink) + populate(objectMap, "value", i.Value) + return json.Marshal(objectMap) +} + +// IdentifierProperties - Identifier resource specific properties +type IdentifierProperties struct { + // String representation of the identity. + Value *string `json:"id,omitempty"` +} + +// IdentityProviders - The configuration settings of each of the identity providers used to configure App Service Authentication/Authorization. +type IdentityProviders struct { + // The configuration settings of the Apple provider. + Apple *Apple `json:"apple,omitempty"` + + // The configuration settings of the Azure Active directory provider. + AzureActiveDirectory *AzureActiveDirectory `json:"azureActiveDirectory,omitempty"` + + // The configuration settings of the Azure Static Web Apps provider. + AzureStaticWebApps *AzureStaticWebApps `json:"azureStaticWebApps,omitempty"` + + // The map of the name of the alias of each custom Open ID Connect provider to the configuration settings of the custom Open ID Connect provider. + CustomOpenIDConnectProviders map[string]*CustomOpenIDConnectProvider `json:"customOpenIdConnectProviders,omitempty"` + + // The configuration settings of the Facebook provider. + Facebook *Facebook `json:"facebook,omitempty"` + + // The configuration settings of the GitHub provider. + GitHub *GitHub `json:"gitHub,omitempty"` + + // The configuration settings of the Google provider. + Google *Google `json:"google,omitempty"` + + // The configuration settings of the legacy Microsoft Account provider. + LegacyMicrosoftAccount *LegacyMicrosoftAccount `json:"legacyMicrosoftAccount,omitempty"` + + // The configuration settings of the Twitter provider. + Twitter *Twitter `json:"twitter,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type IdentityProviders. +func (i IdentityProviders) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "apple", i.Apple) + populate(objectMap, "azureActiveDirectory", i.AzureActiveDirectory) + populate(objectMap, "azureStaticWebApps", i.AzureStaticWebApps) + populate(objectMap, "customOpenIdConnectProviders", i.CustomOpenIDConnectProviders) + populate(objectMap, "facebook", i.Facebook) + populate(objectMap, "gitHub", i.GitHub) + populate(objectMap, "google", i.Google) + populate(objectMap, "legacyMicrosoftAccount", i.LegacyMicrosoftAccount) + populate(objectMap, "twitter", i.Twitter) + return json.Marshal(objectMap) +} + +// InboundEnvironmentEndpoint - The IP Addresses and Ports that require inbound network access to and within the subnet of the App Service Environment. +type InboundEnvironmentEndpoint struct { + // Short text describing the purpose of the network traffic. + Description *string `json:"description,omitempty"` + + // The IP addresses that network traffic will originate from in cidr notation. + Endpoints []*string `json:"endpoints,omitempty"` + + // The ports that network traffic will arrive to the App Service Environment at. + Ports []*string `json:"ports,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type InboundEnvironmentEndpoint. +func (i InboundEnvironmentEndpoint) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "description", i.Description) + populate(objectMap, "endpoints", i.Endpoints) + populate(objectMap, "ports", i.Ports) + return json.Marshal(objectMap) +} + +// InboundEnvironmentEndpointCollection - Collection of Inbound Environment Endpoints +type InboundEnvironmentEndpointCollection struct { + // REQUIRED; Collection of resources. + Value []*InboundEnvironmentEndpoint `json:"value,omitempty"` + + // READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type InboundEnvironmentEndpointCollection. +func (i InboundEnvironmentEndpointCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", i.NextLink) + populate(objectMap, "value", i.Value) + return json.Marshal(objectMap) +} + +// JwtClaimChecks - The configuration settings of the checks that should be made while validating the JWT Claims. +type JwtClaimChecks struct { + // The list of the allowed client applications. + AllowedClientApplications []*string `json:"allowedClientApplications,omitempty"` + + // The list of the allowed groups. + AllowedGroups []*string `json:"allowedGroups,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type JwtClaimChecks. +func (j JwtClaimChecks) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "allowedClientApplications", j.AllowedClientApplications) + populate(objectMap, "allowedGroups", j.AllowedGroups) + return json.Marshal(objectMap) +} + +// KeyInfo - Function key info. +type KeyInfo struct { + // Key name + Name *string `json:"name,omitempty"` + + // Key value + Value *string `json:"value,omitempty"` +} + +type KeyValuePairStringObject struct { + // READ-ONLY + Key *string `json:"key,omitempty" azure:"ro"` + + // READ-ONLY; Any object + Value map[string]interface{} `json:"value,omitempty" azure:"ro"` +} + +// KubeEnvironment - A Kubernetes cluster specialized for web workloads by Azure App Service +type KubeEnvironment struct { + Resource + // Extended Location. + ExtendedLocation *ExtendedLocation `json:"extendedLocation,omitempty"` + + // KubeEnvironment resource specific properties + Properties *KubeEnvironmentProperties `json:"properties,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type KubeEnvironment. +func (k KubeEnvironment) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + k.Resource.marshalInternal(objectMap) + populate(objectMap, "extendedLocation", k.ExtendedLocation) + populate(objectMap, "properties", k.Properties) + return json.Marshal(objectMap) +} + +// KubeEnvironmentCollection - Collection of Kubernetes Environments +type KubeEnvironmentCollection struct { + // REQUIRED; Collection of resources. + Value []*KubeEnvironment `json:"value,omitempty"` + + // READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type KubeEnvironmentCollection. +func (k KubeEnvironmentCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", k.NextLink) + populate(objectMap, "value", k.Value) + return json.Marshal(objectMap) +} + +// KubeEnvironmentPatchResource - ARM resource for a KubeEnvironment when patching +type KubeEnvironmentPatchResource struct { + ProxyOnlyResource + // KubeEnvironmentPatchResource resource specific properties + Properties *KubeEnvironmentPatchResourceProperties `json:"properties,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type KubeEnvironmentPatchResource. +func (k KubeEnvironmentPatchResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + k.ProxyOnlyResource.marshalInternal(objectMap) + populate(objectMap, "properties", k.Properties) + return json.Marshal(objectMap) +} + +// KubeEnvironmentPatchResourceProperties - KubeEnvironmentPatchResource resource specific properties +type KubeEnvironmentPatchResourceProperties struct { + AksResourceID *string `json:"aksResourceID,omitempty"` + + // Cluster configuration which enables the log daemon to export app logs to a destination. Currently only "log-analytics" is supported + AppLogsConfiguration *AppLogsConfiguration `json:"appLogsConfiguration,omitempty"` + + // Cluster configuration which determines the ARC cluster components types. Eg: Choosing between BuildService kind, FrontEnd Service ArtifactsStorageType + // etc. + ArcConfiguration *ArcConfiguration `json:"arcConfiguration,omitempty"` + + // Only visible within Vnet/Subnet + InternalLoadBalancerEnabled *bool `json:"internalLoadBalancerEnabled,omitempty"` + + // Static IP of the KubeEnvironment + StaticIP *string `json:"staticIp,omitempty"` + + // READ-ONLY; Default Domain Name for the cluster + DefaultDomain *string `json:"defaultDomain,omitempty" azure:"ro"` + + // READ-ONLY; Any errors that occurred during deployment or deployment validation + DeploymentErrors *string `json:"deploymentErrors,omitempty" azure:"ro"` + + // READ-ONLY; Provisioning state of the Kubernetes Environment. + ProvisioningState *KubeEnvironmentProvisioningState `json:"provisioningState,omitempty" azure:"ro"` +} + +// KubeEnvironmentProfile - Specification for a Kubernetes Environment to use for this resource. +type KubeEnvironmentProfile struct { + // Resource ID of the Kubernetes Environment. + ID *string `json:"id,omitempty"` + + // READ-ONLY; Name of the Kubernetes Environment. + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; Resource type of the Kubernetes Environment. + Type *string `json:"type,omitempty" azure:"ro"` +} + +// KubeEnvironmentProperties - KubeEnvironment resource specific properties +type KubeEnvironmentProperties struct { + AksResourceID *string `json:"aksResourceID,omitempty"` + + // Cluster configuration which enables the log daemon to export app logs to a destination. Currently only "log-analytics" is supported + AppLogsConfiguration *AppLogsConfiguration `json:"appLogsConfiguration,omitempty"` + + // Cluster configuration which determines the ARC cluster components types. Eg: Choosing between BuildService kind, FrontEnd Service ArtifactsStorageType + // etc. + ArcConfiguration *ArcConfiguration `json:"arcConfiguration,omitempty"` + + // Only visible within Vnet/Subnet + InternalLoadBalancerEnabled *bool `json:"internalLoadBalancerEnabled,omitempty"` + + // Static IP of the KubeEnvironment + StaticIP *string `json:"staticIp,omitempty"` + + // READ-ONLY; Default Domain Name for the cluster + DefaultDomain *string `json:"defaultDomain,omitempty" azure:"ro"` + + // READ-ONLY; Any errors that occurred during deployment or deployment validation + DeploymentErrors *string `json:"deploymentErrors,omitempty" azure:"ro"` + + // READ-ONLY; Provisioning state of the Kubernetes Environment. + ProvisioningState *KubeEnvironmentProvisioningState `json:"provisioningState,omitempty" azure:"ro"` +} + +// KubeEnvironmentsBeginCreateOrUpdateOptions contains the optional parameters for the KubeEnvironments.BeginCreateOrUpdate method. +type KubeEnvironmentsBeginCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// KubeEnvironmentsBeginDeleteOptions contains the optional parameters for the KubeEnvironments.BeginDelete method. +type KubeEnvironmentsBeginDeleteOptions struct { + // placeholder for future optional parameters +} + +// KubeEnvironmentsGetOptions contains the optional parameters for the KubeEnvironments.Get method. +type KubeEnvironmentsGetOptions struct { + // placeholder for future optional parameters +} + +// KubeEnvironmentsListByResourceGroupOptions contains the optional parameters for the KubeEnvironments.ListByResourceGroup method. +type KubeEnvironmentsListByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// KubeEnvironmentsListBySubscriptionOptions contains the optional parameters for the KubeEnvironments.ListBySubscription method. +type KubeEnvironmentsListBySubscriptionOptions struct { + // placeholder for future optional parameters +} + +// KubeEnvironmentsUpdateOptions contains the optional parameters for the KubeEnvironments.Update method. +type KubeEnvironmentsUpdateOptions struct { + // placeholder for future optional parameters +} + +// LegacyMicrosoftAccount - The configuration settings of the legacy Microsoft Account provider. +type LegacyMicrosoftAccount struct { + // false if the legacy Microsoft Account provider should not be enabled despite the set registration; otherwise, true. + Enabled *bool `json:"enabled,omitempty"` + + // The configuration settings of the login flow. + Login *LoginScopes `json:"login,omitempty"` + + // The configuration settings of the app registration for the legacy Microsoft Account provider. + Registration *ClientRegistration `json:"registration,omitempty"` + + // The configuration settings of the legacy Microsoft Account provider token validation flow. + Validation *AllowedAudiencesValidation `json:"validation,omitempty"` +} + +// LinuxJavaContainerSettings - Linux Java Container settings. +type LinuxJavaContainerSettings struct { + // READ-ONLY; End-of-life date for the minor version. + EndOfLifeDate *time.Time `json:"endOfLifeDate,omitempty" azure:"ro"` + + // READ-ONLY; true if the stack version is auto-updated; otherwise, false. + IsAutoUpdate *bool `json:"isAutoUpdate,omitempty" azure:"ro"` + + // READ-ONLY; true if the stack is deprecated; otherwise, false. + IsDeprecated *bool `json:"isDeprecated,omitempty" azure:"ro"` + + // READ-ONLY; true if the minor version is early-access; otherwise, false. + IsEarlyAccess *bool `json:"isEarlyAccess,omitempty" azure:"ro"` + + // READ-ONLY; true if the stack should be hidden; otherwise, false. + IsHidden *bool `json:"isHidden,omitempty" azure:"ro"` + + // READ-ONLY; true if the stack is in preview; otherwise, false. + IsPreview *bool `json:"isPreview,omitempty" azure:"ro"` + + // READ-ONLY; Java 11 version (runtime only). + Java11Runtime *string `json:"java11Runtime,omitempty" azure:"ro"` + + // READ-ONLY; Java 8 version (runtime only). + Java8Runtime *string `json:"java8Runtime,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type LinuxJavaContainerSettings. +func (l LinuxJavaContainerSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populateTimeRFC3339(objectMap, "endOfLifeDate", l.EndOfLifeDate) + populate(objectMap, "isAutoUpdate", l.IsAutoUpdate) + populate(objectMap, "isDeprecated", l.IsDeprecated) + populate(objectMap, "isEarlyAccess", l.IsEarlyAccess) + populate(objectMap, "isHidden", l.IsHidden) + populate(objectMap, "isPreview", l.IsPreview) + populate(objectMap, "java11Runtime", l.Java11Runtime) + populate(objectMap, "java8Runtime", l.Java8Runtime) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LinuxJavaContainerSettings. +func (l *LinuxJavaContainerSettings) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "endOfLifeDate": + err = unpopulateTimeRFC3339(val, &l.EndOfLifeDate) + delete(rawMsg, key) + case "isAutoUpdate": + err = unpopulate(val, &l.IsAutoUpdate) + delete(rawMsg, key) + case "isDeprecated": + err = unpopulate(val, &l.IsDeprecated) + delete(rawMsg, key) + case "isEarlyAccess": + err = unpopulate(val, &l.IsEarlyAccess) + delete(rawMsg, key) + case "isHidden": + err = unpopulate(val, &l.IsHidden) + delete(rawMsg, key) + case "isPreview": + err = unpopulate(val, &l.IsPreview) + delete(rawMsg, key) + case "java11Runtime": + err = unpopulate(val, &l.Java11Runtime) + delete(rawMsg, key) + case "java8Runtime": + err = unpopulate(val, &l.Java8Runtime) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// LocalizableString - Localizable string object containing the name and a localized value. +type LocalizableString struct { + // Localized name. + LocalizedValue *string `json:"localizedValue,omitempty"` + + // Non-localized name. + Value *string `json:"value,omitempty"` +} + +type LogAnalyticsConfiguration struct { + CustomerID *string `json:"customerId,omitempty"` + SharedKey *string `json:"sharedKey,omitempty"` +} + +// LogSpecification - Log Definition of a single resource metric. +type LogSpecification struct { + BlobDuration *string `json:"blobDuration,omitempty"` + DisplayName *string `json:"displayName,omitempty"` + LogFilterPattern *string `json:"logFilterPattern,omitempty"` + Name *string `json:"name,omitempty"` +} + +// Login - The configuration settings of the login flow of users using App Service Authentication/Authorization. +type Login struct { + // External URLs that can be redirected to as part of logging in or logging out of the app. Note that the query string part of the URL is ignored. This + // is an advanced setting typically only needed by + // Windows Store application backends. Note that URLs within the current domain are always implicitly allowed. + AllowedExternalRedirectUrls []*string `json:"allowedExternalRedirectUrls,omitempty"` + + // The configuration settings of the session cookie's expiration. + CookieExpiration *CookieExpiration `json:"cookieExpiration,omitempty"` + + // The configuration settings of the nonce used in the login flow. + Nonce *Nonce `json:"nonce,omitempty"` + + // true if the fragments from the request are preserved after the login request is made; otherwise, false. + PreserveURLFragmentsForLogins *bool `json:"preserveUrlFragmentsForLogins,omitempty"` + + // The routes that specify the endpoints used for login and logout requests. + Routes *LoginRoutes `json:"routes,omitempty"` + + // The configuration settings of the token store. + TokenStore *TokenStore `json:"tokenStore,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type Login. +func (l Login) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "allowedExternalRedirectUrls", l.AllowedExternalRedirectUrls) + populate(objectMap, "cookieExpiration", l.CookieExpiration) + populate(objectMap, "nonce", l.Nonce) + populate(objectMap, "preserveUrlFragmentsForLogins", l.PreserveURLFragmentsForLogins) + populate(objectMap, "routes", l.Routes) + populate(objectMap, "tokenStore", l.TokenStore) + return json.Marshal(objectMap) +} + +// LoginRoutes - The routes that specify the endpoints used for login and logout requests. +type LoginRoutes struct { + // The endpoint at which a logout request should be made. + LogoutEndpoint *string `json:"logoutEndpoint,omitempty"` +} + +// LoginScopes - The configuration settings of the login flow, including the scopes that should be requested. +type LoginScopes struct { + // A list of the scopes that should be requested while authenticating. + Scopes []*string `json:"scopes,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type LoginScopes. +func (l LoginScopes) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "scopes", l.Scopes) + return json.Marshal(objectMap) +} + +// MSDeploy ARM PUT information +type MSDeploy struct { + ProxyOnlyResource + // Core resource properties + Properties *MSDeployCore `json:"properties,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type MSDeploy. +func (m MSDeploy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + m.ProxyOnlyResource.marshalInternal(objectMap) + populate(objectMap, "properties", m.Properties) + return json.Marshal(objectMap) +} + +// MSDeployCore - MSDeploy ARM PUT core information +type MSDeployCore struct { + // Sets the AppOffline rule while the MSDeploy operation executes. Setting is false by default. + AppOffline *bool `json:"appOffline,omitempty"` + + // SQL Connection String + ConnectionString *string `json:"connectionString,omitempty"` + + // Database Type + DbType *string `json:"dbType,omitempty"` + + // Package URI + PackageURI *string `json:"packageUri,omitempty"` + + // MSDeploy Parameters. Must not be set if SetParametersXmlFileUri is used. + SetParameters map[string]*string `json:"setParameters,omitempty"` + + // URI of MSDeploy Parameters file. Must not be set if SetParameters is used. + SetParametersXMLFileURI *string `json:"setParametersXmlFileUri,omitempty"` + + // Controls whether the MSDeploy operation skips the AppData directory. If set to true, the existing AppData directory on the destination will not be deleted, + // and any App_Data directory in the source + // will be ignored. Setting is false by default. + SkipAppData *bool `json:"skipAppData,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type MSDeployCore. +func (m MSDeployCore) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "appOffline", m.AppOffline) + populate(objectMap, "connectionString", m.ConnectionString) + populate(objectMap, "dbType", m.DbType) + populate(objectMap, "packageUri", m.PackageURI) + populate(objectMap, "setParameters", m.SetParameters) + populate(objectMap, "setParametersXmlFileUri", m.SetParametersXMLFileURI) + populate(objectMap, "skipAppData", m.SkipAppData) + return json.Marshal(objectMap) +} + +// MSDeployLog - MSDeploy log +type MSDeployLog struct { + ProxyOnlyResource + // MSDeployLog resource specific properties + Properties *MSDeployLogProperties `json:"properties,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type MSDeployLog. +func (m MSDeployLog) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + m.ProxyOnlyResource.marshalInternal(objectMap) + populate(objectMap, "properties", m.Properties) + return json.Marshal(objectMap) +} + +// MSDeployLogEntry - MSDeploy log entry +type MSDeployLogEntry struct { + // READ-ONLY; Log entry message + Message *string `json:"message,omitempty" azure:"ro"` + + // READ-ONLY; Timestamp of log entry + Time *time.Time `json:"time,omitempty" azure:"ro"` + + // READ-ONLY; Log entry type + Type *MSDeployLogEntryType `json:"type,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type MSDeployLogEntry. +func (m MSDeployLogEntry) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "message", m.Message) + populateTimeRFC3339(objectMap, "time", m.Time) + populate(objectMap, "type", m.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MSDeployLogEntry. +func (m *MSDeployLogEntry) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "message": + err = unpopulate(val, &m.Message) + delete(rawMsg, key) + case "time": + err = unpopulateTimeRFC3339(val, &m.Time) + delete(rawMsg, key) + case "type": + err = unpopulate(val, &m.Type) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MSDeployLogProperties - MSDeployLog resource specific properties +type MSDeployLogProperties struct { + // READ-ONLY; List of log entry messages + Entries []*MSDeployLogEntry `json:"entries,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type MSDeployLogProperties. +func (m MSDeployLogProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "entries", m.Entries) + return json.Marshal(objectMap) +} + +// MSDeployStatus - MSDeploy ARM response +type MSDeployStatus struct { + ProxyOnlyResource + // MSDeployStatus resource specific properties + Properties *MSDeployStatusProperties `json:"properties,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type MSDeployStatus. +func (m MSDeployStatus) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + m.ProxyOnlyResource.marshalInternal(objectMap) + populate(objectMap, "properties", m.Properties) + return json.Marshal(objectMap) +} + +// MSDeployStatusProperties - MSDeployStatus resource specific properties +type MSDeployStatusProperties struct { + // READ-ONLY; Whether the deployment operation has completed + Complete *bool `json:"complete,omitempty" azure:"ro"` + + // READ-ONLY; Username of deployer + Deployer *string `json:"deployer,omitempty" azure:"ro"` + + // READ-ONLY; End time of deploy operation + EndTime *time.Time `json:"endTime,omitempty" azure:"ro"` + + // READ-ONLY; Provisioning state + ProvisioningState *MSDeployProvisioningState `json:"provisioningState,omitempty" azure:"ro"` + + // READ-ONLY; Start time of deploy operation + StartTime *time.Time `json:"startTime,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type MSDeployStatusProperties. +func (m MSDeployStatusProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "complete", m.Complete) + populate(objectMap, "deployer", m.Deployer) + populateTimeRFC3339(objectMap, "endTime", m.EndTime) + populate(objectMap, "provisioningState", m.ProvisioningState) + populateTimeRFC3339(objectMap, "startTime", m.StartTime) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MSDeployStatusProperties. +func (m *MSDeployStatusProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "complete": + err = unpopulate(val, &m.Complete) + delete(rawMsg, key) + case "deployer": + err = unpopulate(val, &m.Deployer) + delete(rawMsg, key) + case "endTime": + err = unpopulateTimeRFC3339(val, &m.EndTime) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, &m.ProvisioningState) + delete(rawMsg, key) + case "startTime": + err = unpopulateTimeRFC3339(val, &m.StartTime) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// ManagedServiceIdentity - Managed service identity. +type ManagedServiceIdentity struct { + // Type of managed service identity. + Type *ManagedServiceIdentityType `json:"type,omitempty"` + + // The list of user assigned identities associated with the resource. 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]*UserAssignedIdentity `json:"userAssignedIdentities,omitempty"` + + // READ-ONLY; Principal Id of managed service identity. + PrincipalID *string `json:"principalId,omitempty" azure:"ro"` + + // READ-ONLY; Tenant of managed service identity. + TenantID *string `json:"tenantId,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedServiceIdentity. +func (m ManagedServiceIdentity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "principalId", m.PrincipalID) + populate(objectMap, "tenantId", m.TenantID) + populate(objectMap, "type", m.Type) + populate(objectMap, "userAssignedIdentities", m.UserAssignedIdentities) + return json.Marshal(objectMap) +} + +// MetricAvailability - Retention policy of a resource metric. +type MetricAvailability struct { + BlobDuration *string `json:"blobDuration,omitempty"` + TimeGrain *string `json:"timeGrain,omitempty"` +} + +// MetricSpecification - Definition of a single resource metric. +type MetricSpecification struct { + AggregationType *string `json:"aggregationType,omitempty"` + Availabilities []*MetricAvailability `json:"availabilities,omitempty"` + Category *string `json:"category,omitempty"` + Dimensions []*Dimension `json:"dimensions,omitempty"` + DisplayDescription *string `json:"displayDescription,omitempty"` + DisplayName *string `json:"displayName,omitempty"` + EnableRegionalMdmAccount *bool `json:"enableRegionalMdmAccount,omitempty"` + FillGapWithZero *bool `json:"fillGapWithZero,omitempty"` + IsInternal *bool `json:"isInternal,omitempty"` + MetricFilterPattern *string `json:"metricFilterPattern,omitempty"` + Name *string `json:"name,omitempty"` + SourceMdmAccount *string `json:"sourceMdmAccount,omitempty"` + SourceMdmNamespace *string `json:"sourceMdmNamespace,omitempty"` + SupportedAggregationTypes []*string `json:"supportedAggregationTypes,omitempty"` + SupportedTimeGrainTypes []*string `json:"supportedTimeGrainTypes,omitempty"` + SupportsInstanceLevelAggregation *bool `json:"supportsInstanceLevelAggregation,omitempty"` + Unit *string `json:"unit,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type MetricSpecification. +func (m MetricSpecification) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "aggregationType", m.AggregationType) + populate(objectMap, "availabilities", m.Availabilities) + populate(objectMap, "category", m.Category) + populate(objectMap, "dimensions", m.Dimensions) + populate(objectMap, "displayDescription", m.DisplayDescription) + populate(objectMap, "displayName", m.DisplayName) + populate(objectMap, "enableRegionalMdmAccount", m.EnableRegionalMdmAccount) + populate(objectMap, "fillGapWithZero", m.FillGapWithZero) + populate(objectMap, "isInternal", m.IsInternal) + populate(objectMap, "metricFilterPattern", m.MetricFilterPattern) + populate(objectMap, "name", m.Name) + populate(objectMap, "sourceMdmAccount", m.SourceMdmAccount) + populate(objectMap, "sourceMdmNamespace", m.SourceMdmNamespace) + populate(objectMap, "supportedAggregationTypes", m.SupportedAggregationTypes) + populate(objectMap, "supportedTimeGrainTypes", m.SupportedTimeGrainTypes) + populate(objectMap, "supportsInstanceLevelAggregation", m.SupportsInstanceLevelAggregation) + populate(objectMap, "unit", m.Unit) + return json.Marshal(objectMap) +} + +// MigrateMySQLRequest - MySQL migration request. +type MigrateMySQLRequest struct { + ProxyOnlyResource + // MigrateMySqlRequest resource specific properties + Properties *MigrateMySQLRequestProperties `json:"properties,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type MigrateMySQLRequest. +func (m MigrateMySQLRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + m.ProxyOnlyResource.marshalInternal(objectMap) + populate(objectMap, "properties", m.Properties) + return json.Marshal(objectMap) +} + +// MigrateMySQLRequestProperties - MigrateMySqlRequest resource specific properties +type MigrateMySQLRequestProperties struct { + // REQUIRED; Connection string to the remote MySQL database. + ConnectionString *string `json:"connectionString,omitempty"` + + // REQUIRED; The type of migration operation to be done + MigrationType *MySQLMigrationType `json:"migrationType,omitempty"` +} + +// MigrateMySQLStatus - MySQL migration status. +type MigrateMySQLStatus struct { + ProxyOnlyResource + // MigrateMySqlStatus resource specific properties + Properties *MigrateMySQLStatusProperties `json:"properties,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type MigrateMySQLStatus. +func (m MigrateMySQLStatus) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + m.ProxyOnlyResource.marshalInternal(objectMap) + populate(objectMap, "properties", m.Properties) + return json.Marshal(objectMap) +} + +// MigrateMySQLStatusProperties - MigrateMySqlStatus resource specific properties +type MigrateMySQLStatusProperties struct { + // READ-ONLY; True if the web app has in app MySql enabled + LocalMySQLEnabled *bool `json:"localMySqlEnabled,omitempty" azure:"ro"` + + // READ-ONLY; Status of the migration task. + MigrationOperationStatus *OperationStatus `json:"migrationOperationStatus,omitempty" azure:"ro"` + + // READ-ONLY; Operation ID for the migration task. + OperationID *string `json:"operationId,omitempty" azure:"ro"` +} + +// NameIdentifier - Identifies an object. +type NameIdentifier struct { + // Name of the object. + Name *string `json:"name,omitempty"` +} + +// NameIdentifierCollection - Collection of domain name identifiers. +type NameIdentifierCollection struct { + // REQUIRED; Collection of resources. + Value []*NameIdentifier `json:"value,omitempty"` + + // READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type NameIdentifierCollection. +func (n NameIdentifierCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", n.NextLink) + populate(objectMap, "value", n.Value) + return json.Marshal(objectMap) +} + +// NameValuePair - Name value pair. +type NameValuePair struct { + // Pair name. + Name *string `json:"name,omitempty"` + + // Pair value. + Value *string `json:"value,omitempty"` +} + +// NetworkFeatures - Full view of network features for an app (presently VNET integration and Hybrid Connections). +type NetworkFeatures struct { + ProxyOnlyResource + // NetworkFeatures resource specific properties + Properties *NetworkFeaturesProperties `json:"properties,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type NetworkFeatures. +func (n NetworkFeatures) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + n.ProxyOnlyResource.marshalInternal(objectMap) + populate(objectMap, "properties", n.Properties) + return json.Marshal(objectMap) +} + +// NetworkFeaturesProperties - NetworkFeatures resource specific properties +type NetworkFeaturesProperties struct { + // READ-ONLY; The Hybrid Connections summary view. + HybridConnections []*RelayServiceConnectionEntity `json:"hybridConnections,omitempty" azure:"ro"` + + // READ-ONLY; The Hybrid Connection V2 (Service Bus) view. + HybridConnectionsV2 []*HybridConnection `json:"hybridConnectionsV2,omitempty" azure:"ro"` + + // READ-ONLY; The Virtual Network summary view. + VirtualNetworkConnection *VnetInfo `json:"virtualNetworkConnection,omitempty" azure:"ro"` + + // READ-ONLY; The Virtual Network name. + VirtualNetworkName *string `json:"virtualNetworkName,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type NetworkFeaturesProperties. +func (n NetworkFeaturesProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "hybridConnections", n.HybridConnections) + populate(objectMap, "hybridConnectionsV2", n.HybridConnectionsV2) + populate(objectMap, "virtualNetworkConnection", n.VirtualNetworkConnection) + populate(objectMap, "virtualNetworkName", n.VirtualNetworkName) + return json.Marshal(objectMap) +} + +// NetworkTrace - Network trace +type NetworkTrace struct { + // Detailed message of a network trace operation, e.g. error message in case of failure. + Message *string `json:"message,omitempty"` + + // Local file path for the captured network trace file. + Path *string `json:"path,omitempty"` + + // Current status of the network trace operation, same as Operation.Status (InProgress/Succeeded/Failed). + Status *string `json:"status,omitempty"` +} + +// Nonce - The configuration settings of the nonce used in the login flow. +type Nonce struct { + // The time after the request is made when the nonce should expire. + NonceExpirationInterval *string `json:"nonceExpirationInterval,omitempty"` + + // false if the nonce should not be validated while completing the login flow; otherwise, true. + ValidateNonce *bool `json:"validateNonce,omitempty"` +} + +// OpenIDConnectClientCredential - The authentication client credentials of the custom Open ID Connect provider. +type OpenIDConnectClientCredential struct { + // The app setting that contains the client secret for the custom Open ID Connect provider. + ClientSecretSettingName *string `json:"clientSecretSettingName,omitempty"` + + // The method that should be used to authenticate the user. + Method *string `json:"method,omitempty"` +} + +// OpenIDConnectConfig - The configuration settings of the endpoints used for the custom Open ID Connect provider. +type OpenIDConnectConfig struct { + // The endpoint to be used to make an authorization request. + AuthorizationEndpoint *string `json:"authorizationEndpoint,omitempty"` + + // The endpoint that provides the keys necessary to validate the token. + CertificationURI *string `json:"certificationUri,omitempty"` + + // The endpoint that issues the token. + Issuer *string `json:"issuer,omitempty"` + + // The endpoint to be used to request a token. + TokenEndpoint *string `json:"tokenEndpoint,omitempty"` + + // The endpoint that contains all the configuration endpoints for the provider. + WellKnownOpenIDConfiguration *string `json:"wellKnownOpenIdConfiguration,omitempty"` +} + +// OpenIDConnectLogin - The configuration settings of the login flow of the custom Open ID Connect provider. +type OpenIDConnectLogin struct { + // The name of the claim that contains the users name. + NameClaimType *string `json:"nameClaimType,omitempty"` + + // A list of the scopes that should be requested while authenticating. + Scopes []*string `json:"scopes,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type OpenIDConnectLogin. +func (o OpenIDConnectLogin) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nameClaimType", o.NameClaimType) + populate(objectMap, "scopes", o.Scopes) + return json.Marshal(objectMap) +} + +// OpenIDConnectRegistration - The configuration settings of the app registration for the custom Open ID Connect provider. +type OpenIDConnectRegistration struct { + // The authentication credentials of the custom Open ID Connect provider. + ClientCredential *OpenIDConnectClientCredential `json:"clientCredential,omitempty"` + + // The client id of the custom Open ID Connect provider. + ClientID *string `json:"clientId,omitempty"` + + // The configuration settings of the endpoints used for the custom Open ID Connect provider. + OpenIDConnectConfiguration *OpenIDConnectConfig `json:"openIdConnectConfiguration,omitempty"` +} + +// Operation - An operation on a resource. +type Operation struct { + // Time when operation has started. + CreatedTime *time.Time `json:"createdTime,omitempty"` + + // Any errors associate with the operation. + Errors []*ErrorEntity `json:"errors,omitempty"` + + // Time when operation will expire. + ExpirationTime *time.Time `json:"expirationTime,omitempty"` + + // Applicable only for stamp operation ids. + GeoMasterOperationID *string `json:"geoMasterOperationId,omitempty"` + + // Operation ID. + ID *string `json:"id,omitempty"` + + // Time when operation has been updated. + ModifiedTime *time.Time `json:"modifiedTime,omitempty"` + + // Operation name. + Name *string `json:"name,omitempty"` + + // The current status of the operation. + Status *OperationStatus `json:"status,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type Operation. +func (o Operation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populateTimeRFC3339(objectMap, "createdTime", o.CreatedTime) + populate(objectMap, "errors", o.Errors) + populateTimeRFC3339(objectMap, "expirationTime", o.ExpirationTime) + populate(objectMap, "geoMasterOperationId", o.GeoMasterOperationID) + populate(objectMap, "id", o.ID) + populateTimeRFC3339(objectMap, "modifiedTime", o.ModifiedTime) + populate(objectMap, "name", o.Name) + populate(objectMap, "status", o.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Operation. +func (o *Operation) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "createdTime": + err = unpopulateTimeRFC3339(val, &o.CreatedTime) + delete(rawMsg, key) + case "errors": + err = unpopulate(val, &o.Errors) + delete(rawMsg, key) + case "expirationTime": + err = unpopulateTimeRFC3339(val, &o.ExpirationTime) + delete(rawMsg, key) + case "geoMasterOperationId": + err = unpopulate(val, &o.GeoMasterOperationID) + delete(rawMsg, key) + case "id": + err = unpopulate(val, &o.ID) + delete(rawMsg, key) + case "modifiedTime": + err = unpopulateTimeRFC3339(val, &o.ModifiedTime) + delete(rawMsg, key) + case "name": + err = unpopulate(val, &o.Name) + delete(rawMsg, key) + case "status": + err = unpopulate(val, &o.Status) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// OutboundEnvironmentEndpoint - Endpoints accessed for a common purpose that the App Service Environment requires outbound network access to. +type OutboundEnvironmentEndpoint struct { + // The type of service accessed by the App Service Environment, e.g., Azure Storage, Azure SQL Database, and Azure Active Directory. + Category *string `json:"category,omitempty"` + + // The endpoints that the App Service Environment reaches the service at. + Endpoints []*EndpointDependency `json:"endpoints,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type OutboundEnvironmentEndpoint. +func (o OutboundEnvironmentEndpoint) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "category", o.Category) + populate(objectMap, "endpoints", o.Endpoints) + return json.Marshal(objectMap) +} + +// OutboundEnvironmentEndpointCollection - Collection of Outbound Environment Endpoints +type OutboundEnvironmentEndpointCollection struct { + // REQUIRED; Collection of resources. + Value []*OutboundEnvironmentEndpoint `json:"value,omitempty"` + + // READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type OutboundEnvironmentEndpointCollection. +func (o OutboundEnvironmentEndpointCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", o.NextLink) + populate(objectMap, "value", o.Value) + return json.Marshal(objectMap) +} + +// PerfMonCounterCollection - Collection of performance monitor counters. +type PerfMonCounterCollection struct { + // REQUIRED; Collection of resources. + Value []*PerfMonResponse `json:"value,omitempty"` + + // READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type PerfMonCounterCollection. +func (p PerfMonCounterCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", p.NextLink) + populate(objectMap, "value", p.Value) + return json.Marshal(objectMap) +} + +// PerfMonResponse - Performance monitor API response. +type PerfMonResponse struct { + // The response code. + Code *string `json:"code,omitempty"` + + // The performance monitor counters. + Data *PerfMonSet `json:"data,omitempty"` + + // The message. + Message *string `json:"message,omitempty"` +} + +// PerfMonSample - Performance monitor sample in a set. +type PerfMonSample struct { + // Name of the server on which the measurement is made. + InstanceName *string `json:"instanceName,omitempty"` + + // Point in time for which counter was measured. + Time *time.Time `json:"time,omitempty"` + + // Value of counter at a certain time. + Value *float64 `json:"value,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type PerfMonSample. +func (p PerfMonSample) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "instanceName", p.InstanceName) + populateTimeRFC3339(objectMap, "time", p.Time) + populate(objectMap, "value", p.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PerfMonSample. +func (p *PerfMonSample) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "instanceName": + err = unpopulate(val, &p.InstanceName) + delete(rawMsg, key) + case "time": + err = unpopulateTimeRFC3339(val, &p.Time) + delete(rawMsg, key) + case "value": + err = unpopulate(val, &p.Value) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// PerfMonSet - Metric information. +type PerfMonSet struct { + // End time of the period. + EndTime *time.Time `json:"endTime,omitempty"` + + // Unique key name of the counter. + Name *string `json:"name,omitempty"` + + // Start time of the period. + StartTime *time.Time `json:"startTime,omitempty"` + + // Presented time grain. + TimeGrain *string `json:"timeGrain,omitempty"` + + // Collection of workers that are active during this time. + Values []*PerfMonSample `json:"values,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type PerfMonSet. +func (p PerfMonSet) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populateTimeRFC3339(objectMap, "endTime", p.EndTime) + populate(objectMap, "name", p.Name) + populateTimeRFC3339(objectMap, "startTime", p.StartTime) + populate(objectMap, "timeGrain", p.TimeGrain) + populate(objectMap, "values", p.Values) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PerfMonSet. +func (p *PerfMonSet) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "endTime": + err = unpopulateTimeRFC3339(val, &p.EndTime) + delete(rawMsg, key) + case "name": + err = unpopulate(val, &p.Name) + delete(rawMsg, key) + case "startTime": + err = unpopulateTimeRFC3339(val, &p.StartTime) + delete(rawMsg, key) + case "timeGrain": + err = unpopulate(val, &p.TimeGrain) + delete(rawMsg, key) + case "values": + err = unpopulate(val, &p.Values) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// PremierAddOn - Premier add-on. +type PremierAddOn struct { + Resource + // PremierAddOn resource specific properties + Properties *PremierAddOnProperties `json:"properties,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type PremierAddOn. +func (p PremierAddOn) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + p.Resource.marshalInternal(objectMap) + populate(objectMap, "properties", p.Properties) + return json.Marshal(objectMap) +} + +// PremierAddOnOffer - Premier add-on offer. +type PremierAddOnOffer struct { + ProxyOnlyResource + // PremierAddOnOffer resource specific properties + Properties *PremierAddOnOfferProperties `json:"properties,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type PremierAddOnOffer. +func (p PremierAddOnOffer) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + p.ProxyOnlyResource.marshalInternal(objectMap) + populate(objectMap, "properties", p.Properties) + return json.Marshal(objectMap) +} + +// PremierAddOnOfferCollection - Collection of premier add-on offers. +type PremierAddOnOfferCollection struct { + // REQUIRED; Collection of resources. + Value []*PremierAddOnOffer `json:"value,omitempty"` + + // READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type PremierAddOnOfferCollection. +func (p PremierAddOnOfferCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", p.NextLink) + populate(objectMap, "value", p.Value) + return json.Marshal(objectMap) +} + +// PremierAddOnOfferProperties - PremierAddOnOffer resource specific properties +type PremierAddOnOfferProperties struct { + // Legal terms URL. + LegalTermsURL *string `json:"legalTermsUrl,omitempty"` + + // Marketplace offer. + MarketplaceOffer *string `json:"marketplaceOffer,omitempty"` + + // Marketplace publisher. + MarketplacePublisher *string `json:"marketplacePublisher,omitempty"` + + // Privacy policy URL. + PrivacyPolicyURL *string `json:"privacyPolicyUrl,omitempty"` + + // Premier add on offer Product. + Product *string `json:"product,omitempty"` + + // true if promotion code is required; otherwise, false. + PromoCodeRequired *bool `json:"promoCodeRequired,omitempty"` + + // Premier add on offer Quota. + Quota *int32 `json:"quota,omitempty"` + + // Premier add on SKU. + SKU *string `json:"sku,omitempty"` + + // Premier add on offer Vendor. + Vendor *string `json:"vendor,omitempty"` + + // App Service plans this offer is restricted to. + WebHostingPlanRestrictions *AppServicePlanRestrictions `json:"webHostingPlanRestrictions,omitempty"` +} + +// PremierAddOnPatchResource - ARM resource for a PremierAddOn. +type PremierAddOnPatchResource struct { + ProxyOnlyResource + // PremierAddOnPatchResource resource specific properties + Properties *PremierAddOnPatchResourceProperties `json:"properties,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type PremierAddOnPatchResource. +func (p PremierAddOnPatchResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + p.ProxyOnlyResource.marshalInternal(objectMap) + populate(objectMap, "properties", p.Properties) + return json.Marshal(objectMap) +} + +// PremierAddOnPatchResourceProperties - PremierAddOnPatchResource resource specific properties +type PremierAddOnPatchResourceProperties struct { + // Premier add on Marketplace offer. + MarketplaceOffer *string `json:"marketplaceOffer,omitempty"` + + // Premier add on Marketplace publisher. + MarketplacePublisher *string `json:"marketplacePublisher,omitempty"` + + // Premier add on Product. + Product *string `json:"product,omitempty"` + + // Premier add on SKU. + SKU *string `json:"sku,omitempty"` + + // Premier add on Vendor. + Vendor *string `json:"vendor,omitempty"` +} + +// PremierAddOnProperties - PremierAddOn resource specific properties +type PremierAddOnProperties struct { + // Premier add on Marketplace offer. + MarketplaceOffer *string `json:"marketplaceOffer,omitempty"` + + // Premier add on Marketplace publisher. + MarketplacePublisher *string `json:"marketplacePublisher,omitempty"` + + // Premier add on Product. + Product *string `json:"product,omitempty"` + + // Premier add on SKU. + SKU *string `json:"sku,omitempty"` + + // Premier add on Vendor. + Vendor *string `json:"vendor,omitempty"` +} + +// PrivateAccess - Description of the parameters of Private Access for a Web Site. +type PrivateAccess struct { + ProxyOnlyResource + // PrivateAccess resource specific properties + Properties *PrivateAccessProperties `json:"properties,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type PrivateAccess. +func (p PrivateAccess) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + p.ProxyOnlyResource.marshalInternal(objectMap) + populate(objectMap, "properties", p.Properties) + return json.Marshal(objectMap) +} + +// PrivateAccessProperties - PrivateAccess resource specific properties +type PrivateAccessProperties struct { + // Whether private access is enabled or not. + Enabled *bool `json:"enabled,omitempty"` + + // The Virtual Networks (and subnets) allowed to access the site privately. + VirtualNetworks []*PrivateAccessVirtualNetwork `json:"virtualNetworks,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type PrivateAccessProperties. +func (p PrivateAccessProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "enabled", p.Enabled) + populate(objectMap, "virtualNetworks", p.VirtualNetworks) + return json.Marshal(objectMap) +} + +// PrivateAccessSubnet - Description of a Virtual Network subnet that is useable for private site access. +type PrivateAccessSubnet struct { + // The key (ID) of the subnet. + Key *int32 `json:"key,omitempty"` + + // The name of the subnet. + Name *string `json:"name,omitempty"` +} + +// PrivateAccessVirtualNetwork - Description of a Virtual Network that is useable for private site access. +type PrivateAccessVirtualNetwork struct { + // The key (ID) of the Virtual Network. + Key *int32 `json:"key,omitempty"` + + // The name of the Virtual Network. + Name *string `json:"name,omitempty"` + + // The ARM uri of the Virtual Network + ResourceID *string `json:"resourceId,omitempty"` + + // A List of subnets that access is allowed to on this Virtual Network. An empty array (but not null) is interpreted to mean that all subnets are allowed + // within this Virtual Network. + Subnets []*PrivateAccessSubnet `json:"subnets,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type PrivateAccessVirtualNetwork. +func (p PrivateAccessVirtualNetwork) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "key", p.Key) + populate(objectMap, "name", p.Name) + populate(objectMap, "resourceId", p.ResourceID) + populate(objectMap, "subnets", p.Subnets) + return json.Marshal(objectMap) +} + +type PrivateEndpointConnectionCollection struct { + // REQUIRED; Collection of resources. + Value []*RemotePrivateEndpointConnectionARMResource `json:"value,omitempty"` + + // READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionCollection. +func (p PrivateEndpointConnectionCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", p.NextLink) + populate(objectMap, "value", p.Value) + return json.Marshal(objectMap) +} + +// PrivateLinkConnectionApprovalRequest - A request to approve or reject a private endpoint connection +type PrivateLinkConnectionApprovalRequest struct { + // The state of a private link connection + PrivateLinkServiceConnectionState *PrivateLinkConnectionState `json:"privateLinkServiceConnectionState,omitempty"` +} + +// PrivateLinkConnectionApprovalRequestResource - Private Endpoint Connection Approval ARM resource. +type PrivateLinkConnectionApprovalRequestResource struct { + ProxyOnlyResource + // Core resource properties + Properties *PrivateLinkConnectionApprovalRequest `json:"properties,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type PrivateLinkConnectionApprovalRequestResource. +func (p PrivateLinkConnectionApprovalRequestResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + p.ProxyOnlyResource.marshalInternal(objectMap) + populate(objectMap, "properties", p.Properties) + return json.Marshal(objectMap) +} + +// PrivateLinkConnectionState - The state of a private link connection +type PrivateLinkConnectionState struct { + // ActionsRequired for a private link connection + ActionsRequired *string `json:"actionsRequired,omitempty"` + + // Description of a private link connection + Description *string `json:"description,omitempty"` + + // Status of a private link connection + Status *string `json:"status,omitempty"` +} + +// PrivateLinkResource - A private link resource +type PrivateLinkResource struct { + // REQUIRED + ID *string `json:"id,omitempty"` + + // REQUIRED; Name of a private link resource + Name *string `json:"name,omitempty"` + + // REQUIRED; Properties of a private link resource + Properties *PrivateLinkResourceProperties `json:"properties,omitempty"` + + // REQUIRED + Type *string `json:"type,omitempty"` +} + +// PrivateLinkResourceProperties - Properties of a private link resource +type PrivateLinkResourceProperties struct { + // READ-ONLY; GroupId of a private link resource + GroupID *string `json:"groupId,omitempty" azure:"ro"` + + // READ-ONLY; RequiredMembers of a private link resource + RequiredMembers []*string `json:"requiredMembers,omitempty" azure:"ro"` + + // READ-ONLY; RequiredZoneNames of a private link resource + RequiredZoneNames []*string `json:"requiredZoneNames,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResourceProperties. +func (p PrivateLinkResourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "groupId", p.GroupID) + populate(objectMap, "requiredMembers", p.RequiredMembers) + populate(objectMap, "requiredZoneNames", p.RequiredZoneNames) + return json.Marshal(objectMap) +} + +// PrivateLinkResourcesWrapper - Wrapper for a collection of private link resources +type PrivateLinkResourcesWrapper struct { + // REQUIRED + Value []*PrivateLinkResource `json:"value,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResourcesWrapper. +func (p PrivateLinkResourcesWrapper) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "value", p.Value) + return json.Marshal(objectMap) +} + +// ProcessInfo - Process Information. +type ProcessInfo struct { + ProxyOnlyResource + // ProcessInfo resource specific properties + Properties *ProcessInfoProperties `json:"properties,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type ProcessInfo. +func (p ProcessInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + p.ProxyOnlyResource.marshalInternal(objectMap) + populate(objectMap, "properties", p.Properties) + return json.Marshal(objectMap) +} + +// ProcessInfoCollection - Collection of Kudu process information elements. +type ProcessInfoCollection struct { + // REQUIRED; Collection of resources. + Value []*ProcessInfo `json:"value,omitempty"` + + // READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type ProcessInfoCollection. +func (p ProcessInfoCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", p.NextLink) + populate(objectMap, "value", p.Value) + return json.Marshal(objectMap) +} + +// ProcessInfoProperties - ProcessInfo resource specific properties +type ProcessInfoProperties struct { + // Child process list. + Children []*string `json:"children,omitempty"` + + // Command line. + CommandLine *string `json:"command_line,omitempty"` + + // Deployment name. + DeploymentName *string `json:"deployment_name,omitempty"` + + // Description of process. + Description *string `json:"description,omitempty"` + + // List of environment variables. + EnvironmentVariables map[string]*string `json:"environment_variables,omitempty"` + + // File name of this process. + FileName *string `json:"file_name,omitempty"` + + // Handle count. + HandleCount *int32 `json:"handle_count,omitempty"` + + // HRef URI. + Href *string `json:"href,omitempty"` + + // IIS Profile timeout (seconds). + IisProfileTimeoutInSeconds *float64 `json:"iis_profile_timeout_in_seconds,omitempty"` + + // Is the IIS Profile running? + IsIisProfileRunning *bool `json:"is_iis_profile_running,omitempty"` + + // Is profile running? + IsProfileRunning *bool `json:"is_profile_running,omitempty"` + + // Is this the SCM site? + IsScmSite *bool `json:"is_scm_site,omitempty"` + + // Is this a Web Job? + IsWebjob *bool `json:"is_webjob,omitempty"` + + // Minidump URI. + Minidump *string `json:"minidump,omitempty"` + + // Module count. + ModuleCount *int32 `json:"module_count,omitempty"` + + // List of modules. + Modules []*ProcessModuleInfo `json:"modules,omitempty"` + + // Non-paged system memory. + NonPagedSystemMemory *int64 `json:"non_paged_system_memory,omitempty"` + + // List of open files. + OpenFileHandles []*string `json:"open_file_handles,omitempty"` + + // Paged memory. + PagedMemory *int64 `json:"paged_memory,omitempty"` + + // Paged system memory. + PagedSystemMemory *int64 `json:"paged_system_memory,omitempty"` + + // Parent process. + Parent *string `json:"parent,omitempty"` + + // Peak paged memory. + PeakPagedMemory *int64 `json:"peak_paged_memory,omitempty"` + + // Peak virtual memory usage. + PeakVirtualMemory *int64 `json:"peak_virtual_memory,omitempty"` + + // Peak working set. + PeakWorkingSet *int64 `json:"peak_working_set,omitempty"` + + // Private memory size. + PrivateMemory *int64 `json:"private_memory,omitempty"` + + // Privileged CPU time. + PrivilegedCPUTime *string `json:"privileged_cpu_time,omitempty"` + + // Start time. + StartTime *time.Time `json:"start_time,omitempty"` + + // Thread count. + ThreadCount *int32 `json:"thread_count,omitempty"` + + // Thread list. + Threads []*ProcessThreadInfo `json:"threads,omitempty"` + + // Time stamp. + TimeStamp *time.Time `json:"time_stamp,omitempty"` + + // Total CPU time. + TotalCPUTime *string `json:"total_cpu_time,omitempty"` + + // User CPU time. + UserCPUTime *string `json:"user_cpu_time,omitempty"` + + // User name. + UserName *string `json:"user_name,omitempty"` + + // Virtual memory size. + VirtualMemory *int64 `json:"virtual_memory,omitempty"` + + // Working set. + WorkingSet *int64 `json:"working_set,omitempty"` + + // READ-ONLY; ARM Identifier for deployment. + Identifier *int32 `json:"identifier,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type ProcessInfoProperties. +func (p ProcessInfoProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "children", p.Children) + populate(objectMap, "command_line", p.CommandLine) + populate(objectMap, "deployment_name", p.DeploymentName) + populate(objectMap, "description", p.Description) + populate(objectMap, "environment_variables", p.EnvironmentVariables) + populate(objectMap, "file_name", p.FileName) + populate(objectMap, "handle_count", p.HandleCount) + populate(objectMap, "href", p.Href) + populate(objectMap, "identifier", p.Identifier) + populate(objectMap, "iis_profile_timeout_in_seconds", p.IisProfileTimeoutInSeconds) + populate(objectMap, "is_iis_profile_running", p.IsIisProfileRunning) + populate(objectMap, "is_profile_running", p.IsProfileRunning) + populate(objectMap, "is_scm_site", p.IsScmSite) + populate(objectMap, "is_webjob", p.IsWebjob) + populate(objectMap, "minidump", p.Minidump) + populate(objectMap, "module_count", p.ModuleCount) + populate(objectMap, "modules", p.Modules) + populate(objectMap, "non_paged_system_memory", p.NonPagedSystemMemory) + populate(objectMap, "open_file_handles", p.OpenFileHandles) + populate(objectMap, "paged_memory", p.PagedMemory) + populate(objectMap, "paged_system_memory", p.PagedSystemMemory) + populate(objectMap, "parent", p.Parent) + populate(objectMap, "peak_paged_memory", p.PeakPagedMemory) + populate(objectMap, "peak_virtual_memory", p.PeakVirtualMemory) + populate(objectMap, "peak_working_set", p.PeakWorkingSet) + populate(objectMap, "private_memory", p.PrivateMemory) + populate(objectMap, "privileged_cpu_time", p.PrivilegedCPUTime) + populateTimeRFC3339(objectMap, "start_time", p.StartTime) + populate(objectMap, "thread_count", p.ThreadCount) + populate(objectMap, "threads", p.Threads) + populateTimeRFC3339(objectMap, "time_stamp", p.TimeStamp) + populate(objectMap, "total_cpu_time", p.TotalCPUTime) + populate(objectMap, "user_cpu_time", p.UserCPUTime) + populate(objectMap, "user_name", p.UserName) + populate(objectMap, "virtual_memory", p.VirtualMemory) + populate(objectMap, "working_set", p.WorkingSet) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ProcessInfoProperties. +func (p *ProcessInfoProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "children": + err = unpopulate(val, &p.Children) + delete(rawMsg, key) + case "command_line": + err = unpopulate(val, &p.CommandLine) + delete(rawMsg, key) + case "deployment_name": + err = unpopulate(val, &p.DeploymentName) + delete(rawMsg, key) + case "description": + err = unpopulate(val, &p.Description) + delete(rawMsg, key) + case "environment_variables": + err = unpopulate(val, &p.EnvironmentVariables) + delete(rawMsg, key) + case "file_name": + err = unpopulate(val, &p.FileName) + delete(rawMsg, key) + case "handle_count": + err = unpopulate(val, &p.HandleCount) + delete(rawMsg, key) + case "href": + err = unpopulate(val, &p.Href) + delete(rawMsg, key) + case "identifier": + err = unpopulate(val, &p.Identifier) + delete(rawMsg, key) + case "iis_profile_timeout_in_seconds": + err = unpopulate(val, &p.IisProfileTimeoutInSeconds) + delete(rawMsg, key) + case "is_iis_profile_running": + err = unpopulate(val, &p.IsIisProfileRunning) + delete(rawMsg, key) + case "is_profile_running": + err = unpopulate(val, &p.IsProfileRunning) + delete(rawMsg, key) + case "is_scm_site": + err = unpopulate(val, &p.IsScmSite) + delete(rawMsg, key) + case "is_webjob": + err = unpopulate(val, &p.IsWebjob) + delete(rawMsg, key) + case "minidump": + err = unpopulate(val, &p.Minidump) + delete(rawMsg, key) + case "module_count": + err = unpopulate(val, &p.ModuleCount) + delete(rawMsg, key) + case "modules": + err = unpopulate(val, &p.Modules) + delete(rawMsg, key) + case "non_paged_system_memory": + err = unpopulate(val, &p.NonPagedSystemMemory) + delete(rawMsg, key) + case "open_file_handles": + err = unpopulate(val, &p.OpenFileHandles) + delete(rawMsg, key) + case "paged_memory": + err = unpopulate(val, &p.PagedMemory) + delete(rawMsg, key) + case "paged_system_memory": + err = unpopulate(val, &p.PagedSystemMemory) + delete(rawMsg, key) + case "parent": + err = unpopulate(val, &p.Parent) + delete(rawMsg, key) + case "peak_paged_memory": + err = unpopulate(val, &p.PeakPagedMemory) + delete(rawMsg, key) + case "peak_virtual_memory": + err = unpopulate(val, &p.PeakVirtualMemory) + delete(rawMsg, key) + case "peak_working_set": + err = unpopulate(val, &p.PeakWorkingSet) + delete(rawMsg, key) + case "private_memory": + err = unpopulate(val, &p.PrivateMemory) + delete(rawMsg, key) + case "privileged_cpu_time": + err = unpopulate(val, &p.PrivilegedCPUTime) + delete(rawMsg, key) + case "start_time": + err = unpopulateTimeRFC3339(val, &p.StartTime) + delete(rawMsg, key) + case "thread_count": + err = unpopulate(val, &p.ThreadCount) + delete(rawMsg, key) + case "threads": + err = unpopulate(val, &p.Threads) + delete(rawMsg, key) + case "time_stamp": + err = unpopulateTimeRFC3339(val, &p.TimeStamp) + delete(rawMsg, key) + case "total_cpu_time": + err = unpopulate(val, &p.TotalCPUTime) + delete(rawMsg, key) + case "user_cpu_time": + err = unpopulate(val, &p.UserCPUTime) + delete(rawMsg, key) + case "user_name": + err = unpopulate(val, &p.UserName) + delete(rawMsg, key) + case "virtual_memory": + err = unpopulate(val, &p.VirtualMemory) + delete(rawMsg, key) + case "working_set": + err = unpopulate(val, &p.WorkingSet) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// ProcessModuleInfo - Process Module Information. +type ProcessModuleInfo struct { + ProxyOnlyResource + // ProcessModuleInfo resource specific properties + Properties *ProcessModuleInfoProperties `json:"properties,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type ProcessModuleInfo. +func (p ProcessModuleInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + p.ProxyOnlyResource.marshalInternal(objectMap) + populate(objectMap, "properties", p.Properties) + return json.Marshal(objectMap) +} + +// ProcessModuleInfoCollection - Collection of Kudu thread information elements. +type ProcessModuleInfoCollection struct { + // REQUIRED; Collection of resources. + Value []*ProcessModuleInfo `json:"value,omitempty"` + + // READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type ProcessModuleInfoCollection. +func (p ProcessModuleInfoCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", p.NextLink) + populate(objectMap, "value", p.Value) + return json.Marshal(objectMap) +} + +// ProcessModuleInfoProperties - ProcessModuleInfo resource specific properties +type ProcessModuleInfoProperties struct { + // Base address. Used as module identifier in ARM resource URI. + BaseAddress *string `json:"base_address,omitempty"` + + // File description. + FileDescription *string `json:"file_description,omitempty"` + + // File name. + FileName *string `json:"file_name,omitempty"` + + // File path. + FilePath *string `json:"file_path,omitempty"` + + // File version. + FileVersion *string `json:"file_version,omitempty"` + + // HRef URI. + Href *string `json:"href,omitempty"` + + // Is debug? + IsDebug *bool `json:"is_debug,omitempty"` + + // Module language (locale). + Language *string `json:"language,omitempty"` + + // Module memory size. + ModuleMemorySize *int32 `json:"module_memory_size,omitempty"` + + // Product name. + Product *string `json:"product,omitempty"` + + // Product version. + ProductVersion *string `json:"product_version,omitempty"` +} + +// ProcessThreadInfo - Process Thread Information. +type ProcessThreadInfo struct { + ProxyOnlyResource + // ProcessThreadInfo resource specific properties + Properties *ProcessThreadInfoProperties `json:"properties,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type ProcessThreadInfo. +func (p ProcessThreadInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + p.ProxyOnlyResource.marshalInternal(objectMap) + populate(objectMap, "properties", p.Properties) + return json.Marshal(objectMap) +} + +// ProcessThreadInfoCollection - Collection of Kudu thread information elements. +type ProcessThreadInfoCollection struct { + // REQUIRED; Collection of resources. + Value []*ProcessThreadInfo `json:"value,omitempty"` + + // READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type ProcessThreadInfoCollection. +func (p ProcessThreadInfoCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", p.NextLink) + populate(objectMap, "value", p.Value) + return json.Marshal(objectMap) +} + +// ProcessThreadInfoProperties - ProcessThreadInfo resource specific properties +type ProcessThreadInfoProperties struct { + // Base priority. + BasePriority *int32 `json:"base_priority,omitempty"` + + // Current thread priority. + CurrentPriority *int32 `json:"current_priority,omitempty"` + + // HRef URI. + Href *string `json:"href,omitempty"` + + // Thread priority level. + PriorityLevel *string `json:"priority_level,omitempty"` + + // Process URI. + Process *string `json:"process,omitempty"` + + // Start address. + StartAddress *string `json:"start_address,omitempty"` + + // Start time. + StartTime *time.Time `json:"start_time,omitempty"` + + // Thread state. + State *string `json:"state,omitempty"` + + // Total processor time. + TotalProcessorTime *string `json:"total_processor_time,omitempty"` + + // User processor time. + UserProcessorTime *string `json:"user_processor_time,omitempty"` + + // Wait reason. + WaitReason *string `json:"wait_reason,omitempty"` + + // READ-ONLY; Site extension ID. + Identifier *int32 `json:"identifier,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type ProcessThreadInfoProperties. +func (p ProcessThreadInfoProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "base_priority", p.BasePriority) + populate(objectMap, "current_priority", p.CurrentPriority) + populate(objectMap, "href", p.Href) + populate(objectMap, "identifier", p.Identifier) + populate(objectMap, "priority_level", p.PriorityLevel) + populate(objectMap, "process", p.Process) + populate(objectMap, "start_address", p.StartAddress) + populateTimeRFC3339(objectMap, "start_time", p.StartTime) + populate(objectMap, "state", p.State) + populate(objectMap, "total_processor_time", p.TotalProcessorTime) + populate(objectMap, "user_processor_time", p.UserProcessorTime) + populate(objectMap, "wait_reason", p.WaitReason) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ProcessThreadInfoProperties. +func (p *ProcessThreadInfoProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "base_priority": + err = unpopulate(val, &p.BasePriority) + delete(rawMsg, key) + case "current_priority": + err = unpopulate(val, &p.CurrentPriority) + delete(rawMsg, key) + case "href": + err = unpopulate(val, &p.Href) + delete(rawMsg, key) + case "identifier": + err = unpopulate(val, &p.Identifier) + delete(rawMsg, key) + case "priority_level": + err = unpopulate(val, &p.PriorityLevel) + delete(rawMsg, key) + case "process": + err = unpopulate(val, &p.Process) + delete(rawMsg, key) + case "start_address": + err = unpopulate(val, &p.StartAddress) + delete(rawMsg, key) + case "start_time": + err = unpopulateTimeRFC3339(val, &p.StartTime) + delete(rawMsg, key) + case "state": + err = unpopulate(val, &p.State) + delete(rawMsg, key) + case "total_processor_time": + err = unpopulate(val, &p.TotalProcessorTime) + delete(rawMsg, key) + case "user_processor_time": + err = unpopulate(val, &p.UserProcessorTime) + delete(rawMsg, key) + case "wait_reason": + err = unpopulate(val, &p.WaitReason) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// ProviderGetAvailableStacksOnPremOptions contains the optional parameters for the Provider.GetAvailableStacksOnPrem method. +type ProviderGetAvailableStacksOnPremOptions struct { + OSTypeSelected *ProviderOsTypeSelected +} + +// ProviderGetAvailableStacksOptions contains the optional parameters for the Provider.GetAvailableStacks method. +type ProviderGetAvailableStacksOptions struct { + OSTypeSelected *ProviderOsTypeSelected +} + +// ProviderGetFunctionAppStacksForLocationOptions contains the optional parameters for the Provider.GetFunctionAppStacksForLocation method. +type ProviderGetFunctionAppStacksForLocationOptions struct { + // Stack OS Type + StackOsType *ProviderStackOsType +} + +// ProviderGetFunctionAppStacksOptions contains the optional parameters for the Provider.GetFunctionAppStacks method. +type ProviderGetFunctionAppStacksOptions struct { + // Stack OS Type + StackOsType *ProviderStackOsType +} + +// ProviderGetWebAppStacksForLocationOptions contains the optional parameters for the Provider.GetWebAppStacksForLocation method. +type ProviderGetWebAppStacksForLocationOptions struct { + // Stack OS Type + StackOsType *ProviderStackOsType +} + +// ProviderGetWebAppStacksOptions contains the optional parameters for the Provider.GetWebAppStacks method. +type ProviderGetWebAppStacksOptions struct { + // Stack OS Type + StackOsType *ProviderStackOsType +} + +// ProviderListOperationsOptions contains the optional parameters for the Provider.ListOperations method. +type ProviderListOperationsOptions struct { + // placeholder for future optional parameters +} + +// ProxyOnlyResource - Azure proxy only resource. This resource is not tracked by Azure Resource Manager. +type ProxyOnlyResource struct { + // Kind of resource. + Kind *string `json:"kind,omitempty"` + + // READ-ONLY; Resource Id. + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; Resource Name. + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; Resource type. + Type *string `json:"type,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type ProxyOnlyResource. +func (p ProxyOnlyResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + p.marshalInternal(objectMap) + return json.Marshal(objectMap) +} + +func (p ProxyOnlyResource) marshalInternal(objectMap map[string]interface{}) { + populate(objectMap, "id", p.ID) + populate(objectMap, "kind", p.Kind) + populate(objectMap, "name", p.Name) + populate(objectMap, "type", p.Type) +} + +// PublicCertificate - Public certificate object +type PublicCertificate struct { + ProxyOnlyResource + // PublicCertificate resource specific properties + Properties *PublicCertificateProperties `json:"properties,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type PublicCertificate. +func (p PublicCertificate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + p.ProxyOnlyResource.marshalInternal(objectMap) + populate(objectMap, "properties", p.Properties) + return json.Marshal(objectMap) +} + +// PublicCertificateCollection - Collection of public certificates +type PublicCertificateCollection struct { + // REQUIRED; Collection of resources. + Value []*PublicCertificate `json:"value,omitempty"` + + // READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type PublicCertificateCollection. +func (p PublicCertificateCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", p.NextLink) + populate(objectMap, "value", p.Value) + return json.Marshal(objectMap) +} + +// PublicCertificateProperties - PublicCertificate resource specific properties +type PublicCertificateProperties struct { + // Public Certificate byte array + Blob []byte `json:"blob,omitempty"` + + // Public Certificate Location + PublicCertificateLocation *PublicCertificateLocation `json:"publicCertificateLocation,omitempty"` + + // READ-ONLY; Certificate Thumbprint + Thumbprint *string `json:"thumbprint,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type PublicCertificateProperties. +func (p PublicCertificateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populateByteArray(objectMap, "blob", p.Blob, runtime.Base64StdFormat) + populate(objectMap, "publicCertificateLocation", p.PublicCertificateLocation) + populate(objectMap, "thumbprint", p.Thumbprint) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PublicCertificateProperties. +func (p *PublicCertificateProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "blob": + err = runtime.DecodeByteArray(string(val), &p.Blob, runtime.Base64StdFormat) + delete(rawMsg, key) + case "publicCertificateLocation": + err = unpopulate(val, &p.PublicCertificateLocation) + delete(rawMsg, key) + case "thumbprint": + err = unpopulate(val, &p.Thumbprint) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// PublishingCredentialsPoliciesCollection - Publishing Credentials Policies entity collection ARM resource. +type PublishingCredentialsPoliciesCollection struct { + // REQUIRED; Collection of resources. + Value []*CsmPublishingCredentialsPoliciesEntity `json:"value,omitempty"` + + // READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type PublishingCredentialsPoliciesCollection. +func (p PublishingCredentialsPoliciesCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", p.NextLink) + populate(objectMap, "value", p.Value) + return json.Marshal(objectMap) +} + +// PushSettings - Push settings for the App. +type PushSettings struct { + ProxyOnlyResource + // PushSettings resource specific properties + Properties *PushSettingsProperties `json:"properties,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type PushSettings. +func (p PushSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + p.ProxyOnlyResource.marshalInternal(objectMap) + populate(objectMap, "properties", p.Properties) + return json.Marshal(objectMap) +} + +// PushSettingsProperties - PushSettings resource specific properties +type PushSettingsProperties struct { + // REQUIRED; Gets or sets a flag indicating whether the Push endpoint is enabled. + IsPushEnabled *bool `json:"isPushEnabled,omitempty"` + + // Gets or sets a JSON string containing a list of dynamic tags that will be evaluated from user claims in the push registration endpoint. + DynamicTagsJSON *string `json:"dynamicTagsJson,omitempty"` + + // Gets or sets a JSON string containing a list of tags that are whitelisted for use by the push registration endpoint. + TagWhitelistJSON *string `json:"tagWhitelistJson,omitempty"` + + // Gets or sets a JSON string containing a list of tags that require user authentication to be used in the push registration endpoint. Tags can consist + // of alphanumeric characters and the following: '_', + // '@', '#', '.', ':', '-'. Validation should be performed at the PushRequestHandler. + TagsRequiringAuth *string `json:"tagsRequiringAuth,omitempty"` +} + +// QueryUtterancesResult - Result for utterances query. +type QueryUtterancesResult struct { + // A sample utterance. + SampleUtterance *SampleUtterance `json:"sampleUtterance,omitempty"` + + // Score of a sample utterance. + Score *float32 `json:"score,omitempty"` +} + +// QueryUtterancesResults - Suggested utterances where the detector can be applicable +type QueryUtterancesResults struct { + // Search Query. + Query *string `json:"query,omitempty"` + + // Array of utterance results for search query. + Results []*QueryUtterancesResult `json:"results,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type QueryUtterancesResults. +func (q QueryUtterancesResults) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "query", q.Query) + populate(objectMap, "results", q.Results) + return json.Marshal(objectMap) +} + +// RampUpRule - Routing rules for ramp up testing. This rule allows to redirect static traffic % to a slot or to gradually change routing % based on performance. +type RampUpRule struct { + // Hostname of a slot to which the traffic will be redirected if decided to. E.g. myapp-stage.azurewebsites.net. + ActionHostName *string `json:"actionHostName,omitempty"` + + // Custom decision algorithm can be provided in TiPCallback site extension which URL can be specified. See TiPCallback site extension for the scaffold and + // contracts. + // https://www.siteextensions.net/packages/TiPCallback/ + ChangeDecisionCallbackURL *string `json:"changeDecisionCallbackUrl,omitempty"` + + // Specifies interval in minutes to reevaluate ReroutePercentage. + ChangeIntervalInMinutes *int32 `json:"changeIntervalInMinutes,omitempty"` + + // In auto ramp up scenario this is the step to add/remove from ReroutePercentage until it reaches \nMinReroutePercentage orMaxReroutePercentage. Site metrics + // are checked every N minutes specified in + // ChangeIntervalInMinutes.\nCustom decision algorithm can be provided in TiPCallback site extension which URL can be specified in ChangeDecisionCallbackUrl. + ChangeStep *float64 `json:"changeStep,omitempty"` + + // Specifies upper boundary below which ReroutePercentage will stay. + MaxReroutePercentage *float64 `json:"maxReroutePercentage,omitempty"` + + // Specifies lower boundary above which ReroutePercentage will stay. + MinReroutePercentage *float64 `json:"minReroutePercentage,omitempty"` + + // Name of the routing rule. The recommended name would be to point to the slot which will receive the traffic in the experiment. + Name *string `json:"name,omitempty"` + + // Percentage of the traffic which will be redirected to ActionHostName. + ReroutePercentage *float64 `json:"reroutePercentage,omitempty"` +} + +// Recommendation - Represents a recommendation result generated by the recommendation engine. +type Recommendation struct { + ProxyOnlyResource + // Recommendation resource specific properties + Properties *RecommendationProperties `json:"properties,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type Recommendation. +func (r Recommendation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + r.ProxyOnlyResource.marshalInternal(objectMap) + populate(objectMap, "properties", r.Properties) + return json.Marshal(objectMap) +} + +// RecommendationCollection - Collection of recommendations. +type RecommendationCollection struct { + // REQUIRED; Collection of resources. + Value []*Recommendation `json:"value,omitempty"` + + // READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type RecommendationCollection. +func (r RecommendationCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", r.NextLink) + populate(objectMap, "value", r.Value) + return json.Marshal(objectMap) +} + +// RecommendationProperties - Recommendation resource specific properties +type RecommendationProperties struct { + // Name of action recommended by this object. + ActionName *string `json:"actionName,omitempty"` + + // Deep link to a blade on the portal. + BladeName *string `json:"bladeName,omitempty"` + + // List of channels that this recommendation can apply. + Channels *Channels `json:"channels,omitempty"` + + // Timestamp when this instance was created. + CreationTime *time.Time `json:"creationTime,omitempty"` + + // UI friendly name of the rule (may not be unique). + DisplayName *string `json:"displayName,omitempty"` + + // True if this recommendation is still valid (i.e. "actionable"). False if it is invalid. + Enabled *int32 `json:"enabled,omitempty"` + + // The end time in UTC of a range that the recommendation refers to. + EndTime *time.Time `json:"endTime,omitempty"` + + // Extension name of the portal if exists. + ExtensionName *string `json:"extensionName,omitempty"` + + // Forward link to an external document associated with the rule. + ForwardLink *string `json:"forwardLink,omitempty"` + + // True if this is associated with a dynamically added rule + IsDynamic *bool `json:"isDynamic,omitempty"` + + // Level indicating how critical this recommendation can impact. + Level *NotificationLevel `json:"level,omitempty"` + + // Recommendation text. + Message *string `json:"message,omitempty"` + + // When to notify this recommendation next in UTC. Null means that this will never be notified anymore. + NextNotificationTime *time.Time `json:"nextNotificationTime,omitempty"` + + // Date and time in UTC when this notification expires. + NotificationExpirationTime *time.Time `json:"notificationExpirationTime,omitempty"` + + // Last timestamp in UTC this instance was actually notified. Null means that this recommendation hasn't been notified yet. + NotifiedTime *time.Time `json:"notifiedTime,omitempty"` + + // A GUID value that each recommendation object is associated with. + RecommendationID *string `json:"recommendationId,omitempty"` + + // Full ARM resource ID string that this recommendation object is associated with. + ResourceID *string `json:"resourceId,omitempty"` + + // Name of a resource type this recommendation applies, e.g. Subscription, ServerFarm, Site. + ResourceScope *ResourceScopeType `json:"resourceScope,omitempty"` + + // Unique name of the rule. + RuleName *string `json:"ruleName,omitempty"` + + // A metric value measured by the rule. + Score *float64 `json:"score,omitempty"` + + // The beginning time in UTC of a range that the recommendation refers to. + StartTime *time.Time `json:"startTime,omitempty"` + + // The list of states of this recommendation. If it's null then it should be considered "Active". + States []*string `json:"states,omitempty"` + + // READ-ONLY; The list of category tags that this recommendation belongs to. + CategoryTags []*string `json:"categoryTags,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type RecommendationProperties. +func (r RecommendationProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "actionName", r.ActionName) + populate(objectMap, "bladeName", r.BladeName) + populate(objectMap, "categoryTags", r.CategoryTags) + populate(objectMap, "channels", r.Channels) + populateTimeRFC3339(objectMap, "creationTime", r.CreationTime) + populate(objectMap, "displayName", r.DisplayName) + populate(objectMap, "enabled", r.Enabled) + populateTimeRFC3339(objectMap, "endTime", r.EndTime) + populate(objectMap, "extensionName", r.ExtensionName) + populate(objectMap, "forwardLink", r.ForwardLink) + populate(objectMap, "isDynamic", r.IsDynamic) + populate(objectMap, "level", r.Level) + populate(objectMap, "message", r.Message) + populateTimeRFC3339(objectMap, "nextNotificationTime", r.NextNotificationTime) + populateTimeRFC3339(objectMap, "notificationExpirationTime", r.NotificationExpirationTime) + populateTimeRFC3339(objectMap, "notifiedTime", r.NotifiedTime) + populate(objectMap, "recommendationId", r.RecommendationID) + populate(objectMap, "resourceId", r.ResourceID) + populate(objectMap, "resourceScope", r.ResourceScope) + populate(objectMap, "ruleName", r.RuleName) + populate(objectMap, "score", r.Score) + populateTimeRFC3339(objectMap, "startTime", r.StartTime) + populate(objectMap, "states", r.States) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RecommendationProperties. +func (r *RecommendationProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "actionName": + err = unpopulate(val, &r.ActionName) + delete(rawMsg, key) + case "bladeName": + err = unpopulate(val, &r.BladeName) + delete(rawMsg, key) + case "categoryTags": + err = unpopulate(val, &r.CategoryTags) + delete(rawMsg, key) + case "channels": + err = unpopulate(val, &r.Channels) + delete(rawMsg, key) + case "creationTime": + err = unpopulateTimeRFC3339(val, &r.CreationTime) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, &r.DisplayName) + delete(rawMsg, key) + case "enabled": + err = unpopulate(val, &r.Enabled) + delete(rawMsg, key) + case "endTime": + err = unpopulateTimeRFC3339(val, &r.EndTime) + delete(rawMsg, key) + case "extensionName": + err = unpopulate(val, &r.ExtensionName) + delete(rawMsg, key) + case "forwardLink": + err = unpopulate(val, &r.ForwardLink) + delete(rawMsg, key) + case "isDynamic": + err = unpopulate(val, &r.IsDynamic) + delete(rawMsg, key) + case "level": + err = unpopulate(val, &r.Level) + delete(rawMsg, key) + case "message": + err = unpopulate(val, &r.Message) + delete(rawMsg, key) + case "nextNotificationTime": + err = unpopulateTimeRFC3339(val, &r.NextNotificationTime) + delete(rawMsg, key) + case "notificationExpirationTime": + err = unpopulateTimeRFC3339(val, &r.NotificationExpirationTime) + delete(rawMsg, key) + case "notifiedTime": + err = unpopulateTimeRFC3339(val, &r.NotifiedTime) + delete(rawMsg, key) + case "recommendationId": + err = unpopulate(val, &r.RecommendationID) + delete(rawMsg, key) + case "resourceId": + err = unpopulate(val, &r.ResourceID) + delete(rawMsg, key) + case "resourceScope": + err = unpopulate(val, &r.ResourceScope) + delete(rawMsg, key) + case "ruleName": + err = unpopulate(val, &r.RuleName) + delete(rawMsg, key) + case "score": + err = unpopulate(val, &r.Score) + delete(rawMsg, key) + case "startTime": + err = unpopulateTimeRFC3339(val, &r.StartTime) + delete(rawMsg, key) + case "states": + err = unpopulate(val, &r.States) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// RecommendationRule - Represents a recommendation rule that the recommendation engine can perform. +type RecommendationRule struct { + ProxyOnlyResource + // RecommendationRule resource specific properties + Properties *RecommendationRuleProperties `json:"properties,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type RecommendationRule. +func (r RecommendationRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + r.ProxyOnlyResource.marshalInternal(objectMap) + populate(objectMap, "properties", r.Properties) + return json.Marshal(objectMap) +} + +// RecommendationRuleProperties - RecommendationRule resource specific properties +type RecommendationRuleProperties struct { + // Name of action that is recommended by this rule in string. + ActionName *string `json:"actionName,omitempty"` + + // Deep link to a blade on the portal. Applicable to dynamic rule only. + BladeName *string `json:"bladeName,omitempty"` + + // List of available channels that this rule applies. + Channels *Channels `json:"channels,omitempty"` + + // Localized detailed description of the rule. + Description *string `json:"description,omitempty"` + + // UI friendly name of the rule. + DisplayName *string `json:"displayName,omitempty"` + + // Extension name of the portal if exists. Applicable to dynamic rule only. + ExtensionName *string `json:"extensionName,omitempty"` + + // Forward link to an external document associated with the rule. Applicable to dynamic rule only. + ForwardLink *string `json:"forwardLink,omitempty"` + + // True if this is associated with a dynamically added rule + IsDynamic *bool `json:"isDynamic,omitempty"` + + // Level of impact indicating how critical this rule is. + Level *NotificationLevel `json:"level,omitempty"` + + // Localized name of the rule (Good for UI). + Message *string `json:"message,omitempty"` + + // Recommendation ID of an associated recommendation object tied to the rule, if exists. If such an object doesn't exist, it is set to null. + RecommendationID *string `json:"recommendationId,omitempty"` + + // Unique name of the rule. + RecommendationName *string `json:"recommendationName,omitempty"` + + // READ-ONLY; The list of category tags that this recommendation rule belongs to. + CategoryTags []*string `json:"categoryTags,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type RecommendationRuleProperties. +func (r RecommendationRuleProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "actionName", r.ActionName) + populate(objectMap, "bladeName", r.BladeName) + populate(objectMap, "categoryTags", r.CategoryTags) + populate(objectMap, "channels", r.Channels) + populate(objectMap, "description", r.Description) + populate(objectMap, "displayName", r.DisplayName) + populate(objectMap, "extensionName", r.ExtensionName) + populate(objectMap, "forwardLink", r.ForwardLink) + populate(objectMap, "isDynamic", r.IsDynamic) + populate(objectMap, "level", r.Level) + populate(objectMap, "message", r.Message) + populate(objectMap, "recommendationId", r.RecommendationID) + populate(objectMap, "recommendationName", r.RecommendationName) + return json.Marshal(objectMap) +} + +// RecommendationsDisableAllForHostingEnvironmentOptions contains the optional parameters for the Recommendations.DisableAllForHostingEnvironment method. +type RecommendationsDisableAllForHostingEnvironmentOptions struct { + // placeholder for future optional parameters +} + +// RecommendationsDisableAllForWebAppOptions contains the optional parameters for the Recommendations.DisableAllForWebApp method. +type RecommendationsDisableAllForWebAppOptions struct { + // placeholder for future optional parameters +} + +// RecommendationsDisableRecommendationForHostingEnvironmentOptions contains the optional parameters for the Recommendations.DisableRecommendationForHostingEnvironment +// method. +type RecommendationsDisableRecommendationForHostingEnvironmentOptions struct { + // placeholder for future optional parameters +} + +// RecommendationsDisableRecommendationForSiteOptions contains the optional parameters for the Recommendations.DisableRecommendationForSite method. +type RecommendationsDisableRecommendationForSiteOptions struct { + // placeholder for future optional parameters +} + +// RecommendationsDisableRecommendationForSubscriptionOptions contains the optional parameters for the Recommendations.DisableRecommendationForSubscription +// method. +type RecommendationsDisableRecommendationForSubscriptionOptions struct { + // placeholder for future optional parameters +} + +// RecommendationsGetRuleDetailsByHostingEnvironmentOptions contains the optional parameters for the Recommendations.GetRuleDetailsByHostingEnvironment +// method. +type RecommendationsGetRuleDetailsByHostingEnvironmentOptions struct { + // The GUID of the recommendation object if you query an expired one. You don't need to specify it to query an active entry. + RecommendationID *string + // Specify true to update the last-seen timestamp of the recommendation object. + UpdateSeen *bool +} + +// RecommendationsGetRuleDetailsByWebAppOptions contains the optional parameters for the Recommendations.GetRuleDetailsByWebApp method. +type RecommendationsGetRuleDetailsByWebAppOptions struct { + // The GUID of the recommendation object if you query an expired one. You don't need to specify it to query an active entry. + RecommendationID *string + // Specify true to update the last-seen timestamp of the recommendation object. + UpdateSeen *bool +} + +// RecommendationsListHistoryForHostingEnvironmentOptions contains the optional parameters for the Recommendations.ListHistoryForHostingEnvironment method. +type RecommendationsListHistoryForHostingEnvironmentOptions struct { + // Specify false to return all recommendations. The default is true, which returns only expired recommendations. + ExpiredOnly *bool + // Filter is specified by using OData syntax. Example: $filter=channel eq 'Api' or channel eq 'Notification' and startTime eq 2014-01-01T00:00:00Z and endTime + // eq 2014-12-31T23:59:59Z and timeGrain eq duration'[PT1H|PT1M|P1D] + Filter *string +} + +// RecommendationsListHistoryForWebAppOptions contains the optional parameters for the Recommendations.ListHistoryForWebApp method. +type RecommendationsListHistoryForWebAppOptions struct { + // Specify false to return all recommendations. The default is true, which returns only expired recommendations. + ExpiredOnly *bool + // Filter is specified by using OData syntax. Example: $filter=channel eq 'Api' or channel eq 'Notification' and startTime eq 2014-01-01T00:00:00Z and endTime + // eq 2014-12-31T23:59:59Z and timeGrain eq duration'[PT1H|PT1M|P1D] + Filter *string +} + +// RecommendationsListOptions contains the optional parameters for the Recommendations.List method. +type RecommendationsListOptions struct { + // Specify true to return only the most critical recommendations. The default is false, which returns all recommendations. + Featured *bool + // Filter is specified by using OData syntax. Example: $filter=channel eq 'Api' or channel eq 'Notification' and startTime eq 2014-01-01T00:00:00Z and endTime + // eq 2014-12-31T23:59:59Z and timeGrain eq duration'[PT1H|PT1M|P1D] + Filter *string +} + +// RecommendationsListRecommendedRulesForHostingEnvironmentOptions contains the optional parameters for the Recommendations.ListRecommendedRulesForHostingEnvironment +// method. +type RecommendationsListRecommendedRulesForHostingEnvironmentOptions struct { + // Specify true to return only the most critical recommendations. The default is false, which returns all recommendations. + Featured *bool + // Return only channels specified in the filter. Filter is specified by using OData syntax. Example: $filter=channel eq 'Api' or channel eq 'Notification' + Filter *string +} + +// RecommendationsListRecommendedRulesForWebAppOptions contains the optional parameters for the Recommendations.ListRecommendedRulesForWebApp method. +type RecommendationsListRecommendedRulesForWebAppOptions struct { + // Specify true to return only the most critical recommendations. The default is false, which returns all recommendations. + Featured *bool + // Return only channels specified in the filter. Filter is specified by using OData syntax. Example: $filter=channel eq 'Api' or channel eq 'Notification' + Filter *string +} + +// RecommendationsResetAllFiltersForHostingEnvironmentOptions contains the optional parameters for the Recommendations.ResetAllFiltersForHostingEnvironment +// method. +type RecommendationsResetAllFiltersForHostingEnvironmentOptions struct { + // placeholder for future optional parameters +} + +// RecommendationsResetAllFiltersForWebAppOptions contains the optional parameters for the Recommendations.ResetAllFiltersForWebApp method. +type RecommendationsResetAllFiltersForWebAppOptions struct { + // placeholder for future optional parameters +} + +// RecommendationsResetAllFiltersOptions contains the optional parameters for the Recommendations.ResetAllFilters method. +type RecommendationsResetAllFiltersOptions struct { + // placeholder for future optional parameters +} + +// ReissueCertificateOrderRequest - Class representing certificate reissue request. +type ReissueCertificateOrderRequest struct { + ProxyOnlyResource + // ReissueCertificateOrderRequest resource specific properties + Properties *ReissueCertificateOrderRequestProperties `json:"properties,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type ReissueCertificateOrderRequest. +func (r ReissueCertificateOrderRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + r.ProxyOnlyResource.marshalInternal(objectMap) + populate(objectMap, "properties", r.Properties) + return json.Marshal(objectMap) +} + +// ReissueCertificateOrderRequestProperties - ReissueCertificateOrderRequest resource specific properties +type ReissueCertificateOrderRequestProperties struct { + // Csr to be used for re-key operation. + Csr *string `json:"csr,omitempty"` + + // Delay in hours to revoke existing certificate after the new certificate is issued. + DelayExistingRevokeInHours *int32 `json:"delayExistingRevokeInHours,omitempty"` + + // Should we change the ASC type (from managed private key to external private key and vice versa). + IsPrivateKeyExternal *bool `json:"isPrivateKeyExternal,omitempty"` + + // Certificate Key Size. + KeySize *int32 `json:"keySize,omitempty"` +} + +// RelayServiceConnectionEntity - Hybrid Connection for an App Service app. +type RelayServiceConnectionEntity struct { + ProxyOnlyResource + // RelayServiceConnectionEntity resource specific properties + Properties *RelayServiceConnectionEntityProperties `json:"properties,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type RelayServiceConnectionEntity. +func (r RelayServiceConnectionEntity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + r.ProxyOnlyResource.marshalInternal(objectMap) + populate(objectMap, "properties", r.Properties) + return json.Marshal(objectMap) +} + +// RelayServiceConnectionEntityProperties - RelayServiceConnectionEntity resource specific properties +type RelayServiceConnectionEntityProperties struct { + BiztalkURI *string `json:"biztalkUri,omitempty"` + EntityConnectionString *string `json:"entityConnectionString,omitempty"` + EntityName *string `json:"entityName,omitempty"` + Hostname *string `json:"hostname,omitempty"` + Port *int32 `json:"port,omitempty"` + ResourceConnectionString *string `json:"resourceConnectionString,omitempty"` + ResourceType *string `json:"resourceType,omitempty"` +} + +// RemotePrivateEndpointConnection - A remote private endpoint connection +type RemotePrivateEndpointConnection struct { + ProxyOnlyResource + // RemotePrivateEndpointConnection resource specific properties + Properties *RemotePrivateEndpointConnectionProperties `json:"properties,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type RemotePrivateEndpointConnection. +func (r RemotePrivateEndpointConnection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + r.ProxyOnlyResource.marshalInternal(objectMap) + populate(objectMap, "properties", r.Properties) + return json.Marshal(objectMap) +} + +// RemotePrivateEndpointConnectionARMResource - Remote Private Endpoint Connection ARM resource. +type RemotePrivateEndpointConnectionARMResource struct { + ProxyOnlyResource + // RemotePrivateEndpointConnectionARMResource resource specific properties + Properties *RemotePrivateEndpointConnectionARMResourceProperties `json:"properties,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type RemotePrivateEndpointConnectionARMResource. +func (r RemotePrivateEndpointConnectionARMResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + r.ProxyOnlyResource.marshalInternal(objectMap) + populate(objectMap, "properties", r.Properties) + return json.Marshal(objectMap) +} + +// RemotePrivateEndpointConnectionARMResourceProperties - RemotePrivateEndpointConnectionARMResource resource specific properties +type RemotePrivateEndpointConnectionARMResourceProperties struct { + // Private IPAddresses mapped to the remote private endpoint + IPAddresses []*string `json:"ipAddresses,omitempty"` + + // PrivateEndpoint of a remote private endpoint connection + PrivateEndpoint *ArmIDWrapper `json:"privateEndpoint,omitempty"` + + // The state of a private link connection + PrivateLinkServiceConnectionState *PrivateLinkConnectionState `json:"privateLinkServiceConnectionState,omitempty"` + + // READ-ONLY + ProvisioningState *string `json:"provisioningState,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type RemotePrivateEndpointConnectionARMResourceProperties. +func (r RemotePrivateEndpointConnectionARMResourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "ipAddresses", r.IPAddresses) + populate(objectMap, "privateEndpoint", r.PrivateEndpoint) + populate(objectMap, "privateLinkServiceConnectionState", r.PrivateLinkServiceConnectionState) + populate(objectMap, "provisioningState", r.ProvisioningState) + return json.Marshal(objectMap) +} + +// RemotePrivateEndpointConnectionProperties - RemotePrivateEndpointConnection resource specific properties +type RemotePrivateEndpointConnectionProperties struct { + // Private IPAddresses mapped to the remote private endpoint + IPAddresses []*string `json:"ipAddresses,omitempty"` + + // PrivateEndpoint of a remote private endpoint connection + PrivateEndpoint *ArmIDWrapper `json:"privateEndpoint,omitempty"` + + // The state of a private link connection + PrivateLinkServiceConnectionState *PrivateLinkConnectionState `json:"privateLinkServiceConnectionState,omitempty"` + + // READ-ONLY + ProvisioningState *string `json:"provisioningState,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type RemotePrivateEndpointConnectionProperties. +func (r RemotePrivateEndpointConnectionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "ipAddresses", r.IPAddresses) + populate(objectMap, "privateEndpoint", r.PrivateEndpoint) + populate(objectMap, "privateLinkServiceConnectionState", r.PrivateLinkServiceConnectionState) + populate(objectMap, "provisioningState", r.ProvisioningState) + return json.Marshal(objectMap) +} + +// Rendering - Instructions for rendering the data +type Rendering struct { + // Description of the data that will help it be interpreted + Description *string `json:"description,omitempty"` + + // Title of data + Title *string `json:"title,omitempty"` + + // Rendering Type + Type *RenderingType `json:"type,omitempty"` +} + +// RenewCertificateOrderRequest - Class representing certificate renew request. +type RenewCertificateOrderRequest struct { + ProxyOnlyResource + // RenewCertificateOrderRequest resource specific properties + Properties *RenewCertificateOrderRequestProperties `json:"properties,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type RenewCertificateOrderRequest. +func (r RenewCertificateOrderRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + r.ProxyOnlyResource.marshalInternal(objectMap) + populate(objectMap, "properties", r.Properties) + return json.Marshal(objectMap) +} + +// RenewCertificateOrderRequestProperties - RenewCertificateOrderRequest resource specific properties +type RenewCertificateOrderRequestProperties struct { + // Csr to be used for re-key operation. + Csr *string `json:"csr,omitempty"` + + // Should we change the ASC type (from managed private key to external private key and vice versa). + IsPrivateKeyExternal *bool `json:"isPrivateKeyExternal,omitempty"` + + // Certificate Key Size. + KeySize *int32 `json:"keySize,omitempty"` +} + +// RequestsBasedTrigger - Trigger based on total requests. +type RequestsBasedTrigger struct { + // Request Count. + Count *int32 `json:"count,omitempty"` + + // Time interval. + TimeInterval *string `json:"timeInterval,omitempty"` +} + +// Resource - Azure resource. This resource is tracked in Azure Resource Manager +type Resource struct { + // REQUIRED; Resource Location. + Location *string `json:"location,omitempty"` + + // Kind of resource. + Kind *string `json:"kind,omitempty"` + + // Resource tags. + Tags map[string]*string `json:"tags,omitempty"` + + // READ-ONLY; Resource Id. + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; Resource Name. + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; Resource type. + Type *string `json:"type,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type Resource. +func (r Resource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + r.marshalInternal(objectMap) + return json.Marshal(objectMap) +} + +func (r Resource) marshalInternal(objectMap map[string]interface{}) { + populate(objectMap, "id", r.ID) + populate(objectMap, "kind", r.Kind) + populate(objectMap, "location", r.Location) + populate(objectMap, "name", r.Name) + populate(objectMap, "tags", r.Tags) + populate(objectMap, "type", r.Type) +} + +// ResourceCollection - Collection of resources. +type ResourceCollection struct { + // REQUIRED; Collection of resources. + Value []*string `json:"value,omitempty"` + + // READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type ResourceCollection. +func (r ResourceCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", r.NextLink) + populate(objectMap, "value", r.Value) + return json.Marshal(objectMap) +} + +// ResourceHealthMetadata - Used for getting ResourceHealthCheck settings. +type ResourceHealthMetadata struct { + ProxyOnlyResource + // ResourceHealthMetadata resource specific properties + Properties *ResourceHealthMetadataProperties `json:"properties,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type ResourceHealthMetadata. +func (r ResourceHealthMetadata) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + r.ProxyOnlyResource.marshalInternal(objectMap) + populate(objectMap, "properties", r.Properties) + return json.Marshal(objectMap) +} + +// ResourceHealthMetadataCollection - Collection of resource health metadata. +type ResourceHealthMetadataCollection struct { + // REQUIRED; Collection of resources. + Value []*ResourceHealthMetadata `json:"value,omitempty"` + + // READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type ResourceHealthMetadataCollection. +func (r ResourceHealthMetadataCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", r.NextLink) + populate(objectMap, "value", r.Value) + return json.Marshal(objectMap) +} + +// ResourceHealthMetadataGetBySiteOptions contains the optional parameters for the ResourceHealthMetadata.GetBySite method. +type ResourceHealthMetadataGetBySiteOptions struct { + // placeholder for future optional parameters +} + +// ResourceHealthMetadataGetBySiteSlotOptions contains the optional parameters for the ResourceHealthMetadata.GetBySiteSlot method. +type ResourceHealthMetadataGetBySiteSlotOptions struct { + // placeholder for future optional parameters +} + +// ResourceHealthMetadataListByResourceGroupOptions contains the optional parameters for the ResourceHealthMetadata.ListByResourceGroup method. +type ResourceHealthMetadataListByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// ResourceHealthMetadataListBySiteOptions contains the optional parameters for the ResourceHealthMetadata.ListBySite method. +type ResourceHealthMetadataListBySiteOptions struct { + // placeholder for future optional parameters +} + +// ResourceHealthMetadataListBySiteSlotOptions contains the optional parameters for the ResourceHealthMetadata.ListBySiteSlot method. +type ResourceHealthMetadataListBySiteSlotOptions struct { + // placeholder for future optional parameters +} + +// ResourceHealthMetadataListOptions contains the optional parameters for the ResourceHealthMetadata.List method. +type ResourceHealthMetadataListOptions struct { + // placeholder for future optional parameters +} + +// ResourceHealthMetadataProperties - ResourceHealthMetadata resource specific properties +type ResourceHealthMetadataProperties struct { + // The category that the resource matches in the RHC Policy File + Category *string `json:"category,omitempty"` + + // Is there a health signal for the resource + SignalAvailability *bool `json:"signalAvailability,omitempty"` +} + +// ResourceMetricAvailability - Metrics availability and retention. +type ResourceMetricAvailability struct { + // READ-ONLY; Retention period for the current time grain. + Retention *string `json:"retention,omitempty" azure:"ro"` + + // READ-ONLY; Time grain . + TimeGrain *string `json:"timeGrain,omitempty" azure:"ro"` +} + +// ResourceMetricDefinition - Metadata for the metrics. +type ResourceMetricDefinition struct { + ProxyOnlyResource + // ResourceMetricDefinition resource specific properties + Properties *ResourceMetricDefinitionProperties `json:"properties,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type ResourceMetricDefinition. +func (r ResourceMetricDefinition) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + r.ProxyOnlyResource.marshalInternal(objectMap) + populate(objectMap, "properties", r.Properties) + return json.Marshal(objectMap) +} + +// ResourceMetricDefinitionCollection - Collection of metric definitions. +type ResourceMetricDefinitionCollection struct { + // REQUIRED; Collection of resources. + Value []*ResourceMetricDefinition `json:"value,omitempty"` + + // READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type ResourceMetricDefinitionCollection. +func (r ResourceMetricDefinitionCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", r.NextLink) + populate(objectMap, "value", r.Value) + return json.Marshal(objectMap) +} + +// ResourceMetricDefinitionProperties - ResourceMetricDefinition resource specific properties +type ResourceMetricDefinitionProperties struct { + // READ-ONLY; List of time grains supported for the metric together with retention period. + MetricAvailabilities []*ResourceMetricAvailability `json:"metricAvailabilities,omitempty" azure:"ro"` + + // READ-ONLY; Primary aggregation type. + PrimaryAggregationType *string `json:"primaryAggregationType,omitempty" azure:"ro"` + + // READ-ONLY; Resource metric definition properties. + Properties map[string]*string `json:"properties,omitempty" azure:"ro"` + + // READ-ONLY; Resource URI. + ResourceURI *string `json:"resourceUri,omitempty" azure:"ro"` + + // READ-ONLY; Unit of the metric. + Unit *string `json:"unit,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type ResourceMetricDefinitionProperties. +func (r ResourceMetricDefinitionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "metricAvailabilities", r.MetricAvailabilities) + populate(objectMap, "primaryAggregationType", r.PrimaryAggregationType) + populate(objectMap, "properties", r.Properties) + populate(objectMap, "resourceUri", r.ResourceURI) + populate(objectMap, "unit", r.Unit) + return json.Marshal(objectMap) +} + +// ResourceNameAvailability - Information regarding availability of a resource name. +type ResourceNameAvailability struct { + // If reason == invalid, provide the user with the reason why the given name is invalid, and provide the resource naming requirements so that the user can + // select a valid name. If reason == AlreadyExists, + // explain that resource name is already in use, and direct them to select a different name. + Message *string `json:"message,omitempty"` + + // true indicates name is valid and available. false indicates the name is invalid, unavailable, or both. + NameAvailable *bool `json:"nameAvailable,omitempty"` + + // Invalid indicates the name provided does not match Azure App Service naming requirements. AlreadyExists indicates that the name is already in use and + // is therefore unavailable. + Reason *InAvailabilityReasonType `json:"reason,omitempty"` +} + +// ResourceNameAvailabilityRequest - Resource name availability request content. +type ResourceNameAvailabilityRequest struct { + // REQUIRED; Resource name to verify. + Name *string `json:"name,omitempty"` + + // REQUIRED; Resource type used for verification. + Type *CheckNameResourceTypes `json:"type,omitempty"` + + // Is fully qualified domain name. + IsFqdn *bool `json:"isFqdn,omitempty"` +} + +// ResponseMessageEnvelopeRemotePrivateEndpointConnection - Message envelope that contains the common Azure resource manager properties and the resource +// provider specific content. +type ResponseMessageEnvelopeRemotePrivateEndpointConnection struct { + // Azure-AsyncOperation Error info. + Error *ErrorEntity `json:"error,omitempty"` + + // Resource Id. Typically ID is populated only for responses to GET requests. Caller is responsible for passing in this value for GET requests only. For + // example: + // /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupId}/providers/Microsoft.Web/sites/{sitename} + ID *string `json:"id,omitempty"` + + // MSI resource + Identity *ManagedServiceIdentity `json:"identity,omitempty"` + + // Geographical region resource belongs to e.g. SouthCentralUS, SouthEastAsia. + Location *string `json:"location,omitempty"` + + // Name of resource. + Name *string `json:"name,omitempty"` + + // Azure resource manager plan. + Plan *ArmPlan `json:"plan,omitempty"` + + // Resource specific properties. + Properties *RemotePrivateEndpointConnection `json:"properties,omitempty"` + + // SKU description of the resource. + SKU *SKUDescription `json:"sku,omitempty"` + + // Azure-AsyncOperation Status info. + Status *string `json:"status,omitempty"` + + // Tags associated with resource. + Tags map[string]*string `json:"tags,omitempty"` + + // Type of resource e.g "Microsoft.Web/sites". + Type *string `json:"type,omitempty"` + + // Logical Availability Zones the service is hosted in + Zones []*string `json:"zones,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type ResponseMessageEnvelopeRemotePrivateEndpointConnection. +func (r ResponseMessageEnvelopeRemotePrivateEndpointConnection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "error", r.Error) + populate(objectMap, "id", r.ID) + populate(objectMap, "identity", r.Identity) + populate(objectMap, "location", r.Location) + populate(objectMap, "name", r.Name) + populate(objectMap, "plan", r.Plan) + populate(objectMap, "properties", r.Properties) + populate(objectMap, "sku", r.SKU) + populate(objectMap, "status", r.Status) + populate(objectMap, "tags", r.Tags) + populate(objectMap, "type", r.Type) + populate(objectMap, "zones", r.Zones) + return json.Marshal(objectMap) +} + +type ResponseMetaData struct { + // Source of the Data + DataSource *DataSource `json:"dataSource,omitempty"` +} + +// RestoreRequest - Description of a restore request. +type RestoreRequest struct { + ProxyOnlyResource + // RestoreRequest resource specific properties + Properties *RestoreRequestProperties `json:"properties,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type RestoreRequest. +func (r RestoreRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + r.ProxyOnlyResource.marshalInternal(objectMap) + populate(objectMap, "properties", r.Properties) + return json.Marshal(objectMap) +} + +// RestoreRequestProperties - RestoreRequest resource specific properties +type RestoreRequestProperties struct { + // REQUIRED; true if the restore operation can overwrite target app; otherwise, false. true is needed if trying to restore over an existing app. + Overwrite *bool `json:"overwrite,omitempty"` + + // REQUIRED; SAS URL to the container. + StorageAccountURL *string `json:"storageAccountUrl,omitempty"` + + // true if SiteConfig.ConnectionStrings should be set in new app; otherwise, false. + AdjustConnectionStrings *bool `json:"adjustConnectionStrings,omitempty"` + + // Specify app service plan that will own restored site. + AppServicePlan *string `json:"appServicePlan,omitempty"` + + // Name of a blob which contains the backup. + BlobName *string `json:"blobName,omitempty"` + + // Collection of databases which should be restored. This list has to match the list of databases included in the backup. + Databases []*DatabaseBackupSetting `json:"databases,omitempty"` + + // App Service Environment name, if needed (only when restoring an app to an App Service Environment). + HostingEnvironment *string `json:"hostingEnvironment,omitempty"` + + // Changes a logic when restoring an app with custom domains. true to remove custom domains automatically. If false, custom domains are added to the app's + // object when it is being restored, but that might + // fail due to conflicts during the operation. + IgnoreConflictingHostNames *bool `json:"ignoreConflictingHostNames,omitempty"` + + // Ignore the databases and only restore the site content + IgnoreDatabases *bool `json:"ignoreDatabases,omitempty"` + + // Operation type. + OperationType *BackupRestoreOperationType `json:"operationType,omitempty"` + + // Name of an app. + SiteName *string `json:"siteName,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type RestoreRequestProperties. +func (r RestoreRequestProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "adjustConnectionStrings", r.AdjustConnectionStrings) + populate(objectMap, "appServicePlan", r.AppServicePlan) + populate(objectMap, "blobName", r.BlobName) + populate(objectMap, "databases", r.Databases) + populate(objectMap, "hostingEnvironment", r.HostingEnvironment) + populate(objectMap, "ignoreConflictingHostNames", r.IgnoreConflictingHostNames) + populate(objectMap, "ignoreDatabases", r.IgnoreDatabases) + populate(objectMap, "operationType", r.OperationType) + populate(objectMap, "overwrite", r.Overwrite) + populate(objectMap, "siteName", r.SiteName) + populate(objectMap, "storageAccountUrl", r.StorageAccountURL) + return json.Marshal(objectMap) +} + +// SKUCapacity - Description of the App Service plan scale options. +type SKUCapacity struct { + // Default number of workers for this App Service plan SKU. + Default *int32 `json:"default,omitempty"` + + // Maximum number of Elastic workers for this App Service plan SKU. + ElasticMaximum *int32 `json:"elasticMaximum,omitempty"` + + // Maximum number of workers for this App Service plan SKU. + Maximum *int32 `json:"maximum,omitempty"` + + // Minimum number of workers for this App Service plan SKU. + Minimum *int32 `json:"minimum,omitempty"` + + // Available scale configurations for an App Service plan. + ScaleType *string `json:"scaleType,omitempty"` +} + +// SKUDescription - Description of a SKU for a scalable resource. +type SKUDescription struct { + // Capabilities of the SKU, e.g., is traffic manager enabled? + Capabilities []*Capability `json:"capabilities,omitempty"` + + // Current number of instances assigned to the resource. + Capacity *int32 `json:"capacity,omitempty"` + + // Family code of the resource SKU. + Family *string `json:"family,omitempty"` + + // Locations of the SKU. + Locations []*string `json:"locations,omitempty"` + + // Name of the resource SKU. + Name *string `json:"name,omitempty"` + + // Min, max, and default scale values of the SKU. + SKUCapacity *SKUCapacity `json:"skuCapacity,omitempty"` + + // Size specifier of the resource SKU. + Size *string `json:"size,omitempty"` + + // Service tier of the resource SKU. + Tier *string `json:"tier,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type SKUDescription. +func (s SKUDescription) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "capabilities", s.Capabilities) + populate(objectMap, "capacity", s.Capacity) + populate(objectMap, "family", s.Family) + populate(objectMap, "locations", s.Locations) + populate(objectMap, "name", s.Name) + populate(objectMap, "skuCapacity", s.SKUCapacity) + populate(objectMap, "size", s.Size) + populate(objectMap, "tier", s.Tier) + return json.Marshal(objectMap) +} + +// SKUInfo - SKU discovery information. +type SKUInfo struct { + // Min, max, and default scale values of the SKU. + Capacity *SKUCapacity `json:"capacity,omitempty"` + + // Resource type that this SKU applies to. + ResourceType *string `json:"resourceType,omitempty"` + + // Name and tier of the SKU. + SKU *SKUDescription `json:"sku,omitempty"` +} + +// SKUInfoCollection - Collection of SKU information. +type SKUInfoCollection struct { + // REQUIRED; Collection of resources. + Value []*SKUInfo `json:"value,omitempty"` + + // READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type SKUInfoCollection. +func (s SKUInfoCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// SKUInfos - Collection of SKU information. +type SKUInfos struct { + // Resource type that this SKU applies to. + ResourceType *string `json:"resourceType,omitempty"` + + // List of SKUs the subscription is able to use. + SKUs []*GlobalCsmSKUDescription `json:"skus,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type SKUInfos. +func (s SKUInfos) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "resourceType", s.ResourceType) + populate(objectMap, "skus", s.SKUs) + return json.Marshal(objectMap) +} + +// SampleUtterance - Sample utterance. +type SampleUtterance struct { + // Links attribute of sample utterance. + Links []*string `json:"links,omitempty"` + + // Question id of sample utterance (for stackoverflow questions titles). + Qid *string `json:"qid,omitempty"` + + // Text attribute of sample utterance. + Text *string `json:"text,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type SampleUtterance. +func (s SampleUtterance) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "links", s.Links) + populate(objectMap, "qid", s.Qid) + populate(objectMap, "text", s.Text) + return json.Marshal(objectMap) +} + +// ServiceSpecification - Resource metrics service provided by Microsoft.Insights resource provider. +type ServiceSpecification struct { + LogSpecifications []*LogSpecification `json:"logSpecifications,omitempty"` + MetricSpecifications []*MetricSpecification `json:"metricSpecifications,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type ServiceSpecification. +func (s ServiceSpecification) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "logSpecifications", s.LogSpecifications) + populate(objectMap, "metricSpecifications", s.MetricSpecifications) + return json.Marshal(objectMap) +} + +// Site - A web app, a mobile app backend, or an API app. +type Site struct { + Resource + // Extended Location. + ExtendedLocation *ExtendedLocation `json:"extendedLocation,omitempty"` + + // Managed service identity. + Identity *ManagedServiceIdentity `json:"identity,omitempty"` + + // Site resource specific properties + Properties *SiteProperties `json:"properties,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type Site. +func (s Site) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + s.Resource.marshalInternal(objectMap) + populate(objectMap, "extendedLocation", s.ExtendedLocation) + populate(objectMap, "identity", s.Identity) + populate(objectMap, "properties", s.Properties) + return json.Marshal(objectMap) +} + +// SiteAuthSettings - Configuration settings for the Azure App Service Authentication / Authorization feature. +type SiteAuthSettings struct { + ProxyOnlyResource + // SiteAuthSettings resource specific properties + Properties *SiteAuthSettingsProperties `json:"properties,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type SiteAuthSettings. +func (s SiteAuthSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + s.ProxyOnlyResource.marshalInternal(objectMap) + populate(objectMap, "properties", s.Properties) + return json.Marshal(objectMap) +} + +// SiteAuthSettingsProperties - SiteAuthSettings resource specific properties +type SiteAuthSettingsProperties struct { + // Gets a JSON string containing the Azure AD Acl settings. + AADClaimsAuthorization *string `json:"aadClaimsAuthorization,omitempty"` + + // Login parameters to send to the OpenID Connect authorization endpoint when a user logs in. Each parameter must be in the form "key=value". + AdditionalLoginParams []*string `json:"additionalLoginParams,omitempty"` + + // Allowed audience values to consider when validating JWTs issued by Azure Active Directory. Note that the ClientID value is always considered an allowed + // audience, regardless of this setting. + AllowedAudiences []*string `json:"allowedAudiences,omitempty"` + + // External URLs that can be redirected to as part of logging in or logging out of the app. Note that the query string part of the URL is ignored. This + // is an advanced setting typically only needed by + // Windows Store application backends. Note that URLs within the current domain are always implicitly allowed. + AllowedExternalRedirectUrls []*string `json:"allowedExternalRedirectUrls,omitempty"` + + // The path of the config file containing auth settings. If the path is relative, base will the site's root directory. + AuthFilePath *string `json:"authFilePath,omitempty"` + + // The Client ID of this relying party application, known as the clientid. This setting is required for enabling OpenID Connection authentication with Azure + // Active Directory or other 3rd party OpenID + // Connect providers. More information on OpenID Connect: http://openid.net/specs/openid-connect-core-10.html + ClientID *string `json:"clientId,omitempty"` + + // The Client Secret of this relying party application (in Azure Active Directory, this is also referred to as the Key). This setting is optional. If no + // client secret is configured, the OpenID Connect + // implicit auth flow is used to authenticate end users. Otherwise, the OpenID Connect Authorization Code Flow is used to authenticate end users. More information + // on OpenID Connect: + // http://openid.net/specs/openid-connect-core-1_0.html + ClientSecret *string `json:"clientSecret,omitempty"` + + // An alternative to the client secret, that is the thumbprint of a certificate used for signing purposes. This property acts as a replacement for the Client + // Secret. It is also optional. + ClientSecretCertificateThumbprint *string `json:"clientSecretCertificateThumbprint,omitempty"` + + // The app setting name that contains the client secret of the relying party application. + ClientSecretSettingName *string `json:"clientSecretSettingName,omitempty"` + + // The ConfigVersion of the Authentication / Authorization feature in use for the current app. The setting in this value can control the behavior of the + // control plane for Authentication / Authorization. + ConfigVersion *string `json:"configVersion,omitempty"` + + // The default authentication provider to use when multiple providers are configured. This setting is only needed if multiple providers are configured and + // the unauthenticated client action is set to + // "RedirectToLoginPage". + DefaultProvider *BuiltInAuthenticationProvider `json:"defaultProvider,omitempty"` + + // true if the Authentication / Authorization feature is enabled for the current app; otherwise, false. + Enabled *bool `json:"enabled,omitempty"` + + // The App ID of the Facebook app used for login. This setting is required for enabling Facebook Login. Facebook Login documentation: https://developers.facebook.com/docs/facebook-login + FacebookAppID *string `json:"facebookAppId,omitempty"` + + // The App Secret of the Facebook app used for Facebook Login. This setting is required for enabling Facebook Login. Facebook Login documentation: https://developers.facebook.com/docs/facebook-login + FacebookAppSecret *string `json:"facebookAppSecret,omitempty"` + + // The app setting name that contains the app secret used for Facebook Login. + FacebookAppSecretSettingName *string `json:"facebookAppSecretSettingName,omitempty"` + + // The OAuth 2.0 scopes that will be requested as part of Facebook Login authentication. This setting is optional. Facebook Login documentation: https://developers.facebook.com/docs/facebook-login + FacebookOAuthScopes []*string `json:"facebookOAuthScopes,omitempty"` + + // The Client Id of the GitHub app used for login. This setting is required for enabling Github login + GitHubClientID *string `json:"gitHubClientId,omitempty"` + + // The Client Secret of the GitHub app used for Github Login. This setting is required for enabling Github login. + GitHubClientSecret *string `json:"gitHubClientSecret,omitempty"` + + // The app setting name that contains the client secret of the Github app used for GitHub Login. + GitHubClientSecretSettingName *string `json:"gitHubClientSecretSettingName,omitempty"` + + // The OAuth 2.0 scopes that will be requested as part of GitHub Login authentication. This setting is optional + GitHubOAuthScopes []*string `json:"gitHubOAuthScopes,omitempty"` + + // The OpenID Connect Client ID for the Google web application. This setting is required for enabling Google Sign-In. Google Sign-In documentation: https://developers.google.com/identity/sign-in/web/ + GoogleClientID *string `json:"googleClientId,omitempty"` + + // The client secret associated with the Google web application. This setting is required for enabling Google Sign-In. Google Sign-In documentation: https://developers.google.com/identity/sign-in/web/ + GoogleClientSecret *string `json:"googleClientSecret,omitempty"` + + // The app setting name that contains the client secret associated with the Google web application. + GoogleClientSecretSettingName *string `json:"googleClientSecretSettingName,omitempty"` + + // The OAuth 2.0 scopes that will be requested as part of Google Sign-In authentication. This setting is optional. If not specified, "openid", "profile", + // and "email" are used as default scopes. Google + // Sign-In documentation: https://developers.google.com/identity/sign-in/web/ + GoogleOAuthScopes []*string `json:"googleOAuthScopes,omitempty"` + + // "true" if the auth config settings should be read from a file, "false" otherwise + IsAuthFromFile *string `json:"isAuthFromFile,omitempty"` + + // The OpenID Connect Issuer URI that represents the entity which issues access tokens for this application. When using Azure Active Directory, this value + // is the URI of the directory tenant, e.g. + // https://sts.windows.net/{tenant-guid}/. This URI is a case-sensitive identifier for the token issuer. More information on OpenID Connect Discovery: + // http://openid.net/specs/openid-connect-discovery-1_0.html + Issuer *string `json:"issuer,omitempty"` + + // The OAuth 2.0 client ID that was created for the app used for authentication. This setting is required for enabling Microsoft Account authentication. + // Microsoft Account OAuth documentation: + // https://dev.onedrive.com/auth/msa_oauth.htm + MicrosoftAccountClientID *string `json:"microsoftAccountClientId,omitempty"` + + // The OAuth 2.0 client secret that was created for the app used for authentication. This setting is required for enabling Microsoft Account authentication. + // Microsoft Account OAuth documentation: + // https://dev.onedrive.com/auth/msa_oauth.htm + MicrosoftAccountClientSecret *string `json:"microsoftAccountClientSecret,omitempty"` + + // The app setting name containing the OAuth 2.0 client secret that was created for the app used for authentication. + MicrosoftAccountClientSecretSettingName *string `json:"microsoftAccountClientSecretSettingName,omitempty"` + + // The OAuth 2.0 scopes that will be requested as part of Microsoft Account authentication. This setting is optional. If not specified, "wl.basic" is used + // as the default scope. Microsoft Account Scopes + // and permissions documentation: https://msdn.microsoft.com/en-us/library/dn631845.aspx + MicrosoftAccountOAuthScopes []*string `json:"microsoftAccountOAuthScopes,omitempty"` + + // The RuntimeVersion of the Authentication / Authorization feature in use for the current app. The setting in this value can control the behavior of certain + // features in the Authentication / + // Authorization module. + RuntimeVersion *string `json:"runtimeVersion,omitempty"` + + // The number of hours after session token expiration that a session token can be used to call the token refresh API. The default is 72 hours. + TokenRefreshExtensionHours *float64 `json:"tokenRefreshExtensionHours,omitempty"` + + // true to durably store platform-specific security tokens that are obtained during login flows; otherwise, false. The default is false. + TokenStoreEnabled *bool `json:"tokenStoreEnabled,omitempty"` + + // The OAuth 1.0a consumer key of the Twitter application used for sign-in. This setting is required for enabling Twitter Sign-In. Twitter Sign-In documentation: + // https://dev.twitter.com/web/sign-in + TwitterConsumerKey *string `json:"twitterConsumerKey,omitempty"` + + // The OAuth 1.0a consumer secret of the Twitter application used for sign-in. This setting is required for enabling Twitter Sign-In. Twitter Sign-In documentation: + // https://dev.twitter.com/web/sign-in + TwitterConsumerSecret *string `json:"twitterConsumerSecret,omitempty"` + + // The app setting name that contains the OAuth 1.0a consumer secret of the Twitter application used for sign-in. + TwitterConsumerSecretSettingName *string `json:"twitterConsumerSecretSettingName,omitempty"` + + // The action to take when an unauthenticated client attempts to access the app. + UnauthenticatedClientAction *UnauthenticatedClientAction `json:"unauthenticatedClientAction,omitempty"` + + // Gets a value indicating whether the issuer should be a valid HTTPS url and be validated as such. + ValidateIssuer *bool `json:"validateIssuer,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type SiteAuthSettingsProperties. +func (s SiteAuthSettingsProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "aadClaimsAuthorization", s.AADClaimsAuthorization) + populate(objectMap, "additionalLoginParams", s.AdditionalLoginParams) + populate(objectMap, "allowedAudiences", s.AllowedAudiences) + populate(objectMap, "allowedExternalRedirectUrls", s.AllowedExternalRedirectUrls) + populate(objectMap, "authFilePath", s.AuthFilePath) + populate(objectMap, "clientId", s.ClientID) + populate(objectMap, "clientSecret", s.ClientSecret) + populate(objectMap, "clientSecretCertificateThumbprint", s.ClientSecretCertificateThumbprint) + populate(objectMap, "clientSecretSettingName", s.ClientSecretSettingName) + populate(objectMap, "configVersion", s.ConfigVersion) + populate(objectMap, "defaultProvider", s.DefaultProvider) + populate(objectMap, "enabled", s.Enabled) + populate(objectMap, "facebookAppId", s.FacebookAppID) + populate(objectMap, "facebookAppSecret", s.FacebookAppSecret) + populate(objectMap, "facebookAppSecretSettingName", s.FacebookAppSecretSettingName) + populate(objectMap, "facebookOAuthScopes", s.FacebookOAuthScopes) + populate(objectMap, "gitHubClientId", s.GitHubClientID) + populate(objectMap, "gitHubClientSecret", s.GitHubClientSecret) + populate(objectMap, "gitHubClientSecretSettingName", s.GitHubClientSecretSettingName) + populate(objectMap, "gitHubOAuthScopes", s.GitHubOAuthScopes) + populate(objectMap, "googleClientId", s.GoogleClientID) + populate(objectMap, "googleClientSecret", s.GoogleClientSecret) + populate(objectMap, "googleClientSecretSettingName", s.GoogleClientSecretSettingName) + populate(objectMap, "googleOAuthScopes", s.GoogleOAuthScopes) + populate(objectMap, "isAuthFromFile", s.IsAuthFromFile) + populate(objectMap, "issuer", s.Issuer) + populate(objectMap, "microsoftAccountClientId", s.MicrosoftAccountClientID) + populate(objectMap, "microsoftAccountClientSecret", s.MicrosoftAccountClientSecret) + populate(objectMap, "microsoftAccountClientSecretSettingName", s.MicrosoftAccountClientSecretSettingName) + populate(objectMap, "microsoftAccountOAuthScopes", s.MicrosoftAccountOAuthScopes) + populate(objectMap, "runtimeVersion", s.RuntimeVersion) + populate(objectMap, "tokenRefreshExtensionHours", s.TokenRefreshExtensionHours) + populate(objectMap, "tokenStoreEnabled", s.TokenStoreEnabled) + populate(objectMap, "twitterConsumerKey", s.TwitterConsumerKey) + populate(objectMap, "twitterConsumerSecret", s.TwitterConsumerSecret) + populate(objectMap, "twitterConsumerSecretSettingName", s.TwitterConsumerSecretSettingName) + populate(objectMap, "unauthenticatedClientAction", s.UnauthenticatedClientAction) + populate(objectMap, "validateIssuer", s.ValidateIssuer) + return json.Marshal(objectMap) +} + +// SiteAuthSettingsV2 - Configuration settings for the Azure App Service Authentication / Authorization V2 feature. +type SiteAuthSettingsV2 struct { + ProxyOnlyResource + // SiteAuthSettingsV2 resource specific properties + Properties *SiteAuthSettingsV2Properties `json:"properties,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type SiteAuthSettingsV2. +func (s SiteAuthSettingsV2) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + s.ProxyOnlyResource.marshalInternal(objectMap) + populate(objectMap, "properties", s.Properties) + return json.Marshal(objectMap) +} + +// SiteAuthSettingsV2Properties - SiteAuthSettingsV2 resource specific properties +type SiteAuthSettingsV2Properties struct { + // The configuration settings that determines the validation flow of users using App Service Authentication/Authorization. + GlobalValidation *GlobalValidation `json:"globalValidation,omitempty"` + + // The configuration settings of the HTTP requests for authentication and authorization requests made against App Service Authentication/Authorization. + HTTPSettings *HTTPSettings `json:"httpSettings,omitempty"` + + // The configuration settings of each of the identity providers used to configure App Service Authentication/Authorization. + IdentityProviders *IdentityProviders `json:"identityProviders,omitempty"` + + // The configuration settings of the login flow of users using App Service Authentication/Authorization. + Login *Login `json:"login,omitempty"` + + // The configuration settings of the platform of App Service Authentication/Authorization. + Platform *AuthPlatform `json:"platform,omitempty"` +} + +// SiteCloneability - Represents whether or not an app is cloneable. +type SiteCloneability struct { + // List of blocking application characteristics. + BlockingCharacteristics []*SiteCloneabilityCriterion `json:"blockingCharacteristics,omitempty"` + + // List of features enabled on app that prevent cloning. + BlockingFeatures []*SiteCloneabilityCriterion `json:"blockingFeatures,omitempty"` + + // Name of app. + Result *CloneAbilityResult `json:"result,omitempty"` + + // List of features enabled on app that are non-blocking but cannot be cloned. The app can still be cloned but the features in this list will not be set + // up on cloned app. + UnsupportedFeatures []*SiteCloneabilityCriterion `json:"unsupportedFeatures,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type SiteCloneability. +func (s SiteCloneability) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "blockingCharacteristics", s.BlockingCharacteristics) + populate(objectMap, "blockingFeatures", s.BlockingFeatures) + populate(objectMap, "result", s.Result) + populate(objectMap, "unsupportedFeatures", s.UnsupportedFeatures) + return json.Marshal(objectMap) +} + +// SiteCloneabilityCriterion - An app cloneability criterion. +type SiteCloneabilityCriterion struct { + // Description of criterion. + Description *string `json:"description,omitempty"` + + // Name of criterion. + Name *string `json:"name,omitempty"` +} + +// SiteConfig - Configuration of an App Service app. +type SiteConfig struct { + // Information about the formal API definition for the app. + APIDefinition *APIDefinitionInfo `json:"apiDefinition,omitempty"` + + // Azure API management settings linked to the app. + APIManagementConfig *APIManagementConfig `json:"apiManagementConfig,omitempty"` + + // Flag to use Managed Identity Creds for ACR pull + AcrUseManagedIdentityCreds *bool `json:"acrUseManagedIdentityCreds,omitempty"` + + // If using user managed identity, the user managed identity ClientId + AcrUserManagedIdentityID *string `json:"acrUserManagedIdentityID,omitempty"` + + // true if Always On is enabled; otherwise, false. + AlwaysOn *bool `json:"alwaysOn,omitempty"` + + // App command line to launch. + AppCommandLine *string `json:"appCommandLine,omitempty"` + + // Application settings. + AppSettings []*NameValuePair `json:"appSettings,omitempty"` + + // true if Auto Heal is enabled; otherwise, false. + AutoHealEnabled *bool `json:"autoHealEnabled,omitempty"` + + // Auto Heal rules. + AutoHealRules *AutoHealRules `json:"autoHealRules,omitempty"` + + // Auto-swap slot name. + AutoSwapSlotName *string `json:"autoSwapSlotName,omitempty"` + + // List of Azure Storage Accounts. + AzureStorageAccounts map[string]*AzureStorageInfoValue `json:"azureStorageAccounts,omitempty"` + + // Connection strings. + ConnectionStrings []*ConnStringInfo `json:"connectionStrings,omitempty"` + + // Cross-Origin Resource Sharing (CORS) settings. + Cors *CorsSettings `json:"cors,omitempty"` + + // Default documents. + DefaultDocuments []*string `json:"defaultDocuments,omitempty"` + + // true if detailed error logging is enabled; otherwise, false. + DetailedErrorLoggingEnabled *bool `json:"detailedErrorLoggingEnabled,omitempty"` + + // Document root. + DocumentRoot *string `json:"documentRoot,omitempty"` + + // This is work around for polymorphic types. + Experiments *Experiments `json:"experiments,omitempty"` + + // State of FTP / FTPS service + FtpsState *FtpsState `json:"ftpsState,omitempty"` + + // Maximum number of workers that a site can scale out to. This setting only applies to the Consumption and Elastic Premium Plans + FunctionAppScaleLimit *int32 `json:"functionAppScaleLimit,omitempty"` + + // Gets or sets a value indicating whether functions runtime scale monitoring is enabled. When enabled, the ScaleController will not monitor event sources + // directly, but will instead call to the runtime + // to get scale status. + FunctionsRuntimeScaleMonitoringEnabled *bool `json:"functionsRuntimeScaleMonitoringEnabled,omitempty"` + + // true if HTTP logging is enabled; otherwise, false. + HTTPLoggingEnabled *bool `json:"httpLoggingEnabled,omitempty"` + + // Handler mappings. + HandlerMappings []*HandlerMapping `json:"handlerMappings,omitempty"` + + // Health check path + HealthCheckPath *string `json:"healthCheckPath,omitempty"` + + // Http20Enabled: configures a web site to allow clients to connect over http2.0 + Http20Enabled *bool `json:"http20Enabled,omitempty"` + + // IP security restrictions for main. + IPSecurityRestrictions []*IPSecurityRestriction `json:"ipSecurityRestrictions,omitempty"` + + // Java container. + JavaContainer *string `json:"javaContainer,omitempty"` + + // Java container version. + JavaContainerVersion *string `json:"javaContainerVersion,omitempty"` + + // Java version. + JavaVersion *string `json:"javaVersion,omitempty"` + + // Identity to use for Key Vault Reference authentication. + KeyVaultReferenceIdentity *string `json:"keyVaultReferenceIdentity,omitempty"` + + // Site limits. + Limits *SiteLimits `json:"limits,omitempty"` + + // Linux App Framework and version + LinuxFxVersion *string `json:"linuxFxVersion,omitempty"` + + // Site load balancing. + LoadBalancing *SiteLoadBalancing `json:"loadBalancing,omitempty"` + + // true to enable local MySQL; otherwise, false. + LocalMySQLEnabled *bool `json:"localMySqlEnabled,omitempty"` + + // HTTP logs directory size limit. + LogsDirectorySizeLimit *int32 `json:"logsDirectorySizeLimit,omitempty"` + + // Managed pipeline mode. + ManagedPipelineMode *ManagedPipelineMode `json:"managedPipelineMode,omitempty"` + + // Managed Service Identity Id + ManagedServiceIdentityID *int32 `json:"managedServiceIdentityId,omitempty"` + + // MinTlsVersion: configures the minimum version of TLS required for SSL requests + MinTLSVersion *SupportedTLSVersions `json:"minTlsVersion,omitempty"` + + // Number of minimum instance count for a site This setting only applies to the Elastic Plans + MinimumElasticInstanceCount *int32 `json:"minimumElasticInstanceCount,omitempty"` + + // .NET Framework version. + NetFrameworkVersion *string `json:"netFrameworkVersion,omitempty"` + + // Version of Node.js. + NodeVersion *string `json:"nodeVersion,omitempty"` + + // Number of workers. + NumberOfWorkers *int32 `json:"numberOfWorkers,omitempty"` + + // Version of PHP. + PhpVersion *string `json:"phpVersion,omitempty"` + + // Version of PowerShell. + PowerShellVersion *string `json:"powerShellVersion,omitempty"` + + // Number of preWarmed instances. This setting only applies to the Consumption and Elastic Plans + PreWarmedInstanceCount *int32 `json:"preWarmedInstanceCount,omitempty"` + + // Property to allow or block all public traffic. + PublicNetworkAccess *string `json:"publicNetworkAccess,omitempty"` + + // Publishing user name. + PublishingUsername *string `json:"publishingUsername,omitempty"` + + // Push endpoint settings. + Push *PushSettings `json:"push,omitempty"` + + // Version of Python. + PythonVersion *string `json:"pythonVersion,omitempty"` + + // true if remote debugging is enabled; otherwise, false. + RemoteDebuggingEnabled *bool `json:"remoteDebuggingEnabled,omitempty"` + + // Remote debugging version. + RemoteDebuggingVersion *string `json:"remoteDebuggingVersion,omitempty"` + + // true if request tracing is enabled; otherwise, false. + RequestTracingEnabled *bool `json:"requestTracingEnabled,omitempty"` + + // Request tracing expiration time. + RequestTracingExpirationTime *time.Time `json:"requestTracingExpirationTime,omitempty"` + + // IP security restrictions for scm. + ScmIPSecurityRestrictions []*IPSecurityRestriction `json:"scmIpSecurityRestrictions,omitempty"` + + // IP security restrictions for scm to use main. + ScmIPSecurityRestrictionsUseMain *bool `json:"scmIpSecurityRestrictionsUseMain,omitempty"` + + // ScmMinTlsVersion: configures the minimum version of TLS required for SSL requests for SCM site + ScmMinTLSVersion *SupportedTLSVersions `json:"scmMinTlsVersion,omitempty"` + + // SCM type. + ScmType *ScmType `json:"scmType,omitempty"` + + // Tracing options. + TracingOptions *string `json:"tracingOptions,omitempty"` + + // true to use 32-bit worker process; otherwise, false. + Use32BitWorkerProcess *bool `json:"use32BitWorkerProcess,omitempty"` + + // Virtual applications. + VirtualApplications []*VirtualApplication `json:"virtualApplications,omitempty"` + + // Virtual Network name. + VnetName *string `json:"vnetName,omitempty"` + + // The number of private ports assigned to this app. These will be assigned dynamically on runtime. + VnetPrivatePortsCount *int32 `json:"vnetPrivatePortsCount,omitempty"` + + // Virtual Network Route All enabled. This causes all outbound traffic to have Virtual Network Security Groups and User Defined Routes applied. + VnetRouteAllEnabled *bool `json:"vnetRouteAllEnabled,omitempty"` + + // true if WebSocket is enabled; otherwise, false. + WebSocketsEnabled *bool `json:"webSocketsEnabled,omitempty"` + + // Sets the time zone a site uses for generating timestamps. Compatible with Linux and Windows App Service. Setting the WEBSITETIMEZONE app setting takes + // precedence over this config. For Linux, expects + // tz database values https://www.iana.org/time-zones (for a quick reference see https://en.wikipedia.org/wiki/Listoftzdatabasetimezones). For Windows, + // expects one of the time zones listed under HKEY + // LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones + WebsiteTimeZone *string `json:"websiteTimeZone,omitempty"` + + // Xenon App Framework and version + WindowsFxVersion *string `json:"windowsFxVersion,omitempty"` + + // Explicit Managed Service Identity Id + XManagedServiceIdentityID *int32 `json:"xManagedServiceIdentityId,omitempty"` + + // READ-ONLY; Site MachineKey. + MachineKey *SiteMachineKey `json:"machineKey,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type SiteConfig. +func (s SiteConfig) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "apiDefinition", s.APIDefinition) + populate(objectMap, "apiManagementConfig", s.APIManagementConfig) + populate(objectMap, "acrUseManagedIdentityCreds", s.AcrUseManagedIdentityCreds) + populate(objectMap, "acrUserManagedIdentityID", s.AcrUserManagedIdentityID) + populate(objectMap, "alwaysOn", s.AlwaysOn) + populate(objectMap, "appCommandLine", s.AppCommandLine) + populate(objectMap, "appSettings", s.AppSettings) + populate(objectMap, "autoHealEnabled", s.AutoHealEnabled) + populate(objectMap, "autoHealRules", s.AutoHealRules) + populate(objectMap, "autoSwapSlotName", s.AutoSwapSlotName) + populate(objectMap, "azureStorageAccounts", s.AzureStorageAccounts) + populate(objectMap, "connectionStrings", s.ConnectionStrings) + populate(objectMap, "cors", s.Cors) + populate(objectMap, "defaultDocuments", s.DefaultDocuments) + populate(objectMap, "detailedErrorLoggingEnabled", s.DetailedErrorLoggingEnabled) + populate(objectMap, "documentRoot", s.DocumentRoot) + populate(objectMap, "experiments", s.Experiments) + populate(objectMap, "ftpsState", s.FtpsState) + populate(objectMap, "functionAppScaleLimit", s.FunctionAppScaleLimit) + populate(objectMap, "functionsRuntimeScaleMonitoringEnabled", s.FunctionsRuntimeScaleMonitoringEnabled) + populate(objectMap, "httpLoggingEnabled", s.HTTPLoggingEnabled) + populate(objectMap, "handlerMappings", s.HandlerMappings) + populate(objectMap, "healthCheckPath", s.HealthCheckPath) + populate(objectMap, "http20Enabled", s.Http20Enabled) + populate(objectMap, "ipSecurityRestrictions", s.IPSecurityRestrictions) + populate(objectMap, "javaContainer", s.JavaContainer) + populate(objectMap, "javaContainerVersion", s.JavaContainerVersion) + populate(objectMap, "javaVersion", s.JavaVersion) + populate(objectMap, "keyVaultReferenceIdentity", s.KeyVaultReferenceIdentity) + populate(objectMap, "limits", s.Limits) + populate(objectMap, "linuxFxVersion", s.LinuxFxVersion) + populate(objectMap, "loadBalancing", s.LoadBalancing) + populate(objectMap, "localMySqlEnabled", s.LocalMySQLEnabled) + populate(objectMap, "logsDirectorySizeLimit", s.LogsDirectorySizeLimit) + populate(objectMap, "machineKey", s.MachineKey) + populate(objectMap, "managedPipelineMode", s.ManagedPipelineMode) + populate(objectMap, "managedServiceIdentityId", s.ManagedServiceIdentityID) + populate(objectMap, "minTlsVersion", s.MinTLSVersion) + populate(objectMap, "minimumElasticInstanceCount", s.MinimumElasticInstanceCount) + populate(objectMap, "netFrameworkVersion", s.NetFrameworkVersion) + populate(objectMap, "nodeVersion", s.NodeVersion) + populate(objectMap, "numberOfWorkers", s.NumberOfWorkers) + populate(objectMap, "phpVersion", s.PhpVersion) + populate(objectMap, "powerShellVersion", s.PowerShellVersion) + populate(objectMap, "preWarmedInstanceCount", s.PreWarmedInstanceCount) + populate(objectMap, "publicNetworkAccess", s.PublicNetworkAccess) + populate(objectMap, "publishingUsername", s.PublishingUsername) + populate(objectMap, "push", s.Push) + populate(objectMap, "pythonVersion", s.PythonVersion) + populate(objectMap, "remoteDebuggingEnabled", s.RemoteDebuggingEnabled) + populate(objectMap, "remoteDebuggingVersion", s.RemoteDebuggingVersion) + populate(objectMap, "requestTracingEnabled", s.RequestTracingEnabled) + populateTimeRFC3339(objectMap, "requestTracingExpirationTime", s.RequestTracingExpirationTime) + populate(objectMap, "scmIpSecurityRestrictions", s.ScmIPSecurityRestrictions) + populate(objectMap, "scmIpSecurityRestrictionsUseMain", s.ScmIPSecurityRestrictionsUseMain) + populate(objectMap, "scmMinTlsVersion", s.ScmMinTLSVersion) + populate(objectMap, "scmType", s.ScmType) + populate(objectMap, "tracingOptions", s.TracingOptions) + populate(objectMap, "use32BitWorkerProcess", s.Use32BitWorkerProcess) + populate(objectMap, "virtualApplications", s.VirtualApplications) + populate(objectMap, "vnetName", s.VnetName) + populate(objectMap, "vnetPrivatePortsCount", s.VnetPrivatePortsCount) + populate(objectMap, "vnetRouteAllEnabled", s.VnetRouteAllEnabled) + populate(objectMap, "webSocketsEnabled", s.WebSocketsEnabled) + populate(objectMap, "websiteTimeZone", s.WebsiteTimeZone) + populate(objectMap, "windowsFxVersion", s.WindowsFxVersion) + populate(objectMap, "xManagedServiceIdentityId", s.XManagedServiceIdentityID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SiteConfig. +func (s *SiteConfig) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "apiDefinition": + err = unpopulate(val, &s.APIDefinition) + delete(rawMsg, key) + case "apiManagementConfig": + err = unpopulate(val, &s.APIManagementConfig) + delete(rawMsg, key) + case "acrUseManagedIdentityCreds": + err = unpopulate(val, &s.AcrUseManagedIdentityCreds) + delete(rawMsg, key) + case "acrUserManagedIdentityID": + err = unpopulate(val, &s.AcrUserManagedIdentityID) + delete(rawMsg, key) + case "alwaysOn": + err = unpopulate(val, &s.AlwaysOn) + delete(rawMsg, key) + case "appCommandLine": + err = unpopulate(val, &s.AppCommandLine) + delete(rawMsg, key) + case "appSettings": + err = unpopulate(val, &s.AppSettings) + delete(rawMsg, key) + case "autoHealEnabled": + err = unpopulate(val, &s.AutoHealEnabled) + delete(rawMsg, key) + case "autoHealRules": + err = unpopulate(val, &s.AutoHealRules) + delete(rawMsg, key) + case "autoSwapSlotName": + err = unpopulate(val, &s.AutoSwapSlotName) + delete(rawMsg, key) + case "azureStorageAccounts": + err = unpopulate(val, &s.AzureStorageAccounts) + delete(rawMsg, key) + case "connectionStrings": + err = unpopulate(val, &s.ConnectionStrings) + delete(rawMsg, key) + case "cors": + err = unpopulate(val, &s.Cors) + delete(rawMsg, key) + case "defaultDocuments": + err = unpopulate(val, &s.DefaultDocuments) + delete(rawMsg, key) + case "detailedErrorLoggingEnabled": + err = unpopulate(val, &s.DetailedErrorLoggingEnabled) + delete(rawMsg, key) + case "documentRoot": + err = unpopulate(val, &s.DocumentRoot) + delete(rawMsg, key) + case "experiments": + err = unpopulate(val, &s.Experiments) + delete(rawMsg, key) + case "ftpsState": + err = unpopulate(val, &s.FtpsState) + delete(rawMsg, key) + case "functionAppScaleLimit": + err = unpopulate(val, &s.FunctionAppScaleLimit) + delete(rawMsg, key) + case "functionsRuntimeScaleMonitoringEnabled": + err = unpopulate(val, &s.FunctionsRuntimeScaleMonitoringEnabled) + delete(rawMsg, key) + case "httpLoggingEnabled": + err = unpopulate(val, &s.HTTPLoggingEnabled) + delete(rawMsg, key) + case "handlerMappings": + err = unpopulate(val, &s.HandlerMappings) + delete(rawMsg, key) + case "healthCheckPath": + err = unpopulate(val, &s.HealthCheckPath) + delete(rawMsg, key) + case "http20Enabled": + err = unpopulate(val, &s.Http20Enabled) + delete(rawMsg, key) + case "ipSecurityRestrictions": + err = unpopulate(val, &s.IPSecurityRestrictions) + delete(rawMsg, key) + case "javaContainer": + err = unpopulate(val, &s.JavaContainer) + delete(rawMsg, key) + case "javaContainerVersion": + err = unpopulate(val, &s.JavaContainerVersion) + delete(rawMsg, key) + case "javaVersion": + err = unpopulate(val, &s.JavaVersion) + delete(rawMsg, key) + case "keyVaultReferenceIdentity": + err = unpopulate(val, &s.KeyVaultReferenceIdentity) + delete(rawMsg, key) + case "limits": + err = unpopulate(val, &s.Limits) + delete(rawMsg, key) + case "linuxFxVersion": + err = unpopulate(val, &s.LinuxFxVersion) + delete(rawMsg, key) + case "loadBalancing": + err = unpopulate(val, &s.LoadBalancing) + delete(rawMsg, key) + case "localMySqlEnabled": + err = unpopulate(val, &s.LocalMySQLEnabled) + delete(rawMsg, key) + case "logsDirectorySizeLimit": + err = unpopulate(val, &s.LogsDirectorySizeLimit) + delete(rawMsg, key) + case "machineKey": + err = unpopulate(val, &s.MachineKey) + delete(rawMsg, key) + case "managedPipelineMode": + err = unpopulate(val, &s.ManagedPipelineMode) + delete(rawMsg, key) + case "managedServiceIdentityId": + err = unpopulate(val, &s.ManagedServiceIdentityID) + delete(rawMsg, key) + case "minTlsVersion": + err = unpopulate(val, &s.MinTLSVersion) + delete(rawMsg, key) + case "minimumElasticInstanceCount": + err = unpopulate(val, &s.MinimumElasticInstanceCount) + delete(rawMsg, key) + case "netFrameworkVersion": + err = unpopulate(val, &s.NetFrameworkVersion) + delete(rawMsg, key) + case "nodeVersion": + err = unpopulate(val, &s.NodeVersion) + delete(rawMsg, key) + case "numberOfWorkers": + err = unpopulate(val, &s.NumberOfWorkers) + delete(rawMsg, key) + case "phpVersion": + err = unpopulate(val, &s.PhpVersion) + delete(rawMsg, key) + case "powerShellVersion": + err = unpopulate(val, &s.PowerShellVersion) + delete(rawMsg, key) + case "preWarmedInstanceCount": + err = unpopulate(val, &s.PreWarmedInstanceCount) + delete(rawMsg, key) + case "publicNetworkAccess": + err = unpopulate(val, &s.PublicNetworkAccess) + delete(rawMsg, key) + case "publishingUsername": + err = unpopulate(val, &s.PublishingUsername) + delete(rawMsg, key) + case "push": + err = unpopulate(val, &s.Push) + delete(rawMsg, key) + case "pythonVersion": + err = unpopulate(val, &s.PythonVersion) + delete(rawMsg, key) + case "remoteDebuggingEnabled": + err = unpopulate(val, &s.RemoteDebuggingEnabled) + delete(rawMsg, key) + case "remoteDebuggingVersion": + err = unpopulate(val, &s.RemoteDebuggingVersion) + delete(rawMsg, key) + case "requestTracingEnabled": + err = unpopulate(val, &s.RequestTracingEnabled) + delete(rawMsg, key) + case "requestTracingExpirationTime": + err = unpopulateTimeRFC3339(val, &s.RequestTracingExpirationTime) + delete(rawMsg, key) + case "scmIpSecurityRestrictions": + err = unpopulate(val, &s.ScmIPSecurityRestrictions) + delete(rawMsg, key) + case "scmIpSecurityRestrictionsUseMain": + err = unpopulate(val, &s.ScmIPSecurityRestrictionsUseMain) + delete(rawMsg, key) + case "scmMinTlsVersion": + err = unpopulate(val, &s.ScmMinTLSVersion) + delete(rawMsg, key) + case "scmType": + err = unpopulate(val, &s.ScmType) + delete(rawMsg, key) + case "tracingOptions": + err = unpopulate(val, &s.TracingOptions) + delete(rawMsg, key) + case "use32BitWorkerProcess": + err = unpopulate(val, &s.Use32BitWorkerProcess) + delete(rawMsg, key) + case "virtualApplications": + err = unpopulate(val, &s.VirtualApplications) + delete(rawMsg, key) + case "vnetName": + err = unpopulate(val, &s.VnetName) + delete(rawMsg, key) + case "vnetPrivatePortsCount": + err = unpopulate(val, &s.VnetPrivatePortsCount) + delete(rawMsg, key) + case "vnetRouteAllEnabled": + err = unpopulate(val, &s.VnetRouteAllEnabled) + delete(rawMsg, key) + case "webSocketsEnabled": + err = unpopulate(val, &s.WebSocketsEnabled) + delete(rawMsg, key) + case "websiteTimeZone": + err = unpopulate(val, &s.WebsiteTimeZone) + delete(rawMsg, key) + case "windowsFxVersion": + err = unpopulate(val, &s.WindowsFxVersion) + delete(rawMsg, key) + case "xManagedServiceIdentityId": + err = unpopulate(val, &s.XManagedServiceIdentityID) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// SiteConfigPropertiesDictionary - Site config properties dictionary. +type SiteConfigPropertiesDictionary struct { + // READ-ONLY; JavaVersion configuration setting. + JavaVersion *string `json:"javaVersion,omitempty" azure:"ro"` + + // READ-ONLY; LinuxFxVersion configuration setting. + LinuxFxVersion *string `json:"linuxFxVersion,omitempty" azure:"ro"` + + // READ-ONLY; PowerShellVersion configuration setting. + PowerShellVersion *string `json:"powerShellVersion,omitempty" azure:"ro"` + + // READ-ONLY; true if use32BitWorkerProcess should be set to true for the stack; otherwise, false. + Use32BitWorkerProcess *bool `json:"use32BitWorkerProcess,omitempty" azure:"ro"` +} + +// SiteConfigResource - Web app configuration ARM resource. +type SiteConfigResource struct { + ProxyOnlyResource + // Core resource properties + Properties *SiteConfig `json:"properties,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type SiteConfigResource. +func (s SiteConfigResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + s.ProxyOnlyResource.marshalInternal(objectMap) + populate(objectMap, "properties", s.Properties) + return json.Marshal(objectMap) +} + +// SiteConfigResourceCollection - Collection of site configurations. +type SiteConfigResourceCollection struct { + // REQUIRED; Collection of resources. + Value []*SiteConfigResource `json:"value,omitempty"` + + // READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type SiteConfigResourceCollection. +func (s SiteConfigResourceCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// SiteConfigurationSnapshotInfo - A snapshot of a web app configuration. +type SiteConfigurationSnapshotInfo struct { + ProxyOnlyResource + // SiteConfigurationSnapshotInfo resource specific properties + Properties *SiteConfigurationSnapshotInfoProperties `json:"properties,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type SiteConfigurationSnapshotInfo. +func (s SiteConfigurationSnapshotInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + s.ProxyOnlyResource.marshalInternal(objectMap) + populate(objectMap, "properties", s.Properties) + return json.Marshal(objectMap) +} + +// SiteConfigurationSnapshotInfoCollection - Collection of metadata for the app configuration snapshots that can be restored. +type SiteConfigurationSnapshotInfoCollection struct { + // REQUIRED; Collection of resources. + Value []*SiteConfigurationSnapshotInfo `json:"value,omitempty"` + + // READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type SiteConfigurationSnapshotInfoCollection. +func (s SiteConfigurationSnapshotInfoCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// SiteConfigurationSnapshotInfoProperties - SiteConfigurationSnapshotInfo resource specific properties +type SiteConfigurationSnapshotInfoProperties struct { + // READ-ONLY; The id of the snapshot + SnapshotID *int32 `json:"snapshotId,omitempty" azure:"ro"` + + // READ-ONLY; The time the snapshot was taken. + Time *time.Time `json:"time,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type SiteConfigurationSnapshotInfoProperties. +func (s SiteConfigurationSnapshotInfoProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "snapshotId", s.SnapshotID) + populateTimeRFC3339(objectMap, "time", s.Time) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SiteConfigurationSnapshotInfoProperties. +func (s *SiteConfigurationSnapshotInfoProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "snapshotId": + err = unpopulate(val, &s.SnapshotID) + delete(rawMsg, key) + case "time": + err = unpopulateTimeRFC3339(val, &s.Time) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// SiteExtensionInfo - Site Extension Information. +type SiteExtensionInfo struct { + ProxyOnlyResource + // SiteExtensionInfo resource specific properties + Properties *SiteExtensionInfoProperties `json:"properties,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type SiteExtensionInfo. +func (s SiteExtensionInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + s.ProxyOnlyResource.marshalInternal(objectMap) + populate(objectMap, "properties", s.Properties) + return json.Marshal(objectMap) +} + +// SiteExtensionInfoCollection - Collection of Kudu site extension information elements. +type SiteExtensionInfoCollection struct { + // REQUIRED; Collection of resources. + Value []*SiteExtensionInfo `json:"value,omitempty"` + + // READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type SiteExtensionInfoCollection. +func (s SiteExtensionInfoCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// SiteExtensionInfoProperties - SiteExtensionInfo resource specific properties +type SiteExtensionInfoProperties struct { + // List of authors. + Authors []*string `json:"authors,omitempty"` + + // Site Extension comment. + Comment *string `json:"comment,omitempty"` + + // Detailed description. + Description *string `json:"description,omitempty"` + + // Count of downloads. + DownloadCount *int32 `json:"download_count,omitempty"` + + // Site extension ID. + ExtensionID *string `json:"extension_id,omitempty"` + + // Site extension type. + ExtensionType *SiteExtensionType `json:"extension_type,omitempty"` + + // Extension URL. + ExtensionURL *string `json:"extension_url,omitempty"` + + // Feed URL. + FeedURL *string `json:"feed_url,omitempty"` + + // Icon URL. + IconURL *string `json:"icon_url,omitempty"` + + // Installed timestamp. + InstalledDateTime *time.Time `json:"installed_date_time,omitempty"` + + // Installer command line parameters. + InstallerCommandLineParams *string `json:"installer_command_line_params,omitempty"` + + // License URL. + LicenseURL *string `json:"license_url,omitempty"` + + // true if the local version is the latest version; false otherwise. + LocalIsLatestVersion *bool `json:"local_is_latest_version,omitempty"` + + // Local path. + LocalPath *string `json:"local_path,omitempty"` + + // Project URL. + ProjectURL *string `json:"project_url,omitempty"` + + // Provisioning state. + ProvisioningState *string `json:"provisioningState,omitempty"` + + // Published timestamp. + PublishedDateTime *time.Time `json:"published_date_time,omitempty"` + + // Summary description. + Summary *string `json:"summary,omitempty"` + Title *string `json:"title,omitempty"` + + // Version information. + Version *string `json:"version,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type SiteExtensionInfoProperties. +func (s SiteExtensionInfoProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "authors", s.Authors) + populate(objectMap, "comment", s.Comment) + populate(objectMap, "description", s.Description) + populate(objectMap, "download_count", s.DownloadCount) + populate(objectMap, "extension_id", s.ExtensionID) + populate(objectMap, "extension_type", s.ExtensionType) + populate(objectMap, "extension_url", s.ExtensionURL) + populate(objectMap, "feed_url", s.FeedURL) + populate(objectMap, "icon_url", s.IconURL) + populateTimeRFC3339(objectMap, "installed_date_time", s.InstalledDateTime) + populate(objectMap, "installer_command_line_params", s.InstallerCommandLineParams) + populate(objectMap, "license_url", s.LicenseURL) + populate(objectMap, "local_is_latest_version", s.LocalIsLatestVersion) + populate(objectMap, "local_path", s.LocalPath) + populate(objectMap, "project_url", s.ProjectURL) + populate(objectMap, "provisioningState", s.ProvisioningState) + populateTimeRFC3339(objectMap, "published_date_time", s.PublishedDateTime) + populate(objectMap, "summary", s.Summary) + populate(objectMap, "title", s.Title) + populate(objectMap, "version", s.Version) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SiteExtensionInfoProperties. +func (s *SiteExtensionInfoProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "authors": + err = unpopulate(val, &s.Authors) + delete(rawMsg, key) + case "comment": + err = unpopulate(val, &s.Comment) + delete(rawMsg, key) + case "description": + err = unpopulate(val, &s.Description) + delete(rawMsg, key) + case "download_count": + err = unpopulate(val, &s.DownloadCount) + delete(rawMsg, key) + case "extension_id": + err = unpopulate(val, &s.ExtensionID) + delete(rawMsg, key) + case "extension_type": + err = unpopulate(val, &s.ExtensionType) + delete(rawMsg, key) + case "extension_url": + err = unpopulate(val, &s.ExtensionURL) + delete(rawMsg, key) + case "feed_url": + err = unpopulate(val, &s.FeedURL) + delete(rawMsg, key) + case "icon_url": + err = unpopulate(val, &s.IconURL) + delete(rawMsg, key) + case "installed_date_time": + err = unpopulateTimeRFC3339(val, &s.InstalledDateTime) + delete(rawMsg, key) + case "installer_command_line_params": + err = unpopulate(val, &s.InstallerCommandLineParams) + delete(rawMsg, key) + case "license_url": + err = unpopulate(val, &s.LicenseURL) + delete(rawMsg, key) + case "local_is_latest_version": + err = unpopulate(val, &s.LocalIsLatestVersion) + delete(rawMsg, key) + case "local_path": + err = unpopulate(val, &s.LocalPath) + delete(rawMsg, key) + case "project_url": + err = unpopulate(val, &s.ProjectURL) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, &s.ProvisioningState) + delete(rawMsg, key) + case "published_date_time": + err = unpopulateTimeRFC3339(val, &s.PublishedDateTime) + delete(rawMsg, key) + case "summary": + err = unpopulate(val, &s.Summary) + delete(rawMsg, key) + case "title": + err = unpopulate(val, &s.Title) + delete(rawMsg, key) + case "version": + err = unpopulate(val, &s.Version) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// SiteLimits - Metric limits set on an app. +type SiteLimits struct { + // Maximum allowed disk size usage in MB. + MaxDiskSizeInMb *int64 `json:"maxDiskSizeInMb,omitempty"` + + // Maximum allowed memory usage in MB. + MaxMemoryInMb *int64 `json:"maxMemoryInMb,omitempty"` + + // Maximum allowed CPU usage percentage. + MaxPercentageCPU *float64 `json:"maxPercentageCpu,omitempty"` +} + +// SiteLogsConfig - Configuration of App Service site logs. +type SiteLogsConfig struct { + ProxyOnlyResource + // SiteLogsConfig resource specific properties + Properties *SiteLogsConfigProperties `json:"properties,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type SiteLogsConfig. +func (s SiteLogsConfig) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + s.ProxyOnlyResource.marshalInternal(objectMap) + populate(objectMap, "properties", s.Properties) + return json.Marshal(objectMap) +} + +// SiteLogsConfigProperties - SiteLogsConfig resource specific properties +type SiteLogsConfigProperties struct { + // Application logs configuration. + ApplicationLogs *ApplicationLogsConfig `json:"applicationLogs,omitempty"` + + // Detailed error messages configuration. + DetailedErrorMessages *EnabledConfig `json:"detailedErrorMessages,omitempty"` + + // Failed requests tracing configuration. + FailedRequestsTracing *EnabledConfig `json:"failedRequestsTracing,omitempty"` + + // HTTP logs configuration. + HTTPLogs *HTTPLogsConfig `json:"httpLogs,omitempty"` +} + +// SiteMachineKey - MachineKey of an app. +type SiteMachineKey struct { + // Algorithm used for decryption. + Decryption *string `json:"decryption,omitempty"` + + // Decryption key. + DecryptionKey *string `json:"decryptionKey,omitempty"` + + // MachineKey validation. + Validation *string `json:"validation,omitempty"` + + // Validation key. + ValidationKey *string `json:"validationKey,omitempty"` +} + +// SitePatchResource - ARM resource for a site. +type SitePatchResource struct { + ProxyOnlyResource + // Managed service identity. + Identity *ManagedServiceIdentity `json:"identity,omitempty"` + + // SitePatchResource resource specific properties + Properties *SitePatchResourceProperties `json:"properties,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type SitePatchResource. +func (s SitePatchResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + s.ProxyOnlyResource.marshalInternal(objectMap) + populate(objectMap, "identity", s.Identity) + populate(objectMap, "properties", s.Properties) + return json.Marshal(objectMap) +} + +// SitePatchResourceProperties - SitePatchResource resource specific properties +type SitePatchResourceProperties struct { + // true to enable client affinity; false to stop sending session affinity cookies, which route client requests in the same session to the same instance. + // Default is true. + ClientAffinityEnabled *bool `json:"clientAffinityEnabled,omitempty"` + + // true to enable client certificate authentication (TLS mutual authentication); otherwise, false. Default is false. + ClientCertEnabled *bool `json:"clientCertEnabled,omitempty"` + + // client certificate authentication comma-separated exclusion paths + ClientCertExclusionPaths *string `json:"clientCertExclusionPaths,omitempty"` + + // This composes with ClientCertEnabled setting. + // * ClientCertEnabled: false means ClientCert is ignored. + // * ClientCertEnabled: true and ClientCertMode: Required means ClientCert is required. + // * ClientCertEnabled: true and ClientCertMode: Optional means ClientCert is optional or accepted. + ClientCertMode *ClientCertMode `json:"clientCertMode,omitempty"` + + // If specified during app creation, the app is cloned from a source app. + CloningInfo *CloningInfo `json:"cloningInfo,omitempty"` + + // Size of the function container. + ContainerSize *int32 `json:"containerSize,omitempty"` + + // Unique identifier that verifies the custom domains assigned to the app. Customer will add this id to a txt record for verification. + CustomDomainVerificationID *string `json:"customDomainVerificationId,omitempty"` + + // Maximum allowed daily memory-time quota (applicable on dynamic apps only). + DailyMemoryTimeQuota *int32 `json:"dailyMemoryTimeQuota,omitempty"` + + // true if the app is enabled; otherwise, false. Setting this value to false disables the app (takes the app offline). + Enabled *bool `json:"enabled,omitempty"` + + // HttpsOnly: configures a web site to accept only https requests. Issues redirect for http requests + HTTPSOnly *bool `json:"httpsOnly,omitempty"` + + // Hostname SSL states are used to manage the SSL bindings for app's hostnames. + HostNameSSLStates []*HostNameSSLState `json:"hostNameSslStates,omitempty"` + + // true to disable the public hostnames of the app; otherwise, false. If true, the app is only accessible via API management process. + HostNamesDisabled *bool `json:"hostNamesDisabled,omitempty"` + + // App Service Environment to use for the app. + HostingEnvironmentProfile *HostingEnvironmentProfile `json:"hostingEnvironmentProfile,omitempty"` + + // Hyper-V sandbox. + HyperV *bool `json:"hyperV,omitempty"` + + // Obsolete: Hyper-V sandbox. + IsXenon *bool `json:"isXenon,omitempty"` + + // Identity to use for Key Vault Reference authentication. + KeyVaultReferenceIdentity *string `json:"keyVaultReferenceIdentity,omitempty"` + + // Site redundancy mode + RedundancyMode *RedundancyMode `json:"redundancyMode,omitempty"` + + // true if reserved; otherwise, false. + Reserved *bool `json:"reserved,omitempty"` + + // true to stop SCM (KUDU) site when the app is stopped; otherwise, false. The default is false. + ScmSiteAlsoStopped *bool `json:"scmSiteAlsoStopped,omitempty"` + + // Resource ID of the associated App Service plan, formatted as: "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". + ServerFarmID *string `json:"serverFarmId,omitempty"` + + // Configuration of the app. + SiteConfig *SiteConfig `json:"siteConfig,omitempty"` + + // Checks if Customer provided storage account is required + StorageAccountRequired *bool `json:"storageAccountRequired,omitempty"` + + // Azure Resource Manager ID of the Virtual network and subnet to be joined by Regional VNET Integration. This must be of the form + // /subscriptions/{subscriptionName}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName} + VirtualNetworkSubnetID *string `json:"virtualNetworkSubnetId,omitempty"` + + // READ-ONLY; Management information availability state for the app. + AvailabilityState *SiteAvailabilityState `json:"availabilityState,omitempty" azure:"ro"` + + // READ-ONLY; Default hostname of the app. Read-only. + DefaultHostName *string `json:"defaultHostName,omitempty" azure:"ro"` + + // READ-ONLY; Enabled hostnames for the app.Hostnames need to be assigned (see HostNames) AND enabled. Otherwise, the app is not served on those hostnames. + EnabledHostNames []*string `json:"enabledHostNames,omitempty" azure:"ro"` + + // READ-ONLY; Hostnames associated with the app. + HostNames []*string `json:"hostNames,omitempty" azure:"ro"` + + // READ-ONLY; Specifies an operation id if this site has a pending operation. + InProgressOperationID *string `json:"inProgressOperationId,omitempty" azure:"ro"` + + // READ-ONLY; true if the app is a default container; otherwise, false. + IsDefaultContainer *bool `json:"isDefaultContainer,omitempty" azure:"ro"` + + // READ-ONLY; Last time the app was modified, in UTC. Read-only. + LastModifiedTimeUTC *time.Time `json:"lastModifiedTimeUtc,omitempty" azure:"ro"` + + // READ-ONLY; Maximum number of workers. This only applies to Functions container. + MaxNumberOfWorkers *int32 `json:"maxNumberOfWorkers,omitempty" azure:"ro"` + + // READ-ONLY; List of IP addresses that the app uses for outbound connections (e.g. database access). Includes VIPs from tenants that site can be hosted + // with current settings. Read-only. + OutboundIPAddresses *string `json:"outboundIpAddresses,omitempty" azure:"ro"` + + // READ-ONLY; List of IP addresses that the app uses for outbound connections (e.g. database access). Includes VIPs from all tenants except dataComponent. + // Read-only. + PossibleOutboundIPAddresses *string `json:"possibleOutboundIpAddresses,omitempty" azure:"ro"` + + // READ-ONLY; Name of the repository site. + RepositorySiteName *string `json:"repositorySiteName,omitempty" azure:"ro"` + + // READ-ONLY; Name of the resource group the app belongs to. Read-only. + ResourceGroup *string `json:"resourceGroup,omitempty" azure:"ro"` + + // READ-ONLY; Status of the last deployment slot swap operation. + SlotSwapStatus *SlotSwapStatus `json:"slotSwapStatus,omitempty" azure:"ro"` + + // READ-ONLY; Current state of the app. + State *string `json:"state,omitempty" azure:"ro"` + + // READ-ONLY; App suspended till in case memory-time quota is exceeded. + SuspendedTill *time.Time `json:"suspendedTill,omitempty" azure:"ro"` + + // READ-ONLY; Specifies which deployment slot this app will swap into. Read-only. + TargetSwapSlot *string `json:"targetSwapSlot,omitempty" azure:"ro"` + + // READ-ONLY; Azure Traffic Manager hostnames associated with the app. Read-only. + TrafficManagerHostNames []*string `json:"trafficManagerHostNames,omitempty" azure:"ro"` + + // READ-ONLY; State indicating whether the app has exceeded its quota usage. Read-only. + UsageState *UsageState `json:"usageState,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type SitePatchResourceProperties. +func (s SitePatchResourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "availabilityState", s.AvailabilityState) + populate(objectMap, "clientAffinityEnabled", s.ClientAffinityEnabled) + populate(objectMap, "clientCertEnabled", s.ClientCertEnabled) + populate(objectMap, "clientCertExclusionPaths", s.ClientCertExclusionPaths) + populate(objectMap, "clientCertMode", s.ClientCertMode) + populate(objectMap, "cloningInfo", s.CloningInfo) + populate(objectMap, "containerSize", s.ContainerSize) + populate(objectMap, "customDomainVerificationId", s.CustomDomainVerificationID) + populate(objectMap, "dailyMemoryTimeQuota", s.DailyMemoryTimeQuota) + populate(objectMap, "defaultHostName", s.DefaultHostName) + populate(objectMap, "enabled", s.Enabled) + populate(objectMap, "enabledHostNames", s.EnabledHostNames) + populate(objectMap, "httpsOnly", s.HTTPSOnly) + populate(objectMap, "hostNameSslStates", s.HostNameSSLStates) + populate(objectMap, "hostNames", s.HostNames) + populate(objectMap, "hostNamesDisabled", s.HostNamesDisabled) + populate(objectMap, "hostingEnvironmentProfile", s.HostingEnvironmentProfile) + populate(objectMap, "hyperV", s.HyperV) + populate(objectMap, "inProgressOperationId", s.InProgressOperationID) + populate(objectMap, "isDefaultContainer", s.IsDefaultContainer) + populate(objectMap, "isXenon", s.IsXenon) + populate(objectMap, "keyVaultReferenceIdentity", s.KeyVaultReferenceIdentity) + populateTimeRFC3339(objectMap, "lastModifiedTimeUtc", s.LastModifiedTimeUTC) + populate(objectMap, "maxNumberOfWorkers", s.MaxNumberOfWorkers) + populate(objectMap, "outboundIpAddresses", s.OutboundIPAddresses) + populate(objectMap, "possibleOutboundIpAddresses", s.PossibleOutboundIPAddresses) + populate(objectMap, "redundancyMode", s.RedundancyMode) + populate(objectMap, "repositorySiteName", s.RepositorySiteName) + populate(objectMap, "reserved", s.Reserved) + populate(objectMap, "resourceGroup", s.ResourceGroup) + populate(objectMap, "scmSiteAlsoStopped", s.ScmSiteAlsoStopped) + populate(objectMap, "serverFarmId", s.ServerFarmID) + populate(objectMap, "siteConfig", s.SiteConfig) + populate(objectMap, "slotSwapStatus", s.SlotSwapStatus) + populate(objectMap, "state", s.State) + populate(objectMap, "storageAccountRequired", s.StorageAccountRequired) + populateTimeRFC3339(objectMap, "suspendedTill", s.SuspendedTill) + populate(objectMap, "targetSwapSlot", s.TargetSwapSlot) + populate(objectMap, "trafficManagerHostNames", s.TrafficManagerHostNames) + populate(objectMap, "usageState", s.UsageState) + populate(objectMap, "virtualNetworkSubnetId", s.VirtualNetworkSubnetID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SitePatchResourceProperties. +func (s *SitePatchResourceProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "availabilityState": + err = unpopulate(val, &s.AvailabilityState) + delete(rawMsg, key) + case "clientAffinityEnabled": + err = unpopulate(val, &s.ClientAffinityEnabled) + delete(rawMsg, key) + case "clientCertEnabled": + err = unpopulate(val, &s.ClientCertEnabled) + delete(rawMsg, key) + case "clientCertExclusionPaths": + err = unpopulate(val, &s.ClientCertExclusionPaths) + delete(rawMsg, key) + case "clientCertMode": + err = unpopulate(val, &s.ClientCertMode) + delete(rawMsg, key) + case "cloningInfo": + err = unpopulate(val, &s.CloningInfo) + delete(rawMsg, key) + case "containerSize": + err = unpopulate(val, &s.ContainerSize) + delete(rawMsg, key) + case "customDomainVerificationId": + err = unpopulate(val, &s.CustomDomainVerificationID) + delete(rawMsg, key) + case "dailyMemoryTimeQuota": + err = unpopulate(val, &s.DailyMemoryTimeQuota) + delete(rawMsg, key) + case "defaultHostName": + err = unpopulate(val, &s.DefaultHostName) + delete(rawMsg, key) + case "enabled": + err = unpopulate(val, &s.Enabled) + delete(rawMsg, key) + case "enabledHostNames": + err = unpopulate(val, &s.EnabledHostNames) + delete(rawMsg, key) + case "httpsOnly": + err = unpopulate(val, &s.HTTPSOnly) + delete(rawMsg, key) + case "hostNameSslStates": + err = unpopulate(val, &s.HostNameSSLStates) + delete(rawMsg, key) + case "hostNames": + err = unpopulate(val, &s.HostNames) + delete(rawMsg, key) + case "hostNamesDisabled": + err = unpopulate(val, &s.HostNamesDisabled) + delete(rawMsg, key) + case "hostingEnvironmentProfile": + err = unpopulate(val, &s.HostingEnvironmentProfile) + delete(rawMsg, key) + case "hyperV": + err = unpopulate(val, &s.HyperV) + delete(rawMsg, key) + case "inProgressOperationId": + err = unpopulate(val, &s.InProgressOperationID) + delete(rawMsg, key) + case "isDefaultContainer": + err = unpopulate(val, &s.IsDefaultContainer) + delete(rawMsg, key) + case "isXenon": + err = unpopulate(val, &s.IsXenon) + delete(rawMsg, key) + case "keyVaultReferenceIdentity": + err = unpopulate(val, &s.KeyVaultReferenceIdentity) + delete(rawMsg, key) + case "lastModifiedTimeUtc": + err = unpopulateTimeRFC3339(val, &s.LastModifiedTimeUTC) + delete(rawMsg, key) + case "maxNumberOfWorkers": + err = unpopulate(val, &s.MaxNumberOfWorkers) + delete(rawMsg, key) + case "outboundIpAddresses": + err = unpopulate(val, &s.OutboundIPAddresses) + delete(rawMsg, key) + case "possibleOutboundIpAddresses": + err = unpopulate(val, &s.PossibleOutboundIPAddresses) + delete(rawMsg, key) + case "redundancyMode": + err = unpopulate(val, &s.RedundancyMode) + delete(rawMsg, key) + case "repositorySiteName": + err = unpopulate(val, &s.RepositorySiteName) + delete(rawMsg, key) + case "reserved": + err = unpopulate(val, &s.Reserved) + delete(rawMsg, key) + case "resourceGroup": + err = unpopulate(val, &s.ResourceGroup) + delete(rawMsg, key) + case "scmSiteAlsoStopped": + err = unpopulate(val, &s.ScmSiteAlsoStopped) + delete(rawMsg, key) + case "serverFarmId": + err = unpopulate(val, &s.ServerFarmID) + delete(rawMsg, key) + case "siteConfig": + err = unpopulate(val, &s.SiteConfig) + delete(rawMsg, key) + case "slotSwapStatus": + err = unpopulate(val, &s.SlotSwapStatus) + delete(rawMsg, key) + case "state": + err = unpopulate(val, &s.State) + delete(rawMsg, key) + case "storageAccountRequired": + err = unpopulate(val, &s.StorageAccountRequired) + delete(rawMsg, key) + case "suspendedTill": + err = unpopulateTimeRFC3339(val, &s.SuspendedTill) + delete(rawMsg, key) + case "targetSwapSlot": + err = unpopulate(val, &s.TargetSwapSlot) + delete(rawMsg, key) + case "trafficManagerHostNames": + err = unpopulate(val, &s.TrafficManagerHostNames) + delete(rawMsg, key) + case "usageState": + err = unpopulate(val, &s.UsageState) + delete(rawMsg, key) + case "virtualNetworkSubnetId": + err = unpopulate(val, &s.VirtualNetworkSubnetID) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// SitePhpErrorLogFlag - Used for getting PHP error logging flag. +type SitePhpErrorLogFlag struct { + ProxyOnlyResource + // SitePhpErrorLogFlag resource specific properties + Properties *SitePhpErrorLogFlagProperties `json:"properties,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type SitePhpErrorLogFlag. +func (s SitePhpErrorLogFlag) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + s.ProxyOnlyResource.marshalInternal(objectMap) + populate(objectMap, "properties", s.Properties) + return json.Marshal(objectMap) +} + +// SitePhpErrorLogFlagProperties - SitePhpErrorLogFlag resource specific properties +type SitePhpErrorLogFlagProperties struct { + // Local log_errors setting. + LocalLogErrors *string `json:"localLogErrors,omitempty"` + + // Local logerrorsmax_len setting. + LocalLogErrorsMaxLength *string `json:"localLogErrorsMaxLength,omitempty"` + + // Master log_errors setting. + MasterLogErrors *string `json:"masterLogErrors,omitempty"` + + // Master logerrorsmax_len setting. + MasterLogErrorsMaxLength *string `json:"masterLogErrorsMaxLength,omitempty"` +} + +// SiteProperties - Site resource specific properties +type SiteProperties struct { + // true to enable client affinity; false to stop sending session affinity cookies, which route client requests in the same session to the same instance. + // Default is true. + ClientAffinityEnabled *bool `json:"clientAffinityEnabled,omitempty"` + + // true to enable client certificate authentication (TLS mutual authentication); otherwise, false. Default is false. + ClientCertEnabled *bool `json:"clientCertEnabled,omitempty"` + + // client certificate authentication comma-separated exclusion paths + ClientCertExclusionPaths *string `json:"clientCertExclusionPaths,omitempty"` + + // This composes with ClientCertEnabled setting. + // * ClientCertEnabled: false means ClientCert is ignored. + // * ClientCertEnabled: true and ClientCertMode: Required means ClientCert is required. + // * ClientCertEnabled: true and ClientCertMode: Optional means ClientCert is optional or accepted. + ClientCertMode *ClientCertMode `json:"clientCertMode,omitempty"` + + // If specified during app creation, the app is cloned from a source app. + CloningInfo *CloningInfo `json:"cloningInfo,omitempty"` + + // Size of the function container. + ContainerSize *int32 `json:"containerSize,omitempty"` + + // Unique identifier that verifies the custom domains assigned to the app. Customer will add this id to a txt record for verification. + CustomDomainVerificationID *string `json:"customDomainVerificationId,omitempty"` + + // Maximum allowed daily memory-time quota (applicable on dynamic apps only). + DailyMemoryTimeQuota *int32 `json:"dailyMemoryTimeQuota,omitempty"` + + // true if the app is enabled; otherwise, false. Setting this value to false disables the app (takes the app offline). + Enabled *bool `json:"enabled,omitempty"` + + // HttpsOnly: configures a web site to accept only https requests. Issues redirect for http requests + HTTPSOnly *bool `json:"httpsOnly,omitempty"` + + // Hostname SSL states are used to manage the SSL bindings for app's hostnames. + HostNameSSLStates []*HostNameSSLState `json:"hostNameSslStates,omitempty"` + + // true to disable the public hostnames of the app; otherwise, false. If true, the app is only accessible via API management process. + HostNamesDisabled *bool `json:"hostNamesDisabled,omitempty"` + + // App Service Environment to use for the app. + HostingEnvironmentProfile *HostingEnvironmentProfile `json:"hostingEnvironmentProfile,omitempty"` + + // Hyper-V sandbox. + HyperV *bool `json:"hyperV,omitempty"` + + // Obsolete: Hyper-V sandbox. + IsXenon *bool `json:"isXenon,omitempty"` + + // Identity to use for Key Vault Reference authentication. + KeyVaultReferenceIdentity *string `json:"keyVaultReferenceIdentity,omitempty"` + + // Site redundancy mode + RedundancyMode *RedundancyMode `json:"redundancyMode,omitempty"` + + // true if reserved; otherwise, false. + Reserved *bool `json:"reserved,omitempty"` + + // true to stop SCM (KUDU) site when the app is stopped; otherwise, false. The default is false. + ScmSiteAlsoStopped *bool `json:"scmSiteAlsoStopped,omitempty"` + + // Resource ID of the associated App Service plan, formatted as: "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". + ServerFarmID *string `json:"serverFarmId,omitempty"` + + // Configuration of the app. + SiteConfig *SiteConfig `json:"siteConfig,omitempty"` + + // Checks if Customer provided storage account is required + StorageAccountRequired *bool `json:"storageAccountRequired,omitempty"` + + // Azure Resource Manager ID of the Virtual network and subnet to be joined by Regional VNET Integration. This must be of the form + // /subscriptions/{subscriptionName}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName} + VirtualNetworkSubnetID *string `json:"virtualNetworkSubnetId,omitempty"` + + // READ-ONLY; Management information availability state for the app. + AvailabilityState *SiteAvailabilityState `json:"availabilityState,omitempty" azure:"ro"` + + // READ-ONLY; Default hostname of the app. Read-only. + DefaultHostName *string `json:"defaultHostName,omitempty" azure:"ro"` + + // READ-ONLY; Enabled hostnames for the app.Hostnames need to be assigned (see HostNames) AND enabled. Otherwise, the app is not served on those hostnames. + EnabledHostNames []*string `json:"enabledHostNames,omitempty" azure:"ro"` + + // READ-ONLY; Hostnames associated with the app. + HostNames []*string `json:"hostNames,omitempty" azure:"ro"` + + // READ-ONLY; Specifies an operation id if this site has a pending operation. + InProgressOperationID *string `json:"inProgressOperationId,omitempty" azure:"ro"` + + // READ-ONLY; true if the app is a default container; otherwise, false. + IsDefaultContainer *bool `json:"isDefaultContainer,omitempty" azure:"ro"` + + // READ-ONLY; Last time the app was modified, in UTC. Read-only. + LastModifiedTimeUTC *time.Time `json:"lastModifiedTimeUtc,omitempty" azure:"ro"` + + // READ-ONLY; Maximum number of workers. This only applies to Functions container. + MaxNumberOfWorkers *int32 `json:"maxNumberOfWorkers,omitempty" azure:"ro"` + + // READ-ONLY; List of IP addresses that the app uses for outbound connections (e.g. database access). Includes VIPs from tenants that site can be hosted + // with current settings. Read-only. + OutboundIPAddresses *string `json:"outboundIpAddresses,omitempty" azure:"ro"` + + // READ-ONLY; List of IP addresses that the app uses for outbound connections (e.g. database access). Includes VIPs from all tenants except dataComponent. + // Read-only. + PossibleOutboundIPAddresses *string `json:"possibleOutboundIpAddresses,omitempty" azure:"ro"` + + // READ-ONLY; Name of the repository site. + RepositorySiteName *string `json:"repositorySiteName,omitempty" azure:"ro"` + + // READ-ONLY; Name of the resource group the app belongs to. Read-only. + ResourceGroup *string `json:"resourceGroup,omitempty" azure:"ro"` + + // READ-ONLY; Status of the last deployment slot swap operation. + SlotSwapStatus *SlotSwapStatus `json:"slotSwapStatus,omitempty" azure:"ro"` + + // READ-ONLY; Current state of the app. + State *string `json:"state,omitempty" azure:"ro"` + + // READ-ONLY; App suspended till in case memory-time quota is exceeded. + SuspendedTill *time.Time `json:"suspendedTill,omitempty" azure:"ro"` + + // READ-ONLY; Specifies which deployment slot this app will swap into. Read-only. + TargetSwapSlot *string `json:"targetSwapSlot,omitempty" azure:"ro"` + + // READ-ONLY; Azure Traffic Manager hostnames associated with the app. Read-only. + TrafficManagerHostNames []*string `json:"trafficManagerHostNames,omitempty" azure:"ro"` + + // READ-ONLY; State indicating whether the app has exceeded its quota usage. Read-only. + UsageState *UsageState `json:"usageState,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type SiteProperties. +func (s SiteProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "availabilityState", s.AvailabilityState) + populate(objectMap, "clientAffinityEnabled", s.ClientAffinityEnabled) + populate(objectMap, "clientCertEnabled", s.ClientCertEnabled) + populate(objectMap, "clientCertExclusionPaths", s.ClientCertExclusionPaths) + populate(objectMap, "clientCertMode", s.ClientCertMode) + populate(objectMap, "cloningInfo", s.CloningInfo) + populate(objectMap, "containerSize", s.ContainerSize) + populate(objectMap, "customDomainVerificationId", s.CustomDomainVerificationID) + populate(objectMap, "dailyMemoryTimeQuota", s.DailyMemoryTimeQuota) + populate(objectMap, "defaultHostName", s.DefaultHostName) + populate(objectMap, "enabled", s.Enabled) + populate(objectMap, "enabledHostNames", s.EnabledHostNames) + populate(objectMap, "httpsOnly", s.HTTPSOnly) + populate(objectMap, "hostNameSslStates", s.HostNameSSLStates) + populate(objectMap, "hostNames", s.HostNames) + populate(objectMap, "hostNamesDisabled", s.HostNamesDisabled) + populate(objectMap, "hostingEnvironmentProfile", s.HostingEnvironmentProfile) + populate(objectMap, "hyperV", s.HyperV) + populate(objectMap, "inProgressOperationId", s.InProgressOperationID) + populate(objectMap, "isDefaultContainer", s.IsDefaultContainer) + populate(objectMap, "isXenon", s.IsXenon) + populate(objectMap, "keyVaultReferenceIdentity", s.KeyVaultReferenceIdentity) + populateTimeRFC3339(objectMap, "lastModifiedTimeUtc", s.LastModifiedTimeUTC) + populate(objectMap, "maxNumberOfWorkers", s.MaxNumberOfWorkers) + populate(objectMap, "outboundIpAddresses", s.OutboundIPAddresses) + populate(objectMap, "possibleOutboundIpAddresses", s.PossibleOutboundIPAddresses) + populate(objectMap, "redundancyMode", s.RedundancyMode) + populate(objectMap, "repositorySiteName", s.RepositorySiteName) + populate(objectMap, "reserved", s.Reserved) + populate(objectMap, "resourceGroup", s.ResourceGroup) + populate(objectMap, "scmSiteAlsoStopped", s.ScmSiteAlsoStopped) + populate(objectMap, "serverFarmId", s.ServerFarmID) + populate(objectMap, "siteConfig", s.SiteConfig) + populate(objectMap, "slotSwapStatus", s.SlotSwapStatus) + populate(objectMap, "state", s.State) + populate(objectMap, "storageAccountRequired", s.StorageAccountRequired) + populateTimeRFC3339(objectMap, "suspendedTill", s.SuspendedTill) + populate(objectMap, "targetSwapSlot", s.TargetSwapSlot) + populate(objectMap, "trafficManagerHostNames", s.TrafficManagerHostNames) + populate(objectMap, "usageState", s.UsageState) + populate(objectMap, "virtualNetworkSubnetId", s.VirtualNetworkSubnetID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SiteProperties. +func (s *SiteProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "availabilityState": + err = unpopulate(val, &s.AvailabilityState) + delete(rawMsg, key) + case "clientAffinityEnabled": + err = unpopulate(val, &s.ClientAffinityEnabled) + delete(rawMsg, key) + case "clientCertEnabled": + err = unpopulate(val, &s.ClientCertEnabled) + delete(rawMsg, key) + case "clientCertExclusionPaths": + err = unpopulate(val, &s.ClientCertExclusionPaths) + delete(rawMsg, key) + case "clientCertMode": + err = unpopulate(val, &s.ClientCertMode) + delete(rawMsg, key) + case "cloningInfo": + err = unpopulate(val, &s.CloningInfo) + delete(rawMsg, key) + case "containerSize": + err = unpopulate(val, &s.ContainerSize) + delete(rawMsg, key) + case "customDomainVerificationId": + err = unpopulate(val, &s.CustomDomainVerificationID) + delete(rawMsg, key) + case "dailyMemoryTimeQuota": + err = unpopulate(val, &s.DailyMemoryTimeQuota) + delete(rawMsg, key) + case "defaultHostName": + err = unpopulate(val, &s.DefaultHostName) + delete(rawMsg, key) + case "enabled": + err = unpopulate(val, &s.Enabled) + delete(rawMsg, key) + case "enabledHostNames": + err = unpopulate(val, &s.EnabledHostNames) + delete(rawMsg, key) + case "httpsOnly": + err = unpopulate(val, &s.HTTPSOnly) + delete(rawMsg, key) + case "hostNameSslStates": + err = unpopulate(val, &s.HostNameSSLStates) + delete(rawMsg, key) + case "hostNames": + err = unpopulate(val, &s.HostNames) + delete(rawMsg, key) + case "hostNamesDisabled": + err = unpopulate(val, &s.HostNamesDisabled) + delete(rawMsg, key) + case "hostingEnvironmentProfile": + err = unpopulate(val, &s.HostingEnvironmentProfile) + delete(rawMsg, key) + case "hyperV": + err = unpopulate(val, &s.HyperV) + delete(rawMsg, key) + case "inProgressOperationId": + err = unpopulate(val, &s.InProgressOperationID) + delete(rawMsg, key) + case "isDefaultContainer": + err = unpopulate(val, &s.IsDefaultContainer) + delete(rawMsg, key) + case "isXenon": + err = unpopulate(val, &s.IsXenon) + delete(rawMsg, key) + case "keyVaultReferenceIdentity": + err = unpopulate(val, &s.KeyVaultReferenceIdentity) + delete(rawMsg, key) + case "lastModifiedTimeUtc": + err = unpopulateTimeRFC3339(val, &s.LastModifiedTimeUTC) + delete(rawMsg, key) + case "maxNumberOfWorkers": + err = unpopulate(val, &s.MaxNumberOfWorkers) + delete(rawMsg, key) + case "outboundIpAddresses": + err = unpopulate(val, &s.OutboundIPAddresses) + delete(rawMsg, key) + case "possibleOutboundIpAddresses": + err = unpopulate(val, &s.PossibleOutboundIPAddresses) + delete(rawMsg, key) + case "redundancyMode": + err = unpopulate(val, &s.RedundancyMode) + delete(rawMsg, key) + case "repositorySiteName": + err = unpopulate(val, &s.RepositorySiteName) + delete(rawMsg, key) + case "reserved": + err = unpopulate(val, &s.Reserved) + delete(rawMsg, key) + case "resourceGroup": + err = unpopulate(val, &s.ResourceGroup) + delete(rawMsg, key) + case "scmSiteAlsoStopped": + err = unpopulate(val, &s.ScmSiteAlsoStopped) + delete(rawMsg, key) + case "serverFarmId": + err = unpopulate(val, &s.ServerFarmID) + delete(rawMsg, key) + case "siteConfig": + err = unpopulate(val, &s.SiteConfig) + delete(rawMsg, key) + case "slotSwapStatus": + err = unpopulate(val, &s.SlotSwapStatus) + delete(rawMsg, key) + case "state": + err = unpopulate(val, &s.State) + delete(rawMsg, key) + case "storageAccountRequired": + err = unpopulate(val, &s.StorageAccountRequired) + delete(rawMsg, key) + case "suspendedTill": + err = unpopulateTimeRFC3339(val, &s.SuspendedTill) + delete(rawMsg, key) + case "targetSwapSlot": + err = unpopulate(val, &s.TargetSwapSlot) + delete(rawMsg, key) + case "trafficManagerHostNames": + err = unpopulate(val, &s.TrafficManagerHostNames) + delete(rawMsg, key) + case "usageState": + err = unpopulate(val, &s.UsageState) + delete(rawMsg, key) + case "virtualNetworkSubnetId": + err = unpopulate(val, &s.VirtualNetworkSubnetID) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// SiteSeal - Site seal +type SiteSeal struct { + // REQUIRED; HTML snippet + HTML *string `json:"html,omitempty"` +} + +// SiteSealRequest - Site seal request. +type SiteSealRequest struct { + // If true use the light color theme for site seal; otherwise, use the default color theme. + LightTheme *bool `json:"lightTheme,omitempty"` + + // Locale of site seal. + Locale *string `json:"locale,omitempty"` +} + +// SiteSourceControl - Source control configuration for an app. +type SiteSourceControl struct { + ProxyOnlyResource + // SiteSourceControl resource specific properties + Properties *SiteSourceControlProperties `json:"properties,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type SiteSourceControl. +func (s SiteSourceControl) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + s.ProxyOnlyResource.marshalInternal(objectMap) + populate(objectMap, "properties", s.Properties) + return json.Marshal(objectMap) +} + +// SiteSourceControlProperties - SiteSourceControl resource specific properties +type SiteSourceControlProperties struct { + // Name of branch to use for deployment. + Branch *string `json:"branch,omitempty"` + + // true to enable deployment rollback; otherwise, false. + DeploymentRollbackEnabled *bool `json:"deploymentRollbackEnabled,omitempty"` + + // If GitHub Action is selected, than the associated configuration. + GitHubActionConfiguration *GitHubActionConfiguration `json:"gitHubActionConfiguration,omitempty"` + + // true if this is deployed via GitHub action. + IsGitHubAction *bool `json:"isGitHubAction,omitempty"` + + // true to limit to manual integration; false to enable continuous integration (which configures webhooks into online repos like GitHub). + IsManualIntegration *bool `json:"isManualIntegration,omitempty"` + + // true for a Mercurial repository; false for a Git repository. + IsMercurial *bool `json:"isMercurial,omitempty"` + + // Repository or source control URL. + RepoURL *string `json:"repoUrl,omitempty"` +} + +// SlotConfigNames - Names for connection strings, application settings, and external Azure storage account configuration identifiers to be marked as sticky +// to the deployment slot and not moved during a swap operation. +// This is valid for all deployment slots in an app. +type SlotConfigNames struct { + // List of application settings names. + AppSettingNames []*string `json:"appSettingNames,omitempty"` + + // List of external Azure storage account identifiers. + AzureStorageConfigNames []*string `json:"azureStorageConfigNames,omitempty"` + + // List of connection string names. + ConnectionStringNames []*string `json:"connectionStringNames,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type SlotConfigNames. +func (s SlotConfigNames) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "appSettingNames", s.AppSettingNames) + populate(objectMap, "azureStorageConfigNames", s.AzureStorageConfigNames) + populate(objectMap, "connectionStringNames", s.ConnectionStringNames) + return json.Marshal(objectMap) +} + +// SlotConfigNamesResource - Slot Config names azure resource. +type SlotConfigNamesResource struct { + ProxyOnlyResource + // Core resource properties + Properties *SlotConfigNames `json:"properties,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type SlotConfigNamesResource. +func (s SlotConfigNamesResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + s.ProxyOnlyResource.marshalInternal(objectMap) + populate(objectMap, "properties", s.Properties) + return json.Marshal(objectMap) +} + +// SlotDifference - A setting difference between two deployment slots of an app. +type SlotDifference struct { + ProxyOnlyResource + // SlotDifference resource specific properties + Properties *SlotDifferenceProperties `json:"properties,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type SlotDifference. +func (s SlotDifference) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + s.ProxyOnlyResource.marshalInternal(objectMap) + populate(objectMap, "properties", s.Properties) + return json.Marshal(objectMap) +} + +// SlotDifferenceCollection - Collection of slot differences. +type SlotDifferenceCollection struct { + // REQUIRED; Collection of resources. + Value []*SlotDifference `json:"value,omitempty"` + + // READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type SlotDifferenceCollection. +func (s SlotDifferenceCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// SlotDifferenceProperties - SlotDifference resource specific properties +type SlotDifferenceProperties struct { + // READ-ONLY; Description of the setting difference. + Description *string `json:"description,omitempty" azure:"ro"` + + // READ-ONLY; Rule that describes how to process the setting difference during a slot swap. + DiffRule *string `json:"diffRule,omitempty" azure:"ro"` + + // READ-ONLY; Level of the difference: Information, Warning or Error. + Level *string `json:"level,omitempty" azure:"ro"` + + // READ-ONLY; Name of the setting. + SettingName *string `json:"settingName,omitempty" azure:"ro"` + + // READ-ONLY; The type of the setting: General, AppSetting or ConnectionString. + SettingType *string `json:"settingType,omitempty" azure:"ro"` + + // READ-ONLY; Value of the setting in the current slot. + ValueInCurrentSlot *string `json:"valueInCurrentSlot,omitempty" azure:"ro"` + + // READ-ONLY; Value of the setting in the target slot. + ValueInTargetSlot *string `json:"valueInTargetSlot,omitempty" azure:"ro"` +} + +// SlotSwapStatus - The status of the last successful slot swap operation. +type SlotSwapStatus struct { + // READ-ONLY; The destination slot of the last swap operation. + DestinationSlotName *string `json:"destinationSlotName,omitempty" azure:"ro"` + + // READ-ONLY; The source slot of the last swap operation. + SourceSlotName *string `json:"sourceSlotName,omitempty" azure:"ro"` + + // READ-ONLY; The time the last successful slot swap completed. + TimestampUTC *time.Time `json:"timestampUtc,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type SlotSwapStatus. +func (s SlotSwapStatus) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "destinationSlotName", s.DestinationSlotName) + populate(objectMap, "sourceSlotName", s.SourceSlotName) + populateTimeRFC3339(objectMap, "timestampUtc", s.TimestampUTC) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SlotSwapStatus. +func (s *SlotSwapStatus) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "destinationSlotName": + err = unpopulate(val, &s.DestinationSlotName) + delete(rawMsg, key) + case "sourceSlotName": + err = unpopulate(val, &s.SourceSlotName) + delete(rawMsg, key) + case "timestampUtc": + err = unpopulateTimeRFC3339(val, &s.TimestampUTC) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// SlowRequestsBasedTrigger - Trigger based on request execution time. +type SlowRequestsBasedTrigger struct { + // Request Count. + Count *int32 `json:"count,omitempty"` + + // Request Path. + Path *string `json:"path,omitempty"` + + // Time interval. + TimeInterval *string `json:"timeInterval,omitempty"` + + // Time taken. + TimeTaken *string `json:"timeTaken,omitempty"` +} + +// Snapshot - A snapshot of an app. +type Snapshot struct { + ProxyOnlyResource + // Snapshot resource specific properties + Properties *SnapshotProperties `json:"properties,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type Snapshot. +func (s Snapshot) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + s.ProxyOnlyResource.marshalInternal(objectMap) + populate(objectMap, "properties", s.Properties) + return json.Marshal(objectMap) +} + +// SnapshotCollection - Collection of snapshots which can be used to revert an app to a previous time. +type SnapshotCollection struct { + // REQUIRED; Collection of resources. + Value []*Snapshot `json:"value,omitempty"` + + // READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type SnapshotCollection. +func (s SnapshotCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// SnapshotProperties - Snapshot resource specific properties +type SnapshotProperties struct { + // READ-ONLY; The time the snapshot was taken. + Time *string `json:"time,omitempty" azure:"ro"` +} + +// SnapshotRecoverySource - Specifies the web app that snapshot contents will be retrieved from. +type SnapshotRecoverySource struct { + // ARM resource ID of the source app. /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName} for production + // slots and + // /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slotName} for other slots. + ID *string `json:"id,omitempty"` + + // Geographical location of the source web app, e.g. SouthEastAsia, SouthCentralUS + Location *string `json:"location,omitempty"` +} + +// SnapshotRestoreRequest - Details about app recovery operation. +type SnapshotRestoreRequest struct { + ProxyOnlyResource + // SnapshotRestoreRequest resource specific properties + Properties *SnapshotRestoreRequestProperties `json:"properties,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type SnapshotRestoreRequest. +func (s SnapshotRestoreRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + s.ProxyOnlyResource.marshalInternal(objectMap) + populate(objectMap, "properties", s.Properties) + return json.Marshal(objectMap) +} + +// SnapshotRestoreRequestProperties - SnapshotRestoreRequest resource specific properties +type SnapshotRestoreRequestProperties struct { + // REQUIRED; If true the restore operation can overwrite source app; otherwise, false. + Overwrite *bool `json:"overwrite,omitempty"` + + // If true, custom hostname conflicts will be ignored when recovering to a target web app. This setting is only necessary when RecoverConfiguration is enabled. + IgnoreConflictingHostNames *bool `json:"ignoreConflictingHostNames,omitempty"` + + // If true, site configuration, in addition to content, will be reverted. + RecoverConfiguration *bool `json:"recoverConfiguration,omitempty"` + + // Optional. Specifies the web app that snapshot contents will be retrieved from. If empty, the targeted web app will be used as the source. + RecoverySource *SnapshotRecoverySource `json:"recoverySource,omitempty"` + + // Point in time in which the app restore should be done, formatted as a DateTime string. + SnapshotTime *string `json:"snapshotTime,omitempty"` + + // If true, the snapshot is retrieved from DRSecondary endpoint. + UseDRSecondary *bool `json:"useDRSecondary,omitempty"` +} + +// Solution - Class Representing Solution for problems detected. +type Solution struct { + // Solution Data. + Data [][]*NameValuePair `json:"data,omitempty"` + + // Description of the solution + Description *string `json:"description,omitempty"` + + // Display Name of the solution + DisplayName *string `json:"displayName,omitempty"` + + // Solution Id. + ID *float64 `json:"id,omitempty"` + + // Solution Metadata. + Metadata [][]*NameValuePair `json:"metadata,omitempty"` + + // Order of the solution. + Order *float64 `json:"order,omitempty"` + + // Type of Solution + Type *SolutionType `json:"type,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type Solution. +func (s Solution) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "data", s.Data) + populate(objectMap, "description", s.Description) + populate(objectMap, "displayName", s.DisplayName) + populate(objectMap, "id", s.ID) + populate(objectMap, "metadata", s.Metadata) + populate(objectMap, "order", s.Order) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// SourceControl - The source control OAuth token. +type SourceControl struct { + ProxyOnlyResource + // SourceControl resource specific properties + Properties *SourceControlProperties `json:"properties,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type SourceControl. +func (s SourceControl) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + s.ProxyOnlyResource.marshalInternal(objectMap) + populate(objectMap, "properties", s.Properties) + return json.Marshal(objectMap) +} + +// SourceControlCollection - Collection of source controls. +type SourceControlCollection struct { + // REQUIRED; Collection of resources. + Value []*SourceControl `json:"value,omitempty"` + + // READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type SourceControlCollection. +func (s SourceControlCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// SourceControlProperties - SourceControl resource specific properties +type SourceControlProperties struct { + // OAuth token expiration. + ExpirationTime *time.Time `json:"expirationTime,omitempty"` + + // OAuth refresh token. + RefreshToken *string `json:"refreshToken,omitempty"` + + // OAuth access token. + Token *string `json:"token,omitempty"` + + // OAuth access token secret. + TokenSecret *string `json:"tokenSecret,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type SourceControlProperties. +func (s SourceControlProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populateTimeRFC3339(objectMap, "expirationTime", s.ExpirationTime) + populate(objectMap, "refreshToken", s.RefreshToken) + populate(objectMap, "token", s.Token) + populate(objectMap, "tokenSecret", s.TokenSecret) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SourceControlProperties. +func (s *SourceControlProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "expirationTime": + err = unpopulateTimeRFC3339(val, &s.ExpirationTime) + delete(rawMsg, key) + case "refreshToken": + err = unpopulate(val, &s.RefreshToken) + delete(rawMsg, key) + case "token": + err = unpopulate(val, &s.Token) + delete(rawMsg, key) + case "tokenSecret": + err = unpopulate(val, &s.TokenSecret) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// StackMajorVersion - Application stack major version. +type StackMajorVersion struct { + // Example: All the function apps need AppSetting: "FUNCTIONSWORKERRUNTIME" to be set stack name + AppSettingsDictionary map[string]map[string]interface{} `json:"appSettingsDictionary,omitempty"` + + // true if this supports Application Insights; otherwise, false. + ApplicationInsights *bool `json:"applicationInsights,omitempty"` + + // Application stack major version (display only). + DisplayVersion *string `json:"displayVersion,omitempty"` + + // true if this is the default major version; otherwise, false. + IsDefault *bool `json:"isDefault,omitempty"` + + // true if this stack has been deprecated, otherwise false. + IsDeprecated *bool `json:"isDeprecated,omitempty"` + + // true if this stack should be hidden for new customers on portal, otherwise false. + IsHidden *bool `json:"isHidden,omitempty"` + + // true if this stack is in Preview, otherwise false. + IsPreview *bool `json:"isPreview,omitempty"` + + // Minor versions associated with the major version. + MinorVersions []*StackMinorVersion `json:"minorVersions,omitempty"` + + // Application stack major version (runtime only). + RuntimeVersion *string `json:"runtimeVersion,omitempty"` + + // Example: All Linux Function Apps, need Use32BitWorkerProcess to be set to 0 + SiteConfigPropertiesDictionary map[string]map[string]interface{} `json:"siteConfigPropertiesDictionary,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type StackMajorVersion. +func (s StackMajorVersion) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "appSettingsDictionary", s.AppSettingsDictionary) + populate(objectMap, "applicationInsights", s.ApplicationInsights) + populate(objectMap, "displayVersion", s.DisplayVersion) + populate(objectMap, "isDefault", s.IsDefault) + populate(objectMap, "isDeprecated", s.IsDeprecated) + populate(objectMap, "isHidden", s.IsHidden) + populate(objectMap, "isPreview", s.IsPreview) + populate(objectMap, "minorVersions", s.MinorVersions) + populate(objectMap, "runtimeVersion", s.RuntimeVersion) + populate(objectMap, "siteConfigPropertiesDictionary", s.SiteConfigPropertiesDictionary) + return json.Marshal(objectMap) +} + +// StackMinorVersion - Application stack minor version. +type StackMinorVersion struct { + // Application stack minor version (display only). + DisplayVersion *string `json:"displayVersion,omitempty"` + + // true if this is the default minor version; otherwise, false. + IsDefault *bool `json:"isDefault,omitempty"` + + // true if this supports Remote Debugging, otherwise false. + IsRemoteDebuggingEnabled *bool `json:"isRemoteDebuggingEnabled,omitempty"` + + // Application stack minor version (runtime only). + RuntimeVersion *string `json:"runtimeVersion,omitempty"` +} + +// StampCapacity - Stamp capacity information. +type StampCapacity struct { + // Available capacity (# of machines, bytes of storage etc…). + AvailableCapacity *int64 `json:"availableCapacity,omitempty"` + + // Shared/dedicated workers. + ComputeMode *ComputeModeOptions `json:"computeMode,omitempty"` + + // If true, it includes basic apps. Basic apps are not used for capacity allocation. + ExcludeFromCapacityAllocation *bool `json:"excludeFromCapacityAllocation,omitempty"` + + // true if capacity is applicable for all apps; otherwise, false. + IsApplicableForAllComputeModes *bool `json:"isApplicableForAllComputeModes,omitempty"` + + // Is this a linux stamp capacity + IsLinux *bool `json:"isLinux,omitempty"` + + // Name of the stamp. + Name *string `json:"name,omitempty"` + + // Shared or Dedicated. + SiteMode *string `json:"siteMode,omitempty"` + + // Total capacity (# of machines, bytes of storage etc…). + TotalCapacity *int64 `json:"totalCapacity,omitempty"` + + // Name of the unit. + Unit *string `json:"unit,omitempty"` + + // Size of the machines. + WorkerSize *WorkerSizeOptions `json:"workerSize,omitempty"` + + // Size ID of machines: 0 - Small 1 - Medium 2 - Large + WorkerSizeID *int32 `json:"workerSizeId,omitempty"` +} + +// StampCapacityCollection - Collection of stamp capacities. +type StampCapacityCollection struct { + // REQUIRED; Collection of resources. + Value []*StampCapacity `json:"value,omitempty"` + + // READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type StampCapacityCollection. +func (s StampCapacityCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// StaticSite - A static site. +type StaticSite struct { + // false if config file is locked for this static web app; otherwise, true. + AllowConfigFileUpdates *bool `json:"allowConfigFileUpdates,omitempty"` + + // The target branch in the repository. + Branch *string `json:"branch,omitempty"` + + // Build properties to configure on the repository. + BuildProperties *StaticSiteBuildProperties `json:"buildProperties,omitempty"` + + // A user's github repository token. This is used to setup the Github Actions workflow file and API secrets. + RepositoryToken *string `json:"repositoryToken,omitempty"` + + // URL for the repository of the static site. + RepositoryURL *string `json:"repositoryUrl,omitempty"` + + // State indicating whether staging environments are allowed or not allowed for a static web app. + StagingEnvironmentPolicy *StagingEnvironmentPolicy `json:"stagingEnvironmentPolicy,omitempty"` + + // Template options for generating a new repository. + TemplateProperties *StaticSiteTemplateOptions `json:"templateProperties,omitempty"` + + // READ-ONLY; The content distribution endpoint for the static site. + ContentDistributionEndpoint *string `json:"contentDistributionEndpoint,omitempty" azure:"ro"` + + // READ-ONLY; The custom domains associated with this static site. + CustomDomains []*string `json:"customDomains,omitempty" azure:"ro"` + + // READ-ONLY; The default autogenerated hostname for the static site. + DefaultHostname *string `json:"defaultHostname,omitempty" azure:"ro"` + + // READ-ONLY; Identity to use for Key Vault Reference authentication. + KeyVaultReferenceIdentity *string `json:"keyVaultReferenceIdentity,omitempty" azure:"ro"` + + // READ-ONLY; Private endpoint connections + PrivateEndpointConnections []*ResponseMessageEnvelopeRemotePrivateEndpointConnection `json:"privateEndpointConnections,omitempty" azure:"ro"` + + // READ-ONLY; The provider that submitted the last deployment to the primary environment of the static site. + Provider *string `json:"provider,omitempty" azure:"ro"` + + // READ-ONLY; User provided function apps registered with the static site + UserProvidedFunctionApps []*StaticSiteUserProvidedFunctionApp `json:"userProvidedFunctionApps,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type StaticSite. +func (s StaticSite) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "allowConfigFileUpdates", s.AllowConfigFileUpdates) + populate(objectMap, "branch", s.Branch) + populate(objectMap, "buildProperties", s.BuildProperties) + populate(objectMap, "contentDistributionEndpoint", s.ContentDistributionEndpoint) + populate(objectMap, "customDomains", s.CustomDomains) + populate(objectMap, "defaultHostname", s.DefaultHostname) + populate(objectMap, "keyVaultReferenceIdentity", s.KeyVaultReferenceIdentity) + populate(objectMap, "privateEndpointConnections", s.PrivateEndpointConnections) + populate(objectMap, "provider", s.Provider) + populate(objectMap, "repositoryToken", s.RepositoryToken) + populate(objectMap, "repositoryUrl", s.RepositoryURL) + populate(objectMap, "stagingEnvironmentPolicy", s.StagingEnvironmentPolicy) + populate(objectMap, "templateProperties", s.TemplateProperties) + populate(objectMap, "userProvidedFunctionApps", s.UserProvidedFunctionApps) + return json.Marshal(objectMap) +} + +// StaticSiteARMResource - Static Site ARM resource. +type StaticSiteARMResource struct { + Resource + // Managed service identity. + Identity *ManagedServiceIdentity `json:"identity,omitempty"` + + // Core resource properties + Properties *StaticSite `json:"properties,omitempty"` + + // Description of a SKU for a scalable resource. + SKU *SKUDescription `json:"sku,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type StaticSiteARMResource. +func (s StaticSiteARMResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + s.Resource.marshalInternal(objectMap) + populate(objectMap, "identity", s.Identity) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "sku", s.SKU) + return json.Marshal(objectMap) +} + +// StaticSiteBuildARMResource - Static Site Build ARM resource. +type StaticSiteBuildARMResource struct { + ProxyOnlyResource + // StaticSiteBuildARMResource resource specific properties + Properties *StaticSiteBuildARMResourceProperties `json:"properties,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type StaticSiteBuildARMResource. +func (s StaticSiteBuildARMResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + s.ProxyOnlyResource.marshalInternal(objectMap) + populate(objectMap, "properties", s.Properties) + return json.Marshal(objectMap) +} + +// StaticSiteBuildARMResourceProperties - StaticSiteBuildARMResource resource specific properties +type StaticSiteBuildARMResourceProperties struct { + // READ-ONLY; An identifier for the static site build. + BuildID *string `json:"buildId,omitempty" azure:"ro"` + + // READ-ONLY; When this build was created. + CreatedTimeUTC *time.Time `json:"createdTimeUtc,omitempty" azure:"ro"` + + // READ-ONLY; The hostname for a static site build. + Hostname *string `json:"hostname,omitempty" azure:"ro"` + + // READ-ONLY; When this build was updated. + LastUpdatedOn *time.Time `json:"lastUpdatedOn,omitempty" azure:"ro"` + + // READ-ONLY; The title of a pull request that a static site build is related to. + PullRequestTitle *string `json:"pullRequestTitle,omitempty" azure:"ro"` + + // READ-ONLY; The source branch. + SourceBranch *string `json:"sourceBranch,omitempty" azure:"ro"` + + // READ-ONLY; The status of the static site build. + Status *BuildStatus `json:"status,omitempty" azure:"ro"` + + // READ-ONLY; User provided function apps registered with the static site build + UserProvidedFunctionApps []*StaticSiteUserProvidedFunctionApp `json:"userProvidedFunctionApps,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type StaticSiteBuildARMResourceProperties. +func (s StaticSiteBuildARMResourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "buildId", s.BuildID) + populateTimeRFC3339(objectMap, "createdTimeUtc", s.CreatedTimeUTC) + populate(objectMap, "hostname", s.Hostname) + populateTimeRFC3339(objectMap, "lastUpdatedOn", s.LastUpdatedOn) + populate(objectMap, "pullRequestTitle", s.PullRequestTitle) + populate(objectMap, "sourceBranch", s.SourceBranch) + populate(objectMap, "status", s.Status) + populate(objectMap, "userProvidedFunctionApps", s.UserProvidedFunctionApps) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type StaticSiteBuildARMResourceProperties. +func (s *StaticSiteBuildARMResourceProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "buildId": + err = unpopulate(val, &s.BuildID) + delete(rawMsg, key) + case "createdTimeUtc": + err = unpopulateTimeRFC3339(val, &s.CreatedTimeUTC) + delete(rawMsg, key) + case "hostname": + err = unpopulate(val, &s.Hostname) + delete(rawMsg, key) + case "lastUpdatedOn": + err = unpopulateTimeRFC3339(val, &s.LastUpdatedOn) + delete(rawMsg, key) + case "pullRequestTitle": + err = unpopulate(val, &s.PullRequestTitle) + delete(rawMsg, key) + case "sourceBranch": + err = unpopulate(val, &s.SourceBranch) + delete(rawMsg, key) + case "status": + err = unpopulate(val, &s.Status) + delete(rawMsg, key) + case "userProvidedFunctionApps": + err = unpopulate(val, &s.UserProvidedFunctionApps) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// StaticSiteBuildCollection - Collection of static site builds. +type StaticSiteBuildCollection struct { + // REQUIRED; Collection of resources. + Value []*StaticSiteBuildARMResource `json:"value,omitempty"` + + // READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type StaticSiteBuildCollection. +func (s StaticSiteBuildCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// StaticSiteBuildProperties - Build properties for the static site. +type StaticSiteBuildProperties struct { + // A custom command to run during deployment of the Azure Functions API application. + APIBuildCommand *string `json:"apiBuildCommand,omitempty"` + + // The path to the api code within the repository. + APILocation *string `json:"apiLocation,omitempty"` + + // Deprecated: The path of the app artifacts after building (deprecated in favor of OutputLocation) + AppArtifactLocation *string `json:"appArtifactLocation,omitempty"` + + // A custom command to run during deployment of the static content application. + AppBuildCommand *string `json:"appBuildCommand,omitempty"` + + // The path to the app code within the repository. + AppLocation *string `json:"appLocation,omitempty"` + + // Github Action secret name override. + GithubActionSecretNameOverride *string `json:"githubActionSecretNameOverride,omitempty"` + + // The output path of the app after building. + OutputLocation *string `json:"outputLocation,omitempty"` + + // Skip Github Action workflow generation. + SkipGithubActionWorkflowGeneration *bool `json:"skipGithubActionWorkflowGeneration,omitempty"` +} + +// StaticSiteCollection - Collection of static sites. +type StaticSiteCollection struct { + // REQUIRED; Collection of resources. + Value []*StaticSiteARMResource `json:"value,omitempty"` + + // READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type StaticSiteCollection. +func (s StaticSiteCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// StaticSiteCustomDomainOverviewARMResource - Static Site Custom Domain Overview ARM resource. +type StaticSiteCustomDomainOverviewARMResource struct { + ProxyOnlyResource + // StaticSiteCustomDomainOverviewARMResource resource specific properties + Properties *StaticSiteCustomDomainOverviewARMResourceProperties `json:"properties,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type StaticSiteCustomDomainOverviewARMResource. +func (s StaticSiteCustomDomainOverviewARMResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + s.ProxyOnlyResource.marshalInternal(objectMap) + populate(objectMap, "properties", s.Properties) + return json.Marshal(objectMap) +} + +// StaticSiteCustomDomainOverviewARMResourceProperties - StaticSiteCustomDomainOverviewARMResource resource specific properties +type StaticSiteCustomDomainOverviewARMResourceProperties struct { + // READ-ONLY; The date and time on which the custom domain was created for the static site. + CreatedOn *time.Time `json:"createdOn,omitempty" azure:"ro"` + + // READ-ONLY; The domain name for the static site custom domain. + DomainName *string `json:"domainName,omitempty" azure:"ro"` + + // READ-ONLY + ErrorMessage *string `json:"errorMessage,omitempty" azure:"ro"` + + // READ-ONLY; The status of the custom domain + Status *CustomDomainStatus `json:"status,omitempty" azure:"ro"` + + // READ-ONLY; The TXT record validation token + ValidationToken *string `json:"validationToken,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type StaticSiteCustomDomainOverviewARMResourceProperties. +func (s StaticSiteCustomDomainOverviewARMResourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populateTimeRFC3339(objectMap, "createdOn", s.CreatedOn) + populate(objectMap, "domainName", s.DomainName) + populate(objectMap, "errorMessage", s.ErrorMessage) + populate(objectMap, "status", s.Status) + populate(objectMap, "validationToken", s.ValidationToken) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type StaticSiteCustomDomainOverviewARMResourceProperties. +func (s *StaticSiteCustomDomainOverviewARMResourceProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "createdOn": + err = unpopulateTimeRFC3339(val, &s.CreatedOn) + delete(rawMsg, key) + case "domainName": + err = unpopulate(val, &s.DomainName) + delete(rawMsg, key) + case "errorMessage": + err = unpopulate(val, &s.ErrorMessage) + delete(rawMsg, key) + case "status": + err = unpopulate(val, &s.Status) + delete(rawMsg, key) + case "validationToken": + err = unpopulate(val, &s.ValidationToken) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// StaticSiteCustomDomainOverviewCollection - Collection of static site custom domains. +type StaticSiteCustomDomainOverviewCollection struct { + // REQUIRED; Collection of resources. + Value []*StaticSiteCustomDomainOverviewARMResource `json:"value,omitempty"` + + // READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type StaticSiteCustomDomainOverviewCollection. +func (s StaticSiteCustomDomainOverviewCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// StaticSiteCustomDomainRequestPropertiesARMResource - Static Site Custom Domain Request Properties ARM resource. +type StaticSiteCustomDomainRequestPropertiesARMResource struct { + ProxyOnlyResource + // StaticSiteCustomDomainRequestPropertiesARMResource resource specific properties + Properties *StaticSiteCustomDomainRequestPropertiesARMResourceProperties `json:"properties,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type StaticSiteCustomDomainRequestPropertiesARMResource. +func (s StaticSiteCustomDomainRequestPropertiesARMResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + s.ProxyOnlyResource.marshalInternal(objectMap) + populate(objectMap, "properties", s.Properties) + return json.Marshal(objectMap) +} + +// StaticSiteCustomDomainRequestPropertiesARMResourceProperties - StaticSiteCustomDomainRequestPropertiesARMResource resource specific properties +type StaticSiteCustomDomainRequestPropertiesARMResourceProperties struct { + // Validation method for adding a custom domain + ValidationMethod *string `json:"validationMethod,omitempty"` +} + +// StaticSiteFunctionOverviewARMResource - Static Site Function Overview ARM resource. +type StaticSiteFunctionOverviewARMResource struct { + ProxyOnlyResource + // StaticSiteFunctionOverviewARMResource resource specific properties + Properties *StaticSiteFunctionOverviewARMResourceProperties `json:"properties,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type StaticSiteFunctionOverviewARMResource. +func (s StaticSiteFunctionOverviewARMResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + s.ProxyOnlyResource.marshalInternal(objectMap) + populate(objectMap, "properties", s.Properties) + return json.Marshal(objectMap) +} + +// StaticSiteFunctionOverviewARMResourceProperties - StaticSiteFunctionOverviewARMResource resource specific properties +type StaticSiteFunctionOverviewARMResourceProperties struct { + // READ-ONLY; The name for the function + FunctionName *string `json:"functionName,omitempty" azure:"ro"` + + // READ-ONLY; The trigger type of the function + TriggerType *TriggerTypes `json:"triggerType,omitempty" azure:"ro"` +} + +// StaticSiteFunctionOverviewCollection - Collection of static site functions. +type StaticSiteFunctionOverviewCollection struct { + // REQUIRED; Collection of resources. + Value []*StaticSiteFunctionOverviewARMResource `json:"value,omitempty"` + + // READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type StaticSiteFunctionOverviewCollection. +func (s StaticSiteFunctionOverviewCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// StaticSitePatchResource - ARM resource for a static site when patching +type StaticSitePatchResource struct { + ProxyOnlyResource + // Core resource properties + Properties *StaticSite `json:"properties,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type StaticSitePatchResource. +func (s StaticSitePatchResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + s.ProxyOnlyResource.marshalInternal(objectMap) + populate(objectMap, "properties", s.Properties) + return json.Marshal(objectMap) +} + +// StaticSiteResetPropertiesARMResource - Static Site Reset Properties ARM resource. +type StaticSiteResetPropertiesARMResource struct { + ProxyOnlyResource + // StaticSiteResetPropertiesARMResource resource specific properties + Properties *StaticSiteResetPropertiesARMResourceProperties `json:"properties,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type StaticSiteResetPropertiesARMResource. +func (s StaticSiteResetPropertiesARMResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + s.ProxyOnlyResource.marshalInternal(objectMap) + populate(objectMap, "properties", s.Properties) + return json.Marshal(objectMap) +} + +// StaticSiteResetPropertiesARMResourceProperties - StaticSiteResetPropertiesARMResource resource specific properties +type StaticSiteResetPropertiesARMResourceProperties struct { + // The token which proves admin privileges to the repository. + RepositoryToken *string `json:"repositoryToken,omitempty"` + + // Determines whether the repository should be updated with the new properties. + ShouldUpdateRepository *bool `json:"shouldUpdateRepository,omitempty"` +} + +// StaticSiteTemplateOptions - Template Options for the static site. +type StaticSiteTemplateOptions struct { + // Description of the newly generated repository. + Description *string `json:"description,omitempty"` + + // Whether or not the newly generated repository is a private repository. Defaults to false (i.e. public). + IsPrivate *bool `json:"isPrivate,omitempty"` + + // Owner of the newly generated repository. + Owner *string `json:"owner,omitempty"` + + // Name of the newly generated repository. + RepositoryName *string `json:"repositoryName,omitempty"` + + // URL of the template repository. The newly generated repository will be based on this one. + TemplateRepositoryURL *string `json:"templateRepositoryUrl,omitempty"` +} + +// StaticSiteUserARMResource - Static Site User ARM resource. +type StaticSiteUserARMResource struct { + ProxyOnlyResource + // StaticSiteUserARMResource resource specific properties + Properties *StaticSiteUserARMResourceProperties `json:"properties,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type StaticSiteUserARMResource. +func (s StaticSiteUserARMResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + s.ProxyOnlyResource.marshalInternal(objectMap) + populate(objectMap, "properties", s.Properties) + return json.Marshal(objectMap) +} + +// StaticSiteUserARMResourceProperties - StaticSiteUserARMResource resource specific properties +type StaticSiteUserARMResourceProperties struct { + // The roles for the static site user, in free-form string format + Roles *string `json:"roles,omitempty"` + + // READ-ONLY; The display name for the static site user. + DisplayName *string `json:"displayName,omitempty" azure:"ro"` + + // READ-ONLY; The identity provider for the static site user. + Provider *string `json:"provider,omitempty" azure:"ro"` + + // READ-ONLY; The user id for the static site user. + UserID *string `json:"userId,omitempty" azure:"ro"` +} + +// StaticSiteUserCollection - Collection of static site custom users. +type StaticSiteUserCollection struct { + // REQUIRED; Collection of resources. + Value []*StaticSiteUserARMResource `json:"value,omitempty"` + + // READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type StaticSiteUserCollection. +func (s StaticSiteUserCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// StaticSiteUserInvitationRequestResource - Static sites user roles invitation resource. +type StaticSiteUserInvitationRequestResource struct { + ProxyOnlyResource + // StaticSiteUserInvitationRequestResource resource specific properties + Properties *StaticSiteUserInvitationRequestResourceProperties `json:"properties,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type StaticSiteUserInvitationRequestResource. +func (s StaticSiteUserInvitationRequestResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + s.ProxyOnlyResource.marshalInternal(objectMap) + populate(objectMap, "properties", s.Properties) + return json.Marshal(objectMap) +} + +// StaticSiteUserInvitationRequestResourceProperties - StaticSiteUserInvitationRequestResource resource specific properties +type StaticSiteUserInvitationRequestResourceProperties struct { + // The domain name for the static site custom domain. + Domain *string `json:"domain,omitempty"` + + // The number of hours the sas token stays valid + NumHoursToExpiration *int32 `json:"numHoursToExpiration,omitempty"` + + // The identity provider for the static site user. + Provider *string `json:"provider,omitempty"` + + // The roles for the static site user, in free-form string format + Roles *string `json:"roles,omitempty"` + + // The user id for the static site user. + UserDetails *string `json:"userDetails,omitempty"` +} + +// StaticSiteUserInvitationResponseResource - Static sites user roles invitation link resource. +type StaticSiteUserInvitationResponseResource struct { + ProxyOnlyResource + // StaticSiteUserInvitationResponseResource resource specific properties + Properties *StaticSiteUserInvitationResponseResourceProperties `json:"properties,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type StaticSiteUserInvitationResponseResource. +func (s StaticSiteUserInvitationResponseResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + s.ProxyOnlyResource.marshalInternal(objectMap) + populate(objectMap, "properties", s.Properties) + return json.Marshal(objectMap) +} + +// StaticSiteUserInvitationResponseResourceProperties - StaticSiteUserInvitationResponseResource resource specific properties +type StaticSiteUserInvitationResponseResourceProperties struct { + // READ-ONLY; The expiration time of the invitation + ExpiresOn *time.Time `json:"expiresOn,omitempty" azure:"ro"` + + // READ-ONLY; The url for the invitation link + InvitationURL *string `json:"invitationUrl,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type StaticSiteUserInvitationResponseResourceProperties. +func (s StaticSiteUserInvitationResponseResourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populateTimeRFC3339(objectMap, "expiresOn", s.ExpiresOn) + populate(objectMap, "invitationUrl", s.InvitationURL) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type StaticSiteUserInvitationResponseResourceProperties. +func (s *StaticSiteUserInvitationResponseResourceProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "expiresOn": + err = unpopulateTimeRFC3339(val, &s.ExpiresOn) + delete(rawMsg, key) + case "invitationUrl": + err = unpopulate(val, &s.InvitationURL) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// StaticSiteUserProvidedFunctionApp - A static site user provided function. +type StaticSiteUserProvidedFunctionApp struct { + ProxyOnlyResource + // StaticSiteUserProvidedFunctionApp resource specific properties + Properties *StaticSiteUserProvidedFunctionAppProperties `json:"properties,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type StaticSiteUserProvidedFunctionApp. +func (s StaticSiteUserProvidedFunctionApp) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + s.ProxyOnlyResource.marshalInternal(objectMap) + populate(objectMap, "properties", s.Properties) + return json.Marshal(objectMap) +} + +// StaticSiteUserProvidedFunctionAppARMResource - Static Site User Provided Function App ARM resource. +type StaticSiteUserProvidedFunctionAppARMResource struct { + ProxyOnlyResource + // StaticSiteUserProvidedFunctionAppARMResource resource specific properties + Properties *StaticSiteUserProvidedFunctionAppARMResourceProperties `json:"properties,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type StaticSiteUserProvidedFunctionAppARMResource. +func (s StaticSiteUserProvidedFunctionAppARMResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + s.ProxyOnlyResource.marshalInternal(objectMap) + populate(objectMap, "properties", s.Properties) + return json.Marshal(objectMap) +} + +// StaticSiteUserProvidedFunctionAppARMResourceProperties - StaticSiteUserProvidedFunctionAppARMResource resource specific properties +type StaticSiteUserProvidedFunctionAppARMResourceProperties struct { + // The region of the function app registered with the static site + FunctionAppRegion *string `json:"functionAppRegion,omitempty"` + + // The resource id of the function app registered with the static site + FunctionAppResourceID *string `json:"functionAppResourceId,omitempty"` + + // READ-ONLY; The date and time on which the function app was registered with the static site. + CreatedOn *time.Time `json:"createdOn,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type StaticSiteUserProvidedFunctionAppARMResourceProperties. +func (s StaticSiteUserProvidedFunctionAppARMResourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populateTimeRFC3339(objectMap, "createdOn", s.CreatedOn) + populate(objectMap, "functionAppRegion", s.FunctionAppRegion) + populate(objectMap, "functionAppResourceId", s.FunctionAppResourceID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type StaticSiteUserProvidedFunctionAppARMResourceProperties. +func (s *StaticSiteUserProvidedFunctionAppARMResourceProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "createdOn": + err = unpopulateTimeRFC3339(val, &s.CreatedOn) + delete(rawMsg, key) + case "functionAppRegion": + err = unpopulate(val, &s.FunctionAppRegion) + delete(rawMsg, key) + case "functionAppResourceId": + err = unpopulate(val, &s.FunctionAppResourceID) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// StaticSiteUserProvidedFunctionAppProperties - StaticSiteUserProvidedFunctionApp resource specific properties +type StaticSiteUserProvidedFunctionAppProperties struct { + // The region of the function app registered with the static site + FunctionAppRegion *string `json:"functionAppRegion,omitempty"` + + // The resource id of the function app registered with the static site + FunctionAppResourceID *string `json:"functionAppResourceId,omitempty"` + + // READ-ONLY; The date and time on which the function app was registered with the static site. + CreatedOn *time.Time `json:"createdOn,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type StaticSiteUserProvidedFunctionAppProperties. +func (s StaticSiteUserProvidedFunctionAppProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populateTimeRFC3339(objectMap, "createdOn", s.CreatedOn) + populate(objectMap, "functionAppRegion", s.FunctionAppRegion) + populate(objectMap, "functionAppResourceId", s.FunctionAppResourceID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type StaticSiteUserProvidedFunctionAppProperties. +func (s *StaticSiteUserProvidedFunctionAppProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "createdOn": + err = unpopulateTimeRFC3339(val, &s.CreatedOn) + delete(rawMsg, key) + case "functionAppRegion": + err = unpopulate(val, &s.FunctionAppRegion) + delete(rawMsg, key) + case "functionAppResourceId": + err = unpopulate(val, &s.FunctionAppResourceID) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// StaticSiteUserProvidedFunctionAppsCollection - Collection of static site user provided function apps. +type StaticSiteUserProvidedFunctionAppsCollection struct { + // REQUIRED; Collection of resources. + Value []*StaticSiteUserProvidedFunctionAppARMResource `json:"value,omitempty"` + + // READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type StaticSiteUserProvidedFunctionAppsCollection. +func (s StaticSiteUserProvidedFunctionAppsCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// StaticSiteZipDeployment - A static site zip deployment. +type StaticSiteZipDeployment struct { + // URL for the zipped api content + APIZipURL *string `json:"apiZipUrl,omitempty"` + + // URL for the zipped app content + AppZipURL *string `json:"appZipUrl,omitempty"` + + // A title to label the deployment + DeploymentTitle *string `json:"deploymentTitle,omitempty"` + + // The language of the api content, if it exists + FunctionLanguage *string `json:"functionLanguage,omitempty"` + + // The provider submitting this deployment + Provider *string `json:"provider,omitempty"` +} + +// StaticSiteZipDeploymentARMResource - Static site zip deployment ARM resource. +type StaticSiteZipDeploymentARMResource struct { + ProxyOnlyResource + // Core resource properties + Properties *StaticSiteZipDeployment `json:"properties,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type StaticSiteZipDeploymentARMResource. +func (s StaticSiteZipDeploymentARMResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + s.ProxyOnlyResource.marshalInternal(objectMap) + populate(objectMap, "properties", s.Properties) + return json.Marshal(objectMap) +} + +// StaticSitesBeginApproveOrRejectPrivateEndpointConnectionOptions contains the optional parameters for the StaticSites.BeginApproveOrRejectPrivateEndpointConnection +// method. +type StaticSitesBeginApproveOrRejectPrivateEndpointConnectionOptions struct { + // placeholder for future optional parameters +} + +// StaticSitesBeginCreateOrUpdateStaticSiteCustomDomainOptions contains the optional parameters for the StaticSites.BeginCreateOrUpdateStaticSiteCustomDomain +// method. +type StaticSitesBeginCreateOrUpdateStaticSiteCustomDomainOptions struct { + // placeholder for future optional parameters +} + +// StaticSitesBeginCreateOrUpdateStaticSiteOptions contains the optional parameters for the StaticSites.BeginCreateOrUpdateStaticSite method. +type StaticSitesBeginCreateOrUpdateStaticSiteOptions struct { + // placeholder for future optional parameters +} + +// StaticSitesBeginCreateZipDeploymentForStaticSiteBuildOptions contains the optional parameters for the StaticSites.BeginCreateZipDeploymentForStaticSiteBuild +// method. +type StaticSitesBeginCreateZipDeploymentForStaticSiteBuildOptions struct { + // placeholder for future optional parameters +} + +// StaticSitesBeginCreateZipDeploymentForStaticSiteOptions contains the optional parameters for the StaticSites.BeginCreateZipDeploymentForStaticSite method. +type StaticSitesBeginCreateZipDeploymentForStaticSiteOptions struct { + // placeholder for future optional parameters +} + +// StaticSitesBeginDeletePrivateEndpointConnectionOptions contains the optional parameters for the StaticSites.BeginDeletePrivateEndpointConnection method. +type StaticSitesBeginDeletePrivateEndpointConnectionOptions struct { + // placeholder for future optional parameters +} + +// StaticSitesBeginDeleteStaticSiteBuildOptions contains the optional parameters for the StaticSites.BeginDeleteStaticSiteBuild method. +type StaticSitesBeginDeleteStaticSiteBuildOptions struct { + // placeholder for future optional parameters +} + +// StaticSitesBeginDeleteStaticSiteCustomDomainOptions contains the optional parameters for the StaticSites.BeginDeleteStaticSiteCustomDomain method. +type StaticSitesBeginDeleteStaticSiteCustomDomainOptions struct { + // placeholder for future optional parameters +} + +// StaticSitesBeginDeleteStaticSiteOptions contains the optional parameters for the StaticSites.BeginDeleteStaticSite method. +type StaticSitesBeginDeleteStaticSiteOptions struct { + // placeholder for future optional parameters +} + +// StaticSitesBeginDetachStaticSiteOptions contains the optional parameters for the StaticSites.BeginDetachStaticSite method. +type StaticSitesBeginDetachStaticSiteOptions struct { + // placeholder for future optional parameters +} + +// StaticSitesBeginRegisterUserProvidedFunctionAppWithStaticSiteBuildOptions contains the optional parameters for the StaticSites.BeginRegisterUserProvidedFunctionAppWithStaticSiteBuild +// method. +type StaticSitesBeginRegisterUserProvidedFunctionAppWithStaticSiteBuildOptions struct { + // Specify true to force the update of the auth configuration on the function app even if an AzureStaticWebApps provider is already configured + // on the function app. The default is false. + IsForced *bool +} + +// StaticSitesBeginRegisterUserProvidedFunctionAppWithStaticSiteOptions contains the optional parameters for the StaticSites.BeginRegisterUserProvidedFunctionAppWithStaticSite +// method. +type StaticSitesBeginRegisterUserProvidedFunctionAppWithStaticSiteOptions struct { + // Specify true to force the update of the auth configuration on the function app even if an AzureStaticWebApps provider is already configured + // on the function app. The default is false. + IsForced *bool +} + +// StaticSitesBeginValidateCustomDomainCanBeAddedToStaticSiteOptions contains the optional parameters for the StaticSites.BeginValidateCustomDomainCanBeAddedToStaticSite +// method. +type StaticSitesBeginValidateCustomDomainCanBeAddedToStaticSiteOptions struct { + // placeholder for future optional parameters +} + +// StaticSitesCreateOrUpdateStaticSiteAppSettingsOptions contains the optional parameters for the StaticSites.CreateOrUpdateStaticSiteAppSettings method. +type StaticSitesCreateOrUpdateStaticSiteAppSettingsOptions struct { + // placeholder for future optional parameters +} + +// StaticSitesCreateOrUpdateStaticSiteBuildAppSettingsOptions contains the optional parameters for the StaticSites.CreateOrUpdateStaticSiteBuildAppSettings +// method. +type StaticSitesCreateOrUpdateStaticSiteBuildAppSettingsOptions struct { + // placeholder for future optional parameters +} + +// StaticSitesCreateOrUpdateStaticSiteBuildFunctionAppSettingsOptions contains the optional parameters for the StaticSites.CreateOrUpdateStaticSiteBuildFunctionAppSettings +// method. +type StaticSitesCreateOrUpdateStaticSiteBuildFunctionAppSettingsOptions struct { + // placeholder for future optional parameters +} + +// StaticSitesCreateOrUpdateStaticSiteFunctionAppSettingsOptions contains the optional parameters for the StaticSites.CreateOrUpdateStaticSiteFunctionAppSettings +// method. +type StaticSitesCreateOrUpdateStaticSiteFunctionAppSettingsOptions struct { + // placeholder for future optional parameters +} + +// StaticSitesCreateUserRolesInvitationLinkOptions contains the optional parameters for the StaticSites.CreateUserRolesInvitationLink method. +type StaticSitesCreateUserRolesInvitationLinkOptions struct { + // placeholder for future optional parameters +} + +// StaticSitesDeleteStaticSiteUserOptions contains the optional parameters for the StaticSites.DeleteStaticSiteUser method. +type StaticSitesDeleteStaticSiteUserOptions struct { + // placeholder for future optional parameters +} + +// StaticSitesDetachUserProvidedFunctionAppFromStaticSiteBuildOptions contains the optional parameters for the StaticSites.DetachUserProvidedFunctionAppFromStaticSiteBuild +// method. +type StaticSitesDetachUserProvidedFunctionAppFromStaticSiteBuildOptions struct { + // placeholder for future optional parameters +} + +// StaticSitesDetachUserProvidedFunctionAppFromStaticSiteOptions contains the optional parameters for the StaticSites.DetachUserProvidedFunctionAppFromStaticSite +// method. +type StaticSitesDetachUserProvidedFunctionAppFromStaticSiteOptions struct { + // placeholder for future optional parameters +} + +// StaticSitesGetPrivateEndpointConnectionListOptions contains the optional parameters for the StaticSites.GetPrivateEndpointConnectionList method. +type StaticSitesGetPrivateEndpointConnectionListOptions struct { + // placeholder for future optional parameters +} + +// StaticSitesGetPrivateEndpointConnectionOptions contains the optional parameters for the StaticSites.GetPrivateEndpointConnection method. +type StaticSitesGetPrivateEndpointConnectionOptions struct { + // placeholder for future optional parameters +} + +// StaticSitesGetPrivateLinkResourcesOptions contains the optional parameters for the StaticSites.GetPrivateLinkResources method. +type StaticSitesGetPrivateLinkResourcesOptions struct { + // placeholder for future optional parameters +} + +// StaticSitesGetStaticSiteBuildOptions contains the optional parameters for the StaticSites.GetStaticSiteBuild method. +type StaticSitesGetStaticSiteBuildOptions struct { + // placeholder for future optional parameters +} + +// StaticSitesGetStaticSiteBuildsOptions contains the optional parameters for the StaticSites.GetStaticSiteBuilds method. +type StaticSitesGetStaticSiteBuildsOptions struct { + // placeholder for future optional parameters +} + +// StaticSitesGetStaticSiteCustomDomainOptions contains the optional parameters for the StaticSites.GetStaticSiteCustomDomain method. +type StaticSitesGetStaticSiteCustomDomainOptions struct { + // placeholder for future optional parameters +} + +// StaticSitesGetStaticSiteOptions contains the optional parameters for the StaticSites.GetStaticSite method. +type StaticSitesGetStaticSiteOptions struct { + // placeholder for future optional parameters +} + +// StaticSitesGetStaticSitesByResourceGroupOptions contains the optional parameters for the StaticSites.GetStaticSitesByResourceGroup method. +type StaticSitesGetStaticSitesByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// StaticSitesGetUserProvidedFunctionAppForStaticSiteBuildOptions contains the optional parameters for the StaticSites.GetUserProvidedFunctionAppForStaticSiteBuild +// method. +type StaticSitesGetUserProvidedFunctionAppForStaticSiteBuildOptions struct { + // placeholder for future optional parameters +} + +// StaticSitesGetUserProvidedFunctionAppForStaticSiteOptions contains the optional parameters for the StaticSites.GetUserProvidedFunctionAppForStaticSite +// method. +type StaticSitesGetUserProvidedFunctionAppForStaticSiteOptions struct { + // placeholder for future optional parameters +} + +// StaticSitesGetUserProvidedFunctionAppsForStaticSiteBuildOptions contains the optional parameters for the StaticSites.GetUserProvidedFunctionAppsForStaticSiteBuild +// method. +type StaticSitesGetUserProvidedFunctionAppsForStaticSiteBuildOptions struct { + // placeholder for future optional parameters +} + +// StaticSitesGetUserProvidedFunctionAppsForStaticSiteOptions contains the optional parameters for the StaticSites.GetUserProvidedFunctionAppsForStaticSite +// method. +type StaticSitesGetUserProvidedFunctionAppsForStaticSiteOptions struct { + // placeholder for future optional parameters +} + +// StaticSitesListOptions contains the optional parameters for the StaticSites.List method. +type StaticSitesListOptions struct { + // placeholder for future optional parameters +} + +// StaticSitesListStaticSiteAppSettingsOptions contains the optional parameters for the StaticSites.ListStaticSiteAppSettings method. +type StaticSitesListStaticSiteAppSettingsOptions struct { + // placeholder for future optional parameters +} + +// StaticSitesListStaticSiteBuildAppSettingsOptions contains the optional parameters for the StaticSites.ListStaticSiteBuildAppSettings method. +type StaticSitesListStaticSiteBuildAppSettingsOptions struct { + // placeholder for future optional parameters +} + +// StaticSitesListStaticSiteBuildFunctionAppSettingsOptions contains the optional parameters for the StaticSites.ListStaticSiteBuildFunctionAppSettings +// method. +type StaticSitesListStaticSiteBuildFunctionAppSettingsOptions struct { + // placeholder for future optional parameters +} + +// StaticSitesListStaticSiteBuildFunctionsOptions contains the optional parameters for the StaticSites.ListStaticSiteBuildFunctions method. +type StaticSitesListStaticSiteBuildFunctionsOptions struct { + // placeholder for future optional parameters +} + +// StaticSitesListStaticSiteConfiguredRolesOptions contains the optional parameters for the StaticSites.ListStaticSiteConfiguredRoles method. +type StaticSitesListStaticSiteConfiguredRolesOptions struct { + // placeholder for future optional parameters +} + +// StaticSitesListStaticSiteCustomDomainsOptions contains the optional parameters for the StaticSites.ListStaticSiteCustomDomains method. +type StaticSitesListStaticSiteCustomDomainsOptions struct { + // placeholder for future optional parameters +} + +// StaticSitesListStaticSiteFunctionAppSettingsOptions contains the optional parameters for the StaticSites.ListStaticSiteFunctionAppSettings method. +type StaticSitesListStaticSiteFunctionAppSettingsOptions struct { + // placeholder for future optional parameters +} + +// StaticSitesListStaticSiteFunctionsOptions contains the optional parameters for the StaticSites.ListStaticSiteFunctions method. +type StaticSitesListStaticSiteFunctionsOptions struct { + // placeholder for future optional parameters +} + +// StaticSitesListStaticSiteSecretsOptions contains the optional parameters for the StaticSites.ListStaticSiteSecrets method. +type StaticSitesListStaticSiteSecretsOptions struct { + // placeholder for future optional parameters +} + +// StaticSitesListStaticSiteUsersOptions contains the optional parameters for the StaticSites.ListStaticSiteUsers method. +type StaticSitesListStaticSiteUsersOptions struct { + // placeholder for future optional parameters +} + +// StaticSitesPreviewWorkflowOptions contains the optional parameters for the StaticSites.PreviewWorkflow method. +type StaticSitesPreviewWorkflowOptions struct { + // placeholder for future optional parameters +} + +// StaticSitesResetStaticSiteAPIKeyOptions contains the optional parameters for the StaticSites.ResetStaticSiteAPIKey method. +type StaticSitesResetStaticSiteAPIKeyOptions struct { + // placeholder for future optional parameters +} + +// StaticSitesUpdateStaticSiteOptions contains the optional parameters for the StaticSites.UpdateStaticSite method. +type StaticSitesUpdateStaticSiteOptions struct { + // placeholder for future optional parameters +} + +// StaticSitesUpdateStaticSiteUserOptions contains the optional parameters for the StaticSites.UpdateStaticSiteUser method. +type StaticSitesUpdateStaticSiteUserOptions struct { + // placeholder for future optional parameters +} + +// StaticSitesWorkflowPreview - Preview for the Static Site Workflow to be generated +type StaticSitesWorkflowPreview struct { + ProxyOnlyResource + // StaticSitesWorkflowPreview resource specific properties + Properties *StaticSitesWorkflowPreviewProperties `json:"properties,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type StaticSitesWorkflowPreview. +func (s StaticSitesWorkflowPreview) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + s.ProxyOnlyResource.marshalInternal(objectMap) + populate(objectMap, "properties", s.Properties) + return json.Marshal(objectMap) +} + +// StaticSitesWorkflowPreviewProperties - StaticSitesWorkflowPreview resource specific properties +type StaticSitesWorkflowPreviewProperties struct { + // READ-ONLY; The contents for the workflow file to be generated + Contents *string `json:"contents,omitempty" azure:"ro"` + + // READ-ONLY; The path for the workflow file to be generated + Path *string `json:"path,omitempty" azure:"ro"` +} + +// StaticSitesWorkflowPreviewRequest - Request entity for previewing the Static Site workflow +type StaticSitesWorkflowPreviewRequest struct { + ProxyOnlyResource + // StaticSitesWorkflowPreviewRequest resource specific properties + Properties *StaticSitesWorkflowPreviewRequestProperties `json:"properties,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type StaticSitesWorkflowPreviewRequest. +func (s StaticSitesWorkflowPreviewRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + s.ProxyOnlyResource.marshalInternal(objectMap) + populate(objectMap, "properties", s.Properties) + return json.Marshal(objectMap) +} + +// StaticSitesWorkflowPreviewRequestProperties - StaticSitesWorkflowPreviewRequest resource specific properties +type StaticSitesWorkflowPreviewRequestProperties struct { + // The target branch in the repository. + Branch *string `json:"branch,omitempty"` + + // Build properties to configure on the repository. + BuildProperties *StaticSiteBuildProperties `json:"buildProperties,omitempty"` + + // URL for the repository of the static site. + RepositoryURL *string `json:"repositoryUrl,omitempty"` +} + +// Status - Identify the status of the most severe insight generated by the detector. +type Status struct { + // Descriptive message. + Message *string `json:"message,omitempty"` + + // Level of the most severe insight generated by the detector. + StatusID *InsightStatus `json:"statusId,omitempty"` +} + +// StatusCodesBasedTrigger - Trigger based on status code. +type StatusCodesBasedTrigger struct { + // Request Count. + Count *int32 `json:"count,omitempty"` + + // Request Path + Path *string `json:"path,omitempty"` + + // HTTP status code. + Status *int32 `json:"status,omitempty"` + + // Request Sub Status. + SubStatus *int32 `json:"subStatus,omitempty"` + + // Time interval. + TimeInterval *string `json:"timeInterval,omitempty"` + + // Win32 error code. + Win32Status *int32 `json:"win32Status,omitempty"` +} + +// StatusCodesRangeBasedTrigger - Trigger based on range of status codes. +type StatusCodesRangeBasedTrigger struct { + // Request Count. + Count *int32 `json:"count,omitempty"` + Path *string `json:"path,omitempty"` + + // HTTP status code. + StatusCodes *string `json:"statusCodes,omitempty"` + + // Time interval. + TimeInterval *string `json:"timeInterval,omitempty"` +} + +// StorageMigrationOptions - Options for app content migration. +type StorageMigrationOptions struct { + ProxyOnlyResource + // StorageMigrationOptions resource specific properties + Properties *StorageMigrationOptionsProperties `json:"properties,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type StorageMigrationOptions. +func (s StorageMigrationOptions) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + s.ProxyOnlyResource.marshalInternal(objectMap) + populate(objectMap, "properties", s.Properties) + return json.Marshal(objectMap) +} + +// StorageMigrationOptionsProperties - StorageMigrationOptions resource specific properties +type StorageMigrationOptionsProperties struct { + // REQUIRED; AzureFiles connection string. + AzurefilesConnectionString *string `json:"azurefilesConnectionString,omitempty"` + + // REQUIRED; AzureFiles share. + AzurefilesShare *string `json:"azurefilesShare,omitempty"` + + // true if the app should be read only during copy operation; otherwise, false. + BlockWriteAccessToSite *bool `json:"blockWriteAccessToSite,omitempty"` + + // trueif the app should be switched over; otherwise, false. + SwitchSiteAfterMigration *bool `json:"switchSiteAfterMigration,omitempty"` +} + +// StorageMigrationResponse - Response for a migration of app content request. +type StorageMigrationResponse struct { + ProxyOnlyResource + // StorageMigrationResponse resource specific properties + Properties *StorageMigrationResponseProperties `json:"properties,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type StorageMigrationResponse. +func (s StorageMigrationResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + s.ProxyOnlyResource.marshalInternal(objectMap) + populate(objectMap, "properties", s.Properties) + return json.Marshal(objectMap) +} + +// StorageMigrationResponseProperties - StorageMigrationResponse resource specific properties +type StorageMigrationResponseProperties struct { + // READ-ONLY; When server starts the migration process, it will return an operation ID identifying that particular migration operation. + OperationID *string `json:"operationId,omitempty" azure:"ro"` +} + +// StringDictionary - String dictionary resource. +type StringDictionary struct { + ProxyOnlyResource + // Settings. + Properties map[string]*string `json:"properties,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type StringDictionary. +func (s StringDictionary) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + s.ProxyOnlyResource.marshalInternal(objectMap) + populate(objectMap, "properties", s.Properties) + return json.Marshal(objectMap) +} + +// StringList - String list resource. +type StringList struct { + ProxyOnlyResource + // List of string resources. + Properties []*string `json:"properties,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type StringList. +func (s StringList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + s.ProxyOnlyResource.marshalInternal(objectMap) + populate(objectMap, "properties", s.Properties) + return json.Marshal(objectMap) +} + +// SupportTopic - Defines a unique Support Topic +type SupportTopic struct { + // READ-ONLY; Support Topic Id + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; Unique resource Id + PesID *string `json:"pesId,omitempty" azure:"ro"` +} + +// SwiftVirtualNetwork - Swift Virtual Network Contract. This is used to enable the new Swift way of doing virtual network integration. +type SwiftVirtualNetwork struct { + ProxyOnlyResource + // SwiftVirtualNetwork resource specific properties + Properties *SwiftVirtualNetworkProperties `json:"properties,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type SwiftVirtualNetwork. +func (s SwiftVirtualNetwork) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + s.ProxyOnlyResource.marshalInternal(objectMap) + populate(objectMap, "properties", s.Properties) + return json.Marshal(objectMap) +} + +// SwiftVirtualNetworkProperties - SwiftVirtualNetwork resource specific properties +type SwiftVirtualNetworkProperties struct { + // The Virtual Network subnet's resource ID. This is the subnet that this Web App will join. This subnet must have a delegation to Microsoft.Web/serverFarms + // defined first. + SubnetResourceID *string `json:"subnetResourceId,omitempty"` + + // A flag that specifies if the scale unit this Web App is on supports Swift integration. + SwiftSupported *bool `json:"swiftSupported,omitempty"` +} + +// TldLegalAgreement - Legal agreement for a top level domain. +type TldLegalAgreement struct { + // REQUIRED; Unique identifier for the agreement. + AgreementKey *string `json:"agreementKey,omitempty"` + + // REQUIRED; Agreement details. + Content *string `json:"content,omitempty"` + + // REQUIRED; Agreement title. + Title *string `json:"title,omitempty"` + + // URL where a copy of the agreement details is hosted. + URL *string `json:"url,omitempty"` +} + +// TldLegalAgreementCollection - Collection of top-level domain legal agreements. +type TldLegalAgreementCollection struct { + // REQUIRED; Collection of resources. + Value []*TldLegalAgreement `json:"value,omitempty"` + + // READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type TldLegalAgreementCollection. +func (t TldLegalAgreementCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", t.NextLink) + populate(objectMap, "value", t.Value) + return json.Marshal(objectMap) +} + +// TokenStore - The configuration settings of the token store. +type TokenStore struct { + // The configuration settings of the storage of the tokens if blob storage is used. + AzureBlobStorage *BlobStorageTokenStore `json:"azureBlobStorage,omitempty"` + + // true to durably store platform-specific security tokens that are obtained during login flows; otherwise, false. The default is false. + Enabled *bool `json:"enabled,omitempty"` + + // The configuration settings of the storage of the tokens if a file system is used. + FileSystem *FileSystemTokenStore `json:"fileSystem,omitempty"` + + // The number of hours after session token expiration that a session token can be used to call the token refresh API. The default is 72 hours. + TokenRefreshExtensionHours *float64 `json:"tokenRefreshExtensionHours,omitempty"` +} + +// TopLevelDomain - A top level domain object. +type TopLevelDomain struct { + ProxyOnlyResource + // TopLevelDomain resource specific properties + Properties *TopLevelDomainProperties `json:"properties,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type TopLevelDomain. +func (t TopLevelDomain) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + t.ProxyOnlyResource.marshalInternal(objectMap) + populate(objectMap, "properties", t.Properties) + return json.Marshal(objectMap) +} + +// TopLevelDomainAgreementOption - Options for retrieving the list of top level domain legal agreements. +type TopLevelDomainAgreementOption struct { + // If true, then the list of agreements will include agreements for domain transfer as well; otherwise, false. + ForTransfer *bool `json:"forTransfer,omitempty"` + + // If true, then the list of agreements will include agreements for domain privacy as well; otherwise, false. + IncludePrivacy *bool `json:"includePrivacy,omitempty"` +} + +// TopLevelDomainCollection - Collection of Top-level domains. +type TopLevelDomainCollection struct { + // REQUIRED; Collection of resources. + Value []*TopLevelDomain `json:"value,omitempty"` + + // READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type TopLevelDomainCollection. +func (t TopLevelDomainCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", t.NextLink) + populate(objectMap, "value", t.Value) + return json.Marshal(objectMap) +} + +// TopLevelDomainProperties - TopLevelDomain resource specific properties +type TopLevelDomainProperties struct { + // If true, then the top level domain supports domain privacy; otherwise, false. + Privacy *bool `json:"privacy,omitempty"` +} + +// TopLevelDomainsGetOptions contains the optional parameters for the TopLevelDomains.Get method. +type TopLevelDomainsGetOptions struct { + // placeholder for future optional parameters +} + +// TopLevelDomainsListAgreementsOptions contains the optional parameters for the TopLevelDomains.ListAgreements method. +type TopLevelDomainsListAgreementsOptions struct { + // placeholder for future optional parameters +} + +// TopLevelDomainsListOptions contains the optional parameters for the TopLevelDomains.List method. +type TopLevelDomainsListOptions struct { + // placeholder for future optional parameters +} + +// TriggeredJobHistory - Triggered Web Job History. List of Triggered Web Job Run Information elements. +type TriggeredJobHistory struct { + ProxyOnlyResource + // TriggeredJobHistory resource specific properties + Properties *TriggeredJobHistoryProperties `json:"properties,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type TriggeredJobHistory. +func (t TriggeredJobHistory) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + t.ProxyOnlyResource.marshalInternal(objectMap) + populate(objectMap, "properties", t.Properties) + return json.Marshal(objectMap) +} + +// TriggeredJobHistoryCollection - Collection of Kudu continuous web job information elements. +type TriggeredJobHistoryCollection struct { + // REQUIRED; Collection of resources. + Value []*TriggeredJobHistory `json:"value,omitempty"` + + // READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type TriggeredJobHistoryCollection. +func (t TriggeredJobHistoryCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", t.NextLink) + populate(objectMap, "value", t.Value) + return json.Marshal(objectMap) +} + +// TriggeredJobHistoryProperties - TriggeredJobHistory resource specific properties +type TriggeredJobHistoryProperties struct { + // List of triggered web job runs. + Runs []*TriggeredJobRun `json:"runs,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type TriggeredJobHistoryProperties. +func (t TriggeredJobHistoryProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "runs", t.Runs) + return json.Marshal(objectMap) +} + +// TriggeredJobRun - Triggered Web Job Run Information. +type TriggeredJobRun struct { + // Job duration. + Duration *string `json:"duration,omitempty"` + + // End time. + EndTime *time.Time `json:"end_time,omitempty"` + + // Error URL. + ErrorURL *string `json:"error_url,omitempty"` + + // Job name. + JobName *string `json:"job_name,omitempty"` + + // Output URL. + OutputURL *string `json:"output_url,omitempty"` + + // Start time. + StartTime *time.Time `json:"start_time,omitempty"` + + // Job status. + Status *TriggeredWebJobStatus `json:"status,omitempty"` + + // Job trigger. + Trigger *string `json:"trigger,omitempty"` + + // Job URL. + URL *string `json:"url,omitempty"` + + // Job ID. + WebJobID *string `json:"web_job_id,omitempty"` + + // Job name. + WebJobName *string `json:"web_job_name,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type TriggeredJobRun. +func (t TriggeredJobRun) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "duration", t.Duration) + populateTimeRFC3339(objectMap, "end_time", t.EndTime) + populate(objectMap, "error_url", t.ErrorURL) + populate(objectMap, "job_name", t.JobName) + populate(objectMap, "output_url", t.OutputURL) + populateTimeRFC3339(objectMap, "start_time", t.StartTime) + populate(objectMap, "status", t.Status) + populate(objectMap, "trigger", t.Trigger) + populate(objectMap, "url", t.URL) + populate(objectMap, "web_job_id", t.WebJobID) + populate(objectMap, "web_job_name", t.WebJobName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TriggeredJobRun. +func (t *TriggeredJobRun) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "duration": + err = unpopulate(val, &t.Duration) + delete(rawMsg, key) + case "end_time": + err = unpopulateTimeRFC3339(val, &t.EndTime) + delete(rawMsg, key) + case "error_url": + err = unpopulate(val, &t.ErrorURL) + delete(rawMsg, key) + case "job_name": + err = unpopulate(val, &t.JobName) + delete(rawMsg, key) + case "output_url": + err = unpopulate(val, &t.OutputURL) + delete(rawMsg, key) + case "start_time": + err = unpopulateTimeRFC3339(val, &t.StartTime) + delete(rawMsg, key) + case "status": + err = unpopulate(val, &t.Status) + delete(rawMsg, key) + case "trigger": + err = unpopulate(val, &t.Trigger) + delete(rawMsg, key) + case "url": + err = unpopulate(val, &t.URL) + delete(rawMsg, key) + case "web_job_id": + err = unpopulate(val, &t.WebJobID) + delete(rawMsg, key) + case "web_job_name": + err = unpopulate(val, &t.WebJobName) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// TriggeredWebJob - Triggered Web Job Information. +type TriggeredWebJob struct { + ProxyOnlyResource + // TriggeredWebJob resource specific properties + Properties *TriggeredWebJobProperties `json:"properties,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type TriggeredWebJob. +func (t TriggeredWebJob) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + t.ProxyOnlyResource.marshalInternal(objectMap) + populate(objectMap, "properties", t.Properties) + return json.Marshal(objectMap) +} + +// TriggeredWebJobCollection - Collection of Kudu continuous web job information elements. +type TriggeredWebJobCollection struct { + // REQUIRED; Collection of resources. + Value []*TriggeredWebJob `json:"value,omitempty"` + + // READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type TriggeredWebJobCollection. +func (t TriggeredWebJobCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", t.NextLink) + populate(objectMap, "value", t.Value) + return json.Marshal(objectMap) +} + +// TriggeredWebJobProperties - TriggeredWebJob resource specific properties +type TriggeredWebJobProperties struct { + // Error information. + Error *string `json:"error,omitempty"` + + // Extra Info URL. + ExtraInfoURL *string `json:"extra_info_url,omitempty"` + + // History URL. + HistoryURL *string `json:"history_url,omitempty"` + + // Latest job run information. + LatestRun *TriggeredJobRun `json:"latest_run,omitempty"` + + // Run command. + RunCommand *string `json:"run_command,omitempty"` + + // Scheduler Logs URL. + SchedulerLogsURL *string `json:"scheduler_logs_url,omitempty"` + + // Job settings. + Settings map[string]map[string]interface{} `json:"settings,omitempty"` + + // Job URL. + URL *string `json:"url,omitempty"` + + // Using SDK? + UsingSdk *bool `json:"using_sdk,omitempty"` + + // Job type. + WebJobType *WebJobType `json:"web_job_type,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type TriggeredWebJobProperties. +func (t TriggeredWebJobProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "error", t.Error) + populate(objectMap, "extra_info_url", t.ExtraInfoURL) + populate(objectMap, "history_url", t.HistoryURL) + populate(objectMap, "latest_run", t.LatestRun) + populate(objectMap, "run_command", t.RunCommand) + populate(objectMap, "scheduler_logs_url", t.SchedulerLogsURL) + populate(objectMap, "settings", t.Settings) + populate(objectMap, "url", t.URL) + populate(objectMap, "using_sdk", t.UsingSdk) + populate(objectMap, "web_job_type", t.WebJobType) + return json.Marshal(objectMap) +} + +// Twitter - The configuration settings of the Twitter provider. +type Twitter struct { + // false if the Twitter provider should not be enabled despite the set registration; otherwise, true. + Enabled *bool `json:"enabled,omitempty"` + + // The configuration settings of the app registration for the Twitter provider. + Registration *TwitterRegistration `json:"registration,omitempty"` +} + +// TwitterRegistration - The configuration settings of the app registration for the Twitter provider. +type TwitterRegistration struct { + // The OAuth 1.0a consumer key of the Twitter application used for sign-in. This setting is required for enabling Twitter Sign-In. Twitter Sign-In documentation: + // https://dev.twitter.com/web/sign-in + ConsumerKey *string `json:"consumerKey,omitempty"` + + // The app setting name that contains the OAuth 1.0a consumer secret of the Twitter application used for sign-in. + ConsumerSecretSettingName *string `json:"consumerSecretSettingName,omitempty"` +} + +// Usage of the quota resource. +type Usage struct { + ProxyOnlyResource + // Usage resource specific properties + Properties *UsageProperties `json:"properties,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type Usage. +func (u Usage) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + u.ProxyOnlyResource.marshalInternal(objectMap) + populate(objectMap, "properties", u.Properties) + return json.Marshal(objectMap) +} + +// UsageCollection - Collection of usages. +type UsageCollection struct { + // REQUIRED; Collection of resources. + Value []*Usage `json:"value,omitempty"` + + // READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type UsageCollection. +func (u UsageCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", u.NextLink) + populate(objectMap, "value", u.Value) + return json.Marshal(objectMap) +} + +// UsageProperties - Usage resource specific properties +type UsageProperties struct { + // READ-ONLY; Compute mode used for this usage. + ComputeMode *ComputeModeOptions `json:"computeMode,omitempty" azure:"ro"` + + // READ-ONLY; The current value of the resource counter. + CurrentValue *int64 `json:"currentValue,omitempty" azure:"ro"` + + // READ-ONLY; Friendly name shown in the UI. + DisplayName *string `json:"displayName,omitempty" azure:"ro"` + + // READ-ONLY; The resource limit. + Limit *int64 `json:"limit,omitempty" azure:"ro"` + + // READ-ONLY; Next reset time for the resource counter. + NextResetTime *time.Time `json:"nextResetTime,omitempty" azure:"ro"` + + // READ-ONLY; Name of the quota resource. + ResourceName *string `json:"resourceName,omitempty" azure:"ro"` + + // READ-ONLY; Site mode used for this usage. + SiteMode *string `json:"siteMode,omitempty" azure:"ro"` + + // READ-ONLY; Units of measurement for the quota resource. + Unit *string `json:"unit,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type UsageProperties. +func (u UsageProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "computeMode", u.ComputeMode) + populate(objectMap, "currentValue", u.CurrentValue) + populate(objectMap, "displayName", u.DisplayName) + populate(objectMap, "limit", u.Limit) + populateTimeRFC3339(objectMap, "nextResetTime", u.NextResetTime) + populate(objectMap, "resourceName", u.ResourceName) + populate(objectMap, "siteMode", u.SiteMode) + populate(objectMap, "unit", u.Unit) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type UsageProperties. +func (u *UsageProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "computeMode": + err = unpopulate(val, &u.ComputeMode) + delete(rawMsg, key) + case "currentValue": + err = unpopulate(val, &u.CurrentValue) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, &u.DisplayName) + delete(rawMsg, key) + case "limit": + err = unpopulate(val, &u.Limit) + delete(rawMsg, key) + case "nextResetTime": + err = unpopulateTimeRFC3339(val, &u.NextResetTime) + delete(rawMsg, key) + case "resourceName": + err = unpopulate(val, &u.ResourceName) + delete(rawMsg, key) + case "siteMode": + err = unpopulate(val, &u.SiteMode) + delete(rawMsg, key) + case "unit": + err = unpopulate(val, &u.Unit) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// User credentials used for publishing activity. +type User struct { + ProxyOnlyResource + // User resource specific properties + Properties *UserProperties `json:"properties,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type User. +func (u User) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + u.ProxyOnlyResource.marshalInternal(objectMap) + populate(objectMap, "properties", u.Properties) + return json.Marshal(objectMap) +} + +// UserAssignedIdentity - User Assigned identity. +type UserAssignedIdentity struct { + // READ-ONLY; Client Id of user assigned identity + ClientID *string `json:"clientId,omitempty" azure:"ro"` + + // READ-ONLY; Principal Id of user assigned identity + PrincipalID *string `json:"principalId,omitempty" azure:"ro"` +} + +// UserProperties - User resource specific properties +type UserProperties struct { + // REQUIRED; Username used for publishing. + PublishingUserName *string `json:"publishingUserName,omitempty"` + + // Password used for publishing. + PublishingPassword *string `json:"publishingPassword,omitempty"` + + // Password hash used for publishing. + PublishingPasswordHash *string `json:"publishingPasswordHash,omitempty"` + + // Password hash salt used for publishing. + PublishingPasswordHashSalt *string `json:"publishingPasswordHashSalt,omitempty"` + + // Url of SCM site. + ScmURI *string `json:"scmUri,omitempty"` +} + +// ValidateProperties - App properties used for validation. +type ValidateProperties struct { + // App Service Environment Properties + AppServiceEnvironment *AppServiceEnvironment `json:"appServiceEnvironment,omitempty"` + + // Target capacity of the App Service plan (number of VMs). + Capacity *int32 `json:"capacity,omitempty"` + + // Platform (windows or linux) + ContainerImagePlatform *string `json:"containerImagePlatform,omitempty"` + + // Repository name (image name) + ContainerImageRepository *string `json:"containerImageRepository,omitempty"` + + // Image tag + ContainerImageTag *string `json:"containerImageTag,omitempty"` + + // Base URL of the container registry + ContainerRegistryBaseURL *string `json:"containerRegistryBaseUrl,omitempty"` + + // Password for to access the container registry + ContainerRegistryPassword *string `json:"containerRegistryPassword,omitempty"` + + // Username for to access the container registry + ContainerRegistryUsername *string `json:"containerRegistryUsername,omitempty"` + + // Name of App Service Environment where app or App Service plan should be created. + HostingEnvironment *string `json:"hostingEnvironment,omitempty"` + + // true if App Service plan is for Spot instances; otherwise, false. + IsSpot *bool `json:"isSpot,omitempty"` + + // true if App Service plan is running as a windows container + IsXenon *bool `json:"isXenon,omitempty"` + + // true if App Service plan is for Linux workers; otherwise, false. + NeedLinuxWorkers *bool `json:"needLinuxWorkers,omitempty"` + + // Name of the target SKU for the App Service plan. + SKUName *string `json:"skuName,omitempty"` + + // ARM resource ID of an App Service plan that would host the app. + ServerFarmID *string `json:"serverFarmId,omitempty"` +} + +// ValidateRequest - Resource validation request content. +type ValidateRequest struct { + // REQUIRED; Expected location of the resource. + Location *string `json:"location,omitempty"` + + // REQUIRED; Resource name to verify. + Name *string `json:"name,omitempty"` + + // REQUIRED; Properties of the resource to validate. + Properties *ValidateProperties `json:"properties,omitempty"` + + // REQUIRED; Resource type used for verification. + Type *ValidateResourceTypes `json:"type,omitempty"` +} + +// ValidateResponse - Describes the result of resource validation. +type ValidateResponse struct { + // Error details for the case when validation fails. + Error *ValidateResponseError `json:"error,omitempty"` + + // Result of validation. + Status *string `json:"status,omitempty"` +} + +// ValidateResponseError - Error details for when validation fails. +type ValidateResponseError struct { + // Validation error code. + Code *string `json:"code,omitempty"` + + // Validation error message. + Message *string `json:"message,omitempty"` +} + +// VirtualApplication - Virtual application in an app. +type VirtualApplication struct { + // Physical path. + PhysicalPath *string `json:"physicalPath,omitempty"` + + // true if preloading is enabled; otherwise, false. + PreloadEnabled *bool `json:"preloadEnabled,omitempty"` + + // Virtual directories for virtual application. + VirtualDirectories []*VirtualDirectory `json:"virtualDirectories,omitempty"` + + // Virtual path. + VirtualPath *string `json:"virtualPath,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type VirtualApplication. +func (v VirtualApplication) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "physicalPath", v.PhysicalPath) + populate(objectMap, "preloadEnabled", v.PreloadEnabled) + populate(objectMap, "virtualDirectories", v.VirtualDirectories) + populate(objectMap, "virtualPath", v.VirtualPath) + return json.Marshal(objectMap) +} + +// VirtualDirectory - Directory for virtual application. +type VirtualDirectory struct { + // Physical path. + PhysicalPath *string `json:"physicalPath,omitempty"` + + // Path to virtual application. + VirtualPath *string `json:"virtualPath,omitempty"` +} + +// VirtualIPMapping - Virtual IP mapping. +type VirtualIPMapping struct { + // Is virtual IP mapping in use. + InUse *bool `json:"inUse,omitempty"` + + // Internal HTTP port. + InternalHTTPPort *int32 `json:"internalHttpPort,omitempty"` + + // Internal HTTPS port. + InternalHTTPSPort *int32 `json:"internalHttpsPort,omitempty"` + + // name of the service that virtual IP is assigned to + ServiceName *string `json:"serviceName,omitempty"` + + // Virtual IP address. + VirtualIP *string `json:"virtualIP,omitempty"` +} + +// VirtualNetworkProfile - Specification for using a Virtual Network. +type VirtualNetworkProfile struct { + // REQUIRED; Resource id of the Virtual Network. + ID *string `json:"id,omitempty"` + + // Subnet within the Virtual Network. + Subnet *string `json:"subnet,omitempty"` + + // READ-ONLY; Name of the Virtual Network (read-only). + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; Resource type of the Virtual Network (read-only). + Type *string `json:"type,omitempty" azure:"ro"` +} + +// VnetGateway - The Virtual Network gateway contract. This is used to give the Virtual Network gateway access to the VPN package. +type VnetGateway struct { + ProxyOnlyResource + // VnetGateway resource specific properties + Properties *VnetGatewayProperties `json:"properties,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type VnetGateway. +func (v VnetGateway) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + v.ProxyOnlyResource.marshalInternal(objectMap) + populate(objectMap, "properties", v.Properties) + return json.Marshal(objectMap) +} + +// VnetGatewayProperties - VnetGateway resource specific properties +type VnetGatewayProperties struct { + // REQUIRED; The URI where the VPN package can be downloaded. + VPNPackageURI *string `json:"vpnPackageUri,omitempty"` + + // The Virtual Network name. + VnetName *string `json:"vnetName,omitempty"` +} + +// VnetInfo - Virtual Network information contract. +type VnetInfo struct { + // A certificate file (.cer) blob containing the public key of the private key used to authenticate a Point-To-Site VPN connection. + CertBlob *string `json:"certBlob,omitempty"` + + // DNS servers to be used by this Virtual Network. This should be a comma-separated list of IP addresses. + DNSServers *string `json:"dnsServers,omitempty"` + + // Flag that is used to denote if this is VNET injection + IsSwift *bool `json:"isSwift,omitempty"` + + // The Virtual Network's resource ID. + VnetResourceID *string `json:"vnetResourceId,omitempty"` + + // READ-ONLY; The client certificate thumbprint. + CertThumbprint *string `json:"certThumbprint,omitempty" azure:"ro"` + + // READ-ONLY; true if a resync is required; otherwise, false. + ResyncRequired *bool `json:"resyncRequired,omitempty" azure:"ro"` + + // READ-ONLY; The routes that this Virtual Network connection uses. + Routes []*VnetRoute `json:"routes,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type VnetInfo. +func (v VnetInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "certBlob", v.CertBlob) + populate(objectMap, "certThumbprint", v.CertThumbprint) + populate(objectMap, "dnsServers", v.DNSServers) + populate(objectMap, "isSwift", v.IsSwift) + populate(objectMap, "resyncRequired", v.ResyncRequired) + populate(objectMap, "routes", v.Routes) + populate(objectMap, "vnetResourceId", v.VnetResourceID) + return json.Marshal(objectMap) +} + +// VnetInfoResource - Virtual Network information ARM resource. +type VnetInfoResource struct { + ProxyOnlyResource + // Core resource properties + Properties *VnetInfo `json:"properties,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type VnetInfoResource. +func (v VnetInfoResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + v.ProxyOnlyResource.marshalInternal(objectMap) + populate(objectMap, "properties", v.Properties) + return json.Marshal(objectMap) +} + +// VnetParameters - The required set of inputs to validate a VNET +type VnetParameters struct { + ProxyOnlyResource + // VnetParameters resource specific properties + Properties *VnetParametersProperties `json:"properties,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type VnetParameters. +func (v VnetParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + v.ProxyOnlyResource.marshalInternal(objectMap) + populate(objectMap, "properties", v.Properties) + return json.Marshal(objectMap) +} + +// VnetParametersProperties - VnetParameters resource specific properties +type VnetParametersProperties struct { + // The ARM Resource ID of the subnet to validate + SubnetResourceID *string `json:"subnetResourceId,omitempty"` + + // The name of the VNET to be validated + VnetName *string `json:"vnetName,omitempty"` + + // The Resource Group of the VNET to be validated + VnetResourceGroup *string `json:"vnetResourceGroup,omitempty"` + + // The subnet name to be validated + VnetSubnetName *string `json:"vnetSubnetName,omitempty"` +} + +// VnetRoute - Virtual Network route contract used to pass routing information for a Virtual Network. +type VnetRoute struct { + ProxyOnlyResource + // VnetRoute resource specific properties + Properties *VnetRouteProperties `json:"properties,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type VnetRoute. +func (v VnetRoute) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + v.ProxyOnlyResource.marshalInternal(objectMap) + populate(objectMap, "properties", v.Properties) + return json.Marshal(objectMap) +} + +// VnetRouteProperties - VnetRoute resource specific properties +type VnetRouteProperties struct { + // The ending address for this route. If the start address is specified in CIDR notation, this must be omitted. + EndAddress *string `json:"endAddress,omitempty"` + + // The type of route this is: DEFAULT - By default, every app has routes to the local address ranges specified by RFC1918 INHERITED - Routes inherited from + // the real Virtual Network routes STATIC - Static + // route set on the app only + // These values will be used for syncing an app's routes with those from a Virtual Network. + RouteType *RouteType `json:"routeType,omitempty"` + + // The starting address for this route. This may also include a CIDR notation, in which case the end address must not be specified. + StartAddress *string `json:"startAddress,omitempty"` +} + +// VnetValidationFailureDetails - A class that describes the reason for a validation failure. +type VnetValidationFailureDetails struct { + ProxyOnlyResource + // VnetValidationFailureDetails resource specific properties + Properties *VnetValidationFailureDetailsProperties `json:"properties,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type VnetValidationFailureDetails. +func (v VnetValidationFailureDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + v.ProxyOnlyResource.marshalInternal(objectMap) + populate(objectMap, "properties", v.Properties) + return json.Marshal(objectMap) +} + +// VnetValidationFailureDetailsProperties - VnetValidationFailureDetails resource specific properties +type VnetValidationFailureDetailsProperties struct { + // A flag describing whether or not validation failed. + Failed *bool `json:"failed,omitempty"` + + // A list of tests that failed in the validation. + FailedTests []*VnetValidationTestFailure `json:"failedTests,omitempty"` + + // Text describing the validation outcome. + Message *string `json:"message,omitempty"` + + // A list of warnings generated during validation. + Warnings []*VnetValidationTestFailure `json:"warnings,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type VnetValidationFailureDetailsProperties. +func (v VnetValidationFailureDetailsProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "failed", v.Failed) + populate(objectMap, "failedTests", v.FailedTests) + populate(objectMap, "message", v.Message) + populate(objectMap, "warnings", v.Warnings) + return json.Marshal(objectMap) +} + +// VnetValidationTestFailure - A class that describes a test that failed during NSG and UDR validation. +type VnetValidationTestFailure struct { + ProxyOnlyResource + // VnetValidationTestFailure resource specific properties + Properties *VnetValidationTestFailureProperties `json:"properties,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type VnetValidationTestFailure. +func (v VnetValidationTestFailure) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + v.ProxyOnlyResource.marshalInternal(objectMap) + populate(objectMap, "properties", v.Properties) + return json.Marshal(objectMap) +} + +// VnetValidationTestFailureProperties - VnetValidationTestFailure resource specific properties +type VnetValidationTestFailureProperties struct { + // The details of what caused the failure, e.g. the blocking rule name, etc. + Details *string `json:"details,omitempty"` + + // The name of the test that failed. + TestName *string `json:"testName,omitempty"` +} + +// WebAppCollection - Collection of App Service apps. +type WebAppCollection struct { + // REQUIRED; Collection of resources. + Value []*Site `json:"value,omitempty"` + + // READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type WebAppCollection. +func (w WebAppCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", w.NextLink) + populate(objectMap, "value", w.Value) + return json.Marshal(objectMap) +} + +// WebAppInstanceStatusCollection - Collection of app instances. +type WebAppInstanceStatusCollection struct { + // REQUIRED; Collection of resources. + Value []*WebSiteInstanceStatus `json:"value,omitempty"` + + // READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type WebAppInstanceStatusCollection. +func (w WebAppInstanceStatusCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", w.NextLink) + populate(objectMap, "value", w.Value) + return json.Marshal(objectMap) +} + +// WebAppMajorVersion - Web App stack major version. +type WebAppMajorVersion struct { + // READ-ONLY; Web App stack major version (display only). + DisplayText *string `json:"displayText,omitempty" azure:"ro"` + + // READ-ONLY; Minor versions associated with the major version. + MinorVersions []*WebAppMinorVersion `json:"minorVersions,omitempty" azure:"ro"` + + // READ-ONLY; Web App stack major version name. + Value *string `json:"value,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type WebAppMajorVersion. +func (w WebAppMajorVersion) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "displayText", w.DisplayText) + populate(objectMap, "minorVersions", w.MinorVersions) + populate(objectMap, "value", w.Value) + return json.Marshal(objectMap) +} + +// WebAppMinorVersion - Web App stack minor version. +type WebAppMinorVersion struct { + // READ-ONLY; Web App stack minor version (display only). + DisplayText *string `json:"displayText,omitempty" azure:"ro"` + + // READ-ONLY; Settings associated with the minor version. + StackSettings *WebAppRuntimes `json:"stackSettings,omitempty" azure:"ro"` + + // READ-ONLY; Web App stack major version name. + Value *string `json:"value,omitempty" azure:"ro"` +} + +// WebAppRuntimeSettings - Web App runtime settings. +type WebAppRuntimeSettings struct { + // READ-ONLY; Application Insights settings associated with the minor version. + AppInsightsSettings *AppInsightsWebAppStackSettings `json:"appInsightsSettings,omitempty" azure:"ro"` + + // READ-ONLY; End-of-life date for the minor version. + EndOfLifeDate *time.Time `json:"endOfLifeDate,omitempty" azure:"ro"` + + // READ-ONLY; GitHub Actions settings associated with the minor version. + GitHubActionSettings *GitHubActionWebAppStackSettings `json:"gitHubActionSettings,omitempty" azure:"ro"` + + // READ-ONLY; true if the stack version is auto-updated; otherwise, false. + IsAutoUpdate *bool `json:"isAutoUpdate,omitempty" azure:"ro"` + + // READ-ONLY; true if the stack is deprecated; otherwise, false. + IsDeprecated *bool `json:"isDeprecated,omitempty" azure:"ro"` + + // READ-ONLY; true if the minor version is early-access; otherwise, false. + IsEarlyAccess *bool `json:"isEarlyAccess,omitempty" azure:"ro"` + + // READ-ONLY; true if the stack should be hidden; otherwise, false. + IsHidden *bool `json:"isHidden,omitempty" azure:"ro"` + + // READ-ONLY; true if the stack is in preview; otherwise, false. + IsPreview *bool `json:"isPreview,omitempty" azure:"ro"` + + // READ-ONLY; true if remote debugging is supported for the stack; otherwise, false. + RemoteDebuggingSupported *bool `json:"remoteDebuggingSupported,omitempty" azure:"ro"` + + // READ-ONLY; Web App stack minor version (runtime only). + RuntimeVersion *string `json:"runtimeVersion,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type WebAppRuntimeSettings. +func (w WebAppRuntimeSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "appInsightsSettings", w.AppInsightsSettings) + populateTimeRFC3339(objectMap, "endOfLifeDate", w.EndOfLifeDate) + populate(objectMap, "gitHubActionSettings", w.GitHubActionSettings) + populate(objectMap, "isAutoUpdate", w.IsAutoUpdate) + populate(objectMap, "isDeprecated", w.IsDeprecated) + populate(objectMap, "isEarlyAccess", w.IsEarlyAccess) + populate(objectMap, "isHidden", w.IsHidden) + populate(objectMap, "isPreview", w.IsPreview) + populate(objectMap, "remoteDebuggingSupported", w.RemoteDebuggingSupported) + populate(objectMap, "runtimeVersion", w.RuntimeVersion) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WebAppRuntimeSettings. +func (w *WebAppRuntimeSettings) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "appInsightsSettings": + err = unpopulate(val, &w.AppInsightsSettings) + delete(rawMsg, key) + case "endOfLifeDate": + err = unpopulateTimeRFC3339(val, &w.EndOfLifeDate) + delete(rawMsg, key) + case "gitHubActionSettings": + err = unpopulate(val, &w.GitHubActionSettings) + delete(rawMsg, key) + case "isAutoUpdate": + err = unpopulate(val, &w.IsAutoUpdate) + delete(rawMsg, key) + case "isDeprecated": + err = unpopulate(val, &w.IsDeprecated) + delete(rawMsg, key) + case "isEarlyAccess": + err = unpopulate(val, &w.IsEarlyAccess) + delete(rawMsg, key) + case "isHidden": + err = unpopulate(val, &w.IsHidden) + delete(rawMsg, key) + case "isPreview": + err = unpopulate(val, &w.IsPreview) + delete(rawMsg, key) + case "remoteDebuggingSupported": + err = unpopulate(val, &w.RemoteDebuggingSupported) + delete(rawMsg, key) + case "runtimeVersion": + err = unpopulate(val, &w.RuntimeVersion) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// WebAppRuntimes - Web App stack runtimes. +type WebAppRuntimes struct { + // READ-ONLY; Linux-specific settings associated with the Java container minor version. + LinuxContainerSettings *LinuxJavaContainerSettings `json:"linuxContainerSettings,omitempty" azure:"ro"` + + // READ-ONLY; Linux-specific settings associated with the minor version. + LinuxRuntimeSettings *WebAppRuntimeSettings `json:"linuxRuntimeSettings,omitempty" azure:"ro"` + + // READ-ONLY; Windows-specific settings associated with the Java container minor version. + WindowsContainerSettings *WindowsJavaContainerSettings `json:"windowsContainerSettings,omitempty" azure:"ro"` + + // READ-ONLY; Windows-specific settings associated with the minor version. + WindowsRuntimeSettings *WebAppRuntimeSettings `json:"windowsRuntimeSettings,omitempty" azure:"ro"` +} + +// WebAppStack - Web App stack. +type WebAppStack struct { + ProxyOnlyResource + // WebAppStack resource specific properties + Properties *WebAppStackProperties `json:"properties,omitempty"` + + // READ-ONLY; Web App stack location. + Location *string `json:"location,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type WebAppStack. +func (w WebAppStack) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + w.ProxyOnlyResource.marshalInternal(objectMap) + populate(objectMap, "location", w.Location) + populate(objectMap, "properties", w.Properties) + return json.Marshal(objectMap) +} + +// WebAppStackCollection - Collection of Web app Stacks +type WebAppStackCollection struct { + // REQUIRED; Collection of resources. + Value []*WebAppStack `json:"value,omitempty"` + + // READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type WebAppStackCollection. +func (w WebAppStackCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", w.NextLink) + populate(objectMap, "value", w.Value) + return json.Marshal(objectMap) +} + +// WebAppStackProperties - WebAppStack resource specific properties +type WebAppStackProperties struct { + // READ-ONLY; Web App stack (display only). + DisplayText *string `json:"displayText,omitempty" azure:"ro"` + + // READ-ONLY; List of major versions available. + MajorVersions []*WebAppMajorVersion `json:"majorVersions,omitempty" azure:"ro"` + + // READ-ONLY; Web App stack preferred OS. + PreferredOs *StackPreferredOs `json:"preferredOs,omitempty" azure:"ro"` + + // READ-ONLY; Web App stack name. + Value *string `json:"value,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type WebAppStackProperties. +func (w WebAppStackProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "displayText", w.DisplayText) + populate(objectMap, "majorVersions", w.MajorVersions) + populate(objectMap, "preferredOs", w.PreferredOs) + populate(objectMap, "value", w.Value) + return json.Marshal(objectMap) +} + +// WebAppsAddPremierAddOnOptions contains the optional parameters for the WebApps.AddPremierAddOn method. +type WebAppsAddPremierAddOnOptions struct { + // placeholder for future optional parameters +} + +// WebAppsAddPremierAddOnSlotOptions contains the optional parameters for the WebApps.AddPremierAddOnSlot method. +type WebAppsAddPremierAddOnSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsAnalyzeCustomHostnameOptions contains the optional parameters for the WebApps.AnalyzeCustomHostname method. +type WebAppsAnalyzeCustomHostnameOptions struct { + // Custom hostname. + HostName *string +} + +// WebAppsAnalyzeCustomHostnameSlotOptions contains the optional parameters for the WebApps.AnalyzeCustomHostnameSlot method. +type WebAppsAnalyzeCustomHostnameSlotOptions struct { + // Custom hostname. + HostName *string +} + +// WebAppsApplySlotConfigToProductionOptions contains the optional parameters for the WebApps.ApplySlotConfigToProduction method. +type WebAppsApplySlotConfigToProductionOptions struct { + // placeholder for future optional parameters +} + +// WebAppsApplySlotConfigurationSlotOptions contains the optional parameters for the WebApps.ApplySlotConfigurationSlot method. +type WebAppsApplySlotConfigurationSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsBackupOptions contains the optional parameters for the WebApps.Backup method. +type WebAppsBackupOptions struct { + // placeholder for future optional parameters +} + +// WebAppsBackupSlotOptions contains the optional parameters for the WebApps.BackupSlot method. +type WebAppsBackupSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsBeginApproveOrRejectPrivateEndpointConnectionOptions contains the optional parameters for the WebApps.BeginApproveOrRejectPrivateEndpointConnection +// method. +type WebAppsBeginApproveOrRejectPrivateEndpointConnectionOptions struct { + // placeholder for future optional parameters +} + +// WebAppsBeginApproveOrRejectPrivateEndpointConnectionSlotOptions contains the optional parameters for the WebApps.BeginApproveOrRejectPrivateEndpointConnectionSlot +// method. +type WebAppsBeginApproveOrRejectPrivateEndpointConnectionSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsBeginCreateFunctionOptions contains the optional parameters for the WebApps.BeginCreateFunction method. +type WebAppsBeginCreateFunctionOptions struct { + // placeholder for future optional parameters +} + +// WebAppsBeginCreateInstanceFunctionSlotOptions contains the optional parameters for the WebApps.BeginCreateInstanceFunctionSlot method. +type WebAppsBeginCreateInstanceFunctionSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsBeginCreateInstanceMSDeployOperationOptions contains the optional parameters for the WebApps.BeginCreateInstanceMSDeployOperation method. +type WebAppsBeginCreateInstanceMSDeployOperationOptions struct { + // placeholder for future optional parameters +} + +// WebAppsBeginCreateInstanceMSDeployOperationSlotOptions contains the optional parameters for the WebApps.BeginCreateInstanceMSDeployOperationSlot method. +type WebAppsBeginCreateInstanceMSDeployOperationSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsBeginCreateMSDeployOperationOptions contains the optional parameters for the WebApps.BeginCreateMSDeployOperation method. +type WebAppsBeginCreateMSDeployOperationOptions struct { + // placeholder for future optional parameters +} + +// WebAppsBeginCreateMSDeployOperationSlotOptions contains the optional parameters for the WebApps.BeginCreateMSDeployOperationSlot method. +type WebAppsBeginCreateMSDeployOperationSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsBeginCreateOrUpdateOptions contains the optional parameters for the WebApps.BeginCreateOrUpdate method. +type WebAppsBeginCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// WebAppsBeginCreateOrUpdateSlotOptions contains the optional parameters for the WebApps.BeginCreateOrUpdateSlot method. +type WebAppsBeginCreateOrUpdateSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsBeginCreateOrUpdateSourceControlOptions contains the optional parameters for the WebApps.BeginCreateOrUpdateSourceControl method. +type WebAppsBeginCreateOrUpdateSourceControlOptions struct { + // placeholder for future optional parameters +} + +// WebAppsBeginCreateOrUpdateSourceControlSlotOptions contains the optional parameters for the WebApps.BeginCreateOrUpdateSourceControlSlot method. +type WebAppsBeginCreateOrUpdateSourceControlSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsBeginDeletePrivateEndpointConnectionOptions contains the optional parameters for the WebApps.BeginDeletePrivateEndpointConnection method. +type WebAppsBeginDeletePrivateEndpointConnectionOptions struct { + // placeholder for future optional parameters +} + +// WebAppsBeginDeletePrivateEndpointConnectionSlotOptions contains the optional parameters for the WebApps.BeginDeletePrivateEndpointConnectionSlot method. +type WebAppsBeginDeletePrivateEndpointConnectionSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsBeginInstallSiteExtensionOptions contains the optional parameters for the WebApps.BeginInstallSiteExtension method. +type WebAppsBeginInstallSiteExtensionOptions struct { + // placeholder for future optional parameters +} + +// WebAppsBeginInstallSiteExtensionSlotOptions contains the optional parameters for the WebApps.BeginInstallSiteExtensionSlot method. +type WebAppsBeginInstallSiteExtensionSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsBeginListPublishingCredentialsOptions contains the optional parameters for the WebApps.BeginListPublishingCredentials method. +type WebAppsBeginListPublishingCredentialsOptions struct { + // placeholder for future optional parameters +} + +// WebAppsBeginListPublishingCredentialsSlotOptions contains the optional parameters for the WebApps.BeginListPublishingCredentialsSlot method. +type WebAppsBeginListPublishingCredentialsSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsBeginMigrateMySQLOptions contains the optional parameters for the WebApps.BeginMigrateMySQL method. +type WebAppsBeginMigrateMySQLOptions struct { + // placeholder for future optional parameters +} + +// WebAppsBeginMigrateStorageOptions contains the optional parameters for the WebApps.BeginMigrateStorage method. +type WebAppsBeginMigrateStorageOptions struct { + // placeholder for future optional parameters +} + +// WebAppsBeginRestoreFromBackupBlobOptions contains the optional parameters for the WebApps.BeginRestoreFromBackupBlob method. +type WebAppsBeginRestoreFromBackupBlobOptions struct { + // placeholder for future optional parameters +} + +// WebAppsBeginRestoreFromBackupBlobSlotOptions contains the optional parameters for the WebApps.BeginRestoreFromBackupBlobSlot method. +type WebAppsBeginRestoreFromBackupBlobSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsBeginRestoreFromDeletedAppOptions contains the optional parameters for the WebApps.BeginRestoreFromDeletedApp method. +type WebAppsBeginRestoreFromDeletedAppOptions struct { + // placeholder for future optional parameters +} + +// WebAppsBeginRestoreFromDeletedAppSlotOptions contains the optional parameters for the WebApps.BeginRestoreFromDeletedAppSlot method. +type WebAppsBeginRestoreFromDeletedAppSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsBeginRestoreOptions contains the optional parameters for the WebApps.BeginRestore method. +type WebAppsBeginRestoreOptions struct { + // placeholder for future optional parameters +} + +// WebAppsBeginRestoreSlotOptions contains the optional parameters for the WebApps.BeginRestoreSlot method. +type WebAppsBeginRestoreSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsBeginRestoreSnapshotOptions contains the optional parameters for the WebApps.BeginRestoreSnapshot method. +type WebAppsBeginRestoreSnapshotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsBeginRestoreSnapshotSlotOptions contains the optional parameters for the WebApps.BeginRestoreSnapshotSlot method. +type WebAppsBeginRestoreSnapshotSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsBeginStartNetworkTraceOptions contains the optional parameters for the WebApps.BeginStartNetworkTrace method. +type WebAppsBeginStartNetworkTraceOptions struct { + // The duration to keep capturing in seconds. + DurationInSeconds *int32 + // The maximum frame length in bytes (Optional). + MaxFrameLength *int32 + // The Blob URL to store capture file. + SasURL *string +} + +// WebAppsBeginStartNetworkTraceSlotOptions contains the optional parameters for the WebApps.BeginStartNetworkTraceSlot method. +type WebAppsBeginStartNetworkTraceSlotOptions struct { + // The duration to keep capturing in seconds. + DurationInSeconds *int32 + // The maximum frame length in bytes (Optional). + MaxFrameLength *int32 + // The Blob URL to store capture file. + SasURL *string +} + +// WebAppsBeginStartWebSiteNetworkTraceOperationOptions contains the optional parameters for the WebApps.BeginStartWebSiteNetworkTraceOperation method. +type WebAppsBeginStartWebSiteNetworkTraceOperationOptions struct { + // The duration to keep capturing in seconds. + DurationInSeconds *int32 + // The maximum frame length in bytes (Optional). + MaxFrameLength *int32 + // The Blob URL to store capture file. + SasURL *string +} + +// WebAppsBeginStartWebSiteNetworkTraceOperationSlotOptions contains the optional parameters for the WebApps.BeginStartWebSiteNetworkTraceOperationSlot +// method. +type WebAppsBeginStartWebSiteNetworkTraceOperationSlotOptions struct { + // The duration to keep capturing in seconds. + DurationInSeconds *int32 + // The maximum frame length in bytes (Optional). + MaxFrameLength *int32 + // The Blob URL to store capture file. + SasURL *string +} + +// WebAppsBeginSwapSlotOptions contains the optional parameters for the WebApps.BeginSwapSlot method. +type WebAppsBeginSwapSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsBeginSwapSlotWithProductionOptions contains the optional parameters for the WebApps.BeginSwapSlotWithProduction method. +type WebAppsBeginSwapSlotWithProductionOptions struct { + // placeholder for future optional parameters +} + +// WebAppsCreateDeploymentOptions contains the optional parameters for the WebApps.CreateDeployment method. +type WebAppsCreateDeploymentOptions struct { + // placeholder for future optional parameters +} + +// WebAppsCreateDeploymentSlotOptions contains the optional parameters for the WebApps.CreateDeploymentSlot method. +type WebAppsCreateDeploymentSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsCreateOrUpdateConfigurationOptions contains the optional parameters for the WebApps.CreateOrUpdateConfiguration method. +type WebAppsCreateOrUpdateConfigurationOptions struct { + // placeholder for future optional parameters +} + +// WebAppsCreateOrUpdateConfigurationSlotOptions contains the optional parameters for the WebApps.CreateOrUpdateConfigurationSlot method. +type WebAppsCreateOrUpdateConfigurationSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsCreateOrUpdateDomainOwnershipIdentifierOptions contains the optional parameters for the WebApps.CreateOrUpdateDomainOwnershipIdentifier method. +type WebAppsCreateOrUpdateDomainOwnershipIdentifierOptions struct { + // placeholder for future optional parameters +} + +// WebAppsCreateOrUpdateDomainOwnershipIdentifierSlotOptions contains the optional parameters for the WebApps.CreateOrUpdateDomainOwnershipIdentifierSlot +// method. +type WebAppsCreateOrUpdateDomainOwnershipIdentifierSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsCreateOrUpdateFunctionSecretOptions contains the optional parameters for the WebApps.CreateOrUpdateFunctionSecret method. +type WebAppsCreateOrUpdateFunctionSecretOptions struct { + // placeholder for future optional parameters +} + +// WebAppsCreateOrUpdateFunctionSecretSlotOptions contains the optional parameters for the WebApps.CreateOrUpdateFunctionSecretSlot method. +type WebAppsCreateOrUpdateFunctionSecretSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsCreateOrUpdateHostNameBindingOptions contains the optional parameters for the WebApps.CreateOrUpdateHostNameBinding method. +type WebAppsCreateOrUpdateHostNameBindingOptions struct { + // placeholder for future optional parameters +} + +// WebAppsCreateOrUpdateHostNameBindingSlotOptions contains the optional parameters for the WebApps.CreateOrUpdateHostNameBindingSlot method. +type WebAppsCreateOrUpdateHostNameBindingSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsCreateOrUpdateHostSecretOptions contains the optional parameters for the WebApps.CreateOrUpdateHostSecret method. +type WebAppsCreateOrUpdateHostSecretOptions struct { + // placeholder for future optional parameters +} + +// WebAppsCreateOrUpdateHostSecretSlotOptions contains the optional parameters for the WebApps.CreateOrUpdateHostSecretSlot method. +type WebAppsCreateOrUpdateHostSecretSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsCreateOrUpdateHybridConnectionOptions contains the optional parameters for the WebApps.CreateOrUpdateHybridConnection method. +type WebAppsCreateOrUpdateHybridConnectionOptions struct { + // placeholder for future optional parameters +} + +// WebAppsCreateOrUpdateHybridConnectionSlotOptions contains the optional parameters for the WebApps.CreateOrUpdateHybridConnectionSlot method. +type WebAppsCreateOrUpdateHybridConnectionSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsCreateOrUpdatePublicCertificateOptions contains the optional parameters for the WebApps.CreateOrUpdatePublicCertificate method. +type WebAppsCreateOrUpdatePublicCertificateOptions struct { + // placeholder for future optional parameters +} + +// WebAppsCreateOrUpdatePublicCertificateSlotOptions contains the optional parameters for the WebApps.CreateOrUpdatePublicCertificateSlot method. +type WebAppsCreateOrUpdatePublicCertificateSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsCreateOrUpdateRelayServiceConnectionOptions contains the optional parameters for the WebApps.CreateOrUpdateRelayServiceConnection method. +type WebAppsCreateOrUpdateRelayServiceConnectionOptions struct { + // placeholder for future optional parameters +} + +// WebAppsCreateOrUpdateRelayServiceConnectionSlotOptions contains the optional parameters for the WebApps.CreateOrUpdateRelayServiceConnectionSlot method. +type WebAppsCreateOrUpdateRelayServiceConnectionSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsCreateOrUpdateSwiftVirtualNetworkConnectionWithCheckOptions contains the optional parameters for the WebApps.CreateOrUpdateSwiftVirtualNetworkConnectionWithCheck +// method. +type WebAppsCreateOrUpdateSwiftVirtualNetworkConnectionWithCheckOptions struct { + // placeholder for future optional parameters +} + +// WebAppsCreateOrUpdateSwiftVirtualNetworkConnectionWithCheckSlotOptions contains the optional parameters for the WebApps.CreateOrUpdateSwiftVirtualNetworkConnectionWithCheckSlot +// method. +type WebAppsCreateOrUpdateSwiftVirtualNetworkConnectionWithCheckSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsCreateOrUpdateVnetConnectionGatewayOptions contains the optional parameters for the WebApps.CreateOrUpdateVnetConnectionGateway method. +type WebAppsCreateOrUpdateVnetConnectionGatewayOptions struct { + // placeholder for future optional parameters +} + +// WebAppsCreateOrUpdateVnetConnectionGatewaySlotOptions contains the optional parameters for the WebApps.CreateOrUpdateVnetConnectionGatewaySlot method. +type WebAppsCreateOrUpdateVnetConnectionGatewaySlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsCreateOrUpdateVnetConnectionOptions contains the optional parameters for the WebApps.CreateOrUpdateVnetConnection method. +type WebAppsCreateOrUpdateVnetConnectionOptions struct { + // placeholder for future optional parameters +} + +// WebAppsCreateOrUpdateVnetConnectionSlotOptions contains the optional parameters for the WebApps.CreateOrUpdateVnetConnectionSlot method. +type WebAppsCreateOrUpdateVnetConnectionSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsDeleteBackupConfigurationOptions contains the optional parameters for the WebApps.DeleteBackupConfiguration method. +type WebAppsDeleteBackupConfigurationOptions struct { + // placeholder for future optional parameters +} + +// WebAppsDeleteBackupConfigurationSlotOptions contains the optional parameters for the WebApps.DeleteBackupConfigurationSlot method. +type WebAppsDeleteBackupConfigurationSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsDeleteBackupOptions contains the optional parameters for the WebApps.DeleteBackup method. +type WebAppsDeleteBackupOptions struct { + // placeholder for future optional parameters +} + +// WebAppsDeleteBackupSlotOptions contains the optional parameters for the WebApps.DeleteBackupSlot method. +type WebAppsDeleteBackupSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsDeleteContinuousWebJobOptions contains the optional parameters for the WebApps.DeleteContinuousWebJob method. +type WebAppsDeleteContinuousWebJobOptions struct { + // placeholder for future optional parameters +} + +// WebAppsDeleteContinuousWebJobSlotOptions contains the optional parameters for the WebApps.DeleteContinuousWebJobSlot method. +type WebAppsDeleteContinuousWebJobSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsDeleteDeploymentOptions contains the optional parameters for the WebApps.DeleteDeployment method. +type WebAppsDeleteDeploymentOptions struct { + // placeholder for future optional parameters +} + +// WebAppsDeleteDeploymentSlotOptions contains the optional parameters for the WebApps.DeleteDeploymentSlot method. +type WebAppsDeleteDeploymentSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsDeleteDomainOwnershipIdentifierOptions contains the optional parameters for the WebApps.DeleteDomainOwnershipIdentifier method. +type WebAppsDeleteDomainOwnershipIdentifierOptions struct { + // placeholder for future optional parameters +} + +// WebAppsDeleteDomainOwnershipIdentifierSlotOptions contains the optional parameters for the WebApps.DeleteDomainOwnershipIdentifierSlot method. +type WebAppsDeleteDomainOwnershipIdentifierSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsDeleteFunctionOptions contains the optional parameters for the WebApps.DeleteFunction method. +type WebAppsDeleteFunctionOptions struct { + // placeholder for future optional parameters +} + +// WebAppsDeleteFunctionSecretOptions contains the optional parameters for the WebApps.DeleteFunctionSecret method. +type WebAppsDeleteFunctionSecretOptions struct { + // placeholder for future optional parameters +} + +// WebAppsDeleteFunctionSecretSlotOptions contains the optional parameters for the WebApps.DeleteFunctionSecretSlot method. +type WebAppsDeleteFunctionSecretSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsDeleteHostNameBindingOptions contains the optional parameters for the WebApps.DeleteHostNameBinding method. +type WebAppsDeleteHostNameBindingOptions struct { + // placeholder for future optional parameters +} + +// WebAppsDeleteHostNameBindingSlotOptions contains the optional parameters for the WebApps.DeleteHostNameBindingSlot method. +type WebAppsDeleteHostNameBindingSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsDeleteHostSecretOptions contains the optional parameters for the WebApps.DeleteHostSecret method. +type WebAppsDeleteHostSecretOptions struct { + // placeholder for future optional parameters +} + +// WebAppsDeleteHostSecretSlotOptions contains the optional parameters for the WebApps.DeleteHostSecretSlot method. +type WebAppsDeleteHostSecretSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsDeleteHybridConnectionOptions contains the optional parameters for the WebApps.DeleteHybridConnection method. +type WebAppsDeleteHybridConnectionOptions struct { + // placeholder for future optional parameters +} + +// WebAppsDeleteHybridConnectionSlotOptions contains the optional parameters for the WebApps.DeleteHybridConnectionSlot method. +type WebAppsDeleteHybridConnectionSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsDeleteInstanceFunctionSlotOptions contains the optional parameters for the WebApps.DeleteInstanceFunctionSlot method. +type WebAppsDeleteInstanceFunctionSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsDeleteInstanceProcessOptions contains the optional parameters for the WebApps.DeleteInstanceProcess method. +type WebAppsDeleteInstanceProcessOptions struct { + // placeholder for future optional parameters +} + +// WebAppsDeleteInstanceProcessSlotOptions contains the optional parameters for the WebApps.DeleteInstanceProcessSlot method. +type WebAppsDeleteInstanceProcessSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsDeleteOptions contains the optional parameters for the WebApps.Delete method. +type WebAppsDeleteOptions struct { + // Specify false if you want to keep empty App Service plan. By default, empty App Service plan is deleted. + DeleteEmptyServerFarm *bool + // If true, web app metrics are also deleted. + DeleteMetrics *bool +} + +// WebAppsDeletePremierAddOnOptions contains the optional parameters for the WebApps.DeletePremierAddOn method. +type WebAppsDeletePremierAddOnOptions struct { + // placeholder for future optional parameters +} + +// WebAppsDeletePremierAddOnSlotOptions contains the optional parameters for the WebApps.DeletePremierAddOnSlot method. +type WebAppsDeletePremierAddOnSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsDeleteProcessOptions contains the optional parameters for the WebApps.DeleteProcess method. +type WebAppsDeleteProcessOptions struct { + // placeholder for future optional parameters +} + +// WebAppsDeleteProcessSlotOptions contains the optional parameters for the WebApps.DeleteProcessSlot method. +type WebAppsDeleteProcessSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsDeletePublicCertificateOptions contains the optional parameters for the WebApps.DeletePublicCertificate method. +type WebAppsDeletePublicCertificateOptions struct { + // placeholder for future optional parameters +} + +// WebAppsDeletePublicCertificateSlotOptions contains the optional parameters for the WebApps.DeletePublicCertificateSlot method. +type WebAppsDeletePublicCertificateSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsDeleteRelayServiceConnectionOptions contains the optional parameters for the WebApps.DeleteRelayServiceConnection method. +type WebAppsDeleteRelayServiceConnectionOptions struct { + // placeholder for future optional parameters +} + +// WebAppsDeleteRelayServiceConnectionSlotOptions contains the optional parameters for the WebApps.DeleteRelayServiceConnectionSlot method. +type WebAppsDeleteRelayServiceConnectionSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsDeleteSiteExtensionOptions contains the optional parameters for the WebApps.DeleteSiteExtension method. +type WebAppsDeleteSiteExtensionOptions struct { + // placeholder for future optional parameters +} + +// WebAppsDeleteSiteExtensionSlotOptions contains the optional parameters for the WebApps.DeleteSiteExtensionSlot method. +type WebAppsDeleteSiteExtensionSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsDeleteSlotOptions contains the optional parameters for the WebApps.DeleteSlot method. +type WebAppsDeleteSlotOptions struct { + // Specify false if you want to keep empty App Service plan. By default, empty App Service plan is deleted. + DeleteEmptyServerFarm *bool + // If true, web app metrics are also deleted. + DeleteMetrics *bool +} + +// WebAppsDeleteSourceControlOptions contains the optional parameters for the WebApps.DeleteSourceControl method. +type WebAppsDeleteSourceControlOptions struct { + AdditionalFlags *string +} + +// WebAppsDeleteSourceControlSlotOptions contains the optional parameters for the WebApps.DeleteSourceControlSlot method. +type WebAppsDeleteSourceControlSlotOptions struct { + AdditionalFlags *string +} + +// WebAppsDeleteSwiftVirtualNetworkOptions contains the optional parameters for the WebApps.DeleteSwiftVirtualNetwork method. +type WebAppsDeleteSwiftVirtualNetworkOptions struct { + // placeholder for future optional parameters +} + +// WebAppsDeleteSwiftVirtualNetworkSlotOptions contains the optional parameters for the WebApps.DeleteSwiftVirtualNetworkSlot method. +type WebAppsDeleteSwiftVirtualNetworkSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsDeleteTriggeredWebJobOptions contains the optional parameters for the WebApps.DeleteTriggeredWebJob method. +type WebAppsDeleteTriggeredWebJobOptions struct { + // placeholder for future optional parameters +} + +// WebAppsDeleteTriggeredWebJobSlotOptions contains the optional parameters for the WebApps.DeleteTriggeredWebJobSlot method. +type WebAppsDeleteTriggeredWebJobSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsDeleteVnetConnectionOptions contains the optional parameters for the WebApps.DeleteVnetConnection method. +type WebAppsDeleteVnetConnectionOptions struct { + // placeholder for future optional parameters +} + +// WebAppsDeleteVnetConnectionSlotOptions contains the optional parameters for the WebApps.DeleteVnetConnectionSlot method. +type WebAppsDeleteVnetConnectionSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsDiscoverBackupOptions contains the optional parameters for the WebApps.DiscoverBackup method. +type WebAppsDiscoverBackupOptions struct { + // placeholder for future optional parameters +} + +// WebAppsDiscoverBackupSlotOptions contains the optional parameters for the WebApps.DiscoverBackupSlot method. +type WebAppsDiscoverBackupSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsGenerateNewSitePublishingPasswordOptions contains the optional parameters for the WebApps.GenerateNewSitePublishingPassword method. +type WebAppsGenerateNewSitePublishingPasswordOptions struct { + // placeholder for future optional parameters +} + +// WebAppsGenerateNewSitePublishingPasswordSlotOptions contains the optional parameters for the WebApps.GenerateNewSitePublishingPasswordSlot method. +type WebAppsGenerateNewSitePublishingPasswordSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsGetAppSettingKeyVaultReferenceOptions contains the optional parameters for the WebApps.GetAppSettingKeyVaultReference method. +type WebAppsGetAppSettingKeyVaultReferenceOptions struct { + // placeholder for future optional parameters +} + +// WebAppsGetAppSettingKeyVaultReferenceSlotOptions contains the optional parameters for the WebApps.GetAppSettingKeyVaultReferenceSlot method. +type WebAppsGetAppSettingKeyVaultReferenceSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsGetAppSettingsKeyVaultReferencesOptions contains the optional parameters for the WebApps.GetAppSettingsKeyVaultReferences method. +type WebAppsGetAppSettingsKeyVaultReferencesOptions struct { + // placeholder for future optional parameters +} + +// WebAppsGetAppSettingsKeyVaultReferencesSlotOptions contains the optional parameters for the WebApps.GetAppSettingsKeyVaultReferencesSlot method. +type WebAppsGetAppSettingsKeyVaultReferencesSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsGetAuthSettingsOptions contains the optional parameters for the WebApps.GetAuthSettings method. +type WebAppsGetAuthSettingsOptions struct { + // placeholder for future optional parameters +} + +// WebAppsGetAuthSettingsSlotOptions contains the optional parameters for the WebApps.GetAuthSettingsSlot method. +type WebAppsGetAuthSettingsSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsGetAuthSettingsV2Options contains the optional parameters for the WebApps.GetAuthSettingsV2 method. +type WebAppsGetAuthSettingsV2Options struct { + // placeholder for future optional parameters +} + +// WebAppsGetAuthSettingsV2SlotOptions contains the optional parameters for the WebApps.GetAuthSettingsV2Slot method. +type WebAppsGetAuthSettingsV2SlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsGetBackupConfigurationOptions contains the optional parameters for the WebApps.GetBackupConfiguration method. +type WebAppsGetBackupConfigurationOptions struct { + // placeholder for future optional parameters +} + +// WebAppsGetBackupConfigurationSlotOptions contains the optional parameters for the WebApps.GetBackupConfigurationSlot method. +type WebAppsGetBackupConfigurationSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsGetBackupStatusOptions contains the optional parameters for the WebApps.GetBackupStatus method. +type WebAppsGetBackupStatusOptions struct { + // placeholder for future optional parameters +} + +// WebAppsGetBackupStatusSlotOptions contains the optional parameters for the WebApps.GetBackupStatusSlot method. +type WebAppsGetBackupStatusSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsGetConfigurationOptions contains the optional parameters for the WebApps.GetConfiguration method. +type WebAppsGetConfigurationOptions struct { + // placeholder for future optional parameters +} + +// WebAppsGetConfigurationSlotOptions contains the optional parameters for the WebApps.GetConfigurationSlot method. +type WebAppsGetConfigurationSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsGetConfigurationSnapshotOptions contains the optional parameters for the WebApps.GetConfigurationSnapshot method. +type WebAppsGetConfigurationSnapshotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsGetConfigurationSnapshotSlotOptions contains the optional parameters for the WebApps.GetConfigurationSnapshotSlot method. +type WebAppsGetConfigurationSnapshotSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsGetContainerLogsZipOptions contains the optional parameters for the WebApps.GetContainerLogsZip method. +type WebAppsGetContainerLogsZipOptions struct { + // placeholder for future optional parameters +} + +// WebAppsGetContainerLogsZipSlotOptions contains the optional parameters for the WebApps.GetContainerLogsZipSlot method. +type WebAppsGetContainerLogsZipSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsGetContinuousWebJobOptions contains the optional parameters for the WebApps.GetContinuousWebJob method. +type WebAppsGetContinuousWebJobOptions struct { + // placeholder for future optional parameters +} + +// WebAppsGetContinuousWebJobSlotOptions contains the optional parameters for the WebApps.GetContinuousWebJobSlot method. +type WebAppsGetContinuousWebJobSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsGetDeploymentOptions contains the optional parameters for the WebApps.GetDeployment method. +type WebAppsGetDeploymentOptions struct { + // placeholder for future optional parameters +} + +// WebAppsGetDeploymentSlotOptions contains the optional parameters for the WebApps.GetDeploymentSlot method. +type WebAppsGetDeploymentSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsGetDiagnosticLogsConfigurationOptions contains the optional parameters for the WebApps.GetDiagnosticLogsConfiguration method. +type WebAppsGetDiagnosticLogsConfigurationOptions struct { + // placeholder for future optional parameters +} + +// WebAppsGetDiagnosticLogsConfigurationSlotOptions contains the optional parameters for the WebApps.GetDiagnosticLogsConfigurationSlot method. +type WebAppsGetDiagnosticLogsConfigurationSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsGetDomainOwnershipIdentifierOptions contains the optional parameters for the WebApps.GetDomainOwnershipIdentifier method. +type WebAppsGetDomainOwnershipIdentifierOptions struct { + // placeholder for future optional parameters +} + +// WebAppsGetDomainOwnershipIdentifierSlotOptions contains the optional parameters for the WebApps.GetDomainOwnershipIdentifierSlot method. +type WebAppsGetDomainOwnershipIdentifierSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsGetFtpAllowedOptions contains the optional parameters for the WebApps.GetFtpAllowed method. +type WebAppsGetFtpAllowedOptions struct { + // placeholder for future optional parameters +} + +// WebAppsGetFtpAllowedSlotOptions contains the optional parameters for the WebApps.GetFtpAllowedSlot method. +type WebAppsGetFtpAllowedSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsGetFunctionOptions contains the optional parameters for the WebApps.GetFunction method. +type WebAppsGetFunctionOptions struct { + // placeholder for future optional parameters +} + +// WebAppsGetFunctionsAdminTokenOptions contains the optional parameters for the WebApps.GetFunctionsAdminToken method. +type WebAppsGetFunctionsAdminTokenOptions struct { + // placeholder for future optional parameters +} + +// WebAppsGetFunctionsAdminTokenSlotOptions contains the optional parameters for the WebApps.GetFunctionsAdminTokenSlot method. +type WebAppsGetFunctionsAdminTokenSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsGetHostNameBindingOptions contains the optional parameters for the WebApps.GetHostNameBinding method. +type WebAppsGetHostNameBindingOptions struct { + // placeholder for future optional parameters +} + +// WebAppsGetHostNameBindingSlotOptions contains the optional parameters for the WebApps.GetHostNameBindingSlot method. +type WebAppsGetHostNameBindingSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsGetHybridConnectionOptions contains the optional parameters for the WebApps.GetHybridConnection method. +type WebAppsGetHybridConnectionOptions struct { + // placeholder for future optional parameters +} + +// WebAppsGetHybridConnectionSlotOptions contains the optional parameters for the WebApps.GetHybridConnectionSlot method. +type WebAppsGetHybridConnectionSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsGetInstanceFunctionSlotOptions contains the optional parameters for the WebApps.GetInstanceFunctionSlot method. +type WebAppsGetInstanceFunctionSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsGetInstanceInfoOptions contains the optional parameters for the WebApps.GetInstanceInfo method. +type WebAppsGetInstanceInfoOptions struct { + // placeholder for future optional parameters +} + +// WebAppsGetInstanceInfoSlotOptions contains the optional parameters for the WebApps.GetInstanceInfoSlot method. +type WebAppsGetInstanceInfoSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsGetInstanceMSDeployLogOptions contains the optional parameters for the WebApps.GetInstanceMSDeployLog method. +type WebAppsGetInstanceMSDeployLogOptions struct { + // placeholder for future optional parameters +} + +// WebAppsGetInstanceMSDeployLogSlotOptions contains the optional parameters for the WebApps.GetInstanceMSDeployLogSlot method. +type WebAppsGetInstanceMSDeployLogSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsGetInstanceMsDeployStatusOptions contains the optional parameters for the WebApps.GetInstanceMsDeployStatus method. +type WebAppsGetInstanceMsDeployStatusOptions struct { + // placeholder for future optional parameters +} + +// WebAppsGetInstanceMsDeployStatusSlotOptions contains the optional parameters for the WebApps.GetInstanceMsDeployStatusSlot method. +type WebAppsGetInstanceMsDeployStatusSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsGetInstanceProcessDumpOptions contains the optional parameters for the WebApps.GetInstanceProcessDump method. +type WebAppsGetInstanceProcessDumpOptions struct { + // placeholder for future optional parameters +} + +// WebAppsGetInstanceProcessDumpSlotOptions contains the optional parameters for the WebApps.GetInstanceProcessDumpSlot method. +type WebAppsGetInstanceProcessDumpSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsGetInstanceProcessModuleOptions contains the optional parameters for the WebApps.GetInstanceProcessModule method. +type WebAppsGetInstanceProcessModuleOptions struct { + // placeholder for future optional parameters +} + +// WebAppsGetInstanceProcessModuleSlotOptions contains the optional parameters for the WebApps.GetInstanceProcessModuleSlot method. +type WebAppsGetInstanceProcessModuleSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsGetInstanceProcessOptions contains the optional parameters for the WebApps.GetInstanceProcess method. +type WebAppsGetInstanceProcessOptions struct { + // placeholder for future optional parameters +} + +// WebAppsGetInstanceProcessSlotOptions contains the optional parameters for the WebApps.GetInstanceProcessSlot method. +type WebAppsGetInstanceProcessSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsGetMSDeployLogOptions contains the optional parameters for the WebApps.GetMSDeployLog method. +type WebAppsGetMSDeployLogOptions struct { + // placeholder for future optional parameters +} + +// WebAppsGetMSDeployLogSlotOptions contains the optional parameters for the WebApps.GetMSDeployLogSlot method. +type WebAppsGetMSDeployLogSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsGetMSDeployStatusOptions contains the optional parameters for the WebApps.GetMSDeployStatus method. +type WebAppsGetMSDeployStatusOptions struct { + // placeholder for future optional parameters +} + +// WebAppsGetMSDeployStatusSlotOptions contains the optional parameters for the WebApps.GetMSDeployStatusSlot method. +type WebAppsGetMSDeployStatusSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsGetMigrateMySQLStatusOptions contains the optional parameters for the WebApps.GetMigrateMySQLStatus method. +type WebAppsGetMigrateMySQLStatusOptions struct { + // placeholder for future optional parameters +} + +// WebAppsGetMigrateMySQLStatusSlotOptions contains the optional parameters for the WebApps.GetMigrateMySQLStatusSlot method. +type WebAppsGetMigrateMySQLStatusSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsGetNetworkTraceOperationOptions contains the optional parameters for the WebApps.GetNetworkTraceOperation method. +type WebAppsGetNetworkTraceOperationOptions struct { + // placeholder for future optional parameters +} + +// WebAppsGetNetworkTraceOperationSlotOptions contains the optional parameters for the WebApps.GetNetworkTraceOperationSlot method. +type WebAppsGetNetworkTraceOperationSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsGetNetworkTraceOperationSlotV2Options contains the optional parameters for the WebApps.GetNetworkTraceOperationSlotV2 method. +type WebAppsGetNetworkTraceOperationSlotV2Options struct { + // placeholder for future optional parameters +} + +// WebAppsGetNetworkTraceOperationV2Options contains the optional parameters for the WebApps.GetNetworkTraceOperationV2 method. +type WebAppsGetNetworkTraceOperationV2Options struct { + // placeholder for future optional parameters +} + +// WebAppsGetNetworkTracesOptions contains the optional parameters for the WebApps.GetNetworkTraces method. +type WebAppsGetNetworkTracesOptions struct { + // placeholder for future optional parameters +} + +// WebAppsGetNetworkTracesSlotOptions contains the optional parameters for the WebApps.GetNetworkTracesSlot method. +type WebAppsGetNetworkTracesSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsGetNetworkTracesSlotV2Options contains the optional parameters for the WebApps.GetNetworkTracesSlotV2 method. +type WebAppsGetNetworkTracesSlotV2Options struct { + // placeholder for future optional parameters +} + +// WebAppsGetNetworkTracesV2Options contains the optional parameters for the WebApps.GetNetworkTracesV2 method. +type WebAppsGetNetworkTracesV2Options struct { + // placeholder for future optional parameters +} + +// WebAppsGetOptions contains the optional parameters for the WebApps.Get method. +type WebAppsGetOptions struct { + // placeholder for future optional parameters +} + +// WebAppsGetPremierAddOnOptions contains the optional parameters for the WebApps.GetPremierAddOn method. +type WebAppsGetPremierAddOnOptions struct { + // placeholder for future optional parameters +} + +// WebAppsGetPremierAddOnSlotOptions contains the optional parameters for the WebApps.GetPremierAddOnSlot method. +type WebAppsGetPremierAddOnSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsGetPrivateAccessOptions contains the optional parameters for the WebApps.GetPrivateAccess method. +type WebAppsGetPrivateAccessOptions struct { + // placeholder for future optional parameters +} + +// WebAppsGetPrivateAccessSlotOptions contains the optional parameters for the WebApps.GetPrivateAccessSlot method. +type WebAppsGetPrivateAccessSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsGetPrivateEndpointConnectionListOptions contains the optional parameters for the WebApps.GetPrivateEndpointConnectionList method. +type WebAppsGetPrivateEndpointConnectionListOptions struct { + // placeholder for future optional parameters +} + +// WebAppsGetPrivateEndpointConnectionListSlotOptions contains the optional parameters for the WebApps.GetPrivateEndpointConnectionListSlot method. +type WebAppsGetPrivateEndpointConnectionListSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsGetPrivateEndpointConnectionOptions contains the optional parameters for the WebApps.GetPrivateEndpointConnection method. +type WebAppsGetPrivateEndpointConnectionOptions struct { + // placeholder for future optional parameters +} + +// WebAppsGetPrivateEndpointConnectionSlotOptions contains the optional parameters for the WebApps.GetPrivateEndpointConnectionSlot method. +type WebAppsGetPrivateEndpointConnectionSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsGetPrivateLinkResourcesOptions contains the optional parameters for the WebApps.GetPrivateLinkResources method. +type WebAppsGetPrivateLinkResourcesOptions struct { + // placeholder for future optional parameters +} + +// WebAppsGetPrivateLinkResourcesSlotOptions contains the optional parameters for the WebApps.GetPrivateLinkResourcesSlot method. +type WebAppsGetPrivateLinkResourcesSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsGetProcessDumpOptions contains the optional parameters for the WebApps.GetProcessDump method. +type WebAppsGetProcessDumpOptions struct { + // placeholder for future optional parameters +} + +// WebAppsGetProcessDumpSlotOptions contains the optional parameters for the WebApps.GetProcessDumpSlot method. +type WebAppsGetProcessDumpSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsGetProcessModuleOptions contains the optional parameters for the WebApps.GetProcessModule method. +type WebAppsGetProcessModuleOptions struct { + // placeholder for future optional parameters +} + +// WebAppsGetProcessModuleSlotOptions contains the optional parameters for the WebApps.GetProcessModuleSlot method. +type WebAppsGetProcessModuleSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsGetProcessOptions contains the optional parameters for the WebApps.GetProcess method. +type WebAppsGetProcessOptions struct { + // placeholder for future optional parameters +} + +// WebAppsGetProcessSlotOptions contains the optional parameters for the WebApps.GetProcessSlot method. +type WebAppsGetProcessSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsGetPublicCertificateOptions contains the optional parameters for the WebApps.GetPublicCertificate method. +type WebAppsGetPublicCertificateOptions struct { + // placeholder for future optional parameters +} + +// WebAppsGetPublicCertificateSlotOptions contains the optional parameters for the WebApps.GetPublicCertificateSlot method. +type WebAppsGetPublicCertificateSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsGetRelayServiceConnectionOptions contains the optional parameters for the WebApps.GetRelayServiceConnection method. +type WebAppsGetRelayServiceConnectionOptions struct { + // placeholder for future optional parameters +} + +// WebAppsGetRelayServiceConnectionSlotOptions contains the optional parameters for the WebApps.GetRelayServiceConnectionSlot method. +type WebAppsGetRelayServiceConnectionSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsGetScmAllowedOptions contains the optional parameters for the WebApps.GetScmAllowed method. +type WebAppsGetScmAllowedOptions struct { + // placeholder for future optional parameters +} + +// WebAppsGetScmAllowedSlotOptions contains the optional parameters for the WebApps.GetScmAllowedSlot method. +type WebAppsGetScmAllowedSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsGetSiteConnectionStringKeyVaultReferenceOptions contains the optional parameters for the WebApps.GetSiteConnectionStringKeyVaultReference method. +type WebAppsGetSiteConnectionStringKeyVaultReferenceOptions struct { + // placeholder for future optional parameters +} + +// WebAppsGetSiteConnectionStringKeyVaultReferenceSlotOptions contains the optional parameters for the WebApps.GetSiteConnectionStringKeyVaultReferenceSlot +// method. +type WebAppsGetSiteConnectionStringKeyVaultReferenceSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsGetSiteConnectionStringKeyVaultReferencesOptions contains the optional parameters for the WebApps.GetSiteConnectionStringKeyVaultReferences method. +type WebAppsGetSiteConnectionStringKeyVaultReferencesOptions struct { + // placeholder for future optional parameters +} + +// WebAppsGetSiteConnectionStringKeyVaultReferencesSlotOptions contains the optional parameters for the WebApps.GetSiteConnectionStringKeyVaultReferencesSlot +// method. +type WebAppsGetSiteConnectionStringKeyVaultReferencesSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsGetSiteExtensionOptions contains the optional parameters for the WebApps.GetSiteExtension method. +type WebAppsGetSiteExtensionOptions struct { + // placeholder for future optional parameters +} + +// WebAppsGetSiteExtensionSlotOptions contains the optional parameters for the WebApps.GetSiteExtensionSlot method. +type WebAppsGetSiteExtensionSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsGetSitePhpErrorLogFlagOptions contains the optional parameters for the WebApps.GetSitePhpErrorLogFlag method. +type WebAppsGetSitePhpErrorLogFlagOptions struct { + // placeholder for future optional parameters +} + +// WebAppsGetSitePhpErrorLogFlagSlotOptions contains the optional parameters for the WebApps.GetSitePhpErrorLogFlagSlot method. +type WebAppsGetSitePhpErrorLogFlagSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsGetSlotOptions contains the optional parameters for the WebApps.GetSlot method. +type WebAppsGetSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsGetSourceControlOptions contains the optional parameters for the WebApps.GetSourceControl method. +type WebAppsGetSourceControlOptions struct { + // placeholder for future optional parameters +} + +// WebAppsGetSourceControlSlotOptions contains the optional parameters for the WebApps.GetSourceControlSlot method. +type WebAppsGetSourceControlSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsGetSwiftVirtualNetworkConnectionOptions contains the optional parameters for the WebApps.GetSwiftVirtualNetworkConnection method. +type WebAppsGetSwiftVirtualNetworkConnectionOptions struct { + // placeholder for future optional parameters +} + +// WebAppsGetSwiftVirtualNetworkConnectionSlotOptions contains the optional parameters for the WebApps.GetSwiftVirtualNetworkConnectionSlot method. +type WebAppsGetSwiftVirtualNetworkConnectionSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsGetTriggeredWebJobHistoryOptions contains the optional parameters for the WebApps.GetTriggeredWebJobHistory method. +type WebAppsGetTriggeredWebJobHistoryOptions struct { + // placeholder for future optional parameters +} + +// WebAppsGetTriggeredWebJobHistorySlotOptions contains the optional parameters for the WebApps.GetTriggeredWebJobHistorySlot method. +type WebAppsGetTriggeredWebJobHistorySlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsGetTriggeredWebJobOptions contains the optional parameters for the WebApps.GetTriggeredWebJob method. +type WebAppsGetTriggeredWebJobOptions struct { + // placeholder for future optional parameters +} + +// WebAppsGetTriggeredWebJobSlotOptions contains the optional parameters for the WebApps.GetTriggeredWebJobSlot method. +type WebAppsGetTriggeredWebJobSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsGetVnetConnectionGatewayOptions contains the optional parameters for the WebApps.GetVnetConnectionGateway method. +type WebAppsGetVnetConnectionGatewayOptions struct { + // placeholder for future optional parameters +} + +// WebAppsGetVnetConnectionGatewaySlotOptions contains the optional parameters for the WebApps.GetVnetConnectionGatewaySlot method. +type WebAppsGetVnetConnectionGatewaySlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsGetVnetConnectionOptions contains the optional parameters for the WebApps.GetVnetConnection method. +type WebAppsGetVnetConnectionOptions struct { + // placeholder for future optional parameters +} + +// WebAppsGetVnetConnectionSlotOptions contains the optional parameters for the WebApps.GetVnetConnectionSlot method. +type WebAppsGetVnetConnectionSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsGetWebJobOptions contains the optional parameters for the WebApps.GetWebJob method. +type WebAppsGetWebJobOptions struct { + // placeholder for future optional parameters +} + +// WebAppsGetWebJobSlotOptions contains the optional parameters for the WebApps.GetWebJobSlot method. +type WebAppsGetWebJobSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsGetWebSiteContainerLogsOptions contains the optional parameters for the WebApps.GetWebSiteContainerLogs method. +type WebAppsGetWebSiteContainerLogsOptions struct { + // placeholder for future optional parameters +} + +// WebAppsGetWebSiteContainerLogsSlotOptions contains the optional parameters for the WebApps.GetWebSiteContainerLogsSlot method. +type WebAppsGetWebSiteContainerLogsSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsIsCloneableOptions contains the optional parameters for the WebApps.IsCloneable method. +type WebAppsIsCloneableOptions struct { + // placeholder for future optional parameters +} + +// WebAppsIsCloneableSlotOptions contains the optional parameters for the WebApps.IsCloneableSlot method. +type WebAppsIsCloneableSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsListApplicationSettingsOptions contains the optional parameters for the WebApps.ListApplicationSettings method. +type WebAppsListApplicationSettingsOptions struct { + // placeholder for future optional parameters +} + +// WebAppsListApplicationSettingsSlotOptions contains the optional parameters for the WebApps.ListApplicationSettingsSlot method. +type WebAppsListApplicationSettingsSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsListAzureStorageAccountsOptions contains the optional parameters for the WebApps.ListAzureStorageAccounts method. +type WebAppsListAzureStorageAccountsOptions struct { + // placeholder for future optional parameters +} + +// WebAppsListAzureStorageAccountsSlotOptions contains the optional parameters for the WebApps.ListAzureStorageAccountsSlot method. +type WebAppsListAzureStorageAccountsSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsListBackupStatusSecretsOptions contains the optional parameters for the WebApps.ListBackupStatusSecrets method. +type WebAppsListBackupStatusSecretsOptions struct { + // placeholder for future optional parameters +} + +// WebAppsListBackupStatusSecretsSlotOptions contains the optional parameters for the WebApps.ListBackupStatusSecretsSlot method. +type WebAppsListBackupStatusSecretsSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsListBackupsOptions contains the optional parameters for the WebApps.ListBackups method. +type WebAppsListBackupsOptions struct { + // placeholder for future optional parameters +} + +// WebAppsListBackupsSlotOptions contains the optional parameters for the WebApps.ListBackupsSlot method. +type WebAppsListBackupsSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsListBasicPublishingCredentialsPoliciesOptions contains the optional parameters for the WebApps.ListBasicPublishingCredentialsPolicies method. +type WebAppsListBasicPublishingCredentialsPoliciesOptions struct { + // placeholder for future optional parameters +} + +// WebAppsListBasicPublishingCredentialsPoliciesSlotOptions contains the optional parameters for the WebApps.ListBasicPublishingCredentialsPoliciesSlot +// method. +type WebAppsListBasicPublishingCredentialsPoliciesSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsListByResourceGroupOptions contains the optional parameters for the WebApps.ListByResourceGroup method. +type WebAppsListByResourceGroupOptions struct { + // Specify true to include deployment slots in results. The default is false, which only gives you the production slot of all apps. + IncludeSlots *bool +} + +// WebAppsListConfigurationSnapshotInfoOptions contains the optional parameters for the WebApps.ListConfigurationSnapshotInfo method. +type WebAppsListConfigurationSnapshotInfoOptions struct { + // placeholder for future optional parameters +} + +// WebAppsListConfigurationSnapshotInfoSlotOptions contains the optional parameters for the WebApps.ListConfigurationSnapshotInfoSlot method. +type WebAppsListConfigurationSnapshotInfoSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsListConfigurationsOptions contains the optional parameters for the WebApps.ListConfigurations method. +type WebAppsListConfigurationsOptions struct { + // placeholder for future optional parameters +} + +// WebAppsListConfigurationsSlotOptions contains the optional parameters for the WebApps.ListConfigurationsSlot method. +type WebAppsListConfigurationsSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsListConnectionStringsOptions contains the optional parameters for the WebApps.ListConnectionStrings method. +type WebAppsListConnectionStringsOptions struct { + // placeholder for future optional parameters +} + +// WebAppsListConnectionStringsSlotOptions contains the optional parameters for the WebApps.ListConnectionStringsSlot method. +type WebAppsListConnectionStringsSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsListContinuousWebJobsOptions contains the optional parameters for the WebApps.ListContinuousWebJobs method. +type WebAppsListContinuousWebJobsOptions struct { + // placeholder for future optional parameters +} + +// WebAppsListContinuousWebJobsSlotOptions contains the optional parameters for the WebApps.ListContinuousWebJobsSlot method. +type WebAppsListContinuousWebJobsSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsListDeploymentLogOptions contains the optional parameters for the WebApps.ListDeploymentLog method. +type WebAppsListDeploymentLogOptions struct { + // placeholder for future optional parameters +} + +// WebAppsListDeploymentLogSlotOptions contains the optional parameters for the WebApps.ListDeploymentLogSlot method. +type WebAppsListDeploymentLogSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsListDeploymentsOptions contains the optional parameters for the WebApps.ListDeployments method. +type WebAppsListDeploymentsOptions struct { + // placeholder for future optional parameters +} + +// WebAppsListDeploymentsSlotOptions contains the optional parameters for the WebApps.ListDeploymentsSlot method. +type WebAppsListDeploymentsSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsListDomainOwnershipIdentifiersOptions contains the optional parameters for the WebApps.ListDomainOwnershipIdentifiers method. +type WebAppsListDomainOwnershipIdentifiersOptions struct { + // placeholder for future optional parameters +} + +// WebAppsListDomainOwnershipIdentifiersSlotOptions contains the optional parameters for the WebApps.ListDomainOwnershipIdentifiersSlot method. +type WebAppsListDomainOwnershipIdentifiersSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsListFunctionKeysOptions contains the optional parameters for the WebApps.ListFunctionKeys method. +type WebAppsListFunctionKeysOptions struct { + // placeholder for future optional parameters +} + +// WebAppsListFunctionKeysSlotOptions contains the optional parameters for the WebApps.ListFunctionKeysSlot method. +type WebAppsListFunctionKeysSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsListFunctionSecretsOptions contains the optional parameters for the WebApps.ListFunctionSecrets method. +type WebAppsListFunctionSecretsOptions struct { + // placeholder for future optional parameters +} + +// WebAppsListFunctionSecretsSlotOptions contains the optional parameters for the WebApps.ListFunctionSecretsSlot method. +type WebAppsListFunctionSecretsSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsListFunctionsOptions contains the optional parameters for the WebApps.ListFunctions method. +type WebAppsListFunctionsOptions struct { + // placeholder for future optional parameters +} + +// WebAppsListHostKeysOptions contains the optional parameters for the WebApps.ListHostKeys method. +type WebAppsListHostKeysOptions struct { + // placeholder for future optional parameters +} + +// WebAppsListHostKeysSlotOptions contains the optional parameters for the WebApps.ListHostKeysSlot method. +type WebAppsListHostKeysSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsListHostNameBindingsOptions contains the optional parameters for the WebApps.ListHostNameBindings method. +type WebAppsListHostNameBindingsOptions struct { + // placeholder for future optional parameters +} + +// WebAppsListHostNameBindingsSlotOptions contains the optional parameters for the WebApps.ListHostNameBindingsSlot method. +type WebAppsListHostNameBindingsSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsListHybridConnectionsOptions contains the optional parameters for the WebApps.ListHybridConnections method. +type WebAppsListHybridConnectionsOptions struct { + // placeholder for future optional parameters +} + +// WebAppsListHybridConnectionsSlotOptions contains the optional parameters for the WebApps.ListHybridConnectionsSlot method. +type WebAppsListHybridConnectionsSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsListInstanceFunctionsSlotOptions contains the optional parameters for the WebApps.ListInstanceFunctionsSlot method. +type WebAppsListInstanceFunctionsSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsListInstanceIdentifiersOptions contains the optional parameters for the WebApps.ListInstanceIdentifiers method. +type WebAppsListInstanceIdentifiersOptions struct { + // placeholder for future optional parameters +} + +// WebAppsListInstanceIdentifiersSlotOptions contains the optional parameters for the WebApps.ListInstanceIdentifiersSlot method. +type WebAppsListInstanceIdentifiersSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsListInstanceProcessModulesOptions contains the optional parameters for the WebApps.ListInstanceProcessModules method. +type WebAppsListInstanceProcessModulesOptions struct { + // placeholder for future optional parameters +} + +// WebAppsListInstanceProcessModulesSlotOptions contains the optional parameters for the WebApps.ListInstanceProcessModulesSlot method. +type WebAppsListInstanceProcessModulesSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsListInstanceProcessThreadsOptions contains the optional parameters for the WebApps.ListInstanceProcessThreads method. +type WebAppsListInstanceProcessThreadsOptions struct { + // placeholder for future optional parameters +} + +// WebAppsListInstanceProcessThreadsSlotOptions contains the optional parameters for the WebApps.ListInstanceProcessThreadsSlot method. +type WebAppsListInstanceProcessThreadsSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsListInstanceProcessesOptions contains the optional parameters for the WebApps.ListInstanceProcesses method. +type WebAppsListInstanceProcessesOptions struct { + // placeholder for future optional parameters +} + +// WebAppsListInstanceProcessesSlotOptions contains the optional parameters for the WebApps.ListInstanceProcessesSlot method. +type WebAppsListInstanceProcessesSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsListMetadataOptions contains the optional parameters for the WebApps.ListMetadata method. +type WebAppsListMetadataOptions struct { + // placeholder for future optional parameters +} + +// WebAppsListMetadataSlotOptions contains the optional parameters for the WebApps.ListMetadataSlot method. +type WebAppsListMetadataSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsListNetworkFeaturesOptions contains the optional parameters for the WebApps.ListNetworkFeatures method. +type WebAppsListNetworkFeaturesOptions struct { + // placeholder for future optional parameters +} + +// WebAppsListNetworkFeaturesSlotOptions contains the optional parameters for the WebApps.ListNetworkFeaturesSlot method. +type WebAppsListNetworkFeaturesSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsListOptions contains the optional parameters for the WebApps.List method. +type WebAppsListOptions struct { + // placeholder for future optional parameters +} + +// WebAppsListPerfMonCountersOptions contains the optional parameters for the WebApps.ListPerfMonCounters method. +type WebAppsListPerfMonCountersOptions struct { + // Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: $filter=(startTime eq 2014-01-01T00:00:00Z and endTime + // eq 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. + Filter *string +} + +// WebAppsListPerfMonCountersSlotOptions contains the optional parameters for the WebApps.ListPerfMonCountersSlot method. +type WebAppsListPerfMonCountersSlotOptions struct { + // Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: $filter=(startTime eq 2014-01-01T00:00:00Z and endTime + // eq 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. + Filter *string +} + +// WebAppsListPremierAddOnsOptions contains the optional parameters for the WebApps.ListPremierAddOns method. +type WebAppsListPremierAddOnsOptions struct { + // placeholder for future optional parameters +} + +// WebAppsListPremierAddOnsSlotOptions contains the optional parameters for the WebApps.ListPremierAddOnsSlot method. +type WebAppsListPremierAddOnsSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsListProcessModulesOptions contains the optional parameters for the WebApps.ListProcessModules method. +type WebAppsListProcessModulesOptions struct { + // placeholder for future optional parameters +} + +// WebAppsListProcessModulesSlotOptions contains the optional parameters for the WebApps.ListProcessModulesSlot method. +type WebAppsListProcessModulesSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsListProcessThreadsOptions contains the optional parameters for the WebApps.ListProcessThreads method. +type WebAppsListProcessThreadsOptions struct { + // placeholder for future optional parameters +} + +// WebAppsListProcessThreadsSlotOptions contains the optional parameters for the WebApps.ListProcessThreadsSlot method. +type WebAppsListProcessThreadsSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsListProcessesOptions contains the optional parameters for the WebApps.ListProcesses method. +type WebAppsListProcessesOptions struct { + // placeholder for future optional parameters +} + +// WebAppsListProcessesSlotOptions contains the optional parameters for the WebApps.ListProcessesSlot method. +type WebAppsListProcessesSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsListPublicCertificatesOptions contains the optional parameters for the WebApps.ListPublicCertificates method. +type WebAppsListPublicCertificatesOptions struct { + // placeholder for future optional parameters +} + +// WebAppsListPublicCertificatesSlotOptions contains the optional parameters for the WebApps.ListPublicCertificatesSlot method. +type WebAppsListPublicCertificatesSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsListPublishingProfileXMLWithSecretsOptions contains the optional parameters for the WebApps.ListPublishingProfileXMLWithSecrets method. +type WebAppsListPublishingProfileXMLWithSecretsOptions struct { + // placeholder for future optional parameters +} + +// WebAppsListPublishingProfileXMLWithSecretsSlotOptions contains the optional parameters for the WebApps.ListPublishingProfileXMLWithSecretsSlot method. +type WebAppsListPublishingProfileXMLWithSecretsSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsListRelayServiceConnectionsOptions contains the optional parameters for the WebApps.ListRelayServiceConnections method. +type WebAppsListRelayServiceConnectionsOptions struct { + // placeholder for future optional parameters +} + +// WebAppsListRelayServiceConnectionsSlotOptions contains the optional parameters for the WebApps.ListRelayServiceConnectionsSlot method. +type WebAppsListRelayServiceConnectionsSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsListSiteBackupsOptions contains the optional parameters for the WebApps.ListSiteBackups method. +type WebAppsListSiteBackupsOptions struct { + // placeholder for future optional parameters +} + +// WebAppsListSiteBackupsSlotOptions contains the optional parameters for the WebApps.ListSiteBackupsSlot method. +type WebAppsListSiteBackupsSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsListSiteExtensionsOptions contains the optional parameters for the WebApps.ListSiteExtensions method. +type WebAppsListSiteExtensionsOptions struct { + // placeholder for future optional parameters +} + +// WebAppsListSiteExtensionsSlotOptions contains the optional parameters for the WebApps.ListSiteExtensionsSlot method. +type WebAppsListSiteExtensionsSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsListSitePushSettingsOptions contains the optional parameters for the WebApps.ListSitePushSettings method. +type WebAppsListSitePushSettingsOptions struct { + // placeholder for future optional parameters +} + +// WebAppsListSitePushSettingsSlotOptions contains the optional parameters for the WebApps.ListSitePushSettingsSlot method. +type WebAppsListSitePushSettingsSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsListSlotConfigurationNamesOptions contains the optional parameters for the WebApps.ListSlotConfigurationNames method. +type WebAppsListSlotConfigurationNamesOptions struct { + // placeholder for future optional parameters +} + +// WebAppsListSlotDifferencesFromProductionOptions contains the optional parameters for the WebApps.ListSlotDifferencesFromProduction method. +type WebAppsListSlotDifferencesFromProductionOptions struct { + // placeholder for future optional parameters +} + +// WebAppsListSlotDifferencesSlotOptions contains the optional parameters for the WebApps.ListSlotDifferencesSlot method. +type WebAppsListSlotDifferencesSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsListSlotsOptions contains the optional parameters for the WebApps.ListSlots method. +type WebAppsListSlotsOptions struct { + // placeholder for future optional parameters +} + +// WebAppsListSnapshotsFromDRSecondaryOptions contains the optional parameters for the WebApps.ListSnapshotsFromDRSecondary method. +type WebAppsListSnapshotsFromDRSecondaryOptions struct { + // placeholder for future optional parameters +} + +// WebAppsListSnapshotsFromDRSecondarySlotOptions contains the optional parameters for the WebApps.ListSnapshotsFromDRSecondarySlot method. +type WebAppsListSnapshotsFromDRSecondarySlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsListSnapshotsOptions contains the optional parameters for the WebApps.ListSnapshots method. +type WebAppsListSnapshotsOptions struct { + // placeholder for future optional parameters +} + +// WebAppsListSnapshotsSlotOptions contains the optional parameters for the WebApps.ListSnapshotsSlot method. +type WebAppsListSnapshotsSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsListSyncFunctionTriggersOptions contains the optional parameters for the WebApps.ListSyncFunctionTriggers method. +type WebAppsListSyncFunctionTriggersOptions struct { + // placeholder for future optional parameters +} + +// WebAppsListSyncFunctionTriggersSlotOptions contains the optional parameters for the WebApps.ListSyncFunctionTriggersSlot method. +type WebAppsListSyncFunctionTriggersSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsListSyncStatusOptions contains the optional parameters for the WebApps.ListSyncStatus method. +type WebAppsListSyncStatusOptions struct { + // placeholder for future optional parameters +} + +// WebAppsListSyncStatusSlotOptions contains the optional parameters for the WebApps.ListSyncStatusSlot method. +type WebAppsListSyncStatusSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsListTriggeredWebJobHistoryOptions contains the optional parameters for the WebApps.ListTriggeredWebJobHistory method. +type WebAppsListTriggeredWebJobHistoryOptions struct { + // placeholder for future optional parameters +} + +// WebAppsListTriggeredWebJobHistorySlotOptions contains the optional parameters for the WebApps.ListTriggeredWebJobHistorySlot method. +type WebAppsListTriggeredWebJobHistorySlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsListTriggeredWebJobsOptions contains the optional parameters for the WebApps.ListTriggeredWebJobs method. +type WebAppsListTriggeredWebJobsOptions struct { + // placeholder for future optional parameters +} + +// WebAppsListTriggeredWebJobsSlotOptions contains the optional parameters for the WebApps.ListTriggeredWebJobsSlot method. +type WebAppsListTriggeredWebJobsSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsListUsagesOptions contains the optional parameters for the WebApps.ListUsages method. +type WebAppsListUsagesOptions struct { + // Return only information specified in the filter (using OData syntax). For example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime + // eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. + Filter *string +} + +// WebAppsListUsagesSlotOptions contains the optional parameters for the WebApps.ListUsagesSlot method. +type WebAppsListUsagesSlotOptions struct { + // Return only information specified in the filter (using OData syntax). For example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime + // eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. + Filter *string +} + +// WebAppsListVnetConnectionsOptions contains the optional parameters for the WebApps.ListVnetConnections method. +type WebAppsListVnetConnectionsOptions struct { + // placeholder for future optional parameters +} + +// WebAppsListVnetConnectionsSlotOptions contains the optional parameters for the WebApps.ListVnetConnectionsSlot method. +type WebAppsListVnetConnectionsSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsListWebJobsOptions contains the optional parameters for the WebApps.ListWebJobs method. +type WebAppsListWebJobsOptions struct { + // placeholder for future optional parameters +} + +// WebAppsListWebJobsSlotOptions contains the optional parameters for the WebApps.ListWebJobsSlot method. +type WebAppsListWebJobsSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsPutPrivateAccessVnetOptions contains the optional parameters for the WebApps.PutPrivateAccessVnet method. +type WebAppsPutPrivateAccessVnetOptions struct { + // placeholder for future optional parameters +} + +// WebAppsPutPrivateAccessVnetSlotOptions contains the optional parameters for the WebApps.PutPrivateAccessVnetSlot method. +type WebAppsPutPrivateAccessVnetSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsRecoverSiteConfigurationSnapshotOptions contains the optional parameters for the WebApps.RecoverSiteConfigurationSnapshot method. +type WebAppsRecoverSiteConfigurationSnapshotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsRecoverSiteConfigurationSnapshotSlotOptions contains the optional parameters for the WebApps.RecoverSiteConfigurationSnapshotSlot method. +type WebAppsRecoverSiteConfigurationSnapshotSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsResetProductionSlotConfigOptions contains the optional parameters for the WebApps.ResetProductionSlotConfig method. +type WebAppsResetProductionSlotConfigOptions struct { + // placeholder for future optional parameters +} + +// WebAppsResetSlotConfigurationSlotOptions contains the optional parameters for the WebApps.ResetSlotConfigurationSlot method. +type WebAppsResetSlotConfigurationSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsRestartOptions contains the optional parameters for the WebApps.Restart method. +type WebAppsRestartOptions struct { + // Specify true to apply the configuration settings and restarts the app only if necessary. By default, the API always restarts and reprovisions the app. + SoftRestart *bool + // Specify true to block until the app is restarted. By default, it is set to false, and the API responds immediately (asynchronous). + Synchronous *bool +} + +// WebAppsRestartSlotOptions contains the optional parameters for the WebApps.RestartSlot method. +type WebAppsRestartSlotOptions struct { + // Specify true to apply the configuration settings and restarts the app only if necessary. By default, the API always restarts and reprovisions the app. + SoftRestart *bool + // Specify true to block until the app is restarted. By default, it is set to false, and the API responds immediately (asynchronous). + Synchronous *bool +} + +// WebAppsRunTriggeredWebJobOptions contains the optional parameters for the WebApps.RunTriggeredWebJob method. +type WebAppsRunTriggeredWebJobOptions struct { + // placeholder for future optional parameters +} + +// WebAppsRunTriggeredWebJobSlotOptions contains the optional parameters for the WebApps.RunTriggeredWebJobSlot method. +type WebAppsRunTriggeredWebJobSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsStartContinuousWebJobOptions contains the optional parameters for the WebApps.StartContinuousWebJob method. +type WebAppsStartContinuousWebJobOptions struct { + // placeholder for future optional parameters +} + +// WebAppsStartContinuousWebJobSlotOptions contains the optional parameters for the WebApps.StartContinuousWebJobSlot method. +type WebAppsStartContinuousWebJobSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsStartOptions contains the optional parameters for the WebApps.Start method. +type WebAppsStartOptions struct { + // placeholder for future optional parameters +} + +// WebAppsStartSlotOptions contains the optional parameters for the WebApps.StartSlot method. +type WebAppsStartSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsStartWebSiteNetworkTraceOptions contains the optional parameters for the WebApps.StartWebSiteNetworkTrace method. +type WebAppsStartWebSiteNetworkTraceOptions struct { + // The duration to keep capturing in seconds. + DurationInSeconds *int32 + // The maximum frame length in bytes (Optional). + MaxFrameLength *int32 + // The Blob URL to store capture file. + SasURL *string +} + +// WebAppsStartWebSiteNetworkTraceSlotOptions contains the optional parameters for the WebApps.StartWebSiteNetworkTraceSlot method. +type WebAppsStartWebSiteNetworkTraceSlotOptions struct { + // The duration to keep capturing in seconds. + DurationInSeconds *int32 + // The maximum frame length in bytes (Optional). + MaxFrameLength *int32 + // The Blob URL to store capture file. + SasURL *string +} + +// WebAppsStopContinuousWebJobOptions contains the optional parameters for the WebApps.StopContinuousWebJob method. +type WebAppsStopContinuousWebJobOptions struct { + // placeholder for future optional parameters +} + +// WebAppsStopContinuousWebJobSlotOptions contains the optional parameters for the WebApps.StopContinuousWebJobSlot method. +type WebAppsStopContinuousWebJobSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsStopNetworkTraceOptions contains the optional parameters for the WebApps.StopNetworkTrace method. +type WebAppsStopNetworkTraceOptions struct { + // placeholder for future optional parameters +} + +// WebAppsStopNetworkTraceSlotOptions contains the optional parameters for the WebApps.StopNetworkTraceSlot method. +type WebAppsStopNetworkTraceSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsStopOptions contains the optional parameters for the WebApps.Stop method. +type WebAppsStopOptions struct { + // placeholder for future optional parameters +} + +// WebAppsStopSlotOptions contains the optional parameters for the WebApps.StopSlot method. +type WebAppsStopSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsStopWebSiteNetworkTraceOptions contains the optional parameters for the WebApps.StopWebSiteNetworkTrace method. +type WebAppsStopWebSiteNetworkTraceOptions struct { + // placeholder for future optional parameters +} + +// WebAppsStopWebSiteNetworkTraceSlotOptions contains the optional parameters for the WebApps.StopWebSiteNetworkTraceSlot method. +type WebAppsStopWebSiteNetworkTraceSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsSyncFunctionTriggersOptions contains the optional parameters for the WebApps.SyncFunctionTriggers method. +type WebAppsSyncFunctionTriggersOptions struct { + // placeholder for future optional parameters +} + +// WebAppsSyncFunctionTriggersSlotOptions contains the optional parameters for the WebApps.SyncFunctionTriggersSlot method. +type WebAppsSyncFunctionTriggersSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsSyncFunctionsOptions contains the optional parameters for the WebApps.SyncFunctions method. +type WebAppsSyncFunctionsOptions struct { + // placeholder for future optional parameters +} + +// WebAppsSyncFunctionsSlotOptions contains the optional parameters for the WebApps.SyncFunctionsSlot method. +type WebAppsSyncFunctionsSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsSyncRepositoryOptions contains the optional parameters for the WebApps.SyncRepository method. +type WebAppsSyncRepositoryOptions struct { + // placeholder for future optional parameters +} + +// WebAppsSyncRepositorySlotOptions contains the optional parameters for the WebApps.SyncRepositorySlot method. +type WebAppsSyncRepositorySlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsUpdateApplicationSettingsOptions contains the optional parameters for the WebApps.UpdateApplicationSettings method. +type WebAppsUpdateApplicationSettingsOptions struct { + // placeholder for future optional parameters +} + +// WebAppsUpdateApplicationSettingsSlotOptions contains the optional parameters for the WebApps.UpdateApplicationSettingsSlot method. +type WebAppsUpdateApplicationSettingsSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsUpdateAuthSettingsOptions contains the optional parameters for the WebApps.UpdateAuthSettings method. +type WebAppsUpdateAuthSettingsOptions struct { + // placeholder for future optional parameters +} + +// WebAppsUpdateAuthSettingsSlotOptions contains the optional parameters for the WebApps.UpdateAuthSettingsSlot method. +type WebAppsUpdateAuthSettingsSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsUpdateAuthSettingsV2Options contains the optional parameters for the WebApps.UpdateAuthSettingsV2 method. +type WebAppsUpdateAuthSettingsV2Options struct { + // placeholder for future optional parameters +} + +// WebAppsUpdateAuthSettingsV2SlotOptions contains the optional parameters for the WebApps.UpdateAuthSettingsV2Slot method. +type WebAppsUpdateAuthSettingsV2SlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsUpdateAzureStorageAccountsOptions contains the optional parameters for the WebApps.UpdateAzureStorageAccounts method. +type WebAppsUpdateAzureStorageAccountsOptions struct { + // placeholder for future optional parameters +} + +// WebAppsUpdateAzureStorageAccountsSlotOptions contains the optional parameters for the WebApps.UpdateAzureStorageAccountsSlot method. +type WebAppsUpdateAzureStorageAccountsSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsUpdateBackupConfigurationOptions contains the optional parameters for the WebApps.UpdateBackupConfiguration method. +type WebAppsUpdateBackupConfigurationOptions struct { + // placeholder for future optional parameters +} + +// WebAppsUpdateBackupConfigurationSlotOptions contains the optional parameters for the WebApps.UpdateBackupConfigurationSlot method. +type WebAppsUpdateBackupConfigurationSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsUpdateConfigurationOptions contains the optional parameters for the WebApps.UpdateConfiguration method. +type WebAppsUpdateConfigurationOptions struct { + // placeholder for future optional parameters +} + +// WebAppsUpdateConfigurationSlotOptions contains the optional parameters for the WebApps.UpdateConfigurationSlot method. +type WebAppsUpdateConfigurationSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsUpdateConnectionStringsOptions contains the optional parameters for the WebApps.UpdateConnectionStrings method. +type WebAppsUpdateConnectionStringsOptions struct { + // placeholder for future optional parameters +} + +// WebAppsUpdateConnectionStringsSlotOptions contains the optional parameters for the WebApps.UpdateConnectionStringsSlot method. +type WebAppsUpdateConnectionStringsSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsUpdateDiagnosticLogsConfigOptions contains the optional parameters for the WebApps.UpdateDiagnosticLogsConfig method. +type WebAppsUpdateDiagnosticLogsConfigOptions struct { + // placeholder for future optional parameters +} + +// WebAppsUpdateDiagnosticLogsConfigSlotOptions contains the optional parameters for the WebApps.UpdateDiagnosticLogsConfigSlot method. +type WebAppsUpdateDiagnosticLogsConfigSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsUpdateDomainOwnershipIdentifierOptions contains the optional parameters for the WebApps.UpdateDomainOwnershipIdentifier method. +type WebAppsUpdateDomainOwnershipIdentifierOptions struct { + // placeholder for future optional parameters +} + +// WebAppsUpdateDomainOwnershipIdentifierSlotOptions contains the optional parameters for the WebApps.UpdateDomainOwnershipIdentifierSlot method. +type WebAppsUpdateDomainOwnershipIdentifierSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsUpdateFtpAllowedOptions contains the optional parameters for the WebApps.UpdateFtpAllowed method. +type WebAppsUpdateFtpAllowedOptions struct { + // placeholder for future optional parameters +} + +// WebAppsUpdateFtpAllowedSlotOptions contains the optional parameters for the WebApps.UpdateFtpAllowedSlot method. +type WebAppsUpdateFtpAllowedSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsUpdateHybridConnectionOptions contains the optional parameters for the WebApps.UpdateHybridConnection method. +type WebAppsUpdateHybridConnectionOptions struct { + // placeholder for future optional parameters +} + +// WebAppsUpdateHybridConnectionSlotOptions contains the optional parameters for the WebApps.UpdateHybridConnectionSlot method. +type WebAppsUpdateHybridConnectionSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsUpdateMetadataOptions contains the optional parameters for the WebApps.UpdateMetadata method. +type WebAppsUpdateMetadataOptions struct { + // placeholder for future optional parameters +} + +// WebAppsUpdateMetadataSlotOptions contains the optional parameters for the WebApps.UpdateMetadataSlot method. +type WebAppsUpdateMetadataSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsUpdateOptions contains the optional parameters for the WebApps.Update method. +type WebAppsUpdateOptions struct { + // placeholder for future optional parameters +} + +// WebAppsUpdatePremierAddOnOptions contains the optional parameters for the WebApps.UpdatePremierAddOn method. +type WebAppsUpdatePremierAddOnOptions struct { + // placeholder for future optional parameters +} + +// WebAppsUpdatePremierAddOnSlotOptions contains the optional parameters for the WebApps.UpdatePremierAddOnSlot method. +type WebAppsUpdatePremierAddOnSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsUpdateRelayServiceConnectionOptions contains the optional parameters for the WebApps.UpdateRelayServiceConnection method. +type WebAppsUpdateRelayServiceConnectionOptions struct { + // placeholder for future optional parameters +} + +// WebAppsUpdateRelayServiceConnectionSlotOptions contains the optional parameters for the WebApps.UpdateRelayServiceConnectionSlot method. +type WebAppsUpdateRelayServiceConnectionSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsUpdateScmAllowedOptions contains the optional parameters for the WebApps.UpdateScmAllowed method. +type WebAppsUpdateScmAllowedOptions struct { + // placeholder for future optional parameters +} + +// WebAppsUpdateScmAllowedSlotOptions contains the optional parameters for the WebApps.UpdateScmAllowedSlot method. +type WebAppsUpdateScmAllowedSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsUpdateSitePushSettingsOptions contains the optional parameters for the WebApps.UpdateSitePushSettings method. +type WebAppsUpdateSitePushSettingsOptions struct { + // placeholder for future optional parameters +} + +// WebAppsUpdateSitePushSettingsSlotOptions contains the optional parameters for the WebApps.UpdateSitePushSettingsSlot method. +type WebAppsUpdateSitePushSettingsSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsUpdateSlotConfigurationNamesOptions contains the optional parameters for the WebApps.UpdateSlotConfigurationNames method. +type WebAppsUpdateSlotConfigurationNamesOptions struct { + // placeholder for future optional parameters +} + +// WebAppsUpdateSlotOptions contains the optional parameters for the WebApps.UpdateSlot method. +type WebAppsUpdateSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsUpdateSourceControlOptions contains the optional parameters for the WebApps.UpdateSourceControl method. +type WebAppsUpdateSourceControlOptions struct { + // placeholder for future optional parameters +} + +// WebAppsUpdateSourceControlSlotOptions contains the optional parameters for the WebApps.UpdateSourceControlSlot method. +type WebAppsUpdateSourceControlSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsUpdateSwiftVirtualNetworkConnectionWithCheckOptions contains the optional parameters for the WebApps.UpdateSwiftVirtualNetworkConnectionWithCheck +// method. +type WebAppsUpdateSwiftVirtualNetworkConnectionWithCheckOptions struct { + // placeholder for future optional parameters +} + +// WebAppsUpdateSwiftVirtualNetworkConnectionWithCheckSlotOptions contains the optional parameters for the WebApps.UpdateSwiftVirtualNetworkConnectionWithCheckSlot +// method. +type WebAppsUpdateSwiftVirtualNetworkConnectionWithCheckSlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsUpdateVnetConnectionGatewayOptions contains the optional parameters for the WebApps.UpdateVnetConnectionGateway method. +type WebAppsUpdateVnetConnectionGatewayOptions struct { + // placeholder for future optional parameters +} + +// WebAppsUpdateVnetConnectionGatewaySlotOptions contains the optional parameters for the WebApps.UpdateVnetConnectionGatewaySlot method. +type WebAppsUpdateVnetConnectionGatewaySlotOptions struct { + // placeholder for future optional parameters +} + +// WebAppsUpdateVnetConnectionOptions contains the optional parameters for the WebApps.UpdateVnetConnection method. +type WebAppsUpdateVnetConnectionOptions struct { + // placeholder for future optional parameters +} + +// WebAppsUpdateVnetConnectionSlotOptions contains the optional parameters for the WebApps.UpdateVnetConnectionSlot method. +type WebAppsUpdateVnetConnectionSlotOptions struct { + // placeholder for future optional parameters +} + +// WebJob - Web Job Information. +type WebJob struct { + ProxyOnlyResource + // WebJob resource specific properties + Properties *WebJobProperties `json:"properties,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type WebJob. +func (w WebJob) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + w.ProxyOnlyResource.marshalInternal(objectMap) + populate(objectMap, "properties", w.Properties) + return json.Marshal(objectMap) +} + +// WebJobCollection - Collection of Kudu web job information elements. +type WebJobCollection struct { + // REQUIRED; Collection of resources. + Value []*WebJob `json:"value,omitempty"` + + // READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type WebJobCollection. +func (w WebJobCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", w.NextLink) + populate(objectMap, "value", w.Value) + return json.Marshal(objectMap) +} + +// WebJobProperties - WebJob resource specific properties +type WebJobProperties struct { + // Error information. + Error *string `json:"error,omitempty"` + + // Extra Info URL. + ExtraInfoURL *string `json:"extra_info_url,omitempty"` + + // Run command. + RunCommand *string `json:"run_command,omitempty"` + + // Job settings. + Settings map[string]map[string]interface{} `json:"settings,omitempty"` + + // Job URL. + URL *string `json:"url,omitempty"` + + // Using SDK? + UsingSdk *bool `json:"using_sdk,omitempty"` + + // Job type. + WebJobType *WebJobType `json:"web_job_type,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type WebJobProperties. +func (w WebJobProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "error", w.Error) + populate(objectMap, "extra_info_url", w.ExtraInfoURL) + populate(objectMap, "run_command", w.RunCommand) + populate(objectMap, "settings", w.Settings) + populate(objectMap, "url", w.URL) + populate(objectMap, "using_sdk", w.UsingSdk) + populate(objectMap, "web_job_type", w.WebJobType) + return json.Marshal(objectMap) +} + +type WebSiteInstanceStatus struct { + ProxyOnlyResource + // WebSiteInstanceStatus resource specific properties + Properties *WebSiteInstanceStatusProperties `json:"properties,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type WebSiteInstanceStatus. +func (w WebSiteInstanceStatus) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + w.ProxyOnlyResource.marshalInternal(objectMap) + populate(objectMap, "properties", w.Properties) + return json.Marshal(objectMap) +} + +// WebSiteInstanceStatusProperties - WebSiteInstanceStatus resource specific properties +type WebSiteInstanceStatusProperties struct { + // Link to the console to web app instance + ConsoleURL *string `json:"consoleUrl,omitempty"` + + // Dictionary of + Containers map[string]*ContainerInfo `json:"containers,omitempty"` + + // Link to the Diagnose and Solve Portal + DetectorURL *string `json:"detectorUrl,omitempty"` + + // Link to the console to web app instance + HealthCheckURL *string `json:"healthCheckUrl,omitempty"` + State *SiteRuntimeState `json:"state,omitempty"` + + // Link to the GetStatusApi in Kudu + StatusURL *string `json:"statusUrl,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type WebSiteInstanceStatusProperties. +func (w WebSiteInstanceStatusProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "consoleUrl", w.ConsoleURL) + populate(objectMap, "containers", w.Containers) + populate(objectMap, "detectorUrl", w.DetectorURL) + populate(objectMap, "healthCheckUrl", w.HealthCheckURL) + populate(objectMap, "state", w.State) + populate(objectMap, "statusUrl", w.StatusURL) + return json.Marshal(objectMap) +} + +// WebSiteManagementClientCheckNameAvailabilityOptions contains the optional parameters for the WebSiteManagementClient.CheckNameAvailability method. +type WebSiteManagementClientCheckNameAvailabilityOptions struct { + // placeholder for future optional parameters +} + +// WebSiteManagementClientGetPublishingUserOptions contains the optional parameters for the WebSiteManagementClient.GetPublishingUser method. +type WebSiteManagementClientGetPublishingUserOptions struct { + // placeholder for future optional parameters +} + +// WebSiteManagementClientGetSourceControlOptions contains the optional parameters for the WebSiteManagementClient.GetSourceControl method. +type WebSiteManagementClientGetSourceControlOptions struct { + // placeholder for future optional parameters +} + +// WebSiteManagementClientGetSubscriptionDeploymentLocationsOptions contains the optional parameters for the WebSiteManagementClient.GetSubscriptionDeploymentLocations +// method. +type WebSiteManagementClientGetSubscriptionDeploymentLocationsOptions struct { + // placeholder for future optional parameters +} + +// WebSiteManagementClientListBillingMetersOptions contains the optional parameters for the WebSiteManagementClient.ListBillingMeters method. +type WebSiteManagementClientListBillingMetersOptions struct { + // Azure Location of billable resource + BillingLocation *string + // App Service OS type meters used for + OSType *string +} + +// WebSiteManagementClientListGeoRegionsOptions contains the optional parameters for the WebSiteManagementClient.ListGeoRegions method. +type WebSiteManagementClientListGeoRegionsOptions struct { + // Specify true if you want to filter to only regions that support Linux Consumption Workers. + LinuxDynamicWorkersEnabled *bool + // Specify true if you want to filter to only regions that support Linux workers. + LinuxWorkersEnabled *bool + // Name of SKU used to filter the regions. + SKU *SKUName + // Specify true if you want to filter to only regions that support Xenon workers. + XenonWorkersEnabled *bool +} + +// WebSiteManagementClientListPremierAddOnOffersOptions contains the optional parameters for the WebSiteManagementClient.ListPremierAddOnOffers method. +type WebSiteManagementClientListPremierAddOnOffersOptions struct { + // placeholder for future optional parameters +} + +// WebSiteManagementClientListSKUsOptions contains the optional parameters for the WebSiteManagementClient.ListSKUs method. +type WebSiteManagementClientListSKUsOptions struct { + // placeholder for future optional parameters +} + +// WebSiteManagementClientListSiteIdentifiersAssignedToHostNameOptions contains the optional parameters for the WebSiteManagementClient.ListSiteIdentifiersAssignedToHostName +// method. +type WebSiteManagementClientListSiteIdentifiersAssignedToHostNameOptions struct { + // placeholder for future optional parameters +} + +// WebSiteManagementClientListSourceControlsOptions contains the optional parameters for the WebSiteManagementClient.ListSourceControls method. +type WebSiteManagementClientListSourceControlsOptions struct { + // placeholder for future optional parameters +} + +// WebSiteManagementClientMoveOptions contains the optional parameters for the WebSiteManagementClient.Move method. +type WebSiteManagementClientMoveOptions struct { + // placeholder for future optional parameters +} + +// WebSiteManagementClientUpdatePublishingUserOptions contains the optional parameters for the WebSiteManagementClient.UpdatePublishingUser method. +type WebSiteManagementClientUpdatePublishingUserOptions struct { + // placeholder for future optional parameters +} + +// WebSiteManagementClientUpdateSourceControlOptions contains the optional parameters for the WebSiteManagementClient.UpdateSourceControl method. +type WebSiteManagementClientUpdateSourceControlOptions struct { + // placeholder for future optional parameters +} + +// WebSiteManagementClientValidateMoveOptions contains the optional parameters for the WebSiteManagementClient.ValidateMove method. +type WebSiteManagementClientValidateMoveOptions struct { + // placeholder for future optional parameters +} + +// WebSiteManagementClientValidateOptions contains the optional parameters for the WebSiteManagementClient.Validate method. +type WebSiteManagementClientValidateOptions struct { + // placeholder for future optional parameters +} + +// WebSiteManagementClientVerifyHostingEnvironmentVnetOptions contains the optional parameters for the WebSiteManagementClient.VerifyHostingEnvironmentVnet +// method. +type WebSiteManagementClientVerifyHostingEnvironmentVnetOptions struct { + // placeholder for future optional parameters +} + +// WindowsJavaContainerSettings - Windows Java Container settings. +type WindowsJavaContainerSettings struct { + // READ-ONLY; End-of-life date for the minor version. + EndOfLifeDate *time.Time `json:"endOfLifeDate,omitempty" azure:"ro"` + + // READ-ONLY; true if the stack version is auto-updated; otherwise, false. + IsAutoUpdate *bool `json:"isAutoUpdate,omitempty" azure:"ro"` + + // READ-ONLY; true if the stack is deprecated; otherwise, false. + IsDeprecated *bool `json:"isDeprecated,omitempty" azure:"ro"` + + // READ-ONLY; true if the minor version is early-access; otherwise, false. + IsEarlyAccess *bool `json:"isEarlyAccess,omitempty" azure:"ro"` + + // READ-ONLY; true if the stack should be hidden; otherwise, false. + IsHidden *bool `json:"isHidden,omitempty" azure:"ro"` + + // READ-ONLY; true if the stack is in preview; otherwise, false. + IsPreview *bool `json:"isPreview,omitempty" azure:"ro"` + + // READ-ONLY; Java container (runtime only). + JavaContainer *string `json:"javaContainer,omitempty" azure:"ro"` + + // READ-ONLY; Java container version (runtime only). + JavaContainerVersion *string `json:"javaContainerVersion,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type WindowsJavaContainerSettings. +func (w WindowsJavaContainerSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populateTimeRFC3339(objectMap, "endOfLifeDate", w.EndOfLifeDate) + populate(objectMap, "isAutoUpdate", w.IsAutoUpdate) + populate(objectMap, "isDeprecated", w.IsDeprecated) + populate(objectMap, "isEarlyAccess", w.IsEarlyAccess) + populate(objectMap, "isHidden", w.IsHidden) + populate(objectMap, "isPreview", w.IsPreview) + populate(objectMap, "javaContainer", w.JavaContainer) + populate(objectMap, "javaContainerVersion", w.JavaContainerVersion) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WindowsJavaContainerSettings. +func (w *WindowsJavaContainerSettings) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "endOfLifeDate": + err = unpopulateTimeRFC3339(val, &w.EndOfLifeDate) + delete(rawMsg, key) + case "isAutoUpdate": + err = unpopulate(val, &w.IsAutoUpdate) + delete(rawMsg, key) + case "isDeprecated": + err = unpopulate(val, &w.IsDeprecated) + delete(rawMsg, key) + case "isEarlyAccess": + err = unpopulate(val, &w.IsEarlyAccess) + delete(rawMsg, key) + case "isHidden": + err = unpopulate(val, &w.IsHidden) + delete(rawMsg, key) + case "isPreview": + err = unpopulate(val, &w.IsPreview) + delete(rawMsg, key) + case "javaContainer": + err = unpopulate(val, &w.JavaContainer) + delete(rawMsg, key) + case "javaContainerVersion": + err = unpopulate(val, &w.JavaContainerVersion) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// WorkerPool - Worker pool of an App Service Environment. +type WorkerPool struct { + // Shared or dedicated app hosting. + ComputeMode *ComputeModeOptions `json:"computeMode,omitempty"` + + // Number of instances in the worker pool. + WorkerCount *int32 `json:"workerCount,omitempty"` + + // VM size of the worker pool instances. + WorkerSize *string `json:"workerSize,omitempty"` + + // Worker size ID for referencing this worker pool. + WorkerSizeID *int32 `json:"workerSizeId,omitempty"` + + // READ-ONLY; Names of all instances in the worker pool (read only). + InstanceNames []*string `json:"instanceNames,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type WorkerPool. +func (w WorkerPool) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "computeMode", w.ComputeMode) + populate(objectMap, "instanceNames", w.InstanceNames) + populate(objectMap, "workerCount", w.WorkerCount) + populate(objectMap, "workerSize", w.WorkerSize) + populate(objectMap, "workerSizeId", w.WorkerSizeID) + return json.Marshal(objectMap) +} + +// WorkerPoolCollection - Collection of worker pools. +type WorkerPoolCollection struct { + // REQUIRED; Collection of resources. + Value []*WorkerPoolResource `json:"value,omitempty"` + + // READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` +} + +// MarshalJSON implements the json.Marshaller interface for type WorkerPoolCollection. +func (w WorkerPoolCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", w.NextLink) + populate(objectMap, "value", w.Value) + return json.Marshal(objectMap) +} + +// WorkerPoolResource - Worker pool of an App Service Environment ARM resource. +type WorkerPoolResource struct { + ProxyOnlyResource + // Core resource properties + Properties *WorkerPool `json:"properties,omitempty"` + + // Description of a SKU for a scalable resource. + SKU *SKUDescription `json:"sku,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type WorkerPoolResource. +func (w WorkerPoolResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + w.ProxyOnlyResource.marshalInternal(objectMap) + populate(objectMap, "properties", w.Properties) + populate(objectMap, "sku", w.SKU) + return json.Marshal(objectMap) +} + +func populate(m map[string]interface{}, k string, v interface{}) { + if v == nil { + return + } else if azcore.IsNullValue(v) { + m[k] = nil + } else if !reflect.ValueOf(v).IsNil() { + m[k] = v + } +} + +func populateByteArray(m map[string]interface{}, k string, b []byte, f runtime.Base64Encoding) { + if azcore.IsNullValue(b) { + m[k] = nil + } else if len(b) == 0 { + return + } else { + m[k] = runtime.EncodeByteArray(b, f) + } +} + +func unpopulate(data json.RawMessage, v interface{}) error { + if data == nil { + return nil + } + return json.Unmarshal(data, v) +} diff --git a/sdk/resourcemanager/appservice/armappservice/zz_generated_pagers.go b/sdk/resourcemanager/appservice/armappservice/zz_generated_pagers.go new file mode 100644 index 000000000000..3fd22bcc119a --- /dev/null +++ b/sdk/resourcemanager/appservice/armappservice/zz_generated_pagers.go @@ -0,0 +1,8057 @@ +//go:build go1.16 +// +build go1.16 + +// 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. + +package armappservice + +import ( + "context" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "reflect" +) + +// AppServiceCertificateOrdersListByResourceGroupPager provides operations for iterating over paged responses. +type AppServiceCertificateOrdersListByResourceGroupPager struct { + client *AppServiceCertificateOrdersClient + current AppServiceCertificateOrdersListByResourceGroupResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, AppServiceCertificateOrdersListByResourceGroupResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *AppServiceCertificateOrdersListByResourceGroupPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *AppServiceCertificateOrdersListByResourceGroupPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.AppServiceCertificateOrderCollection.NextLink == nil || len(*p.current.AppServiceCertificateOrderCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listByResourceGroupHandleError(resp) + return false + } + result, err := p.client.listByResourceGroupHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current AppServiceCertificateOrdersListByResourceGroupResponse page. +func (p *AppServiceCertificateOrdersListByResourceGroupPager) PageResponse() AppServiceCertificateOrdersListByResourceGroupResponse { + return p.current +} + +// AppServiceCertificateOrdersListCertificatesPager provides operations for iterating over paged responses. +type AppServiceCertificateOrdersListCertificatesPager struct { + client *AppServiceCertificateOrdersClient + current AppServiceCertificateOrdersListCertificatesResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, AppServiceCertificateOrdersListCertificatesResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *AppServiceCertificateOrdersListCertificatesPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *AppServiceCertificateOrdersListCertificatesPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.AppServiceCertificateCollection.NextLink == nil || len(*p.current.AppServiceCertificateCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listCertificatesHandleError(resp) + return false + } + result, err := p.client.listCertificatesHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current AppServiceCertificateOrdersListCertificatesResponse page. +func (p *AppServiceCertificateOrdersListCertificatesPager) PageResponse() AppServiceCertificateOrdersListCertificatesResponse { + return p.current +} + +// AppServiceCertificateOrdersListPager provides operations for iterating over paged responses. +type AppServiceCertificateOrdersListPager struct { + client *AppServiceCertificateOrdersClient + current AppServiceCertificateOrdersListResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, AppServiceCertificateOrdersListResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *AppServiceCertificateOrdersListPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *AppServiceCertificateOrdersListPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.AppServiceCertificateOrderCollection.NextLink == nil || len(*p.current.AppServiceCertificateOrderCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listHandleError(resp) + return false + } + result, err := p.client.listHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current AppServiceCertificateOrdersListResponse page. +func (p *AppServiceCertificateOrdersListPager) PageResponse() AppServiceCertificateOrdersListResponse { + return p.current +} + +// AppServiceEnvironmentsChangeVnetPager provides operations for iterating over paged responses. +type AppServiceEnvironmentsChangeVnetPager struct { + client *AppServiceEnvironmentsClient + current AppServiceEnvironmentsChangeVnetResponse + err error + second bool +} + +// Err returns the last error encountered while paging. +func (p *AppServiceEnvironmentsChangeVnetPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *AppServiceEnvironmentsChangeVnetPager) NextPage(ctx context.Context) bool { + if !p.second { + p.second = true + return true + } else if !reflect.ValueOf(p.current).IsZero() { + if p.current.WebAppCollection.NextLink == nil || len(*p.current.WebAppCollection.NextLink) == 0 { + return false + } + } + req, err := runtime.NewRequest(ctx, http.MethodGet, *p.current.WebAppCollection.NextLink) + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { + p.err = p.client.changeVnetHandleError(resp) + return false + } + result, err := p.client.changeVnetHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current AppServiceEnvironmentsChangeVnetResponse page. +func (p *AppServiceEnvironmentsChangeVnetPager) PageResponse() AppServiceEnvironmentsChangeVnetResponse { + return p.current +} + +// AppServiceEnvironmentsGetInboundNetworkDependenciesEndpointsPager provides operations for iterating over paged responses. +type AppServiceEnvironmentsGetInboundNetworkDependenciesEndpointsPager struct { + client *AppServiceEnvironmentsClient + current AppServiceEnvironmentsGetInboundNetworkDependenciesEndpointsResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, AppServiceEnvironmentsGetInboundNetworkDependenciesEndpointsResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *AppServiceEnvironmentsGetInboundNetworkDependenciesEndpointsPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *AppServiceEnvironmentsGetInboundNetworkDependenciesEndpointsPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.InboundEnvironmentEndpointCollection.NextLink == nil || len(*p.current.InboundEnvironmentEndpointCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.getInboundNetworkDependenciesEndpointsHandleError(resp) + return false + } + result, err := p.client.getInboundNetworkDependenciesEndpointsHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current AppServiceEnvironmentsGetInboundNetworkDependenciesEndpointsResponse page. +func (p *AppServiceEnvironmentsGetInboundNetworkDependenciesEndpointsPager) PageResponse() AppServiceEnvironmentsGetInboundNetworkDependenciesEndpointsResponse { + return p.current +} + +// AppServiceEnvironmentsGetOutboundNetworkDependenciesEndpointsPager provides operations for iterating over paged responses. +type AppServiceEnvironmentsGetOutboundNetworkDependenciesEndpointsPager struct { + client *AppServiceEnvironmentsClient + current AppServiceEnvironmentsGetOutboundNetworkDependenciesEndpointsResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, AppServiceEnvironmentsGetOutboundNetworkDependenciesEndpointsResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *AppServiceEnvironmentsGetOutboundNetworkDependenciesEndpointsPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *AppServiceEnvironmentsGetOutboundNetworkDependenciesEndpointsPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.OutboundEnvironmentEndpointCollection.NextLink == nil || len(*p.current.OutboundEnvironmentEndpointCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.getOutboundNetworkDependenciesEndpointsHandleError(resp) + return false + } + result, err := p.client.getOutboundNetworkDependenciesEndpointsHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current AppServiceEnvironmentsGetOutboundNetworkDependenciesEndpointsResponse page. +func (p *AppServiceEnvironmentsGetOutboundNetworkDependenciesEndpointsPager) PageResponse() AppServiceEnvironmentsGetOutboundNetworkDependenciesEndpointsResponse { + return p.current +} + +// AppServiceEnvironmentsGetPrivateEndpointConnectionListPager provides operations for iterating over paged responses. +type AppServiceEnvironmentsGetPrivateEndpointConnectionListPager struct { + client *AppServiceEnvironmentsClient + current AppServiceEnvironmentsGetPrivateEndpointConnectionListResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, AppServiceEnvironmentsGetPrivateEndpointConnectionListResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *AppServiceEnvironmentsGetPrivateEndpointConnectionListPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *AppServiceEnvironmentsGetPrivateEndpointConnectionListPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.PrivateEndpointConnectionCollection.NextLink == nil || len(*p.current.PrivateEndpointConnectionCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.getPrivateEndpointConnectionListHandleError(resp) + return false + } + result, err := p.client.getPrivateEndpointConnectionListHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current AppServiceEnvironmentsGetPrivateEndpointConnectionListResponse page. +func (p *AppServiceEnvironmentsGetPrivateEndpointConnectionListPager) PageResponse() AppServiceEnvironmentsGetPrivateEndpointConnectionListResponse { + return p.current +} + +// AppServiceEnvironmentsListAppServicePlansPager provides operations for iterating over paged responses. +type AppServiceEnvironmentsListAppServicePlansPager struct { + client *AppServiceEnvironmentsClient + current AppServiceEnvironmentsListAppServicePlansResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, AppServiceEnvironmentsListAppServicePlansResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *AppServiceEnvironmentsListAppServicePlansPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *AppServiceEnvironmentsListAppServicePlansPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.AppServicePlanCollection.NextLink == nil || len(*p.current.AppServicePlanCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listAppServicePlansHandleError(resp) + return false + } + result, err := p.client.listAppServicePlansHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current AppServiceEnvironmentsListAppServicePlansResponse page. +func (p *AppServiceEnvironmentsListAppServicePlansPager) PageResponse() AppServiceEnvironmentsListAppServicePlansResponse { + return p.current +} + +// AppServiceEnvironmentsListByResourceGroupPager provides operations for iterating over paged responses. +type AppServiceEnvironmentsListByResourceGroupPager struct { + client *AppServiceEnvironmentsClient + current AppServiceEnvironmentsListByResourceGroupResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, AppServiceEnvironmentsListByResourceGroupResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *AppServiceEnvironmentsListByResourceGroupPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *AppServiceEnvironmentsListByResourceGroupPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.AppServiceEnvironmentCollection.NextLink == nil || len(*p.current.AppServiceEnvironmentCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listByResourceGroupHandleError(resp) + return false + } + result, err := p.client.listByResourceGroupHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current AppServiceEnvironmentsListByResourceGroupResponse page. +func (p *AppServiceEnvironmentsListByResourceGroupPager) PageResponse() AppServiceEnvironmentsListByResourceGroupResponse { + return p.current +} + +// AppServiceEnvironmentsListCapacitiesPager provides operations for iterating over paged responses. +type AppServiceEnvironmentsListCapacitiesPager struct { + client *AppServiceEnvironmentsClient + current AppServiceEnvironmentsListCapacitiesResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, AppServiceEnvironmentsListCapacitiesResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *AppServiceEnvironmentsListCapacitiesPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *AppServiceEnvironmentsListCapacitiesPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.StampCapacityCollection.NextLink == nil || len(*p.current.StampCapacityCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listCapacitiesHandleError(resp) + return false + } + result, err := p.client.listCapacitiesHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current AppServiceEnvironmentsListCapacitiesResponse page. +func (p *AppServiceEnvironmentsListCapacitiesPager) PageResponse() AppServiceEnvironmentsListCapacitiesResponse { + return p.current +} + +// AppServiceEnvironmentsListMultiRoleMetricDefinitionsPager provides operations for iterating over paged responses. +type AppServiceEnvironmentsListMultiRoleMetricDefinitionsPager struct { + client *AppServiceEnvironmentsClient + current AppServiceEnvironmentsListMultiRoleMetricDefinitionsResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, AppServiceEnvironmentsListMultiRoleMetricDefinitionsResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *AppServiceEnvironmentsListMultiRoleMetricDefinitionsPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *AppServiceEnvironmentsListMultiRoleMetricDefinitionsPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.ResourceMetricDefinitionCollection.NextLink == nil || len(*p.current.ResourceMetricDefinitionCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listMultiRoleMetricDefinitionsHandleError(resp) + return false + } + result, err := p.client.listMultiRoleMetricDefinitionsHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current AppServiceEnvironmentsListMultiRoleMetricDefinitionsResponse page. +func (p *AppServiceEnvironmentsListMultiRoleMetricDefinitionsPager) PageResponse() AppServiceEnvironmentsListMultiRoleMetricDefinitionsResponse { + return p.current +} + +// AppServiceEnvironmentsListMultiRolePoolInstanceMetricDefinitionsPager provides operations for iterating over paged responses. +type AppServiceEnvironmentsListMultiRolePoolInstanceMetricDefinitionsPager struct { + client *AppServiceEnvironmentsClient + current AppServiceEnvironmentsListMultiRolePoolInstanceMetricDefinitionsResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, AppServiceEnvironmentsListMultiRolePoolInstanceMetricDefinitionsResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *AppServiceEnvironmentsListMultiRolePoolInstanceMetricDefinitionsPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *AppServiceEnvironmentsListMultiRolePoolInstanceMetricDefinitionsPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.ResourceMetricDefinitionCollection.NextLink == nil || len(*p.current.ResourceMetricDefinitionCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listMultiRolePoolInstanceMetricDefinitionsHandleError(resp) + return false + } + result, err := p.client.listMultiRolePoolInstanceMetricDefinitionsHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current AppServiceEnvironmentsListMultiRolePoolInstanceMetricDefinitionsResponse page. +func (p *AppServiceEnvironmentsListMultiRolePoolInstanceMetricDefinitionsPager) PageResponse() AppServiceEnvironmentsListMultiRolePoolInstanceMetricDefinitionsResponse { + return p.current +} + +// AppServiceEnvironmentsListMultiRolePoolSKUsPager provides operations for iterating over paged responses. +type AppServiceEnvironmentsListMultiRolePoolSKUsPager struct { + client *AppServiceEnvironmentsClient + current AppServiceEnvironmentsListMultiRolePoolSKUsResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, AppServiceEnvironmentsListMultiRolePoolSKUsResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *AppServiceEnvironmentsListMultiRolePoolSKUsPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *AppServiceEnvironmentsListMultiRolePoolSKUsPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.SKUInfoCollection.NextLink == nil || len(*p.current.SKUInfoCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listMultiRolePoolSKUsHandleError(resp) + return false + } + result, err := p.client.listMultiRolePoolSKUsHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current AppServiceEnvironmentsListMultiRolePoolSKUsResponse page. +func (p *AppServiceEnvironmentsListMultiRolePoolSKUsPager) PageResponse() AppServiceEnvironmentsListMultiRolePoolSKUsResponse { + return p.current +} + +// AppServiceEnvironmentsListMultiRolePoolsPager provides operations for iterating over paged responses. +type AppServiceEnvironmentsListMultiRolePoolsPager struct { + client *AppServiceEnvironmentsClient + current AppServiceEnvironmentsListMultiRolePoolsResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, AppServiceEnvironmentsListMultiRolePoolsResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *AppServiceEnvironmentsListMultiRolePoolsPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *AppServiceEnvironmentsListMultiRolePoolsPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.WorkerPoolCollection.NextLink == nil || len(*p.current.WorkerPoolCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listMultiRolePoolsHandleError(resp) + return false + } + result, err := p.client.listMultiRolePoolsHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current AppServiceEnvironmentsListMultiRolePoolsResponse page. +func (p *AppServiceEnvironmentsListMultiRolePoolsPager) PageResponse() AppServiceEnvironmentsListMultiRolePoolsResponse { + return p.current +} + +// AppServiceEnvironmentsListMultiRoleUsagesPager provides operations for iterating over paged responses. +type AppServiceEnvironmentsListMultiRoleUsagesPager struct { + client *AppServiceEnvironmentsClient + current AppServiceEnvironmentsListMultiRoleUsagesResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, AppServiceEnvironmentsListMultiRoleUsagesResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *AppServiceEnvironmentsListMultiRoleUsagesPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *AppServiceEnvironmentsListMultiRoleUsagesPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.UsageCollection.NextLink == nil || len(*p.current.UsageCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listMultiRoleUsagesHandleError(resp) + return false + } + result, err := p.client.listMultiRoleUsagesHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current AppServiceEnvironmentsListMultiRoleUsagesResponse page. +func (p *AppServiceEnvironmentsListMultiRoleUsagesPager) PageResponse() AppServiceEnvironmentsListMultiRoleUsagesResponse { + return p.current +} + +// AppServiceEnvironmentsListPager provides operations for iterating over paged responses. +type AppServiceEnvironmentsListPager struct { + client *AppServiceEnvironmentsClient + current AppServiceEnvironmentsListResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, AppServiceEnvironmentsListResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *AppServiceEnvironmentsListPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *AppServiceEnvironmentsListPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.AppServiceEnvironmentCollection.NextLink == nil || len(*p.current.AppServiceEnvironmentCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listHandleError(resp) + return false + } + result, err := p.client.listHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current AppServiceEnvironmentsListResponse page. +func (p *AppServiceEnvironmentsListPager) PageResponse() AppServiceEnvironmentsListResponse { + return p.current +} + +// AppServiceEnvironmentsListUsagesPager provides operations for iterating over paged responses. +type AppServiceEnvironmentsListUsagesPager struct { + client *AppServiceEnvironmentsClient + current AppServiceEnvironmentsListUsagesResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, AppServiceEnvironmentsListUsagesResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *AppServiceEnvironmentsListUsagesPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *AppServiceEnvironmentsListUsagesPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.CsmUsageQuotaCollection.NextLink == nil || len(*p.current.CsmUsageQuotaCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listUsagesHandleError(resp) + return false + } + result, err := p.client.listUsagesHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current AppServiceEnvironmentsListUsagesResponse page. +func (p *AppServiceEnvironmentsListUsagesPager) PageResponse() AppServiceEnvironmentsListUsagesResponse { + return p.current +} + +// AppServiceEnvironmentsListWebAppsPager provides operations for iterating over paged responses. +type AppServiceEnvironmentsListWebAppsPager struct { + client *AppServiceEnvironmentsClient + current AppServiceEnvironmentsListWebAppsResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, AppServiceEnvironmentsListWebAppsResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *AppServiceEnvironmentsListWebAppsPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *AppServiceEnvironmentsListWebAppsPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.WebAppCollection.NextLink == nil || len(*p.current.WebAppCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listWebAppsHandleError(resp) + return false + } + result, err := p.client.listWebAppsHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current AppServiceEnvironmentsListWebAppsResponse page. +func (p *AppServiceEnvironmentsListWebAppsPager) PageResponse() AppServiceEnvironmentsListWebAppsResponse { + return p.current +} + +// AppServiceEnvironmentsListWebWorkerMetricDefinitionsPager provides operations for iterating over paged responses. +type AppServiceEnvironmentsListWebWorkerMetricDefinitionsPager struct { + client *AppServiceEnvironmentsClient + current AppServiceEnvironmentsListWebWorkerMetricDefinitionsResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, AppServiceEnvironmentsListWebWorkerMetricDefinitionsResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *AppServiceEnvironmentsListWebWorkerMetricDefinitionsPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *AppServiceEnvironmentsListWebWorkerMetricDefinitionsPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.ResourceMetricDefinitionCollection.NextLink == nil || len(*p.current.ResourceMetricDefinitionCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listWebWorkerMetricDefinitionsHandleError(resp) + return false + } + result, err := p.client.listWebWorkerMetricDefinitionsHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current AppServiceEnvironmentsListWebWorkerMetricDefinitionsResponse page. +func (p *AppServiceEnvironmentsListWebWorkerMetricDefinitionsPager) PageResponse() AppServiceEnvironmentsListWebWorkerMetricDefinitionsResponse { + return p.current +} + +// AppServiceEnvironmentsListWebWorkerUsagesPager provides operations for iterating over paged responses. +type AppServiceEnvironmentsListWebWorkerUsagesPager struct { + client *AppServiceEnvironmentsClient + current AppServiceEnvironmentsListWebWorkerUsagesResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, AppServiceEnvironmentsListWebWorkerUsagesResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *AppServiceEnvironmentsListWebWorkerUsagesPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *AppServiceEnvironmentsListWebWorkerUsagesPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.UsageCollection.NextLink == nil || len(*p.current.UsageCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listWebWorkerUsagesHandleError(resp) + return false + } + result, err := p.client.listWebWorkerUsagesHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current AppServiceEnvironmentsListWebWorkerUsagesResponse page. +func (p *AppServiceEnvironmentsListWebWorkerUsagesPager) PageResponse() AppServiceEnvironmentsListWebWorkerUsagesResponse { + return p.current +} + +// AppServiceEnvironmentsListWorkerPoolInstanceMetricDefinitionsPager provides operations for iterating over paged responses. +type AppServiceEnvironmentsListWorkerPoolInstanceMetricDefinitionsPager struct { + client *AppServiceEnvironmentsClient + current AppServiceEnvironmentsListWorkerPoolInstanceMetricDefinitionsResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, AppServiceEnvironmentsListWorkerPoolInstanceMetricDefinitionsResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *AppServiceEnvironmentsListWorkerPoolInstanceMetricDefinitionsPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *AppServiceEnvironmentsListWorkerPoolInstanceMetricDefinitionsPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.ResourceMetricDefinitionCollection.NextLink == nil || len(*p.current.ResourceMetricDefinitionCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listWorkerPoolInstanceMetricDefinitionsHandleError(resp) + return false + } + result, err := p.client.listWorkerPoolInstanceMetricDefinitionsHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current AppServiceEnvironmentsListWorkerPoolInstanceMetricDefinitionsResponse page. +func (p *AppServiceEnvironmentsListWorkerPoolInstanceMetricDefinitionsPager) PageResponse() AppServiceEnvironmentsListWorkerPoolInstanceMetricDefinitionsResponse { + return p.current +} + +// AppServiceEnvironmentsListWorkerPoolSKUsPager provides operations for iterating over paged responses. +type AppServiceEnvironmentsListWorkerPoolSKUsPager struct { + client *AppServiceEnvironmentsClient + current AppServiceEnvironmentsListWorkerPoolSKUsResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, AppServiceEnvironmentsListWorkerPoolSKUsResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *AppServiceEnvironmentsListWorkerPoolSKUsPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *AppServiceEnvironmentsListWorkerPoolSKUsPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.SKUInfoCollection.NextLink == nil || len(*p.current.SKUInfoCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listWorkerPoolSKUsHandleError(resp) + return false + } + result, err := p.client.listWorkerPoolSKUsHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current AppServiceEnvironmentsListWorkerPoolSKUsResponse page. +func (p *AppServiceEnvironmentsListWorkerPoolSKUsPager) PageResponse() AppServiceEnvironmentsListWorkerPoolSKUsResponse { + return p.current +} + +// AppServiceEnvironmentsListWorkerPoolsPager provides operations for iterating over paged responses. +type AppServiceEnvironmentsListWorkerPoolsPager struct { + client *AppServiceEnvironmentsClient + current AppServiceEnvironmentsListWorkerPoolsResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, AppServiceEnvironmentsListWorkerPoolsResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *AppServiceEnvironmentsListWorkerPoolsPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *AppServiceEnvironmentsListWorkerPoolsPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.WorkerPoolCollection.NextLink == nil || len(*p.current.WorkerPoolCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listWorkerPoolsHandleError(resp) + return false + } + result, err := p.client.listWorkerPoolsHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current AppServiceEnvironmentsListWorkerPoolsResponse page. +func (p *AppServiceEnvironmentsListWorkerPoolsPager) PageResponse() AppServiceEnvironmentsListWorkerPoolsResponse { + return p.current +} + +// AppServiceEnvironmentsResumePager provides operations for iterating over paged responses. +type AppServiceEnvironmentsResumePager struct { + client *AppServiceEnvironmentsClient + current AppServiceEnvironmentsResumeResponse + err error + second bool +} + +// Err returns the last error encountered while paging. +func (p *AppServiceEnvironmentsResumePager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *AppServiceEnvironmentsResumePager) NextPage(ctx context.Context) bool { + if !p.second { + p.second = true + return true + } else if !reflect.ValueOf(p.current).IsZero() { + if p.current.WebAppCollection.NextLink == nil || len(*p.current.WebAppCollection.NextLink) == 0 { + return false + } + } + req, err := runtime.NewRequest(ctx, http.MethodGet, *p.current.WebAppCollection.NextLink) + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { + p.err = p.client.resumeHandleError(resp) + return false + } + result, err := p.client.resumeHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current AppServiceEnvironmentsResumeResponse page. +func (p *AppServiceEnvironmentsResumePager) PageResponse() AppServiceEnvironmentsResumeResponse { + return p.current +} + +// AppServiceEnvironmentsSuspendPager provides operations for iterating over paged responses. +type AppServiceEnvironmentsSuspendPager struct { + client *AppServiceEnvironmentsClient + current AppServiceEnvironmentsSuspendResponse + err error + second bool +} + +// Err returns the last error encountered while paging. +func (p *AppServiceEnvironmentsSuspendPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *AppServiceEnvironmentsSuspendPager) NextPage(ctx context.Context) bool { + if !p.second { + p.second = true + return true + } else if !reflect.ValueOf(p.current).IsZero() { + if p.current.WebAppCollection.NextLink == nil || len(*p.current.WebAppCollection.NextLink) == 0 { + return false + } + } + req, err := runtime.NewRequest(ctx, http.MethodGet, *p.current.WebAppCollection.NextLink) + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { + p.err = p.client.suspendHandleError(resp) + return false + } + result, err := p.client.suspendHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current AppServiceEnvironmentsSuspendResponse page. +func (p *AppServiceEnvironmentsSuspendPager) PageResponse() AppServiceEnvironmentsSuspendResponse { + return p.current +} + +// AppServicePlansListByResourceGroupPager provides operations for iterating over paged responses. +type AppServicePlansListByResourceGroupPager struct { + client *AppServicePlansClient + current AppServicePlansListByResourceGroupResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, AppServicePlansListByResourceGroupResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *AppServicePlansListByResourceGroupPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *AppServicePlansListByResourceGroupPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.AppServicePlanCollection.NextLink == nil || len(*p.current.AppServicePlanCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listByResourceGroupHandleError(resp) + return false + } + result, err := p.client.listByResourceGroupHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current AppServicePlansListByResourceGroupResponse page. +func (p *AppServicePlansListByResourceGroupPager) PageResponse() AppServicePlansListByResourceGroupResponse { + return p.current +} + +// AppServicePlansListHybridConnectionsPager provides operations for iterating over paged responses. +type AppServicePlansListHybridConnectionsPager struct { + client *AppServicePlansClient + current AppServicePlansListHybridConnectionsResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, AppServicePlansListHybridConnectionsResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *AppServicePlansListHybridConnectionsPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *AppServicePlansListHybridConnectionsPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.HybridConnectionCollection.NextLink == nil || len(*p.current.HybridConnectionCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listHybridConnectionsHandleError(resp) + return false + } + result, err := p.client.listHybridConnectionsHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current AppServicePlansListHybridConnectionsResponse page. +func (p *AppServicePlansListHybridConnectionsPager) PageResponse() AppServicePlansListHybridConnectionsResponse { + return p.current +} + +// AppServicePlansListPager provides operations for iterating over paged responses. +type AppServicePlansListPager struct { + client *AppServicePlansClient + current AppServicePlansListResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, AppServicePlansListResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *AppServicePlansListPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *AppServicePlansListPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.AppServicePlanCollection.NextLink == nil || len(*p.current.AppServicePlanCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listHandleError(resp) + return false + } + result, err := p.client.listHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current AppServicePlansListResponse page. +func (p *AppServicePlansListPager) PageResponse() AppServicePlansListResponse { + return p.current +} + +// AppServicePlansListUsagesPager provides operations for iterating over paged responses. +type AppServicePlansListUsagesPager struct { + client *AppServicePlansClient + current AppServicePlansListUsagesResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, AppServicePlansListUsagesResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *AppServicePlansListUsagesPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *AppServicePlansListUsagesPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.CsmUsageQuotaCollection.NextLink == nil || len(*p.current.CsmUsageQuotaCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listUsagesHandleError(resp) + return false + } + result, err := p.client.listUsagesHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current AppServicePlansListUsagesResponse page. +func (p *AppServicePlansListUsagesPager) PageResponse() AppServicePlansListUsagesResponse { + return p.current +} + +// AppServicePlansListWebAppsByHybridConnectionPager provides operations for iterating over paged responses. +type AppServicePlansListWebAppsByHybridConnectionPager struct { + client *AppServicePlansClient + current AppServicePlansListWebAppsByHybridConnectionResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, AppServicePlansListWebAppsByHybridConnectionResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *AppServicePlansListWebAppsByHybridConnectionPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *AppServicePlansListWebAppsByHybridConnectionPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.ResourceCollection.NextLink == nil || len(*p.current.ResourceCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listWebAppsByHybridConnectionHandleError(resp) + return false + } + result, err := p.client.listWebAppsByHybridConnectionHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current AppServicePlansListWebAppsByHybridConnectionResponse page. +func (p *AppServicePlansListWebAppsByHybridConnectionPager) PageResponse() AppServicePlansListWebAppsByHybridConnectionResponse { + return p.current +} + +// AppServicePlansListWebAppsPager provides operations for iterating over paged responses. +type AppServicePlansListWebAppsPager struct { + client *AppServicePlansClient + current AppServicePlansListWebAppsResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, AppServicePlansListWebAppsResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *AppServicePlansListWebAppsPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *AppServicePlansListWebAppsPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.WebAppCollection.NextLink == nil || len(*p.current.WebAppCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listWebAppsHandleError(resp) + return false + } + result, err := p.client.listWebAppsHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current AppServicePlansListWebAppsResponse page. +func (p *AppServicePlansListWebAppsPager) PageResponse() AppServicePlansListWebAppsResponse { + return p.current +} + +// CertificateOrdersDiagnosticsListAppServiceCertificateOrderDetectorResponsePager provides operations for iterating over paged responses. +type CertificateOrdersDiagnosticsListAppServiceCertificateOrderDetectorResponsePager struct { + client *CertificateOrdersDiagnosticsClient + current CertificateOrdersDiagnosticsListAppServiceCertificateOrderDetectorResponseResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, CertificateOrdersDiagnosticsListAppServiceCertificateOrderDetectorResponseResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *CertificateOrdersDiagnosticsListAppServiceCertificateOrderDetectorResponsePager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *CertificateOrdersDiagnosticsListAppServiceCertificateOrderDetectorResponsePager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.DetectorResponseCollection.NextLink == nil || len(*p.current.DetectorResponseCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listAppServiceCertificateOrderDetectorResponseHandleError(resp) + return false + } + result, err := p.client.listAppServiceCertificateOrderDetectorResponseHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current CertificateOrdersDiagnosticsListAppServiceCertificateOrderDetectorResponseResponse page. +func (p *CertificateOrdersDiagnosticsListAppServiceCertificateOrderDetectorResponsePager) PageResponse() CertificateOrdersDiagnosticsListAppServiceCertificateOrderDetectorResponseResponse { + return p.current +} + +// CertificateRegistrationProviderListOperationsPager provides operations for iterating over paged responses. +type CertificateRegistrationProviderListOperationsPager struct { + client *CertificateRegistrationProviderClient + current CertificateRegistrationProviderListOperationsResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, CertificateRegistrationProviderListOperationsResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *CertificateRegistrationProviderListOperationsPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *CertificateRegistrationProviderListOperationsPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.CsmOperationCollection.NextLink == nil || len(*p.current.CsmOperationCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listOperationsHandleError(resp) + return false + } + result, err := p.client.listOperationsHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current CertificateRegistrationProviderListOperationsResponse page. +func (p *CertificateRegistrationProviderListOperationsPager) PageResponse() CertificateRegistrationProviderListOperationsResponse { + return p.current +} + +// CertificatesListByResourceGroupPager provides operations for iterating over paged responses. +type CertificatesListByResourceGroupPager struct { + client *CertificatesClient + current CertificatesListByResourceGroupResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, CertificatesListByResourceGroupResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *CertificatesListByResourceGroupPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *CertificatesListByResourceGroupPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.CertificateCollection.NextLink == nil || len(*p.current.CertificateCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listByResourceGroupHandleError(resp) + return false + } + result, err := p.client.listByResourceGroupHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current CertificatesListByResourceGroupResponse page. +func (p *CertificatesListByResourceGroupPager) PageResponse() CertificatesListByResourceGroupResponse { + return p.current +} + +// CertificatesListPager provides operations for iterating over paged responses. +type CertificatesListPager struct { + client *CertificatesClient + current CertificatesListResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, CertificatesListResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *CertificatesListPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *CertificatesListPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.CertificateCollection.NextLink == nil || len(*p.current.CertificateCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listHandleError(resp) + return false + } + result, err := p.client.listHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current CertificatesListResponse page. +func (p *CertificatesListPager) PageResponse() CertificatesListResponse { + return p.current +} + +// DeletedWebAppsListByLocationPager provides operations for iterating over paged responses. +type DeletedWebAppsListByLocationPager struct { + client *DeletedWebAppsClient + current DeletedWebAppsListByLocationResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, DeletedWebAppsListByLocationResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *DeletedWebAppsListByLocationPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *DeletedWebAppsListByLocationPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.DeletedWebAppCollection.NextLink == nil || len(*p.current.DeletedWebAppCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listByLocationHandleError(resp) + return false + } + result, err := p.client.listByLocationHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current DeletedWebAppsListByLocationResponse page. +func (p *DeletedWebAppsListByLocationPager) PageResponse() DeletedWebAppsListByLocationResponse { + return p.current +} + +// DeletedWebAppsListPager provides operations for iterating over paged responses. +type DeletedWebAppsListPager struct { + client *DeletedWebAppsClient + current DeletedWebAppsListResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, DeletedWebAppsListResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *DeletedWebAppsListPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *DeletedWebAppsListPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.DeletedWebAppCollection.NextLink == nil || len(*p.current.DeletedWebAppCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listHandleError(resp) + return false + } + result, err := p.client.listHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current DeletedWebAppsListResponse page. +func (p *DeletedWebAppsListPager) PageResponse() DeletedWebAppsListResponse { + return p.current +} + +// DiagnosticsListHostingEnvironmentDetectorResponsesPager provides operations for iterating over paged responses. +type DiagnosticsListHostingEnvironmentDetectorResponsesPager struct { + client *DiagnosticsClient + current DiagnosticsListHostingEnvironmentDetectorResponsesResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, DiagnosticsListHostingEnvironmentDetectorResponsesResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *DiagnosticsListHostingEnvironmentDetectorResponsesPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *DiagnosticsListHostingEnvironmentDetectorResponsesPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.DetectorResponseCollection.NextLink == nil || len(*p.current.DetectorResponseCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listHostingEnvironmentDetectorResponsesHandleError(resp) + return false + } + result, err := p.client.listHostingEnvironmentDetectorResponsesHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current DiagnosticsListHostingEnvironmentDetectorResponsesResponse page. +func (p *DiagnosticsListHostingEnvironmentDetectorResponsesPager) PageResponse() DiagnosticsListHostingEnvironmentDetectorResponsesResponse { + return p.current +} + +// DiagnosticsListSiteAnalysesPager provides operations for iterating over paged responses. +type DiagnosticsListSiteAnalysesPager struct { + client *DiagnosticsClient + current DiagnosticsListSiteAnalysesResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, DiagnosticsListSiteAnalysesResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *DiagnosticsListSiteAnalysesPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *DiagnosticsListSiteAnalysesPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.DiagnosticAnalysisCollection.NextLink == nil || len(*p.current.DiagnosticAnalysisCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listSiteAnalysesHandleError(resp) + return false + } + result, err := p.client.listSiteAnalysesHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current DiagnosticsListSiteAnalysesResponse page. +func (p *DiagnosticsListSiteAnalysesPager) PageResponse() DiagnosticsListSiteAnalysesResponse { + return p.current +} + +// DiagnosticsListSiteAnalysesSlotPager provides operations for iterating over paged responses. +type DiagnosticsListSiteAnalysesSlotPager struct { + client *DiagnosticsClient + current DiagnosticsListSiteAnalysesSlotResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, DiagnosticsListSiteAnalysesSlotResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *DiagnosticsListSiteAnalysesSlotPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *DiagnosticsListSiteAnalysesSlotPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.DiagnosticAnalysisCollection.NextLink == nil || len(*p.current.DiagnosticAnalysisCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listSiteAnalysesSlotHandleError(resp) + return false + } + result, err := p.client.listSiteAnalysesSlotHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current DiagnosticsListSiteAnalysesSlotResponse page. +func (p *DiagnosticsListSiteAnalysesSlotPager) PageResponse() DiagnosticsListSiteAnalysesSlotResponse { + return p.current +} + +// DiagnosticsListSiteDetectorResponsesPager provides operations for iterating over paged responses. +type DiagnosticsListSiteDetectorResponsesPager struct { + client *DiagnosticsClient + current DiagnosticsListSiteDetectorResponsesResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, DiagnosticsListSiteDetectorResponsesResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *DiagnosticsListSiteDetectorResponsesPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *DiagnosticsListSiteDetectorResponsesPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.DetectorResponseCollection.NextLink == nil || len(*p.current.DetectorResponseCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listSiteDetectorResponsesHandleError(resp) + return false + } + result, err := p.client.listSiteDetectorResponsesHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current DiagnosticsListSiteDetectorResponsesResponse page. +func (p *DiagnosticsListSiteDetectorResponsesPager) PageResponse() DiagnosticsListSiteDetectorResponsesResponse { + return p.current +} + +// DiagnosticsListSiteDetectorResponsesSlotPager provides operations for iterating over paged responses. +type DiagnosticsListSiteDetectorResponsesSlotPager struct { + client *DiagnosticsClient + current DiagnosticsListSiteDetectorResponsesSlotResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, DiagnosticsListSiteDetectorResponsesSlotResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *DiagnosticsListSiteDetectorResponsesSlotPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *DiagnosticsListSiteDetectorResponsesSlotPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.DetectorResponseCollection.NextLink == nil || len(*p.current.DetectorResponseCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listSiteDetectorResponsesSlotHandleError(resp) + return false + } + result, err := p.client.listSiteDetectorResponsesSlotHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current DiagnosticsListSiteDetectorResponsesSlotResponse page. +func (p *DiagnosticsListSiteDetectorResponsesSlotPager) PageResponse() DiagnosticsListSiteDetectorResponsesSlotResponse { + return p.current +} + +// DiagnosticsListSiteDetectorsPager provides operations for iterating over paged responses. +type DiagnosticsListSiteDetectorsPager struct { + client *DiagnosticsClient + current DiagnosticsListSiteDetectorsResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, DiagnosticsListSiteDetectorsResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *DiagnosticsListSiteDetectorsPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *DiagnosticsListSiteDetectorsPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.DiagnosticDetectorCollection.NextLink == nil || len(*p.current.DiagnosticDetectorCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listSiteDetectorsHandleError(resp) + return false + } + result, err := p.client.listSiteDetectorsHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current DiagnosticsListSiteDetectorsResponse page. +func (p *DiagnosticsListSiteDetectorsPager) PageResponse() DiagnosticsListSiteDetectorsResponse { + return p.current +} + +// DiagnosticsListSiteDetectorsSlotPager provides operations for iterating over paged responses. +type DiagnosticsListSiteDetectorsSlotPager struct { + client *DiagnosticsClient + current DiagnosticsListSiteDetectorsSlotResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, DiagnosticsListSiteDetectorsSlotResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *DiagnosticsListSiteDetectorsSlotPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *DiagnosticsListSiteDetectorsSlotPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.DiagnosticDetectorCollection.NextLink == nil || len(*p.current.DiagnosticDetectorCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listSiteDetectorsSlotHandleError(resp) + return false + } + result, err := p.client.listSiteDetectorsSlotHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current DiagnosticsListSiteDetectorsSlotResponse page. +func (p *DiagnosticsListSiteDetectorsSlotPager) PageResponse() DiagnosticsListSiteDetectorsSlotResponse { + return p.current +} + +// DiagnosticsListSiteDiagnosticCategoriesPager provides operations for iterating over paged responses. +type DiagnosticsListSiteDiagnosticCategoriesPager struct { + client *DiagnosticsClient + current DiagnosticsListSiteDiagnosticCategoriesResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, DiagnosticsListSiteDiagnosticCategoriesResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *DiagnosticsListSiteDiagnosticCategoriesPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *DiagnosticsListSiteDiagnosticCategoriesPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.DiagnosticCategoryCollection.NextLink == nil || len(*p.current.DiagnosticCategoryCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listSiteDiagnosticCategoriesHandleError(resp) + return false + } + result, err := p.client.listSiteDiagnosticCategoriesHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current DiagnosticsListSiteDiagnosticCategoriesResponse page. +func (p *DiagnosticsListSiteDiagnosticCategoriesPager) PageResponse() DiagnosticsListSiteDiagnosticCategoriesResponse { + return p.current +} + +// DiagnosticsListSiteDiagnosticCategoriesSlotPager provides operations for iterating over paged responses. +type DiagnosticsListSiteDiagnosticCategoriesSlotPager struct { + client *DiagnosticsClient + current DiagnosticsListSiteDiagnosticCategoriesSlotResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, DiagnosticsListSiteDiagnosticCategoriesSlotResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *DiagnosticsListSiteDiagnosticCategoriesSlotPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *DiagnosticsListSiteDiagnosticCategoriesSlotPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.DiagnosticCategoryCollection.NextLink == nil || len(*p.current.DiagnosticCategoryCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listSiteDiagnosticCategoriesSlotHandleError(resp) + return false + } + result, err := p.client.listSiteDiagnosticCategoriesSlotHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current DiagnosticsListSiteDiagnosticCategoriesSlotResponse page. +func (p *DiagnosticsListSiteDiagnosticCategoriesSlotPager) PageResponse() DiagnosticsListSiteDiagnosticCategoriesSlotResponse { + return p.current +} + +// DomainRegistrationProviderListOperationsPager provides operations for iterating over paged responses. +type DomainRegistrationProviderListOperationsPager struct { + client *DomainRegistrationProviderClient + current DomainRegistrationProviderListOperationsResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, DomainRegistrationProviderListOperationsResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *DomainRegistrationProviderListOperationsPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *DomainRegistrationProviderListOperationsPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.CsmOperationCollection.NextLink == nil || len(*p.current.CsmOperationCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listOperationsHandleError(resp) + return false + } + result, err := p.client.listOperationsHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current DomainRegistrationProviderListOperationsResponse page. +func (p *DomainRegistrationProviderListOperationsPager) PageResponse() DomainRegistrationProviderListOperationsResponse { + return p.current +} + +// DomainsListByResourceGroupPager provides operations for iterating over paged responses. +type DomainsListByResourceGroupPager struct { + client *DomainsClient + current DomainsListByResourceGroupResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, DomainsListByResourceGroupResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *DomainsListByResourceGroupPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *DomainsListByResourceGroupPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.DomainCollection.NextLink == nil || len(*p.current.DomainCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listByResourceGroupHandleError(resp) + return false + } + result, err := p.client.listByResourceGroupHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current DomainsListByResourceGroupResponse page. +func (p *DomainsListByResourceGroupPager) PageResponse() DomainsListByResourceGroupResponse { + return p.current +} + +// DomainsListOwnershipIdentifiersPager provides operations for iterating over paged responses. +type DomainsListOwnershipIdentifiersPager struct { + client *DomainsClient + current DomainsListOwnershipIdentifiersResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, DomainsListOwnershipIdentifiersResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *DomainsListOwnershipIdentifiersPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *DomainsListOwnershipIdentifiersPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.DomainOwnershipIdentifierCollection.NextLink == nil || len(*p.current.DomainOwnershipIdentifierCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listOwnershipIdentifiersHandleError(resp) + return false + } + result, err := p.client.listOwnershipIdentifiersHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current DomainsListOwnershipIdentifiersResponse page. +func (p *DomainsListOwnershipIdentifiersPager) PageResponse() DomainsListOwnershipIdentifiersResponse { + return p.current +} + +// DomainsListPager provides operations for iterating over paged responses. +type DomainsListPager struct { + client *DomainsClient + current DomainsListResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, DomainsListResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *DomainsListPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *DomainsListPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.DomainCollection.NextLink == nil || len(*p.current.DomainCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listHandleError(resp) + return false + } + result, err := p.client.listHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current DomainsListResponse page. +func (p *DomainsListPager) PageResponse() DomainsListResponse { + return p.current +} + +// DomainsListRecommendationsPager provides operations for iterating over paged responses. +type DomainsListRecommendationsPager struct { + client *DomainsClient + current DomainsListRecommendationsResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, DomainsListRecommendationsResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *DomainsListRecommendationsPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *DomainsListRecommendationsPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.NameIdentifierCollection.NextLink == nil || len(*p.current.NameIdentifierCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listRecommendationsHandleError(resp) + return false + } + result, err := p.client.listRecommendationsHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current DomainsListRecommendationsResponse page. +func (p *DomainsListRecommendationsPager) PageResponse() DomainsListRecommendationsResponse { + return p.current +} + +// KubeEnvironmentsListByResourceGroupPager provides operations for iterating over paged responses. +type KubeEnvironmentsListByResourceGroupPager struct { + client *KubeEnvironmentsClient + current KubeEnvironmentsListByResourceGroupResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, KubeEnvironmentsListByResourceGroupResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *KubeEnvironmentsListByResourceGroupPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *KubeEnvironmentsListByResourceGroupPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.KubeEnvironmentCollection.NextLink == nil || len(*p.current.KubeEnvironmentCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listByResourceGroupHandleError(resp) + return false + } + result, err := p.client.listByResourceGroupHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current KubeEnvironmentsListByResourceGroupResponse page. +func (p *KubeEnvironmentsListByResourceGroupPager) PageResponse() KubeEnvironmentsListByResourceGroupResponse { + return p.current +} + +// KubeEnvironmentsListBySubscriptionPager provides operations for iterating over paged responses. +type KubeEnvironmentsListBySubscriptionPager struct { + client *KubeEnvironmentsClient + current KubeEnvironmentsListBySubscriptionResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, KubeEnvironmentsListBySubscriptionResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *KubeEnvironmentsListBySubscriptionPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *KubeEnvironmentsListBySubscriptionPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.KubeEnvironmentCollection.NextLink == nil || len(*p.current.KubeEnvironmentCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listBySubscriptionHandleError(resp) + return false + } + result, err := p.client.listBySubscriptionHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current KubeEnvironmentsListBySubscriptionResponse page. +func (p *KubeEnvironmentsListBySubscriptionPager) PageResponse() KubeEnvironmentsListBySubscriptionResponse { + return p.current +} + +// ProviderGetAvailableStacksOnPremPager provides operations for iterating over paged responses. +type ProviderGetAvailableStacksOnPremPager struct { + client *ProviderClient + current ProviderGetAvailableStacksOnPremResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, ProviderGetAvailableStacksOnPremResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *ProviderGetAvailableStacksOnPremPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *ProviderGetAvailableStacksOnPremPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.ApplicationStackCollection.NextLink == nil || len(*p.current.ApplicationStackCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.getAvailableStacksOnPremHandleError(resp) + return false + } + result, err := p.client.getAvailableStacksOnPremHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current ProviderGetAvailableStacksOnPremResponse page. +func (p *ProviderGetAvailableStacksOnPremPager) PageResponse() ProviderGetAvailableStacksOnPremResponse { + return p.current +} + +// ProviderGetAvailableStacksPager provides operations for iterating over paged responses. +type ProviderGetAvailableStacksPager struct { + client *ProviderClient + current ProviderGetAvailableStacksResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, ProviderGetAvailableStacksResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *ProviderGetAvailableStacksPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *ProviderGetAvailableStacksPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.ApplicationStackCollection.NextLink == nil || len(*p.current.ApplicationStackCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.getAvailableStacksHandleError(resp) + return false + } + result, err := p.client.getAvailableStacksHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current ProviderGetAvailableStacksResponse page. +func (p *ProviderGetAvailableStacksPager) PageResponse() ProviderGetAvailableStacksResponse { + return p.current +} + +// ProviderGetFunctionAppStacksForLocationPager provides operations for iterating over paged responses. +type ProviderGetFunctionAppStacksForLocationPager struct { + client *ProviderClient + current ProviderGetFunctionAppStacksForLocationResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, ProviderGetFunctionAppStacksForLocationResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *ProviderGetFunctionAppStacksForLocationPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *ProviderGetFunctionAppStacksForLocationPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.FunctionAppStackCollection.NextLink == nil || len(*p.current.FunctionAppStackCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.getFunctionAppStacksForLocationHandleError(resp) + return false + } + result, err := p.client.getFunctionAppStacksForLocationHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current ProviderGetFunctionAppStacksForLocationResponse page. +func (p *ProviderGetFunctionAppStacksForLocationPager) PageResponse() ProviderGetFunctionAppStacksForLocationResponse { + return p.current +} + +// ProviderGetFunctionAppStacksPager provides operations for iterating over paged responses. +type ProviderGetFunctionAppStacksPager struct { + client *ProviderClient + current ProviderGetFunctionAppStacksResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, ProviderGetFunctionAppStacksResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *ProviderGetFunctionAppStacksPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *ProviderGetFunctionAppStacksPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.FunctionAppStackCollection.NextLink == nil || len(*p.current.FunctionAppStackCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.getFunctionAppStacksHandleError(resp) + return false + } + result, err := p.client.getFunctionAppStacksHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current ProviderGetFunctionAppStacksResponse page. +func (p *ProviderGetFunctionAppStacksPager) PageResponse() ProviderGetFunctionAppStacksResponse { + return p.current +} + +// ProviderGetWebAppStacksForLocationPager provides operations for iterating over paged responses. +type ProviderGetWebAppStacksForLocationPager struct { + client *ProviderClient + current ProviderGetWebAppStacksForLocationResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, ProviderGetWebAppStacksForLocationResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *ProviderGetWebAppStacksForLocationPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *ProviderGetWebAppStacksForLocationPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.WebAppStackCollection.NextLink == nil || len(*p.current.WebAppStackCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.getWebAppStacksForLocationHandleError(resp) + return false + } + result, err := p.client.getWebAppStacksForLocationHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current ProviderGetWebAppStacksForLocationResponse page. +func (p *ProviderGetWebAppStacksForLocationPager) PageResponse() ProviderGetWebAppStacksForLocationResponse { + return p.current +} + +// ProviderGetWebAppStacksPager provides operations for iterating over paged responses. +type ProviderGetWebAppStacksPager struct { + client *ProviderClient + current ProviderGetWebAppStacksResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, ProviderGetWebAppStacksResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *ProviderGetWebAppStacksPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *ProviderGetWebAppStacksPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.WebAppStackCollection.NextLink == nil || len(*p.current.WebAppStackCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.getWebAppStacksHandleError(resp) + return false + } + result, err := p.client.getWebAppStacksHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current ProviderGetWebAppStacksResponse page. +func (p *ProviderGetWebAppStacksPager) PageResponse() ProviderGetWebAppStacksResponse { + return p.current +} + +// ProviderListOperationsPager provides operations for iterating over paged responses. +type ProviderListOperationsPager struct { + client *ProviderClient + current ProviderListOperationsResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, ProviderListOperationsResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *ProviderListOperationsPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *ProviderListOperationsPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.CsmOperationCollection.NextLink == nil || len(*p.current.CsmOperationCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listOperationsHandleError(resp) + return false + } + result, err := p.client.listOperationsHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current ProviderListOperationsResponse page. +func (p *ProviderListOperationsPager) PageResponse() ProviderListOperationsResponse { + return p.current +} + +// RecommendationsListHistoryForHostingEnvironmentPager provides operations for iterating over paged responses. +type RecommendationsListHistoryForHostingEnvironmentPager struct { + client *RecommendationsClient + current RecommendationsListHistoryForHostingEnvironmentResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, RecommendationsListHistoryForHostingEnvironmentResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *RecommendationsListHistoryForHostingEnvironmentPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *RecommendationsListHistoryForHostingEnvironmentPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.RecommendationCollection.NextLink == nil || len(*p.current.RecommendationCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listHistoryForHostingEnvironmentHandleError(resp) + return false + } + result, err := p.client.listHistoryForHostingEnvironmentHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current RecommendationsListHistoryForHostingEnvironmentResponse page. +func (p *RecommendationsListHistoryForHostingEnvironmentPager) PageResponse() RecommendationsListHistoryForHostingEnvironmentResponse { + return p.current +} + +// RecommendationsListHistoryForWebAppPager provides operations for iterating over paged responses. +type RecommendationsListHistoryForWebAppPager struct { + client *RecommendationsClient + current RecommendationsListHistoryForWebAppResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, RecommendationsListHistoryForWebAppResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *RecommendationsListHistoryForWebAppPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *RecommendationsListHistoryForWebAppPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.RecommendationCollection.NextLink == nil || len(*p.current.RecommendationCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listHistoryForWebAppHandleError(resp) + return false + } + result, err := p.client.listHistoryForWebAppHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current RecommendationsListHistoryForWebAppResponse page. +func (p *RecommendationsListHistoryForWebAppPager) PageResponse() RecommendationsListHistoryForWebAppResponse { + return p.current +} + +// RecommendationsListPager provides operations for iterating over paged responses. +type RecommendationsListPager struct { + client *RecommendationsClient + current RecommendationsListResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, RecommendationsListResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *RecommendationsListPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *RecommendationsListPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.RecommendationCollection.NextLink == nil || len(*p.current.RecommendationCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listHandleError(resp) + return false + } + result, err := p.client.listHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current RecommendationsListResponse page. +func (p *RecommendationsListPager) PageResponse() RecommendationsListResponse { + return p.current +} + +// RecommendationsListRecommendedRulesForHostingEnvironmentPager provides operations for iterating over paged responses. +type RecommendationsListRecommendedRulesForHostingEnvironmentPager struct { + client *RecommendationsClient + current RecommendationsListRecommendedRulesForHostingEnvironmentResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, RecommendationsListRecommendedRulesForHostingEnvironmentResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *RecommendationsListRecommendedRulesForHostingEnvironmentPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *RecommendationsListRecommendedRulesForHostingEnvironmentPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.RecommendationCollection.NextLink == nil || len(*p.current.RecommendationCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listRecommendedRulesForHostingEnvironmentHandleError(resp) + return false + } + result, err := p.client.listRecommendedRulesForHostingEnvironmentHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current RecommendationsListRecommendedRulesForHostingEnvironmentResponse page. +func (p *RecommendationsListRecommendedRulesForHostingEnvironmentPager) PageResponse() RecommendationsListRecommendedRulesForHostingEnvironmentResponse { + return p.current +} + +// RecommendationsListRecommendedRulesForWebAppPager provides operations for iterating over paged responses. +type RecommendationsListRecommendedRulesForWebAppPager struct { + client *RecommendationsClient + current RecommendationsListRecommendedRulesForWebAppResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, RecommendationsListRecommendedRulesForWebAppResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *RecommendationsListRecommendedRulesForWebAppPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *RecommendationsListRecommendedRulesForWebAppPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.RecommendationCollection.NextLink == nil || len(*p.current.RecommendationCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listRecommendedRulesForWebAppHandleError(resp) + return false + } + result, err := p.client.listRecommendedRulesForWebAppHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current RecommendationsListRecommendedRulesForWebAppResponse page. +func (p *RecommendationsListRecommendedRulesForWebAppPager) PageResponse() RecommendationsListRecommendedRulesForWebAppResponse { + return p.current +} + +// ResourceHealthMetadataListByResourceGroupPager provides operations for iterating over paged responses. +type ResourceHealthMetadataListByResourceGroupPager struct { + client *ResourceHealthMetadataClient + current ResourceHealthMetadataListByResourceGroupResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, ResourceHealthMetadataListByResourceGroupResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *ResourceHealthMetadataListByResourceGroupPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *ResourceHealthMetadataListByResourceGroupPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.ResourceHealthMetadataCollection.NextLink == nil || len(*p.current.ResourceHealthMetadataCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listByResourceGroupHandleError(resp) + return false + } + result, err := p.client.listByResourceGroupHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current ResourceHealthMetadataListByResourceGroupResponse page. +func (p *ResourceHealthMetadataListByResourceGroupPager) PageResponse() ResourceHealthMetadataListByResourceGroupResponse { + return p.current +} + +// ResourceHealthMetadataListBySitePager provides operations for iterating over paged responses. +type ResourceHealthMetadataListBySitePager struct { + client *ResourceHealthMetadataClient + current ResourceHealthMetadataListBySiteResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, ResourceHealthMetadataListBySiteResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *ResourceHealthMetadataListBySitePager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *ResourceHealthMetadataListBySitePager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.ResourceHealthMetadataCollection.NextLink == nil || len(*p.current.ResourceHealthMetadataCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listBySiteHandleError(resp) + return false + } + result, err := p.client.listBySiteHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current ResourceHealthMetadataListBySiteResponse page. +func (p *ResourceHealthMetadataListBySitePager) PageResponse() ResourceHealthMetadataListBySiteResponse { + return p.current +} + +// ResourceHealthMetadataListBySiteSlotPager provides operations for iterating over paged responses. +type ResourceHealthMetadataListBySiteSlotPager struct { + client *ResourceHealthMetadataClient + current ResourceHealthMetadataListBySiteSlotResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, ResourceHealthMetadataListBySiteSlotResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *ResourceHealthMetadataListBySiteSlotPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *ResourceHealthMetadataListBySiteSlotPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.ResourceHealthMetadataCollection.NextLink == nil || len(*p.current.ResourceHealthMetadataCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listBySiteSlotHandleError(resp) + return false + } + result, err := p.client.listBySiteSlotHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current ResourceHealthMetadataListBySiteSlotResponse page. +func (p *ResourceHealthMetadataListBySiteSlotPager) PageResponse() ResourceHealthMetadataListBySiteSlotResponse { + return p.current +} + +// ResourceHealthMetadataListPager provides operations for iterating over paged responses. +type ResourceHealthMetadataListPager struct { + client *ResourceHealthMetadataClient + current ResourceHealthMetadataListResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, ResourceHealthMetadataListResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *ResourceHealthMetadataListPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *ResourceHealthMetadataListPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.ResourceHealthMetadataCollection.NextLink == nil || len(*p.current.ResourceHealthMetadataCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listHandleError(resp) + return false + } + result, err := p.client.listHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current ResourceHealthMetadataListResponse page. +func (p *ResourceHealthMetadataListPager) PageResponse() ResourceHealthMetadataListResponse { + return p.current +} + +// StaticSitesGetPrivateEndpointConnectionListPager provides operations for iterating over paged responses. +type StaticSitesGetPrivateEndpointConnectionListPager struct { + client *StaticSitesClient + current StaticSitesGetPrivateEndpointConnectionListResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, StaticSitesGetPrivateEndpointConnectionListResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *StaticSitesGetPrivateEndpointConnectionListPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *StaticSitesGetPrivateEndpointConnectionListPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.PrivateEndpointConnectionCollection.NextLink == nil || len(*p.current.PrivateEndpointConnectionCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.getPrivateEndpointConnectionListHandleError(resp) + return false + } + result, err := p.client.getPrivateEndpointConnectionListHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current StaticSitesGetPrivateEndpointConnectionListResponse page. +func (p *StaticSitesGetPrivateEndpointConnectionListPager) PageResponse() StaticSitesGetPrivateEndpointConnectionListResponse { + return p.current +} + +// StaticSitesGetStaticSiteBuildsPager provides operations for iterating over paged responses. +type StaticSitesGetStaticSiteBuildsPager struct { + client *StaticSitesClient + current StaticSitesGetStaticSiteBuildsResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, StaticSitesGetStaticSiteBuildsResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *StaticSitesGetStaticSiteBuildsPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *StaticSitesGetStaticSiteBuildsPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.StaticSiteBuildCollection.NextLink == nil || len(*p.current.StaticSiteBuildCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.getStaticSiteBuildsHandleError(resp) + return false + } + result, err := p.client.getStaticSiteBuildsHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current StaticSitesGetStaticSiteBuildsResponse page. +func (p *StaticSitesGetStaticSiteBuildsPager) PageResponse() StaticSitesGetStaticSiteBuildsResponse { + return p.current +} + +// StaticSitesGetStaticSitesByResourceGroupPager provides operations for iterating over paged responses. +type StaticSitesGetStaticSitesByResourceGroupPager struct { + client *StaticSitesClient + current StaticSitesGetStaticSitesByResourceGroupResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, StaticSitesGetStaticSitesByResourceGroupResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *StaticSitesGetStaticSitesByResourceGroupPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *StaticSitesGetStaticSitesByResourceGroupPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.StaticSiteCollection.NextLink == nil || len(*p.current.StaticSiteCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.getStaticSitesByResourceGroupHandleError(resp) + return false + } + result, err := p.client.getStaticSitesByResourceGroupHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current StaticSitesGetStaticSitesByResourceGroupResponse page. +func (p *StaticSitesGetStaticSitesByResourceGroupPager) PageResponse() StaticSitesGetStaticSitesByResourceGroupResponse { + return p.current +} + +// StaticSitesGetUserProvidedFunctionAppsForStaticSiteBuildPager provides operations for iterating over paged responses. +type StaticSitesGetUserProvidedFunctionAppsForStaticSiteBuildPager struct { + client *StaticSitesClient + current StaticSitesGetUserProvidedFunctionAppsForStaticSiteBuildResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, StaticSitesGetUserProvidedFunctionAppsForStaticSiteBuildResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *StaticSitesGetUserProvidedFunctionAppsForStaticSiteBuildPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *StaticSitesGetUserProvidedFunctionAppsForStaticSiteBuildPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.StaticSiteUserProvidedFunctionAppsCollection.NextLink == nil || len(*p.current.StaticSiteUserProvidedFunctionAppsCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.getUserProvidedFunctionAppsForStaticSiteBuildHandleError(resp) + return false + } + result, err := p.client.getUserProvidedFunctionAppsForStaticSiteBuildHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current StaticSitesGetUserProvidedFunctionAppsForStaticSiteBuildResponse page. +func (p *StaticSitesGetUserProvidedFunctionAppsForStaticSiteBuildPager) PageResponse() StaticSitesGetUserProvidedFunctionAppsForStaticSiteBuildResponse { + return p.current +} + +// StaticSitesGetUserProvidedFunctionAppsForStaticSitePager provides operations for iterating over paged responses. +type StaticSitesGetUserProvidedFunctionAppsForStaticSitePager struct { + client *StaticSitesClient + current StaticSitesGetUserProvidedFunctionAppsForStaticSiteResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, StaticSitesGetUserProvidedFunctionAppsForStaticSiteResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *StaticSitesGetUserProvidedFunctionAppsForStaticSitePager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *StaticSitesGetUserProvidedFunctionAppsForStaticSitePager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.StaticSiteUserProvidedFunctionAppsCollection.NextLink == nil || len(*p.current.StaticSiteUserProvidedFunctionAppsCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.getUserProvidedFunctionAppsForStaticSiteHandleError(resp) + return false + } + result, err := p.client.getUserProvidedFunctionAppsForStaticSiteHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current StaticSitesGetUserProvidedFunctionAppsForStaticSiteResponse page. +func (p *StaticSitesGetUserProvidedFunctionAppsForStaticSitePager) PageResponse() StaticSitesGetUserProvidedFunctionAppsForStaticSiteResponse { + return p.current +} + +// StaticSitesListPager provides operations for iterating over paged responses. +type StaticSitesListPager struct { + client *StaticSitesClient + current StaticSitesListResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, StaticSitesListResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *StaticSitesListPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *StaticSitesListPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.StaticSiteCollection.NextLink == nil || len(*p.current.StaticSiteCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listHandleError(resp) + return false + } + result, err := p.client.listHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current StaticSitesListResponse page. +func (p *StaticSitesListPager) PageResponse() StaticSitesListResponse { + return p.current +} + +// StaticSitesListStaticSiteBuildFunctionsPager provides operations for iterating over paged responses. +type StaticSitesListStaticSiteBuildFunctionsPager struct { + client *StaticSitesClient + current StaticSitesListStaticSiteBuildFunctionsResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, StaticSitesListStaticSiteBuildFunctionsResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *StaticSitesListStaticSiteBuildFunctionsPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *StaticSitesListStaticSiteBuildFunctionsPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.StaticSiteFunctionOverviewCollection.NextLink == nil || len(*p.current.StaticSiteFunctionOverviewCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listStaticSiteBuildFunctionsHandleError(resp) + return false + } + result, err := p.client.listStaticSiteBuildFunctionsHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current StaticSitesListStaticSiteBuildFunctionsResponse page. +func (p *StaticSitesListStaticSiteBuildFunctionsPager) PageResponse() StaticSitesListStaticSiteBuildFunctionsResponse { + return p.current +} + +// StaticSitesListStaticSiteCustomDomainsPager provides operations for iterating over paged responses. +type StaticSitesListStaticSiteCustomDomainsPager struct { + client *StaticSitesClient + current StaticSitesListStaticSiteCustomDomainsResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, StaticSitesListStaticSiteCustomDomainsResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *StaticSitesListStaticSiteCustomDomainsPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *StaticSitesListStaticSiteCustomDomainsPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.StaticSiteCustomDomainOverviewCollection.NextLink == nil || len(*p.current.StaticSiteCustomDomainOverviewCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listStaticSiteCustomDomainsHandleError(resp) + return false + } + result, err := p.client.listStaticSiteCustomDomainsHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current StaticSitesListStaticSiteCustomDomainsResponse page. +func (p *StaticSitesListStaticSiteCustomDomainsPager) PageResponse() StaticSitesListStaticSiteCustomDomainsResponse { + return p.current +} + +// StaticSitesListStaticSiteFunctionsPager provides operations for iterating over paged responses. +type StaticSitesListStaticSiteFunctionsPager struct { + client *StaticSitesClient + current StaticSitesListStaticSiteFunctionsResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, StaticSitesListStaticSiteFunctionsResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *StaticSitesListStaticSiteFunctionsPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *StaticSitesListStaticSiteFunctionsPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.StaticSiteFunctionOverviewCollection.NextLink == nil || len(*p.current.StaticSiteFunctionOverviewCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listStaticSiteFunctionsHandleError(resp) + return false + } + result, err := p.client.listStaticSiteFunctionsHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current StaticSitesListStaticSiteFunctionsResponse page. +func (p *StaticSitesListStaticSiteFunctionsPager) PageResponse() StaticSitesListStaticSiteFunctionsResponse { + return p.current +} + +// StaticSitesListStaticSiteUsersPager provides operations for iterating over paged responses. +type StaticSitesListStaticSiteUsersPager struct { + client *StaticSitesClient + current StaticSitesListStaticSiteUsersResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, StaticSitesListStaticSiteUsersResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *StaticSitesListStaticSiteUsersPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *StaticSitesListStaticSiteUsersPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.StaticSiteUserCollection.NextLink == nil || len(*p.current.StaticSiteUserCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listStaticSiteUsersHandleError(resp) + return false + } + result, err := p.client.listStaticSiteUsersHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current StaticSitesListStaticSiteUsersResponse page. +func (p *StaticSitesListStaticSiteUsersPager) PageResponse() StaticSitesListStaticSiteUsersResponse { + return p.current +} + +// TopLevelDomainsListAgreementsPager provides operations for iterating over paged responses. +type TopLevelDomainsListAgreementsPager struct { + client *TopLevelDomainsClient + current TopLevelDomainsListAgreementsResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, TopLevelDomainsListAgreementsResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *TopLevelDomainsListAgreementsPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *TopLevelDomainsListAgreementsPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.TldLegalAgreementCollection.NextLink == nil || len(*p.current.TldLegalAgreementCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listAgreementsHandleError(resp) + return false + } + result, err := p.client.listAgreementsHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current TopLevelDomainsListAgreementsResponse page. +func (p *TopLevelDomainsListAgreementsPager) PageResponse() TopLevelDomainsListAgreementsResponse { + return p.current +} + +// TopLevelDomainsListPager provides operations for iterating over paged responses. +type TopLevelDomainsListPager struct { + client *TopLevelDomainsClient + current TopLevelDomainsListResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, TopLevelDomainsListResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *TopLevelDomainsListPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *TopLevelDomainsListPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.TopLevelDomainCollection.NextLink == nil || len(*p.current.TopLevelDomainCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listHandleError(resp) + return false + } + result, err := p.client.listHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current TopLevelDomainsListResponse page. +func (p *TopLevelDomainsListPager) PageResponse() TopLevelDomainsListResponse { + return p.current +} + +// WebAppsGetAppSettingsKeyVaultReferencesPager provides operations for iterating over paged responses. +type WebAppsGetAppSettingsKeyVaultReferencesPager struct { + client *WebAppsClient + current WebAppsGetAppSettingsKeyVaultReferencesResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, WebAppsGetAppSettingsKeyVaultReferencesResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *WebAppsGetAppSettingsKeyVaultReferencesPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *WebAppsGetAppSettingsKeyVaultReferencesPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.APIKVReferenceCollection.NextLink == nil || len(*p.current.APIKVReferenceCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.getAppSettingsKeyVaultReferencesHandleError(resp) + return false + } + result, err := p.client.getAppSettingsKeyVaultReferencesHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current WebAppsGetAppSettingsKeyVaultReferencesResponse page. +func (p *WebAppsGetAppSettingsKeyVaultReferencesPager) PageResponse() WebAppsGetAppSettingsKeyVaultReferencesResponse { + return p.current +} + +// WebAppsGetAppSettingsKeyVaultReferencesSlotPager provides operations for iterating over paged responses. +type WebAppsGetAppSettingsKeyVaultReferencesSlotPager struct { + client *WebAppsClient + current WebAppsGetAppSettingsKeyVaultReferencesSlotResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, WebAppsGetAppSettingsKeyVaultReferencesSlotResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *WebAppsGetAppSettingsKeyVaultReferencesSlotPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *WebAppsGetAppSettingsKeyVaultReferencesSlotPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.APIKVReferenceCollection.NextLink == nil || len(*p.current.APIKVReferenceCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.getAppSettingsKeyVaultReferencesSlotHandleError(resp) + return false + } + result, err := p.client.getAppSettingsKeyVaultReferencesSlotHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current WebAppsGetAppSettingsKeyVaultReferencesSlotResponse page. +func (p *WebAppsGetAppSettingsKeyVaultReferencesSlotPager) PageResponse() WebAppsGetAppSettingsKeyVaultReferencesSlotResponse { + return p.current +} + +// WebAppsGetPrivateEndpointConnectionListPager provides operations for iterating over paged responses. +type WebAppsGetPrivateEndpointConnectionListPager struct { + client *WebAppsClient + current WebAppsGetPrivateEndpointConnectionListResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, WebAppsGetPrivateEndpointConnectionListResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *WebAppsGetPrivateEndpointConnectionListPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *WebAppsGetPrivateEndpointConnectionListPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.PrivateEndpointConnectionCollection.NextLink == nil || len(*p.current.PrivateEndpointConnectionCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.getPrivateEndpointConnectionListHandleError(resp) + return false + } + result, err := p.client.getPrivateEndpointConnectionListHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current WebAppsGetPrivateEndpointConnectionListResponse page. +func (p *WebAppsGetPrivateEndpointConnectionListPager) PageResponse() WebAppsGetPrivateEndpointConnectionListResponse { + return p.current +} + +// WebAppsGetPrivateEndpointConnectionListSlotPager provides operations for iterating over paged responses. +type WebAppsGetPrivateEndpointConnectionListSlotPager struct { + client *WebAppsClient + current WebAppsGetPrivateEndpointConnectionListSlotResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, WebAppsGetPrivateEndpointConnectionListSlotResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *WebAppsGetPrivateEndpointConnectionListSlotPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *WebAppsGetPrivateEndpointConnectionListSlotPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.PrivateEndpointConnectionCollection.NextLink == nil || len(*p.current.PrivateEndpointConnectionCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.getPrivateEndpointConnectionListSlotHandleError(resp) + return false + } + result, err := p.client.getPrivateEndpointConnectionListSlotHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current WebAppsGetPrivateEndpointConnectionListSlotResponse page. +func (p *WebAppsGetPrivateEndpointConnectionListSlotPager) PageResponse() WebAppsGetPrivateEndpointConnectionListSlotResponse { + return p.current +} + +// WebAppsGetSiteConnectionStringKeyVaultReferencesPager provides operations for iterating over paged responses. +type WebAppsGetSiteConnectionStringKeyVaultReferencesPager struct { + client *WebAppsClient + current WebAppsGetSiteConnectionStringKeyVaultReferencesResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, WebAppsGetSiteConnectionStringKeyVaultReferencesResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *WebAppsGetSiteConnectionStringKeyVaultReferencesPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *WebAppsGetSiteConnectionStringKeyVaultReferencesPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.APIKVReferenceCollection.NextLink == nil || len(*p.current.APIKVReferenceCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.getSiteConnectionStringKeyVaultReferencesHandleError(resp) + return false + } + result, err := p.client.getSiteConnectionStringKeyVaultReferencesHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current WebAppsGetSiteConnectionStringKeyVaultReferencesResponse page. +func (p *WebAppsGetSiteConnectionStringKeyVaultReferencesPager) PageResponse() WebAppsGetSiteConnectionStringKeyVaultReferencesResponse { + return p.current +} + +// WebAppsGetSiteConnectionStringKeyVaultReferencesSlotPager provides operations for iterating over paged responses. +type WebAppsGetSiteConnectionStringKeyVaultReferencesSlotPager struct { + client *WebAppsClient + current WebAppsGetSiteConnectionStringKeyVaultReferencesSlotResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, WebAppsGetSiteConnectionStringKeyVaultReferencesSlotResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *WebAppsGetSiteConnectionStringKeyVaultReferencesSlotPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *WebAppsGetSiteConnectionStringKeyVaultReferencesSlotPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.APIKVReferenceCollection.NextLink == nil || len(*p.current.APIKVReferenceCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.getSiteConnectionStringKeyVaultReferencesSlotHandleError(resp) + return false + } + result, err := p.client.getSiteConnectionStringKeyVaultReferencesSlotHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current WebAppsGetSiteConnectionStringKeyVaultReferencesSlotResponse page. +func (p *WebAppsGetSiteConnectionStringKeyVaultReferencesSlotPager) PageResponse() WebAppsGetSiteConnectionStringKeyVaultReferencesSlotResponse { + return p.current +} + +// WebAppsListBackupsPager provides operations for iterating over paged responses. +type WebAppsListBackupsPager struct { + client *WebAppsClient + current WebAppsListBackupsResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, WebAppsListBackupsResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *WebAppsListBackupsPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *WebAppsListBackupsPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.BackupItemCollection.NextLink == nil || len(*p.current.BackupItemCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listBackupsHandleError(resp) + return false + } + result, err := p.client.listBackupsHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current WebAppsListBackupsResponse page. +func (p *WebAppsListBackupsPager) PageResponse() WebAppsListBackupsResponse { + return p.current +} + +// WebAppsListBackupsSlotPager provides operations for iterating over paged responses. +type WebAppsListBackupsSlotPager struct { + client *WebAppsClient + current WebAppsListBackupsSlotResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, WebAppsListBackupsSlotResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *WebAppsListBackupsSlotPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *WebAppsListBackupsSlotPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.BackupItemCollection.NextLink == nil || len(*p.current.BackupItemCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listBackupsSlotHandleError(resp) + return false + } + result, err := p.client.listBackupsSlotHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current WebAppsListBackupsSlotResponse page. +func (p *WebAppsListBackupsSlotPager) PageResponse() WebAppsListBackupsSlotResponse { + return p.current +} + +// WebAppsListBasicPublishingCredentialsPoliciesPager provides operations for iterating over paged responses. +type WebAppsListBasicPublishingCredentialsPoliciesPager struct { + client *WebAppsClient + current WebAppsListBasicPublishingCredentialsPoliciesResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, WebAppsListBasicPublishingCredentialsPoliciesResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *WebAppsListBasicPublishingCredentialsPoliciesPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *WebAppsListBasicPublishingCredentialsPoliciesPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.PublishingCredentialsPoliciesCollection.NextLink == nil || len(*p.current.PublishingCredentialsPoliciesCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listBasicPublishingCredentialsPoliciesHandleError(resp) + return false + } + result, err := p.client.listBasicPublishingCredentialsPoliciesHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current WebAppsListBasicPublishingCredentialsPoliciesResponse page. +func (p *WebAppsListBasicPublishingCredentialsPoliciesPager) PageResponse() WebAppsListBasicPublishingCredentialsPoliciesResponse { + return p.current +} + +// WebAppsListBasicPublishingCredentialsPoliciesSlotPager provides operations for iterating over paged responses. +type WebAppsListBasicPublishingCredentialsPoliciesSlotPager struct { + client *WebAppsClient + current WebAppsListBasicPublishingCredentialsPoliciesSlotResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, WebAppsListBasicPublishingCredentialsPoliciesSlotResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *WebAppsListBasicPublishingCredentialsPoliciesSlotPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *WebAppsListBasicPublishingCredentialsPoliciesSlotPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.PublishingCredentialsPoliciesCollection.NextLink == nil || len(*p.current.PublishingCredentialsPoliciesCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listBasicPublishingCredentialsPoliciesSlotHandleError(resp) + return false + } + result, err := p.client.listBasicPublishingCredentialsPoliciesSlotHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current WebAppsListBasicPublishingCredentialsPoliciesSlotResponse page. +func (p *WebAppsListBasicPublishingCredentialsPoliciesSlotPager) PageResponse() WebAppsListBasicPublishingCredentialsPoliciesSlotResponse { + return p.current +} + +// WebAppsListByResourceGroupPager provides operations for iterating over paged responses. +type WebAppsListByResourceGroupPager struct { + client *WebAppsClient + current WebAppsListByResourceGroupResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, WebAppsListByResourceGroupResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *WebAppsListByResourceGroupPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *WebAppsListByResourceGroupPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.WebAppCollection.NextLink == nil || len(*p.current.WebAppCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listByResourceGroupHandleError(resp) + return false + } + result, err := p.client.listByResourceGroupHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current WebAppsListByResourceGroupResponse page. +func (p *WebAppsListByResourceGroupPager) PageResponse() WebAppsListByResourceGroupResponse { + return p.current +} + +// WebAppsListConfigurationSnapshotInfoPager provides operations for iterating over paged responses. +type WebAppsListConfigurationSnapshotInfoPager struct { + client *WebAppsClient + current WebAppsListConfigurationSnapshotInfoResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, WebAppsListConfigurationSnapshotInfoResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *WebAppsListConfigurationSnapshotInfoPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *WebAppsListConfigurationSnapshotInfoPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.SiteConfigurationSnapshotInfoCollection.NextLink == nil || len(*p.current.SiteConfigurationSnapshotInfoCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listConfigurationSnapshotInfoHandleError(resp) + return false + } + result, err := p.client.listConfigurationSnapshotInfoHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current WebAppsListConfigurationSnapshotInfoResponse page. +func (p *WebAppsListConfigurationSnapshotInfoPager) PageResponse() WebAppsListConfigurationSnapshotInfoResponse { + return p.current +} + +// WebAppsListConfigurationSnapshotInfoSlotPager provides operations for iterating over paged responses. +type WebAppsListConfigurationSnapshotInfoSlotPager struct { + client *WebAppsClient + current WebAppsListConfigurationSnapshotInfoSlotResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, WebAppsListConfigurationSnapshotInfoSlotResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *WebAppsListConfigurationSnapshotInfoSlotPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *WebAppsListConfigurationSnapshotInfoSlotPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.SiteConfigurationSnapshotInfoCollection.NextLink == nil || len(*p.current.SiteConfigurationSnapshotInfoCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listConfigurationSnapshotInfoSlotHandleError(resp) + return false + } + result, err := p.client.listConfigurationSnapshotInfoSlotHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current WebAppsListConfigurationSnapshotInfoSlotResponse page. +func (p *WebAppsListConfigurationSnapshotInfoSlotPager) PageResponse() WebAppsListConfigurationSnapshotInfoSlotResponse { + return p.current +} + +// WebAppsListConfigurationsPager provides operations for iterating over paged responses. +type WebAppsListConfigurationsPager struct { + client *WebAppsClient + current WebAppsListConfigurationsResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, WebAppsListConfigurationsResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *WebAppsListConfigurationsPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *WebAppsListConfigurationsPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.SiteConfigResourceCollection.NextLink == nil || len(*p.current.SiteConfigResourceCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listConfigurationsHandleError(resp) + return false + } + result, err := p.client.listConfigurationsHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current WebAppsListConfigurationsResponse page. +func (p *WebAppsListConfigurationsPager) PageResponse() WebAppsListConfigurationsResponse { + return p.current +} + +// WebAppsListConfigurationsSlotPager provides operations for iterating over paged responses. +type WebAppsListConfigurationsSlotPager struct { + client *WebAppsClient + current WebAppsListConfigurationsSlotResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, WebAppsListConfigurationsSlotResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *WebAppsListConfigurationsSlotPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *WebAppsListConfigurationsSlotPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.SiteConfigResourceCollection.NextLink == nil || len(*p.current.SiteConfigResourceCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listConfigurationsSlotHandleError(resp) + return false + } + result, err := p.client.listConfigurationsSlotHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current WebAppsListConfigurationsSlotResponse page. +func (p *WebAppsListConfigurationsSlotPager) PageResponse() WebAppsListConfigurationsSlotResponse { + return p.current +} + +// WebAppsListContinuousWebJobsPager provides operations for iterating over paged responses. +type WebAppsListContinuousWebJobsPager struct { + client *WebAppsClient + current WebAppsListContinuousWebJobsResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, WebAppsListContinuousWebJobsResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *WebAppsListContinuousWebJobsPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *WebAppsListContinuousWebJobsPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.ContinuousWebJobCollection.NextLink == nil || len(*p.current.ContinuousWebJobCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listContinuousWebJobsHandleError(resp) + return false + } + result, err := p.client.listContinuousWebJobsHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current WebAppsListContinuousWebJobsResponse page. +func (p *WebAppsListContinuousWebJobsPager) PageResponse() WebAppsListContinuousWebJobsResponse { + return p.current +} + +// WebAppsListContinuousWebJobsSlotPager provides operations for iterating over paged responses. +type WebAppsListContinuousWebJobsSlotPager struct { + client *WebAppsClient + current WebAppsListContinuousWebJobsSlotResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, WebAppsListContinuousWebJobsSlotResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *WebAppsListContinuousWebJobsSlotPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *WebAppsListContinuousWebJobsSlotPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.ContinuousWebJobCollection.NextLink == nil || len(*p.current.ContinuousWebJobCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listContinuousWebJobsSlotHandleError(resp) + return false + } + result, err := p.client.listContinuousWebJobsSlotHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current WebAppsListContinuousWebJobsSlotResponse page. +func (p *WebAppsListContinuousWebJobsSlotPager) PageResponse() WebAppsListContinuousWebJobsSlotResponse { + return p.current +} + +// WebAppsListDeploymentsPager provides operations for iterating over paged responses. +type WebAppsListDeploymentsPager struct { + client *WebAppsClient + current WebAppsListDeploymentsResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, WebAppsListDeploymentsResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *WebAppsListDeploymentsPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *WebAppsListDeploymentsPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.DeploymentCollection.NextLink == nil || len(*p.current.DeploymentCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listDeploymentsHandleError(resp) + return false + } + result, err := p.client.listDeploymentsHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current WebAppsListDeploymentsResponse page. +func (p *WebAppsListDeploymentsPager) PageResponse() WebAppsListDeploymentsResponse { + return p.current +} + +// WebAppsListDeploymentsSlotPager provides operations for iterating over paged responses. +type WebAppsListDeploymentsSlotPager struct { + client *WebAppsClient + current WebAppsListDeploymentsSlotResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, WebAppsListDeploymentsSlotResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *WebAppsListDeploymentsSlotPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *WebAppsListDeploymentsSlotPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.DeploymentCollection.NextLink == nil || len(*p.current.DeploymentCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listDeploymentsSlotHandleError(resp) + return false + } + result, err := p.client.listDeploymentsSlotHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current WebAppsListDeploymentsSlotResponse page. +func (p *WebAppsListDeploymentsSlotPager) PageResponse() WebAppsListDeploymentsSlotResponse { + return p.current +} + +// WebAppsListDomainOwnershipIdentifiersPager provides operations for iterating over paged responses. +type WebAppsListDomainOwnershipIdentifiersPager struct { + client *WebAppsClient + current WebAppsListDomainOwnershipIdentifiersResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, WebAppsListDomainOwnershipIdentifiersResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *WebAppsListDomainOwnershipIdentifiersPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *WebAppsListDomainOwnershipIdentifiersPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.IdentifierCollection.NextLink == nil || len(*p.current.IdentifierCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listDomainOwnershipIdentifiersHandleError(resp) + return false + } + result, err := p.client.listDomainOwnershipIdentifiersHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current WebAppsListDomainOwnershipIdentifiersResponse page. +func (p *WebAppsListDomainOwnershipIdentifiersPager) PageResponse() WebAppsListDomainOwnershipIdentifiersResponse { + return p.current +} + +// WebAppsListDomainOwnershipIdentifiersSlotPager provides operations for iterating over paged responses. +type WebAppsListDomainOwnershipIdentifiersSlotPager struct { + client *WebAppsClient + current WebAppsListDomainOwnershipIdentifiersSlotResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, WebAppsListDomainOwnershipIdentifiersSlotResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *WebAppsListDomainOwnershipIdentifiersSlotPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *WebAppsListDomainOwnershipIdentifiersSlotPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.IdentifierCollection.NextLink == nil || len(*p.current.IdentifierCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listDomainOwnershipIdentifiersSlotHandleError(resp) + return false + } + result, err := p.client.listDomainOwnershipIdentifiersSlotHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current WebAppsListDomainOwnershipIdentifiersSlotResponse page. +func (p *WebAppsListDomainOwnershipIdentifiersSlotPager) PageResponse() WebAppsListDomainOwnershipIdentifiersSlotResponse { + return p.current +} + +// WebAppsListFunctionsPager provides operations for iterating over paged responses. +type WebAppsListFunctionsPager struct { + client *WebAppsClient + current WebAppsListFunctionsResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, WebAppsListFunctionsResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *WebAppsListFunctionsPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *WebAppsListFunctionsPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.FunctionEnvelopeCollection.NextLink == nil || len(*p.current.FunctionEnvelopeCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listFunctionsHandleError(resp) + return false + } + result, err := p.client.listFunctionsHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current WebAppsListFunctionsResponse page. +func (p *WebAppsListFunctionsPager) PageResponse() WebAppsListFunctionsResponse { + return p.current +} + +// WebAppsListHostNameBindingsPager provides operations for iterating over paged responses. +type WebAppsListHostNameBindingsPager struct { + client *WebAppsClient + current WebAppsListHostNameBindingsResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, WebAppsListHostNameBindingsResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *WebAppsListHostNameBindingsPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *WebAppsListHostNameBindingsPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.HostNameBindingCollection.NextLink == nil || len(*p.current.HostNameBindingCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listHostNameBindingsHandleError(resp) + return false + } + result, err := p.client.listHostNameBindingsHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current WebAppsListHostNameBindingsResponse page. +func (p *WebAppsListHostNameBindingsPager) PageResponse() WebAppsListHostNameBindingsResponse { + return p.current +} + +// WebAppsListHostNameBindingsSlotPager provides operations for iterating over paged responses. +type WebAppsListHostNameBindingsSlotPager struct { + client *WebAppsClient + current WebAppsListHostNameBindingsSlotResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, WebAppsListHostNameBindingsSlotResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *WebAppsListHostNameBindingsSlotPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *WebAppsListHostNameBindingsSlotPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.HostNameBindingCollection.NextLink == nil || len(*p.current.HostNameBindingCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listHostNameBindingsSlotHandleError(resp) + return false + } + result, err := p.client.listHostNameBindingsSlotHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current WebAppsListHostNameBindingsSlotResponse page. +func (p *WebAppsListHostNameBindingsSlotPager) PageResponse() WebAppsListHostNameBindingsSlotResponse { + return p.current +} + +// WebAppsListInstanceFunctionsSlotPager provides operations for iterating over paged responses. +type WebAppsListInstanceFunctionsSlotPager struct { + client *WebAppsClient + current WebAppsListInstanceFunctionsSlotResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, WebAppsListInstanceFunctionsSlotResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *WebAppsListInstanceFunctionsSlotPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *WebAppsListInstanceFunctionsSlotPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.FunctionEnvelopeCollection.NextLink == nil || len(*p.current.FunctionEnvelopeCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listInstanceFunctionsSlotHandleError(resp) + return false + } + result, err := p.client.listInstanceFunctionsSlotHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current WebAppsListInstanceFunctionsSlotResponse page. +func (p *WebAppsListInstanceFunctionsSlotPager) PageResponse() WebAppsListInstanceFunctionsSlotResponse { + return p.current +} + +// WebAppsListInstanceIdentifiersPager provides operations for iterating over paged responses. +type WebAppsListInstanceIdentifiersPager struct { + client *WebAppsClient + current WebAppsListInstanceIdentifiersResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, WebAppsListInstanceIdentifiersResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *WebAppsListInstanceIdentifiersPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *WebAppsListInstanceIdentifiersPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.WebAppInstanceStatusCollection.NextLink == nil || len(*p.current.WebAppInstanceStatusCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listInstanceIdentifiersHandleError(resp) + return false + } + result, err := p.client.listInstanceIdentifiersHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current WebAppsListInstanceIdentifiersResponse page. +func (p *WebAppsListInstanceIdentifiersPager) PageResponse() WebAppsListInstanceIdentifiersResponse { + return p.current +} + +// WebAppsListInstanceIdentifiersSlotPager provides operations for iterating over paged responses. +type WebAppsListInstanceIdentifiersSlotPager struct { + client *WebAppsClient + current WebAppsListInstanceIdentifiersSlotResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, WebAppsListInstanceIdentifiersSlotResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *WebAppsListInstanceIdentifiersSlotPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *WebAppsListInstanceIdentifiersSlotPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.WebAppInstanceStatusCollection.NextLink == nil || len(*p.current.WebAppInstanceStatusCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listInstanceIdentifiersSlotHandleError(resp) + return false + } + result, err := p.client.listInstanceIdentifiersSlotHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current WebAppsListInstanceIdentifiersSlotResponse page. +func (p *WebAppsListInstanceIdentifiersSlotPager) PageResponse() WebAppsListInstanceIdentifiersSlotResponse { + return p.current +} + +// WebAppsListInstanceProcessModulesPager provides operations for iterating over paged responses. +type WebAppsListInstanceProcessModulesPager struct { + client *WebAppsClient + current WebAppsListInstanceProcessModulesResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, WebAppsListInstanceProcessModulesResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *WebAppsListInstanceProcessModulesPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *WebAppsListInstanceProcessModulesPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.ProcessModuleInfoCollection.NextLink == nil || len(*p.current.ProcessModuleInfoCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listInstanceProcessModulesHandleError(resp) + return false + } + result, err := p.client.listInstanceProcessModulesHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current WebAppsListInstanceProcessModulesResponse page. +func (p *WebAppsListInstanceProcessModulesPager) PageResponse() WebAppsListInstanceProcessModulesResponse { + return p.current +} + +// WebAppsListInstanceProcessModulesSlotPager provides operations for iterating over paged responses. +type WebAppsListInstanceProcessModulesSlotPager struct { + client *WebAppsClient + current WebAppsListInstanceProcessModulesSlotResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, WebAppsListInstanceProcessModulesSlotResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *WebAppsListInstanceProcessModulesSlotPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *WebAppsListInstanceProcessModulesSlotPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.ProcessModuleInfoCollection.NextLink == nil || len(*p.current.ProcessModuleInfoCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listInstanceProcessModulesSlotHandleError(resp) + return false + } + result, err := p.client.listInstanceProcessModulesSlotHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current WebAppsListInstanceProcessModulesSlotResponse page. +func (p *WebAppsListInstanceProcessModulesSlotPager) PageResponse() WebAppsListInstanceProcessModulesSlotResponse { + return p.current +} + +// WebAppsListInstanceProcessThreadsPager provides operations for iterating over paged responses. +type WebAppsListInstanceProcessThreadsPager struct { + client *WebAppsClient + current WebAppsListInstanceProcessThreadsResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, WebAppsListInstanceProcessThreadsResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *WebAppsListInstanceProcessThreadsPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *WebAppsListInstanceProcessThreadsPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.ProcessThreadInfoCollection.NextLink == nil || len(*p.current.ProcessThreadInfoCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listInstanceProcessThreadsHandleError(resp) + return false + } + result, err := p.client.listInstanceProcessThreadsHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current WebAppsListInstanceProcessThreadsResponse page. +func (p *WebAppsListInstanceProcessThreadsPager) PageResponse() WebAppsListInstanceProcessThreadsResponse { + return p.current +} + +// WebAppsListInstanceProcessThreadsSlotPager provides operations for iterating over paged responses. +type WebAppsListInstanceProcessThreadsSlotPager struct { + client *WebAppsClient + current WebAppsListInstanceProcessThreadsSlotResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, WebAppsListInstanceProcessThreadsSlotResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *WebAppsListInstanceProcessThreadsSlotPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *WebAppsListInstanceProcessThreadsSlotPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.ProcessThreadInfoCollection.NextLink == nil || len(*p.current.ProcessThreadInfoCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listInstanceProcessThreadsSlotHandleError(resp) + return false + } + result, err := p.client.listInstanceProcessThreadsSlotHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current WebAppsListInstanceProcessThreadsSlotResponse page. +func (p *WebAppsListInstanceProcessThreadsSlotPager) PageResponse() WebAppsListInstanceProcessThreadsSlotResponse { + return p.current +} + +// WebAppsListInstanceProcessesPager provides operations for iterating over paged responses. +type WebAppsListInstanceProcessesPager struct { + client *WebAppsClient + current WebAppsListInstanceProcessesResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, WebAppsListInstanceProcessesResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *WebAppsListInstanceProcessesPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *WebAppsListInstanceProcessesPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.ProcessInfoCollection.NextLink == nil || len(*p.current.ProcessInfoCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listInstanceProcessesHandleError(resp) + return false + } + result, err := p.client.listInstanceProcessesHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current WebAppsListInstanceProcessesResponse page. +func (p *WebAppsListInstanceProcessesPager) PageResponse() WebAppsListInstanceProcessesResponse { + return p.current +} + +// WebAppsListInstanceProcessesSlotPager provides operations for iterating over paged responses. +type WebAppsListInstanceProcessesSlotPager struct { + client *WebAppsClient + current WebAppsListInstanceProcessesSlotResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, WebAppsListInstanceProcessesSlotResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *WebAppsListInstanceProcessesSlotPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *WebAppsListInstanceProcessesSlotPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.ProcessInfoCollection.NextLink == nil || len(*p.current.ProcessInfoCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listInstanceProcessesSlotHandleError(resp) + return false + } + result, err := p.client.listInstanceProcessesSlotHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current WebAppsListInstanceProcessesSlotResponse page. +func (p *WebAppsListInstanceProcessesSlotPager) PageResponse() WebAppsListInstanceProcessesSlotResponse { + return p.current +} + +// WebAppsListPager provides operations for iterating over paged responses. +type WebAppsListPager struct { + client *WebAppsClient + current WebAppsListResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, WebAppsListResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *WebAppsListPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *WebAppsListPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.WebAppCollection.NextLink == nil || len(*p.current.WebAppCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listHandleError(resp) + return false + } + result, err := p.client.listHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current WebAppsListResponse page. +func (p *WebAppsListPager) PageResponse() WebAppsListResponse { + return p.current +} + +// WebAppsListPerfMonCountersPager provides operations for iterating over paged responses. +type WebAppsListPerfMonCountersPager struct { + client *WebAppsClient + current WebAppsListPerfMonCountersResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, WebAppsListPerfMonCountersResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *WebAppsListPerfMonCountersPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *WebAppsListPerfMonCountersPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.PerfMonCounterCollection.NextLink == nil || len(*p.current.PerfMonCounterCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listPerfMonCountersHandleError(resp) + return false + } + result, err := p.client.listPerfMonCountersHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current WebAppsListPerfMonCountersResponse page. +func (p *WebAppsListPerfMonCountersPager) PageResponse() WebAppsListPerfMonCountersResponse { + return p.current +} + +// WebAppsListPerfMonCountersSlotPager provides operations for iterating over paged responses. +type WebAppsListPerfMonCountersSlotPager struct { + client *WebAppsClient + current WebAppsListPerfMonCountersSlotResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, WebAppsListPerfMonCountersSlotResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *WebAppsListPerfMonCountersSlotPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *WebAppsListPerfMonCountersSlotPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.PerfMonCounterCollection.NextLink == nil || len(*p.current.PerfMonCounterCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listPerfMonCountersSlotHandleError(resp) + return false + } + result, err := p.client.listPerfMonCountersSlotHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current WebAppsListPerfMonCountersSlotResponse page. +func (p *WebAppsListPerfMonCountersSlotPager) PageResponse() WebAppsListPerfMonCountersSlotResponse { + return p.current +} + +// WebAppsListProcessModulesPager provides operations for iterating over paged responses. +type WebAppsListProcessModulesPager struct { + client *WebAppsClient + current WebAppsListProcessModulesResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, WebAppsListProcessModulesResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *WebAppsListProcessModulesPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *WebAppsListProcessModulesPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.ProcessModuleInfoCollection.NextLink == nil || len(*p.current.ProcessModuleInfoCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listProcessModulesHandleError(resp) + return false + } + result, err := p.client.listProcessModulesHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current WebAppsListProcessModulesResponse page. +func (p *WebAppsListProcessModulesPager) PageResponse() WebAppsListProcessModulesResponse { + return p.current +} + +// WebAppsListProcessModulesSlotPager provides operations for iterating over paged responses. +type WebAppsListProcessModulesSlotPager struct { + client *WebAppsClient + current WebAppsListProcessModulesSlotResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, WebAppsListProcessModulesSlotResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *WebAppsListProcessModulesSlotPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *WebAppsListProcessModulesSlotPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.ProcessModuleInfoCollection.NextLink == nil || len(*p.current.ProcessModuleInfoCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listProcessModulesSlotHandleError(resp) + return false + } + result, err := p.client.listProcessModulesSlotHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current WebAppsListProcessModulesSlotResponse page. +func (p *WebAppsListProcessModulesSlotPager) PageResponse() WebAppsListProcessModulesSlotResponse { + return p.current +} + +// WebAppsListProcessThreadsPager provides operations for iterating over paged responses. +type WebAppsListProcessThreadsPager struct { + client *WebAppsClient + current WebAppsListProcessThreadsResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, WebAppsListProcessThreadsResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *WebAppsListProcessThreadsPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *WebAppsListProcessThreadsPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.ProcessThreadInfoCollection.NextLink == nil || len(*p.current.ProcessThreadInfoCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listProcessThreadsHandleError(resp) + return false + } + result, err := p.client.listProcessThreadsHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current WebAppsListProcessThreadsResponse page. +func (p *WebAppsListProcessThreadsPager) PageResponse() WebAppsListProcessThreadsResponse { + return p.current +} + +// WebAppsListProcessThreadsSlotPager provides operations for iterating over paged responses. +type WebAppsListProcessThreadsSlotPager struct { + client *WebAppsClient + current WebAppsListProcessThreadsSlotResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, WebAppsListProcessThreadsSlotResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *WebAppsListProcessThreadsSlotPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *WebAppsListProcessThreadsSlotPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.ProcessThreadInfoCollection.NextLink == nil || len(*p.current.ProcessThreadInfoCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listProcessThreadsSlotHandleError(resp) + return false + } + result, err := p.client.listProcessThreadsSlotHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current WebAppsListProcessThreadsSlotResponse page. +func (p *WebAppsListProcessThreadsSlotPager) PageResponse() WebAppsListProcessThreadsSlotResponse { + return p.current +} + +// WebAppsListProcessesPager provides operations for iterating over paged responses. +type WebAppsListProcessesPager struct { + client *WebAppsClient + current WebAppsListProcessesResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, WebAppsListProcessesResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *WebAppsListProcessesPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *WebAppsListProcessesPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.ProcessInfoCollection.NextLink == nil || len(*p.current.ProcessInfoCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listProcessesHandleError(resp) + return false + } + result, err := p.client.listProcessesHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current WebAppsListProcessesResponse page. +func (p *WebAppsListProcessesPager) PageResponse() WebAppsListProcessesResponse { + return p.current +} + +// WebAppsListProcessesSlotPager provides operations for iterating over paged responses. +type WebAppsListProcessesSlotPager struct { + client *WebAppsClient + current WebAppsListProcessesSlotResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, WebAppsListProcessesSlotResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *WebAppsListProcessesSlotPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *WebAppsListProcessesSlotPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.ProcessInfoCollection.NextLink == nil || len(*p.current.ProcessInfoCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listProcessesSlotHandleError(resp) + return false + } + result, err := p.client.listProcessesSlotHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current WebAppsListProcessesSlotResponse page. +func (p *WebAppsListProcessesSlotPager) PageResponse() WebAppsListProcessesSlotResponse { + return p.current +} + +// WebAppsListPublicCertificatesPager provides operations for iterating over paged responses. +type WebAppsListPublicCertificatesPager struct { + client *WebAppsClient + current WebAppsListPublicCertificatesResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, WebAppsListPublicCertificatesResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *WebAppsListPublicCertificatesPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *WebAppsListPublicCertificatesPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.PublicCertificateCollection.NextLink == nil || len(*p.current.PublicCertificateCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listPublicCertificatesHandleError(resp) + return false + } + result, err := p.client.listPublicCertificatesHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current WebAppsListPublicCertificatesResponse page. +func (p *WebAppsListPublicCertificatesPager) PageResponse() WebAppsListPublicCertificatesResponse { + return p.current +} + +// WebAppsListPublicCertificatesSlotPager provides operations for iterating over paged responses. +type WebAppsListPublicCertificatesSlotPager struct { + client *WebAppsClient + current WebAppsListPublicCertificatesSlotResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, WebAppsListPublicCertificatesSlotResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *WebAppsListPublicCertificatesSlotPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *WebAppsListPublicCertificatesSlotPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.PublicCertificateCollection.NextLink == nil || len(*p.current.PublicCertificateCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listPublicCertificatesSlotHandleError(resp) + return false + } + result, err := p.client.listPublicCertificatesSlotHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current WebAppsListPublicCertificatesSlotResponse page. +func (p *WebAppsListPublicCertificatesSlotPager) PageResponse() WebAppsListPublicCertificatesSlotResponse { + return p.current +} + +// WebAppsListSiteBackupsPager provides operations for iterating over paged responses. +type WebAppsListSiteBackupsPager struct { + client *WebAppsClient + current WebAppsListSiteBackupsResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, WebAppsListSiteBackupsResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *WebAppsListSiteBackupsPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *WebAppsListSiteBackupsPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.BackupItemCollection.NextLink == nil || len(*p.current.BackupItemCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listSiteBackupsHandleError(resp) + return false + } + result, err := p.client.listSiteBackupsHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current WebAppsListSiteBackupsResponse page. +func (p *WebAppsListSiteBackupsPager) PageResponse() WebAppsListSiteBackupsResponse { + return p.current +} + +// WebAppsListSiteBackupsSlotPager provides operations for iterating over paged responses. +type WebAppsListSiteBackupsSlotPager struct { + client *WebAppsClient + current WebAppsListSiteBackupsSlotResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, WebAppsListSiteBackupsSlotResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *WebAppsListSiteBackupsSlotPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *WebAppsListSiteBackupsSlotPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.BackupItemCollection.NextLink == nil || len(*p.current.BackupItemCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listSiteBackupsSlotHandleError(resp) + return false + } + result, err := p.client.listSiteBackupsSlotHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current WebAppsListSiteBackupsSlotResponse page. +func (p *WebAppsListSiteBackupsSlotPager) PageResponse() WebAppsListSiteBackupsSlotResponse { + return p.current +} + +// WebAppsListSiteExtensionsPager provides operations for iterating over paged responses. +type WebAppsListSiteExtensionsPager struct { + client *WebAppsClient + current WebAppsListSiteExtensionsResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, WebAppsListSiteExtensionsResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *WebAppsListSiteExtensionsPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *WebAppsListSiteExtensionsPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.SiteExtensionInfoCollection.NextLink == nil || len(*p.current.SiteExtensionInfoCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listSiteExtensionsHandleError(resp) + return false + } + result, err := p.client.listSiteExtensionsHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current WebAppsListSiteExtensionsResponse page. +func (p *WebAppsListSiteExtensionsPager) PageResponse() WebAppsListSiteExtensionsResponse { + return p.current +} + +// WebAppsListSiteExtensionsSlotPager provides operations for iterating over paged responses. +type WebAppsListSiteExtensionsSlotPager struct { + client *WebAppsClient + current WebAppsListSiteExtensionsSlotResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, WebAppsListSiteExtensionsSlotResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *WebAppsListSiteExtensionsSlotPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *WebAppsListSiteExtensionsSlotPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.SiteExtensionInfoCollection.NextLink == nil || len(*p.current.SiteExtensionInfoCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listSiteExtensionsSlotHandleError(resp) + return false + } + result, err := p.client.listSiteExtensionsSlotHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current WebAppsListSiteExtensionsSlotResponse page. +func (p *WebAppsListSiteExtensionsSlotPager) PageResponse() WebAppsListSiteExtensionsSlotResponse { + return p.current +} + +// WebAppsListSlotDifferencesFromProductionPager provides operations for iterating over paged responses. +type WebAppsListSlotDifferencesFromProductionPager struct { + client *WebAppsClient + current WebAppsListSlotDifferencesFromProductionResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, WebAppsListSlotDifferencesFromProductionResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *WebAppsListSlotDifferencesFromProductionPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *WebAppsListSlotDifferencesFromProductionPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.SlotDifferenceCollection.NextLink == nil || len(*p.current.SlotDifferenceCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listSlotDifferencesFromProductionHandleError(resp) + return false + } + result, err := p.client.listSlotDifferencesFromProductionHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current WebAppsListSlotDifferencesFromProductionResponse page. +func (p *WebAppsListSlotDifferencesFromProductionPager) PageResponse() WebAppsListSlotDifferencesFromProductionResponse { + return p.current +} + +// WebAppsListSlotDifferencesSlotPager provides operations for iterating over paged responses. +type WebAppsListSlotDifferencesSlotPager struct { + client *WebAppsClient + current WebAppsListSlotDifferencesSlotResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, WebAppsListSlotDifferencesSlotResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *WebAppsListSlotDifferencesSlotPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *WebAppsListSlotDifferencesSlotPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.SlotDifferenceCollection.NextLink == nil || len(*p.current.SlotDifferenceCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listSlotDifferencesSlotHandleError(resp) + return false + } + result, err := p.client.listSlotDifferencesSlotHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current WebAppsListSlotDifferencesSlotResponse page. +func (p *WebAppsListSlotDifferencesSlotPager) PageResponse() WebAppsListSlotDifferencesSlotResponse { + return p.current +} + +// WebAppsListSlotsPager provides operations for iterating over paged responses. +type WebAppsListSlotsPager struct { + client *WebAppsClient + current WebAppsListSlotsResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, WebAppsListSlotsResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *WebAppsListSlotsPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *WebAppsListSlotsPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.WebAppCollection.NextLink == nil || len(*p.current.WebAppCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listSlotsHandleError(resp) + return false + } + result, err := p.client.listSlotsHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current WebAppsListSlotsResponse page. +func (p *WebAppsListSlotsPager) PageResponse() WebAppsListSlotsResponse { + return p.current +} + +// WebAppsListSnapshotsFromDRSecondaryPager provides operations for iterating over paged responses. +type WebAppsListSnapshotsFromDRSecondaryPager struct { + client *WebAppsClient + current WebAppsListSnapshotsFromDRSecondaryResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, WebAppsListSnapshotsFromDRSecondaryResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *WebAppsListSnapshotsFromDRSecondaryPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *WebAppsListSnapshotsFromDRSecondaryPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.SnapshotCollection.NextLink == nil || len(*p.current.SnapshotCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listSnapshotsFromDRSecondaryHandleError(resp) + return false + } + result, err := p.client.listSnapshotsFromDRSecondaryHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current WebAppsListSnapshotsFromDRSecondaryResponse page. +func (p *WebAppsListSnapshotsFromDRSecondaryPager) PageResponse() WebAppsListSnapshotsFromDRSecondaryResponse { + return p.current +} + +// WebAppsListSnapshotsFromDRSecondarySlotPager provides operations for iterating over paged responses. +type WebAppsListSnapshotsFromDRSecondarySlotPager struct { + client *WebAppsClient + current WebAppsListSnapshotsFromDRSecondarySlotResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, WebAppsListSnapshotsFromDRSecondarySlotResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *WebAppsListSnapshotsFromDRSecondarySlotPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *WebAppsListSnapshotsFromDRSecondarySlotPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.SnapshotCollection.NextLink == nil || len(*p.current.SnapshotCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listSnapshotsFromDRSecondarySlotHandleError(resp) + return false + } + result, err := p.client.listSnapshotsFromDRSecondarySlotHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current WebAppsListSnapshotsFromDRSecondarySlotResponse page. +func (p *WebAppsListSnapshotsFromDRSecondarySlotPager) PageResponse() WebAppsListSnapshotsFromDRSecondarySlotResponse { + return p.current +} + +// WebAppsListSnapshotsPager provides operations for iterating over paged responses. +type WebAppsListSnapshotsPager struct { + client *WebAppsClient + current WebAppsListSnapshotsResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, WebAppsListSnapshotsResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *WebAppsListSnapshotsPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *WebAppsListSnapshotsPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.SnapshotCollection.NextLink == nil || len(*p.current.SnapshotCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listSnapshotsHandleError(resp) + return false + } + result, err := p.client.listSnapshotsHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current WebAppsListSnapshotsResponse page. +func (p *WebAppsListSnapshotsPager) PageResponse() WebAppsListSnapshotsResponse { + return p.current +} + +// WebAppsListSnapshotsSlotPager provides operations for iterating over paged responses. +type WebAppsListSnapshotsSlotPager struct { + client *WebAppsClient + current WebAppsListSnapshotsSlotResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, WebAppsListSnapshotsSlotResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *WebAppsListSnapshotsSlotPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *WebAppsListSnapshotsSlotPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.SnapshotCollection.NextLink == nil || len(*p.current.SnapshotCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listSnapshotsSlotHandleError(resp) + return false + } + result, err := p.client.listSnapshotsSlotHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current WebAppsListSnapshotsSlotResponse page. +func (p *WebAppsListSnapshotsSlotPager) PageResponse() WebAppsListSnapshotsSlotResponse { + return p.current +} + +// WebAppsListTriggeredWebJobHistoryPager provides operations for iterating over paged responses. +type WebAppsListTriggeredWebJobHistoryPager struct { + client *WebAppsClient + current WebAppsListTriggeredWebJobHistoryResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, WebAppsListTriggeredWebJobHistoryResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *WebAppsListTriggeredWebJobHistoryPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *WebAppsListTriggeredWebJobHistoryPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.TriggeredJobHistoryCollection.NextLink == nil || len(*p.current.TriggeredJobHistoryCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listTriggeredWebJobHistoryHandleError(resp) + return false + } + result, err := p.client.listTriggeredWebJobHistoryHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current WebAppsListTriggeredWebJobHistoryResponse page. +func (p *WebAppsListTriggeredWebJobHistoryPager) PageResponse() WebAppsListTriggeredWebJobHistoryResponse { + return p.current +} + +// WebAppsListTriggeredWebJobHistorySlotPager provides operations for iterating over paged responses. +type WebAppsListTriggeredWebJobHistorySlotPager struct { + client *WebAppsClient + current WebAppsListTriggeredWebJobHistorySlotResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, WebAppsListTriggeredWebJobHistorySlotResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *WebAppsListTriggeredWebJobHistorySlotPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *WebAppsListTriggeredWebJobHistorySlotPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.TriggeredJobHistoryCollection.NextLink == nil || len(*p.current.TriggeredJobHistoryCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listTriggeredWebJobHistorySlotHandleError(resp) + return false + } + result, err := p.client.listTriggeredWebJobHistorySlotHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current WebAppsListTriggeredWebJobHistorySlotResponse page. +func (p *WebAppsListTriggeredWebJobHistorySlotPager) PageResponse() WebAppsListTriggeredWebJobHistorySlotResponse { + return p.current +} + +// WebAppsListTriggeredWebJobsPager provides operations for iterating over paged responses. +type WebAppsListTriggeredWebJobsPager struct { + client *WebAppsClient + current WebAppsListTriggeredWebJobsResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, WebAppsListTriggeredWebJobsResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *WebAppsListTriggeredWebJobsPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *WebAppsListTriggeredWebJobsPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.TriggeredWebJobCollection.NextLink == nil || len(*p.current.TriggeredWebJobCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listTriggeredWebJobsHandleError(resp) + return false + } + result, err := p.client.listTriggeredWebJobsHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current WebAppsListTriggeredWebJobsResponse page. +func (p *WebAppsListTriggeredWebJobsPager) PageResponse() WebAppsListTriggeredWebJobsResponse { + return p.current +} + +// WebAppsListTriggeredWebJobsSlotPager provides operations for iterating over paged responses. +type WebAppsListTriggeredWebJobsSlotPager struct { + client *WebAppsClient + current WebAppsListTriggeredWebJobsSlotResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, WebAppsListTriggeredWebJobsSlotResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *WebAppsListTriggeredWebJobsSlotPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *WebAppsListTriggeredWebJobsSlotPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.TriggeredWebJobCollection.NextLink == nil || len(*p.current.TriggeredWebJobCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listTriggeredWebJobsSlotHandleError(resp) + return false + } + result, err := p.client.listTriggeredWebJobsSlotHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current WebAppsListTriggeredWebJobsSlotResponse page. +func (p *WebAppsListTriggeredWebJobsSlotPager) PageResponse() WebAppsListTriggeredWebJobsSlotResponse { + return p.current +} + +// WebAppsListUsagesPager provides operations for iterating over paged responses. +type WebAppsListUsagesPager struct { + client *WebAppsClient + current WebAppsListUsagesResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, WebAppsListUsagesResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *WebAppsListUsagesPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *WebAppsListUsagesPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.CsmUsageQuotaCollection.NextLink == nil || len(*p.current.CsmUsageQuotaCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listUsagesHandleError(resp) + return false + } + result, err := p.client.listUsagesHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current WebAppsListUsagesResponse page. +func (p *WebAppsListUsagesPager) PageResponse() WebAppsListUsagesResponse { + return p.current +} + +// WebAppsListUsagesSlotPager provides operations for iterating over paged responses. +type WebAppsListUsagesSlotPager struct { + client *WebAppsClient + current WebAppsListUsagesSlotResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, WebAppsListUsagesSlotResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *WebAppsListUsagesSlotPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *WebAppsListUsagesSlotPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.CsmUsageQuotaCollection.NextLink == nil || len(*p.current.CsmUsageQuotaCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listUsagesSlotHandleError(resp) + return false + } + result, err := p.client.listUsagesSlotHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current WebAppsListUsagesSlotResponse page. +func (p *WebAppsListUsagesSlotPager) PageResponse() WebAppsListUsagesSlotResponse { + return p.current +} + +// WebAppsListWebJobsPager provides operations for iterating over paged responses. +type WebAppsListWebJobsPager struct { + client *WebAppsClient + current WebAppsListWebJobsResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, WebAppsListWebJobsResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *WebAppsListWebJobsPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *WebAppsListWebJobsPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.WebJobCollection.NextLink == nil || len(*p.current.WebJobCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listWebJobsHandleError(resp) + return false + } + result, err := p.client.listWebJobsHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current WebAppsListWebJobsResponse page. +func (p *WebAppsListWebJobsPager) PageResponse() WebAppsListWebJobsResponse { + return p.current +} + +// WebAppsListWebJobsSlotPager provides operations for iterating over paged responses. +type WebAppsListWebJobsSlotPager struct { + client *WebAppsClient + current WebAppsListWebJobsSlotResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, WebAppsListWebJobsSlotResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *WebAppsListWebJobsSlotPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *WebAppsListWebJobsSlotPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.WebJobCollection.NextLink == nil || len(*p.current.WebJobCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listWebJobsSlotHandleError(resp) + return false + } + result, err := p.client.listWebJobsSlotHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current WebAppsListWebJobsSlotResponse page. +func (p *WebAppsListWebJobsSlotPager) PageResponse() WebAppsListWebJobsSlotResponse { + return p.current +} + +// WebSiteManagementClientListBillingMetersPager provides operations for iterating over paged responses. +type WebSiteManagementClientListBillingMetersPager struct { + client *WebSiteManagementClient + current WebSiteManagementClientListBillingMetersResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, WebSiteManagementClientListBillingMetersResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *WebSiteManagementClientListBillingMetersPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *WebSiteManagementClientListBillingMetersPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.BillingMeterCollection.NextLink == nil || len(*p.current.BillingMeterCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listBillingMetersHandleError(resp) + return false + } + result, err := p.client.listBillingMetersHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current WebSiteManagementClientListBillingMetersResponse page. +func (p *WebSiteManagementClientListBillingMetersPager) PageResponse() WebSiteManagementClientListBillingMetersResponse { + return p.current +} + +// WebSiteManagementClientListGeoRegionsPager provides operations for iterating over paged responses. +type WebSiteManagementClientListGeoRegionsPager struct { + client *WebSiteManagementClient + current WebSiteManagementClientListGeoRegionsResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, WebSiteManagementClientListGeoRegionsResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *WebSiteManagementClientListGeoRegionsPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *WebSiteManagementClientListGeoRegionsPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.GeoRegionCollection.NextLink == nil || len(*p.current.GeoRegionCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listGeoRegionsHandleError(resp) + return false + } + result, err := p.client.listGeoRegionsHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current WebSiteManagementClientListGeoRegionsResponse page. +func (p *WebSiteManagementClientListGeoRegionsPager) PageResponse() WebSiteManagementClientListGeoRegionsResponse { + return p.current +} + +// WebSiteManagementClientListPremierAddOnOffersPager provides operations for iterating over paged responses. +type WebSiteManagementClientListPremierAddOnOffersPager struct { + client *WebSiteManagementClient + current WebSiteManagementClientListPremierAddOnOffersResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, WebSiteManagementClientListPremierAddOnOffersResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *WebSiteManagementClientListPremierAddOnOffersPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *WebSiteManagementClientListPremierAddOnOffersPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.PremierAddOnOfferCollection.NextLink == nil || len(*p.current.PremierAddOnOfferCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listPremierAddOnOffersHandleError(resp) + return false + } + result, err := p.client.listPremierAddOnOffersHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current WebSiteManagementClientListPremierAddOnOffersResponse page. +func (p *WebSiteManagementClientListPremierAddOnOffersPager) PageResponse() WebSiteManagementClientListPremierAddOnOffersResponse { + return p.current +} + +// WebSiteManagementClientListSiteIdentifiersAssignedToHostNamePager provides operations for iterating over paged responses. +type WebSiteManagementClientListSiteIdentifiersAssignedToHostNamePager struct { + client *WebSiteManagementClient + current WebSiteManagementClientListSiteIdentifiersAssignedToHostNameResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, WebSiteManagementClientListSiteIdentifiersAssignedToHostNameResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *WebSiteManagementClientListSiteIdentifiersAssignedToHostNamePager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *WebSiteManagementClientListSiteIdentifiersAssignedToHostNamePager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.IdentifierCollection.NextLink == nil || len(*p.current.IdentifierCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listSiteIdentifiersAssignedToHostNameHandleError(resp) + return false + } + result, err := p.client.listSiteIdentifiersAssignedToHostNameHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current WebSiteManagementClientListSiteIdentifiersAssignedToHostNameResponse page. +func (p *WebSiteManagementClientListSiteIdentifiersAssignedToHostNamePager) PageResponse() WebSiteManagementClientListSiteIdentifiersAssignedToHostNameResponse { + return p.current +} + +// WebSiteManagementClientListSourceControlsPager provides operations for iterating over paged responses. +type WebSiteManagementClientListSourceControlsPager struct { + client *WebSiteManagementClient + current WebSiteManagementClientListSourceControlsResponse + err error + requester func(context.Context) (*policy.Request, error) + advancer func(context.Context, WebSiteManagementClientListSourceControlsResponse) (*policy.Request, error) +} + +// Err returns the last error encountered while paging. +func (p *WebSiteManagementClientListSourceControlsPager) Err() error { + return p.err +} + +// NextPage returns true if the pager advanced to the next page. +// Returns false if there are no more pages or an error occurred. +func (p *WebSiteManagementClientListSourceControlsPager) NextPage(ctx context.Context) bool { + var req *policy.Request + var err error + if !reflect.ValueOf(p.current).IsZero() { + if p.current.SourceControlCollection.NextLink == nil || len(*p.current.SourceControlCollection.NextLink) == 0 { + return false + } + req, err = p.advancer(ctx, p.current) + } else { + req, err = p.requester(ctx) + } + if err != nil { + p.err = err + return false + } + resp, err := p.client.pl.Do(req) + if err != nil { + p.err = err + return false + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + p.err = p.client.listSourceControlsHandleError(resp) + return false + } + result, err := p.client.listSourceControlsHandleResponse(resp) + if err != nil { + p.err = err + return false + } + p.current = result + return true +} + +// PageResponse returns the current WebSiteManagementClientListSourceControlsResponse page. +func (p *WebSiteManagementClientListSourceControlsPager) PageResponse() WebSiteManagementClientListSourceControlsResponse { + return p.current +} diff --git a/sdk/resourcemanager/appservice/armappservice/zz_generated_pollers.go b/sdk/resourcemanager/appservice/armappservice/zz_generated_pollers.go new file mode 100644 index 000000000000..d167a4012c38 --- /dev/null +++ b/sdk/resourcemanager/appservice/armappservice/zz_generated_pollers.go @@ -0,0 +1,2678 @@ +//go:build go1.16 +// +build go1.16 + +// 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. + +package armappservice + +import ( + "context" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "net/http" +) + +// AppServiceCertificateOrdersCreateOrUpdateCertificatePoller provides polling facilities until the operation reaches a terminal state. +type AppServiceCertificateOrdersCreateOrUpdateCertificatePoller struct { + pt *azcore.Poller +} + +// Done returns true if the LRO has reached a terminal state. +func (p *AppServiceCertificateOrdersCreateOrUpdateCertificatePoller) Done() bool { + return p.pt.Done() +} + +// Poll fetches the latest state of the LRO. It returns an HTTP response or error. +// If the LRO has completed successfully, the poller's state is updated and the HTTP +// response is returned. +// If the LRO has completed with failure or was cancelled, the poller's state is +// updated and the error is returned. +// If the LRO has not reached a terminal state, the poller's state is updated and +// the latest HTTP response is returned. +// If Poll fails, the poller's state is unmodified and the error is returned. +// Calling Poll on an LRO that has reached a terminal state will return the final +// HTTP response or error. +func (p *AppServiceCertificateOrdersCreateOrUpdateCertificatePoller) Poll(ctx context.Context) (*http.Response, error) { + return p.pt.Poll(ctx) +} + +// FinalResponse performs a final GET to the service and returns the final response +// for the polling operation. If there is an error performing the final GET then an error is returned. +// If the final GET succeeded then the final AppServiceCertificateOrdersCreateOrUpdateCertificateResponse will be returned. +func (p *AppServiceCertificateOrdersCreateOrUpdateCertificatePoller) FinalResponse(ctx context.Context) (AppServiceCertificateOrdersCreateOrUpdateCertificateResponse, error) { + respType := AppServiceCertificateOrdersCreateOrUpdateCertificateResponse{} + resp, err := p.pt.FinalResponse(ctx, &respType.AppServiceCertificateResource) + if err != nil { + return AppServiceCertificateOrdersCreateOrUpdateCertificateResponse{}, err + } + respType.RawResponse = resp + return respType, nil +} + +// ResumeToken returns a value representing the poller that can be used to resume +// the LRO at a later time. ResumeTokens are unique per service operation. +func (p *AppServiceCertificateOrdersCreateOrUpdateCertificatePoller) ResumeToken() (string, error) { + return p.pt.ResumeToken() +} + +// AppServiceCertificateOrdersCreateOrUpdatePoller provides polling facilities until the operation reaches a terminal state. +type AppServiceCertificateOrdersCreateOrUpdatePoller struct { + pt *azcore.Poller +} + +// Done returns true if the LRO has reached a terminal state. +func (p *AppServiceCertificateOrdersCreateOrUpdatePoller) Done() bool { + return p.pt.Done() +} + +// Poll fetches the latest state of the LRO. It returns an HTTP response or error. +// If the LRO has completed successfully, the poller's state is updated and the HTTP +// response is returned. +// If the LRO has completed with failure or was cancelled, the poller's state is +// updated and the error is returned. +// If the LRO has not reached a terminal state, the poller's state is updated and +// the latest HTTP response is returned. +// If Poll fails, the poller's state is unmodified and the error is returned. +// Calling Poll on an LRO that has reached a terminal state will return the final +// HTTP response or error. +func (p *AppServiceCertificateOrdersCreateOrUpdatePoller) Poll(ctx context.Context) (*http.Response, error) { + return p.pt.Poll(ctx) +} + +// FinalResponse performs a final GET to the service and returns the final response +// for the polling operation. If there is an error performing the final GET then an error is returned. +// If the final GET succeeded then the final AppServiceCertificateOrdersCreateOrUpdateResponse will be returned. +func (p *AppServiceCertificateOrdersCreateOrUpdatePoller) FinalResponse(ctx context.Context) (AppServiceCertificateOrdersCreateOrUpdateResponse, error) { + respType := AppServiceCertificateOrdersCreateOrUpdateResponse{} + resp, err := p.pt.FinalResponse(ctx, &respType.AppServiceCertificateOrder) + if err != nil { + return AppServiceCertificateOrdersCreateOrUpdateResponse{}, err + } + respType.RawResponse = resp + return respType, nil +} + +// ResumeToken returns a value representing the poller that can be used to resume +// the LRO at a later time. ResumeTokens are unique per service operation. +func (p *AppServiceCertificateOrdersCreateOrUpdatePoller) ResumeToken() (string, error) { + return p.pt.ResumeToken() +} + +// AppServiceEnvironmentsApproveOrRejectPrivateEndpointConnectionPoller provides polling facilities until the operation reaches a terminal state. +type AppServiceEnvironmentsApproveOrRejectPrivateEndpointConnectionPoller struct { + pt *azcore.Poller +} + +// Done returns true if the LRO has reached a terminal state. +func (p *AppServiceEnvironmentsApproveOrRejectPrivateEndpointConnectionPoller) Done() bool { + return p.pt.Done() +} + +// Poll fetches the latest state of the LRO. It returns an HTTP response or error. +// If the LRO has completed successfully, the poller's state is updated and the HTTP +// response is returned. +// If the LRO has completed with failure or was cancelled, the poller's state is +// updated and the error is returned. +// If the LRO has not reached a terminal state, the poller's state is updated and +// the latest HTTP response is returned. +// If Poll fails, the poller's state is unmodified and the error is returned. +// Calling Poll on an LRO that has reached a terminal state will return the final +// HTTP response or error. +func (p *AppServiceEnvironmentsApproveOrRejectPrivateEndpointConnectionPoller) Poll(ctx context.Context) (*http.Response, error) { + return p.pt.Poll(ctx) +} + +// FinalResponse performs a final GET to the service and returns the final response +// for the polling operation. If there is an error performing the final GET then an error is returned. +// If the final GET succeeded then the final AppServiceEnvironmentsApproveOrRejectPrivateEndpointConnectionResponse will be returned. +func (p *AppServiceEnvironmentsApproveOrRejectPrivateEndpointConnectionPoller) FinalResponse(ctx context.Context) (AppServiceEnvironmentsApproveOrRejectPrivateEndpointConnectionResponse, error) { + respType := AppServiceEnvironmentsApproveOrRejectPrivateEndpointConnectionResponse{} + resp, err := p.pt.FinalResponse(ctx, &respType.RemotePrivateEndpointConnectionARMResource) + if err != nil { + return AppServiceEnvironmentsApproveOrRejectPrivateEndpointConnectionResponse{}, err + } + respType.RawResponse = resp + return respType, nil +} + +// ResumeToken returns a value representing the poller that can be used to resume +// the LRO at a later time. ResumeTokens are unique per service operation. +func (p *AppServiceEnvironmentsApproveOrRejectPrivateEndpointConnectionPoller) ResumeToken() (string, error) { + return p.pt.ResumeToken() +} + +// AppServiceEnvironmentsChangeVnetPoller provides polling facilities until the operation reaches a terminal state. +type AppServiceEnvironmentsChangeVnetPoller struct { + pt *azcore.Poller + client *AppServiceEnvironmentsClient +} + +// Done returns true if the LRO has reached a terminal state. +func (p *AppServiceEnvironmentsChangeVnetPoller) Done() bool { + return p.pt.Done() +} + +// Poll fetches the latest state of the LRO. It returns an HTTP response or error. +// If the LRO has completed successfully, the poller's state is updated and the HTTP +// response is returned. +// If the LRO has completed with failure or was cancelled, the poller's state is +// updated and the error is returned. +// If the LRO has not reached a terminal state, the poller's state is updated and +// the latest HTTP response is returned. +// If Poll fails, the poller's state is unmodified and the error is returned. +// Calling Poll on an LRO that has reached a terminal state will return the final +// HTTP response or error. +func (p *AppServiceEnvironmentsChangeVnetPoller) Poll(ctx context.Context) (*http.Response, error) { + return p.pt.Poll(ctx) +} + +// FinalResponse performs a final GET to the service and returns the final response +// for the polling operation. If there is an error performing the final GET then an error is returned. +// If the final GET succeeded then the final *AppServiceEnvironmentsChangeVnetPager will be returned. +func (p *AppServiceEnvironmentsChangeVnetPoller) FinalResponse(ctx context.Context) (*AppServiceEnvironmentsChangeVnetPager, error) { + respType := &AppServiceEnvironmentsChangeVnetPager{client: p.client} + if _, err := p.pt.FinalResponse(ctx, &respType.current.WebAppCollection); err != nil { + return nil, err + } + return respType, nil +} + +// ResumeToken returns a value representing the poller that can be used to resume +// the LRO at a later time. ResumeTokens are unique per service operation. +func (p *AppServiceEnvironmentsChangeVnetPoller) ResumeToken() (string, error) { + return p.pt.ResumeToken() +} + +// AppServiceEnvironmentsCreateOrUpdateMultiRolePoolPoller provides polling facilities until the operation reaches a terminal state. +type AppServiceEnvironmentsCreateOrUpdateMultiRolePoolPoller struct { + pt *azcore.Poller +} + +// Done returns true if the LRO has reached a terminal state. +func (p *AppServiceEnvironmentsCreateOrUpdateMultiRolePoolPoller) Done() bool { + return p.pt.Done() +} + +// Poll fetches the latest state of the LRO. It returns an HTTP response or error. +// If the LRO has completed successfully, the poller's state is updated and the HTTP +// response is returned. +// If the LRO has completed with failure or was cancelled, the poller's state is +// updated and the error is returned. +// If the LRO has not reached a terminal state, the poller's state is updated and +// the latest HTTP response is returned. +// If Poll fails, the poller's state is unmodified and the error is returned. +// Calling Poll on an LRO that has reached a terminal state will return the final +// HTTP response or error. +func (p *AppServiceEnvironmentsCreateOrUpdateMultiRolePoolPoller) Poll(ctx context.Context) (*http.Response, error) { + return p.pt.Poll(ctx) +} + +// FinalResponse performs a final GET to the service and returns the final response +// for the polling operation. If there is an error performing the final GET then an error is returned. +// If the final GET succeeded then the final AppServiceEnvironmentsCreateOrUpdateMultiRolePoolResponse will be returned. +func (p *AppServiceEnvironmentsCreateOrUpdateMultiRolePoolPoller) FinalResponse(ctx context.Context) (AppServiceEnvironmentsCreateOrUpdateMultiRolePoolResponse, error) { + respType := AppServiceEnvironmentsCreateOrUpdateMultiRolePoolResponse{} + resp, err := p.pt.FinalResponse(ctx, &respType.WorkerPoolResource) + if err != nil { + return AppServiceEnvironmentsCreateOrUpdateMultiRolePoolResponse{}, err + } + respType.RawResponse = resp + return respType, nil +} + +// ResumeToken returns a value representing the poller that can be used to resume +// the LRO at a later time. ResumeTokens are unique per service operation. +func (p *AppServiceEnvironmentsCreateOrUpdateMultiRolePoolPoller) ResumeToken() (string, error) { + return p.pt.ResumeToken() +} + +// AppServiceEnvironmentsCreateOrUpdatePoller provides polling facilities until the operation reaches a terminal state. +type AppServiceEnvironmentsCreateOrUpdatePoller struct { + pt *azcore.Poller +} + +// Done returns true if the LRO has reached a terminal state. +func (p *AppServiceEnvironmentsCreateOrUpdatePoller) Done() bool { + return p.pt.Done() +} + +// Poll fetches the latest state of the LRO. It returns an HTTP response or error. +// If the LRO has completed successfully, the poller's state is updated and the HTTP +// response is returned. +// If the LRO has completed with failure or was cancelled, the poller's state is +// updated and the error is returned. +// If the LRO has not reached a terminal state, the poller's state is updated and +// the latest HTTP response is returned. +// If Poll fails, the poller's state is unmodified and the error is returned. +// Calling Poll on an LRO that has reached a terminal state will return the final +// HTTP response or error. +func (p *AppServiceEnvironmentsCreateOrUpdatePoller) Poll(ctx context.Context) (*http.Response, error) { + return p.pt.Poll(ctx) +} + +// FinalResponse performs a final GET to the service and returns the final response +// for the polling operation. If there is an error performing the final GET then an error is returned. +// If the final GET succeeded then the final AppServiceEnvironmentsCreateOrUpdateResponse will be returned. +func (p *AppServiceEnvironmentsCreateOrUpdatePoller) FinalResponse(ctx context.Context) (AppServiceEnvironmentsCreateOrUpdateResponse, error) { + respType := AppServiceEnvironmentsCreateOrUpdateResponse{} + resp, err := p.pt.FinalResponse(ctx, &respType.AppServiceEnvironmentResource) + if err != nil { + return AppServiceEnvironmentsCreateOrUpdateResponse{}, err + } + respType.RawResponse = resp + return respType, nil +} + +// ResumeToken returns a value representing the poller that can be used to resume +// the LRO at a later time. ResumeTokens are unique per service operation. +func (p *AppServiceEnvironmentsCreateOrUpdatePoller) ResumeToken() (string, error) { + return p.pt.ResumeToken() +} + +// AppServiceEnvironmentsCreateOrUpdateWorkerPoolPoller provides polling facilities until the operation reaches a terminal state. +type AppServiceEnvironmentsCreateOrUpdateWorkerPoolPoller struct { + pt *azcore.Poller +} + +// Done returns true if the LRO has reached a terminal state. +func (p *AppServiceEnvironmentsCreateOrUpdateWorkerPoolPoller) Done() bool { + return p.pt.Done() +} + +// Poll fetches the latest state of the LRO. It returns an HTTP response or error. +// If the LRO has completed successfully, the poller's state is updated and the HTTP +// response is returned. +// If the LRO has completed with failure or was cancelled, the poller's state is +// updated and the error is returned. +// If the LRO has not reached a terminal state, the poller's state is updated and +// the latest HTTP response is returned. +// If Poll fails, the poller's state is unmodified and the error is returned. +// Calling Poll on an LRO that has reached a terminal state will return the final +// HTTP response or error. +func (p *AppServiceEnvironmentsCreateOrUpdateWorkerPoolPoller) Poll(ctx context.Context) (*http.Response, error) { + return p.pt.Poll(ctx) +} + +// FinalResponse performs a final GET to the service and returns the final response +// for the polling operation. If there is an error performing the final GET then an error is returned. +// If the final GET succeeded then the final AppServiceEnvironmentsCreateOrUpdateWorkerPoolResponse will be returned. +func (p *AppServiceEnvironmentsCreateOrUpdateWorkerPoolPoller) FinalResponse(ctx context.Context) (AppServiceEnvironmentsCreateOrUpdateWorkerPoolResponse, error) { + respType := AppServiceEnvironmentsCreateOrUpdateWorkerPoolResponse{} + resp, err := p.pt.FinalResponse(ctx, &respType.WorkerPoolResource) + if err != nil { + return AppServiceEnvironmentsCreateOrUpdateWorkerPoolResponse{}, err + } + respType.RawResponse = resp + return respType, nil +} + +// ResumeToken returns a value representing the poller that can be used to resume +// the LRO at a later time. ResumeTokens are unique per service operation. +func (p *AppServiceEnvironmentsCreateOrUpdateWorkerPoolPoller) ResumeToken() (string, error) { + return p.pt.ResumeToken() +} + +// AppServiceEnvironmentsDeletePoller provides polling facilities until the operation reaches a terminal state. +type AppServiceEnvironmentsDeletePoller struct { + pt *azcore.Poller +} + +// Done returns true if the LRO has reached a terminal state. +func (p *AppServiceEnvironmentsDeletePoller) Done() bool { + return p.pt.Done() +} + +// Poll fetches the latest state of the LRO. It returns an HTTP response or error. +// If the LRO has completed successfully, the poller's state is updated and the HTTP +// response is returned. +// If the LRO has completed with failure or was cancelled, the poller's state is +// updated and the error is returned. +// If the LRO has not reached a terminal state, the poller's state is updated and +// the latest HTTP response is returned. +// If Poll fails, the poller's state is unmodified and the error is returned. +// Calling Poll on an LRO that has reached a terminal state will return the final +// HTTP response or error. +func (p *AppServiceEnvironmentsDeletePoller) Poll(ctx context.Context) (*http.Response, error) { + return p.pt.Poll(ctx) +} + +// FinalResponse performs a final GET to the service and returns the final response +// for the polling operation. If there is an error performing the final GET then an error is returned. +// If the final GET succeeded then the final AppServiceEnvironmentsDeleteResponse will be returned. +func (p *AppServiceEnvironmentsDeletePoller) FinalResponse(ctx context.Context) (AppServiceEnvironmentsDeleteResponse, error) { + respType := AppServiceEnvironmentsDeleteResponse{} + resp, err := p.pt.FinalResponse(ctx, nil) + if err != nil { + return AppServiceEnvironmentsDeleteResponse{}, err + } + respType.RawResponse = resp + return respType, nil +} + +// ResumeToken returns a value representing the poller that can be used to resume +// the LRO at a later time. ResumeTokens are unique per service operation. +func (p *AppServiceEnvironmentsDeletePoller) ResumeToken() (string, error) { + return p.pt.ResumeToken() +} + +// AppServiceEnvironmentsDeletePrivateEndpointConnectionPoller provides polling facilities until the operation reaches a terminal state. +type AppServiceEnvironmentsDeletePrivateEndpointConnectionPoller struct { + pt *azcore.Poller +} + +// Done returns true if the LRO has reached a terminal state. +func (p *AppServiceEnvironmentsDeletePrivateEndpointConnectionPoller) Done() bool { + return p.pt.Done() +} + +// Poll fetches the latest state of the LRO. It returns an HTTP response or error. +// If the LRO has completed successfully, the poller's state is updated and the HTTP +// response is returned. +// If the LRO has completed with failure or was cancelled, the poller's state is +// updated and the error is returned. +// If the LRO has not reached a terminal state, the poller's state is updated and +// the latest HTTP response is returned. +// If Poll fails, the poller's state is unmodified and the error is returned. +// Calling Poll on an LRO that has reached a terminal state will return the final +// HTTP response or error. +func (p *AppServiceEnvironmentsDeletePrivateEndpointConnectionPoller) Poll(ctx context.Context) (*http.Response, error) { + return p.pt.Poll(ctx) +} + +// FinalResponse performs a final GET to the service and returns the final response +// for the polling operation. If there is an error performing the final GET then an error is returned. +// If the final GET succeeded then the final AppServiceEnvironmentsDeletePrivateEndpointConnectionResponse will be returned. +func (p *AppServiceEnvironmentsDeletePrivateEndpointConnectionPoller) FinalResponse(ctx context.Context) (AppServiceEnvironmentsDeletePrivateEndpointConnectionResponse, error) { + respType := AppServiceEnvironmentsDeletePrivateEndpointConnectionResponse{} + resp, err := p.pt.FinalResponse(ctx, &respType.Object) + if err != nil { + return AppServiceEnvironmentsDeletePrivateEndpointConnectionResponse{}, err + } + respType.RawResponse = resp + return respType, nil +} + +// ResumeToken returns a value representing the poller that can be used to resume +// the LRO at a later time. ResumeTokens are unique per service operation. +func (p *AppServiceEnvironmentsDeletePrivateEndpointConnectionPoller) ResumeToken() (string, error) { + return p.pt.ResumeToken() +} + +// AppServiceEnvironmentsResumePoller provides polling facilities until the operation reaches a terminal state. +type AppServiceEnvironmentsResumePoller struct { + pt *azcore.Poller + client *AppServiceEnvironmentsClient +} + +// Done returns true if the LRO has reached a terminal state. +func (p *AppServiceEnvironmentsResumePoller) Done() bool { + return p.pt.Done() +} + +// Poll fetches the latest state of the LRO. It returns an HTTP response or error. +// If the LRO has completed successfully, the poller's state is updated and the HTTP +// response is returned. +// If the LRO has completed with failure or was cancelled, the poller's state is +// updated and the error is returned. +// If the LRO has not reached a terminal state, the poller's state is updated and +// the latest HTTP response is returned. +// If Poll fails, the poller's state is unmodified and the error is returned. +// Calling Poll on an LRO that has reached a terminal state will return the final +// HTTP response or error. +func (p *AppServiceEnvironmentsResumePoller) Poll(ctx context.Context) (*http.Response, error) { + return p.pt.Poll(ctx) +} + +// FinalResponse performs a final GET to the service and returns the final response +// for the polling operation. If there is an error performing the final GET then an error is returned. +// If the final GET succeeded then the final *AppServiceEnvironmentsResumePager will be returned. +func (p *AppServiceEnvironmentsResumePoller) FinalResponse(ctx context.Context) (*AppServiceEnvironmentsResumePager, error) { + respType := &AppServiceEnvironmentsResumePager{client: p.client} + if _, err := p.pt.FinalResponse(ctx, &respType.current.WebAppCollection); err != nil { + return nil, err + } + return respType, nil +} + +// ResumeToken returns a value representing the poller that can be used to resume +// the LRO at a later time. ResumeTokens are unique per service operation. +func (p *AppServiceEnvironmentsResumePoller) ResumeToken() (string, error) { + return p.pt.ResumeToken() +} + +// AppServiceEnvironmentsSuspendPoller provides polling facilities until the operation reaches a terminal state. +type AppServiceEnvironmentsSuspendPoller struct { + pt *azcore.Poller + client *AppServiceEnvironmentsClient +} + +// Done returns true if the LRO has reached a terminal state. +func (p *AppServiceEnvironmentsSuspendPoller) Done() bool { + return p.pt.Done() +} + +// Poll fetches the latest state of the LRO. It returns an HTTP response or error. +// If the LRO has completed successfully, the poller's state is updated and the HTTP +// response is returned. +// If the LRO has completed with failure or was cancelled, the poller's state is +// updated and the error is returned. +// If the LRO has not reached a terminal state, the poller's state is updated and +// the latest HTTP response is returned. +// If Poll fails, the poller's state is unmodified and the error is returned. +// Calling Poll on an LRO that has reached a terminal state will return the final +// HTTP response or error. +func (p *AppServiceEnvironmentsSuspendPoller) Poll(ctx context.Context) (*http.Response, error) { + return p.pt.Poll(ctx) +} + +// FinalResponse performs a final GET to the service and returns the final response +// for the polling operation. If there is an error performing the final GET then an error is returned. +// If the final GET succeeded then the final *AppServiceEnvironmentsSuspendPager will be returned. +func (p *AppServiceEnvironmentsSuspendPoller) FinalResponse(ctx context.Context) (*AppServiceEnvironmentsSuspendPager, error) { + respType := &AppServiceEnvironmentsSuspendPager{client: p.client} + if _, err := p.pt.FinalResponse(ctx, &respType.current.WebAppCollection); err != nil { + return nil, err + } + return respType, nil +} + +// ResumeToken returns a value representing the poller that can be used to resume +// the LRO at a later time. ResumeTokens are unique per service operation. +func (p *AppServiceEnvironmentsSuspendPoller) ResumeToken() (string, error) { + return p.pt.ResumeToken() +} + +// AppServicePlansCreateOrUpdatePoller provides polling facilities until the operation reaches a terminal state. +type AppServicePlansCreateOrUpdatePoller struct { + pt *azcore.Poller +} + +// Done returns true if the LRO has reached a terminal state. +func (p *AppServicePlansCreateOrUpdatePoller) Done() bool { + return p.pt.Done() +} + +// Poll fetches the latest state of the LRO. It returns an HTTP response or error. +// If the LRO has completed successfully, the poller's state is updated and the HTTP +// response is returned. +// If the LRO has completed with failure or was cancelled, the poller's state is +// updated and the error is returned. +// If the LRO has not reached a terminal state, the poller's state is updated and +// the latest HTTP response is returned. +// If Poll fails, the poller's state is unmodified and the error is returned. +// Calling Poll on an LRO that has reached a terminal state will return the final +// HTTP response or error. +func (p *AppServicePlansCreateOrUpdatePoller) Poll(ctx context.Context) (*http.Response, error) { + return p.pt.Poll(ctx) +} + +// FinalResponse performs a final GET to the service and returns the final response +// for the polling operation. If there is an error performing the final GET then an error is returned. +// If the final GET succeeded then the final AppServicePlansCreateOrUpdateResponse will be returned. +func (p *AppServicePlansCreateOrUpdatePoller) FinalResponse(ctx context.Context) (AppServicePlansCreateOrUpdateResponse, error) { + respType := AppServicePlansCreateOrUpdateResponse{} + resp, err := p.pt.FinalResponse(ctx, &respType.AppServicePlan) + if err != nil { + return AppServicePlansCreateOrUpdateResponse{}, err + } + respType.RawResponse = resp + return respType, nil +} + +// ResumeToken returns a value representing the poller that can be used to resume +// the LRO at a later time. ResumeTokens are unique per service operation. +func (p *AppServicePlansCreateOrUpdatePoller) ResumeToken() (string, error) { + return p.pt.ResumeToken() +} + +// DomainsCreateOrUpdatePoller provides polling facilities until the operation reaches a terminal state. +type DomainsCreateOrUpdatePoller struct { + pt *azcore.Poller +} + +// Done returns true if the LRO has reached a terminal state. +func (p *DomainsCreateOrUpdatePoller) Done() bool { + return p.pt.Done() +} + +// Poll fetches the latest state of the LRO. It returns an HTTP response or error. +// If the LRO has completed successfully, the poller's state is updated and the HTTP +// response is returned. +// If the LRO has completed with failure or was cancelled, the poller's state is +// updated and the error is returned. +// If the LRO has not reached a terminal state, the poller's state is updated and +// the latest HTTP response is returned. +// If Poll fails, the poller's state is unmodified and the error is returned. +// Calling Poll on an LRO that has reached a terminal state will return the final +// HTTP response or error. +func (p *DomainsCreateOrUpdatePoller) Poll(ctx context.Context) (*http.Response, error) { + return p.pt.Poll(ctx) +} + +// FinalResponse performs a final GET to the service and returns the final response +// for the polling operation. If there is an error performing the final GET then an error is returned. +// If the final GET succeeded then the final DomainsCreateOrUpdateResponse will be returned. +func (p *DomainsCreateOrUpdatePoller) FinalResponse(ctx context.Context) (DomainsCreateOrUpdateResponse, error) { + respType := DomainsCreateOrUpdateResponse{} + resp, err := p.pt.FinalResponse(ctx, &respType.Domain) + if err != nil { + return DomainsCreateOrUpdateResponse{}, err + } + respType.RawResponse = resp + return respType, nil +} + +// ResumeToken returns a value representing the poller that can be used to resume +// the LRO at a later time. ResumeTokens are unique per service operation. +func (p *DomainsCreateOrUpdatePoller) ResumeToken() (string, error) { + return p.pt.ResumeToken() +} + +// KubeEnvironmentsCreateOrUpdatePoller provides polling facilities until the operation reaches a terminal state. +type KubeEnvironmentsCreateOrUpdatePoller struct { + pt *azcore.Poller +} + +// Done returns true if the LRO has reached a terminal state. +func (p *KubeEnvironmentsCreateOrUpdatePoller) Done() bool { + return p.pt.Done() +} + +// Poll fetches the latest state of the LRO. It returns an HTTP response or error. +// If the LRO has completed successfully, the poller's state is updated and the HTTP +// response is returned. +// If the LRO has completed with failure or was cancelled, the poller's state is +// updated and the error is returned. +// If the LRO has not reached a terminal state, the poller's state is updated and +// the latest HTTP response is returned. +// If Poll fails, the poller's state is unmodified and the error is returned. +// Calling Poll on an LRO that has reached a terminal state will return the final +// HTTP response or error. +func (p *KubeEnvironmentsCreateOrUpdatePoller) Poll(ctx context.Context) (*http.Response, error) { + return p.pt.Poll(ctx) +} + +// FinalResponse performs a final GET to the service and returns the final response +// for the polling operation. If there is an error performing the final GET then an error is returned. +// If the final GET succeeded then the final KubeEnvironmentsCreateOrUpdateResponse will be returned. +func (p *KubeEnvironmentsCreateOrUpdatePoller) FinalResponse(ctx context.Context) (KubeEnvironmentsCreateOrUpdateResponse, error) { + respType := KubeEnvironmentsCreateOrUpdateResponse{} + resp, err := p.pt.FinalResponse(ctx, &respType.KubeEnvironment) + if err != nil { + return KubeEnvironmentsCreateOrUpdateResponse{}, err + } + respType.RawResponse = resp + return respType, nil +} + +// ResumeToken returns a value representing the poller that can be used to resume +// the LRO at a later time. ResumeTokens are unique per service operation. +func (p *KubeEnvironmentsCreateOrUpdatePoller) ResumeToken() (string, error) { + return p.pt.ResumeToken() +} + +// KubeEnvironmentsDeletePoller provides polling facilities until the operation reaches a terminal state. +type KubeEnvironmentsDeletePoller struct { + pt *azcore.Poller +} + +// Done returns true if the LRO has reached a terminal state. +func (p *KubeEnvironmentsDeletePoller) Done() bool { + return p.pt.Done() +} + +// Poll fetches the latest state of the LRO. It returns an HTTP response or error. +// If the LRO has completed successfully, the poller's state is updated and the HTTP +// response is returned. +// If the LRO has completed with failure or was cancelled, the poller's state is +// updated and the error is returned. +// If the LRO has not reached a terminal state, the poller's state is updated and +// the latest HTTP response is returned. +// If Poll fails, the poller's state is unmodified and the error is returned. +// Calling Poll on an LRO that has reached a terminal state will return the final +// HTTP response or error. +func (p *KubeEnvironmentsDeletePoller) Poll(ctx context.Context) (*http.Response, error) { + return p.pt.Poll(ctx) +} + +// FinalResponse performs a final GET to the service and returns the final response +// for the polling operation. If there is an error performing the final GET then an error is returned. +// If the final GET succeeded then the final KubeEnvironmentsDeleteResponse will be returned. +func (p *KubeEnvironmentsDeletePoller) FinalResponse(ctx context.Context) (KubeEnvironmentsDeleteResponse, error) { + respType := KubeEnvironmentsDeleteResponse{} + resp, err := p.pt.FinalResponse(ctx, nil) + if err != nil { + return KubeEnvironmentsDeleteResponse{}, err + } + respType.RawResponse = resp + return respType, nil +} + +// ResumeToken returns a value representing the poller that can be used to resume +// the LRO at a later time. ResumeTokens are unique per service operation. +func (p *KubeEnvironmentsDeletePoller) ResumeToken() (string, error) { + return p.pt.ResumeToken() +} + +// StaticSitesApproveOrRejectPrivateEndpointConnectionPoller provides polling facilities until the operation reaches a terminal state. +type StaticSitesApproveOrRejectPrivateEndpointConnectionPoller struct { + pt *azcore.Poller +} + +// Done returns true if the LRO has reached a terminal state. +func (p *StaticSitesApproveOrRejectPrivateEndpointConnectionPoller) Done() bool { + return p.pt.Done() +} + +// Poll fetches the latest state of the LRO. It returns an HTTP response or error. +// If the LRO has completed successfully, the poller's state is updated and the HTTP +// response is returned. +// If the LRO has completed with failure or was cancelled, the poller's state is +// updated and the error is returned. +// If the LRO has not reached a terminal state, the poller's state is updated and +// the latest HTTP response is returned. +// If Poll fails, the poller's state is unmodified and the error is returned. +// Calling Poll on an LRO that has reached a terminal state will return the final +// HTTP response or error. +func (p *StaticSitesApproveOrRejectPrivateEndpointConnectionPoller) Poll(ctx context.Context) (*http.Response, error) { + return p.pt.Poll(ctx) +} + +// FinalResponse performs a final GET to the service and returns the final response +// for the polling operation. If there is an error performing the final GET then an error is returned. +// If the final GET succeeded then the final StaticSitesApproveOrRejectPrivateEndpointConnectionResponse will be returned. +func (p *StaticSitesApproveOrRejectPrivateEndpointConnectionPoller) FinalResponse(ctx context.Context) (StaticSitesApproveOrRejectPrivateEndpointConnectionResponse, error) { + respType := StaticSitesApproveOrRejectPrivateEndpointConnectionResponse{} + resp, err := p.pt.FinalResponse(ctx, &respType.RemotePrivateEndpointConnectionARMResource) + if err != nil { + return StaticSitesApproveOrRejectPrivateEndpointConnectionResponse{}, err + } + respType.RawResponse = resp + return respType, nil +} + +// ResumeToken returns a value representing the poller that can be used to resume +// the LRO at a later time. ResumeTokens are unique per service operation. +func (p *StaticSitesApproveOrRejectPrivateEndpointConnectionPoller) ResumeToken() (string, error) { + return p.pt.ResumeToken() +} + +// StaticSitesCreateOrUpdateStaticSiteCustomDomainPoller provides polling facilities until the operation reaches a terminal state. +type StaticSitesCreateOrUpdateStaticSiteCustomDomainPoller struct { + pt *azcore.Poller +} + +// Done returns true if the LRO has reached a terminal state. +func (p *StaticSitesCreateOrUpdateStaticSiteCustomDomainPoller) Done() bool { + return p.pt.Done() +} + +// Poll fetches the latest state of the LRO. It returns an HTTP response or error. +// If the LRO has completed successfully, the poller's state is updated and the HTTP +// response is returned. +// If the LRO has completed with failure or was cancelled, the poller's state is +// updated and the error is returned. +// If the LRO has not reached a terminal state, the poller's state is updated and +// the latest HTTP response is returned. +// If Poll fails, the poller's state is unmodified and the error is returned. +// Calling Poll on an LRO that has reached a terminal state will return the final +// HTTP response or error. +func (p *StaticSitesCreateOrUpdateStaticSiteCustomDomainPoller) Poll(ctx context.Context) (*http.Response, error) { + return p.pt.Poll(ctx) +} + +// FinalResponse performs a final GET to the service and returns the final response +// for the polling operation. If there is an error performing the final GET then an error is returned. +// If the final GET succeeded then the final StaticSitesCreateOrUpdateStaticSiteCustomDomainResponse will be returned. +func (p *StaticSitesCreateOrUpdateStaticSiteCustomDomainPoller) FinalResponse(ctx context.Context) (StaticSitesCreateOrUpdateStaticSiteCustomDomainResponse, error) { + respType := StaticSitesCreateOrUpdateStaticSiteCustomDomainResponse{} + resp, err := p.pt.FinalResponse(ctx, &respType.StaticSiteCustomDomainOverviewARMResource) + if err != nil { + return StaticSitesCreateOrUpdateStaticSiteCustomDomainResponse{}, err + } + respType.RawResponse = resp + return respType, nil +} + +// ResumeToken returns a value representing the poller that can be used to resume +// the LRO at a later time. ResumeTokens are unique per service operation. +func (p *StaticSitesCreateOrUpdateStaticSiteCustomDomainPoller) ResumeToken() (string, error) { + return p.pt.ResumeToken() +} + +// StaticSitesCreateOrUpdateStaticSitePoller provides polling facilities until the operation reaches a terminal state. +type StaticSitesCreateOrUpdateStaticSitePoller struct { + pt *azcore.Poller +} + +// Done returns true if the LRO has reached a terminal state. +func (p *StaticSitesCreateOrUpdateStaticSitePoller) Done() bool { + return p.pt.Done() +} + +// Poll fetches the latest state of the LRO. It returns an HTTP response or error. +// If the LRO has completed successfully, the poller's state is updated and the HTTP +// response is returned. +// If the LRO has completed with failure or was cancelled, the poller's state is +// updated and the error is returned. +// If the LRO has not reached a terminal state, the poller's state is updated and +// the latest HTTP response is returned. +// If Poll fails, the poller's state is unmodified and the error is returned. +// Calling Poll on an LRO that has reached a terminal state will return the final +// HTTP response or error. +func (p *StaticSitesCreateOrUpdateStaticSitePoller) Poll(ctx context.Context) (*http.Response, error) { + return p.pt.Poll(ctx) +} + +// FinalResponse performs a final GET to the service and returns the final response +// for the polling operation. If there is an error performing the final GET then an error is returned. +// If the final GET succeeded then the final StaticSitesCreateOrUpdateStaticSiteResponse will be returned. +func (p *StaticSitesCreateOrUpdateStaticSitePoller) FinalResponse(ctx context.Context) (StaticSitesCreateOrUpdateStaticSiteResponse, error) { + respType := StaticSitesCreateOrUpdateStaticSiteResponse{} + resp, err := p.pt.FinalResponse(ctx, &respType.StaticSiteARMResource) + if err != nil { + return StaticSitesCreateOrUpdateStaticSiteResponse{}, err + } + respType.RawResponse = resp + return respType, nil +} + +// ResumeToken returns a value representing the poller that can be used to resume +// the LRO at a later time. ResumeTokens are unique per service operation. +func (p *StaticSitesCreateOrUpdateStaticSitePoller) ResumeToken() (string, error) { + return p.pt.ResumeToken() +} + +// StaticSitesCreateZipDeploymentForStaticSiteBuildPoller provides polling facilities until the operation reaches a terminal state. +type StaticSitesCreateZipDeploymentForStaticSiteBuildPoller struct { + pt *azcore.Poller +} + +// Done returns true if the LRO has reached a terminal state. +func (p *StaticSitesCreateZipDeploymentForStaticSiteBuildPoller) Done() bool { + return p.pt.Done() +} + +// Poll fetches the latest state of the LRO. It returns an HTTP response or error. +// If the LRO has completed successfully, the poller's state is updated and the HTTP +// response is returned. +// If the LRO has completed with failure or was cancelled, the poller's state is +// updated and the error is returned. +// If the LRO has not reached a terminal state, the poller's state is updated and +// the latest HTTP response is returned. +// If Poll fails, the poller's state is unmodified and the error is returned. +// Calling Poll on an LRO that has reached a terminal state will return the final +// HTTP response or error. +func (p *StaticSitesCreateZipDeploymentForStaticSiteBuildPoller) Poll(ctx context.Context) (*http.Response, error) { + return p.pt.Poll(ctx) +} + +// FinalResponse performs a final GET to the service and returns the final response +// for the polling operation. If there is an error performing the final GET then an error is returned. +// If the final GET succeeded then the final StaticSitesCreateZipDeploymentForStaticSiteBuildResponse will be returned. +func (p *StaticSitesCreateZipDeploymentForStaticSiteBuildPoller) FinalResponse(ctx context.Context) (StaticSitesCreateZipDeploymentForStaticSiteBuildResponse, error) { + respType := StaticSitesCreateZipDeploymentForStaticSiteBuildResponse{} + resp, err := p.pt.FinalResponse(ctx, nil) + if err != nil { + return StaticSitesCreateZipDeploymentForStaticSiteBuildResponse{}, err + } + respType.RawResponse = resp + return respType, nil +} + +// ResumeToken returns a value representing the poller that can be used to resume +// the LRO at a later time. ResumeTokens are unique per service operation. +func (p *StaticSitesCreateZipDeploymentForStaticSiteBuildPoller) ResumeToken() (string, error) { + return p.pt.ResumeToken() +} + +// StaticSitesCreateZipDeploymentForStaticSitePoller provides polling facilities until the operation reaches a terminal state. +type StaticSitesCreateZipDeploymentForStaticSitePoller struct { + pt *azcore.Poller +} + +// Done returns true if the LRO has reached a terminal state. +func (p *StaticSitesCreateZipDeploymentForStaticSitePoller) Done() bool { + return p.pt.Done() +} + +// Poll fetches the latest state of the LRO. It returns an HTTP response or error. +// If the LRO has completed successfully, the poller's state is updated and the HTTP +// response is returned. +// If the LRO has completed with failure or was cancelled, the poller's state is +// updated and the error is returned. +// If the LRO has not reached a terminal state, the poller's state is updated and +// the latest HTTP response is returned. +// If Poll fails, the poller's state is unmodified and the error is returned. +// Calling Poll on an LRO that has reached a terminal state will return the final +// HTTP response or error. +func (p *StaticSitesCreateZipDeploymentForStaticSitePoller) Poll(ctx context.Context) (*http.Response, error) { + return p.pt.Poll(ctx) +} + +// FinalResponse performs a final GET to the service and returns the final response +// for the polling operation. If there is an error performing the final GET then an error is returned. +// If the final GET succeeded then the final StaticSitesCreateZipDeploymentForStaticSiteResponse will be returned. +func (p *StaticSitesCreateZipDeploymentForStaticSitePoller) FinalResponse(ctx context.Context) (StaticSitesCreateZipDeploymentForStaticSiteResponse, error) { + respType := StaticSitesCreateZipDeploymentForStaticSiteResponse{} + resp, err := p.pt.FinalResponse(ctx, nil) + if err != nil { + return StaticSitesCreateZipDeploymentForStaticSiteResponse{}, err + } + respType.RawResponse = resp + return respType, nil +} + +// ResumeToken returns a value representing the poller that can be used to resume +// the LRO at a later time. ResumeTokens are unique per service operation. +func (p *StaticSitesCreateZipDeploymentForStaticSitePoller) ResumeToken() (string, error) { + return p.pt.ResumeToken() +} + +// StaticSitesDeletePrivateEndpointConnectionPoller provides polling facilities until the operation reaches a terminal state. +type StaticSitesDeletePrivateEndpointConnectionPoller struct { + pt *azcore.Poller +} + +// Done returns true if the LRO has reached a terminal state. +func (p *StaticSitesDeletePrivateEndpointConnectionPoller) Done() bool { + return p.pt.Done() +} + +// Poll fetches the latest state of the LRO. It returns an HTTP response or error. +// If the LRO has completed successfully, the poller's state is updated and the HTTP +// response is returned. +// If the LRO has completed with failure or was cancelled, the poller's state is +// updated and the error is returned. +// If the LRO has not reached a terminal state, the poller's state is updated and +// the latest HTTP response is returned. +// If Poll fails, the poller's state is unmodified and the error is returned. +// Calling Poll on an LRO that has reached a terminal state will return the final +// HTTP response or error. +func (p *StaticSitesDeletePrivateEndpointConnectionPoller) Poll(ctx context.Context) (*http.Response, error) { + return p.pt.Poll(ctx) +} + +// FinalResponse performs a final GET to the service and returns the final response +// for the polling operation. If there is an error performing the final GET then an error is returned. +// If the final GET succeeded then the final StaticSitesDeletePrivateEndpointConnectionResponse will be returned. +func (p *StaticSitesDeletePrivateEndpointConnectionPoller) FinalResponse(ctx context.Context) (StaticSitesDeletePrivateEndpointConnectionResponse, error) { + respType := StaticSitesDeletePrivateEndpointConnectionResponse{} + resp, err := p.pt.FinalResponse(ctx, &respType.Object) + if err != nil { + return StaticSitesDeletePrivateEndpointConnectionResponse{}, err + } + respType.RawResponse = resp + return respType, nil +} + +// ResumeToken returns a value representing the poller that can be used to resume +// the LRO at a later time. ResumeTokens are unique per service operation. +func (p *StaticSitesDeletePrivateEndpointConnectionPoller) ResumeToken() (string, error) { + return p.pt.ResumeToken() +} + +// StaticSitesDeleteStaticSiteBuildPoller provides polling facilities until the operation reaches a terminal state. +type StaticSitesDeleteStaticSiteBuildPoller struct { + pt *azcore.Poller +} + +// Done returns true if the LRO has reached a terminal state. +func (p *StaticSitesDeleteStaticSiteBuildPoller) Done() bool { + return p.pt.Done() +} + +// Poll fetches the latest state of the LRO. It returns an HTTP response or error. +// If the LRO has completed successfully, the poller's state is updated and the HTTP +// response is returned. +// If the LRO has completed with failure or was cancelled, the poller's state is +// updated and the error is returned. +// If the LRO has not reached a terminal state, the poller's state is updated and +// the latest HTTP response is returned. +// If Poll fails, the poller's state is unmodified and the error is returned. +// Calling Poll on an LRO that has reached a terminal state will return the final +// HTTP response or error. +func (p *StaticSitesDeleteStaticSiteBuildPoller) Poll(ctx context.Context) (*http.Response, error) { + return p.pt.Poll(ctx) +} + +// FinalResponse performs a final GET to the service and returns the final response +// for the polling operation. If there is an error performing the final GET then an error is returned. +// If the final GET succeeded then the final StaticSitesDeleteStaticSiteBuildResponse will be returned. +func (p *StaticSitesDeleteStaticSiteBuildPoller) FinalResponse(ctx context.Context) (StaticSitesDeleteStaticSiteBuildResponse, error) { + respType := StaticSitesDeleteStaticSiteBuildResponse{} + resp, err := p.pt.FinalResponse(ctx, nil) + if err != nil { + return StaticSitesDeleteStaticSiteBuildResponse{}, err + } + respType.RawResponse = resp + return respType, nil +} + +// ResumeToken returns a value representing the poller that can be used to resume +// the LRO at a later time. ResumeTokens are unique per service operation. +func (p *StaticSitesDeleteStaticSiteBuildPoller) ResumeToken() (string, error) { + return p.pt.ResumeToken() +} + +// StaticSitesDeleteStaticSiteCustomDomainPoller provides polling facilities until the operation reaches a terminal state. +type StaticSitesDeleteStaticSiteCustomDomainPoller struct { + pt *azcore.Poller +} + +// Done returns true if the LRO has reached a terminal state. +func (p *StaticSitesDeleteStaticSiteCustomDomainPoller) Done() bool { + return p.pt.Done() +} + +// Poll fetches the latest state of the LRO. It returns an HTTP response or error. +// If the LRO has completed successfully, the poller's state is updated and the HTTP +// response is returned. +// If the LRO has completed with failure or was cancelled, the poller's state is +// updated and the error is returned. +// If the LRO has not reached a terminal state, the poller's state is updated and +// the latest HTTP response is returned. +// If Poll fails, the poller's state is unmodified and the error is returned. +// Calling Poll on an LRO that has reached a terminal state will return the final +// HTTP response or error. +func (p *StaticSitesDeleteStaticSiteCustomDomainPoller) Poll(ctx context.Context) (*http.Response, error) { + return p.pt.Poll(ctx) +} + +// FinalResponse performs a final GET to the service and returns the final response +// for the polling operation. If there is an error performing the final GET then an error is returned. +// If the final GET succeeded then the final StaticSitesDeleteStaticSiteCustomDomainResponse will be returned. +func (p *StaticSitesDeleteStaticSiteCustomDomainPoller) FinalResponse(ctx context.Context) (StaticSitesDeleteStaticSiteCustomDomainResponse, error) { + respType := StaticSitesDeleteStaticSiteCustomDomainResponse{} + resp, err := p.pt.FinalResponse(ctx, nil) + if err != nil { + return StaticSitesDeleteStaticSiteCustomDomainResponse{}, err + } + respType.RawResponse = resp + return respType, nil +} + +// ResumeToken returns a value representing the poller that can be used to resume +// the LRO at a later time. ResumeTokens are unique per service operation. +func (p *StaticSitesDeleteStaticSiteCustomDomainPoller) ResumeToken() (string, error) { + return p.pt.ResumeToken() +} + +// StaticSitesDeleteStaticSitePoller provides polling facilities until the operation reaches a terminal state. +type StaticSitesDeleteStaticSitePoller struct { + pt *azcore.Poller +} + +// Done returns true if the LRO has reached a terminal state. +func (p *StaticSitesDeleteStaticSitePoller) Done() bool { + return p.pt.Done() +} + +// Poll fetches the latest state of the LRO. It returns an HTTP response or error. +// If the LRO has completed successfully, the poller's state is updated and the HTTP +// response is returned. +// If the LRO has completed with failure or was cancelled, the poller's state is +// updated and the error is returned. +// If the LRO has not reached a terminal state, the poller's state is updated and +// the latest HTTP response is returned. +// If Poll fails, the poller's state is unmodified and the error is returned. +// Calling Poll on an LRO that has reached a terminal state will return the final +// HTTP response or error. +func (p *StaticSitesDeleteStaticSitePoller) Poll(ctx context.Context) (*http.Response, error) { + return p.pt.Poll(ctx) +} + +// FinalResponse performs a final GET to the service and returns the final response +// for the polling operation. If there is an error performing the final GET then an error is returned. +// If the final GET succeeded then the final StaticSitesDeleteStaticSiteResponse will be returned. +func (p *StaticSitesDeleteStaticSitePoller) FinalResponse(ctx context.Context) (StaticSitesDeleteStaticSiteResponse, error) { + respType := StaticSitesDeleteStaticSiteResponse{} + resp, err := p.pt.FinalResponse(ctx, nil) + if err != nil { + return StaticSitesDeleteStaticSiteResponse{}, err + } + respType.RawResponse = resp + return respType, nil +} + +// ResumeToken returns a value representing the poller that can be used to resume +// the LRO at a later time. ResumeTokens are unique per service operation. +func (p *StaticSitesDeleteStaticSitePoller) ResumeToken() (string, error) { + return p.pt.ResumeToken() +} + +// StaticSitesDetachStaticSitePoller provides polling facilities until the operation reaches a terminal state. +type StaticSitesDetachStaticSitePoller struct { + pt *azcore.Poller +} + +// Done returns true if the LRO has reached a terminal state. +func (p *StaticSitesDetachStaticSitePoller) Done() bool { + return p.pt.Done() +} + +// Poll fetches the latest state of the LRO. It returns an HTTP response or error. +// If the LRO has completed successfully, the poller's state is updated and the HTTP +// response is returned. +// If the LRO has completed with failure or was cancelled, the poller's state is +// updated and the error is returned. +// If the LRO has not reached a terminal state, the poller's state is updated and +// the latest HTTP response is returned. +// If Poll fails, the poller's state is unmodified and the error is returned. +// Calling Poll on an LRO that has reached a terminal state will return the final +// HTTP response or error. +func (p *StaticSitesDetachStaticSitePoller) Poll(ctx context.Context) (*http.Response, error) { + return p.pt.Poll(ctx) +} + +// FinalResponse performs a final GET to the service and returns the final response +// for the polling operation. If there is an error performing the final GET then an error is returned. +// If the final GET succeeded then the final StaticSitesDetachStaticSiteResponse will be returned. +func (p *StaticSitesDetachStaticSitePoller) FinalResponse(ctx context.Context) (StaticSitesDetachStaticSiteResponse, error) { + respType := StaticSitesDetachStaticSiteResponse{} + resp, err := p.pt.FinalResponse(ctx, nil) + if err != nil { + return StaticSitesDetachStaticSiteResponse{}, err + } + respType.RawResponse = resp + return respType, nil +} + +// ResumeToken returns a value representing the poller that can be used to resume +// the LRO at a later time. ResumeTokens are unique per service operation. +func (p *StaticSitesDetachStaticSitePoller) ResumeToken() (string, error) { + return p.pt.ResumeToken() +} + +// StaticSitesRegisterUserProvidedFunctionAppWithStaticSiteBuildPoller provides polling facilities until the operation reaches a terminal state. +type StaticSitesRegisterUserProvidedFunctionAppWithStaticSiteBuildPoller struct { + pt *azcore.Poller +} + +// Done returns true if the LRO has reached a terminal state. +func (p *StaticSitesRegisterUserProvidedFunctionAppWithStaticSiteBuildPoller) Done() bool { + return p.pt.Done() +} + +// Poll fetches the latest state of the LRO. It returns an HTTP response or error. +// If the LRO has completed successfully, the poller's state is updated and the HTTP +// response is returned. +// If the LRO has completed with failure or was cancelled, the poller's state is +// updated and the error is returned. +// If the LRO has not reached a terminal state, the poller's state is updated and +// the latest HTTP response is returned. +// If Poll fails, the poller's state is unmodified and the error is returned. +// Calling Poll on an LRO that has reached a terminal state will return the final +// HTTP response or error. +func (p *StaticSitesRegisterUserProvidedFunctionAppWithStaticSiteBuildPoller) Poll(ctx context.Context) (*http.Response, error) { + return p.pt.Poll(ctx) +} + +// FinalResponse performs a final GET to the service and returns the final response +// for the polling operation. If there is an error performing the final GET then an error is returned. +// If the final GET succeeded then the final StaticSitesRegisterUserProvidedFunctionAppWithStaticSiteBuildResponse will be returned. +func (p *StaticSitesRegisterUserProvidedFunctionAppWithStaticSiteBuildPoller) FinalResponse(ctx context.Context) (StaticSitesRegisterUserProvidedFunctionAppWithStaticSiteBuildResponse, error) { + respType := StaticSitesRegisterUserProvidedFunctionAppWithStaticSiteBuildResponse{} + resp, err := p.pt.FinalResponse(ctx, &respType.StaticSiteUserProvidedFunctionAppARMResource) + if err != nil { + return StaticSitesRegisterUserProvidedFunctionAppWithStaticSiteBuildResponse{}, err + } + respType.RawResponse = resp + return respType, nil +} + +// ResumeToken returns a value representing the poller that can be used to resume +// the LRO at a later time. ResumeTokens are unique per service operation. +func (p *StaticSitesRegisterUserProvidedFunctionAppWithStaticSiteBuildPoller) ResumeToken() (string, error) { + return p.pt.ResumeToken() +} + +// StaticSitesRegisterUserProvidedFunctionAppWithStaticSitePoller provides polling facilities until the operation reaches a terminal state. +type StaticSitesRegisterUserProvidedFunctionAppWithStaticSitePoller struct { + pt *azcore.Poller +} + +// Done returns true if the LRO has reached a terminal state. +func (p *StaticSitesRegisterUserProvidedFunctionAppWithStaticSitePoller) Done() bool { + return p.pt.Done() +} + +// Poll fetches the latest state of the LRO. It returns an HTTP response or error. +// If the LRO has completed successfully, the poller's state is updated and the HTTP +// response is returned. +// If the LRO has completed with failure or was cancelled, the poller's state is +// updated and the error is returned. +// If the LRO has not reached a terminal state, the poller's state is updated and +// the latest HTTP response is returned. +// If Poll fails, the poller's state is unmodified and the error is returned. +// Calling Poll on an LRO that has reached a terminal state will return the final +// HTTP response or error. +func (p *StaticSitesRegisterUserProvidedFunctionAppWithStaticSitePoller) Poll(ctx context.Context) (*http.Response, error) { + return p.pt.Poll(ctx) +} + +// FinalResponse performs a final GET to the service and returns the final response +// for the polling operation. If there is an error performing the final GET then an error is returned. +// If the final GET succeeded then the final StaticSitesRegisterUserProvidedFunctionAppWithStaticSiteResponse will be returned. +func (p *StaticSitesRegisterUserProvidedFunctionAppWithStaticSitePoller) FinalResponse(ctx context.Context) (StaticSitesRegisterUserProvidedFunctionAppWithStaticSiteResponse, error) { + respType := StaticSitesRegisterUserProvidedFunctionAppWithStaticSiteResponse{} + resp, err := p.pt.FinalResponse(ctx, &respType.StaticSiteUserProvidedFunctionAppARMResource) + if err != nil { + return StaticSitesRegisterUserProvidedFunctionAppWithStaticSiteResponse{}, err + } + respType.RawResponse = resp + return respType, nil +} + +// ResumeToken returns a value representing the poller that can be used to resume +// the LRO at a later time. ResumeTokens are unique per service operation. +func (p *StaticSitesRegisterUserProvidedFunctionAppWithStaticSitePoller) ResumeToken() (string, error) { + return p.pt.ResumeToken() +} + +// StaticSitesValidateCustomDomainCanBeAddedToStaticSitePoller provides polling facilities until the operation reaches a terminal state. +type StaticSitesValidateCustomDomainCanBeAddedToStaticSitePoller struct { + pt *azcore.Poller +} + +// Done returns true if the LRO has reached a terminal state. +func (p *StaticSitesValidateCustomDomainCanBeAddedToStaticSitePoller) Done() bool { + return p.pt.Done() +} + +// Poll fetches the latest state of the LRO. It returns an HTTP response or error. +// If the LRO has completed successfully, the poller's state is updated and the HTTP +// response is returned. +// If the LRO has completed with failure or was cancelled, the poller's state is +// updated and the error is returned. +// If the LRO has not reached a terminal state, the poller's state is updated and +// the latest HTTP response is returned. +// If Poll fails, the poller's state is unmodified and the error is returned. +// Calling Poll on an LRO that has reached a terminal state will return the final +// HTTP response or error. +func (p *StaticSitesValidateCustomDomainCanBeAddedToStaticSitePoller) Poll(ctx context.Context) (*http.Response, error) { + return p.pt.Poll(ctx) +} + +// FinalResponse performs a final GET to the service and returns the final response +// for the polling operation. If there is an error performing the final GET then an error is returned. +// If the final GET succeeded then the final StaticSitesValidateCustomDomainCanBeAddedToStaticSiteResponse will be returned. +func (p *StaticSitesValidateCustomDomainCanBeAddedToStaticSitePoller) FinalResponse(ctx context.Context) (StaticSitesValidateCustomDomainCanBeAddedToStaticSiteResponse, error) { + respType := StaticSitesValidateCustomDomainCanBeAddedToStaticSiteResponse{} + resp, err := p.pt.FinalResponse(ctx, nil) + if err != nil { + return StaticSitesValidateCustomDomainCanBeAddedToStaticSiteResponse{}, err + } + respType.RawResponse = resp + return respType, nil +} + +// ResumeToken returns a value representing the poller that can be used to resume +// the LRO at a later time. ResumeTokens are unique per service operation. +func (p *StaticSitesValidateCustomDomainCanBeAddedToStaticSitePoller) ResumeToken() (string, error) { + return p.pt.ResumeToken() +} + +// WebAppsApproveOrRejectPrivateEndpointConnectionPoller provides polling facilities until the operation reaches a terminal state. +type WebAppsApproveOrRejectPrivateEndpointConnectionPoller struct { + pt *azcore.Poller +} + +// Done returns true if the LRO has reached a terminal state. +func (p *WebAppsApproveOrRejectPrivateEndpointConnectionPoller) Done() bool { + return p.pt.Done() +} + +// Poll fetches the latest state of the LRO. It returns an HTTP response or error. +// If the LRO has completed successfully, the poller's state is updated and the HTTP +// response is returned. +// If the LRO has completed with failure or was cancelled, the poller's state is +// updated and the error is returned. +// If the LRO has not reached a terminal state, the poller's state is updated and +// the latest HTTP response is returned. +// If Poll fails, the poller's state is unmodified and the error is returned. +// Calling Poll on an LRO that has reached a terminal state will return the final +// HTTP response or error. +func (p *WebAppsApproveOrRejectPrivateEndpointConnectionPoller) Poll(ctx context.Context) (*http.Response, error) { + return p.pt.Poll(ctx) +} + +// FinalResponse performs a final GET to the service and returns the final response +// for the polling operation. If there is an error performing the final GET then an error is returned. +// If the final GET succeeded then the final WebAppsApproveOrRejectPrivateEndpointConnectionResponse will be returned. +func (p *WebAppsApproveOrRejectPrivateEndpointConnectionPoller) FinalResponse(ctx context.Context) (WebAppsApproveOrRejectPrivateEndpointConnectionResponse, error) { + respType := WebAppsApproveOrRejectPrivateEndpointConnectionResponse{} + resp, err := p.pt.FinalResponse(ctx, &respType.RemotePrivateEndpointConnectionARMResource) + if err != nil { + return WebAppsApproveOrRejectPrivateEndpointConnectionResponse{}, err + } + respType.RawResponse = resp + return respType, nil +} + +// ResumeToken returns a value representing the poller that can be used to resume +// the LRO at a later time. ResumeTokens are unique per service operation. +func (p *WebAppsApproveOrRejectPrivateEndpointConnectionPoller) ResumeToken() (string, error) { + return p.pt.ResumeToken() +} + +// WebAppsApproveOrRejectPrivateEndpointConnectionSlotPoller provides polling facilities until the operation reaches a terminal state. +type WebAppsApproveOrRejectPrivateEndpointConnectionSlotPoller struct { + pt *azcore.Poller +} + +// Done returns true if the LRO has reached a terminal state. +func (p *WebAppsApproveOrRejectPrivateEndpointConnectionSlotPoller) Done() bool { + return p.pt.Done() +} + +// Poll fetches the latest state of the LRO. It returns an HTTP response or error. +// If the LRO has completed successfully, the poller's state is updated and the HTTP +// response is returned. +// If the LRO has completed with failure or was cancelled, the poller's state is +// updated and the error is returned. +// If the LRO has not reached a terminal state, the poller's state is updated and +// the latest HTTP response is returned. +// If Poll fails, the poller's state is unmodified and the error is returned. +// Calling Poll on an LRO that has reached a terminal state will return the final +// HTTP response or error. +func (p *WebAppsApproveOrRejectPrivateEndpointConnectionSlotPoller) Poll(ctx context.Context) (*http.Response, error) { + return p.pt.Poll(ctx) +} + +// FinalResponse performs a final GET to the service and returns the final response +// for the polling operation. If there is an error performing the final GET then an error is returned. +// If the final GET succeeded then the final WebAppsApproveOrRejectPrivateEndpointConnectionSlotResponse will be returned. +func (p *WebAppsApproveOrRejectPrivateEndpointConnectionSlotPoller) FinalResponse(ctx context.Context) (WebAppsApproveOrRejectPrivateEndpointConnectionSlotResponse, error) { + respType := WebAppsApproveOrRejectPrivateEndpointConnectionSlotResponse{} + resp, err := p.pt.FinalResponse(ctx, &respType.RemotePrivateEndpointConnectionARMResource) + if err != nil { + return WebAppsApproveOrRejectPrivateEndpointConnectionSlotResponse{}, err + } + respType.RawResponse = resp + return respType, nil +} + +// ResumeToken returns a value representing the poller that can be used to resume +// the LRO at a later time. ResumeTokens are unique per service operation. +func (p *WebAppsApproveOrRejectPrivateEndpointConnectionSlotPoller) ResumeToken() (string, error) { + return p.pt.ResumeToken() +} + +// WebAppsCreateFunctionPoller provides polling facilities until the operation reaches a terminal state. +type WebAppsCreateFunctionPoller struct { + pt *azcore.Poller +} + +// Done returns true if the LRO has reached a terminal state. +func (p *WebAppsCreateFunctionPoller) Done() bool { + return p.pt.Done() +} + +// Poll fetches the latest state of the LRO. It returns an HTTP response or error. +// If the LRO has completed successfully, the poller's state is updated and the HTTP +// response is returned. +// If the LRO has completed with failure or was cancelled, the poller's state is +// updated and the error is returned. +// If the LRO has not reached a terminal state, the poller's state is updated and +// the latest HTTP response is returned. +// If Poll fails, the poller's state is unmodified and the error is returned. +// Calling Poll on an LRO that has reached a terminal state will return the final +// HTTP response or error. +func (p *WebAppsCreateFunctionPoller) Poll(ctx context.Context) (*http.Response, error) { + return p.pt.Poll(ctx) +} + +// FinalResponse performs a final GET to the service and returns the final response +// for the polling operation. If there is an error performing the final GET then an error is returned. +// If the final GET succeeded then the final WebAppsCreateFunctionResponse will be returned. +func (p *WebAppsCreateFunctionPoller) FinalResponse(ctx context.Context) (WebAppsCreateFunctionResponse, error) { + respType := WebAppsCreateFunctionResponse{} + resp, err := p.pt.FinalResponse(ctx, &respType.FunctionEnvelope) + if err != nil { + return WebAppsCreateFunctionResponse{}, err + } + respType.RawResponse = resp + return respType, nil +} + +// ResumeToken returns a value representing the poller that can be used to resume +// the LRO at a later time. ResumeTokens are unique per service operation. +func (p *WebAppsCreateFunctionPoller) ResumeToken() (string, error) { + return p.pt.ResumeToken() +} + +// WebAppsCreateInstanceFunctionSlotPoller provides polling facilities until the operation reaches a terminal state. +type WebAppsCreateInstanceFunctionSlotPoller struct { + pt *azcore.Poller +} + +// Done returns true if the LRO has reached a terminal state. +func (p *WebAppsCreateInstanceFunctionSlotPoller) Done() bool { + return p.pt.Done() +} + +// Poll fetches the latest state of the LRO. It returns an HTTP response or error. +// If the LRO has completed successfully, the poller's state is updated and the HTTP +// response is returned. +// If the LRO has completed with failure or was cancelled, the poller's state is +// updated and the error is returned. +// If the LRO has not reached a terminal state, the poller's state is updated and +// the latest HTTP response is returned. +// If Poll fails, the poller's state is unmodified and the error is returned. +// Calling Poll on an LRO that has reached a terminal state will return the final +// HTTP response or error. +func (p *WebAppsCreateInstanceFunctionSlotPoller) Poll(ctx context.Context) (*http.Response, error) { + return p.pt.Poll(ctx) +} + +// FinalResponse performs a final GET to the service and returns the final response +// for the polling operation. If there is an error performing the final GET then an error is returned. +// If the final GET succeeded then the final WebAppsCreateInstanceFunctionSlotResponse will be returned. +func (p *WebAppsCreateInstanceFunctionSlotPoller) FinalResponse(ctx context.Context) (WebAppsCreateInstanceFunctionSlotResponse, error) { + respType := WebAppsCreateInstanceFunctionSlotResponse{} + resp, err := p.pt.FinalResponse(ctx, &respType.FunctionEnvelope) + if err != nil { + return WebAppsCreateInstanceFunctionSlotResponse{}, err + } + respType.RawResponse = resp + return respType, nil +} + +// ResumeToken returns a value representing the poller that can be used to resume +// the LRO at a later time. ResumeTokens are unique per service operation. +func (p *WebAppsCreateInstanceFunctionSlotPoller) ResumeToken() (string, error) { + return p.pt.ResumeToken() +} + +// WebAppsCreateInstanceMSDeployOperationPoller provides polling facilities until the operation reaches a terminal state. +type WebAppsCreateInstanceMSDeployOperationPoller struct { + pt *azcore.Poller +} + +// Done returns true if the LRO has reached a terminal state. +func (p *WebAppsCreateInstanceMSDeployOperationPoller) Done() bool { + return p.pt.Done() +} + +// Poll fetches the latest state of the LRO. It returns an HTTP response or error. +// If the LRO has completed successfully, the poller's state is updated and the HTTP +// response is returned. +// If the LRO has completed with failure or was cancelled, the poller's state is +// updated and the error is returned. +// If the LRO has not reached a terminal state, the poller's state is updated and +// the latest HTTP response is returned. +// If Poll fails, the poller's state is unmodified and the error is returned. +// Calling Poll on an LRO that has reached a terminal state will return the final +// HTTP response or error. +func (p *WebAppsCreateInstanceMSDeployOperationPoller) Poll(ctx context.Context) (*http.Response, error) { + return p.pt.Poll(ctx) +} + +// FinalResponse performs a final GET to the service and returns the final response +// for the polling operation. If there is an error performing the final GET then an error is returned. +// If the final GET succeeded then the final WebAppsCreateInstanceMSDeployOperationResponse will be returned. +func (p *WebAppsCreateInstanceMSDeployOperationPoller) FinalResponse(ctx context.Context) (WebAppsCreateInstanceMSDeployOperationResponse, error) { + respType := WebAppsCreateInstanceMSDeployOperationResponse{} + resp, err := p.pt.FinalResponse(ctx, &respType.MSDeployStatus) + if err != nil { + return WebAppsCreateInstanceMSDeployOperationResponse{}, err + } + respType.RawResponse = resp + return respType, nil +} + +// ResumeToken returns a value representing the poller that can be used to resume +// the LRO at a later time. ResumeTokens are unique per service operation. +func (p *WebAppsCreateInstanceMSDeployOperationPoller) ResumeToken() (string, error) { + return p.pt.ResumeToken() +} + +// WebAppsCreateInstanceMSDeployOperationSlotPoller provides polling facilities until the operation reaches a terminal state. +type WebAppsCreateInstanceMSDeployOperationSlotPoller struct { + pt *azcore.Poller +} + +// Done returns true if the LRO has reached a terminal state. +func (p *WebAppsCreateInstanceMSDeployOperationSlotPoller) Done() bool { + return p.pt.Done() +} + +// Poll fetches the latest state of the LRO. It returns an HTTP response or error. +// If the LRO has completed successfully, the poller's state is updated and the HTTP +// response is returned. +// If the LRO has completed with failure or was cancelled, the poller's state is +// updated and the error is returned. +// If the LRO has not reached a terminal state, the poller's state is updated and +// the latest HTTP response is returned. +// If Poll fails, the poller's state is unmodified and the error is returned. +// Calling Poll on an LRO that has reached a terminal state will return the final +// HTTP response or error. +func (p *WebAppsCreateInstanceMSDeployOperationSlotPoller) Poll(ctx context.Context) (*http.Response, error) { + return p.pt.Poll(ctx) +} + +// FinalResponse performs a final GET to the service and returns the final response +// for the polling operation. If there is an error performing the final GET then an error is returned. +// If the final GET succeeded then the final WebAppsCreateInstanceMSDeployOperationSlotResponse will be returned. +func (p *WebAppsCreateInstanceMSDeployOperationSlotPoller) FinalResponse(ctx context.Context) (WebAppsCreateInstanceMSDeployOperationSlotResponse, error) { + respType := WebAppsCreateInstanceMSDeployOperationSlotResponse{} + resp, err := p.pt.FinalResponse(ctx, &respType.MSDeployStatus) + if err != nil { + return WebAppsCreateInstanceMSDeployOperationSlotResponse{}, err + } + respType.RawResponse = resp + return respType, nil +} + +// ResumeToken returns a value representing the poller that can be used to resume +// the LRO at a later time. ResumeTokens are unique per service operation. +func (p *WebAppsCreateInstanceMSDeployOperationSlotPoller) ResumeToken() (string, error) { + return p.pt.ResumeToken() +} + +// WebAppsCreateMSDeployOperationPoller provides polling facilities until the operation reaches a terminal state. +type WebAppsCreateMSDeployOperationPoller struct { + pt *azcore.Poller +} + +// Done returns true if the LRO has reached a terminal state. +func (p *WebAppsCreateMSDeployOperationPoller) Done() bool { + return p.pt.Done() +} + +// Poll fetches the latest state of the LRO. It returns an HTTP response or error. +// If the LRO has completed successfully, the poller's state is updated and the HTTP +// response is returned. +// If the LRO has completed with failure or was cancelled, the poller's state is +// updated and the error is returned. +// If the LRO has not reached a terminal state, the poller's state is updated and +// the latest HTTP response is returned. +// If Poll fails, the poller's state is unmodified and the error is returned. +// Calling Poll on an LRO that has reached a terminal state will return the final +// HTTP response or error. +func (p *WebAppsCreateMSDeployOperationPoller) Poll(ctx context.Context) (*http.Response, error) { + return p.pt.Poll(ctx) +} + +// FinalResponse performs a final GET to the service and returns the final response +// for the polling operation. If there is an error performing the final GET then an error is returned. +// If the final GET succeeded then the final WebAppsCreateMSDeployOperationResponse will be returned. +func (p *WebAppsCreateMSDeployOperationPoller) FinalResponse(ctx context.Context) (WebAppsCreateMSDeployOperationResponse, error) { + respType := WebAppsCreateMSDeployOperationResponse{} + resp, err := p.pt.FinalResponse(ctx, &respType.MSDeployStatus) + if err != nil { + return WebAppsCreateMSDeployOperationResponse{}, err + } + respType.RawResponse = resp + return respType, nil +} + +// ResumeToken returns a value representing the poller that can be used to resume +// the LRO at a later time. ResumeTokens are unique per service operation. +func (p *WebAppsCreateMSDeployOperationPoller) ResumeToken() (string, error) { + return p.pt.ResumeToken() +} + +// WebAppsCreateMSDeployOperationSlotPoller provides polling facilities until the operation reaches a terminal state. +type WebAppsCreateMSDeployOperationSlotPoller struct { + pt *azcore.Poller +} + +// Done returns true if the LRO has reached a terminal state. +func (p *WebAppsCreateMSDeployOperationSlotPoller) Done() bool { + return p.pt.Done() +} + +// Poll fetches the latest state of the LRO. It returns an HTTP response or error. +// If the LRO has completed successfully, the poller's state is updated and the HTTP +// response is returned. +// If the LRO has completed with failure or was cancelled, the poller's state is +// updated and the error is returned. +// If the LRO has not reached a terminal state, the poller's state is updated and +// the latest HTTP response is returned. +// If Poll fails, the poller's state is unmodified and the error is returned. +// Calling Poll on an LRO that has reached a terminal state will return the final +// HTTP response or error. +func (p *WebAppsCreateMSDeployOperationSlotPoller) Poll(ctx context.Context) (*http.Response, error) { + return p.pt.Poll(ctx) +} + +// FinalResponse performs a final GET to the service and returns the final response +// for the polling operation. If there is an error performing the final GET then an error is returned. +// If the final GET succeeded then the final WebAppsCreateMSDeployOperationSlotResponse will be returned. +func (p *WebAppsCreateMSDeployOperationSlotPoller) FinalResponse(ctx context.Context) (WebAppsCreateMSDeployOperationSlotResponse, error) { + respType := WebAppsCreateMSDeployOperationSlotResponse{} + resp, err := p.pt.FinalResponse(ctx, &respType.MSDeployStatus) + if err != nil { + return WebAppsCreateMSDeployOperationSlotResponse{}, err + } + respType.RawResponse = resp + return respType, nil +} + +// ResumeToken returns a value representing the poller that can be used to resume +// the LRO at a later time. ResumeTokens are unique per service operation. +func (p *WebAppsCreateMSDeployOperationSlotPoller) ResumeToken() (string, error) { + return p.pt.ResumeToken() +} + +// WebAppsCreateOrUpdatePoller provides polling facilities until the operation reaches a terminal state. +type WebAppsCreateOrUpdatePoller struct { + pt *azcore.Poller +} + +// Done returns true if the LRO has reached a terminal state. +func (p *WebAppsCreateOrUpdatePoller) Done() bool { + return p.pt.Done() +} + +// Poll fetches the latest state of the LRO. It returns an HTTP response or error. +// If the LRO has completed successfully, the poller's state is updated and the HTTP +// response is returned. +// If the LRO has completed with failure or was cancelled, the poller's state is +// updated and the error is returned. +// If the LRO has not reached a terminal state, the poller's state is updated and +// the latest HTTP response is returned. +// If Poll fails, the poller's state is unmodified and the error is returned. +// Calling Poll on an LRO that has reached a terminal state will return the final +// HTTP response or error. +func (p *WebAppsCreateOrUpdatePoller) Poll(ctx context.Context) (*http.Response, error) { + return p.pt.Poll(ctx) +} + +// FinalResponse performs a final GET to the service and returns the final response +// for the polling operation. If there is an error performing the final GET then an error is returned. +// If the final GET succeeded then the final WebAppsCreateOrUpdateResponse will be returned. +func (p *WebAppsCreateOrUpdatePoller) FinalResponse(ctx context.Context) (WebAppsCreateOrUpdateResponse, error) { + respType := WebAppsCreateOrUpdateResponse{} + resp, err := p.pt.FinalResponse(ctx, &respType.Site) + if err != nil { + return WebAppsCreateOrUpdateResponse{}, err + } + respType.RawResponse = resp + return respType, nil +} + +// ResumeToken returns a value representing the poller that can be used to resume +// the LRO at a later time. ResumeTokens are unique per service operation. +func (p *WebAppsCreateOrUpdatePoller) ResumeToken() (string, error) { + return p.pt.ResumeToken() +} + +// WebAppsCreateOrUpdateSlotPoller provides polling facilities until the operation reaches a terminal state. +type WebAppsCreateOrUpdateSlotPoller struct { + pt *azcore.Poller +} + +// Done returns true if the LRO has reached a terminal state. +func (p *WebAppsCreateOrUpdateSlotPoller) Done() bool { + return p.pt.Done() +} + +// Poll fetches the latest state of the LRO. It returns an HTTP response or error. +// If the LRO has completed successfully, the poller's state is updated and the HTTP +// response is returned. +// If the LRO has completed with failure or was cancelled, the poller's state is +// updated and the error is returned. +// If the LRO has not reached a terminal state, the poller's state is updated and +// the latest HTTP response is returned. +// If Poll fails, the poller's state is unmodified and the error is returned. +// Calling Poll on an LRO that has reached a terminal state will return the final +// HTTP response or error. +func (p *WebAppsCreateOrUpdateSlotPoller) Poll(ctx context.Context) (*http.Response, error) { + return p.pt.Poll(ctx) +} + +// FinalResponse performs a final GET to the service and returns the final response +// for the polling operation. If there is an error performing the final GET then an error is returned. +// If the final GET succeeded then the final WebAppsCreateOrUpdateSlotResponse will be returned. +func (p *WebAppsCreateOrUpdateSlotPoller) FinalResponse(ctx context.Context) (WebAppsCreateOrUpdateSlotResponse, error) { + respType := WebAppsCreateOrUpdateSlotResponse{} + resp, err := p.pt.FinalResponse(ctx, &respType.Site) + if err != nil { + return WebAppsCreateOrUpdateSlotResponse{}, err + } + respType.RawResponse = resp + return respType, nil +} + +// ResumeToken returns a value representing the poller that can be used to resume +// the LRO at a later time. ResumeTokens are unique per service operation. +func (p *WebAppsCreateOrUpdateSlotPoller) ResumeToken() (string, error) { + return p.pt.ResumeToken() +} + +// WebAppsCreateOrUpdateSourceControlPoller provides polling facilities until the operation reaches a terminal state. +type WebAppsCreateOrUpdateSourceControlPoller struct { + pt *azcore.Poller +} + +// Done returns true if the LRO has reached a terminal state. +func (p *WebAppsCreateOrUpdateSourceControlPoller) Done() bool { + return p.pt.Done() +} + +// Poll fetches the latest state of the LRO. It returns an HTTP response or error. +// If the LRO has completed successfully, the poller's state is updated and the HTTP +// response is returned. +// If the LRO has completed with failure or was cancelled, the poller's state is +// updated and the error is returned. +// If the LRO has not reached a terminal state, the poller's state is updated and +// the latest HTTP response is returned. +// If Poll fails, the poller's state is unmodified and the error is returned. +// Calling Poll on an LRO that has reached a terminal state will return the final +// HTTP response or error. +func (p *WebAppsCreateOrUpdateSourceControlPoller) Poll(ctx context.Context) (*http.Response, error) { + return p.pt.Poll(ctx) +} + +// FinalResponse performs a final GET to the service and returns the final response +// for the polling operation. If there is an error performing the final GET then an error is returned. +// If the final GET succeeded then the final WebAppsCreateOrUpdateSourceControlResponse will be returned. +func (p *WebAppsCreateOrUpdateSourceControlPoller) FinalResponse(ctx context.Context) (WebAppsCreateOrUpdateSourceControlResponse, error) { + respType := WebAppsCreateOrUpdateSourceControlResponse{} + resp, err := p.pt.FinalResponse(ctx, &respType.SiteSourceControl) + if err != nil { + return WebAppsCreateOrUpdateSourceControlResponse{}, err + } + respType.RawResponse = resp + return respType, nil +} + +// ResumeToken returns a value representing the poller that can be used to resume +// the LRO at a later time. ResumeTokens are unique per service operation. +func (p *WebAppsCreateOrUpdateSourceControlPoller) ResumeToken() (string, error) { + return p.pt.ResumeToken() +} + +// WebAppsCreateOrUpdateSourceControlSlotPoller provides polling facilities until the operation reaches a terminal state. +type WebAppsCreateOrUpdateSourceControlSlotPoller struct { + pt *azcore.Poller +} + +// Done returns true if the LRO has reached a terminal state. +func (p *WebAppsCreateOrUpdateSourceControlSlotPoller) Done() bool { + return p.pt.Done() +} + +// Poll fetches the latest state of the LRO. It returns an HTTP response or error. +// If the LRO has completed successfully, the poller's state is updated and the HTTP +// response is returned. +// If the LRO has completed with failure or was cancelled, the poller's state is +// updated and the error is returned. +// If the LRO has not reached a terminal state, the poller's state is updated and +// the latest HTTP response is returned. +// If Poll fails, the poller's state is unmodified and the error is returned. +// Calling Poll on an LRO that has reached a terminal state will return the final +// HTTP response or error. +func (p *WebAppsCreateOrUpdateSourceControlSlotPoller) Poll(ctx context.Context) (*http.Response, error) { + return p.pt.Poll(ctx) +} + +// FinalResponse performs a final GET to the service and returns the final response +// for the polling operation. If there is an error performing the final GET then an error is returned. +// If the final GET succeeded then the final WebAppsCreateOrUpdateSourceControlSlotResponse will be returned. +func (p *WebAppsCreateOrUpdateSourceControlSlotPoller) FinalResponse(ctx context.Context) (WebAppsCreateOrUpdateSourceControlSlotResponse, error) { + respType := WebAppsCreateOrUpdateSourceControlSlotResponse{} + resp, err := p.pt.FinalResponse(ctx, &respType.SiteSourceControl) + if err != nil { + return WebAppsCreateOrUpdateSourceControlSlotResponse{}, err + } + respType.RawResponse = resp + return respType, nil +} + +// ResumeToken returns a value representing the poller that can be used to resume +// the LRO at a later time. ResumeTokens are unique per service operation. +func (p *WebAppsCreateOrUpdateSourceControlSlotPoller) ResumeToken() (string, error) { + return p.pt.ResumeToken() +} + +// WebAppsDeletePrivateEndpointConnectionPoller provides polling facilities until the operation reaches a terminal state. +type WebAppsDeletePrivateEndpointConnectionPoller struct { + pt *azcore.Poller +} + +// Done returns true if the LRO has reached a terminal state. +func (p *WebAppsDeletePrivateEndpointConnectionPoller) Done() bool { + return p.pt.Done() +} + +// Poll fetches the latest state of the LRO. It returns an HTTP response or error. +// If the LRO has completed successfully, the poller's state is updated and the HTTP +// response is returned. +// If the LRO has completed with failure or was cancelled, the poller's state is +// updated and the error is returned. +// If the LRO has not reached a terminal state, the poller's state is updated and +// the latest HTTP response is returned. +// If Poll fails, the poller's state is unmodified and the error is returned. +// Calling Poll on an LRO that has reached a terminal state will return the final +// HTTP response or error. +func (p *WebAppsDeletePrivateEndpointConnectionPoller) Poll(ctx context.Context) (*http.Response, error) { + return p.pt.Poll(ctx) +} + +// FinalResponse performs a final GET to the service and returns the final response +// for the polling operation. If there is an error performing the final GET then an error is returned. +// If the final GET succeeded then the final WebAppsDeletePrivateEndpointConnectionResponse will be returned. +func (p *WebAppsDeletePrivateEndpointConnectionPoller) FinalResponse(ctx context.Context) (WebAppsDeletePrivateEndpointConnectionResponse, error) { + respType := WebAppsDeletePrivateEndpointConnectionResponse{} + resp, err := p.pt.FinalResponse(ctx, &respType.Object) + if err != nil { + return WebAppsDeletePrivateEndpointConnectionResponse{}, err + } + respType.RawResponse = resp + return respType, nil +} + +// ResumeToken returns a value representing the poller that can be used to resume +// the LRO at a later time. ResumeTokens are unique per service operation. +func (p *WebAppsDeletePrivateEndpointConnectionPoller) ResumeToken() (string, error) { + return p.pt.ResumeToken() +} + +// WebAppsDeletePrivateEndpointConnectionSlotPoller provides polling facilities until the operation reaches a terminal state. +type WebAppsDeletePrivateEndpointConnectionSlotPoller struct { + pt *azcore.Poller +} + +// Done returns true if the LRO has reached a terminal state. +func (p *WebAppsDeletePrivateEndpointConnectionSlotPoller) Done() bool { + return p.pt.Done() +} + +// Poll fetches the latest state of the LRO. It returns an HTTP response or error. +// If the LRO has completed successfully, the poller's state is updated and the HTTP +// response is returned. +// If the LRO has completed with failure or was cancelled, the poller's state is +// updated and the error is returned. +// If the LRO has not reached a terminal state, the poller's state is updated and +// the latest HTTP response is returned. +// If Poll fails, the poller's state is unmodified and the error is returned. +// Calling Poll on an LRO that has reached a terminal state will return the final +// HTTP response or error. +func (p *WebAppsDeletePrivateEndpointConnectionSlotPoller) Poll(ctx context.Context) (*http.Response, error) { + return p.pt.Poll(ctx) +} + +// FinalResponse performs a final GET to the service and returns the final response +// for the polling operation. If there is an error performing the final GET then an error is returned. +// If the final GET succeeded then the final WebAppsDeletePrivateEndpointConnectionSlotResponse will be returned. +func (p *WebAppsDeletePrivateEndpointConnectionSlotPoller) FinalResponse(ctx context.Context) (WebAppsDeletePrivateEndpointConnectionSlotResponse, error) { + respType := WebAppsDeletePrivateEndpointConnectionSlotResponse{} + resp, err := p.pt.FinalResponse(ctx, &respType.Object) + if err != nil { + return WebAppsDeletePrivateEndpointConnectionSlotResponse{}, err + } + respType.RawResponse = resp + return respType, nil +} + +// ResumeToken returns a value representing the poller that can be used to resume +// the LRO at a later time. ResumeTokens are unique per service operation. +func (p *WebAppsDeletePrivateEndpointConnectionSlotPoller) ResumeToken() (string, error) { + return p.pt.ResumeToken() +} + +// WebAppsInstallSiteExtensionPoller provides polling facilities until the operation reaches a terminal state. +type WebAppsInstallSiteExtensionPoller struct { + pt *azcore.Poller +} + +// Done returns true if the LRO has reached a terminal state. +func (p *WebAppsInstallSiteExtensionPoller) Done() bool { + return p.pt.Done() +} + +// Poll fetches the latest state of the LRO. It returns an HTTP response or error. +// If the LRO has completed successfully, the poller's state is updated and the HTTP +// response is returned. +// If the LRO has completed with failure or was cancelled, the poller's state is +// updated and the error is returned. +// If the LRO has not reached a terminal state, the poller's state is updated and +// the latest HTTP response is returned. +// If Poll fails, the poller's state is unmodified and the error is returned. +// Calling Poll on an LRO that has reached a terminal state will return the final +// HTTP response or error. +func (p *WebAppsInstallSiteExtensionPoller) Poll(ctx context.Context) (*http.Response, error) { + return p.pt.Poll(ctx) +} + +// FinalResponse performs a final GET to the service and returns the final response +// for the polling operation. If there is an error performing the final GET then an error is returned. +// If the final GET succeeded then the final WebAppsInstallSiteExtensionResponse will be returned. +func (p *WebAppsInstallSiteExtensionPoller) FinalResponse(ctx context.Context) (WebAppsInstallSiteExtensionResponse, error) { + respType := WebAppsInstallSiteExtensionResponse{} + resp, err := p.pt.FinalResponse(ctx, &respType.SiteExtensionInfo) + if err != nil { + return WebAppsInstallSiteExtensionResponse{}, err + } + respType.RawResponse = resp + return respType, nil +} + +// ResumeToken returns a value representing the poller that can be used to resume +// the LRO at a later time. ResumeTokens are unique per service operation. +func (p *WebAppsInstallSiteExtensionPoller) ResumeToken() (string, error) { + return p.pt.ResumeToken() +} + +// WebAppsInstallSiteExtensionSlotPoller provides polling facilities until the operation reaches a terminal state. +type WebAppsInstallSiteExtensionSlotPoller struct { + pt *azcore.Poller +} + +// Done returns true if the LRO has reached a terminal state. +func (p *WebAppsInstallSiteExtensionSlotPoller) Done() bool { + return p.pt.Done() +} + +// Poll fetches the latest state of the LRO. It returns an HTTP response or error. +// If the LRO has completed successfully, the poller's state is updated and the HTTP +// response is returned. +// If the LRO has completed with failure or was cancelled, the poller's state is +// updated and the error is returned. +// If the LRO has not reached a terminal state, the poller's state is updated and +// the latest HTTP response is returned. +// If Poll fails, the poller's state is unmodified and the error is returned. +// Calling Poll on an LRO that has reached a terminal state will return the final +// HTTP response or error. +func (p *WebAppsInstallSiteExtensionSlotPoller) Poll(ctx context.Context) (*http.Response, error) { + return p.pt.Poll(ctx) +} + +// FinalResponse performs a final GET to the service and returns the final response +// for the polling operation. If there is an error performing the final GET then an error is returned. +// If the final GET succeeded then the final WebAppsInstallSiteExtensionSlotResponse will be returned. +func (p *WebAppsInstallSiteExtensionSlotPoller) FinalResponse(ctx context.Context) (WebAppsInstallSiteExtensionSlotResponse, error) { + respType := WebAppsInstallSiteExtensionSlotResponse{} + resp, err := p.pt.FinalResponse(ctx, &respType.SiteExtensionInfo) + if err != nil { + return WebAppsInstallSiteExtensionSlotResponse{}, err + } + respType.RawResponse = resp + return respType, nil +} + +// ResumeToken returns a value representing the poller that can be used to resume +// the LRO at a later time. ResumeTokens are unique per service operation. +func (p *WebAppsInstallSiteExtensionSlotPoller) ResumeToken() (string, error) { + return p.pt.ResumeToken() +} + +// WebAppsListPublishingCredentialsPoller provides polling facilities until the operation reaches a terminal state. +type WebAppsListPublishingCredentialsPoller struct { + pt *azcore.Poller +} + +// Done returns true if the LRO has reached a terminal state. +func (p *WebAppsListPublishingCredentialsPoller) Done() bool { + return p.pt.Done() +} + +// Poll fetches the latest state of the LRO. It returns an HTTP response or error. +// If the LRO has completed successfully, the poller's state is updated and the HTTP +// response is returned. +// If the LRO has completed with failure or was cancelled, the poller's state is +// updated and the error is returned. +// If the LRO has not reached a terminal state, the poller's state is updated and +// the latest HTTP response is returned. +// If Poll fails, the poller's state is unmodified and the error is returned. +// Calling Poll on an LRO that has reached a terminal state will return the final +// HTTP response or error. +func (p *WebAppsListPublishingCredentialsPoller) Poll(ctx context.Context) (*http.Response, error) { + return p.pt.Poll(ctx) +} + +// FinalResponse performs a final GET to the service and returns the final response +// for the polling operation. If there is an error performing the final GET then an error is returned. +// If the final GET succeeded then the final WebAppsListPublishingCredentialsResponse will be returned. +func (p *WebAppsListPublishingCredentialsPoller) FinalResponse(ctx context.Context) (WebAppsListPublishingCredentialsResponse, error) { + respType := WebAppsListPublishingCredentialsResponse{} + resp, err := p.pt.FinalResponse(ctx, &respType.User) + if err != nil { + return WebAppsListPublishingCredentialsResponse{}, err + } + respType.RawResponse = resp + return respType, nil +} + +// ResumeToken returns a value representing the poller that can be used to resume +// the LRO at a later time. ResumeTokens are unique per service operation. +func (p *WebAppsListPublishingCredentialsPoller) ResumeToken() (string, error) { + return p.pt.ResumeToken() +} + +// WebAppsListPublishingCredentialsSlotPoller provides polling facilities until the operation reaches a terminal state. +type WebAppsListPublishingCredentialsSlotPoller struct { + pt *azcore.Poller +} + +// Done returns true if the LRO has reached a terminal state. +func (p *WebAppsListPublishingCredentialsSlotPoller) Done() bool { + return p.pt.Done() +} + +// Poll fetches the latest state of the LRO. It returns an HTTP response or error. +// If the LRO has completed successfully, the poller's state is updated and the HTTP +// response is returned. +// If the LRO has completed with failure or was cancelled, the poller's state is +// updated and the error is returned. +// If the LRO has not reached a terminal state, the poller's state is updated and +// the latest HTTP response is returned. +// If Poll fails, the poller's state is unmodified and the error is returned. +// Calling Poll on an LRO that has reached a terminal state will return the final +// HTTP response or error. +func (p *WebAppsListPublishingCredentialsSlotPoller) Poll(ctx context.Context) (*http.Response, error) { + return p.pt.Poll(ctx) +} + +// FinalResponse performs a final GET to the service and returns the final response +// for the polling operation. If there is an error performing the final GET then an error is returned. +// If the final GET succeeded then the final WebAppsListPublishingCredentialsSlotResponse will be returned. +func (p *WebAppsListPublishingCredentialsSlotPoller) FinalResponse(ctx context.Context) (WebAppsListPublishingCredentialsSlotResponse, error) { + respType := WebAppsListPublishingCredentialsSlotResponse{} + resp, err := p.pt.FinalResponse(ctx, &respType.User) + if err != nil { + return WebAppsListPublishingCredentialsSlotResponse{}, err + } + respType.RawResponse = resp + return respType, nil +} + +// ResumeToken returns a value representing the poller that can be used to resume +// the LRO at a later time. ResumeTokens are unique per service operation. +func (p *WebAppsListPublishingCredentialsSlotPoller) ResumeToken() (string, error) { + return p.pt.ResumeToken() +} + +// WebAppsMigrateMySQLPoller provides polling facilities until the operation reaches a terminal state. +type WebAppsMigrateMySQLPoller struct { + pt *azcore.Poller +} + +// Done returns true if the LRO has reached a terminal state. +func (p *WebAppsMigrateMySQLPoller) Done() bool { + return p.pt.Done() +} + +// Poll fetches the latest state of the LRO. It returns an HTTP response or error. +// If the LRO has completed successfully, the poller's state is updated and the HTTP +// response is returned. +// If the LRO has completed with failure or was cancelled, the poller's state is +// updated and the error is returned. +// If the LRO has not reached a terminal state, the poller's state is updated and +// the latest HTTP response is returned. +// If Poll fails, the poller's state is unmodified and the error is returned. +// Calling Poll on an LRO that has reached a terminal state will return the final +// HTTP response or error. +func (p *WebAppsMigrateMySQLPoller) Poll(ctx context.Context) (*http.Response, error) { + return p.pt.Poll(ctx) +} + +// FinalResponse performs a final GET to the service and returns the final response +// for the polling operation. If there is an error performing the final GET then an error is returned. +// If the final GET succeeded then the final WebAppsMigrateMySQLResponse will be returned. +func (p *WebAppsMigrateMySQLPoller) FinalResponse(ctx context.Context) (WebAppsMigrateMySQLResponse, error) { + respType := WebAppsMigrateMySQLResponse{} + resp, err := p.pt.FinalResponse(ctx, &respType.Operation) + if err != nil { + return WebAppsMigrateMySQLResponse{}, err + } + respType.RawResponse = resp + return respType, nil +} + +// ResumeToken returns a value representing the poller that can be used to resume +// the LRO at a later time. ResumeTokens are unique per service operation. +func (p *WebAppsMigrateMySQLPoller) ResumeToken() (string, error) { + return p.pt.ResumeToken() +} + +// WebAppsMigrateStoragePoller provides polling facilities until the operation reaches a terminal state. +type WebAppsMigrateStoragePoller struct { + pt *azcore.Poller +} + +// Done returns true if the LRO has reached a terminal state. +func (p *WebAppsMigrateStoragePoller) Done() bool { + return p.pt.Done() +} + +// Poll fetches the latest state of the LRO. It returns an HTTP response or error. +// If the LRO has completed successfully, the poller's state is updated and the HTTP +// response is returned. +// If the LRO has completed with failure or was cancelled, the poller's state is +// updated and the error is returned. +// If the LRO has not reached a terminal state, the poller's state is updated and +// the latest HTTP response is returned. +// If Poll fails, the poller's state is unmodified and the error is returned. +// Calling Poll on an LRO that has reached a terminal state will return the final +// HTTP response or error. +func (p *WebAppsMigrateStoragePoller) Poll(ctx context.Context) (*http.Response, error) { + return p.pt.Poll(ctx) +} + +// FinalResponse performs a final GET to the service and returns the final response +// for the polling operation. If there is an error performing the final GET then an error is returned. +// If the final GET succeeded then the final WebAppsMigrateStorageResponse will be returned. +func (p *WebAppsMigrateStoragePoller) FinalResponse(ctx context.Context) (WebAppsMigrateStorageResponse, error) { + respType := WebAppsMigrateStorageResponse{} + resp, err := p.pt.FinalResponse(ctx, &respType.StorageMigrationResponse) + if err != nil { + return WebAppsMigrateStorageResponse{}, err + } + respType.RawResponse = resp + return respType, nil +} + +// ResumeToken returns a value representing the poller that can be used to resume +// the LRO at a later time. ResumeTokens are unique per service operation. +func (p *WebAppsMigrateStoragePoller) ResumeToken() (string, error) { + return p.pt.ResumeToken() +} + +// WebAppsRestoreFromBackupBlobPoller provides polling facilities until the operation reaches a terminal state. +type WebAppsRestoreFromBackupBlobPoller struct { + pt *azcore.Poller +} + +// Done returns true if the LRO has reached a terminal state. +func (p *WebAppsRestoreFromBackupBlobPoller) Done() bool { + return p.pt.Done() +} + +// Poll fetches the latest state of the LRO. It returns an HTTP response or error. +// If the LRO has completed successfully, the poller's state is updated and the HTTP +// response is returned. +// If the LRO has completed with failure or was cancelled, the poller's state is +// updated and the error is returned. +// If the LRO has not reached a terminal state, the poller's state is updated and +// the latest HTTP response is returned. +// If Poll fails, the poller's state is unmodified and the error is returned. +// Calling Poll on an LRO that has reached a terminal state will return the final +// HTTP response or error. +func (p *WebAppsRestoreFromBackupBlobPoller) Poll(ctx context.Context) (*http.Response, error) { + return p.pt.Poll(ctx) +} + +// FinalResponse performs a final GET to the service and returns the final response +// for the polling operation. If there is an error performing the final GET then an error is returned. +// If the final GET succeeded then the final WebAppsRestoreFromBackupBlobResponse will be returned. +func (p *WebAppsRestoreFromBackupBlobPoller) FinalResponse(ctx context.Context) (WebAppsRestoreFromBackupBlobResponse, error) { + respType := WebAppsRestoreFromBackupBlobResponse{} + resp, err := p.pt.FinalResponse(ctx, nil) + if err != nil { + return WebAppsRestoreFromBackupBlobResponse{}, err + } + respType.RawResponse = resp + return respType, nil +} + +// ResumeToken returns a value representing the poller that can be used to resume +// the LRO at a later time. ResumeTokens are unique per service operation. +func (p *WebAppsRestoreFromBackupBlobPoller) ResumeToken() (string, error) { + return p.pt.ResumeToken() +} + +// WebAppsRestoreFromBackupBlobSlotPoller provides polling facilities until the operation reaches a terminal state. +type WebAppsRestoreFromBackupBlobSlotPoller struct { + pt *azcore.Poller +} + +// Done returns true if the LRO has reached a terminal state. +func (p *WebAppsRestoreFromBackupBlobSlotPoller) Done() bool { + return p.pt.Done() +} + +// Poll fetches the latest state of the LRO. It returns an HTTP response or error. +// If the LRO has completed successfully, the poller's state is updated and the HTTP +// response is returned. +// If the LRO has completed with failure or was cancelled, the poller's state is +// updated and the error is returned. +// If the LRO has not reached a terminal state, the poller's state is updated and +// the latest HTTP response is returned. +// If Poll fails, the poller's state is unmodified and the error is returned. +// Calling Poll on an LRO that has reached a terminal state will return the final +// HTTP response or error. +func (p *WebAppsRestoreFromBackupBlobSlotPoller) Poll(ctx context.Context) (*http.Response, error) { + return p.pt.Poll(ctx) +} + +// FinalResponse performs a final GET to the service and returns the final response +// for the polling operation. If there is an error performing the final GET then an error is returned. +// If the final GET succeeded then the final WebAppsRestoreFromBackupBlobSlotResponse will be returned. +func (p *WebAppsRestoreFromBackupBlobSlotPoller) FinalResponse(ctx context.Context) (WebAppsRestoreFromBackupBlobSlotResponse, error) { + respType := WebAppsRestoreFromBackupBlobSlotResponse{} + resp, err := p.pt.FinalResponse(ctx, nil) + if err != nil { + return WebAppsRestoreFromBackupBlobSlotResponse{}, err + } + respType.RawResponse = resp + return respType, nil +} + +// ResumeToken returns a value representing the poller that can be used to resume +// the LRO at a later time. ResumeTokens are unique per service operation. +func (p *WebAppsRestoreFromBackupBlobSlotPoller) ResumeToken() (string, error) { + return p.pt.ResumeToken() +} + +// WebAppsRestoreFromDeletedAppPoller provides polling facilities until the operation reaches a terminal state. +type WebAppsRestoreFromDeletedAppPoller struct { + pt *azcore.Poller +} + +// Done returns true if the LRO has reached a terminal state. +func (p *WebAppsRestoreFromDeletedAppPoller) Done() bool { + return p.pt.Done() +} + +// Poll fetches the latest state of the LRO. It returns an HTTP response or error. +// If the LRO has completed successfully, the poller's state is updated and the HTTP +// response is returned. +// If the LRO has completed with failure or was cancelled, the poller's state is +// updated and the error is returned. +// If the LRO has not reached a terminal state, the poller's state is updated and +// the latest HTTP response is returned. +// If Poll fails, the poller's state is unmodified and the error is returned. +// Calling Poll on an LRO that has reached a terminal state will return the final +// HTTP response or error. +func (p *WebAppsRestoreFromDeletedAppPoller) Poll(ctx context.Context) (*http.Response, error) { + return p.pt.Poll(ctx) +} + +// FinalResponse performs a final GET to the service and returns the final response +// for the polling operation. If there is an error performing the final GET then an error is returned. +// If the final GET succeeded then the final WebAppsRestoreFromDeletedAppResponse will be returned. +func (p *WebAppsRestoreFromDeletedAppPoller) FinalResponse(ctx context.Context) (WebAppsRestoreFromDeletedAppResponse, error) { + respType := WebAppsRestoreFromDeletedAppResponse{} + resp, err := p.pt.FinalResponse(ctx, nil) + if err != nil { + return WebAppsRestoreFromDeletedAppResponse{}, err + } + respType.RawResponse = resp + return respType, nil +} + +// ResumeToken returns a value representing the poller that can be used to resume +// the LRO at a later time. ResumeTokens are unique per service operation. +func (p *WebAppsRestoreFromDeletedAppPoller) ResumeToken() (string, error) { + return p.pt.ResumeToken() +} + +// WebAppsRestoreFromDeletedAppSlotPoller provides polling facilities until the operation reaches a terminal state. +type WebAppsRestoreFromDeletedAppSlotPoller struct { + pt *azcore.Poller +} + +// Done returns true if the LRO has reached a terminal state. +func (p *WebAppsRestoreFromDeletedAppSlotPoller) Done() bool { + return p.pt.Done() +} + +// Poll fetches the latest state of the LRO. It returns an HTTP response or error. +// If the LRO has completed successfully, the poller's state is updated and the HTTP +// response is returned. +// If the LRO has completed with failure or was cancelled, the poller's state is +// updated and the error is returned. +// If the LRO has not reached a terminal state, the poller's state is updated and +// the latest HTTP response is returned. +// If Poll fails, the poller's state is unmodified and the error is returned. +// Calling Poll on an LRO that has reached a terminal state will return the final +// HTTP response or error. +func (p *WebAppsRestoreFromDeletedAppSlotPoller) Poll(ctx context.Context) (*http.Response, error) { + return p.pt.Poll(ctx) +} + +// FinalResponse performs a final GET to the service and returns the final response +// for the polling operation. If there is an error performing the final GET then an error is returned. +// If the final GET succeeded then the final WebAppsRestoreFromDeletedAppSlotResponse will be returned. +func (p *WebAppsRestoreFromDeletedAppSlotPoller) FinalResponse(ctx context.Context) (WebAppsRestoreFromDeletedAppSlotResponse, error) { + respType := WebAppsRestoreFromDeletedAppSlotResponse{} + resp, err := p.pt.FinalResponse(ctx, nil) + if err != nil { + return WebAppsRestoreFromDeletedAppSlotResponse{}, err + } + respType.RawResponse = resp + return respType, nil +} + +// ResumeToken returns a value representing the poller that can be used to resume +// the LRO at a later time. ResumeTokens are unique per service operation. +func (p *WebAppsRestoreFromDeletedAppSlotPoller) ResumeToken() (string, error) { + return p.pt.ResumeToken() +} + +// WebAppsRestorePoller provides polling facilities until the operation reaches a terminal state. +type WebAppsRestorePoller struct { + pt *azcore.Poller +} + +// Done returns true if the LRO has reached a terminal state. +func (p *WebAppsRestorePoller) Done() bool { + return p.pt.Done() +} + +// Poll fetches the latest state of the LRO. It returns an HTTP response or error. +// If the LRO has completed successfully, the poller's state is updated and the HTTP +// response is returned. +// If the LRO has completed with failure or was cancelled, the poller's state is +// updated and the error is returned. +// If the LRO has not reached a terminal state, the poller's state is updated and +// the latest HTTP response is returned. +// If Poll fails, the poller's state is unmodified and the error is returned. +// Calling Poll on an LRO that has reached a terminal state will return the final +// HTTP response or error. +func (p *WebAppsRestorePoller) Poll(ctx context.Context) (*http.Response, error) { + return p.pt.Poll(ctx) +} + +// FinalResponse performs a final GET to the service and returns the final response +// for the polling operation. If there is an error performing the final GET then an error is returned. +// If the final GET succeeded then the final WebAppsRestoreResponse will be returned. +func (p *WebAppsRestorePoller) FinalResponse(ctx context.Context) (WebAppsRestoreResponse, error) { + respType := WebAppsRestoreResponse{} + resp, err := p.pt.FinalResponse(ctx, nil) + if err != nil { + return WebAppsRestoreResponse{}, err + } + respType.RawResponse = resp + return respType, nil +} + +// ResumeToken returns a value representing the poller that can be used to resume +// the LRO at a later time. ResumeTokens are unique per service operation. +func (p *WebAppsRestorePoller) ResumeToken() (string, error) { + return p.pt.ResumeToken() +} + +// WebAppsRestoreSlotPoller provides polling facilities until the operation reaches a terminal state. +type WebAppsRestoreSlotPoller struct { + pt *azcore.Poller +} + +// Done returns true if the LRO has reached a terminal state. +func (p *WebAppsRestoreSlotPoller) Done() bool { + return p.pt.Done() +} + +// Poll fetches the latest state of the LRO. It returns an HTTP response or error. +// If the LRO has completed successfully, the poller's state is updated and the HTTP +// response is returned. +// If the LRO has completed with failure or was cancelled, the poller's state is +// updated and the error is returned. +// If the LRO has not reached a terminal state, the poller's state is updated and +// the latest HTTP response is returned. +// If Poll fails, the poller's state is unmodified and the error is returned. +// Calling Poll on an LRO that has reached a terminal state will return the final +// HTTP response or error. +func (p *WebAppsRestoreSlotPoller) Poll(ctx context.Context) (*http.Response, error) { + return p.pt.Poll(ctx) +} + +// FinalResponse performs a final GET to the service and returns the final response +// for the polling operation. If there is an error performing the final GET then an error is returned. +// If the final GET succeeded then the final WebAppsRestoreSlotResponse will be returned. +func (p *WebAppsRestoreSlotPoller) FinalResponse(ctx context.Context) (WebAppsRestoreSlotResponse, error) { + respType := WebAppsRestoreSlotResponse{} + resp, err := p.pt.FinalResponse(ctx, nil) + if err != nil { + return WebAppsRestoreSlotResponse{}, err + } + respType.RawResponse = resp + return respType, nil +} + +// ResumeToken returns a value representing the poller that can be used to resume +// the LRO at a later time. ResumeTokens are unique per service operation. +func (p *WebAppsRestoreSlotPoller) ResumeToken() (string, error) { + return p.pt.ResumeToken() +} + +// WebAppsRestoreSnapshotPoller provides polling facilities until the operation reaches a terminal state. +type WebAppsRestoreSnapshotPoller struct { + pt *azcore.Poller +} + +// Done returns true if the LRO has reached a terminal state. +func (p *WebAppsRestoreSnapshotPoller) Done() bool { + return p.pt.Done() +} + +// Poll fetches the latest state of the LRO. It returns an HTTP response or error. +// If the LRO has completed successfully, the poller's state is updated and the HTTP +// response is returned. +// If the LRO has completed with failure or was cancelled, the poller's state is +// updated and the error is returned. +// If the LRO has not reached a terminal state, the poller's state is updated and +// the latest HTTP response is returned. +// If Poll fails, the poller's state is unmodified and the error is returned. +// Calling Poll on an LRO that has reached a terminal state will return the final +// HTTP response or error. +func (p *WebAppsRestoreSnapshotPoller) Poll(ctx context.Context) (*http.Response, error) { + return p.pt.Poll(ctx) +} + +// FinalResponse performs a final GET to the service and returns the final response +// for the polling operation. If there is an error performing the final GET then an error is returned. +// If the final GET succeeded then the final WebAppsRestoreSnapshotResponse will be returned. +func (p *WebAppsRestoreSnapshotPoller) FinalResponse(ctx context.Context) (WebAppsRestoreSnapshotResponse, error) { + respType := WebAppsRestoreSnapshotResponse{} + resp, err := p.pt.FinalResponse(ctx, nil) + if err != nil { + return WebAppsRestoreSnapshotResponse{}, err + } + respType.RawResponse = resp + return respType, nil +} + +// ResumeToken returns a value representing the poller that can be used to resume +// the LRO at a later time. ResumeTokens are unique per service operation. +func (p *WebAppsRestoreSnapshotPoller) ResumeToken() (string, error) { + return p.pt.ResumeToken() +} + +// WebAppsRestoreSnapshotSlotPoller provides polling facilities until the operation reaches a terminal state. +type WebAppsRestoreSnapshotSlotPoller struct { + pt *azcore.Poller +} + +// Done returns true if the LRO has reached a terminal state. +func (p *WebAppsRestoreSnapshotSlotPoller) Done() bool { + return p.pt.Done() +} + +// Poll fetches the latest state of the LRO. It returns an HTTP response or error. +// If the LRO has completed successfully, the poller's state is updated and the HTTP +// response is returned. +// If the LRO has completed with failure or was cancelled, the poller's state is +// updated and the error is returned. +// If the LRO has not reached a terminal state, the poller's state is updated and +// the latest HTTP response is returned. +// If Poll fails, the poller's state is unmodified and the error is returned. +// Calling Poll on an LRO that has reached a terminal state will return the final +// HTTP response or error. +func (p *WebAppsRestoreSnapshotSlotPoller) Poll(ctx context.Context) (*http.Response, error) { + return p.pt.Poll(ctx) +} + +// FinalResponse performs a final GET to the service and returns the final response +// for the polling operation. If there is an error performing the final GET then an error is returned. +// If the final GET succeeded then the final WebAppsRestoreSnapshotSlotResponse will be returned. +func (p *WebAppsRestoreSnapshotSlotPoller) FinalResponse(ctx context.Context) (WebAppsRestoreSnapshotSlotResponse, error) { + respType := WebAppsRestoreSnapshotSlotResponse{} + resp, err := p.pt.FinalResponse(ctx, nil) + if err != nil { + return WebAppsRestoreSnapshotSlotResponse{}, err + } + respType.RawResponse = resp + return respType, nil +} + +// ResumeToken returns a value representing the poller that can be used to resume +// the LRO at a later time. ResumeTokens are unique per service operation. +func (p *WebAppsRestoreSnapshotSlotPoller) ResumeToken() (string, error) { + return p.pt.ResumeToken() +} + +// WebAppsStartNetworkTracePoller provides polling facilities until the operation reaches a terminal state. +type WebAppsStartNetworkTracePoller struct { + pt *azcore.Poller +} + +// Done returns true if the LRO has reached a terminal state. +func (p *WebAppsStartNetworkTracePoller) Done() bool { + return p.pt.Done() +} + +// Poll fetches the latest state of the LRO. It returns an HTTP response or error. +// If the LRO has completed successfully, the poller's state is updated and the HTTP +// response is returned. +// If the LRO has completed with failure or was cancelled, the poller's state is +// updated and the error is returned. +// If the LRO has not reached a terminal state, the poller's state is updated and +// the latest HTTP response is returned. +// If Poll fails, the poller's state is unmodified and the error is returned. +// Calling Poll on an LRO that has reached a terminal state will return the final +// HTTP response or error. +func (p *WebAppsStartNetworkTracePoller) Poll(ctx context.Context) (*http.Response, error) { + return p.pt.Poll(ctx) +} + +// FinalResponse performs a final GET to the service and returns the final response +// for the polling operation. If there is an error performing the final GET then an error is returned. +// If the final GET succeeded then the final WebAppsStartNetworkTraceResponse will be returned. +func (p *WebAppsStartNetworkTracePoller) FinalResponse(ctx context.Context) (WebAppsStartNetworkTraceResponse, error) { + respType := WebAppsStartNetworkTraceResponse{} + resp, err := p.pt.FinalResponse(ctx, &respType.NetworkTraceArray) + if err != nil { + return WebAppsStartNetworkTraceResponse{}, err + } + respType.RawResponse = resp + return respType, nil +} + +// ResumeToken returns a value representing the poller that can be used to resume +// the LRO at a later time. ResumeTokens are unique per service operation. +func (p *WebAppsStartNetworkTracePoller) ResumeToken() (string, error) { + return p.pt.ResumeToken() +} + +// WebAppsStartNetworkTraceSlotPoller provides polling facilities until the operation reaches a terminal state. +type WebAppsStartNetworkTraceSlotPoller struct { + pt *azcore.Poller +} + +// Done returns true if the LRO has reached a terminal state. +func (p *WebAppsStartNetworkTraceSlotPoller) Done() bool { + return p.pt.Done() +} + +// Poll fetches the latest state of the LRO. It returns an HTTP response or error. +// If the LRO has completed successfully, the poller's state is updated and the HTTP +// response is returned. +// If the LRO has completed with failure or was cancelled, the poller's state is +// updated and the error is returned. +// If the LRO has not reached a terminal state, the poller's state is updated and +// the latest HTTP response is returned. +// If Poll fails, the poller's state is unmodified and the error is returned. +// Calling Poll on an LRO that has reached a terminal state will return the final +// HTTP response or error. +func (p *WebAppsStartNetworkTraceSlotPoller) Poll(ctx context.Context) (*http.Response, error) { + return p.pt.Poll(ctx) +} + +// FinalResponse performs a final GET to the service and returns the final response +// for the polling operation. If there is an error performing the final GET then an error is returned. +// If the final GET succeeded then the final WebAppsStartNetworkTraceSlotResponse will be returned. +func (p *WebAppsStartNetworkTraceSlotPoller) FinalResponse(ctx context.Context) (WebAppsStartNetworkTraceSlotResponse, error) { + respType := WebAppsStartNetworkTraceSlotResponse{} + resp, err := p.pt.FinalResponse(ctx, &respType.NetworkTraceArray) + if err != nil { + return WebAppsStartNetworkTraceSlotResponse{}, err + } + respType.RawResponse = resp + return respType, nil +} + +// ResumeToken returns a value representing the poller that can be used to resume +// the LRO at a later time. ResumeTokens are unique per service operation. +func (p *WebAppsStartNetworkTraceSlotPoller) ResumeToken() (string, error) { + return p.pt.ResumeToken() +} + +// WebAppsStartWebSiteNetworkTraceOperationPoller provides polling facilities until the operation reaches a terminal state. +type WebAppsStartWebSiteNetworkTraceOperationPoller struct { + pt *azcore.Poller +} + +// Done returns true if the LRO has reached a terminal state. +func (p *WebAppsStartWebSiteNetworkTraceOperationPoller) Done() bool { + return p.pt.Done() +} + +// Poll fetches the latest state of the LRO. It returns an HTTP response or error. +// If the LRO has completed successfully, the poller's state is updated and the HTTP +// response is returned. +// If the LRO has completed with failure or was cancelled, the poller's state is +// updated and the error is returned. +// If the LRO has not reached a terminal state, the poller's state is updated and +// the latest HTTP response is returned. +// If Poll fails, the poller's state is unmodified and the error is returned. +// Calling Poll on an LRO that has reached a terminal state will return the final +// HTTP response or error. +func (p *WebAppsStartWebSiteNetworkTraceOperationPoller) Poll(ctx context.Context) (*http.Response, error) { + return p.pt.Poll(ctx) +} + +// FinalResponse performs a final GET to the service and returns the final response +// for the polling operation. If there is an error performing the final GET then an error is returned. +// If the final GET succeeded then the final WebAppsStartWebSiteNetworkTraceOperationResponse will be returned. +func (p *WebAppsStartWebSiteNetworkTraceOperationPoller) FinalResponse(ctx context.Context) (WebAppsStartWebSiteNetworkTraceOperationResponse, error) { + respType := WebAppsStartWebSiteNetworkTraceOperationResponse{} + resp, err := p.pt.FinalResponse(ctx, &respType.NetworkTraceArray) + if err != nil { + return WebAppsStartWebSiteNetworkTraceOperationResponse{}, err + } + respType.RawResponse = resp + return respType, nil +} + +// ResumeToken returns a value representing the poller that can be used to resume +// the LRO at a later time. ResumeTokens are unique per service operation. +func (p *WebAppsStartWebSiteNetworkTraceOperationPoller) ResumeToken() (string, error) { + return p.pt.ResumeToken() +} + +// WebAppsStartWebSiteNetworkTraceOperationSlotPoller provides polling facilities until the operation reaches a terminal state. +type WebAppsStartWebSiteNetworkTraceOperationSlotPoller struct { + pt *azcore.Poller +} + +// Done returns true if the LRO has reached a terminal state. +func (p *WebAppsStartWebSiteNetworkTraceOperationSlotPoller) Done() bool { + return p.pt.Done() +} + +// Poll fetches the latest state of the LRO. It returns an HTTP response or error. +// If the LRO has completed successfully, the poller's state is updated and the HTTP +// response is returned. +// If the LRO has completed with failure or was cancelled, the poller's state is +// updated and the error is returned. +// If the LRO has not reached a terminal state, the poller's state is updated and +// the latest HTTP response is returned. +// If Poll fails, the poller's state is unmodified and the error is returned. +// Calling Poll on an LRO that has reached a terminal state will return the final +// HTTP response or error. +func (p *WebAppsStartWebSiteNetworkTraceOperationSlotPoller) Poll(ctx context.Context) (*http.Response, error) { + return p.pt.Poll(ctx) +} + +// FinalResponse performs a final GET to the service and returns the final response +// for the polling operation. If there is an error performing the final GET then an error is returned. +// If the final GET succeeded then the final WebAppsStartWebSiteNetworkTraceOperationSlotResponse will be returned. +func (p *WebAppsStartWebSiteNetworkTraceOperationSlotPoller) FinalResponse(ctx context.Context) (WebAppsStartWebSiteNetworkTraceOperationSlotResponse, error) { + respType := WebAppsStartWebSiteNetworkTraceOperationSlotResponse{} + resp, err := p.pt.FinalResponse(ctx, &respType.NetworkTraceArray) + if err != nil { + return WebAppsStartWebSiteNetworkTraceOperationSlotResponse{}, err + } + respType.RawResponse = resp + return respType, nil +} + +// ResumeToken returns a value representing the poller that can be used to resume +// the LRO at a later time. ResumeTokens are unique per service operation. +func (p *WebAppsStartWebSiteNetworkTraceOperationSlotPoller) ResumeToken() (string, error) { + return p.pt.ResumeToken() +} + +// WebAppsSwapSlotPoller provides polling facilities until the operation reaches a terminal state. +type WebAppsSwapSlotPoller struct { + pt *azcore.Poller +} + +// Done returns true if the LRO has reached a terminal state. +func (p *WebAppsSwapSlotPoller) Done() bool { + return p.pt.Done() +} + +// Poll fetches the latest state of the LRO. It returns an HTTP response or error. +// If the LRO has completed successfully, the poller's state is updated and the HTTP +// response is returned. +// If the LRO has completed with failure or was cancelled, the poller's state is +// updated and the error is returned. +// If the LRO has not reached a terminal state, the poller's state is updated and +// the latest HTTP response is returned. +// If Poll fails, the poller's state is unmodified and the error is returned. +// Calling Poll on an LRO that has reached a terminal state will return the final +// HTTP response or error. +func (p *WebAppsSwapSlotPoller) Poll(ctx context.Context) (*http.Response, error) { + return p.pt.Poll(ctx) +} + +// FinalResponse performs a final GET to the service and returns the final response +// for the polling operation. If there is an error performing the final GET then an error is returned. +// If the final GET succeeded then the final WebAppsSwapSlotResponse will be returned. +func (p *WebAppsSwapSlotPoller) FinalResponse(ctx context.Context) (WebAppsSwapSlotResponse, error) { + respType := WebAppsSwapSlotResponse{} + resp, err := p.pt.FinalResponse(ctx, nil) + if err != nil { + return WebAppsSwapSlotResponse{}, err + } + respType.RawResponse = resp + return respType, nil +} + +// ResumeToken returns a value representing the poller that can be used to resume +// the LRO at a later time. ResumeTokens are unique per service operation. +func (p *WebAppsSwapSlotPoller) ResumeToken() (string, error) { + return p.pt.ResumeToken() +} + +// WebAppsSwapSlotWithProductionPoller provides polling facilities until the operation reaches a terminal state. +type WebAppsSwapSlotWithProductionPoller struct { + pt *azcore.Poller +} + +// Done returns true if the LRO has reached a terminal state. +func (p *WebAppsSwapSlotWithProductionPoller) Done() bool { + return p.pt.Done() +} + +// Poll fetches the latest state of the LRO. It returns an HTTP response or error. +// If the LRO has completed successfully, the poller's state is updated and the HTTP +// response is returned. +// If the LRO has completed with failure or was cancelled, the poller's state is +// updated and the error is returned. +// If the LRO has not reached a terminal state, the poller's state is updated and +// the latest HTTP response is returned. +// If Poll fails, the poller's state is unmodified and the error is returned. +// Calling Poll on an LRO that has reached a terminal state will return the final +// HTTP response or error. +func (p *WebAppsSwapSlotWithProductionPoller) Poll(ctx context.Context) (*http.Response, error) { + return p.pt.Poll(ctx) +} + +// FinalResponse performs a final GET to the service and returns the final response +// for the polling operation. If there is an error performing the final GET then an error is returned. +// If the final GET succeeded then the final WebAppsSwapSlotWithProductionResponse will be returned. +func (p *WebAppsSwapSlotWithProductionPoller) FinalResponse(ctx context.Context) (WebAppsSwapSlotWithProductionResponse, error) { + respType := WebAppsSwapSlotWithProductionResponse{} + resp, err := p.pt.FinalResponse(ctx, nil) + if err != nil { + return WebAppsSwapSlotWithProductionResponse{}, err + } + respType.RawResponse = resp + return respType, nil +} + +// ResumeToken returns a value representing the poller that can be used to resume +// the LRO at a later time. ResumeTokens are unique per service operation. +func (p *WebAppsSwapSlotWithProductionPoller) ResumeToken() (string, error) { + return p.pt.ResumeToken() +} diff --git a/sdk/resourcemanager/appservice/armappservice/zz_generated_provider_client.go b/sdk/resourcemanager/appservice/armappservice/zz_generated_provider_client.go new file mode 100644 index 000000000000..ac17bff6ad75 --- /dev/null +++ b/sdk/resourcemanager/appservice/armappservice/zz_generated_provider_client.go @@ -0,0 +1,423 @@ +//go:build go1.16 +// +build go1.16 + +// 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. + +package armappservice + +import ( + "context" + "errors" + "fmt" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// ProviderClient contains the methods for the Provider group. +// Don't use this type directly, use NewProviderClient() instead. +type ProviderClient struct { + ep string + pl runtime.Pipeline + subscriptionID string +} + +// NewProviderClient creates a new instance of ProviderClient with the specified values. +func NewProviderClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *ProviderClient { + cp := arm.ClientOptions{} + if options != nil { + cp = *options + } + if len(cp.Host) == 0 { + cp.Host = arm.AzurePublicCloud + } + return &ProviderClient{subscriptionID: subscriptionID, ep: string(cp.Host), pl: armruntime.NewPipeline(module, version, credential, &cp)} +} + +// GetAvailableStacks - Description for Get available application frameworks and their versions +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *ProviderClient) GetAvailableStacks(options *ProviderGetAvailableStacksOptions) *ProviderGetAvailableStacksPager { + return &ProviderGetAvailableStacksPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.getAvailableStacksCreateRequest(ctx, options) + }, + advancer: func(ctx context.Context, resp ProviderGetAvailableStacksResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.ApplicationStackCollection.NextLink) + }, + } +} + +// getAvailableStacksCreateRequest creates the GetAvailableStacks request. +func (client *ProviderClient) getAvailableStacksCreateRequest(ctx context.Context, options *ProviderGetAvailableStacksOptions) (*policy.Request, error) { + urlPath := "/providers/Microsoft.Web/availableStacks" + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + if options != nil && options.OSTypeSelected != nil { + reqQP.Set("osTypeSelected", string(*options.OSTypeSelected)) + } + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getAvailableStacksHandleResponse handles the GetAvailableStacks response. +func (client *ProviderClient) getAvailableStacksHandleResponse(resp *http.Response) (ProviderGetAvailableStacksResponse, error) { + result := ProviderGetAvailableStacksResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.ApplicationStackCollection); err != nil { + return ProviderGetAvailableStacksResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getAvailableStacksHandleError handles the GetAvailableStacks error response. +func (client *ProviderClient) getAvailableStacksHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetAvailableStacksOnPrem - Description for Get available application frameworks and their versions +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *ProviderClient) GetAvailableStacksOnPrem(options *ProviderGetAvailableStacksOnPremOptions) *ProviderGetAvailableStacksOnPremPager { + return &ProviderGetAvailableStacksOnPremPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.getAvailableStacksOnPremCreateRequest(ctx, options) + }, + advancer: func(ctx context.Context, resp ProviderGetAvailableStacksOnPremResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.ApplicationStackCollection.NextLink) + }, + } +} + +// getAvailableStacksOnPremCreateRequest creates the GetAvailableStacksOnPrem request. +func (client *ProviderClient) getAvailableStacksOnPremCreateRequest(ctx context.Context, options *ProviderGetAvailableStacksOnPremOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Web/availableStacks" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + if options != nil && options.OSTypeSelected != nil { + reqQP.Set("osTypeSelected", string(*options.OSTypeSelected)) + } + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getAvailableStacksOnPremHandleResponse handles the GetAvailableStacksOnPrem response. +func (client *ProviderClient) getAvailableStacksOnPremHandleResponse(resp *http.Response) (ProviderGetAvailableStacksOnPremResponse, error) { + result := ProviderGetAvailableStacksOnPremResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.ApplicationStackCollection); err != nil { + return ProviderGetAvailableStacksOnPremResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getAvailableStacksOnPremHandleError handles the GetAvailableStacksOnPrem error response. +func (client *ProviderClient) getAvailableStacksOnPremHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetFunctionAppStacks - Description for Get available Function app frameworks and their versions +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *ProviderClient) GetFunctionAppStacks(options *ProviderGetFunctionAppStacksOptions) *ProviderGetFunctionAppStacksPager { + return &ProviderGetFunctionAppStacksPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.getFunctionAppStacksCreateRequest(ctx, options) + }, + advancer: func(ctx context.Context, resp ProviderGetFunctionAppStacksResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.FunctionAppStackCollection.NextLink) + }, + } +} + +// getFunctionAppStacksCreateRequest creates the GetFunctionAppStacks request. +func (client *ProviderClient) getFunctionAppStacksCreateRequest(ctx context.Context, options *ProviderGetFunctionAppStacksOptions) (*policy.Request, error) { + urlPath := "/providers/Microsoft.Web/functionAppStacks" + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + if options != nil && options.StackOsType != nil { + reqQP.Set("stackOsType", string(*options.StackOsType)) + } + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getFunctionAppStacksHandleResponse handles the GetFunctionAppStacks response. +func (client *ProviderClient) getFunctionAppStacksHandleResponse(resp *http.Response) (ProviderGetFunctionAppStacksResponse, error) { + result := ProviderGetFunctionAppStacksResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.FunctionAppStackCollection); err != nil { + return ProviderGetFunctionAppStacksResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getFunctionAppStacksHandleError handles the GetFunctionAppStacks error response. +func (client *ProviderClient) getFunctionAppStacksHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetFunctionAppStacksForLocation - Description for Get available Function app frameworks and their versions for location +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *ProviderClient) GetFunctionAppStacksForLocation(location string, options *ProviderGetFunctionAppStacksForLocationOptions) *ProviderGetFunctionAppStacksForLocationPager { + return &ProviderGetFunctionAppStacksForLocationPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.getFunctionAppStacksForLocationCreateRequest(ctx, location, options) + }, + advancer: func(ctx context.Context, resp ProviderGetFunctionAppStacksForLocationResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.FunctionAppStackCollection.NextLink) + }, + } +} + +// getFunctionAppStacksForLocationCreateRequest creates the GetFunctionAppStacksForLocation request. +func (client *ProviderClient) getFunctionAppStacksForLocationCreateRequest(ctx context.Context, location string, options *ProviderGetFunctionAppStacksForLocationOptions) (*policy.Request, error) { + urlPath := "/providers/Microsoft.Web/locations/{location}/functionAppStacks" + if location == "" { + return nil, errors.New("parameter location cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + if options != nil && options.StackOsType != nil { + reqQP.Set("stackOsType", string(*options.StackOsType)) + } + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getFunctionAppStacksForLocationHandleResponse handles the GetFunctionAppStacksForLocation response. +func (client *ProviderClient) getFunctionAppStacksForLocationHandleResponse(resp *http.Response) (ProviderGetFunctionAppStacksForLocationResponse, error) { + result := ProviderGetFunctionAppStacksForLocationResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.FunctionAppStackCollection); err != nil { + return ProviderGetFunctionAppStacksForLocationResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getFunctionAppStacksForLocationHandleError handles the GetFunctionAppStacksForLocation error response. +func (client *ProviderClient) getFunctionAppStacksForLocationHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetWebAppStacks - Description for Get available Web app frameworks and their versions +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *ProviderClient) GetWebAppStacks(options *ProviderGetWebAppStacksOptions) *ProviderGetWebAppStacksPager { + return &ProviderGetWebAppStacksPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.getWebAppStacksCreateRequest(ctx, options) + }, + advancer: func(ctx context.Context, resp ProviderGetWebAppStacksResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.WebAppStackCollection.NextLink) + }, + } +} + +// getWebAppStacksCreateRequest creates the GetWebAppStacks request. +func (client *ProviderClient) getWebAppStacksCreateRequest(ctx context.Context, options *ProviderGetWebAppStacksOptions) (*policy.Request, error) { + urlPath := "/providers/Microsoft.Web/webAppStacks" + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + if options != nil && options.StackOsType != nil { + reqQP.Set("stackOsType", string(*options.StackOsType)) + } + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getWebAppStacksHandleResponse handles the GetWebAppStacks response. +func (client *ProviderClient) getWebAppStacksHandleResponse(resp *http.Response) (ProviderGetWebAppStacksResponse, error) { + result := ProviderGetWebAppStacksResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.WebAppStackCollection); err != nil { + return ProviderGetWebAppStacksResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getWebAppStacksHandleError handles the GetWebAppStacks error response. +func (client *ProviderClient) getWebAppStacksHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetWebAppStacksForLocation - Description for Get available Web app frameworks and their versions for location +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *ProviderClient) GetWebAppStacksForLocation(location string, options *ProviderGetWebAppStacksForLocationOptions) *ProviderGetWebAppStacksForLocationPager { + return &ProviderGetWebAppStacksForLocationPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.getWebAppStacksForLocationCreateRequest(ctx, location, options) + }, + advancer: func(ctx context.Context, resp ProviderGetWebAppStacksForLocationResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.WebAppStackCollection.NextLink) + }, + } +} + +// getWebAppStacksForLocationCreateRequest creates the GetWebAppStacksForLocation request. +func (client *ProviderClient) getWebAppStacksForLocationCreateRequest(ctx context.Context, location string, options *ProviderGetWebAppStacksForLocationOptions) (*policy.Request, error) { + urlPath := "/providers/Microsoft.Web/locations/{location}/webAppStacks" + if location == "" { + return nil, errors.New("parameter location cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + if options != nil && options.StackOsType != nil { + reqQP.Set("stackOsType", string(*options.StackOsType)) + } + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getWebAppStacksForLocationHandleResponse handles the GetWebAppStacksForLocation response. +func (client *ProviderClient) getWebAppStacksForLocationHandleResponse(resp *http.Response) (ProviderGetWebAppStacksForLocationResponse, error) { + result := ProviderGetWebAppStacksForLocationResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.WebAppStackCollection); err != nil { + return ProviderGetWebAppStacksForLocationResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getWebAppStacksForLocationHandleError handles the GetWebAppStacksForLocation error response. +func (client *ProviderClient) getWebAppStacksForLocationHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListOperations - Description for Gets all available operations for the Microsoft.Web resource provider. Also exposes resource metric definitions +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *ProviderClient) ListOperations(options *ProviderListOperationsOptions) *ProviderListOperationsPager { + return &ProviderListOperationsPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listOperationsCreateRequest(ctx, options) + }, + advancer: func(ctx context.Context, resp ProviderListOperationsResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.CsmOperationCollection.NextLink) + }, + } +} + +// listOperationsCreateRequest creates the ListOperations request. +func (client *ProviderClient) listOperationsCreateRequest(ctx context.Context, options *ProviderListOperationsOptions) (*policy.Request, error) { + urlPath := "/providers/Microsoft.Web/operations" + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listOperationsHandleResponse handles the ListOperations response. +func (client *ProviderClient) listOperationsHandleResponse(resp *http.Response) (ProviderListOperationsResponse, error) { + result := ProviderListOperationsResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.CsmOperationCollection); err != nil { + return ProviderListOperationsResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listOperationsHandleError handles the ListOperations error response. +func (client *ProviderClient) listOperationsHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} diff --git a/sdk/resourcemanager/appservice/armappservice/zz_generated_recommendations_client.go b/sdk/resourcemanager/appservice/armappservice/zz_generated_recommendations_client.go new file mode 100644 index 000000000000..0af2467d1262 --- /dev/null +++ b/sdk/resourcemanager/appservice/armappservice/zz_generated_recommendations_client.go @@ -0,0 +1,983 @@ +//go:build go1.16 +// +build go1.16 + +// 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. + +package armappservice + +import ( + "context" + "errors" + "fmt" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strconv" + "strings" +) + +// RecommendationsClient contains the methods for the Recommendations group. +// Don't use this type directly, use NewRecommendationsClient() instead. +type RecommendationsClient struct { + ep string + pl runtime.Pipeline + subscriptionID string +} + +// NewRecommendationsClient creates a new instance of RecommendationsClient with the specified values. +func NewRecommendationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *RecommendationsClient { + cp := arm.ClientOptions{} + if options != nil { + cp = *options + } + if len(cp.Host) == 0 { + cp.Host = arm.AzurePublicCloud + } + return &RecommendationsClient{subscriptionID: subscriptionID, ep: string(cp.Host), pl: armruntime.NewPipeline(module, version, credential, &cp)} +} + +// DisableAllForHostingEnvironment - Description for Disable all recommendations for an app. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *RecommendationsClient) DisableAllForHostingEnvironment(ctx context.Context, resourceGroupName string, environmentName string, hostingEnvironmentName string, options *RecommendationsDisableAllForHostingEnvironmentOptions) (RecommendationsDisableAllForHostingEnvironmentResponse, error) { + req, err := client.disableAllForHostingEnvironmentCreateRequest(ctx, resourceGroupName, environmentName, hostingEnvironmentName, options) + if err != nil { + return RecommendationsDisableAllForHostingEnvironmentResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return RecommendationsDisableAllForHostingEnvironmentResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusNoContent) { + return RecommendationsDisableAllForHostingEnvironmentResponse{}, client.disableAllForHostingEnvironmentHandleError(resp) + } + return RecommendationsDisableAllForHostingEnvironmentResponse{RawResponse: resp}, nil +} + +// disableAllForHostingEnvironmentCreateRequest creates the DisableAllForHostingEnvironment request. +func (client *RecommendationsClient) disableAllForHostingEnvironmentCreateRequest(ctx context.Context, resourceGroupName string, environmentName string, hostingEnvironmentName string, options *RecommendationsDisableAllForHostingEnvironmentOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{hostingEnvironmentName}/recommendations/disable" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if hostingEnvironmentName == "" { + return nil, errors.New("parameter hostingEnvironmentName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{hostingEnvironmentName}", url.PathEscape(hostingEnvironmentName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("environmentName", environmentName) + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// disableAllForHostingEnvironmentHandleError handles the DisableAllForHostingEnvironment error response. +func (client *RecommendationsClient) disableAllForHostingEnvironmentHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// DisableAllForWebApp - Description for Disable all recommendations for an app. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *RecommendationsClient) DisableAllForWebApp(ctx context.Context, resourceGroupName string, siteName string, options *RecommendationsDisableAllForWebAppOptions) (RecommendationsDisableAllForWebAppResponse, error) { + req, err := client.disableAllForWebAppCreateRequest(ctx, resourceGroupName, siteName, options) + if err != nil { + return RecommendationsDisableAllForWebAppResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return RecommendationsDisableAllForWebAppResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusNoContent) { + return RecommendationsDisableAllForWebAppResponse{}, client.disableAllForWebAppHandleError(resp) + } + return RecommendationsDisableAllForWebAppResponse{RawResponse: resp}, nil +} + +// disableAllForWebAppCreateRequest creates the DisableAllForWebApp request. +func (client *RecommendationsClient) disableAllForWebAppCreateRequest(ctx context.Context, resourceGroupName string, siteName string, options *RecommendationsDisableAllForWebAppOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/recommendations/disable" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if siteName == "" { + return nil, errors.New("parameter siteName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{siteName}", url.PathEscape(siteName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// disableAllForWebAppHandleError handles the DisableAllForWebApp error response. +func (client *RecommendationsClient) disableAllForWebAppHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// DisableRecommendationForHostingEnvironment - Description for Disables the specific rule for a web site permanently. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *RecommendationsClient) DisableRecommendationForHostingEnvironment(ctx context.Context, resourceGroupName string, environmentName string, name string, hostingEnvironmentName string, options *RecommendationsDisableRecommendationForHostingEnvironmentOptions) (RecommendationsDisableRecommendationForHostingEnvironmentResponse, error) { + req, err := client.disableRecommendationForHostingEnvironmentCreateRequest(ctx, resourceGroupName, environmentName, name, hostingEnvironmentName, options) + if err != nil { + return RecommendationsDisableRecommendationForHostingEnvironmentResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return RecommendationsDisableRecommendationForHostingEnvironmentResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return RecommendationsDisableRecommendationForHostingEnvironmentResponse{}, client.disableRecommendationForHostingEnvironmentHandleError(resp) + } + return RecommendationsDisableRecommendationForHostingEnvironmentResponse{RawResponse: resp}, nil +} + +// disableRecommendationForHostingEnvironmentCreateRequest creates the DisableRecommendationForHostingEnvironment request. +func (client *RecommendationsClient) disableRecommendationForHostingEnvironmentCreateRequest(ctx context.Context, resourceGroupName string, environmentName string, name string, hostingEnvironmentName string, options *RecommendationsDisableRecommendationForHostingEnvironmentOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{hostingEnvironmentName}/recommendations/{name}/disable" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if hostingEnvironmentName == "" { + return nil, errors.New("parameter hostingEnvironmentName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{hostingEnvironmentName}", url.PathEscape(hostingEnvironmentName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("environmentName", environmentName) + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// disableRecommendationForHostingEnvironmentHandleError handles the DisableRecommendationForHostingEnvironment error response. +func (client *RecommendationsClient) disableRecommendationForHostingEnvironmentHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// DisableRecommendationForSite - Description for Disables the specific rule for a web site permanently. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *RecommendationsClient) DisableRecommendationForSite(ctx context.Context, resourceGroupName string, siteName string, name string, options *RecommendationsDisableRecommendationForSiteOptions) (RecommendationsDisableRecommendationForSiteResponse, error) { + req, err := client.disableRecommendationForSiteCreateRequest(ctx, resourceGroupName, siteName, name, options) + if err != nil { + return RecommendationsDisableRecommendationForSiteResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return RecommendationsDisableRecommendationForSiteResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return RecommendationsDisableRecommendationForSiteResponse{}, client.disableRecommendationForSiteHandleError(resp) + } + return RecommendationsDisableRecommendationForSiteResponse{RawResponse: resp}, nil +} + +// disableRecommendationForSiteCreateRequest creates the DisableRecommendationForSite request. +func (client *RecommendationsClient) disableRecommendationForSiteCreateRequest(ctx context.Context, resourceGroupName string, siteName string, name string, options *RecommendationsDisableRecommendationForSiteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/recommendations/{name}/disable" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if siteName == "" { + return nil, errors.New("parameter siteName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{siteName}", url.PathEscape(siteName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// disableRecommendationForSiteHandleError handles the DisableRecommendationForSite error response. +func (client *RecommendationsClient) disableRecommendationForSiteHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// DisableRecommendationForSubscription - Description for Disables the specified rule so it will not apply to a subscription in the future. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *RecommendationsClient) DisableRecommendationForSubscription(ctx context.Context, name string, options *RecommendationsDisableRecommendationForSubscriptionOptions) (RecommendationsDisableRecommendationForSubscriptionResponse, error) { + req, err := client.disableRecommendationForSubscriptionCreateRequest(ctx, name, options) + if err != nil { + return RecommendationsDisableRecommendationForSubscriptionResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return RecommendationsDisableRecommendationForSubscriptionResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return RecommendationsDisableRecommendationForSubscriptionResponse{}, client.disableRecommendationForSubscriptionHandleError(resp) + } + return RecommendationsDisableRecommendationForSubscriptionResponse{RawResponse: resp}, nil +} + +// disableRecommendationForSubscriptionCreateRequest creates the DisableRecommendationForSubscription request. +func (client *RecommendationsClient) disableRecommendationForSubscriptionCreateRequest(ctx context.Context, name string, options *RecommendationsDisableRecommendationForSubscriptionOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Web/recommendations/{name}/disable" + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// disableRecommendationForSubscriptionHandleError handles the DisableRecommendationForSubscription error response. +func (client *RecommendationsClient) disableRecommendationForSubscriptionHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetRuleDetailsByHostingEnvironment - Description for Get a recommendation rule for an app. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *RecommendationsClient) GetRuleDetailsByHostingEnvironment(ctx context.Context, resourceGroupName string, hostingEnvironmentName string, name string, options *RecommendationsGetRuleDetailsByHostingEnvironmentOptions) (RecommendationsGetRuleDetailsByHostingEnvironmentResponse, error) { + req, err := client.getRuleDetailsByHostingEnvironmentCreateRequest(ctx, resourceGroupName, hostingEnvironmentName, name, options) + if err != nil { + return RecommendationsGetRuleDetailsByHostingEnvironmentResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return RecommendationsGetRuleDetailsByHostingEnvironmentResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return RecommendationsGetRuleDetailsByHostingEnvironmentResponse{}, client.getRuleDetailsByHostingEnvironmentHandleError(resp) + } + return client.getRuleDetailsByHostingEnvironmentHandleResponse(resp) +} + +// getRuleDetailsByHostingEnvironmentCreateRequest creates the GetRuleDetailsByHostingEnvironment request. +func (client *RecommendationsClient) getRuleDetailsByHostingEnvironmentCreateRequest(ctx context.Context, resourceGroupName string, hostingEnvironmentName string, name string, options *RecommendationsGetRuleDetailsByHostingEnvironmentOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{hostingEnvironmentName}/recommendations/{name}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if hostingEnvironmentName == "" { + return nil, errors.New("parameter hostingEnvironmentName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{hostingEnvironmentName}", url.PathEscape(hostingEnvironmentName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + if options != nil && options.UpdateSeen != nil { + reqQP.Set("updateSeen", strconv.FormatBool(*options.UpdateSeen)) + } + if options != nil && options.RecommendationID != nil { + reqQP.Set("recommendationId", *options.RecommendationID) + } + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getRuleDetailsByHostingEnvironmentHandleResponse handles the GetRuleDetailsByHostingEnvironment response. +func (client *RecommendationsClient) getRuleDetailsByHostingEnvironmentHandleResponse(resp *http.Response) (RecommendationsGetRuleDetailsByHostingEnvironmentResponse, error) { + result := RecommendationsGetRuleDetailsByHostingEnvironmentResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.RecommendationRule); err != nil { + return RecommendationsGetRuleDetailsByHostingEnvironmentResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getRuleDetailsByHostingEnvironmentHandleError handles the GetRuleDetailsByHostingEnvironment error response. +func (client *RecommendationsClient) getRuleDetailsByHostingEnvironmentHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetRuleDetailsByWebApp - Description for Get a recommendation rule for an app. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *RecommendationsClient) GetRuleDetailsByWebApp(ctx context.Context, resourceGroupName string, siteName string, name string, options *RecommendationsGetRuleDetailsByWebAppOptions) (RecommendationsGetRuleDetailsByWebAppResponse, error) { + req, err := client.getRuleDetailsByWebAppCreateRequest(ctx, resourceGroupName, siteName, name, options) + if err != nil { + return RecommendationsGetRuleDetailsByWebAppResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return RecommendationsGetRuleDetailsByWebAppResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return RecommendationsGetRuleDetailsByWebAppResponse{}, client.getRuleDetailsByWebAppHandleError(resp) + } + return client.getRuleDetailsByWebAppHandleResponse(resp) +} + +// getRuleDetailsByWebAppCreateRequest creates the GetRuleDetailsByWebApp request. +func (client *RecommendationsClient) getRuleDetailsByWebAppCreateRequest(ctx context.Context, resourceGroupName string, siteName string, name string, options *RecommendationsGetRuleDetailsByWebAppOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/recommendations/{name}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if siteName == "" { + return nil, errors.New("parameter siteName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{siteName}", url.PathEscape(siteName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + if options != nil && options.UpdateSeen != nil { + reqQP.Set("updateSeen", strconv.FormatBool(*options.UpdateSeen)) + } + if options != nil && options.RecommendationID != nil { + reqQP.Set("recommendationId", *options.RecommendationID) + } + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getRuleDetailsByWebAppHandleResponse handles the GetRuleDetailsByWebApp response. +func (client *RecommendationsClient) getRuleDetailsByWebAppHandleResponse(resp *http.Response) (RecommendationsGetRuleDetailsByWebAppResponse, error) { + result := RecommendationsGetRuleDetailsByWebAppResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.RecommendationRule); err != nil { + return RecommendationsGetRuleDetailsByWebAppResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getRuleDetailsByWebAppHandleError handles the GetRuleDetailsByWebApp error response. +func (client *RecommendationsClient) getRuleDetailsByWebAppHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// List - Description for List all recommendations for a subscription. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *RecommendationsClient) List(options *RecommendationsListOptions) *RecommendationsListPager { + return &RecommendationsListPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listCreateRequest(ctx, options) + }, + advancer: func(ctx context.Context, resp RecommendationsListResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.RecommendationCollection.NextLink) + }, + } +} + +// listCreateRequest creates the List request. +func (client *RecommendationsClient) listCreateRequest(ctx context.Context, options *RecommendationsListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Web/recommendations" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + if options != nil && options.Featured != nil { + reqQP.Set("featured", strconv.FormatBool(*options.Featured)) + } + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + unencodedParams := []string{req.Raw().URL.RawQuery} + if options != nil && options.Filter != nil { + unencodedParams = append(unencodedParams, "$filter="+*options.Filter) + } + req.Raw().URL.RawQuery = strings.Join(unencodedParams, "&") + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listHandleResponse handles the List response. +func (client *RecommendationsClient) listHandleResponse(resp *http.Response) (RecommendationsListResponse, error) { + result := RecommendationsListResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.RecommendationCollection); err != nil { + return RecommendationsListResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listHandleError handles the List error response. +func (client *RecommendationsClient) listHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListHistoryForHostingEnvironment - Description for Get past recommendations for an app, optionally specified by the time range. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *RecommendationsClient) ListHistoryForHostingEnvironment(resourceGroupName string, hostingEnvironmentName string, options *RecommendationsListHistoryForHostingEnvironmentOptions) *RecommendationsListHistoryForHostingEnvironmentPager { + return &RecommendationsListHistoryForHostingEnvironmentPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listHistoryForHostingEnvironmentCreateRequest(ctx, resourceGroupName, hostingEnvironmentName, options) + }, + advancer: func(ctx context.Context, resp RecommendationsListHistoryForHostingEnvironmentResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.RecommendationCollection.NextLink) + }, + } +} + +// listHistoryForHostingEnvironmentCreateRequest creates the ListHistoryForHostingEnvironment request. +func (client *RecommendationsClient) listHistoryForHostingEnvironmentCreateRequest(ctx context.Context, resourceGroupName string, hostingEnvironmentName string, options *RecommendationsListHistoryForHostingEnvironmentOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{hostingEnvironmentName}/recommendationHistory" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if hostingEnvironmentName == "" { + return nil, errors.New("parameter hostingEnvironmentName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{hostingEnvironmentName}", url.PathEscape(hostingEnvironmentName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + if options != nil && options.ExpiredOnly != nil { + reqQP.Set("expiredOnly", strconv.FormatBool(*options.ExpiredOnly)) + } + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + unencodedParams := []string{req.Raw().URL.RawQuery} + if options != nil && options.Filter != nil { + unencodedParams = append(unencodedParams, "$filter="+*options.Filter) + } + req.Raw().URL.RawQuery = strings.Join(unencodedParams, "&") + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listHistoryForHostingEnvironmentHandleResponse handles the ListHistoryForHostingEnvironment response. +func (client *RecommendationsClient) listHistoryForHostingEnvironmentHandleResponse(resp *http.Response) (RecommendationsListHistoryForHostingEnvironmentResponse, error) { + result := RecommendationsListHistoryForHostingEnvironmentResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.RecommendationCollection); err != nil { + return RecommendationsListHistoryForHostingEnvironmentResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listHistoryForHostingEnvironmentHandleError handles the ListHistoryForHostingEnvironment error response. +func (client *RecommendationsClient) listHistoryForHostingEnvironmentHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListHistoryForWebApp - Description for Get past recommendations for an app, optionally specified by the time range. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *RecommendationsClient) ListHistoryForWebApp(resourceGroupName string, siteName string, options *RecommendationsListHistoryForWebAppOptions) *RecommendationsListHistoryForWebAppPager { + return &RecommendationsListHistoryForWebAppPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listHistoryForWebAppCreateRequest(ctx, resourceGroupName, siteName, options) + }, + advancer: func(ctx context.Context, resp RecommendationsListHistoryForWebAppResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.RecommendationCollection.NextLink) + }, + } +} + +// listHistoryForWebAppCreateRequest creates the ListHistoryForWebApp request. +func (client *RecommendationsClient) listHistoryForWebAppCreateRequest(ctx context.Context, resourceGroupName string, siteName string, options *RecommendationsListHistoryForWebAppOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/recommendationHistory" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if siteName == "" { + return nil, errors.New("parameter siteName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{siteName}", url.PathEscape(siteName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + if options != nil && options.ExpiredOnly != nil { + reqQP.Set("expiredOnly", strconv.FormatBool(*options.ExpiredOnly)) + } + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + unencodedParams := []string{req.Raw().URL.RawQuery} + if options != nil && options.Filter != nil { + unencodedParams = append(unencodedParams, "$filter="+*options.Filter) + } + req.Raw().URL.RawQuery = strings.Join(unencodedParams, "&") + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listHistoryForWebAppHandleResponse handles the ListHistoryForWebApp response. +func (client *RecommendationsClient) listHistoryForWebAppHandleResponse(resp *http.Response) (RecommendationsListHistoryForWebAppResponse, error) { + result := RecommendationsListHistoryForWebAppResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.RecommendationCollection); err != nil { + return RecommendationsListHistoryForWebAppResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listHistoryForWebAppHandleError handles the ListHistoryForWebApp error response. +func (client *RecommendationsClient) listHistoryForWebAppHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListRecommendedRulesForHostingEnvironment - Description for Get all recommendations for a hosting environment. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *RecommendationsClient) ListRecommendedRulesForHostingEnvironment(resourceGroupName string, hostingEnvironmentName string, options *RecommendationsListRecommendedRulesForHostingEnvironmentOptions) *RecommendationsListRecommendedRulesForHostingEnvironmentPager { + return &RecommendationsListRecommendedRulesForHostingEnvironmentPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listRecommendedRulesForHostingEnvironmentCreateRequest(ctx, resourceGroupName, hostingEnvironmentName, options) + }, + advancer: func(ctx context.Context, resp RecommendationsListRecommendedRulesForHostingEnvironmentResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.RecommendationCollection.NextLink) + }, + } +} + +// listRecommendedRulesForHostingEnvironmentCreateRequest creates the ListRecommendedRulesForHostingEnvironment request. +func (client *RecommendationsClient) listRecommendedRulesForHostingEnvironmentCreateRequest(ctx context.Context, resourceGroupName string, hostingEnvironmentName string, options *RecommendationsListRecommendedRulesForHostingEnvironmentOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{hostingEnvironmentName}/recommendations" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if hostingEnvironmentName == "" { + return nil, errors.New("parameter hostingEnvironmentName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{hostingEnvironmentName}", url.PathEscape(hostingEnvironmentName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + if options != nil && options.Featured != nil { + reqQP.Set("featured", strconv.FormatBool(*options.Featured)) + } + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + unencodedParams := []string{req.Raw().URL.RawQuery} + if options != nil && options.Filter != nil { + unencodedParams = append(unencodedParams, "$filter="+*options.Filter) + } + req.Raw().URL.RawQuery = strings.Join(unencodedParams, "&") + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listRecommendedRulesForHostingEnvironmentHandleResponse handles the ListRecommendedRulesForHostingEnvironment response. +func (client *RecommendationsClient) listRecommendedRulesForHostingEnvironmentHandleResponse(resp *http.Response) (RecommendationsListRecommendedRulesForHostingEnvironmentResponse, error) { + result := RecommendationsListRecommendedRulesForHostingEnvironmentResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.RecommendationCollection); err != nil { + return RecommendationsListRecommendedRulesForHostingEnvironmentResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listRecommendedRulesForHostingEnvironmentHandleError handles the ListRecommendedRulesForHostingEnvironment error response. +func (client *RecommendationsClient) listRecommendedRulesForHostingEnvironmentHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListRecommendedRulesForWebApp - Description for Get all recommendations for an app. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *RecommendationsClient) ListRecommendedRulesForWebApp(resourceGroupName string, siteName string, options *RecommendationsListRecommendedRulesForWebAppOptions) *RecommendationsListRecommendedRulesForWebAppPager { + return &RecommendationsListRecommendedRulesForWebAppPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listRecommendedRulesForWebAppCreateRequest(ctx, resourceGroupName, siteName, options) + }, + advancer: func(ctx context.Context, resp RecommendationsListRecommendedRulesForWebAppResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.RecommendationCollection.NextLink) + }, + } +} + +// listRecommendedRulesForWebAppCreateRequest creates the ListRecommendedRulesForWebApp request. +func (client *RecommendationsClient) listRecommendedRulesForWebAppCreateRequest(ctx context.Context, resourceGroupName string, siteName string, options *RecommendationsListRecommendedRulesForWebAppOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/recommendations" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if siteName == "" { + return nil, errors.New("parameter siteName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{siteName}", url.PathEscape(siteName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + if options != nil && options.Featured != nil { + reqQP.Set("featured", strconv.FormatBool(*options.Featured)) + } + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + unencodedParams := []string{req.Raw().URL.RawQuery} + if options != nil && options.Filter != nil { + unencodedParams = append(unencodedParams, "$filter="+*options.Filter) + } + req.Raw().URL.RawQuery = strings.Join(unencodedParams, "&") + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listRecommendedRulesForWebAppHandleResponse handles the ListRecommendedRulesForWebApp response. +func (client *RecommendationsClient) listRecommendedRulesForWebAppHandleResponse(resp *http.Response) (RecommendationsListRecommendedRulesForWebAppResponse, error) { + result := RecommendationsListRecommendedRulesForWebAppResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.RecommendationCollection); err != nil { + return RecommendationsListRecommendedRulesForWebAppResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listRecommendedRulesForWebAppHandleError handles the ListRecommendedRulesForWebApp error response. +func (client *RecommendationsClient) listRecommendedRulesForWebAppHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ResetAllFilters - Description for Reset all recommendation opt-out settings for a subscription. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *RecommendationsClient) ResetAllFilters(ctx context.Context, options *RecommendationsResetAllFiltersOptions) (RecommendationsResetAllFiltersResponse, error) { + req, err := client.resetAllFiltersCreateRequest(ctx, options) + if err != nil { + return RecommendationsResetAllFiltersResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return RecommendationsResetAllFiltersResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusNoContent) { + return RecommendationsResetAllFiltersResponse{}, client.resetAllFiltersHandleError(resp) + } + return RecommendationsResetAllFiltersResponse{RawResponse: resp}, nil +} + +// resetAllFiltersCreateRequest creates the ResetAllFilters request. +func (client *RecommendationsClient) resetAllFiltersCreateRequest(ctx context.Context, options *RecommendationsResetAllFiltersOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Web/recommendations/reset" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// resetAllFiltersHandleError handles the ResetAllFilters error response. +func (client *RecommendationsClient) resetAllFiltersHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ResetAllFiltersForHostingEnvironment - Description for Reset all recommendation opt-out settings for an app. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *RecommendationsClient) ResetAllFiltersForHostingEnvironment(ctx context.Context, resourceGroupName string, environmentName string, hostingEnvironmentName string, options *RecommendationsResetAllFiltersForHostingEnvironmentOptions) (RecommendationsResetAllFiltersForHostingEnvironmentResponse, error) { + req, err := client.resetAllFiltersForHostingEnvironmentCreateRequest(ctx, resourceGroupName, environmentName, hostingEnvironmentName, options) + if err != nil { + return RecommendationsResetAllFiltersForHostingEnvironmentResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return RecommendationsResetAllFiltersForHostingEnvironmentResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusNoContent) { + return RecommendationsResetAllFiltersForHostingEnvironmentResponse{}, client.resetAllFiltersForHostingEnvironmentHandleError(resp) + } + return RecommendationsResetAllFiltersForHostingEnvironmentResponse{RawResponse: resp}, nil +} + +// resetAllFiltersForHostingEnvironmentCreateRequest creates the ResetAllFiltersForHostingEnvironment request. +func (client *RecommendationsClient) resetAllFiltersForHostingEnvironmentCreateRequest(ctx context.Context, resourceGroupName string, environmentName string, hostingEnvironmentName string, options *RecommendationsResetAllFiltersForHostingEnvironmentOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{hostingEnvironmentName}/recommendations/reset" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if hostingEnvironmentName == "" { + return nil, errors.New("parameter hostingEnvironmentName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{hostingEnvironmentName}", url.PathEscape(hostingEnvironmentName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("environmentName", environmentName) + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// resetAllFiltersForHostingEnvironmentHandleError handles the ResetAllFiltersForHostingEnvironment error response. +func (client *RecommendationsClient) resetAllFiltersForHostingEnvironmentHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ResetAllFiltersForWebApp - Description for Reset all recommendation opt-out settings for an app. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *RecommendationsClient) ResetAllFiltersForWebApp(ctx context.Context, resourceGroupName string, siteName string, options *RecommendationsResetAllFiltersForWebAppOptions) (RecommendationsResetAllFiltersForWebAppResponse, error) { + req, err := client.resetAllFiltersForWebAppCreateRequest(ctx, resourceGroupName, siteName, options) + if err != nil { + return RecommendationsResetAllFiltersForWebAppResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return RecommendationsResetAllFiltersForWebAppResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusNoContent) { + return RecommendationsResetAllFiltersForWebAppResponse{}, client.resetAllFiltersForWebAppHandleError(resp) + } + return RecommendationsResetAllFiltersForWebAppResponse{RawResponse: resp}, nil +} + +// resetAllFiltersForWebAppCreateRequest creates the ResetAllFiltersForWebApp request. +func (client *RecommendationsClient) resetAllFiltersForWebAppCreateRequest(ctx context.Context, resourceGroupName string, siteName string, options *RecommendationsResetAllFiltersForWebAppOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/recommendations/reset" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if siteName == "" { + return nil, errors.New("parameter siteName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{siteName}", url.PathEscape(siteName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// resetAllFiltersForWebAppHandleError handles the ResetAllFiltersForWebApp error response. +func (client *RecommendationsClient) resetAllFiltersForWebAppHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} diff --git a/sdk/resourcemanager/appservice/armappservice/zz_generated_resourcehealthmetadata_client.go b/sdk/resourcemanager/appservice/armappservice/zz_generated_resourcehealthmetadata_client.go new file mode 100644 index 000000000000..d781b101227f --- /dev/null +++ b/sdk/resourcemanager/appservice/armappservice/zz_generated_resourcehealthmetadata_client.go @@ -0,0 +1,417 @@ +//go:build go1.16 +// +build go1.16 + +// 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. + +package armappservice + +import ( + "context" + "errors" + "fmt" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// ResourceHealthMetadataClient contains the methods for the ResourceHealthMetadata group. +// Don't use this type directly, use NewResourceHealthMetadataClient() instead. +type ResourceHealthMetadataClient struct { + ep string + pl runtime.Pipeline + subscriptionID string +} + +// NewResourceHealthMetadataClient creates a new instance of ResourceHealthMetadataClient with the specified values. +func NewResourceHealthMetadataClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *ResourceHealthMetadataClient { + cp := arm.ClientOptions{} + if options != nil { + cp = *options + } + if len(cp.Host) == 0 { + cp.Host = arm.AzurePublicCloud + } + return &ResourceHealthMetadataClient{subscriptionID: subscriptionID, ep: string(cp.Host), pl: armruntime.NewPipeline(module, version, credential, &cp)} +} + +// GetBySite - Description for Gets the category of ResourceHealthMetadata to use for the given site +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *ResourceHealthMetadataClient) GetBySite(ctx context.Context, resourceGroupName string, name string, options *ResourceHealthMetadataGetBySiteOptions) (ResourceHealthMetadataGetBySiteResponse, error) { + req, err := client.getBySiteCreateRequest(ctx, resourceGroupName, name, options) + if err != nil { + return ResourceHealthMetadataGetBySiteResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return ResourceHealthMetadataGetBySiteResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ResourceHealthMetadataGetBySiteResponse{}, client.getBySiteHandleError(resp) + } + return client.getBySiteHandleResponse(resp) +} + +// getBySiteCreateRequest creates the GetBySite request. +func (client *ResourceHealthMetadataClient) getBySiteCreateRequest(ctx context.Context, resourceGroupName string, name string, options *ResourceHealthMetadataGetBySiteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/resourceHealthMetadata/default" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getBySiteHandleResponse handles the GetBySite response. +func (client *ResourceHealthMetadataClient) getBySiteHandleResponse(resp *http.Response) (ResourceHealthMetadataGetBySiteResponse, error) { + result := ResourceHealthMetadataGetBySiteResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.ResourceHealthMetadata); err != nil { + return ResourceHealthMetadataGetBySiteResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getBySiteHandleError handles the GetBySite error response. +func (client *ResourceHealthMetadataClient) getBySiteHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetBySiteSlot - Description for Gets the category of ResourceHealthMetadata to use for the given site +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *ResourceHealthMetadataClient) GetBySiteSlot(ctx context.Context, resourceGroupName string, name string, slot string, options *ResourceHealthMetadataGetBySiteSlotOptions) (ResourceHealthMetadataGetBySiteSlotResponse, error) { + req, err := client.getBySiteSlotCreateRequest(ctx, resourceGroupName, name, slot, options) + if err != nil { + return ResourceHealthMetadataGetBySiteSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return ResourceHealthMetadataGetBySiteSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ResourceHealthMetadataGetBySiteSlotResponse{}, client.getBySiteSlotHandleError(resp) + } + return client.getBySiteSlotHandleResponse(resp) +} + +// getBySiteSlotCreateRequest creates the GetBySiteSlot request. +func (client *ResourceHealthMetadataClient) getBySiteSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, slot string, options *ResourceHealthMetadataGetBySiteSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/resourceHealthMetadata/default" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getBySiteSlotHandleResponse handles the GetBySiteSlot response. +func (client *ResourceHealthMetadataClient) getBySiteSlotHandleResponse(resp *http.Response) (ResourceHealthMetadataGetBySiteSlotResponse, error) { + result := ResourceHealthMetadataGetBySiteSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.ResourceHealthMetadata); err != nil { + return ResourceHealthMetadataGetBySiteSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getBySiteSlotHandleError handles the GetBySiteSlot error response. +func (client *ResourceHealthMetadataClient) getBySiteSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// List - Description for List all ResourceHealthMetadata for all sites in the subscription. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *ResourceHealthMetadataClient) List(options *ResourceHealthMetadataListOptions) *ResourceHealthMetadataListPager { + return &ResourceHealthMetadataListPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listCreateRequest(ctx, options) + }, + advancer: func(ctx context.Context, resp ResourceHealthMetadataListResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.ResourceHealthMetadataCollection.NextLink) + }, + } +} + +// listCreateRequest creates the List request. +func (client *ResourceHealthMetadataClient) listCreateRequest(ctx context.Context, options *ResourceHealthMetadataListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Web/resourceHealthMetadata" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listHandleResponse handles the List response. +func (client *ResourceHealthMetadataClient) listHandleResponse(resp *http.Response) (ResourceHealthMetadataListResponse, error) { + result := ResourceHealthMetadataListResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.ResourceHealthMetadataCollection); err != nil { + return ResourceHealthMetadataListResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listHandleError handles the List error response. +func (client *ResourceHealthMetadataClient) listHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListByResourceGroup - Description for List all ResourceHealthMetadata for all sites in the resource group in the subscription. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *ResourceHealthMetadataClient) ListByResourceGroup(resourceGroupName string, options *ResourceHealthMetadataListByResourceGroupOptions) *ResourceHealthMetadataListByResourceGroupPager { + return &ResourceHealthMetadataListByResourceGroupPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) + }, + advancer: func(ctx context.Context, resp ResourceHealthMetadataListByResourceGroupResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.ResourceHealthMetadataCollection.NextLink) + }, + } +} + +// listByResourceGroupCreateRequest creates the ListByResourceGroup request. +func (client *ResourceHealthMetadataClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *ResourceHealthMetadataListByResourceGroupOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/resourceHealthMetadata" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listByResourceGroupHandleResponse handles the ListByResourceGroup response. +func (client *ResourceHealthMetadataClient) listByResourceGroupHandleResponse(resp *http.Response) (ResourceHealthMetadataListByResourceGroupResponse, error) { + result := ResourceHealthMetadataListByResourceGroupResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.ResourceHealthMetadataCollection); err != nil { + return ResourceHealthMetadataListByResourceGroupResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listByResourceGroupHandleError handles the ListByResourceGroup error response. +func (client *ResourceHealthMetadataClient) listByResourceGroupHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListBySite - Description for Gets the category of ResourceHealthMetadata to use for the given site as a collection +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *ResourceHealthMetadataClient) ListBySite(resourceGroupName string, name string, options *ResourceHealthMetadataListBySiteOptions) *ResourceHealthMetadataListBySitePager { + return &ResourceHealthMetadataListBySitePager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listBySiteCreateRequest(ctx, resourceGroupName, name, options) + }, + advancer: func(ctx context.Context, resp ResourceHealthMetadataListBySiteResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.ResourceHealthMetadataCollection.NextLink) + }, + } +} + +// listBySiteCreateRequest creates the ListBySite request. +func (client *ResourceHealthMetadataClient) listBySiteCreateRequest(ctx context.Context, resourceGroupName string, name string, options *ResourceHealthMetadataListBySiteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/resourceHealthMetadata" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listBySiteHandleResponse handles the ListBySite response. +func (client *ResourceHealthMetadataClient) listBySiteHandleResponse(resp *http.Response) (ResourceHealthMetadataListBySiteResponse, error) { + result := ResourceHealthMetadataListBySiteResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.ResourceHealthMetadataCollection); err != nil { + return ResourceHealthMetadataListBySiteResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listBySiteHandleError handles the ListBySite error response. +func (client *ResourceHealthMetadataClient) listBySiteHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListBySiteSlot - Description for Gets the category of ResourceHealthMetadata to use for the given site as a collection +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *ResourceHealthMetadataClient) ListBySiteSlot(resourceGroupName string, name string, slot string, options *ResourceHealthMetadataListBySiteSlotOptions) *ResourceHealthMetadataListBySiteSlotPager { + return &ResourceHealthMetadataListBySiteSlotPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listBySiteSlotCreateRequest(ctx, resourceGroupName, name, slot, options) + }, + advancer: func(ctx context.Context, resp ResourceHealthMetadataListBySiteSlotResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.ResourceHealthMetadataCollection.NextLink) + }, + } +} + +// listBySiteSlotCreateRequest creates the ListBySiteSlot request. +func (client *ResourceHealthMetadataClient) listBySiteSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, slot string, options *ResourceHealthMetadataListBySiteSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/resourceHealthMetadata" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listBySiteSlotHandleResponse handles the ListBySiteSlot response. +func (client *ResourceHealthMetadataClient) listBySiteSlotHandleResponse(resp *http.Response) (ResourceHealthMetadataListBySiteSlotResponse, error) { + result := ResourceHealthMetadataListBySiteSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.ResourceHealthMetadataCollection); err != nil { + return ResourceHealthMetadataListBySiteSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listBySiteSlotHandleError handles the ListBySiteSlot error response. +func (client *ResourceHealthMetadataClient) listBySiteSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} diff --git a/sdk/resourcemanager/appservice/armappservice/zz_generated_response_types.go b/sdk/resourcemanager/appservice/armappservice/zz_generated_response_types.go new file mode 100644 index 000000000000..05407ca47190 --- /dev/null +++ b/sdk/resourcemanager/appservice/armappservice/zz_generated_response_types.go @@ -0,0 +1,9334 @@ +//go:build go1.16 +// +build go1.16 + +// 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. + +package armappservice + +import ( + "context" + armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "net/http" + "time" +) + +// AppServiceCertificateOrdersCreateOrUpdateCertificatePollerResponse contains the response from method AppServiceCertificateOrders.CreateOrUpdateCertificate. +type AppServiceCertificateOrdersCreateOrUpdateCertificatePollerResponse struct { + // Poller contains an initialized poller. + Poller *AppServiceCertificateOrdersCreateOrUpdateCertificatePoller + + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. +// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. +// A good starting value is 30 seconds. Note that some resources might benefit from a different value. +func (l AppServiceCertificateOrdersCreateOrUpdateCertificatePollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (AppServiceCertificateOrdersCreateOrUpdateCertificateResponse, error) { + respType := AppServiceCertificateOrdersCreateOrUpdateCertificateResponse{} + resp, err := l.Poller.pt.PollUntilDone(ctx, freq, &respType.AppServiceCertificateResource) + if err != nil { + return respType, err + } + respType.RawResponse = resp + return respType, nil +} + +// Resume rehydrates a AppServiceCertificateOrdersCreateOrUpdateCertificatePollerResponse from the provided client and resume token. +func (l *AppServiceCertificateOrdersCreateOrUpdateCertificatePollerResponse) Resume(ctx context.Context, client *AppServiceCertificateOrdersClient, token string) error { + pt, err := armruntime.NewPollerFromResumeToken("AppServiceCertificateOrdersClient.CreateOrUpdateCertificate", token, client.pl, client.createOrUpdateCertificateHandleError) + if err != nil { + return err + } + poller := &AppServiceCertificateOrdersCreateOrUpdateCertificatePoller{ + pt: pt, + } + resp, err := poller.Poll(ctx) + if err != nil { + return err + } + l.Poller = poller + l.RawResponse = resp + return nil +} + +// AppServiceCertificateOrdersCreateOrUpdateCertificateResponse contains the response from method AppServiceCertificateOrders.CreateOrUpdateCertificate. +type AppServiceCertificateOrdersCreateOrUpdateCertificateResponse struct { + AppServiceCertificateOrdersCreateOrUpdateCertificateResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// AppServiceCertificateOrdersCreateOrUpdateCertificateResult contains the result from method AppServiceCertificateOrders.CreateOrUpdateCertificate. +type AppServiceCertificateOrdersCreateOrUpdateCertificateResult struct { + AppServiceCertificateResource +} + +// AppServiceCertificateOrdersCreateOrUpdatePollerResponse contains the response from method AppServiceCertificateOrders.CreateOrUpdate. +type AppServiceCertificateOrdersCreateOrUpdatePollerResponse struct { + // Poller contains an initialized poller. + Poller *AppServiceCertificateOrdersCreateOrUpdatePoller + + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. +// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. +// A good starting value is 30 seconds. Note that some resources might benefit from a different value. +func (l AppServiceCertificateOrdersCreateOrUpdatePollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (AppServiceCertificateOrdersCreateOrUpdateResponse, error) { + respType := AppServiceCertificateOrdersCreateOrUpdateResponse{} + resp, err := l.Poller.pt.PollUntilDone(ctx, freq, &respType.AppServiceCertificateOrder) + if err != nil { + return respType, err + } + respType.RawResponse = resp + return respType, nil +} + +// Resume rehydrates a AppServiceCertificateOrdersCreateOrUpdatePollerResponse from the provided client and resume token. +func (l *AppServiceCertificateOrdersCreateOrUpdatePollerResponse) Resume(ctx context.Context, client *AppServiceCertificateOrdersClient, token string) error { + pt, err := armruntime.NewPollerFromResumeToken("AppServiceCertificateOrdersClient.CreateOrUpdate", token, client.pl, client.createOrUpdateHandleError) + if err != nil { + return err + } + poller := &AppServiceCertificateOrdersCreateOrUpdatePoller{ + pt: pt, + } + resp, err := poller.Poll(ctx) + if err != nil { + return err + } + l.Poller = poller + l.RawResponse = resp + return nil +} + +// AppServiceCertificateOrdersCreateOrUpdateResponse contains the response from method AppServiceCertificateOrders.CreateOrUpdate. +type AppServiceCertificateOrdersCreateOrUpdateResponse struct { + AppServiceCertificateOrdersCreateOrUpdateResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// AppServiceCertificateOrdersCreateOrUpdateResult contains the result from method AppServiceCertificateOrders.CreateOrUpdate. +type AppServiceCertificateOrdersCreateOrUpdateResult struct { + AppServiceCertificateOrder +} + +// AppServiceCertificateOrdersDeleteCertificateResponse contains the response from method AppServiceCertificateOrders.DeleteCertificate. +type AppServiceCertificateOrdersDeleteCertificateResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// AppServiceCertificateOrdersDeleteResponse contains the response from method AppServiceCertificateOrders.Delete. +type AppServiceCertificateOrdersDeleteResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// AppServiceCertificateOrdersGetCertificateResponse contains the response from method AppServiceCertificateOrders.GetCertificate. +type AppServiceCertificateOrdersGetCertificateResponse struct { + AppServiceCertificateOrdersGetCertificateResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// AppServiceCertificateOrdersGetCertificateResult contains the result from method AppServiceCertificateOrders.GetCertificate. +type AppServiceCertificateOrdersGetCertificateResult struct { + AppServiceCertificateResource +} + +// AppServiceCertificateOrdersGetResponse contains the response from method AppServiceCertificateOrders.Get. +type AppServiceCertificateOrdersGetResponse struct { + AppServiceCertificateOrdersGetResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// AppServiceCertificateOrdersGetResult contains the result from method AppServiceCertificateOrders.Get. +type AppServiceCertificateOrdersGetResult struct { + AppServiceCertificateOrder +} + +// AppServiceCertificateOrdersListByResourceGroupResponse contains the response from method AppServiceCertificateOrders.ListByResourceGroup. +type AppServiceCertificateOrdersListByResourceGroupResponse struct { + AppServiceCertificateOrdersListByResourceGroupResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// AppServiceCertificateOrdersListByResourceGroupResult contains the result from method AppServiceCertificateOrders.ListByResourceGroup. +type AppServiceCertificateOrdersListByResourceGroupResult struct { + AppServiceCertificateOrderCollection +} + +// AppServiceCertificateOrdersListCertificatesResponse contains the response from method AppServiceCertificateOrders.ListCertificates. +type AppServiceCertificateOrdersListCertificatesResponse struct { + AppServiceCertificateOrdersListCertificatesResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// AppServiceCertificateOrdersListCertificatesResult contains the result from method AppServiceCertificateOrders.ListCertificates. +type AppServiceCertificateOrdersListCertificatesResult struct { + AppServiceCertificateCollection +} + +// AppServiceCertificateOrdersListResponse contains the response from method AppServiceCertificateOrders.List. +type AppServiceCertificateOrdersListResponse struct { + AppServiceCertificateOrdersListResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// AppServiceCertificateOrdersListResult contains the result from method AppServiceCertificateOrders.List. +type AppServiceCertificateOrdersListResult struct { + AppServiceCertificateOrderCollection +} + +// AppServiceCertificateOrdersReissueResponse contains the response from method AppServiceCertificateOrders.Reissue. +type AppServiceCertificateOrdersReissueResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// AppServiceCertificateOrdersRenewResponse contains the response from method AppServiceCertificateOrders.Renew. +type AppServiceCertificateOrdersRenewResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// AppServiceCertificateOrdersResendEmailResponse contains the response from method AppServiceCertificateOrders.ResendEmail. +type AppServiceCertificateOrdersResendEmailResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// AppServiceCertificateOrdersResendRequestEmailsResponse contains the response from method AppServiceCertificateOrders.ResendRequestEmails. +type AppServiceCertificateOrdersResendRequestEmailsResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// AppServiceCertificateOrdersRetrieveCertificateActionsResponse contains the response from method AppServiceCertificateOrders.RetrieveCertificateActions. +type AppServiceCertificateOrdersRetrieveCertificateActionsResponse struct { + AppServiceCertificateOrdersRetrieveCertificateActionsResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// AppServiceCertificateOrdersRetrieveCertificateActionsResult contains the result from method AppServiceCertificateOrders.RetrieveCertificateActions. +type AppServiceCertificateOrdersRetrieveCertificateActionsResult struct { + // Array of CertificateOrderAction + CertificateOrderActionArray []*CertificateOrderAction +} + +// AppServiceCertificateOrdersRetrieveCertificateEmailHistoryResponse contains the response from method AppServiceCertificateOrders.RetrieveCertificateEmailHistory. +type AppServiceCertificateOrdersRetrieveCertificateEmailHistoryResponse struct { + AppServiceCertificateOrdersRetrieveCertificateEmailHistoryResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// AppServiceCertificateOrdersRetrieveCertificateEmailHistoryResult contains the result from method AppServiceCertificateOrders.RetrieveCertificateEmailHistory. +type AppServiceCertificateOrdersRetrieveCertificateEmailHistoryResult struct { + // Array of CertificateEmail + CertificateEmailArray []*CertificateEmail +} + +// AppServiceCertificateOrdersRetrieveSiteSealResponse contains the response from method AppServiceCertificateOrders.RetrieveSiteSeal. +type AppServiceCertificateOrdersRetrieveSiteSealResponse struct { + AppServiceCertificateOrdersRetrieveSiteSealResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// AppServiceCertificateOrdersRetrieveSiteSealResult contains the result from method AppServiceCertificateOrders.RetrieveSiteSeal. +type AppServiceCertificateOrdersRetrieveSiteSealResult struct { + SiteSeal +} + +// AppServiceCertificateOrdersUpdateCertificateResponse contains the response from method AppServiceCertificateOrders.UpdateCertificate. +type AppServiceCertificateOrdersUpdateCertificateResponse struct { + AppServiceCertificateOrdersUpdateCertificateResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// AppServiceCertificateOrdersUpdateCertificateResult contains the result from method AppServiceCertificateOrders.UpdateCertificate. +type AppServiceCertificateOrdersUpdateCertificateResult struct { + AppServiceCertificateResource +} + +// AppServiceCertificateOrdersUpdateResponse contains the response from method AppServiceCertificateOrders.Update. +type AppServiceCertificateOrdersUpdateResponse struct { + AppServiceCertificateOrdersUpdateResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// AppServiceCertificateOrdersUpdateResult contains the result from method AppServiceCertificateOrders.Update. +type AppServiceCertificateOrdersUpdateResult struct { + AppServiceCertificateOrder +} + +// AppServiceCertificateOrdersValidatePurchaseInformationResponse contains the response from method AppServiceCertificateOrders.ValidatePurchaseInformation. +type AppServiceCertificateOrdersValidatePurchaseInformationResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// AppServiceCertificateOrdersVerifyDomainOwnershipResponse contains the response from method AppServiceCertificateOrders.VerifyDomainOwnership. +type AppServiceCertificateOrdersVerifyDomainOwnershipResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// AppServiceEnvironmentsApproveOrRejectPrivateEndpointConnectionPollerResponse contains the response from method AppServiceEnvironments.ApproveOrRejectPrivateEndpointConnection. +type AppServiceEnvironmentsApproveOrRejectPrivateEndpointConnectionPollerResponse struct { + // Poller contains an initialized poller. + Poller *AppServiceEnvironmentsApproveOrRejectPrivateEndpointConnectionPoller + + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. +// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. +// A good starting value is 30 seconds. Note that some resources might benefit from a different value. +func (l AppServiceEnvironmentsApproveOrRejectPrivateEndpointConnectionPollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (AppServiceEnvironmentsApproveOrRejectPrivateEndpointConnectionResponse, error) { + respType := AppServiceEnvironmentsApproveOrRejectPrivateEndpointConnectionResponse{} + resp, err := l.Poller.pt.PollUntilDone(ctx, freq, &respType.RemotePrivateEndpointConnectionARMResource) + if err != nil { + return respType, err + } + respType.RawResponse = resp + return respType, nil +} + +// Resume rehydrates a AppServiceEnvironmentsApproveOrRejectPrivateEndpointConnectionPollerResponse from the provided client and resume token. +func (l *AppServiceEnvironmentsApproveOrRejectPrivateEndpointConnectionPollerResponse) Resume(ctx context.Context, client *AppServiceEnvironmentsClient, token string) error { + pt, err := armruntime.NewPollerFromResumeToken("AppServiceEnvironmentsClient.ApproveOrRejectPrivateEndpointConnection", token, client.pl, client.approveOrRejectPrivateEndpointConnectionHandleError) + if err != nil { + return err + } + poller := &AppServiceEnvironmentsApproveOrRejectPrivateEndpointConnectionPoller{ + pt: pt, + } + resp, err := poller.Poll(ctx) + if err != nil { + return err + } + l.Poller = poller + l.RawResponse = resp + return nil +} + +// AppServiceEnvironmentsApproveOrRejectPrivateEndpointConnectionResponse contains the response from method AppServiceEnvironments.ApproveOrRejectPrivateEndpointConnection. +type AppServiceEnvironmentsApproveOrRejectPrivateEndpointConnectionResponse struct { + AppServiceEnvironmentsApproveOrRejectPrivateEndpointConnectionResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// AppServiceEnvironmentsApproveOrRejectPrivateEndpointConnectionResult contains the result from method AppServiceEnvironments.ApproveOrRejectPrivateEndpointConnection. +type AppServiceEnvironmentsApproveOrRejectPrivateEndpointConnectionResult struct { + RemotePrivateEndpointConnectionARMResource +} + +// AppServiceEnvironmentsChangeVnetPollerResponse contains the response from method AppServiceEnvironments.ChangeVnet. +type AppServiceEnvironmentsChangeVnetPollerResponse struct { + // Poller contains an initialized poller. + Poller *AppServiceEnvironmentsChangeVnetPoller + + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. +// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. +// A good starting value is 30 seconds. Note that some resources might benefit from a different value. +func (l AppServiceEnvironmentsChangeVnetPollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (*AppServiceEnvironmentsChangeVnetPager, error) { + respType := &AppServiceEnvironmentsChangeVnetPager{} + resp, err := l.Poller.pt.PollUntilDone(ctx, freq, &respType.current.WebAppCollection) + if err != nil { + return respType, err + } + respType.current.RawResponse = resp + respType.client = l.Poller.client + return respType, nil +} + +// Resume rehydrates a AppServiceEnvironmentsChangeVnetPollerResponse from the provided client and resume token. +func (l *AppServiceEnvironmentsChangeVnetPollerResponse) Resume(ctx context.Context, client *AppServiceEnvironmentsClient, token string) error { + pt, err := armruntime.NewPollerFromResumeToken("AppServiceEnvironmentsClient.ChangeVnet", token, client.pl, client.changeVnetHandleError) + if err != nil { + return err + } + poller := &AppServiceEnvironmentsChangeVnetPoller{ + pt: pt, + client: client, + } + resp, err := poller.Poll(ctx) + if err != nil { + return err + } + l.Poller = poller + l.RawResponse = resp + return nil +} + +// AppServiceEnvironmentsChangeVnetResponse contains the response from method AppServiceEnvironments.ChangeVnet. +type AppServiceEnvironmentsChangeVnetResponse struct { + AppServiceEnvironmentsChangeVnetResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// AppServiceEnvironmentsChangeVnetResult contains the result from method AppServiceEnvironments.ChangeVnet. +type AppServiceEnvironmentsChangeVnetResult struct { + WebAppCollection +} + +// AppServiceEnvironmentsCreateOrUpdateMultiRolePoolPollerResponse contains the response from method AppServiceEnvironments.CreateOrUpdateMultiRolePool. +type AppServiceEnvironmentsCreateOrUpdateMultiRolePoolPollerResponse struct { + // Poller contains an initialized poller. + Poller *AppServiceEnvironmentsCreateOrUpdateMultiRolePoolPoller + + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. +// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. +// A good starting value is 30 seconds. Note that some resources might benefit from a different value. +func (l AppServiceEnvironmentsCreateOrUpdateMultiRolePoolPollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (AppServiceEnvironmentsCreateOrUpdateMultiRolePoolResponse, error) { + respType := AppServiceEnvironmentsCreateOrUpdateMultiRolePoolResponse{} + resp, err := l.Poller.pt.PollUntilDone(ctx, freq, &respType.WorkerPoolResource) + if err != nil { + return respType, err + } + respType.RawResponse = resp + return respType, nil +} + +// Resume rehydrates a AppServiceEnvironmentsCreateOrUpdateMultiRolePoolPollerResponse from the provided client and resume token. +func (l *AppServiceEnvironmentsCreateOrUpdateMultiRolePoolPollerResponse) Resume(ctx context.Context, client *AppServiceEnvironmentsClient, token string) error { + pt, err := armruntime.NewPollerFromResumeToken("AppServiceEnvironmentsClient.CreateOrUpdateMultiRolePool", token, client.pl, client.createOrUpdateMultiRolePoolHandleError) + if err != nil { + return err + } + poller := &AppServiceEnvironmentsCreateOrUpdateMultiRolePoolPoller{ + pt: pt, + } + resp, err := poller.Poll(ctx) + if err != nil { + return err + } + l.Poller = poller + l.RawResponse = resp + return nil +} + +// AppServiceEnvironmentsCreateOrUpdateMultiRolePoolResponse contains the response from method AppServiceEnvironments.CreateOrUpdateMultiRolePool. +type AppServiceEnvironmentsCreateOrUpdateMultiRolePoolResponse struct { + AppServiceEnvironmentsCreateOrUpdateMultiRolePoolResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// AppServiceEnvironmentsCreateOrUpdateMultiRolePoolResult contains the result from method AppServiceEnvironments.CreateOrUpdateMultiRolePool. +type AppServiceEnvironmentsCreateOrUpdateMultiRolePoolResult struct { + WorkerPoolResource +} + +// AppServiceEnvironmentsCreateOrUpdatePollerResponse contains the response from method AppServiceEnvironments.CreateOrUpdate. +type AppServiceEnvironmentsCreateOrUpdatePollerResponse struct { + // Poller contains an initialized poller. + Poller *AppServiceEnvironmentsCreateOrUpdatePoller + + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. +// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. +// A good starting value is 30 seconds. Note that some resources might benefit from a different value. +func (l AppServiceEnvironmentsCreateOrUpdatePollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (AppServiceEnvironmentsCreateOrUpdateResponse, error) { + respType := AppServiceEnvironmentsCreateOrUpdateResponse{} + resp, err := l.Poller.pt.PollUntilDone(ctx, freq, &respType.AppServiceEnvironmentResource) + if err != nil { + return respType, err + } + respType.RawResponse = resp + return respType, nil +} + +// Resume rehydrates a AppServiceEnvironmentsCreateOrUpdatePollerResponse from the provided client and resume token. +func (l *AppServiceEnvironmentsCreateOrUpdatePollerResponse) Resume(ctx context.Context, client *AppServiceEnvironmentsClient, token string) error { + pt, err := armruntime.NewPollerFromResumeToken("AppServiceEnvironmentsClient.CreateOrUpdate", token, client.pl, client.createOrUpdateHandleError) + if err != nil { + return err + } + poller := &AppServiceEnvironmentsCreateOrUpdatePoller{ + pt: pt, + } + resp, err := poller.Poll(ctx) + if err != nil { + return err + } + l.Poller = poller + l.RawResponse = resp + return nil +} + +// AppServiceEnvironmentsCreateOrUpdateResponse contains the response from method AppServiceEnvironments.CreateOrUpdate. +type AppServiceEnvironmentsCreateOrUpdateResponse struct { + AppServiceEnvironmentsCreateOrUpdateResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// AppServiceEnvironmentsCreateOrUpdateResult contains the result from method AppServiceEnvironments.CreateOrUpdate. +type AppServiceEnvironmentsCreateOrUpdateResult struct { + AppServiceEnvironmentResource +} + +// AppServiceEnvironmentsCreateOrUpdateWorkerPoolPollerResponse contains the response from method AppServiceEnvironments.CreateOrUpdateWorkerPool. +type AppServiceEnvironmentsCreateOrUpdateWorkerPoolPollerResponse struct { + // Poller contains an initialized poller. + Poller *AppServiceEnvironmentsCreateOrUpdateWorkerPoolPoller + + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. +// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. +// A good starting value is 30 seconds. Note that some resources might benefit from a different value. +func (l AppServiceEnvironmentsCreateOrUpdateWorkerPoolPollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (AppServiceEnvironmentsCreateOrUpdateWorkerPoolResponse, error) { + respType := AppServiceEnvironmentsCreateOrUpdateWorkerPoolResponse{} + resp, err := l.Poller.pt.PollUntilDone(ctx, freq, &respType.WorkerPoolResource) + if err != nil { + return respType, err + } + respType.RawResponse = resp + return respType, nil +} + +// Resume rehydrates a AppServiceEnvironmentsCreateOrUpdateWorkerPoolPollerResponse from the provided client and resume token. +func (l *AppServiceEnvironmentsCreateOrUpdateWorkerPoolPollerResponse) Resume(ctx context.Context, client *AppServiceEnvironmentsClient, token string) error { + pt, err := armruntime.NewPollerFromResumeToken("AppServiceEnvironmentsClient.CreateOrUpdateWorkerPool", token, client.pl, client.createOrUpdateWorkerPoolHandleError) + if err != nil { + return err + } + poller := &AppServiceEnvironmentsCreateOrUpdateWorkerPoolPoller{ + pt: pt, + } + resp, err := poller.Poll(ctx) + if err != nil { + return err + } + l.Poller = poller + l.RawResponse = resp + return nil +} + +// AppServiceEnvironmentsCreateOrUpdateWorkerPoolResponse contains the response from method AppServiceEnvironments.CreateOrUpdateWorkerPool. +type AppServiceEnvironmentsCreateOrUpdateWorkerPoolResponse struct { + AppServiceEnvironmentsCreateOrUpdateWorkerPoolResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// AppServiceEnvironmentsCreateOrUpdateWorkerPoolResult contains the result from method AppServiceEnvironments.CreateOrUpdateWorkerPool. +type AppServiceEnvironmentsCreateOrUpdateWorkerPoolResult struct { + WorkerPoolResource +} + +// AppServiceEnvironmentsDeletePollerResponse contains the response from method AppServiceEnvironments.Delete. +type AppServiceEnvironmentsDeletePollerResponse struct { + // Poller contains an initialized poller. + Poller *AppServiceEnvironmentsDeletePoller + + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. +// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. +// A good starting value is 30 seconds. Note that some resources might benefit from a different value. +func (l AppServiceEnvironmentsDeletePollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (AppServiceEnvironmentsDeleteResponse, error) { + respType := AppServiceEnvironmentsDeleteResponse{} + resp, err := l.Poller.pt.PollUntilDone(ctx, freq, nil) + if err != nil { + return respType, err + } + respType.RawResponse = resp + return respType, nil +} + +// Resume rehydrates a AppServiceEnvironmentsDeletePollerResponse from the provided client and resume token. +func (l *AppServiceEnvironmentsDeletePollerResponse) Resume(ctx context.Context, client *AppServiceEnvironmentsClient, token string) error { + pt, err := armruntime.NewPollerFromResumeToken("AppServiceEnvironmentsClient.Delete", token, client.pl, client.deleteHandleError) + if err != nil { + return err + } + poller := &AppServiceEnvironmentsDeletePoller{ + pt: pt, + } + resp, err := poller.Poll(ctx) + if err != nil { + return err + } + l.Poller = poller + l.RawResponse = resp + return nil +} + +// AppServiceEnvironmentsDeletePrivateEndpointConnectionPollerResponse contains the response from method AppServiceEnvironments.DeletePrivateEndpointConnection. +type AppServiceEnvironmentsDeletePrivateEndpointConnectionPollerResponse struct { + // Poller contains an initialized poller. + Poller *AppServiceEnvironmentsDeletePrivateEndpointConnectionPoller + + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. +// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. +// A good starting value is 30 seconds. Note that some resources might benefit from a different value. +func (l AppServiceEnvironmentsDeletePrivateEndpointConnectionPollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (AppServiceEnvironmentsDeletePrivateEndpointConnectionResponse, error) { + respType := AppServiceEnvironmentsDeletePrivateEndpointConnectionResponse{} + resp, err := l.Poller.pt.PollUntilDone(ctx, freq, &respType.Object) + if err != nil { + return respType, err + } + respType.RawResponse = resp + return respType, nil +} + +// Resume rehydrates a AppServiceEnvironmentsDeletePrivateEndpointConnectionPollerResponse from the provided client and resume token. +func (l *AppServiceEnvironmentsDeletePrivateEndpointConnectionPollerResponse) Resume(ctx context.Context, client *AppServiceEnvironmentsClient, token string) error { + pt, err := armruntime.NewPollerFromResumeToken("AppServiceEnvironmentsClient.DeletePrivateEndpointConnection", token, client.pl, client.deletePrivateEndpointConnectionHandleError) + if err != nil { + return err + } + poller := &AppServiceEnvironmentsDeletePrivateEndpointConnectionPoller{ + pt: pt, + } + resp, err := poller.Poll(ctx) + if err != nil { + return err + } + l.Poller = poller + l.RawResponse = resp + return nil +} + +// AppServiceEnvironmentsDeletePrivateEndpointConnectionResponse contains the response from method AppServiceEnvironments.DeletePrivateEndpointConnection. +type AppServiceEnvironmentsDeletePrivateEndpointConnectionResponse struct { + AppServiceEnvironmentsDeletePrivateEndpointConnectionResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// AppServiceEnvironmentsDeletePrivateEndpointConnectionResult contains the result from method AppServiceEnvironments.DeletePrivateEndpointConnection. +type AppServiceEnvironmentsDeletePrivateEndpointConnectionResult struct { + // Any object + Object map[string]interface{} +} + +// AppServiceEnvironmentsDeleteResponse contains the response from method AppServiceEnvironments.Delete. +type AppServiceEnvironmentsDeleteResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// AppServiceEnvironmentsGetAseV3NetworkingConfigurationResponse contains the response from method AppServiceEnvironments.GetAseV3NetworkingConfiguration. +type AppServiceEnvironmentsGetAseV3NetworkingConfigurationResponse struct { + AppServiceEnvironmentsGetAseV3NetworkingConfigurationResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// AppServiceEnvironmentsGetAseV3NetworkingConfigurationResult contains the result from method AppServiceEnvironments.GetAseV3NetworkingConfiguration. +type AppServiceEnvironmentsGetAseV3NetworkingConfigurationResult struct { + AseV3NetworkingConfiguration +} + +// AppServiceEnvironmentsGetDiagnosticsItemResponse contains the response from method AppServiceEnvironments.GetDiagnosticsItem. +type AppServiceEnvironmentsGetDiagnosticsItemResponse struct { + AppServiceEnvironmentsGetDiagnosticsItemResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// AppServiceEnvironmentsGetDiagnosticsItemResult contains the result from method AppServiceEnvironments.GetDiagnosticsItem. +type AppServiceEnvironmentsGetDiagnosticsItemResult struct { + HostingEnvironmentDiagnostics +} + +// AppServiceEnvironmentsGetInboundNetworkDependenciesEndpointsResponse contains the response from method AppServiceEnvironments.GetInboundNetworkDependenciesEndpoints. +type AppServiceEnvironmentsGetInboundNetworkDependenciesEndpointsResponse struct { + AppServiceEnvironmentsGetInboundNetworkDependenciesEndpointsResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// AppServiceEnvironmentsGetInboundNetworkDependenciesEndpointsResult contains the result from method AppServiceEnvironments.GetInboundNetworkDependenciesEndpoints. +type AppServiceEnvironmentsGetInboundNetworkDependenciesEndpointsResult struct { + InboundEnvironmentEndpointCollection +} + +// AppServiceEnvironmentsGetMultiRolePoolResponse contains the response from method AppServiceEnvironments.GetMultiRolePool. +type AppServiceEnvironmentsGetMultiRolePoolResponse struct { + AppServiceEnvironmentsGetMultiRolePoolResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// AppServiceEnvironmentsGetMultiRolePoolResult contains the result from method AppServiceEnvironments.GetMultiRolePool. +type AppServiceEnvironmentsGetMultiRolePoolResult struct { + WorkerPoolResource +} + +// AppServiceEnvironmentsGetOutboundNetworkDependenciesEndpointsResponse contains the response from method AppServiceEnvironments.GetOutboundNetworkDependenciesEndpoints. +type AppServiceEnvironmentsGetOutboundNetworkDependenciesEndpointsResponse struct { + AppServiceEnvironmentsGetOutboundNetworkDependenciesEndpointsResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// AppServiceEnvironmentsGetOutboundNetworkDependenciesEndpointsResult contains the result from method AppServiceEnvironments.GetOutboundNetworkDependenciesEndpoints. +type AppServiceEnvironmentsGetOutboundNetworkDependenciesEndpointsResult struct { + OutboundEnvironmentEndpointCollection +} + +// AppServiceEnvironmentsGetPrivateEndpointConnectionListResponse contains the response from method AppServiceEnvironments.GetPrivateEndpointConnectionList. +type AppServiceEnvironmentsGetPrivateEndpointConnectionListResponse struct { + AppServiceEnvironmentsGetPrivateEndpointConnectionListResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// AppServiceEnvironmentsGetPrivateEndpointConnectionListResult contains the result from method AppServiceEnvironments.GetPrivateEndpointConnectionList. +type AppServiceEnvironmentsGetPrivateEndpointConnectionListResult struct { + PrivateEndpointConnectionCollection +} + +// AppServiceEnvironmentsGetPrivateEndpointConnectionResponse contains the response from method AppServiceEnvironments.GetPrivateEndpointConnection. +type AppServiceEnvironmentsGetPrivateEndpointConnectionResponse struct { + AppServiceEnvironmentsGetPrivateEndpointConnectionResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// AppServiceEnvironmentsGetPrivateEndpointConnectionResult contains the result from method AppServiceEnvironments.GetPrivateEndpointConnection. +type AppServiceEnvironmentsGetPrivateEndpointConnectionResult struct { + RemotePrivateEndpointConnectionARMResource +} + +// AppServiceEnvironmentsGetPrivateLinkResourcesResponse contains the response from method AppServiceEnvironments.GetPrivateLinkResources. +type AppServiceEnvironmentsGetPrivateLinkResourcesResponse struct { + AppServiceEnvironmentsGetPrivateLinkResourcesResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// AppServiceEnvironmentsGetPrivateLinkResourcesResult contains the result from method AppServiceEnvironments.GetPrivateLinkResources. +type AppServiceEnvironmentsGetPrivateLinkResourcesResult struct { + PrivateLinkResourcesWrapper +} + +// AppServiceEnvironmentsGetResponse contains the response from method AppServiceEnvironments.Get. +type AppServiceEnvironmentsGetResponse struct { + AppServiceEnvironmentsGetResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// AppServiceEnvironmentsGetResult contains the result from method AppServiceEnvironments.Get. +type AppServiceEnvironmentsGetResult struct { + AppServiceEnvironmentResource +} + +// AppServiceEnvironmentsGetVipInfoResponse contains the response from method AppServiceEnvironments.GetVipInfo. +type AppServiceEnvironmentsGetVipInfoResponse struct { + AppServiceEnvironmentsGetVipInfoResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// AppServiceEnvironmentsGetVipInfoResult contains the result from method AppServiceEnvironments.GetVipInfo. +type AppServiceEnvironmentsGetVipInfoResult struct { + AddressResponse +} + +// AppServiceEnvironmentsGetWorkerPoolResponse contains the response from method AppServiceEnvironments.GetWorkerPool. +type AppServiceEnvironmentsGetWorkerPoolResponse struct { + AppServiceEnvironmentsGetWorkerPoolResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// AppServiceEnvironmentsGetWorkerPoolResult contains the result from method AppServiceEnvironments.GetWorkerPool. +type AppServiceEnvironmentsGetWorkerPoolResult struct { + WorkerPoolResource +} + +// AppServiceEnvironmentsListAppServicePlansResponse contains the response from method AppServiceEnvironments.ListAppServicePlans. +type AppServiceEnvironmentsListAppServicePlansResponse struct { + AppServiceEnvironmentsListAppServicePlansResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// AppServiceEnvironmentsListAppServicePlansResult contains the result from method AppServiceEnvironments.ListAppServicePlans. +type AppServiceEnvironmentsListAppServicePlansResult struct { + AppServicePlanCollection +} + +// AppServiceEnvironmentsListByResourceGroupResponse contains the response from method AppServiceEnvironments.ListByResourceGroup. +type AppServiceEnvironmentsListByResourceGroupResponse struct { + AppServiceEnvironmentsListByResourceGroupResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// AppServiceEnvironmentsListByResourceGroupResult contains the result from method AppServiceEnvironments.ListByResourceGroup. +type AppServiceEnvironmentsListByResourceGroupResult struct { + AppServiceEnvironmentCollection +} + +// AppServiceEnvironmentsListCapacitiesResponse contains the response from method AppServiceEnvironments.ListCapacities. +type AppServiceEnvironmentsListCapacitiesResponse struct { + AppServiceEnvironmentsListCapacitiesResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// AppServiceEnvironmentsListCapacitiesResult contains the result from method AppServiceEnvironments.ListCapacities. +type AppServiceEnvironmentsListCapacitiesResult struct { + StampCapacityCollection +} + +// AppServiceEnvironmentsListDiagnosticsResponse contains the response from method AppServiceEnvironments.ListDiagnostics. +type AppServiceEnvironmentsListDiagnosticsResponse struct { + AppServiceEnvironmentsListDiagnosticsResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// AppServiceEnvironmentsListDiagnosticsResult contains the result from method AppServiceEnvironments.ListDiagnostics. +type AppServiceEnvironmentsListDiagnosticsResult struct { + // Array of HostingEnvironmentDiagnostics + HostingEnvironmentDiagnosticsArray []*HostingEnvironmentDiagnostics +} + +// AppServiceEnvironmentsListMultiRoleMetricDefinitionsResponse contains the response from method AppServiceEnvironments.ListMultiRoleMetricDefinitions. +type AppServiceEnvironmentsListMultiRoleMetricDefinitionsResponse struct { + AppServiceEnvironmentsListMultiRoleMetricDefinitionsResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// AppServiceEnvironmentsListMultiRoleMetricDefinitionsResult contains the result from method AppServiceEnvironments.ListMultiRoleMetricDefinitions. +type AppServiceEnvironmentsListMultiRoleMetricDefinitionsResult struct { + ResourceMetricDefinitionCollection +} + +// AppServiceEnvironmentsListMultiRolePoolInstanceMetricDefinitionsResponse contains the response from method AppServiceEnvironments.ListMultiRolePoolInstanceMetricDefinitions. +type AppServiceEnvironmentsListMultiRolePoolInstanceMetricDefinitionsResponse struct { + AppServiceEnvironmentsListMultiRolePoolInstanceMetricDefinitionsResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// AppServiceEnvironmentsListMultiRolePoolInstanceMetricDefinitionsResult contains the result from method AppServiceEnvironments.ListMultiRolePoolInstanceMetricDefinitions. +type AppServiceEnvironmentsListMultiRolePoolInstanceMetricDefinitionsResult struct { + ResourceMetricDefinitionCollection +} + +// AppServiceEnvironmentsListMultiRolePoolSKUsResponse contains the response from method AppServiceEnvironments.ListMultiRolePoolSKUs. +type AppServiceEnvironmentsListMultiRolePoolSKUsResponse struct { + AppServiceEnvironmentsListMultiRolePoolSKUsResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// AppServiceEnvironmentsListMultiRolePoolSKUsResult contains the result from method AppServiceEnvironments.ListMultiRolePoolSKUs. +type AppServiceEnvironmentsListMultiRolePoolSKUsResult struct { + SKUInfoCollection +} + +// AppServiceEnvironmentsListMultiRolePoolsResponse contains the response from method AppServiceEnvironments.ListMultiRolePools. +type AppServiceEnvironmentsListMultiRolePoolsResponse struct { + AppServiceEnvironmentsListMultiRolePoolsResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// AppServiceEnvironmentsListMultiRolePoolsResult contains the result from method AppServiceEnvironments.ListMultiRolePools. +type AppServiceEnvironmentsListMultiRolePoolsResult struct { + WorkerPoolCollection +} + +// AppServiceEnvironmentsListMultiRoleUsagesResponse contains the response from method AppServiceEnvironments.ListMultiRoleUsages. +type AppServiceEnvironmentsListMultiRoleUsagesResponse struct { + AppServiceEnvironmentsListMultiRoleUsagesResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// AppServiceEnvironmentsListMultiRoleUsagesResult contains the result from method AppServiceEnvironments.ListMultiRoleUsages. +type AppServiceEnvironmentsListMultiRoleUsagesResult struct { + UsageCollection +} + +// AppServiceEnvironmentsListOperationsResponse contains the response from method AppServiceEnvironments.ListOperations. +type AppServiceEnvironmentsListOperationsResponse struct { + AppServiceEnvironmentsListOperationsResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// AppServiceEnvironmentsListOperationsResult contains the result from method AppServiceEnvironments.ListOperations. +type AppServiceEnvironmentsListOperationsResult struct { + // Array of Operation + OperationArray []*Operation +} + +// AppServiceEnvironmentsListResponse contains the response from method AppServiceEnvironments.List. +type AppServiceEnvironmentsListResponse struct { + AppServiceEnvironmentsListResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// AppServiceEnvironmentsListResult contains the result from method AppServiceEnvironments.List. +type AppServiceEnvironmentsListResult struct { + AppServiceEnvironmentCollection +} + +// AppServiceEnvironmentsListUsagesResponse contains the response from method AppServiceEnvironments.ListUsages. +type AppServiceEnvironmentsListUsagesResponse struct { + AppServiceEnvironmentsListUsagesResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// AppServiceEnvironmentsListUsagesResult contains the result from method AppServiceEnvironments.ListUsages. +type AppServiceEnvironmentsListUsagesResult struct { + CsmUsageQuotaCollection +} + +// AppServiceEnvironmentsListWebAppsResponse contains the response from method AppServiceEnvironments.ListWebApps. +type AppServiceEnvironmentsListWebAppsResponse struct { + AppServiceEnvironmentsListWebAppsResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// AppServiceEnvironmentsListWebAppsResult contains the result from method AppServiceEnvironments.ListWebApps. +type AppServiceEnvironmentsListWebAppsResult struct { + WebAppCollection +} + +// AppServiceEnvironmentsListWebWorkerMetricDefinitionsResponse contains the response from method AppServiceEnvironments.ListWebWorkerMetricDefinitions. +type AppServiceEnvironmentsListWebWorkerMetricDefinitionsResponse struct { + AppServiceEnvironmentsListWebWorkerMetricDefinitionsResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// AppServiceEnvironmentsListWebWorkerMetricDefinitionsResult contains the result from method AppServiceEnvironments.ListWebWorkerMetricDefinitions. +type AppServiceEnvironmentsListWebWorkerMetricDefinitionsResult struct { + ResourceMetricDefinitionCollection +} + +// AppServiceEnvironmentsListWebWorkerUsagesResponse contains the response from method AppServiceEnvironments.ListWebWorkerUsages. +type AppServiceEnvironmentsListWebWorkerUsagesResponse struct { + AppServiceEnvironmentsListWebWorkerUsagesResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// AppServiceEnvironmentsListWebWorkerUsagesResult contains the result from method AppServiceEnvironments.ListWebWorkerUsages. +type AppServiceEnvironmentsListWebWorkerUsagesResult struct { + UsageCollection +} + +// AppServiceEnvironmentsListWorkerPoolInstanceMetricDefinitionsResponse contains the response from method AppServiceEnvironments.ListWorkerPoolInstanceMetricDefinitions. +type AppServiceEnvironmentsListWorkerPoolInstanceMetricDefinitionsResponse struct { + AppServiceEnvironmentsListWorkerPoolInstanceMetricDefinitionsResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// AppServiceEnvironmentsListWorkerPoolInstanceMetricDefinitionsResult contains the result from method AppServiceEnvironments.ListWorkerPoolInstanceMetricDefinitions. +type AppServiceEnvironmentsListWorkerPoolInstanceMetricDefinitionsResult struct { + ResourceMetricDefinitionCollection +} + +// AppServiceEnvironmentsListWorkerPoolSKUsResponse contains the response from method AppServiceEnvironments.ListWorkerPoolSKUs. +type AppServiceEnvironmentsListWorkerPoolSKUsResponse struct { + AppServiceEnvironmentsListWorkerPoolSKUsResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// AppServiceEnvironmentsListWorkerPoolSKUsResult contains the result from method AppServiceEnvironments.ListWorkerPoolSKUs. +type AppServiceEnvironmentsListWorkerPoolSKUsResult struct { + SKUInfoCollection +} + +// AppServiceEnvironmentsListWorkerPoolsResponse contains the response from method AppServiceEnvironments.ListWorkerPools. +type AppServiceEnvironmentsListWorkerPoolsResponse struct { + AppServiceEnvironmentsListWorkerPoolsResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// AppServiceEnvironmentsListWorkerPoolsResult contains the result from method AppServiceEnvironments.ListWorkerPools. +type AppServiceEnvironmentsListWorkerPoolsResult struct { + WorkerPoolCollection +} + +// AppServiceEnvironmentsRebootResponse contains the response from method AppServiceEnvironments.Reboot. +type AppServiceEnvironmentsRebootResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// AppServiceEnvironmentsResumePollerResponse contains the response from method AppServiceEnvironments.Resume. +type AppServiceEnvironmentsResumePollerResponse struct { + // Poller contains an initialized poller. + Poller *AppServiceEnvironmentsResumePoller + + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. +// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. +// A good starting value is 30 seconds. Note that some resources might benefit from a different value. +func (l AppServiceEnvironmentsResumePollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (*AppServiceEnvironmentsResumePager, error) { + respType := &AppServiceEnvironmentsResumePager{} + resp, err := l.Poller.pt.PollUntilDone(ctx, freq, &respType.current.WebAppCollection) + if err != nil { + return respType, err + } + respType.current.RawResponse = resp + respType.client = l.Poller.client + return respType, nil +} + +// Resume rehydrates a AppServiceEnvironmentsResumePollerResponse from the provided client and resume token. +func (l *AppServiceEnvironmentsResumePollerResponse) Resume(ctx context.Context, client *AppServiceEnvironmentsClient, token string) error { + pt, err := armruntime.NewPollerFromResumeToken("AppServiceEnvironmentsClient.Resume", token, client.pl, client.resumeHandleError) + if err != nil { + return err + } + poller := &AppServiceEnvironmentsResumePoller{ + pt: pt, + client: client, + } + resp, err := poller.Poll(ctx) + if err != nil { + return err + } + l.Poller = poller + l.RawResponse = resp + return nil +} + +// AppServiceEnvironmentsResumeResponse contains the response from method AppServiceEnvironments.Resume. +type AppServiceEnvironmentsResumeResponse struct { + AppServiceEnvironmentsResumeResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// AppServiceEnvironmentsResumeResult contains the result from method AppServiceEnvironments.Resume. +type AppServiceEnvironmentsResumeResult struct { + WebAppCollection +} + +// AppServiceEnvironmentsSuspendPollerResponse contains the response from method AppServiceEnvironments.Suspend. +type AppServiceEnvironmentsSuspendPollerResponse struct { + // Poller contains an initialized poller. + Poller *AppServiceEnvironmentsSuspendPoller + + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. +// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. +// A good starting value is 30 seconds. Note that some resources might benefit from a different value. +func (l AppServiceEnvironmentsSuspendPollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (*AppServiceEnvironmentsSuspendPager, error) { + respType := &AppServiceEnvironmentsSuspendPager{} + resp, err := l.Poller.pt.PollUntilDone(ctx, freq, &respType.current.WebAppCollection) + if err != nil { + return respType, err + } + respType.current.RawResponse = resp + respType.client = l.Poller.client + return respType, nil +} + +// Resume rehydrates a AppServiceEnvironmentsSuspendPollerResponse from the provided client and resume token. +func (l *AppServiceEnvironmentsSuspendPollerResponse) Resume(ctx context.Context, client *AppServiceEnvironmentsClient, token string) error { + pt, err := armruntime.NewPollerFromResumeToken("AppServiceEnvironmentsClient.Suspend", token, client.pl, client.suspendHandleError) + if err != nil { + return err + } + poller := &AppServiceEnvironmentsSuspendPoller{ + pt: pt, + client: client, + } + resp, err := poller.Poll(ctx) + if err != nil { + return err + } + l.Poller = poller + l.RawResponse = resp + return nil +} + +// AppServiceEnvironmentsSuspendResponse contains the response from method AppServiceEnvironments.Suspend. +type AppServiceEnvironmentsSuspendResponse struct { + AppServiceEnvironmentsSuspendResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// AppServiceEnvironmentsSuspendResult contains the result from method AppServiceEnvironments.Suspend. +type AppServiceEnvironmentsSuspendResult struct { + WebAppCollection +} + +// AppServiceEnvironmentsUpdateAseNetworkingConfigurationResponse contains the response from method AppServiceEnvironments.UpdateAseNetworkingConfiguration. +type AppServiceEnvironmentsUpdateAseNetworkingConfigurationResponse struct { + AppServiceEnvironmentsUpdateAseNetworkingConfigurationResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// AppServiceEnvironmentsUpdateAseNetworkingConfigurationResult contains the result from method AppServiceEnvironments.UpdateAseNetworkingConfiguration. +type AppServiceEnvironmentsUpdateAseNetworkingConfigurationResult struct { + AseV3NetworkingConfiguration +} + +// AppServiceEnvironmentsUpdateMultiRolePoolResponse contains the response from method AppServiceEnvironments.UpdateMultiRolePool. +type AppServiceEnvironmentsUpdateMultiRolePoolResponse struct { + AppServiceEnvironmentsUpdateMultiRolePoolResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// AppServiceEnvironmentsUpdateMultiRolePoolResult contains the result from method AppServiceEnvironments.UpdateMultiRolePool. +type AppServiceEnvironmentsUpdateMultiRolePoolResult struct { + WorkerPoolResource +} + +// AppServiceEnvironmentsUpdateResponse contains the response from method AppServiceEnvironments.Update. +type AppServiceEnvironmentsUpdateResponse struct { + AppServiceEnvironmentsUpdateResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// AppServiceEnvironmentsUpdateResult contains the result from method AppServiceEnvironments.Update. +type AppServiceEnvironmentsUpdateResult struct { + AppServiceEnvironmentResource +} + +// AppServiceEnvironmentsUpdateWorkerPoolResponse contains the response from method AppServiceEnvironments.UpdateWorkerPool. +type AppServiceEnvironmentsUpdateWorkerPoolResponse struct { + AppServiceEnvironmentsUpdateWorkerPoolResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// AppServiceEnvironmentsUpdateWorkerPoolResult contains the result from method AppServiceEnvironments.UpdateWorkerPool. +type AppServiceEnvironmentsUpdateWorkerPoolResult struct { + WorkerPoolResource +} + +// AppServicePlansCreateOrUpdatePollerResponse contains the response from method AppServicePlans.CreateOrUpdate. +type AppServicePlansCreateOrUpdatePollerResponse struct { + // Poller contains an initialized poller. + Poller *AppServicePlansCreateOrUpdatePoller + + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. +// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. +// A good starting value is 30 seconds. Note that some resources might benefit from a different value. +func (l AppServicePlansCreateOrUpdatePollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (AppServicePlansCreateOrUpdateResponse, error) { + respType := AppServicePlansCreateOrUpdateResponse{} + resp, err := l.Poller.pt.PollUntilDone(ctx, freq, &respType.AppServicePlan) + if err != nil { + return respType, err + } + respType.RawResponse = resp + return respType, nil +} + +// Resume rehydrates a AppServicePlansCreateOrUpdatePollerResponse from the provided client and resume token. +func (l *AppServicePlansCreateOrUpdatePollerResponse) Resume(ctx context.Context, client *AppServicePlansClient, token string) error { + pt, err := armruntime.NewPollerFromResumeToken("AppServicePlansClient.CreateOrUpdate", token, client.pl, client.createOrUpdateHandleError) + if err != nil { + return err + } + poller := &AppServicePlansCreateOrUpdatePoller{ + pt: pt, + } + resp, err := poller.Poll(ctx) + if err != nil { + return err + } + l.Poller = poller + l.RawResponse = resp + return nil +} + +// AppServicePlansCreateOrUpdateResponse contains the response from method AppServicePlans.CreateOrUpdate. +type AppServicePlansCreateOrUpdateResponse struct { + AppServicePlansCreateOrUpdateResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// AppServicePlansCreateOrUpdateResult contains the result from method AppServicePlans.CreateOrUpdate. +type AppServicePlansCreateOrUpdateResult struct { + AppServicePlan +} + +// AppServicePlansCreateOrUpdateVnetRouteResponse contains the response from method AppServicePlans.CreateOrUpdateVnetRoute. +type AppServicePlansCreateOrUpdateVnetRouteResponse struct { + AppServicePlansCreateOrUpdateVnetRouteResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// AppServicePlansCreateOrUpdateVnetRouteResult contains the result from method AppServicePlans.CreateOrUpdateVnetRoute. +type AppServicePlansCreateOrUpdateVnetRouteResult struct { + VnetRoute +} + +// AppServicePlansDeleteHybridConnectionResponse contains the response from method AppServicePlans.DeleteHybridConnection. +type AppServicePlansDeleteHybridConnectionResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// AppServicePlansDeleteResponse contains the response from method AppServicePlans.Delete. +type AppServicePlansDeleteResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// AppServicePlansDeleteVnetRouteResponse contains the response from method AppServicePlans.DeleteVnetRoute. +type AppServicePlansDeleteVnetRouteResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// AppServicePlansGetHybridConnectionPlanLimitResponse contains the response from method AppServicePlans.GetHybridConnectionPlanLimit. +type AppServicePlansGetHybridConnectionPlanLimitResponse struct { + AppServicePlansGetHybridConnectionPlanLimitResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// AppServicePlansGetHybridConnectionPlanLimitResult contains the result from method AppServicePlans.GetHybridConnectionPlanLimit. +type AppServicePlansGetHybridConnectionPlanLimitResult struct { + HybridConnectionLimits +} + +// AppServicePlansGetHybridConnectionResponse contains the response from method AppServicePlans.GetHybridConnection. +type AppServicePlansGetHybridConnectionResponse struct { + AppServicePlansGetHybridConnectionResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// AppServicePlansGetHybridConnectionResult contains the result from method AppServicePlans.GetHybridConnection. +type AppServicePlansGetHybridConnectionResult struct { + HybridConnection +} + +// AppServicePlansGetResponse contains the response from method AppServicePlans.Get. +type AppServicePlansGetResponse struct { + AppServicePlansGetResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// AppServicePlansGetResult contains the result from method AppServicePlans.Get. +type AppServicePlansGetResult struct { + AppServicePlan +} + +// AppServicePlansGetRouteForVnetResponse contains the response from method AppServicePlans.GetRouteForVnet. +type AppServicePlansGetRouteForVnetResponse struct { + AppServicePlansGetRouteForVnetResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// AppServicePlansGetRouteForVnetResult contains the result from method AppServicePlans.GetRouteForVnet. +type AppServicePlansGetRouteForVnetResult struct { + // Array of VnetRoute + VnetRouteArray []*VnetRoute +} + +// AppServicePlansGetServerFarmSKUsResponse contains the response from method AppServicePlans.GetServerFarmSKUs. +type AppServicePlansGetServerFarmSKUsResponse struct { + AppServicePlansGetServerFarmSKUsResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// AppServicePlansGetServerFarmSKUsResult contains the result from method AppServicePlans.GetServerFarmSKUs. +type AppServicePlansGetServerFarmSKUsResult struct { + // Any object + Object map[string]interface{} +} + +// AppServicePlansGetVnetFromServerFarmResponse contains the response from method AppServicePlans.GetVnetFromServerFarm. +type AppServicePlansGetVnetFromServerFarmResponse struct { + AppServicePlansGetVnetFromServerFarmResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// AppServicePlansGetVnetFromServerFarmResult contains the result from method AppServicePlans.GetVnetFromServerFarm. +type AppServicePlansGetVnetFromServerFarmResult struct { + VnetInfoResource +} + +// AppServicePlansGetVnetGatewayResponse contains the response from method AppServicePlans.GetVnetGateway. +type AppServicePlansGetVnetGatewayResponse struct { + AppServicePlansGetVnetGatewayResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// AppServicePlansGetVnetGatewayResult contains the result from method AppServicePlans.GetVnetGateway. +type AppServicePlansGetVnetGatewayResult struct { + VnetGateway +} + +// AppServicePlansListByResourceGroupResponse contains the response from method AppServicePlans.ListByResourceGroup. +type AppServicePlansListByResourceGroupResponse struct { + AppServicePlansListByResourceGroupResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// AppServicePlansListByResourceGroupResult contains the result from method AppServicePlans.ListByResourceGroup. +type AppServicePlansListByResourceGroupResult struct { + AppServicePlanCollection +} + +// AppServicePlansListCapabilitiesResponse contains the response from method AppServicePlans.ListCapabilities. +type AppServicePlansListCapabilitiesResponse struct { + AppServicePlansListCapabilitiesResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// AppServicePlansListCapabilitiesResult contains the result from method AppServicePlans.ListCapabilities. +type AppServicePlansListCapabilitiesResult struct { + // Array of Capability + CapabilityArray []*Capability +} + +// AppServicePlansListHybridConnectionKeysResponse contains the response from method AppServicePlans.ListHybridConnectionKeys. +type AppServicePlansListHybridConnectionKeysResponse struct { + AppServicePlansListHybridConnectionKeysResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// AppServicePlansListHybridConnectionKeysResult contains the result from method AppServicePlans.ListHybridConnectionKeys. +type AppServicePlansListHybridConnectionKeysResult struct { + HybridConnectionKey +} + +// AppServicePlansListHybridConnectionsResponse contains the response from method AppServicePlans.ListHybridConnections. +type AppServicePlansListHybridConnectionsResponse struct { + AppServicePlansListHybridConnectionsResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// AppServicePlansListHybridConnectionsResult contains the result from method AppServicePlans.ListHybridConnections. +type AppServicePlansListHybridConnectionsResult struct { + HybridConnectionCollection +} + +// AppServicePlansListResponse contains the response from method AppServicePlans.List. +type AppServicePlansListResponse struct { + AppServicePlansListResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// AppServicePlansListResult contains the result from method AppServicePlans.List. +type AppServicePlansListResult struct { + AppServicePlanCollection +} + +// AppServicePlansListRoutesForVnetResponse contains the response from method AppServicePlans.ListRoutesForVnet. +type AppServicePlansListRoutesForVnetResponse struct { + AppServicePlansListRoutesForVnetResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// AppServicePlansListRoutesForVnetResult contains the result from method AppServicePlans.ListRoutesForVnet. +type AppServicePlansListRoutesForVnetResult struct { + // Array of VnetRoute + VnetRouteArray []*VnetRoute +} + +// AppServicePlansListUsagesResponse contains the response from method AppServicePlans.ListUsages. +type AppServicePlansListUsagesResponse struct { + AppServicePlansListUsagesResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// AppServicePlansListUsagesResult contains the result from method AppServicePlans.ListUsages. +type AppServicePlansListUsagesResult struct { + CsmUsageQuotaCollection +} + +// AppServicePlansListVnetsResponse contains the response from method AppServicePlans.ListVnets. +type AppServicePlansListVnetsResponse struct { + AppServicePlansListVnetsResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// AppServicePlansListVnetsResult contains the result from method AppServicePlans.ListVnets. +type AppServicePlansListVnetsResult struct { + // Array of VnetInfoResource + VnetInfoResourceArray []*VnetInfoResource +} + +// AppServicePlansListWebAppsByHybridConnectionResponse contains the response from method AppServicePlans.ListWebAppsByHybridConnection. +type AppServicePlansListWebAppsByHybridConnectionResponse struct { + AppServicePlansListWebAppsByHybridConnectionResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// AppServicePlansListWebAppsByHybridConnectionResult contains the result from method AppServicePlans.ListWebAppsByHybridConnection. +type AppServicePlansListWebAppsByHybridConnectionResult struct { + ResourceCollection +} + +// AppServicePlansListWebAppsResponse contains the response from method AppServicePlans.ListWebApps. +type AppServicePlansListWebAppsResponse struct { + AppServicePlansListWebAppsResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// AppServicePlansListWebAppsResult contains the result from method AppServicePlans.ListWebApps. +type AppServicePlansListWebAppsResult struct { + WebAppCollection +} + +// AppServicePlansRebootWorkerResponse contains the response from method AppServicePlans.RebootWorker. +type AppServicePlansRebootWorkerResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// AppServicePlansRestartWebAppsResponse contains the response from method AppServicePlans.RestartWebApps. +type AppServicePlansRestartWebAppsResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// AppServicePlansUpdateResponse contains the response from method AppServicePlans.Update. +type AppServicePlansUpdateResponse struct { + AppServicePlansUpdateResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// AppServicePlansUpdateResult contains the result from method AppServicePlans.Update. +type AppServicePlansUpdateResult struct { + AppServicePlan +} + +// AppServicePlansUpdateVnetGatewayResponse contains the response from method AppServicePlans.UpdateVnetGateway. +type AppServicePlansUpdateVnetGatewayResponse struct { + AppServicePlansUpdateVnetGatewayResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// AppServicePlansUpdateVnetGatewayResult contains the result from method AppServicePlans.UpdateVnetGateway. +type AppServicePlansUpdateVnetGatewayResult struct { + VnetGateway +} + +// AppServicePlansUpdateVnetRouteResponse contains the response from method AppServicePlans.UpdateVnetRoute. +type AppServicePlansUpdateVnetRouteResponse struct { + AppServicePlansUpdateVnetRouteResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// AppServicePlansUpdateVnetRouteResult contains the result from method AppServicePlans.UpdateVnetRoute. +type AppServicePlansUpdateVnetRouteResult struct { + VnetRoute +} + +// CertificateOrdersDiagnosticsGetAppServiceCertificateOrderDetectorResponseResponse contains the response from method CertificateOrdersDiagnostics.GetAppServiceCertificateOrderDetectorResponse. +type CertificateOrdersDiagnosticsGetAppServiceCertificateOrderDetectorResponseResponse struct { + CertificateOrdersDiagnosticsGetAppServiceCertificateOrderDetectorResponseResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// CertificateOrdersDiagnosticsGetAppServiceCertificateOrderDetectorResponseResult contains the result from method CertificateOrdersDiagnostics.GetAppServiceCertificateOrderDetectorResponse. +type CertificateOrdersDiagnosticsGetAppServiceCertificateOrderDetectorResponseResult struct { + DetectorResponse +} + +// CertificateOrdersDiagnosticsListAppServiceCertificateOrderDetectorResponseResponse contains the response from method CertificateOrdersDiagnostics.ListAppServiceCertificateOrderDetectorResponse. +type CertificateOrdersDiagnosticsListAppServiceCertificateOrderDetectorResponseResponse struct { + CertificateOrdersDiagnosticsListAppServiceCertificateOrderDetectorResponseResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// CertificateOrdersDiagnosticsListAppServiceCertificateOrderDetectorResponseResult contains the result from method CertificateOrdersDiagnostics.ListAppServiceCertificateOrderDetectorResponse. +type CertificateOrdersDiagnosticsListAppServiceCertificateOrderDetectorResponseResult struct { + DetectorResponseCollection +} + +// CertificateRegistrationProviderListOperationsResponse contains the response from method CertificateRegistrationProvider.ListOperations. +type CertificateRegistrationProviderListOperationsResponse struct { + CertificateRegistrationProviderListOperationsResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// CertificateRegistrationProviderListOperationsResult contains the result from method CertificateRegistrationProvider.ListOperations. +type CertificateRegistrationProviderListOperationsResult struct { + CsmOperationCollection +} + +// CertificatesCreateOrUpdateResponse contains the response from method Certificates.CreateOrUpdate. +type CertificatesCreateOrUpdateResponse struct { + CertificatesCreateOrUpdateResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// CertificatesCreateOrUpdateResult contains the result from method Certificates.CreateOrUpdate. +type CertificatesCreateOrUpdateResult struct { + Certificate +} + +// CertificatesDeleteResponse contains the response from method Certificates.Delete. +type CertificatesDeleteResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// CertificatesGetResponse contains the response from method Certificates.Get. +type CertificatesGetResponse struct { + CertificatesGetResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// CertificatesGetResult contains the result from method Certificates.Get. +type CertificatesGetResult struct { + Certificate +} + +// CertificatesListByResourceGroupResponse contains the response from method Certificates.ListByResourceGroup. +type CertificatesListByResourceGroupResponse struct { + CertificatesListByResourceGroupResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// CertificatesListByResourceGroupResult contains the result from method Certificates.ListByResourceGroup. +type CertificatesListByResourceGroupResult struct { + CertificateCollection +} + +// CertificatesListResponse contains the response from method Certificates.List. +type CertificatesListResponse struct { + CertificatesListResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// CertificatesListResult contains the result from method Certificates.List. +type CertificatesListResult struct { + CertificateCollection +} + +// CertificatesUpdateResponse contains the response from method Certificates.Update. +type CertificatesUpdateResponse struct { + CertificatesUpdateResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// CertificatesUpdateResult contains the result from method Certificates.Update. +type CertificatesUpdateResult struct { + Certificate +} + +// DeletedWebAppsGetDeletedWebAppByLocationResponse contains the response from method DeletedWebApps.GetDeletedWebAppByLocation. +type DeletedWebAppsGetDeletedWebAppByLocationResponse struct { + DeletedWebAppsGetDeletedWebAppByLocationResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// DeletedWebAppsGetDeletedWebAppByLocationResult contains the result from method DeletedWebApps.GetDeletedWebAppByLocation. +type DeletedWebAppsGetDeletedWebAppByLocationResult struct { + DeletedSite +} + +// DeletedWebAppsListByLocationResponse contains the response from method DeletedWebApps.ListByLocation. +type DeletedWebAppsListByLocationResponse struct { + DeletedWebAppsListByLocationResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// DeletedWebAppsListByLocationResult contains the result from method DeletedWebApps.ListByLocation. +type DeletedWebAppsListByLocationResult struct { + DeletedWebAppCollection +} + +// DeletedWebAppsListResponse contains the response from method DeletedWebApps.List. +type DeletedWebAppsListResponse struct { + DeletedWebAppsListResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// DeletedWebAppsListResult contains the result from method DeletedWebApps.List. +type DeletedWebAppsListResult struct { + DeletedWebAppCollection +} + +// DiagnosticsExecuteSiteAnalysisResponse contains the response from method Diagnostics.ExecuteSiteAnalysis. +type DiagnosticsExecuteSiteAnalysisResponse struct { + DiagnosticsExecuteSiteAnalysisResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// DiagnosticsExecuteSiteAnalysisResult contains the result from method Diagnostics.ExecuteSiteAnalysis. +type DiagnosticsExecuteSiteAnalysisResult struct { + DiagnosticAnalysis +} + +// DiagnosticsExecuteSiteAnalysisSlotResponse contains the response from method Diagnostics.ExecuteSiteAnalysisSlot. +type DiagnosticsExecuteSiteAnalysisSlotResponse struct { + DiagnosticsExecuteSiteAnalysisSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// DiagnosticsExecuteSiteAnalysisSlotResult contains the result from method Diagnostics.ExecuteSiteAnalysisSlot. +type DiagnosticsExecuteSiteAnalysisSlotResult struct { + DiagnosticAnalysis +} + +// DiagnosticsExecuteSiteDetectorResponse contains the response from method Diagnostics.ExecuteSiteDetector. +type DiagnosticsExecuteSiteDetectorResponse struct { + DiagnosticsExecuteSiteDetectorResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// DiagnosticsExecuteSiteDetectorResult contains the result from method Diagnostics.ExecuteSiteDetector. +type DiagnosticsExecuteSiteDetectorResult struct { + DiagnosticDetectorResponse +} + +// DiagnosticsExecuteSiteDetectorSlotResponse contains the response from method Diagnostics.ExecuteSiteDetectorSlot. +type DiagnosticsExecuteSiteDetectorSlotResponse struct { + DiagnosticsExecuteSiteDetectorSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// DiagnosticsExecuteSiteDetectorSlotResult contains the result from method Diagnostics.ExecuteSiteDetectorSlot. +type DiagnosticsExecuteSiteDetectorSlotResult struct { + DiagnosticDetectorResponse +} + +// DiagnosticsGetHostingEnvironmentDetectorResponseResponse contains the response from method Diagnostics.GetHostingEnvironmentDetectorResponse. +type DiagnosticsGetHostingEnvironmentDetectorResponseResponse struct { + DiagnosticsGetHostingEnvironmentDetectorResponseResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// DiagnosticsGetHostingEnvironmentDetectorResponseResult contains the result from method Diagnostics.GetHostingEnvironmentDetectorResponse. +type DiagnosticsGetHostingEnvironmentDetectorResponseResult struct { + DetectorResponse +} + +// DiagnosticsGetSiteAnalysisResponse contains the response from method Diagnostics.GetSiteAnalysis. +type DiagnosticsGetSiteAnalysisResponse struct { + DiagnosticsGetSiteAnalysisResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// DiagnosticsGetSiteAnalysisResult contains the result from method Diagnostics.GetSiteAnalysis. +type DiagnosticsGetSiteAnalysisResult struct { + AnalysisDefinition +} + +// DiagnosticsGetSiteAnalysisSlotResponse contains the response from method Diagnostics.GetSiteAnalysisSlot. +type DiagnosticsGetSiteAnalysisSlotResponse struct { + DiagnosticsGetSiteAnalysisSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// DiagnosticsGetSiteAnalysisSlotResult contains the result from method Diagnostics.GetSiteAnalysisSlot. +type DiagnosticsGetSiteAnalysisSlotResult struct { + AnalysisDefinition +} + +// DiagnosticsGetSiteDetectorResponse contains the response from method Diagnostics.GetSiteDetector. +type DiagnosticsGetSiteDetectorResponse struct { + DiagnosticsGetSiteDetectorResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// DiagnosticsGetSiteDetectorResponseResponse contains the response from method Diagnostics.GetSiteDetectorResponse. +type DiagnosticsGetSiteDetectorResponseResponse struct { + DiagnosticsGetSiteDetectorResponseResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// DiagnosticsGetSiteDetectorResponseResult contains the result from method Diagnostics.GetSiteDetectorResponse. +type DiagnosticsGetSiteDetectorResponseResult struct { + DetectorResponse +} + +// DiagnosticsGetSiteDetectorResponseSlotResponse contains the response from method Diagnostics.GetSiteDetectorResponseSlot. +type DiagnosticsGetSiteDetectorResponseSlotResponse struct { + DiagnosticsGetSiteDetectorResponseSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// DiagnosticsGetSiteDetectorResponseSlotResult contains the result from method Diagnostics.GetSiteDetectorResponseSlot. +type DiagnosticsGetSiteDetectorResponseSlotResult struct { + DetectorResponse +} + +// DiagnosticsGetSiteDetectorResult contains the result from method Diagnostics.GetSiteDetector. +type DiagnosticsGetSiteDetectorResult struct { + DetectorDefinitionResource +} + +// DiagnosticsGetSiteDetectorSlotResponse contains the response from method Diagnostics.GetSiteDetectorSlot. +type DiagnosticsGetSiteDetectorSlotResponse struct { + DiagnosticsGetSiteDetectorSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// DiagnosticsGetSiteDetectorSlotResult contains the result from method Diagnostics.GetSiteDetectorSlot. +type DiagnosticsGetSiteDetectorSlotResult struct { + DetectorDefinitionResource +} + +// DiagnosticsGetSiteDiagnosticCategoryResponse contains the response from method Diagnostics.GetSiteDiagnosticCategory. +type DiagnosticsGetSiteDiagnosticCategoryResponse struct { + DiagnosticsGetSiteDiagnosticCategoryResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// DiagnosticsGetSiteDiagnosticCategoryResult contains the result from method Diagnostics.GetSiteDiagnosticCategory. +type DiagnosticsGetSiteDiagnosticCategoryResult struct { + DiagnosticCategory +} + +// DiagnosticsGetSiteDiagnosticCategorySlotResponse contains the response from method Diagnostics.GetSiteDiagnosticCategorySlot. +type DiagnosticsGetSiteDiagnosticCategorySlotResponse struct { + DiagnosticsGetSiteDiagnosticCategorySlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// DiagnosticsGetSiteDiagnosticCategorySlotResult contains the result from method Diagnostics.GetSiteDiagnosticCategorySlot. +type DiagnosticsGetSiteDiagnosticCategorySlotResult struct { + DiagnosticCategory +} + +// DiagnosticsListHostingEnvironmentDetectorResponsesResponse contains the response from method Diagnostics.ListHostingEnvironmentDetectorResponses. +type DiagnosticsListHostingEnvironmentDetectorResponsesResponse struct { + DiagnosticsListHostingEnvironmentDetectorResponsesResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// DiagnosticsListHostingEnvironmentDetectorResponsesResult contains the result from method Diagnostics.ListHostingEnvironmentDetectorResponses. +type DiagnosticsListHostingEnvironmentDetectorResponsesResult struct { + DetectorResponseCollection +} + +// DiagnosticsListSiteAnalysesResponse contains the response from method Diagnostics.ListSiteAnalyses. +type DiagnosticsListSiteAnalysesResponse struct { + DiagnosticsListSiteAnalysesResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// DiagnosticsListSiteAnalysesResult contains the result from method Diagnostics.ListSiteAnalyses. +type DiagnosticsListSiteAnalysesResult struct { + DiagnosticAnalysisCollection +} + +// DiagnosticsListSiteAnalysesSlotResponse contains the response from method Diagnostics.ListSiteAnalysesSlot. +type DiagnosticsListSiteAnalysesSlotResponse struct { + DiagnosticsListSiteAnalysesSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// DiagnosticsListSiteAnalysesSlotResult contains the result from method Diagnostics.ListSiteAnalysesSlot. +type DiagnosticsListSiteAnalysesSlotResult struct { + DiagnosticAnalysisCollection +} + +// DiagnosticsListSiteDetectorResponsesResponse contains the response from method Diagnostics.ListSiteDetectorResponses. +type DiagnosticsListSiteDetectorResponsesResponse struct { + DiagnosticsListSiteDetectorResponsesResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// DiagnosticsListSiteDetectorResponsesResult contains the result from method Diagnostics.ListSiteDetectorResponses. +type DiagnosticsListSiteDetectorResponsesResult struct { + DetectorResponseCollection +} + +// DiagnosticsListSiteDetectorResponsesSlotResponse contains the response from method Diagnostics.ListSiteDetectorResponsesSlot. +type DiagnosticsListSiteDetectorResponsesSlotResponse struct { + DiagnosticsListSiteDetectorResponsesSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// DiagnosticsListSiteDetectorResponsesSlotResult contains the result from method Diagnostics.ListSiteDetectorResponsesSlot. +type DiagnosticsListSiteDetectorResponsesSlotResult struct { + DetectorResponseCollection +} + +// DiagnosticsListSiteDetectorsResponse contains the response from method Diagnostics.ListSiteDetectors. +type DiagnosticsListSiteDetectorsResponse struct { + DiagnosticsListSiteDetectorsResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// DiagnosticsListSiteDetectorsResult contains the result from method Diagnostics.ListSiteDetectors. +type DiagnosticsListSiteDetectorsResult struct { + DiagnosticDetectorCollection +} + +// DiagnosticsListSiteDetectorsSlotResponse contains the response from method Diagnostics.ListSiteDetectorsSlot. +type DiagnosticsListSiteDetectorsSlotResponse struct { + DiagnosticsListSiteDetectorsSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// DiagnosticsListSiteDetectorsSlotResult contains the result from method Diagnostics.ListSiteDetectorsSlot. +type DiagnosticsListSiteDetectorsSlotResult struct { + DiagnosticDetectorCollection +} + +// DiagnosticsListSiteDiagnosticCategoriesResponse contains the response from method Diagnostics.ListSiteDiagnosticCategories. +type DiagnosticsListSiteDiagnosticCategoriesResponse struct { + DiagnosticsListSiteDiagnosticCategoriesResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// DiagnosticsListSiteDiagnosticCategoriesResult contains the result from method Diagnostics.ListSiteDiagnosticCategories. +type DiagnosticsListSiteDiagnosticCategoriesResult struct { + DiagnosticCategoryCollection +} + +// DiagnosticsListSiteDiagnosticCategoriesSlotResponse contains the response from method Diagnostics.ListSiteDiagnosticCategoriesSlot. +type DiagnosticsListSiteDiagnosticCategoriesSlotResponse struct { + DiagnosticsListSiteDiagnosticCategoriesSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// DiagnosticsListSiteDiagnosticCategoriesSlotResult contains the result from method Diagnostics.ListSiteDiagnosticCategoriesSlot. +type DiagnosticsListSiteDiagnosticCategoriesSlotResult struct { + DiagnosticCategoryCollection +} + +// DomainRegistrationProviderListOperationsResponse contains the response from method DomainRegistrationProvider.ListOperations. +type DomainRegistrationProviderListOperationsResponse struct { + DomainRegistrationProviderListOperationsResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// DomainRegistrationProviderListOperationsResult contains the result from method DomainRegistrationProvider.ListOperations. +type DomainRegistrationProviderListOperationsResult struct { + CsmOperationCollection +} + +// DomainsCheckAvailabilityResponse contains the response from method Domains.CheckAvailability. +type DomainsCheckAvailabilityResponse struct { + DomainsCheckAvailabilityResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// DomainsCheckAvailabilityResult contains the result from method Domains.CheckAvailability. +type DomainsCheckAvailabilityResult struct { + DomainAvailabilityCheckResult +} + +// DomainsCreateOrUpdateOwnershipIdentifierResponse contains the response from method Domains.CreateOrUpdateOwnershipIdentifier. +type DomainsCreateOrUpdateOwnershipIdentifierResponse struct { + DomainsCreateOrUpdateOwnershipIdentifierResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// DomainsCreateOrUpdateOwnershipIdentifierResult contains the result from method Domains.CreateOrUpdateOwnershipIdentifier. +type DomainsCreateOrUpdateOwnershipIdentifierResult struct { + DomainOwnershipIdentifier +} + +// DomainsCreateOrUpdatePollerResponse contains the response from method Domains.CreateOrUpdate. +type DomainsCreateOrUpdatePollerResponse struct { + // Poller contains an initialized poller. + Poller *DomainsCreateOrUpdatePoller + + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. +// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. +// A good starting value is 30 seconds. Note that some resources might benefit from a different value. +func (l DomainsCreateOrUpdatePollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (DomainsCreateOrUpdateResponse, error) { + respType := DomainsCreateOrUpdateResponse{} + resp, err := l.Poller.pt.PollUntilDone(ctx, freq, &respType.Domain) + if err != nil { + return respType, err + } + respType.RawResponse = resp + return respType, nil +} + +// Resume rehydrates a DomainsCreateOrUpdatePollerResponse from the provided client and resume token. +func (l *DomainsCreateOrUpdatePollerResponse) Resume(ctx context.Context, client *DomainsClient, token string) error { + pt, err := armruntime.NewPollerFromResumeToken("DomainsClient.CreateOrUpdate", token, client.pl, client.createOrUpdateHandleError) + if err != nil { + return err + } + poller := &DomainsCreateOrUpdatePoller{ + pt: pt, + } + resp, err := poller.Poll(ctx) + if err != nil { + return err + } + l.Poller = poller + l.RawResponse = resp + return nil +} + +// DomainsCreateOrUpdateResponse contains the response from method Domains.CreateOrUpdate. +type DomainsCreateOrUpdateResponse struct { + DomainsCreateOrUpdateResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// DomainsCreateOrUpdateResult contains the result from method Domains.CreateOrUpdate. +type DomainsCreateOrUpdateResult struct { + Domain +} + +// DomainsDeleteOwnershipIdentifierResponse contains the response from method Domains.DeleteOwnershipIdentifier. +type DomainsDeleteOwnershipIdentifierResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// DomainsDeleteResponse contains the response from method Domains.Delete. +type DomainsDeleteResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// DomainsGetControlCenterSsoRequestResponse contains the response from method Domains.GetControlCenterSsoRequest. +type DomainsGetControlCenterSsoRequestResponse struct { + DomainsGetControlCenterSsoRequestResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// DomainsGetControlCenterSsoRequestResult contains the result from method Domains.GetControlCenterSsoRequest. +type DomainsGetControlCenterSsoRequestResult struct { + DomainControlCenterSsoRequest +} + +// DomainsGetOwnershipIdentifierResponse contains the response from method Domains.GetOwnershipIdentifier. +type DomainsGetOwnershipIdentifierResponse struct { + DomainsGetOwnershipIdentifierResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// DomainsGetOwnershipIdentifierResult contains the result from method Domains.GetOwnershipIdentifier. +type DomainsGetOwnershipIdentifierResult struct { + DomainOwnershipIdentifier +} + +// DomainsGetResponse contains the response from method Domains.Get. +type DomainsGetResponse struct { + DomainsGetResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// DomainsGetResult contains the result from method Domains.Get. +type DomainsGetResult struct { + Domain +} + +// DomainsListByResourceGroupResponse contains the response from method Domains.ListByResourceGroup. +type DomainsListByResourceGroupResponse struct { + DomainsListByResourceGroupResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// DomainsListByResourceGroupResult contains the result from method Domains.ListByResourceGroup. +type DomainsListByResourceGroupResult struct { + DomainCollection +} + +// DomainsListOwnershipIdentifiersResponse contains the response from method Domains.ListOwnershipIdentifiers. +type DomainsListOwnershipIdentifiersResponse struct { + DomainsListOwnershipIdentifiersResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// DomainsListOwnershipIdentifiersResult contains the result from method Domains.ListOwnershipIdentifiers. +type DomainsListOwnershipIdentifiersResult struct { + DomainOwnershipIdentifierCollection +} + +// DomainsListRecommendationsResponse contains the response from method Domains.ListRecommendations. +type DomainsListRecommendationsResponse struct { + DomainsListRecommendationsResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// DomainsListRecommendationsResult contains the result from method Domains.ListRecommendations. +type DomainsListRecommendationsResult struct { + NameIdentifierCollection +} + +// DomainsListResponse contains the response from method Domains.List. +type DomainsListResponse struct { + DomainsListResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// DomainsListResult contains the result from method Domains.List. +type DomainsListResult struct { + DomainCollection +} + +// DomainsRenewResponse contains the response from method Domains.Renew. +type DomainsRenewResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// DomainsUpdateOwnershipIdentifierResponse contains the response from method Domains.UpdateOwnershipIdentifier. +type DomainsUpdateOwnershipIdentifierResponse struct { + DomainsUpdateOwnershipIdentifierResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// DomainsUpdateOwnershipIdentifierResult contains the result from method Domains.UpdateOwnershipIdentifier. +type DomainsUpdateOwnershipIdentifierResult struct { + DomainOwnershipIdentifier +} + +// DomainsUpdateResponse contains the response from method Domains.Update. +type DomainsUpdateResponse struct { + DomainsUpdateResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// DomainsUpdateResult contains the result from method Domains.Update. +type DomainsUpdateResult struct { + Domain +} + +// GlobalGetDeletedWebAppResponse contains the response from method Global.GetDeletedWebApp. +type GlobalGetDeletedWebAppResponse struct { + GlobalGetDeletedWebAppResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// GlobalGetDeletedWebAppResult contains the result from method Global.GetDeletedWebApp. +type GlobalGetDeletedWebAppResult struct { + DeletedSite +} + +// GlobalGetDeletedWebAppSnapshotsResponse contains the response from method Global.GetDeletedWebAppSnapshots. +type GlobalGetDeletedWebAppSnapshotsResponse struct { + GlobalGetDeletedWebAppSnapshotsResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// GlobalGetDeletedWebAppSnapshotsResult contains the result from method Global.GetDeletedWebAppSnapshots. +type GlobalGetDeletedWebAppSnapshotsResult struct { + // Array of Snapshot + SnapshotArray []*Snapshot +} + +// GlobalGetSubscriptionOperationWithAsyncResponseResponse contains the response from method Global.GetSubscriptionOperationWithAsyncResponse. +type GlobalGetSubscriptionOperationWithAsyncResponseResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// KubeEnvironmentsCreateOrUpdatePollerResponse contains the response from method KubeEnvironments.CreateOrUpdate. +type KubeEnvironmentsCreateOrUpdatePollerResponse struct { + // Poller contains an initialized poller. + Poller *KubeEnvironmentsCreateOrUpdatePoller + + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. +// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. +// A good starting value is 30 seconds. Note that some resources might benefit from a different value. +func (l KubeEnvironmentsCreateOrUpdatePollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (KubeEnvironmentsCreateOrUpdateResponse, error) { + respType := KubeEnvironmentsCreateOrUpdateResponse{} + resp, err := l.Poller.pt.PollUntilDone(ctx, freq, &respType.KubeEnvironment) + if err != nil { + return respType, err + } + respType.RawResponse = resp + return respType, nil +} + +// Resume rehydrates a KubeEnvironmentsCreateOrUpdatePollerResponse from the provided client and resume token. +func (l *KubeEnvironmentsCreateOrUpdatePollerResponse) Resume(ctx context.Context, client *KubeEnvironmentsClient, token string) error { + pt, err := armruntime.NewPollerFromResumeToken("KubeEnvironmentsClient.CreateOrUpdate", token, client.pl, client.createOrUpdateHandleError) + if err != nil { + return err + } + poller := &KubeEnvironmentsCreateOrUpdatePoller{ + pt: pt, + } + resp, err := poller.Poll(ctx) + if err != nil { + return err + } + l.Poller = poller + l.RawResponse = resp + return nil +} + +// KubeEnvironmentsCreateOrUpdateResponse contains the response from method KubeEnvironments.CreateOrUpdate. +type KubeEnvironmentsCreateOrUpdateResponse struct { + KubeEnvironmentsCreateOrUpdateResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// KubeEnvironmentsCreateOrUpdateResult contains the result from method KubeEnvironments.CreateOrUpdate. +type KubeEnvironmentsCreateOrUpdateResult struct { + KubeEnvironment +} + +// KubeEnvironmentsDeletePollerResponse contains the response from method KubeEnvironments.Delete. +type KubeEnvironmentsDeletePollerResponse struct { + // Poller contains an initialized poller. + Poller *KubeEnvironmentsDeletePoller + + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. +// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. +// A good starting value is 30 seconds. Note that some resources might benefit from a different value. +func (l KubeEnvironmentsDeletePollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (KubeEnvironmentsDeleteResponse, error) { + respType := KubeEnvironmentsDeleteResponse{} + resp, err := l.Poller.pt.PollUntilDone(ctx, freq, nil) + if err != nil { + return respType, err + } + respType.RawResponse = resp + return respType, nil +} + +// Resume rehydrates a KubeEnvironmentsDeletePollerResponse from the provided client and resume token. +func (l *KubeEnvironmentsDeletePollerResponse) Resume(ctx context.Context, client *KubeEnvironmentsClient, token string) error { + pt, err := armruntime.NewPollerFromResumeToken("KubeEnvironmentsClient.Delete", token, client.pl, client.deleteHandleError) + if err != nil { + return err + } + poller := &KubeEnvironmentsDeletePoller{ + pt: pt, + } + resp, err := poller.Poll(ctx) + if err != nil { + return err + } + l.Poller = poller + l.RawResponse = resp + return nil +} + +// KubeEnvironmentsDeleteResponse contains the response from method KubeEnvironments.Delete. +type KubeEnvironmentsDeleteResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// KubeEnvironmentsGetResponse contains the response from method KubeEnvironments.Get. +type KubeEnvironmentsGetResponse struct { + KubeEnvironmentsGetResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// KubeEnvironmentsGetResult contains the result from method KubeEnvironments.Get. +type KubeEnvironmentsGetResult struct { + KubeEnvironment +} + +// KubeEnvironmentsListByResourceGroupResponse contains the response from method KubeEnvironments.ListByResourceGroup. +type KubeEnvironmentsListByResourceGroupResponse struct { + KubeEnvironmentsListByResourceGroupResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// KubeEnvironmentsListByResourceGroupResult contains the result from method KubeEnvironments.ListByResourceGroup. +type KubeEnvironmentsListByResourceGroupResult struct { + KubeEnvironmentCollection +} + +// KubeEnvironmentsListBySubscriptionResponse contains the response from method KubeEnvironments.ListBySubscription. +type KubeEnvironmentsListBySubscriptionResponse struct { + KubeEnvironmentsListBySubscriptionResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// KubeEnvironmentsListBySubscriptionResult contains the result from method KubeEnvironments.ListBySubscription. +type KubeEnvironmentsListBySubscriptionResult struct { + KubeEnvironmentCollection +} + +// KubeEnvironmentsUpdateResponse contains the response from method KubeEnvironments.Update. +type KubeEnvironmentsUpdateResponse struct { + KubeEnvironmentsUpdateResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// KubeEnvironmentsUpdateResult contains the result from method KubeEnvironments.Update. +type KubeEnvironmentsUpdateResult struct { + KubeEnvironment +} + +// ProviderGetAvailableStacksOnPremResponse contains the response from method Provider.GetAvailableStacksOnPrem. +type ProviderGetAvailableStacksOnPremResponse struct { + ProviderGetAvailableStacksOnPremResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// ProviderGetAvailableStacksOnPremResult contains the result from method Provider.GetAvailableStacksOnPrem. +type ProviderGetAvailableStacksOnPremResult struct { + ApplicationStackCollection +} + +// ProviderGetAvailableStacksResponse contains the response from method Provider.GetAvailableStacks. +type ProviderGetAvailableStacksResponse struct { + ProviderGetAvailableStacksResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// ProviderGetAvailableStacksResult contains the result from method Provider.GetAvailableStacks. +type ProviderGetAvailableStacksResult struct { + ApplicationStackCollection +} + +// ProviderGetFunctionAppStacksForLocationResponse contains the response from method Provider.GetFunctionAppStacksForLocation. +type ProviderGetFunctionAppStacksForLocationResponse struct { + ProviderGetFunctionAppStacksForLocationResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// ProviderGetFunctionAppStacksForLocationResult contains the result from method Provider.GetFunctionAppStacksForLocation. +type ProviderGetFunctionAppStacksForLocationResult struct { + FunctionAppStackCollection +} + +// ProviderGetFunctionAppStacksResponse contains the response from method Provider.GetFunctionAppStacks. +type ProviderGetFunctionAppStacksResponse struct { + ProviderGetFunctionAppStacksResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// ProviderGetFunctionAppStacksResult contains the result from method Provider.GetFunctionAppStacks. +type ProviderGetFunctionAppStacksResult struct { + FunctionAppStackCollection +} + +// ProviderGetWebAppStacksForLocationResponse contains the response from method Provider.GetWebAppStacksForLocation. +type ProviderGetWebAppStacksForLocationResponse struct { + ProviderGetWebAppStacksForLocationResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// ProviderGetWebAppStacksForLocationResult contains the result from method Provider.GetWebAppStacksForLocation. +type ProviderGetWebAppStacksForLocationResult struct { + WebAppStackCollection +} + +// ProviderGetWebAppStacksResponse contains the response from method Provider.GetWebAppStacks. +type ProviderGetWebAppStacksResponse struct { + ProviderGetWebAppStacksResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// ProviderGetWebAppStacksResult contains the result from method Provider.GetWebAppStacks. +type ProviderGetWebAppStacksResult struct { + WebAppStackCollection +} + +// ProviderListOperationsResponse contains the response from method Provider.ListOperations. +type ProviderListOperationsResponse struct { + ProviderListOperationsResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// ProviderListOperationsResult contains the result from method Provider.ListOperations. +type ProviderListOperationsResult struct { + CsmOperationCollection +} + +// RecommendationsDisableAllForHostingEnvironmentResponse contains the response from method Recommendations.DisableAllForHostingEnvironment. +type RecommendationsDisableAllForHostingEnvironmentResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// RecommendationsDisableAllForWebAppResponse contains the response from method Recommendations.DisableAllForWebApp. +type RecommendationsDisableAllForWebAppResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// RecommendationsDisableRecommendationForHostingEnvironmentResponse contains the response from method Recommendations.DisableRecommendationForHostingEnvironment. +type RecommendationsDisableRecommendationForHostingEnvironmentResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// RecommendationsDisableRecommendationForSiteResponse contains the response from method Recommendations.DisableRecommendationForSite. +type RecommendationsDisableRecommendationForSiteResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// RecommendationsDisableRecommendationForSubscriptionResponse contains the response from method Recommendations.DisableRecommendationForSubscription. +type RecommendationsDisableRecommendationForSubscriptionResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// RecommendationsGetRuleDetailsByHostingEnvironmentResponse contains the response from method Recommendations.GetRuleDetailsByHostingEnvironment. +type RecommendationsGetRuleDetailsByHostingEnvironmentResponse struct { + RecommendationsGetRuleDetailsByHostingEnvironmentResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// RecommendationsGetRuleDetailsByHostingEnvironmentResult contains the result from method Recommendations.GetRuleDetailsByHostingEnvironment. +type RecommendationsGetRuleDetailsByHostingEnvironmentResult struct { + RecommendationRule +} + +// RecommendationsGetRuleDetailsByWebAppResponse contains the response from method Recommendations.GetRuleDetailsByWebApp. +type RecommendationsGetRuleDetailsByWebAppResponse struct { + RecommendationsGetRuleDetailsByWebAppResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// RecommendationsGetRuleDetailsByWebAppResult contains the result from method Recommendations.GetRuleDetailsByWebApp. +type RecommendationsGetRuleDetailsByWebAppResult struct { + RecommendationRule +} + +// RecommendationsListHistoryForHostingEnvironmentResponse contains the response from method Recommendations.ListHistoryForHostingEnvironment. +type RecommendationsListHistoryForHostingEnvironmentResponse struct { + RecommendationsListHistoryForHostingEnvironmentResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// RecommendationsListHistoryForHostingEnvironmentResult contains the result from method Recommendations.ListHistoryForHostingEnvironment. +type RecommendationsListHistoryForHostingEnvironmentResult struct { + RecommendationCollection +} + +// RecommendationsListHistoryForWebAppResponse contains the response from method Recommendations.ListHistoryForWebApp. +type RecommendationsListHistoryForWebAppResponse struct { + RecommendationsListHistoryForWebAppResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// RecommendationsListHistoryForWebAppResult contains the result from method Recommendations.ListHistoryForWebApp. +type RecommendationsListHistoryForWebAppResult struct { + RecommendationCollection +} + +// RecommendationsListRecommendedRulesForHostingEnvironmentResponse contains the response from method Recommendations.ListRecommendedRulesForHostingEnvironment. +type RecommendationsListRecommendedRulesForHostingEnvironmentResponse struct { + RecommendationsListRecommendedRulesForHostingEnvironmentResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// RecommendationsListRecommendedRulesForHostingEnvironmentResult contains the result from method Recommendations.ListRecommendedRulesForHostingEnvironment. +type RecommendationsListRecommendedRulesForHostingEnvironmentResult struct { + RecommendationCollection +} + +// RecommendationsListRecommendedRulesForWebAppResponse contains the response from method Recommendations.ListRecommendedRulesForWebApp. +type RecommendationsListRecommendedRulesForWebAppResponse struct { + RecommendationsListRecommendedRulesForWebAppResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// RecommendationsListRecommendedRulesForWebAppResult contains the result from method Recommendations.ListRecommendedRulesForWebApp. +type RecommendationsListRecommendedRulesForWebAppResult struct { + RecommendationCollection +} + +// RecommendationsListResponse contains the response from method Recommendations.List. +type RecommendationsListResponse struct { + RecommendationsListResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// RecommendationsListResult contains the result from method Recommendations.List. +type RecommendationsListResult struct { + RecommendationCollection +} + +// RecommendationsResetAllFiltersForHostingEnvironmentResponse contains the response from method Recommendations.ResetAllFiltersForHostingEnvironment. +type RecommendationsResetAllFiltersForHostingEnvironmentResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// RecommendationsResetAllFiltersForWebAppResponse contains the response from method Recommendations.ResetAllFiltersForWebApp. +type RecommendationsResetAllFiltersForWebAppResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// RecommendationsResetAllFiltersResponse contains the response from method Recommendations.ResetAllFilters. +type RecommendationsResetAllFiltersResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// ResourceHealthMetadataGetBySiteResponse contains the response from method ResourceHealthMetadata.GetBySite. +type ResourceHealthMetadataGetBySiteResponse struct { + ResourceHealthMetadataGetBySiteResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// ResourceHealthMetadataGetBySiteResult contains the result from method ResourceHealthMetadata.GetBySite. +type ResourceHealthMetadataGetBySiteResult struct { + ResourceHealthMetadata +} + +// ResourceHealthMetadataGetBySiteSlotResponse contains the response from method ResourceHealthMetadata.GetBySiteSlot. +type ResourceHealthMetadataGetBySiteSlotResponse struct { + ResourceHealthMetadataGetBySiteSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// ResourceHealthMetadataGetBySiteSlotResult contains the result from method ResourceHealthMetadata.GetBySiteSlot. +type ResourceHealthMetadataGetBySiteSlotResult struct { + ResourceHealthMetadata +} + +// ResourceHealthMetadataListByResourceGroupResponse contains the response from method ResourceHealthMetadata.ListByResourceGroup. +type ResourceHealthMetadataListByResourceGroupResponse struct { + ResourceHealthMetadataListByResourceGroupResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// ResourceHealthMetadataListByResourceGroupResult contains the result from method ResourceHealthMetadata.ListByResourceGroup. +type ResourceHealthMetadataListByResourceGroupResult struct { + ResourceHealthMetadataCollection +} + +// ResourceHealthMetadataListBySiteResponse contains the response from method ResourceHealthMetadata.ListBySite. +type ResourceHealthMetadataListBySiteResponse struct { + ResourceHealthMetadataListBySiteResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// ResourceHealthMetadataListBySiteResult contains the result from method ResourceHealthMetadata.ListBySite. +type ResourceHealthMetadataListBySiteResult struct { + ResourceHealthMetadataCollection +} + +// ResourceHealthMetadataListBySiteSlotResponse contains the response from method ResourceHealthMetadata.ListBySiteSlot. +type ResourceHealthMetadataListBySiteSlotResponse struct { + ResourceHealthMetadataListBySiteSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// ResourceHealthMetadataListBySiteSlotResult contains the result from method ResourceHealthMetadata.ListBySiteSlot. +type ResourceHealthMetadataListBySiteSlotResult struct { + ResourceHealthMetadataCollection +} + +// ResourceHealthMetadataListResponse contains the response from method ResourceHealthMetadata.List. +type ResourceHealthMetadataListResponse struct { + ResourceHealthMetadataListResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// ResourceHealthMetadataListResult contains the result from method ResourceHealthMetadata.List. +type ResourceHealthMetadataListResult struct { + ResourceHealthMetadataCollection +} + +// StaticSitesApproveOrRejectPrivateEndpointConnectionPollerResponse contains the response from method StaticSites.ApproveOrRejectPrivateEndpointConnection. +type StaticSitesApproveOrRejectPrivateEndpointConnectionPollerResponse struct { + // Poller contains an initialized poller. + Poller *StaticSitesApproveOrRejectPrivateEndpointConnectionPoller + + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. +// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. +// A good starting value is 30 seconds. Note that some resources might benefit from a different value. +func (l StaticSitesApproveOrRejectPrivateEndpointConnectionPollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (StaticSitesApproveOrRejectPrivateEndpointConnectionResponse, error) { + respType := StaticSitesApproveOrRejectPrivateEndpointConnectionResponse{} + resp, err := l.Poller.pt.PollUntilDone(ctx, freq, &respType.RemotePrivateEndpointConnectionARMResource) + if err != nil { + return respType, err + } + respType.RawResponse = resp + return respType, nil +} + +// Resume rehydrates a StaticSitesApproveOrRejectPrivateEndpointConnectionPollerResponse from the provided client and resume token. +func (l *StaticSitesApproveOrRejectPrivateEndpointConnectionPollerResponse) Resume(ctx context.Context, client *StaticSitesClient, token string) error { + pt, err := armruntime.NewPollerFromResumeToken("StaticSitesClient.ApproveOrRejectPrivateEndpointConnection", token, client.pl, client.approveOrRejectPrivateEndpointConnectionHandleError) + if err != nil { + return err + } + poller := &StaticSitesApproveOrRejectPrivateEndpointConnectionPoller{ + pt: pt, + } + resp, err := poller.Poll(ctx) + if err != nil { + return err + } + l.Poller = poller + l.RawResponse = resp + return nil +} + +// StaticSitesApproveOrRejectPrivateEndpointConnectionResponse contains the response from method StaticSites.ApproveOrRejectPrivateEndpointConnection. +type StaticSitesApproveOrRejectPrivateEndpointConnectionResponse struct { + StaticSitesApproveOrRejectPrivateEndpointConnectionResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// StaticSitesApproveOrRejectPrivateEndpointConnectionResult contains the result from method StaticSites.ApproveOrRejectPrivateEndpointConnection. +type StaticSitesApproveOrRejectPrivateEndpointConnectionResult struct { + RemotePrivateEndpointConnectionARMResource +} + +// StaticSitesCreateOrUpdateStaticSiteAppSettingsResponse contains the response from method StaticSites.CreateOrUpdateStaticSiteAppSettings. +type StaticSitesCreateOrUpdateStaticSiteAppSettingsResponse struct { + StaticSitesCreateOrUpdateStaticSiteAppSettingsResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// StaticSitesCreateOrUpdateStaticSiteAppSettingsResult contains the result from method StaticSites.CreateOrUpdateStaticSiteAppSettings. +type StaticSitesCreateOrUpdateStaticSiteAppSettingsResult struct { + StringDictionary +} + +// StaticSitesCreateOrUpdateStaticSiteBuildAppSettingsResponse contains the response from method StaticSites.CreateOrUpdateStaticSiteBuildAppSettings. +type StaticSitesCreateOrUpdateStaticSiteBuildAppSettingsResponse struct { + StaticSitesCreateOrUpdateStaticSiteBuildAppSettingsResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// StaticSitesCreateOrUpdateStaticSiteBuildAppSettingsResult contains the result from method StaticSites.CreateOrUpdateStaticSiteBuildAppSettings. +type StaticSitesCreateOrUpdateStaticSiteBuildAppSettingsResult struct { + StringDictionary +} + +// StaticSitesCreateOrUpdateStaticSiteBuildFunctionAppSettingsResponse contains the response from method StaticSites.CreateOrUpdateStaticSiteBuildFunctionAppSettings. +type StaticSitesCreateOrUpdateStaticSiteBuildFunctionAppSettingsResponse struct { + StaticSitesCreateOrUpdateStaticSiteBuildFunctionAppSettingsResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// StaticSitesCreateOrUpdateStaticSiteBuildFunctionAppSettingsResult contains the result from method StaticSites.CreateOrUpdateStaticSiteBuildFunctionAppSettings. +type StaticSitesCreateOrUpdateStaticSiteBuildFunctionAppSettingsResult struct { + StringDictionary +} + +// StaticSitesCreateOrUpdateStaticSiteCustomDomainPollerResponse contains the response from method StaticSites.CreateOrUpdateStaticSiteCustomDomain. +type StaticSitesCreateOrUpdateStaticSiteCustomDomainPollerResponse struct { + // Poller contains an initialized poller. + Poller *StaticSitesCreateOrUpdateStaticSiteCustomDomainPoller + + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. +// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. +// A good starting value is 30 seconds. Note that some resources might benefit from a different value. +func (l StaticSitesCreateOrUpdateStaticSiteCustomDomainPollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (StaticSitesCreateOrUpdateStaticSiteCustomDomainResponse, error) { + respType := StaticSitesCreateOrUpdateStaticSiteCustomDomainResponse{} + resp, err := l.Poller.pt.PollUntilDone(ctx, freq, &respType.StaticSiteCustomDomainOverviewARMResource) + if err != nil { + return respType, err + } + respType.RawResponse = resp + return respType, nil +} + +// Resume rehydrates a StaticSitesCreateOrUpdateStaticSiteCustomDomainPollerResponse from the provided client and resume token. +func (l *StaticSitesCreateOrUpdateStaticSiteCustomDomainPollerResponse) Resume(ctx context.Context, client *StaticSitesClient, token string) error { + pt, err := armruntime.NewPollerFromResumeToken("StaticSitesClient.CreateOrUpdateStaticSiteCustomDomain", token, client.pl, client.createOrUpdateStaticSiteCustomDomainHandleError) + if err != nil { + return err + } + poller := &StaticSitesCreateOrUpdateStaticSiteCustomDomainPoller{ + pt: pt, + } + resp, err := poller.Poll(ctx) + if err != nil { + return err + } + l.Poller = poller + l.RawResponse = resp + return nil +} + +// StaticSitesCreateOrUpdateStaticSiteCustomDomainResponse contains the response from method StaticSites.CreateOrUpdateStaticSiteCustomDomain. +type StaticSitesCreateOrUpdateStaticSiteCustomDomainResponse struct { + StaticSitesCreateOrUpdateStaticSiteCustomDomainResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// StaticSitesCreateOrUpdateStaticSiteCustomDomainResult contains the result from method StaticSites.CreateOrUpdateStaticSiteCustomDomain. +type StaticSitesCreateOrUpdateStaticSiteCustomDomainResult struct { + StaticSiteCustomDomainOverviewARMResource +} + +// StaticSitesCreateOrUpdateStaticSiteFunctionAppSettingsResponse contains the response from method StaticSites.CreateOrUpdateStaticSiteFunctionAppSettings. +type StaticSitesCreateOrUpdateStaticSiteFunctionAppSettingsResponse struct { + StaticSitesCreateOrUpdateStaticSiteFunctionAppSettingsResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// StaticSitesCreateOrUpdateStaticSiteFunctionAppSettingsResult contains the result from method StaticSites.CreateOrUpdateStaticSiteFunctionAppSettings. +type StaticSitesCreateOrUpdateStaticSiteFunctionAppSettingsResult struct { + StringDictionary +} + +// StaticSitesCreateOrUpdateStaticSitePollerResponse contains the response from method StaticSites.CreateOrUpdateStaticSite. +type StaticSitesCreateOrUpdateStaticSitePollerResponse struct { + // Poller contains an initialized poller. + Poller *StaticSitesCreateOrUpdateStaticSitePoller + + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. +// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. +// A good starting value is 30 seconds. Note that some resources might benefit from a different value. +func (l StaticSitesCreateOrUpdateStaticSitePollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (StaticSitesCreateOrUpdateStaticSiteResponse, error) { + respType := StaticSitesCreateOrUpdateStaticSiteResponse{} + resp, err := l.Poller.pt.PollUntilDone(ctx, freq, &respType.StaticSiteARMResource) + if err != nil { + return respType, err + } + respType.RawResponse = resp + return respType, nil +} + +// Resume rehydrates a StaticSitesCreateOrUpdateStaticSitePollerResponse from the provided client and resume token. +func (l *StaticSitesCreateOrUpdateStaticSitePollerResponse) Resume(ctx context.Context, client *StaticSitesClient, token string) error { + pt, err := armruntime.NewPollerFromResumeToken("StaticSitesClient.CreateOrUpdateStaticSite", token, client.pl, client.createOrUpdateStaticSiteHandleError) + if err != nil { + return err + } + poller := &StaticSitesCreateOrUpdateStaticSitePoller{ + pt: pt, + } + resp, err := poller.Poll(ctx) + if err != nil { + return err + } + l.Poller = poller + l.RawResponse = resp + return nil +} + +// StaticSitesCreateOrUpdateStaticSiteResponse contains the response from method StaticSites.CreateOrUpdateStaticSite. +type StaticSitesCreateOrUpdateStaticSiteResponse struct { + StaticSitesCreateOrUpdateStaticSiteResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// StaticSitesCreateOrUpdateStaticSiteResult contains the result from method StaticSites.CreateOrUpdateStaticSite. +type StaticSitesCreateOrUpdateStaticSiteResult struct { + StaticSiteARMResource +} + +// StaticSitesCreateUserRolesInvitationLinkResponse contains the response from method StaticSites.CreateUserRolesInvitationLink. +type StaticSitesCreateUserRolesInvitationLinkResponse struct { + StaticSitesCreateUserRolesInvitationLinkResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// StaticSitesCreateUserRolesInvitationLinkResult contains the result from method StaticSites.CreateUserRolesInvitationLink. +type StaticSitesCreateUserRolesInvitationLinkResult struct { + StaticSiteUserInvitationResponseResource +} + +// StaticSitesCreateZipDeploymentForStaticSiteBuildPollerResponse contains the response from method StaticSites.CreateZipDeploymentForStaticSiteBuild. +type StaticSitesCreateZipDeploymentForStaticSiteBuildPollerResponse struct { + // Poller contains an initialized poller. + Poller *StaticSitesCreateZipDeploymentForStaticSiteBuildPoller + + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. +// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. +// A good starting value is 30 seconds. Note that some resources might benefit from a different value. +func (l StaticSitesCreateZipDeploymentForStaticSiteBuildPollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (StaticSitesCreateZipDeploymentForStaticSiteBuildResponse, error) { + respType := StaticSitesCreateZipDeploymentForStaticSiteBuildResponse{} + resp, err := l.Poller.pt.PollUntilDone(ctx, freq, nil) + if err != nil { + return respType, err + } + respType.RawResponse = resp + return respType, nil +} + +// Resume rehydrates a StaticSitesCreateZipDeploymentForStaticSiteBuildPollerResponse from the provided client and resume token. +func (l *StaticSitesCreateZipDeploymentForStaticSiteBuildPollerResponse) Resume(ctx context.Context, client *StaticSitesClient, token string) error { + pt, err := armruntime.NewPollerFromResumeToken("StaticSitesClient.CreateZipDeploymentForStaticSiteBuild", token, client.pl, client.createZipDeploymentForStaticSiteBuildHandleError) + if err != nil { + return err + } + poller := &StaticSitesCreateZipDeploymentForStaticSiteBuildPoller{ + pt: pt, + } + resp, err := poller.Poll(ctx) + if err != nil { + return err + } + l.Poller = poller + l.RawResponse = resp + return nil +} + +// StaticSitesCreateZipDeploymentForStaticSiteBuildResponse contains the response from method StaticSites.CreateZipDeploymentForStaticSiteBuild. +type StaticSitesCreateZipDeploymentForStaticSiteBuildResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// StaticSitesCreateZipDeploymentForStaticSitePollerResponse contains the response from method StaticSites.CreateZipDeploymentForStaticSite. +type StaticSitesCreateZipDeploymentForStaticSitePollerResponse struct { + // Poller contains an initialized poller. + Poller *StaticSitesCreateZipDeploymentForStaticSitePoller + + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. +// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. +// A good starting value is 30 seconds. Note that some resources might benefit from a different value. +func (l StaticSitesCreateZipDeploymentForStaticSitePollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (StaticSitesCreateZipDeploymentForStaticSiteResponse, error) { + respType := StaticSitesCreateZipDeploymentForStaticSiteResponse{} + resp, err := l.Poller.pt.PollUntilDone(ctx, freq, nil) + if err != nil { + return respType, err + } + respType.RawResponse = resp + return respType, nil +} + +// Resume rehydrates a StaticSitesCreateZipDeploymentForStaticSitePollerResponse from the provided client and resume token. +func (l *StaticSitesCreateZipDeploymentForStaticSitePollerResponse) Resume(ctx context.Context, client *StaticSitesClient, token string) error { + pt, err := armruntime.NewPollerFromResumeToken("StaticSitesClient.CreateZipDeploymentForStaticSite", token, client.pl, client.createZipDeploymentForStaticSiteHandleError) + if err != nil { + return err + } + poller := &StaticSitesCreateZipDeploymentForStaticSitePoller{ + pt: pt, + } + resp, err := poller.Poll(ctx) + if err != nil { + return err + } + l.Poller = poller + l.RawResponse = resp + return nil +} + +// StaticSitesCreateZipDeploymentForStaticSiteResponse contains the response from method StaticSites.CreateZipDeploymentForStaticSite. +type StaticSitesCreateZipDeploymentForStaticSiteResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// StaticSitesDeletePrivateEndpointConnectionPollerResponse contains the response from method StaticSites.DeletePrivateEndpointConnection. +type StaticSitesDeletePrivateEndpointConnectionPollerResponse struct { + // Poller contains an initialized poller. + Poller *StaticSitesDeletePrivateEndpointConnectionPoller + + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. +// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. +// A good starting value is 30 seconds. Note that some resources might benefit from a different value. +func (l StaticSitesDeletePrivateEndpointConnectionPollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (StaticSitesDeletePrivateEndpointConnectionResponse, error) { + respType := StaticSitesDeletePrivateEndpointConnectionResponse{} + resp, err := l.Poller.pt.PollUntilDone(ctx, freq, &respType.Object) + if err != nil { + return respType, err + } + respType.RawResponse = resp + return respType, nil +} + +// Resume rehydrates a StaticSitesDeletePrivateEndpointConnectionPollerResponse from the provided client and resume token. +func (l *StaticSitesDeletePrivateEndpointConnectionPollerResponse) Resume(ctx context.Context, client *StaticSitesClient, token string) error { + pt, err := armruntime.NewPollerFromResumeToken("StaticSitesClient.DeletePrivateEndpointConnection", token, client.pl, client.deletePrivateEndpointConnectionHandleError) + if err != nil { + return err + } + poller := &StaticSitesDeletePrivateEndpointConnectionPoller{ + pt: pt, + } + resp, err := poller.Poll(ctx) + if err != nil { + return err + } + l.Poller = poller + l.RawResponse = resp + return nil +} + +// StaticSitesDeletePrivateEndpointConnectionResponse contains the response from method StaticSites.DeletePrivateEndpointConnection. +type StaticSitesDeletePrivateEndpointConnectionResponse struct { + StaticSitesDeletePrivateEndpointConnectionResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// StaticSitesDeletePrivateEndpointConnectionResult contains the result from method StaticSites.DeletePrivateEndpointConnection. +type StaticSitesDeletePrivateEndpointConnectionResult struct { + // Any object + Object map[string]interface{} +} + +// StaticSitesDeleteStaticSiteBuildPollerResponse contains the response from method StaticSites.DeleteStaticSiteBuild. +type StaticSitesDeleteStaticSiteBuildPollerResponse struct { + // Poller contains an initialized poller. + Poller *StaticSitesDeleteStaticSiteBuildPoller + + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. +// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. +// A good starting value is 30 seconds. Note that some resources might benefit from a different value. +func (l StaticSitesDeleteStaticSiteBuildPollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (StaticSitesDeleteStaticSiteBuildResponse, error) { + respType := StaticSitesDeleteStaticSiteBuildResponse{} + resp, err := l.Poller.pt.PollUntilDone(ctx, freq, nil) + if err != nil { + return respType, err + } + respType.RawResponse = resp + return respType, nil +} + +// Resume rehydrates a StaticSitesDeleteStaticSiteBuildPollerResponse from the provided client and resume token. +func (l *StaticSitesDeleteStaticSiteBuildPollerResponse) Resume(ctx context.Context, client *StaticSitesClient, token string) error { + pt, err := armruntime.NewPollerFromResumeToken("StaticSitesClient.DeleteStaticSiteBuild", token, client.pl, client.deleteStaticSiteBuildHandleError) + if err != nil { + return err + } + poller := &StaticSitesDeleteStaticSiteBuildPoller{ + pt: pt, + } + resp, err := poller.Poll(ctx) + if err != nil { + return err + } + l.Poller = poller + l.RawResponse = resp + return nil +} + +// StaticSitesDeleteStaticSiteBuildResponse contains the response from method StaticSites.DeleteStaticSiteBuild. +type StaticSitesDeleteStaticSiteBuildResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// StaticSitesDeleteStaticSiteCustomDomainPollerResponse contains the response from method StaticSites.DeleteStaticSiteCustomDomain. +type StaticSitesDeleteStaticSiteCustomDomainPollerResponse struct { + // Poller contains an initialized poller. + Poller *StaticSitesDeleteStaticSiteCustomDomainPoller + + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. +// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. +// A good starting value is 30 seconds. Note that some resources might benefit from a different value. +func (l StaticSitesDeleteStaticSiteCustomDomainPollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (StaticSitesDeleteStaticSiteCustomDomainResponse, error) { + respType := StaticSitesDeleteStaticSiteCustomDomainResponse{} + resp, err := l.Poller.pt.PollUntilDone(ctx, freq, nil) + if err != nil { + return respType, err + } + respType.RawResponse = resp + return respType, nil +} + +// Resume rehydrates a StaticSitesDeleteStaticSiteCustomDomainPollerResponse from the provided client and resume token. +func (l *StaticSitesDeleteStaticSiteCustomDomainPollerResponse) Resume(ctx context.Context, client *StaticSitesClient, token string) error { + pt, err := armruntime.NewPollerFromResumeToken("StaticSitesClient.DeleteStaticSiteCustomDomain", token, client.pl, client.deleteStaticSiteCustomDomainHandleError) + if err != nil { + return err + } + poller := &StaticSitesDeleteStaticSiteCustomDomainPoller{ + pt: pt, + } + resp, err := poller.Poll(ctx) + if err != nil { + return err + } + l.Poller = poller + l.RawResponse = resp + return nil +} + +// StaticSitesDeleteStaticSiteCustomDomainResponse contains the response from method StaticSites.DeleteStaticSiteCustomDomain. +type StaticSitesDeleteStaticSiteCustomDomainResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// StaticSitesDeleteStaticSitePollerResponse contains the response from method StaticSites.DeleteStaticSite. +type StaticSitesDeleteStaticSitePollerResponse struct { + // Poller contains an initialized poller. + Poller *StaticSitesDeleteStaticSitePoller + + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. +// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. +// A good starting value is 30 seconds. Note that some resources might benefit from a different value. +func (l StaticSitesDeleteStaticSitePollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (StaticSitesDeleteStaticSiteResponse, error) { + respType := StaticSitesDeleteStaticSiteResponse{} + resp, err := l.Poller.pt.PollUntilDone(ctx, freq, nil) + if err != nil { + return respType, err + } + respType.RawResponse = resp + return respType, nil +} + +// Resume rehydrates a StaticSitesDeleteStaticSitePollerResponse from the provided client and resume token. +func (l *StaticSitesDeleteStaticSitePollerResponse) Resume(ctx context.Context, client *StaticSitesClient, token string) error { + pt, err := armruntime.NewPollerFromResumeToken("StaticSitesClient.DeleteStaticSite", token, client.pl, client.deleteStaticSiteHandleError) + if err != nil { + return err + } + poller := &StaticSitesDeleteStaticSitePoller{ + pt: pt, + } + resp, err := poller.Poll(ctx) + if err != nil { + return err + } + l.Poller = poller + l.RawResponse = resp + return nil +} + +// StaticSitesDeleteStaticSiteResponse contains the response from method StaticSites.DeleteStaticSite. +type StaticSitesDeleteStaticSiteResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// StaticSitesDeleteStaticSiteUserResponse contains the response from method StaticSites.DeleteStaticSiteUser. +type StaticSitesDeleteStaticSiteUserResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// StaticSitesDetachStaticSitePollerResponse contains the response from method StaticSites.DetachStaticSite. +type StaticSitesDetachStaticSitePollerResponse struct { + // Poller contains an initialized poller. + Poller *StaticSitesDetachStaticSitePoller + + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. +// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. +// A good starting value is 30 seconds. Note that some resources might benefit from a different value. +func (l StaticSitesDetachStaticSitePollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (StaticSitesDetachStaticSiteResponse, error) { + respType := StaticSitesDetachStaticSiteResponse{} + resp, err := l.Poller.pt.PollUntilDone(ctx, freq, nil) + if err != nil { + return respType, err + } + respType.RawResponse = resp + return respType, nil +} + +// Resume rehydrates a StaticSitesDetachStaticSitePollerResponse from the provided client and resume token. +func (l *StaticSitesDetachStaticSitePollerResponse) Resume(ctx context.Context, client *StaticSitesClient, token string) error { + pt, err := armruntime.NewPollerFromResumeToken("StaticSitesClient.DetachStaticSite", token, client.pl, client.detachStaticSiteHandleError) + if err != nil { + return err + } + poller := &StaticSitesDetachStaticSitePoller{ + pt: pt, + } + resp, err := poller.Poll(ctx) + if err != nil { + return err + } + l.Poller = poller + l.RawResponse = resp + return nil +} + +// StaticSitesDetachStaticSiteResponse contains the response from method StaticSites.DetachStaticSite. +type StaticSitesDetachStaticSiteResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// StaticSitesDetachUserProvidedFunctionAppFromStaticSiteBuildResponse contains the response from method StaticSites.DetachUserProvidedFunctionAppFromStaticSiteBuild. +type StaticSitesDetachUserProvidedFunctionAppFromStaticSiteBuildResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// StaticSitesDetachUserProvidedFunctionAppFromStaticSiteResponse contains the response from method StaticSites.DetachUserProvidedFunctionAppFromStaticSite. +type StaticSitesDetachUserProvidedFunctionAppFromStaticSiteResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// StaticSitesGetPrivateEndpointConnectionListResponse contains the response from method StaticSites.GetPrivateEndpointConnectionList. +type StaticSitesGetPrivateEndpointConnectionListResponse struct { + StaticSitesGetPrivateEndpointConnectionListResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// StaticSitesGetPrivateEndpointConnectionListResult contains the result from method StaticSites.GetPrivateEndpointConnectionList. +type StaticSitesGetPrivateEndpointConnectionListResult struct { + PrivateEndpointConnectionCollection +} + +// StaticSitesGetPrivateEndpointConnectionResponse contains the response from method StaticSites.GetPrivateEndpointConnection. +type StaticSitesGetPrivateEndpointConnectionResponse struct { + StaticSitesGetPrivateEndpointConnectionResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// StaticSitesGetPrivateEndpointConnectionResult contains the result from method StaticSites.GetPrivateEndpointConnection. +type StaticSitesGetPrivateEndpointConnectionResult struct { + RemotePrivateEndpointConnectionARMResource +} + +// StaticSitesGetPrivateLinkResourcesResponse contains the response from method StaticSites.GetPrivateLinkResources. +type StaticSitesGetPrivateLinkResourcesResponse struct { + StaticSitesGetPrivateLinkResourcesResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// StaticSitesGetPrivateLinkResourcesResult contains the result from method StaticSites.GetPrivateLinkResources. +type StaticSitesGetPrivateLinkResourcesResult struct { + PrivateLinkResourcesWrapper +} + +// StaticSitesGetStaticSiteBuildResponse contains the response from method StaticSites.GetStaticSiteBuild. +type StaticSitesGetStaticSiteBuildResponse struct { + StaticSitesGetStaticSiteBuildResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// StaticSitesGetStaticSiteBuildResult contains the result from method StaticSites.GetStaticSiteBuild. +type StaticSitesGetStaticSiteBuildResult struct { + StaticSiteBuildARMResource +} + +// StaticSitesGetStaticSiteBuildsResponse contains the response from method StaticSites.GetStaticSiteBuilds. +type StaticSitesGetStaticSiteBuildsResponse struct { + StaticSitesGetStaticSiteBuildsResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// StaticSitesGetStaticSiteBuildsResult contains the result from method StaticSites.GetStaticSiteBuilds. +type StaticSitesGetStaticSiteBuildsResult struct { + StaticSiteBuildCollection +} + +// StaticSitesGetStaticSiteCustomDomainResponse contains the response from method StaticSites.GetStaticSiteCustomDomain. +type StaticSitesGetStaticSiteCustomDomainResponse struct { + StaticSitesGetStaticSiteCustomDomainResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// StaticSitesGetStaticSiteCustomDomainResult contains the result from method StaticSites.GetStaticSiteCustomDomain. +type StaticSitesGetStaticSiteCustomDomainResult struct { + StaticSiteCustomDomainOverviewARMResource +} + +// StaticSitesGetStaticSiteResponse contains the response from method StaticSites.GetStaticSite. +type StaticSitesGetStaticSiteResponse struct { + StaticSitesGetStaticSiteResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// StaticSitesGetStaticSiteResult contains the result from method StaticSites.GetStaticSite. +type StaticSitesGetStaticSiteResult struct { + StaticSiteARMResource +} + +// StaticSitesGetStaticSitesByResourceGroupResponse contains the response from method StaticSites.GetStaticSitesByResourceGroup. +type StaticSitesGetStaticSitesByResourceGroupResponse struct { + StaticSitesGetStaticSitesByResourceGroupResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// StaticSitesGetStaticSitesByResourceGroupResult contains the result from method StaticSites.GetStaticSitesByResourceGroup. +type StaticSitesGetStaticSitesByResourceGroupResult struct { + StaticSiteCollection +} + +// StaticSitesGetUserProvidedFunctionAppForStaticSiteBuildResponse contains the response from method StaticSites.GetUserProvidedFunctionAppForStaticSiteBuild. +type StaticSitesGetUserProvidedFunctionAppForStaticSiteBuildResponse struct { + StaticSitesGetUserProvidedFunctionAppForStaticSiteBuildResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// StaticSitesGetUserProvidedFunctionAppForStaticSiteBuildResult contains the result from method StaticSites.GetUserProvidedFunctionAppForStaticSiteBuild. +type StaticSitesGetUserProvidedFunctionAppForStaticSiteBuildResult struct { + StaticSiteUserProvidedFunctionAppARMResource +} + +// StaticSitesGetUserProvidedFunctionAppForStaticSiteResponse contains the response from method StaticSites.GetUserProvidedFunctionAppForStaticSite. +type StaticSitesGetUserProvidedFunctionAppForStaticSiteResponse struct { + StaticSitesGetUserProvidedFunctionAppForStaticSiteResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// StaticSitesGetUserProvidedFunctionAppForStaticSiteResult contains the result from method StaticSites.GetUserProvidedFunctionAppForStaticSite. +type StaticSitesGetUserProvidedFunctionAppForStaticSiteResult struct { + StaticSiteUserProvidedFunctionAppARMResource +} + +// StaticSitesGetUserProvidedFunctionAppsForStaticSiteBuildResponse contains the response from method StaticSites.GetUserProvidedFunctionAppsForStaticSiteBuild. +type StaticSitesGetUserProvidedFunctionAppsForStaticSiteBuildResponse struct { + StaticSitesGetUserProvidedFunctionAppsForStaticSiteBuildResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// StaticSitesGetUserProvidedFunctionAppsForStaticSiteBuildResult contains the result from method StaticSites.GetUserProvidedFunctionAppsForStaticSiteBuild. +type StaticSitesGetUserProvidedFunctionAppsForStaticSiteBuildResult struct { + StaticSiteUserProvidedFunctionAppsCollection +} + +// StaticSitesGetUserProvidedFunctionAppsForStaticSiteResponse contains the response from method StaticSites.GetUserProvidedFunctionAppsForStaticSite. +type StaticSitesGetUserProvidedFunctionAppsForStaticSiteResponse struct { + StaticSitesGetUserProvidedFunctionAppsForStaticSiteResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// StaticSitesGetUserProvidedFunctionAppsForStaticSiteResult contains the result from method StaticSites.GetUserProvidedFunctionAppsForStaticSite. +type StaticSitesGetUserProvidedFunctionAppsForStaticSiteResult struct { + StaticSiteUserProvidedFunctionAppsCollection +} + +// StaticSitesListResponse contains the response from method StaticSites.List. +type StaticSitesListResponse struct { + StaticSitesListResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// StaticSitesListResult contains the result from method StaticSites.List. +type StaticSitesListResult struct { + StaticSiteCollection +} + +// StaticSitesListStaticSiteAppSettingsResponse contains the response from method StaticSites.ListStaticSiteAppSettings. +type StaticSitesListStaticSiteAppSettingsResponse struct { + StaticSitesListStaticSiteAppSettingsResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// StaticSitesListStaticSiteAppSettingsResult contains the result from method StaticSites.ListStaticSiteAppSettings. +type StaticSitesListStaticSiteAppSettingsResult struct { + StringDictionary +} + +// StaticSitesListStaticSiteBuildAppSettingsResponse contains the response from method StaticSites.ListStaticSiteBuildAppSettings. +type StaticSitesListStaticSiteBuildAppSettingsResponse struct { + StaticSitesListStaticSiteBuildAppSettingsResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// StaticSitesListStaticSiteBuildAppSettingsResult contains the result from method StaticSites.ListStaticSiteBuildAppSettings. +type StaticSitesListStaticSiteBuildAppSettingsResult struct { + StringDictionary +} + +// StaticSitesListStaticSiteBuildFunctionAppSettingsResponse contains the response from method StaticSites.ListStaticSiteBuildFunctionAppSettings. +type StaticSitesListStaticSiteBuildFunctionAppSettingsResponse struct { + StaticSitesListStaticSiteBuildFunctionAppSettingsResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// StaticSitesListStaticSiteBuildFunctionAppSettingsResult contains the result from method StaticSites.ListStaticSiteBuildFunctionAppSettings. +type StaticSitesListStaticSiteBuildFunctionAppSettingsResult struct { + StringDictionary +} + +// StaticSitesListStaticSiteBuildFunctionsResponse contains the response from method StaticSites.ListStaticSiteBuildFunctions. +type StaticSitesListStaticSiteBuildFunctionsResponse struct { + StaticSitesListStaticSiteBuildFunctionsResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// StaticSitesListStaticSiteBuildFunctionsResult contains the result from method StaticSites.ListStaticSiteBuildFunctions. +type StaticSitesListStaticSiteBuildFunctionsResult struct { + StaticSiteFunctionOverviewCollection +} + +// StaticSitesListStaticSiteConfiguredRolesResponse contains the response from method StaticSites.ListStaticSiteConfiguredRoles. +type StaticSitesListStaticSiteConfiguredRolesResponse struct { + StaticSitesListStaticSiteConfiguredRolesResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// StaticSitesListStaticSiteConfiguredRolesResult contains the result from method StaticSites.ListStaticSiteConfiguredRoles. +type StaticSitesListStaticSiteConfiguredRolesResult struct { + StringList +} + +// StaticSitesListStaticSiteCustomDomainsResponse contains the response from method StaticSites.ListStaticSiteCustomDomains. +type StaticSitesListStaticSiteCustomDomainsResponse struct { + StaticSitesListStaticSiteCustomDomainsResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// StaticSitesListStaticSiteCustomDomainsResult contains the result from method StaticSites.ListStaticSiteCustomDomains. +type StaticSitesListStaticSiteCustomDomainsResult struct { + StaticSiteCustomDomainOverviewCollection +} + +// StaticSitesListStaticSiteFunctionAppSettingsResponse contains the response from method StaticSites.ListStaticSiteFunctionAppSettings. +type StaticSitesListStaticSiteFunctionAppSettingsResponse struct { + StaticSitesListStaticSiteFunctionAppSettingsResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// StaticSitesListStaticSiteFunctionAppSettingsResult contains the result from method StaticSites.ListStaticSiteFunctionAppSettings. +type StaticSitesListStaticSiteFunctionAppSettingsResult struct { + StringDictionary +} + +// StaticSitesListStaticSiteFunctionsResponse contains the response from method StaticSites.ListStaticSiteFunctions. +type StaticSitesListStaticSiteFunctionsResponse struct { + StaticSitesListStaticSiteFunctionsResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// StaticSitesListStaticSiteFunctionsResult contains the result from method StaticSites.ListStaticSiteFunctions. +type StaticSitesListStaticSiteFunctionsResult struct { + StaticSiteFunctionOverviewCollection +} + +// StaticSitesListStaticSiteSecretsResponse contains the response from method StaticSites.ListStaticSiteSecrets. +type StaticSitesListStaticSiteSecretsResponse struct { + StaticSitesListStaticSiteSecretsResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// StaticSitesListStaticSiteSecretsResult contains the result from method StaticSites.ListStaticSiteSecrets. +type StaticSitesListStaticSiteSecretsResult struct { + StringDictionary +} + +// StaticSitesListStaticSiteUsersResponse contains the response from method StaticSites.ListStaticSiteUsers. +type StaticSitesListStaticSiteUsersResponse struct { + StaticSitesListStaticSiteUsersResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// StaticSitesListStaticSiteUsersResult contains the result from method StaticSites.ListStaticSiteUsers. +type StaticSitesListStaticSiteUsersResult struct { + StaticSiteUserCollection +} + +// StaticSitesPreviewWorkflowResponse contains the response from method StaticSites.PreviewWorkflow. +type StaticSitesPreviewWorkflowResponse struct { + StaticSitesPreviewWorkflowResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// StaticSitesPreviewWorkflowResult contains the result from method StaticSites.PreviewWorkflow. +type StaticSitesPreviewWorkflowResult struct { + StaticSitesWorkflowPreview +} + +// StaticSitesRegisterUserProvidedFunctionAppWithStaticSiteBuildPollerResponse contains the response from method StaticSites.RegisterUserProvidedFunctionAppWithStaticSiteBuild. +type StaticSitesRegisterUserProvidedFunctionAppWithStaticSiteBuildPollerResponse struct { + // Poller contains an initialized poller. + Poller *StaticSitesRegisterUserProvidedFunctionAppWithStaticSiteBuildPoller + + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. +// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. +// A good starting value is 30 seconds. Note that some resources might benefit from a different value. +func (l StaticSitesRegisterUserProvidedFunctionAppWithStaticSiteBuildPollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (StaticSitesRegisterUserProvidedFunctionAppWithStaticSiteBuildResponse, error) { + respType := StaticSitesRegisterUserProvidedFunctionAppWithStaticSiteBuildResponse{} + resp, err := l.Poller.pt.PollUntilDone(ctx, freq, &respType.StaticSiteUserProvidedFunctionAppARMResource) + if err != nil { + return respType, err + } + respType.RawResponse = resp + return respType, nil +} + +// Resume rehydrates a StaticSitesRegisterUserProvidedFunctionAppWithStaticSiteBuildPollerResponse from the provided client and resume token. +func (l *StaticSitesRegisterUserProvidedFunctionAppWithStaticSiteBuildPollerResponse) Resume(ctx context.Context, client *StaticSitesClient, token string) error { + pt, err := armruntime.NewPollerFromResumeToken("StaticSitesClient.RegisterUserProvidedFunctionAppWithStaticSiteBuild", token, client.pl, client.registerUserProvidedFunctionAppWithStaticSiteBuildHandleError) + if err != nil { + return err + } + poller := &StaticSitesRegisterUserProvidedFunctionAppWithStaticSiteBuildPoller{ + pt: pt, + } + resp, err := poller.Poll(ctx) + if err != nil { + return err + } + l.Poller = poller + l.RawResponse = resp + return nil +} + +// StaticSitesRegisterUserProvidedFunctionAppWithStaticSiteBuildResponse contains the response from method StaticSites.RegisterUserProvidedFunctionAppWithStaticSiteBuild. +type StaticSitesRegisterUserProvidedFunctionAppWithStaticSiteBuildResponse struct { + StaticSitesRegisterUserProvidedFunctionAppWithStaticSiteBuildResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// StaticSitesRegisterUserProvidedFunctionAppWithStaticSiteBuildResult contains the result from method StaticSites.RegisterUserProvidedFunctionAppWithStaticSiteBuild. +type StaticSitesRegisterUserProvidedFunctionAppWithStaticSiteBuildResult struct { + StaticSiteUserProvidedFunctionAppARMResource +} + +// StaticSitesRegisterUserProvidedFunctionAppWithStaticSitePollerResponse contains the response from method StaticSites.RegisterUserProvidedFunctionAppWithStaticSite. +type StaticSitesRegisterUserProvidedFunctionAppWithStaticSitePollerResponse struct { + // Poller contains an initialized poller. + Poller *StaticSitesRegisterUserProvidedFunctionAppWithStaticSitePoller + + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. +// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. +// A good starting value is 30 seconds. Note that some resources might benefit from a different value. +func (l StaticSitesRegisterUserProvidedFunctionAppWithStaticSitePollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (StaticSitesRegisterUserProvidedFunctionAppWithStaticSiteResponse, error) { + respType := StaticSitesRegisterUserProvidedFunctionAppWithStaticSiteResponse{} + resp, err := l.Poller.pt.PollUntilDone(ctx, freq, &respType.StaticSiteUserProvidedFunctionAppARMResource) + if err != nil { + return respType, err + } + respType.RawResponse = resp + return respType, nil +} + +// Resume rehydrates a StaticSitesRegisterUserProvidedFunctionAppWithStaticSitePollerResponse from the provided client and resume token. +func (l *StaticSitesRegisterUserProvidedFunctionAppWithStaticSitePollerResponse) Resume(ctx context.Context, client *StaticSitesClient, token string) error { + pt, err := armruntime.NewPollerFromResumeToken("StaticSitesClient.RegisterUserProvidedFunctionAppWithStaticSite", token, client.pl, client.registerUserProvidedFunctionAppWithStaticSiteHandleError) + if err != nil { + return err + } + poller := &StaticSitesRegisterUserProvidedFunctionAppWithStaticSitePoller{ + pt: pt, + } + resp, err := poller.Poll(ctx) + if err != nil { + return err + } + l.Poller = poller + l.RawResponse = resp + return nil +} + +// StaticSitesRegisterUserProvidedFunctionAppWithStaticSiteResponse contains the response from method StaticSites.RegisterUserProvidedFunctionAppWithStaticSite. +type StaticSitesRegisterUserProvidedFunctionAppWithStaticSiteResponse struct { + StaticSitesRegisterUserProvidedFunctionAppWithStaticSiteResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// StaticSitesRegisterUserProvidedFunctionAppWithStaticSiteResult contains the result from method StaticSites.RegisterUserProvidedFunctionAppWithStaticSite. +type StaticSitesRegisterUserProvidedFunctionAppWithStaticSiteResult struct { + StaticSiteUserProvidedFunctionAppARMResource +} + +// StaticSitesResetStaticSiteAPIKeyResponse contains the response from method StaticSites.ResetStaticSiteAPIKey. +type StaticSitesResetStaticSiteAPIKeyResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// StaticSitesUpdateStaticSiteResponse contains the response from method StaticSites.UpdateStaticSite. +type StaticSitesUpdateStaticSiteResponse struct { + StaticSitesUpdateStaticSiteResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// StaticSitesUpdateStaticSiteResult contains the result from method StaticSites.UpdateStaticSite. +type StaticSitesUpdateStaticSiteResult struct { + StaticSiteARMResource +} + +// StaticSitesUpdateStaticSiteUserResponse contains the response from method StaticSites.UpdateStaticSiteUser. +type StaticSitesUpdateStaticSiteUserResponse struct { + StaticSitesUpdateStaticSiteUserResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// StaticSitesUpdateStaticSiteUserResult contains the result from method StaticSites.UpdateStaticSiteUser. +type StaticSitesUpdateStaticSiteUserResult struct { + StaticSiteUserARMResource +} + +// StaticSitesValidateCustomDomainCanBeAddedToStaticSitePollerResponse contains the response from method StaticSites.ValidateCustomDomainCanBeAddedToStaticSite. +type StaticSitesValidateCustomDomainCanBeAddedToStaticSitePollerResponse struct { + // Poller contains an initialized poller. + Poller *StaticSitesValidateCustomDomainCanBeAddedToStaticSitePoller + + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. +// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. +// A good starting value is 30 seconds. Note that some resources might benefit from a different value. +func (l StaticSitesValidateCustomDomainCanBeAddedToStaticSitePollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (StaticSitesValidateCustomDomainCanBeAddedToStaticSiteResponse, error) { + respType := StaticSitesValidateCustomDomainCanBeAddedToStaticSiteResponse{} + resp, err := l.Poller.pt.PollUntilDone(ctx, freq, nil) + if err != nil { + return respType, err + } + respType.RawResponse = resp + return respType, nil +} + +// Resume rehydrates a StaticSitesValidateCustomDomainCanBeAddedToStaticSitePollerResponse from the provided client and resume token. +func (l *StaticSitesValidateCustomDomainCanBeAddedToStaticSitePollerResponse) Resume(ctx context.Context, client *StaticSitesClient, token string) error { + pt, err := armruntime.NewPollerFromResumeToken("StaticSitesClient.ValidateCustomDomainCanBeAddedToStaticSite", token, client.pl, client.validateCustomDomainCanBeAddedToStaticSiteHandleError) + if err != nil { + return err + } + poller := &StaticSitesValidateCustomDomainCanBeAddedToStaticSitePoller{ + pt: pt, + } + resp, err := poller.Poll(ctx) + if err != nil { + return err + } + l.Poller = poller + l.RawResponse = resp + return nil +} + +// StaticSitesValidateCustomDomainCanBeAddedToStaticSiteResponse contains the response from method StaticSites.ValidateCustomDomainCanBeAddedToStaticSite. +type StaticSitesValidateCustomDomainCanBeAddedToStaticSiteResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// TopLevelDomainsGetResponse contains the response from method TopLevelDomains.Get. +type TopLevelDomainsGetResponse struct { + TopLevelDomainsGetResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// TopLevelDomainsGetResult contains the result from method TopLevelDomains.Get. +type TopLevelDomainsGetResult struct { + TopLevelDomain +} + +// TopLevelDomainsListAgreementsResponse contains the response from method TopLevelDomains.ListAgreements. +type TopLevelDomainsListAgreementsResponse struct { + TopLevelDomainsListAgreementsResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// TopLevelDomainsListAgreementsResult contains the result from method TopLevelDomains.ListAgreements. +type TopLevelDomainsListAgreementsResult struct { + TldLegalAgreementCollection +} + +// TopLevelDomainsListResponse contains the response from method TopLevelDomains.List. +type TopLevelDomainsListResponse struct { + TopLevelDomainsListResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// TopLevelDomainsListResult contains the result from method TopLevelDomains.List. +type TopLevelDomainsListResult struct { + TopLevelDomainCollection +} + +// WebAppsAddPremierAddOnResponse contains the response from method WebApps.AddPremierAddOn. +type WebAppsAddPremierAddOnResponse struct { + WebAppsAddPremierAddOnResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsAddPremierAddOnResult contains the result from method WebApps.AddPremierAddOn. +type WebAppsAddPremierAddOnResult struct { + PremierAddOn +} + +// WebAppsAddPremierAddOnSlotResponse contains the response from method WebApps.AddPremierAddOnSlot. +type WebAppsAddPremierAddOnSlotResponse struct { + WebAppsAddPremierAddOnSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsAddPremierAddOnSlotResult contains the result from method WebApps.AddPremierAddOnSlot. +type WebAppsAddPremierAddOnSlotResult struct { + PremierAddOn +} + +// WebAppsAnalyzeCustomHostnameResponse contains the response from method WebApps.AnalyzeCustomHostname. +type WebAppsAnalyzeCustomHostnameResponse struct { + WebAppsAnalyzeCustomHostnameResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsAnalyzeCustomHostnameResult contains the result from method WebApps.AnalyzeCustomHostname. +type WebAppsAnalyzeCustomHostnameResult struct { + CustomHostnameAnalysisResult +} + +// WebAppsAnalyzeCustomHostnameSlotResponse contains the response from method WebApps.AnalyzeCustomHostnameSlot. +type WebAppsAnalyzeCustomHostnameSlotResponse struct { + WebAppsAnalyzeCustomHostnameSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsAnalyzeCustomHostnameSlotResult contains the result from method WebApps.AnalyzeCustomHostnameSlot. +type WebAppsAnalyzeCustomHostnameSlotResult struct { + CustomHostnameAnalysisResult +} + +// WebAppsApplySlotConfigToProductionResponse contains the response from method WebApps.ApplySlotConfigToProduction. +type WebAppsApplySlotConfigToProductionResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsApplySlotConfigurationSlotResponse contains the response from method WebApps.ApplySlotConfigurationSlot. +type WebAppsApplySlotConfigurationSlotResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsApproveOrRejectPrivateEndpointConnectionPollerResponse contains the response from method WebApps.ApproveOrRejectPrivateEndpointConnection. +type WebAppsApproveOrRejectPrivateEndpointConnectionPollerResponse struct { + // Poller contains an initialized poller. + Poller *WebAppsApproveOrRejectPrivateEndpointConnectionPoller + + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. +// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. +// A good starting value is 30 seconds. Note that some resources might benefit from a different value. +func (l WebAppsApproveOrRejectPrivateEndpointConnectionPollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (WebAppsApproveOrRejectPrivateEndpointConnectionResponse, error) { + respType := WebAppsApproveOrRejectPrivateEndpointConnectionResponse{} + resp, err := l.Poller.pt.PollUntilDone(ctx, freq, &respType.RemotePrivateEndpointConnectionARMResource) + if err != nil { + return respType, err + } + respType.RawResponse = resp + return respType, nil +} + +// Resume rehydrates a WebAppsApproveOrRejectPrivateEndpointConnectionPollerResponse from the provided client and resume token. +func (l *WebAppsApproveOrRejectPrivateEndpointConnectionPollerResponse) Resume(ctx context.Context, client *WebAppsClient, token string) error { + pt, err := armruntime.NewPollerFromResumeToken("WebAppsClient.ApproveOrRejectPrivateEndpointConnection", token, client.pl, client.approveOrRejectPrivateEndpointConnectionHandleError) + if err != nil { + return err + } + poller := &WebAppsApproveOrRejectPrivateEndpointConnectionPoller{ + pt: pt, + } + resp, err := poller.Poll(ctx) + if err != nil { + return err + } + l.Poller = poller + l.RawResponse = resp + return nil +} + +// WebAppsApproveOrRejectPrivateEndpointConnectionResponse contains the response from method WebApps.ApproveOrRejectPrivateEndpointConnection. +type WebAppsApproveOrRejectPrivateEndpointConnectionResponse struct { + WebAppsApproveOrRejectPrivateEndpointConnectionResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsApproveOrRejectPrivateEndpointConnectionResult contains the result from method WebApps.ApproveOrRejectPrivateEndpointConnection. +type WebAppsApproveOrRejectPrivateEndpointConnectionResult struct { + RemotePrivateEndpointConnectionARMResource +} + +// WebAppsApproveOrRejectPrivateEndpointConnectionSlotPollerResponse contains the response from method WebApps.ApproveOrRejectPrivateEndpointConnectionSlot. +type WebAppsApproveOrRejectPrivateEndpointConnectionSlotPollerResponse struct { + // Poller contains an initialized poller. + Poller *WebAppsApproveOrRejectPrivateEndpointConnectionSlotPoller + + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. +// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. +// A good starting value is 30 seconds. Note that some resources might benefit from a different value. +func (l WebAppsApproveOrRejectPrivateEndpointConnectionSlotPollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (WebAppsApproveOrRejectPrivateEndpointConnectionSlotResponse, error) { + respType := WebAppsApproveOrRejectPrivateEndpointConnectionSlotResponse{} + resp, err := l.Poller.pt.PollUntilDone(ctx, freq, &respType.RemotePrivateEndpointConnectionARMResource) + if err != nil { + return respType, err + } + respType.RawResponse = resp + return respType, nil +} + +// Resume rehydrates a WebAppsApproveOrRejectPrivateEndpointConnectionSlotPollerResponse from the provided client and resume token. +func (l *WebAppsApproveOrRejectPrivateEndpointConnectionSlotPollerResponse) Resume(ctx context.Context, client *WebAppsClient, token string) error { + pt, err := armruntime.NewPollerFromResumeToken("WebAppsClient.ApproveOrRejectPrivateEndpointConnectionSlot", token, client.pl, client.approveOrRejectPrivateEndpointConnectionSlotHandleError) + if err != nil { + return err + } + poller := &WebAppsApproveOrRejectPrivateEndpointConnectionSlotPoller{ + pt: pt, + } + resp, err := poller.Poll(ctx) + if err != nil { + return err + } + l.Poller = poller + l.RawResponse = resp + return nil +} + +// WebAppsApproveOrRejectPrivateEndpointConnectionSlotResponse contains the response from method WebApps.ApproveOrRejectPrivateEndpointConnectionSlot. +type WebAppsApproveOrRejectPrivateEndpointConnectionSlotResponse struct { + WebAppsApproveOrRejectPrivateEndpointConnectionSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsApproveOrRejectPrivateEndpointConnectionSlotResult contains the result from method WebApps.ApproveOrRejectPrivateEndpointConnectionSlot. +type WebAppsApproveOrRejectPrivateEndpointConnectionSlotResult struct { + RemotePrivateEndpointConnectionARMResource +} + +// WebAppsBackupResponse contains the response from method WebApps.Backup. +type WebAppsBackupResponse struct { + WebAppsBackupResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsBackupResult contains the result from method WebApps.Backup. +type WebAppsBackupResult struct { + BackupItem +} + +// WebAppsBackupSlotResponse contains the response from method WebApps.BackupSlot. +type WebAppsBackupSlotResponse struct { + WebAppsBackupSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsBackupSlotResult contains the result from method WebApps.BackupSlot. +type WebAppsBackupSlotResult struct { + BackupItem +} + +// WebAppsCreateDeploymentResponse contains the response from method WebApps.CreateDeployment. +type WebAppsCreateDeploymentResponse struct { + WebAppsCreateDeploymentResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsCreateDeploymentResult contains the result from method WebApps.CreateDeployment. +type WebAppsCreateDeploymentResult struct { + Deployment +} + +// WebAppsCreateDeploymentSlotResponse contains the response from method WebApps.CreateDeploymentSlot. +type WebAppsCreateDeploymentSlotResponse struct { + WebAppsCreateDeploymentSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsCreateDeploymentSlotResult contains the result from method WebApps.CreateDeploymentSlot. +type WebAppsCreateDeploymentSlotResult struct { + Deployment +} + +// WebAppsCreateFunctionPollerResponse contains the response from method WebApps.CreateFunction. +type WebAppsCreateFunctionPollerResponse struct { + // Poller contains an initialized poller. + Poller *WebAppsCreateFunctionPoller + + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. +// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. +// A good starting value is 30 seconds. Note that some resources might benefit from a different value. +func (l WebAppsCreateFunctionPollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (WebAppsCreateFunctionResponse, error) { + respType := WebAppsCreateFunctionResponse{} + resp, err := l.Poller.pt.PollUntilDone(ctx, freq, &respType.FunctionEnvelope) + if err != nil { + return respType, err + } + respType.RawResponse = resp + return respType, nil +} + +// Resume rehydrates a WebAppsCreateFunctionPollerResponse from the provided client and resume token. +func (l *WebAppsCreateFunctionPollerResponse) Resume(ctx context.Context, client *WebAppsClient, token string) error { + pt, err := armruntime.NewPollerFromResumeToken("WebAppsClient.CreateFunction", token, client.pl, client.createFunctionHandleError) + if err != nil { + return err + } + poller := &WebAppsCreateFunctionPoller{ + pt: pt, + } + resp, err := poller.Poll(ctx) + if err != nil { + return err + } + l.Poller = poller + l.RawResponse = resp + return nil +} + +// WebAppsCreateFunctionResponse contains the response from method WebApps.CreateFunction. +type WebAppsCreateFunctionResponse struct { + WebAppsCreateFunctionResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsCreateFunctionResult contains the result from method WebApps.CreateFunction. +type WebAppsCreateFunctionResult struct { + FunctionEnvelope +} + +// WebAppsCreateInstanceFunctionSlotPollerResponse contains the response from method WebApps.CreateInstanceFunctionSlot. +type WebAppsCreateInstanceFunctionSlotPollerResponse struct { + // Poller contains an initialized poller. + Poller *WebAppsCreateInstanceFunctionSlotPoller + + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. +// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. +// A good starting value is 30 seconds. Note that some resources might benefit from a different value. +func (l WebAppsCreateInstanceFunctionSlotPollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (WebAppsCreateInstanceFunctionSlotResponse, error) { + respType := WebAppsCreateInstanceFunctionSlotResponse{} + resp, err := l.Poller.pt.PollUntilDone(ctx, freq, &respType.FunctionEnvelope) + if err != nil { + return respType, err + } + respType.RawResponse = resp + return respType, nil +} + +// Resume rehydrates a WebAppsCreateInstanceFunctionSlotPollerResponse from the provided client and resume token. +func (l *WebAppsCreateInstanceFunctionSlotPollerResponse) Resume(ctx context.Context, client *WebAppsClient, token string) error { + pt, err := armruntime.NewPollerFromResumeToken("WebAppsClient.CreateInstanceFunctionSlot", token, client.pl, client.createInstanceFunctionSlotHandleError) + if err != nil { + return err + } + poller := &WebAppsCreateInstanceFunctionSlotPoller{ + pt: pt, + } + resp, err := poller.Poll(ctx) + if err != nil { + return err + } + l.Poller = poller + l.RawResponse = resp + return nil +} + +// WebAppsCreateInstanceFunctionSlotResponse contains the response from method WebApps.CreateInstanceFunctionSlot. +type WebAppsCreateInstanceFunctionSlotResponse struct { + WebAppsCreateInstanceFunctionSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsCreateInstanceFunctionSlotResult contains the result from method WebApps.CreateInstanceFunctionSlot. +type WebAppsCreateInstanceFunctionSlotResult struct { + FunctionEnvelope +} + +// WebAppsCreateInstanceMSDeployOperationPollerResponse contains the response from method WebApps.CreateInstanceMSDeployOperation. +type WebAppsCreateInstanceMSDeployOperationPollerResponse struct { + // Poller contains an initialized poller. + Poller *WebAppsCreateInstanceMSDeployOperationPoller + + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. +// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. +// A good starting value is 30 seconds. Note that some resources might benefit from a different value. +func (l WebAppsCreateInstanceMSDeployOperationPollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (WebAppsCreateInstanceMSDeployOperationResponse, error) { + respType := WebAppsCreateInstanceMSDeployOperationResponse{} + resp, err := l.Poller.pt.PollUntilDone(ctx, freq, &respType.MSDeployStatus) + if err != nil { + return respType, err + } + respType.RawResponse = resp + return respType, nil +} + +// Resume rehydrates a WebAppsCreateInstanceMSDeployOperationPollerResponse from the provided client and resume token. +func (l *WebAppsCreateInstanceMSDeployOperationPollerResponse) Resume(ctx context.Context, client *WebAppsClient, token string) error { + pt, err := armruntime.NewPollerFromResumeToken("WebAppsClient.CreateInstanceMSDeployOperation", token, client.pl, client.createInstanceMSDeployOperationHandleError) + if err != nil { + return err + } + poller := &WebAppsCreateInstanceMSDeployOperationPoller{ + pt: pt, + } + resp, err := poller.Poll(ctx) + if err != nil { + return err + } + l.Poller = poller + l.RawResponse = resp + return nil +} + +// WebAppsCreateInstanceMSDeployOperationResponse contains the response from method WebApps.CreateInstanceMSDeployOperation. +type WebAppsCreateInstanceMSDeployOperationResponse struct { + WebAppsCreateInstanceMSDeployOperationResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsCreateInstanceMSDeployOperationResult contains the result from method WebApps.CreateInstanceMSDeployOperation. +type WebAppsCreateInstanceMSDeployOperationResult struct { + MSDeployStatus +} + +// WebAppsCreateInstanceMSDeployOperationSlotPollerResponse contains the response from method WebApps.CreateInstanceMSDeployOperationSlot. +type WebAppsCreateInstanceMSDeployOperationSlotPollerResponse struct { + // Poller contains an initialized poller. + Poller *WebAppsCreateInstanceMSDeployOperationSlotPoller + + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. +// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. +// A good starting value is 30 seconds. Note that some resources might benefit from a different value. +func (l WebAppsCreateInstanceMSDeployOperationSlotPollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (WebAppsCreateInstanceMSDeployOperationSlotResponse, error) { + respType := WebAppsCreateInstanceMSDeployOperationSlotResponse{} + resp, err := l.Poller.pt.PollUntilDone(ctx, freq, &respType.MSDeployStatus) + if err != nil { + return respType, err + } + respType.RawResponse = resp + return respType, nil +} + +// Resume rehydrates a WebAppsCreateInstanceMSDeployOperationSlotPollerResponse from the provided client and resume token. +func (l *WebAppsCreateInstanceMSDeployOperationSlotPollerResponse) Resume(ctx context.Context, client *WebAppsClient, token string) error { + pt, err := armruntime.NewPollerFromResumeToken("WebAppsClient.CreateInstanceMSDeployOperationSlot", token, client.pl, client.createInstanceMSDeployOperationSlotHandleError) + if err != nil { + return err + } + poller := &WebAppsCreateInstanceMSDeployOperationSlotPoller{ + pt: pt, + } + resp, err := poller.Poll(ctx) + if err != nil { + return err + } + l.Poller = poller + l.RawResponse = resp + return nil +} + +// WebAppsCreateInstanceMSDeployOperationSlotResponse contains the response from method WebApps.CreateInstanceMSDeployOperationSlot. +type WebAppsCreateInstanceMSDeployOperationSlotResponse struct { + WebAppsCreateInstanceMSDeployOperationSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsCreateInstanceMSDeployOperationSlotResult contains the result from method WebApps.CreateInstanceMSDeployOperationSlot. +type WebAppsCreateInstanceMSDeployOperationSlotResult struct { + MSDeployStatus +} + +// WebAppsCreateMSDeployOperationPollerResponse contains the response from method WebApps.CreateMSDeployOperation. +type WebAppsCreateMSDeployOperationPollerResponse struct { + // Poller contains an initialized poller. + Poller *WebAppsCreateMSDeployOperationPoller + + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. +// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. +// A good starting value is 30 seconds. Note that some resources might benefit from a different value. +func (l WebAppsCreateMSDeployOperationPollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (WebAppsCreateMSDeployOperationResponse, error) { + respType := WebAppsCreateMSDeployOperationResponse{} + resp, err := l.Poller.pt.PollUntilDone(ctx, freq, &respType.MSDeployStatus) + if err != nil { + return respType, err + } + respType.RawResponse = resp + return respType, nil +} + +// Resume rehydrates a WebAppsCreateMSDeployOperationPollerResponse from the provided client and resume token. +func (l *WebAppsCreateMSDeployOperationPollerResponse) Resume(ctx context.Context, client *WebAppsClient, token string) error { + pt, err := armruntime.NewPollerFromResumeToken("WebAppsClient.CreateMSDeployOperation", token, client.pl, client.createMSDeployOperationHandleError) + if err != nil { + return err + } + poller := &WebAppsCreateMSDeployOperationPoller{ + pt: pt, + } + resp, err := poller.Poll(ctx) + if err != nil { + return err + } + l.Poller = poller + l.RawResponse = resp + return nil +} + +// WebAppsCreateMSDeployOperationResponse contains the response from method WebApps.CreateMSDeployOperation. +type WebAppsCreateMSDeployOperationResponse struct { + WebAppsCreateMSDeployOperationResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsCreateMSDeployOperationResult contains the result from method WebApps.CreateMSDeployOperation. +type WebAppsCreateMSDeployOperationResult struct { + MSDeployStatus +} + +// WebAppsCreateMSDeployOperationSlotPollerResponse contains the response from method WebApps.CreateMSDeployOperationSlot. +type WebAppsCreateMSDeployOperationSlotPollerResponse struct { + // Poller contains an initialized poller. + Poller *WebAppsCreateMSDeployOperationSlotPoller + + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. +// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. +// A good starting value is 30 seconds. Note that some resources might benefit from a different value. +func (l WebAppsCreateMSDeployOperationSlotPollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (WebAppsCreateMSDeployOperationSlotResponse, error) { + respType := WebAppsCreateMSDeployOperationSlotResponse{} + resp, err := l.Poller.pt.PollUntilDone(ctx, freq, &respType.MSDeployStatus) + if err != nil { + return respType, err + } + respType.RawResponse = resp + return respType, nil +} + +// Resume rehydrates a WebAppsCreateMSDeployOperationSlotPollerResponse from the provided client and resume token. +func (l *WebAppsCreateMSDeployOperationSlotPollerResponse) Resume(ctx context.Context, client *WebAppsClient, token string) error { + pt, err := armruntime.NewPollerFromResumeToken("WebAppsClient.CreateMSDeployOperationSlot", token, client.pl, client.createMSDeployOperationSlotHandleError) + if err != nil { + return err + } + poller := &WebAppsCreateMSDeployOperationSlotPoller{ + pt: pt, + } + resp, err := poller.Poll(ctx) + if err != nil { + return err + } + l.Poller = poller + l.RawResponse = resp + return nil +} + +// WebAppsCreateMSDeployOperationSlotResponse contains the response from method WebApps.CreateMSDeployOperationSlot. +type WebAppsCreateMSDeployOperationSlotResponse struct { + WebAppsCreateMSDeployOperationSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsCreateMSDeployOperationSlotResult contains the result from method WebApps.CreateMSDeployOperationSlot. +type WebAppsCreateMSDeployOperationSlotResult struct { + MSDeployStatus +} + +// WebAppsCreateOrUpdateConfigurationResponse contains the response from method WebApps.CreateOrUpdateConfiguration. +type WebAppsCreateOrUpdateConfigurationResponse struct { + WebAppsCreateOrUpdateConfigurationResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsCreateOrUpdateConfigurationResult contains the result from method WebApps.CreateOrUpdateConfiguration. +type WebAppsCreateOrUpdateConfigurationResult struct { + SiteConfigResource +} + +// WebAppsCreateOrUpdateConfigurationSlotResponse contains the response from method WebApps.CreateOrUpdateConfigurationSlot. +type WebAppsCreateOrUpdateConfigurationSlotResponse struct { + WebAppsCreateOrUpdateConfigurationSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsCreateOrUpdateConfigurationSlotResult contains the result from method WebApps.CreateOrUpdateConfigurationSlot. +type WebAppsCreateOrUpdateConfigurationSlotResult struct { + SiteConfigResource +} + +// WebAppsCreateOrUpdateDomainOwnershipIdentifierResponse contains the response from method WebApps.CreateOrUpdateDomainOwnershipIdentifier. +type WebAppsCreateOrUpdateDomainOwnershipIdentifierResponse struct { + WebAppsCreateOrUpdateDomainOwnershipIdentifierResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsCreateOrUpdateDomainOwnershipIdentifierResult contains the result from method WebApps.CreateOrUpdateDomainOwnershipIdentifier. +type WebAppsCreateOrUpdateDomainOwnershipIdentifierResult struct { + Identifier +} + +// WebAppsCreateOrUpdateDomainOwnershipIdentifierSlotResponse contains the response from method WebApps.CreateOrUpdateDomainOwnershipIdentifierSlot. +type WebAppsCreateOrUpdateDomainOwnershipIdentifierSlotResponse struct { + WebAppsCreateOrUpdateDomainOwnershipIdentifierSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsCreateOrUpdateDomainOwnershipIdentifierSlotResult contains the result from method WebApps.CreateOrUpdateDomainOwnershipIdentifierSlot. +type WebAppsCreateOrUpdateDomainOwnershipIdentifierSlotResult struct { + Identifier +} + +// WebAppsCreateOrUpdateFunctionSecretResponse contains the response from method WebApps.CreateOrUpdateFunctionSecret. +type WebAppsCreateOrUpdateFunctionSecretResponse struct { + WebAppsCreateOrUpdateFunctionSecretResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsCreateOrUpdateFunctionSecretResult contains the result from method WebApps.CreateOrUpdateFunctionSecret. +type WebAppsCreateOrUpdateFunctionSecretResult struct { + KeyInfo +} + +// WebAppsCreateOrUpdateFunctionSecretSlotResponse contains the response from method WebApps.CreateOrUpdateFunctionSecretSlot. +type WebAppsCreateOrUpdateFunctionSecretSlotResponse struct { + WebAppsCreateOrUpdateFunctionSecretSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsCreateOrUpdateFunctionSecretSlotResult contains the result from method WebApps.CreateOrUpdateFunctionSecretSlot. +type WebAppsCreateOrUpdateFunctionSecretSlotResult struct { + KeyInfo +} + +// WebAppsCreateOrUpdateHostNameBindingResponse contains the response from method WebApps.CreateOrUpdateHostNameBinding. +type WebAppsCreateOrUpdateHostNameBindingResponse struct { + WebAppsCreateOrUpdateHostNameBindingResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsCreateOrUpdateHostNameBindingResult contains the result from method WebApps.CreateOrUpdateHostNameBinding. +type WebAppsCreateOrUpdateHostNameBindingResult struct { + HostNameBinding +} + +// WebAppsCreateOrUpdateHostNameBindingSlotResponse contains the response from method WebApps.CreateOrUpdateHostNameBindingSlot. +type WebAppsCreateOrUpdateHostNameBindingSlotResponse struct { + WebAppsCreateOrUpdateHostNameBindingSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsCreateOrUpdateHostNameBindingSlotResult contains the result from method WebApps.CreateOrUpdateHostNameBindingSlot. +type WebAppsCreateOrUpdateHostNameBindingSlotResult struct { + HostNameBinding +} + +// WebAppsCreateOrUpdateHostSecretResponse contains the response from method WebApps.CreateOrUpdateHostSecret. +type WebAppsCreateOrUpdateHostSecretResponse struct { + WebAppsCreateOrUpdateHostSecretResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsCreateOrUpdateHostSecretResult contains the result from method WebApps.CreateOrUpdateHostSecret. +type WebAppsCreateOrUpdateHostSecretResult struct { + KeyInfo +} + +// WebAppsCreateOrUpdateHostSecretSlotResponse contains the response from method WebApps.CreateOrUpdateHostSecretSlot. +type WebAppsCreateOrUpdateHostSecretSlotResponse struct { + WebAppsCreateOrUpdateHostSecretSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsCreateOrUpdateHostSecretSlotResult contains the result from method WebApps.CreateOrUpdateHostSecretSlot. +type WebAppsCreateOrUpdateHostSecretSlotResult struct { + KeyInfo +} + +// WebAppsCreateOrUpdateHybridConnectionResponse contains the response from method WebApps.CreateOrUpdateHybridConnection. +type WebAppsCreateOrUpdateHybridConnectionResponse struct { + WebAppsCreateOrUpdateHybridConnectionResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsCreateOrUpdateHybridConnectionResult contains the result from method WebApps.CreateOrUpdateHybridConnection. +type WebAppsCreateOrUpdateHybridConnectionResult struct { + HybridConnection +} + +// WebAppsCreateOrUpdateHybridConnectionSlotResponse contains the response from method WebApps.CreateOrUpdateHybridConnectionSlot. +type WebAppsCreateOrUpdateHybridConnectionSlotResponse struct { + WebAppsCreateOrUpdateHybridConnectionSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsCreateOrUpdateHybridConnectionSlotResult contains the result from method WebApps.CreateOrUpdateHybridConnectionSlot. +type WebAppsCreateOrUpdateHybridConnectionSlotResult struct { + HybridConnection +} + +// WebAppsCreateOrUpdatePollerResponse contains the response from method WebApps.CreateOrUpdate. +type WebAppsCreateOrUpdatePollerResponse struct { + // Poller contains an initialized poller. + Poller *WebAppsCreateOrUpdatePoller + + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. +// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. +// A good starting value is 30 seconds. Note that some resources might benefit from a different value. +func (l WebAppsCreateOrUpdatePollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (WebAppsCreateOrUpdateResponse, error) { + respType := WebAppsCreateOrUpdateResponse{} + resp, err := l.Poller.pt.PollUntilDone(ctx, freq, &respType.Site) + if err != nil { + return respType, err + } + respType.RawResponse = resp + return respType, nil +} + +// Resume rehydrates a WebAppsCreateOrUpdatePollerResponse from the provided client and resume token. +func (l *WebAppsCreateOrUpdatePollerResponse) Resume(ctx context.Context, client *WebAppsClient, token string) error { + pt, err := armruntime.NewPollerFromResumeToken("WebAppsClient.CreateOrUpdate", token, client.pl, client.createOrUpdateHandleError) + if err != nil { + return err + } + poller := &WebAppsCreateOrUpdatePoller{ + pt: pt, + } + resp, err := poller.Poll(ctx) + if err != nil { + return err + } + l.Poller = poller + l.RawResponse = resp + return nil +} + +// WebAppsCreateOrUpdatePublicCertificateResponse contains the response from method WebApps.CreateOrUpdatePublicCertificate. +type WebAppsCreateOrUpdatePublicCertificateResponse struct { + WebAppsCreateOrUpdatePublicCertificateResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsCreateOrUpdatePublicCertificateResult contains the result from method WebApps.CreateOrUpdatePublicCertificate. +type WebAppsCreateOrUpdatePublicCertificateResult struct { + PublicCertificate +} + +// WebAppsCreateOrUpdatePublicCertificateSlotResponse contains the response from method WebApps.CreateOrUpdatePublicCertificateSlot. +type WebAppsCreateOrUpdatePublicCertificateSlotResponse struct { + WebAppsCreateOrUpdatePublicCertificateSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsCreateOrUpdatePublicCertificateSlotResult contains the result from method WebApps.CreateOrUpdatePublicCertificateSlot. +type WebAppsCreateOrUpdatePublicCertificateSlotResult struct { + PublicCertificate +} + +// WebAppsCreateOrUpdateRelayServiceConnectionResponse contains the response from method WebApps.CreateOrUpdateRelayServiceConnection. +type WebAppsCreateOrUpdateRelayServiceConnectionResponse struct { + WebAppsCreateOrUpdateRelayServiceConnectionResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsCreateOrUpdateRelayServiceConnectionResult contains the result from method WebApps.CreateOrUpdateRelayServiceConnection. +type WebAppsCreateOrUpdateRelayServiceConnectionResult struct { + RelayServiceConnectionEntity +} + +// WebAppsCreateOrUpdateRelayServiceConnectionSlotResponse contains the response from method WebApps.CreateOrUpdateRelayServiceConnectionSlot. +type WebAppsCreateOrUpdateRelayServiceConnectionSlotResponse struct { + WebAppsCreateOrUpdateRelayServiceConnectionSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsCreateOrUpdateRelayServiceConnectionSlotResult contains the result from method WebApps.CreateOrUpdateRelayServiceConnectionSlot. +type WebAppsCreateOrUpdateRelayServiceConnectionSlotResult struct { + RelayServiceConnectionEntity +} + +// WebAppsCreateOrUpdateResponse contains the response from method WebApps.CreateOrUpdate. +type WebAppsCreateOrUpdateResponse struct { + WebAppsCreateOrUpdateResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsCreateOrUpdateResult contains the result from method WebApps.CreateOrUpdate. +type WebAppsCreateOrUpdateResult struct { + Site +} + +// WebAppsCreateOrUpdateSlotPollerResponse contains the response from method WebApps.CreateOrUpdateSlot. +type WebAppsCreateOrUpdateSlotPollerResponse struct { + // Poller contains an initialized poller. + Poller *WebAppsCreateOrUpdateSlotPoller + + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. +// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. +// A good starting value is 30 seconds. Note that some resources might benefit from a different value. +func (l WebAppsCreateOrUpdateSlotPollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (WebAppsCreateOrUpdateSlotResponse, error) { + respType := WebAppsCreateOrUpdateSlotResponse{} + resp, err := l.Poller.pt.PollUntilDone(ctx, freq, &respType.Site) + if err != nil { + return respType, err + } + respType.RawResponse = resp + return respType, nil +} + +// Resume rehydrates a WebAppsCreateOrUpdateSlotPollerResponse from the provided client and resume token. +func (l *WebAppsCreateOrUpdateSlotPollerResponse) Resume(ctx context.Context, client *WebAppsClient, token string) error { + pt, err := armruntime.NewPollerFromResumeToken("WebAppsClient.CreateOrUpdateSlot", token, client.pl, client.createOrUpdateSlotHandleError) + if err != nil { + return err + } + poller := &WebAppsCreateOrUpdateSlotPoller{ + pt: pt, + } + resp, err := poller.Poll(ctx) + if err != nil { + return err + } + l.Poller = poller + l.RawResponse = resp + return nil +} + +// WebAppsCreateOrUpdateSlotResponse contains the response from method WebApps.CreateOrUpdateSlot. +type WebAppsCreateOrUpdateSlotResponse struct { + WebAppsCreateOrUpdateSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsCreateOrUpdateSlotResult contains the result from method WebApps.CreateOrUpdateSlot. +type WebAppsCreateOrUpdateSlotResult struct { + Site +} + +// WebAppsCreateOrUpdateSourceControlPollerResponse contains the response from method WebApps.CreateOrUpdateSourceControl. +type WebAppsCreateOrUpdateSourceControlPollerResponse struct { + // Poller contains an initialized poller. + Poller *WebAppsCreateOrUpdateSourceControlPoller + + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. +// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. +// A good starting value is 30 seconds. Note that some resources might benefit from a different value. +func (l WebAppsCreateOrUpdateSourceControlPollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (WebAppsCreateOrUpdateSourceControlResponse, error) { + respType := WebAppsCreateOrUpdateSourceControlResponse{} + resp, err := l.Poller.pt.PollUntilDone(ctx, freq, &respType.SiteSourceControl) + if err != nil { + return respType, err + } + respType.RawResponse = resp + return respType, nil +} + +// Resume rehydrates a WebAppsCreateOrUpdateSourceControlPollerResponse from the provided client and resume token. +func (l *WebAppsCreateOrUpdateSourceControlPollerResponse) Resume(ctx context.Context, client *WebAppsClient, token string) error { + pt, err := armruntime.NewPollerFromResumeToken("WebAppsClient.CreateOrUpdateSourceControl", token, client.pl, client.createOrUpdateSourceControlHandleError) + if err != nil { + return err + } + poller := &WebAppsCreateOrUpdateSourceControlPoller{ + pt: pt, + } + resp, err := poller.Poll(ctx) + if err != nil { + return err + } + l.Poller = poller + l.RawResponse = resp + return nil +} + +// WebAppsCreateOrUpdateSourceControlResponse contains the response from method WebApps.CreateOrUpdateSourceControl. +type WebAppsCreateOrUpdateSourceControlResponse struct { + WebAppsCreateOrUpdateSourceControlResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsCreateOrUpdateSourceControlResult contains the result from method WebApps.CreateOrUpdateSourceControl. +type WebAppsCreateOrUpdateSourceControlResult struct { + SiteSourceControl +} + +// WebAppsCreateOrUpdateSourceControlSlotPollerResponse contains the response from method WebApps.CreateOrUpdateSourceControlSlot. +type WebAppsCreateOrUpdateSourceControlSlotPollerResponse struct { + // Poller contains an initialized poller. + Poller *WebAppsCreateOrUpdateSourceControlSlotPoller + + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. +// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. +// A good starting value is 30 seconds. Note that some resources might benefit from a different value. +func (l WebAppsCreateOrUpdateSourceControlSlotPollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (WebAppsCreateOrUpdateSourceControlSlotResponse, error) { + respType := WebAppsCreateOrUpdateSourceControlSlotResponse{} + resp, err := l.Poller.pt.PollUntilDone(ctx, freq, &respType.SiteSourceControl) + if err != nil { + return respType, err + } + respType.RawResponse = resp + return respType, nil +} + +// Resume rehydrates a WebAppsCreateOrUpdateSourceControlSlotPollerResponse from the provided client and resume token. +func (l *WebAppsCreateOrUpdateSourceControlSlotPollerResponse) Resume(ctx context.Context, client *WebAppsClient, token string) error { + pt, err := armruntime.NewPollerFromResumeToken("WebAppsClient.CreateOrUpdateSourceControlSlot", token, client.pl, client.createOrUpdateSourceControlSlotHandleError) + if err != nil { + return err + } + poller := &WebAppsCreateOrUpdateSourceControlSlotPoller{ + pt: pt, + } + resp, err := poller.Poll(ctx) + if err != nil { + return err + } + l.Poller = poller + l.RawResponse = resp + return nil +} + +// WebAppsCreateOrUpdateSourceControlSlotResponse contains the response from method WebApps.CreateOrUpdateSourceControlSlot. +type WebAppsCreateOrUpdateSourceControlSlotResponse struct { + WebAppsCreateOrUpdateSourceControlSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsCreateOrUpdateSourceControlSlotResult contains the result from method WebApps.CreateOrUpdateSourceControlSlot. +type WebAppsCreateOrUpdateSourceControlSlotResult struct { + SiteSourceControl +} + +// WebAppsCreateOrUpdateSwiftVirtualNetworkConnectionWithCheckResponse contains the response from method WebApps.CreateOrUpdateSwiftVirtualNetworkConnectionWithCheck. +type WebAppsCreateOrUpdateSwiftVirtualNetworkConnectionWithCheckResponse struct { + WebAppsCreateOrUpdateSwiftVirtualNetworkConnectionWithCheckResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsCreateOrUpdateSwiftVirtualNetworkConnectionWithCheckResult contains the result from method WebApps.CreateOrUpdateSwiftVirtualNetworkConnectionWithCheck. +type WebAppsCreateOrUpdateSwiftVirtualNetworkConnectionWithCheckResult struct { + SwiftVirtualNetwork +} + +// WebAppsCreateOrUpdateSwiftVirtualNetworkConnectionWithCheckSlotResponse contains the response from method WebApps.CreateOrUpdateSwiftVirtualNetworkConnectionWithCheckSlot. +type WebAppsCreateOrUpdateSwiftVirtualNetworkConnectionWithCheckSlotResponse struct { + WebAppsCreateOrUpdateSwiftVirtualNetworkConnectionWithCheckSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsCreateOrUpdateSwiftVirtualNetworkConnectionWithCheckSlotResult contains the result from method WebApps.CreateOrUpdateSwiftVirtualNetworkConnectionWithCheckSlot. +type WebAppsCreateOrUpdateSwiftVirtualNetworkConnectionWithCheckSlotResult struct { + SwiftVirtualNetwork +} + +// WebAppsCreateOrUpdateVnetConnectionGatewayResponse contains the response from method WebApps.CreateOrUpdateVnetConnectionGateway. +type WebAppsCreateOrUpdateVnetConnectionGatewayResponse struct { + WebAppsCreateOrUpdateVnetConnectionGatewayResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsCreateOrUpdateVnetConnectionGatewayResult contains the result from method WebApps.CreateOrUpdateVnetConnectionGateway. +type WebAppsCreateOrUpdateVnetConnectionGatewayResult struct { + VnetGateway +} + +// WebAppsCreateOrUpdateVnetConnectionGatewaySlotResponse contains the response from method WebApps.CreateOrUpdateVnetConnectionGatewaySlot. +type WebAppsCreateOrUpdateVnetConnectionGatewaySlotResponse struct { + WebAppsCreateOrUpdateVnetConnectionGatewaySlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsCreateOrUpdateVnetConnectionGatewaySlotResult contains the result from method WebApps.CreateOrUpdateVnetConnectionGatewaySlot. +type WebAppsCreateOrUpdateVnetConnectionGatewaySlotResult struct { + VnetGateway +} + +// WebAppsCreateOrUpdateVnetConnectionResponse contains the response from method WebApps.CreateOrUpdateVnetConnection. +type WebAppsCreateOrUpdateVnetConnectionResponse struct { + WebAppsCreateOrUpdateVnetConnectionResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsCreateOrUpdateVnetConnectionResult contains the result from method WebApps.CreateOrUpdateVnetConnection. +type WebAppsCreateOrUpdateVnetConnectionResult struct { + VnetInfoResource +} + +// WebAppsCreateOrUpdateVnetConnectionSlotResponse contains the response from method WebApps.CreateOrUpdateVnetConnectionSlot. +type WebAppsCreateOrUpdateVnetConnectionSlotResponse struct { + WebAppsCreateOrUpdateVnetConnectionSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsCreateOrUpdateVnetConnectionSlotResult contains the result from method WebApps.CreateOrUpdateVnetConnectionSlot. +type WebAppsCreateOrUpdateVnetConnectionSlotResult struct { + VnetInfoResource +} + +// WebAppsDeleteBackupConfigurationResponse contains the response from method WebApps.DeleteBackupConfiguration. +type WebAppsDeleteBackupConfigurationResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsDeleteBackupConfigurationSlotResponse contains the response from method WebApps.DeleteBackupConfigurationSlot. +type WebAppsDeleteBackupConfigurationSlotResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsDeleteBackupResponse contains the response from method WebApps.DeleteBackup. +type WebAppsDeleteBackupResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsDeleteBackupSlotResponse contains the response from method WebApps.DeleteBackupSlot. +type WebAppsDeleteBackupSlotResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsDeleteContinuousWebJobResponse contains the response from method WebApps.DeleteContinuousWebJob. +type WebAppsDeleteContinuousWebJobResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsDeleteContinuousWebJobSlotResponse contains the response from method WebApps.DeleteContinuousWebJobSlot. +type WebAppsDeleteContinuousWebJobSlotResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsDeleteDeploymentResponse contains the response from method WebApps.DeleteDeployment. +type WebAppsDeleteDeploymentResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsDeleteDeploymentSlotResponse contains the response from method WebApps.DeleteDeploymentSlot. +type WebAppsDeleteDeploymentSlotResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsDeleteDomainOwnershipIdentifierResponse contains the response from method WebApps.DeleteDomainOwnershipIdentifier. +type WebAppsDeleteDomainOwnershipIdentifierResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsDeleteDomainOwnershipIdentifierSlotResponse contains the response from method WebApps.DeleteDomainOwnershipIdentifierSlot. +type WebAppsDeleteDomainOwnershipIdentifierSlotResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsDeleteFunctionResponse contains the response from method WebApps.DeleteFunction. +type WebAppsDeleteFunctionResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsDeleteFunctionSecretResponse contains the response from method WebApps.DeleteFunctionSecret. +type WebAppsDeleteFunctionSecretResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsDeleteFunctionSecretSlotResponse contains the response from method WebApps.DeleteFunctionSecretSlot. +type WebAppsDeleteFunctionSecretSlotResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsDeleteHostNameBindingResponse contains the response from method WebApps.DeleteHostNameBinding. +type WebAppsDeleteHostNameBindingResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsDeleteHostNameBindingSlotResponse contains the response from method WebApps.DeleteHostNameBindingSlot. +type WebAppsDeleteHostNameBindingSlotResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsDeleteHostSecretResponse contains the response from method WebApps.DeleteHostSecret. +type WebAppsDeleteHostSecretResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsDeleteHostSecretSlotResponse contains the response from method WebApps.DeleteHostSecretSlot. +type WebAppsDeleteHostSecretSlotResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsDeleteHybridConnectionResponse contains the response from method WebApps.DeleteHybridConnection. +type WebAppsDeleteHybridConnectionResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsDeleteHybridConnectionSlotResponse contains the response from method WebApps.DeleteHybridConnectionSlot. +type WebAppsDeleteHybridConnectionSlotResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsDeleteInstanceFunctionSlotResponse contains the response from method WebApps.DeleteInstanceFunctionSlot. +type WebAppsDeleteInstanceFunctionSlotResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsDeleteInstanceProcessResponse contains the response from method WebApps.DeleteInstanceProcess. +type WebAppsDeleteInstanceProcessResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsDeleteInstanceProcessSlotResponse contains the response from method WebApps.DeleteInstanceProcessSlot. +type WebAppsDeleteInstanceProcessSlotResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsDeletePremierAddOnResponse contains the response from method WebApps.DeletePremierAddOn. +type WebAppsDeletePremierAddOnResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsDeletePremierAddOnSlotResponse contains the response from method WebApps.DeletePremierAddOnSlot. +type WebAppsDeletePremierAddOnSlotResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsDeletePrivateEndpointConnectionPollerResponse contains the response from method WebApps.DeletePrivateEndpointConnection. +type WebAppsDeletePrivateEndpointConnectionPollerResponse struct { + // Poller contains an initialized poller. + Poller *WebAppsDeletePrivateEndpointConnectionPoller + + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. +// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. +// A good starting value is 30 seconds. Note that some resources might benefit from a different value. +func (l WebAppsDeletePrivateEndpointConnectionPollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (WebAppsDeletePrivateEndpointConnectionResponse, error) { + respType := WebAppsDeletePrivateEndpointConnectionResponse{} + resp, err := l.Poller.pt.PollUntilDone(ctx, freq, &respType.Object) + if err != nil { + return respType, err + } + respType.RawResponse = resp + return respType, nil +} + +// Resume rehydrates a WebAppsDeletePrivateEndpointConnectionPollerResponse from the provided client and resume token. +func (l *WebAppsDeletePrivateEndpointConnectionPollerResponse) Resume(ctx context.Context, client *WebAppsClient, token string) error { + pt, err := armruntime.NewPollerFromResumeToken("WebAppsClient.DeletePrivateEndpointConnection", token, client.pl, client.deletePrivateEndpointConnectionHandleError) + if err != nil { + return err + } + poller := &WebAppsDeletePrivateEndpointConnectionPoller{ + pt: pt, + } + resp, err := poller.Poll(ctx) + if err != nil { + return err + } + l.Poller = poller + l.RawResponse = resp + return nil +} + +// WebAppsDeletePrivateEndpointConnectionResponse contains the response from method WebApps.DeletePrivateEndpointConnection. +type WebAppsDeletePrivateEndpointConnectionResponse struct { + WebAppsDeletePrivateEndpointConnectionResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsDeletePrivateEndpointConnectionResult contains the result from method WebApps.DeletePrivateEndpointConnection. +type WebAppsDeletePrivateEndpointConnectionResult struct { + // Any object + Object map[string]interface{} +} + +// WebAppsDeletePrivateEndpointConnectionSlotPollerResponse contains the response from method WebApps.DeletePrivateEndpointConnectionSlot. +type WebAppsDeletePrivateEndpointConnectionSlotPollerResponse struct { + // Poller contains an initialized poller. + Poller *WebAppsDeletePrivateEndpointConnectionSlotPoller + + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. +// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. +// A good starting value is 30 seconds. Note that some resources might benefit from a different value. +func (l WebAppsDeletePrivateEndpointConnectionSlotPollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (WebAppsDeletePrivateEndpointConnectionSlotResponse, error) { + respType := WebAppsDeletePrivateEndpointConnectionSlotResponse{} + resp, err := l.Poller.pt.PollUntilDone(ctx, freq, &respType.Object) + if err != nil { + return respType, err + } + respType.RawResponse = resp + return respType, nil +} + +// Resume rehydrates a WebAppsDeletePrivateEndpointConnectionSlotPollerResponse from the provided client and resume token. +func (l *WebAppsDeletePrivateEndpointConnectionSlotPollerResponse) Resume(ctx context.Context, client *WebAppsClient, token string) error { + pt, err := armruntime.NewPollerFromResumeToken("WebAppsClient.DeletePrivateEndpointConnectionSlot", token, client.pl, client.deletePrivateEndpointConnectionSlotHandleError) + if err != nil { + return err + } + poller := &WebAppsDeletePrivateEndpointConnectionSlotPoller{ + pt: pt, + } + resp, err := poller.Poll(ctx) + if err != nil { + return err + } + l.Poller = poller + l.RawResponse = resp + return nil +} + +// WebAppsDeletePrivateEndpointConnectionSlotResponse contains the response from method WebApps.DeletePrivateEndpointConnectionSlot. +type WebAppsDeletePrivateEndpointConnectionSlotResponse struct { + WebAppsDeletePrivateEndpointConnectionSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsDeletePrivateEndpointConnectionSlotResult contains the result from method WebApps.DeletePrivateEndpointConnectionSlot. +type WebAppsDeletePrivateEndpointConnectionSlotResult struct { + // Any object + Object map[string]interface{} +} + +// WebAppsDeleteProcessResponse contains the response from method WebApps.DeleteProcess. +type WebAppsDeleteProcessResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsDeleteProcessSlotResponse contains the response from method WebApps.DeleteProcessSlot. +type WebAppsDeleteProcessSlotResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsDeletePublicCertificateResponse contains the response from method WebApps.DeletePublicCertificate. +type WebAppsDeletePublicCertificateResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsDeletePublicCertificateSlotResponse contains the response from method WebApps.DeletePublicCertificateSlot. +type WebAppsDeletePublicCertificateSlotResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsDeleteRelayServiceConnectionResponse contains the response from method WebApps.DeleteRelayServiceConnection. +type WebAppsDeleteRelayServiceConnectionResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsDeleteRelayServiceConnectionSlotResponse contains the response from method WebApps.DeleteRelayServiceConnectionSlot. +type WebAppsDeleteRelayServiceConnectionSlotResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsDeleteResponse contains the response from method WebApps.Delete. +type WebAppsDeleteResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsDeleteSiteExtensionResponse contains the response from method WebApps.DeleteSiteExtension. +type WebAppsDeleteSiteExtensionResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsDeleteSiteExtensionSlotResponse contains the response from method WebApps.DeleteSiteExtensionSlot. +type WebAppsDeleteSiteExtensionSlotResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsDeleteSlotResponse contains the response from method WebApps.DeleteSlot. +type WebAppsDeleteSlotResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsDeleteSourceControlResponse contains the response from method WebApps.DeleteSourceControl. +type WebAppsDeleteSourceControlResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsDeleteSourceControlSlotResponse contains the response from method WebApps.DeleteSourceControlSlot. +type WebAppsDeleteSourceControlSlotResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsDeleteSwiftVirtualNetworkResponse contains the response from method WebApps.DeleteSwiftVirtualNetwork. +type WebAppsDeleteSwiftVirtualNetworkResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsDeleteSwiftVirtualNetworkSlotResponse contains the response from method WebApps.DeleteSwiftVirtualNetworkSlot. +type WebAppsDeleteSwiftVirtualNetworkSlotResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsDeleteTriggeredWebJobResponse contains the response from method WebApps.DeleteTriggeredWebJob. +type WebAppsDeleteTriggeredWebJobResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsDeleteTriggeredWebJobSlotResponse contains the response from method WebApps.DeleteTriggeredWebJobSlot. +type WebAppsDeleteTriggeredWebJobSlotResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsDeleteVnetConnectionResponse contains the response from method WebApps.DeleteVnetConnection. +type WebAppsDeleteVnetConnectionResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsDeleteVnetConnectionSlotResponse contains the response from method WebApps.DeleteVnetConnectionSlot. +type WebAppsDeleteVnetConnectionSlotResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsDiscoverBackupResponse contains the response from method WebApps.DiscoverBackup. +type WebAppsDiscoverBackupResponse struct { + WebAppsDiscoverBackupResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsDiscoverBackupResult contains the result from method WebApps.DiscoverBackup. +type WebAppsDiscoverBackupResult struct { + RestoreRequest +} + +// WebAppsDiscoverBackupSlotResponse contains the response from method WebApps.DiscoverBackupSlot. +type WebAppsDiscoverBackupSlotResponse struct { + WebAppsDiscoverBackupSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsDiscoverBackupSlotResult contains the result from method WebApps.DiscoverBackupSlot. +type WebAppsDiscoverBackupSlotResult struct { + RestoreRequest +} + +// WebAppsGenerateNewSitePublishingPasswordResponse contains the response from method WebApps.GenerateNewSitePublishingPassword. +type WebAppsGenerateNewSitePublishingPasswordResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsGenerateNewSitePublishingPasswordSlotResponse contains the response from method WebApps.GenerateNewSitePublishingPasswordSlot. +type WebAppsGenerateNewSitePublishingPasswordSlotResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsGetAppSettingKeyVaultReferenceResponse contains the response from method WebApps.GetAppSettingKeyVaultReference. +type WebAppsGetAppSettingKeyVaultReferenceResponse struct { + WebAppsGetAppSettingKeyVaultReferenceResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsGetAppSettingKeyVaultReferenceResult contains the result from method WebApps.GetAppSettingKeyVaultReference. +type WebAppsGetAppSettingKeyVaultReferenceResult struct { + APIKVReference +} + +// WebAppsGetAppSettingKeyVaultReferenceSlotResponse contains the response from method WebApps.GetAppSettingKeyVaultReferenceSlot. +type WebAppsGetAppSettingKeyVaultReferenceSlotResponse struct { + WebAppsGetAppSettingKeyVaultReferenceSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsGetAppSettingKeyVaultReferenceSlotResult contains the result from method WebApps.GetAppSettingKeyVaultReferenceSlot. +type WebAppsGetAppSettingKeyVaultReferenceSlotResult struct { + APIKVReference +} + +// WebAppsGetAppSettingsKeyVaultReferencesResponse contains the response from method WebApps.GetAppSettingsKeyVaultReferences. +type WebAppsGetAppSettingsKeyVaultReferencesResponse struct { + WebAppsGetAppSettingsKeyVaultReferencesResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsGetAppSettingsKeyVaultReferencesResult contains the result from method WebApps.GetAppSettingsKeyVaultReferences. +type WebAppsGetAppSettingsKeyVaultReferencesResult struct { + APIKVReferenceCollection +} + +// WebAppsGetAppSettingsKeyVaultReferencesSlotResponse contains the response from method WebApps.GetAppSettingsKeyVaultReferencesSlot. +type WebAppsGetAppSettingsKeyVaultReferencesSlotResponse struct { + WebAppsGetAppSettingsKeyVaultReferencesSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsGetAppSettingsKeyVaultReferencesSlotResult contains the result from method WebApps.GetAppSettingsKeyVaultReferencesSlot. +type WebAppsGetAppSettingsKeyVaultReferencesSlotResult struct { + APIKVReferenceCollection +} + +// WebAppsGetAuthSettingsResponse contains the response from method WebApps.GetAuthSettings. +type WebAppsGetAuthSettingsResponse struct { + WebAppsGetAuthSettingsResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsGetAuthSettingsResult contains the result from method WebApps.GetAuthSettings. +type WebAppsGetAuthSettingsResult struct { + SiteAuthSettings +} + +// WebAppsGetAuthSettingsSlotResponse contains the response from method WebApps.GetAuthSettingsSlot. +type WebAppsGetAuthSettingsSlotResponse struct { + WebAppsGetAuthSettingsSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsGetAuthSettingsSlotResult contains the result from method WebApps.GetAuthSettingsSlot. +type WebAppsGetAuthSettingsSlotResult struct { + SiteAuthSettings +} + +// WebAppsGetAuthSettingsV2Response contains the response from method WebApps.GetAuthSettingsV2. +type WebAppsGetAuthSettingsV2Response struct { + WebAppsGetAuthSettingsV2Result + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsGetAuthSettingsV2Result contains the result from method WebApps.GetAuthSettingsV2. +type WebAppsGetAuthSettingsV2Result struct { + SiteAuthSettingsV2 +} + +// WebAppsGetAuthSettingsV2SlotResponse contains the response from method WebApps.GetAuthSettingsV2Slot. +type WebAppsGetAuthSettingsV2SlotResponse struct { + WebAppsGetAuthSettingsV2SlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsGetAuthSettingsV2SlotResult contains the result from method WebApps.GetAuthSettingsV2Slot. +type WebAppsGetAuthSettingsV2SlotResult struct { + SiteAuthSettingsV2 +} + +// WebAppsGetBackupConfigurationResponse contains the response from method WebApps.GetBackupConfiguration. +type WebAppsGetBackupConfigurationResponse struct { + WebAppsGetBackupConfigurationResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsGetBackupConfigurationResult contains the result from method WebApps.GetBackupConfiguration. +type WebAppsGetBackupConfigurationResult struct { + BackupRequest +} + +// WebAppsGetBackupConfigurationSlotResponse contains the response from method WebApps.GetBackupConfigurationSlot. +type WebAppsGetBackupConfigurationSlotResponse struct { + WebAppsGetBackupConfigurationSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsGetBackupConfigurationSlotResult contains the result from method WebApps.GetBackupConfigurationSlot. +type WebAppsGetBackupConfigurationSlotResult struct { + BackupRequest +} + +// WebAppsGetBackupStatusResponse contains the response from method WebApps.GetBackupStatus. +type WebAppsGetBackupStatusResponse struct { + WebAppsGetBackupStatusResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsGetBackupStatusResult contains the result from method WebApps.GetBackupStatus. +type WebAppsGetBackupStatusResult struct { + BackupItem +} + +// WebAppsGetBackupStatusSlotResponse contains the response from method WebApps.GetBackupStatusSlot. +type WebAppsGetBackupStatusSlotResponse struct { + WebAppsGetBackupStatusSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsGetBackupStatusSlotResult contains the result from method WebApps.GetBackupStatusSlot. +type WebAppsGetBackupStatusSlotResult struct { + BackupItem +} + +// WebAppsGetConfigurationResponse contains the response from method WebApps.GetConfiguration. +type WebAppsGetConfigurationResponse struct { + WebAppsGetConfigurationResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsGetConfigurationResult contains the result from method WebApps.GetConfiguration. +type WebAppsGetConfigurationResult struct { + SiteConfigResource +} + +// WebAppsGetConfigurationSlotResponse contains the response from method WebApps.GetConfigurationSlot. +type WebAppsGetConfigurationSlotResponse struct { + WebAppsGetConfigurationSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsGetConfigurationSlotResult contains the result from method WebApps.GetConfigurationSlot. +type WebAppsGetConfigurationSlotResult struct { + SiteConfigResource +} + +// WebAppsGetConfigurationSnapshotResponse contains the response from method WebApps.GetConfigurationSnapshot. +type WebAppsGetConfigurationSnapshotResponse struct { + WebAppsGetConfigurationSnapshotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsGetConfigurationSnapshotResult contains the result from method WebApps.GetConfigurationSnapshot. +type WebAppsGetConfigurationSnapshotResult struct { + SiteConfigResource +} + +// WebAppsGetConfigurationSnapshotSlotResponse contains the response from method WebApps.GetConfigurationSnapshotSlot. +type WebAppsGetConfigurationSnapshotSlotResponse struct { + WebAppsGetConfigurationSnapshotSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsGetConfigurationSnapshotSlotResult contains the result from method WebApps.GetConfigurationSnapshotSlot. +type WebAppsGetConfigurationSnapshotSlotResult struct { + SiteConfigResource +} + +// WebAppsGetContainerLogsZipResponse contains the response from method WebApps.GetContainerLogsZip. +type WebAppsGetContainerLogsZipResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsGetContainerLogsZipSlotResponse contains the response from method WebApps.GetContainerLogsZipSlot. +type WebAppsGetContainerLogsZipSlotResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsGetContinuousWebJobResponse contains the response from method WebApps.GetContinuousWebJob. +type WebAppsGetContinuousWebJobResponse struct { + WebAppsGetContinuousWebJobResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsGetContinuousWebJobResult contains the result from method WebApps.GetContinuousWebJob. +type WebAppsGetContinuousWebJobResult struct { + ContinuousWebJob +} + +// WebAppsGetContinuousWebJobSlotResponse contains the response from method WebApps.GetContinuousWebJobSlot. +type WebAppsGetContinuousWebJobSlotResponse struct { + WebAppsGetContinuousWebJobSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsGetContinuousWebJobSlotResult contains the result from method WebApps.GetContinuousWebJobSlot. +type WebAppsGetContinuousWebJobSlotResult struct { + ContinuousWebJob +} + +// WebAppsGetDeploymentResponse contains the response from method WebApps.GetDeployment. +type WebAppsGetDeploymentResponse struct { + WebAppsGetDeploymentResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsGetDeploymentResult contains the result from method WebApps.GetDeployment. +type WebAppsGetDeploymentResult struct { + Deployment +} + +// WebAppsGetDeploymentSlotResponse contains the response from method WebApps.GetDeploymentSlot. +type WebAppsGetDeploymentSlotResponse struct { + WebAppsGetDeploymentSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsGetDeploymentSlotResult contains the result from method WebApps.GetDeploymentSlot. +type WebAppsGetDeploymentSlotResult struct { + Deployment +} + +// WebAppsGetDiagnosticLogsConfigurationResponse contains the response from method WebApps.GetDiagnosticLogsConfiguration. +type WebAppsGetDiagnosticLogsConfigurationResponse struct { + WebAppsGetDiagnosticLogsConfigurationResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsGetDiagnosticLogsConfigurationResult contains the result from method WebApps.GetDiagnosticLogsConfiguration. +type WebAppsGetDiagnosticLogsConfigurationResult struct { + SiteLogsConfig +} + +// WebAppsGetDiagnosticLogsConfigurationSlotResponse contains the response from method WebApps.GetDiagnosticLogsConfigurationSlot. +type WebAppsGetDiagnosticLogsConfigurationSlotResponse struct { + WebAppsGetDiagnosticLogsConfigurationSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsGetDiagnosticLogsConfigurationSlotResult contains the result from method WebApps.GetDiagnosticLogsConfigurationSlot. +type WebAppsGetDiagnosticLogsConfigurationSlotResult struct { + SiteLogsConfig +} + +// WebAppsGetDomainOwnershipIdentifierResponse contains the response from method WebApps.GetDomainOwnershipIdentifier. +type WebAppsGetDomainOwnershipIdentifierResponse struct { + WebAppsGetDomainOwnershipIdentifierResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsGetDomainOwnershipIdentifierResult contains the result from method WebApps.GetDomainOwnershipIdentifier. +type WebAppsGetDomainOwnershipIdentifierResult struct { + Identifier +} + +// WebAppsGetDomainOwnershipIdentifierSlotResponse contains the response from method WebApps.GetDomainOwnershipIdentifierSlot. +type WebAppsGetDomainOwnershipIdentifierSlotResponse struct { + WebAppsGetDomainOwnershipIdentifierSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsGetDomainOwnershipIdentifierSlotResult contains the result from method WebApps.GetDomainOwnershipIdentifierSlot. +type WebAppsGetDomainOwnershipIdentifierSlotResult struct { + Identifier +} + +// WebAppsGetFtpAllowedResponse contains the response from method WebApps.GetFtpAllowed. +type WebAppsGetFtpAllowedResponse struct { + WebAppsGetFtpAllowedResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsGetFtpAllowedResult contains the result from method WebApps.GetFtpAllowed. +type WebAppsGetFtpAllowedResult struct { + CsmPublishingCredentialsPoliciesEntity +} + +// WebAppsGetFtpAllowedSlotResponse contains the response from method WebApps.GetFtpAllowedSlot. +type WebAppsGetFtpAllowedSlotResponse struct { + WebAppsGetFtpAllowedSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsGetFtpAllowedSlotResult contains the result from method WebApps.GetFtpAllowedSlot. +type WebAppsGetFtpAllowedSlotResult struct { + CsmPublishingCredentialsPoliciesEntity +} + +// WebAppsGetFunctionResponse contains the response from method WebApps.GetFunction. +type WebAppsGetFunctionResponse struct { + WebAppsGetFunctionResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsGetFunctionResult contains the result from method WebApps.GetFunction. +type WebAppsGetFunctionResult struct { + FunctionEnvelope +} + +// WebAppsGetFunctionsAdminTokenResponse contains the response from method WebApps.GetFunctionsAdminToken. +type WebAppsGetFunctionsAdminTokenResponse struct { + WebAppsGetFunctionsAdminTokenResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsGetFunctionsAdminTokenResult contains the result from method WebApps.GetFunctionsAdminToken. +type WebAppsGetFunctionsAdminTokenResult struct { + Value *string +} + +// WebAppsGetFunctionsAdminTokenSlotResponse contains the response from method WebApps.GetFunctionsAdminTokenSlot. +type WebAppsGetFunctionsAdminTokenSlotResponse struct { + WebAppsGetFunctionsAdminTokenSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsGetFunctionsAdminTokenSlotResult contains the result from method WebApps.GetFunctionsAdminTokenSlot. +type WebAppsGetFunctionsAdminTokenSlotResult struct { + Value *string +} + +// WebAppsGetHostNameBindingResponse contains the response from method WebApps.GetHostNameBinding. +type WebAppsGetHostNameBindingResponse struct { + WebAppsGetHostNameBindingResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsGetHostNameBindingResult contains the result from method WebApps.GetHostNameBinding. +type WebAppsGetHostNameBindingResult struct { + HostNameBinding +} + +// WebAppsGetHostNameBindingSlotResponse contains the response from method WebApps.GetHostNameBindingSlot. +type WebAppsGetHostNameBindingSlotResponse struct { + WebAppsGetHostNameBindingSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsGetHostNameBindingSlotResult contains the result from method WebApps.GetHostNameBindingSlot. +type WebAppsGetHostNameBindingSlotResult struct { + HostNameBinding +} + +// WebAppsGetHybridConnectionResponse contains the response from method WebApps.GetHybridConnection. +type WebAppsGetHybridConnectionResponse struct { + WebAppsGetHybridConnectionResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsGetHybridConnectionResult contains the result from method WebApps.GetHybridConnection. +type WebAppsGetHybridConnectionResult struct { + HybridConnection +} + +// WebAppsGetHybridConnectionSlotResponse contains the response from method WebApps.GetHybridConnectionSlot. +type WebAppsGetHybridConnectionSlotResponse struct { + WebAppsGetHybridConnectionSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsGetHybridConnectionSlotResult contains the result from method WebApps.GetHybridConnectionSlot. +type WebAppsGetHybridConnectionSlotResult struct { + HybridConnection +} + +// WebAppsGetInstanceFunctionSlotResponse contains the response from method WebApps.GetInstanceFunctionSlot. +type WebAppsGetInstanceFunctionSlotResponse struct { + WebAppsGetInstanceFunctionSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsGetInstanceFunctionSlotResult contains the result from method WebApps.GetInstanceFunctionSlot. +type WebAppsGetInstanceFunctionSlotResult struct { + FunctionEnvelope +} + +// WebAppsGetInstanceInfoResponse contains the response from method WebApps.GetInstanceInfo. +type WebAppsGetInstanceInfoResponse struct { + WebAppsGetInstanceInfoResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsGetInstanceInfoResult contains the result from method WebApps.GetInstanceInfo. +type WebAppsGetInstanceInfoResult struct { + WebSiteInstanceStatus +} + +// WebAppsGetInstanceInfoSlotResponse contains the response from method WebApps.GetInstanceInfoSlot. +type WebAppsGetInstanceInfoSlotResponse struct { + WebAppsGetInstanceInfoSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsGetInstanceInfoSlotResult contains the result from method WebApps.GetInstanceInfoSlot. +type WebAppsGetInstanceInfoSlotResult struct { + WebSiteInstanceStatus +} + +// WebAppsGetInstanceMSDeployLogResponse contains the response from method WebApps.GetInstanceMSDeployLog. +type WebAppsGetInstanceMSDeployLogResponse struct { + WebAppsGetInstanceMSDeployLogResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsGetInstanceMSDeployLogResult contains the result from method WebApps.GetInstanceMSDeployLog. +type WebAppsGetInstanceMSDeployLogResult struct { + MSDeployLog +} + +// WebAppsGetInstanceMSDeployLogSlotResponse contains the response from method WebApps.GetInstanceMSDeployLogSlot. +type WebAppsGetInstanceMSDeployLogSlotResponse struct { + WebAppsGetInstanceMSDeployLogSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsGetInstanceMSDeployLogSlotResult contains the result from method WebApps.GetInstanceMSDeployLogSlot. +type WebAppsGetInstanceMSDeployLogSlotResult struct { + MSDeployLog +} + +// WebAppsGetInstanceMsDeployStatusResponse contains the response from method WebApps.GetInstanceMsDeployStatus. +type WebAppsGetInstanceMsDeployStatusResponse struct { + WebAppsGetInstanceMsDeployStatusResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsGetInstanceMsDeployStatusResult contains the result from method WebApps.GetInstanceMsDeployStatus. +type WebAppsGetInstanceMsDeployStatusResult struct { + MSDeployStatus +} + +// WebAppsGetInstanceMsDeployStatusSlotResponse contains the response from method WebApps.GetInstanceMsDeployStatusSlot. +type WebAppsGetInstanceMsDeployStatusSlotResponse struct { + WebAppsGetInstanceMsDeployStatusSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsGetInstanceMsDeployStatusSlotResult contains the result from method WebApps.GetInstanceMsDeployStatusSlot. +type WebAppsGetInstanceMsDeployStatusSlotResult struct { + MSDeployStatus +} + +// WebAppsGetInstanceProcessDumpResponse contains the response from method WebApps.GetInstanceProcessDump. +type WebAppsGetInstanceProcessDumpResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsGetInstanceProcessDumpSlotResponse contains the response from method WebApps.GetInstanceProcessDumpSlot. +type WebAppsGetInstanceProcessDumpSlotResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsGetInstanceProcessModuleResponse contains the response from method WebApps.GetInstanceProcessModule. +type WebAppsGetInstanceProcessModuleResponse struct { + WebAppsGetInstanceProcessModuleResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsGetInstanceProcessModuleResult contains the result from method WebApps.GetInstanceProcessModule. +type WebAppsGetInstanceProcessModuleResult struct { + ProcessModuleInfo +} + +// WebAppsGetInstanceProcessModuleSlotResponse contains the response from method WebApps.GetInstanceProcessModuleSlot. +type WebAppsGetInstanceProcessModuleSlotResponse struct { + WebAppsGetInstanceProcessModuleSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsGetInstanceProcessModuleSlotResult contains the result from method WebApps.GetInstanceProcessModuleSlot. +type WebAppsGetInstanceProcessModuleSlotResult struct { + ProcessModuleInfo +} + +// WebAppsGetInstanceProcessResponse contains the response from method WebApps.GetInstanceProcess. +type WebAppsGetInstanceProcessResponse struct { + WebAppsGetInstanceProcessResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsGetInstanceProcessResult contains the result from method WebApps.GetInstanceProcess. +type WebAppsGetInstanceProcessResult struct { + ProcessInfo +} + +// WebAppsGetInstanceProcessSlotResponse contains the response from method WebApps.GetInstanceProcessSlot. +type WebAppsGetInstanceProcessSlotResponse struct { + WebAppsGetInstanceProcessSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsGetInstanceProcessSlotResult contains the result from method WebApps.GetInstanceProcessSlot. +type WebAppsGetInstanceProcessSlotResult struct { + ProcessInfo +} + +// WebAppsGetMSDeployLogResponse contains the response from method WebApps.GetMSDeployLog. +type WebAppsGetMSDeployLogResponse struct { + WebAppsGetMSDeployLogResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsGetMSDeployLogResult contains the result from method WebApps.GetMSDeployLog. +type WebAppsGetMSDeployLogResult struct { + MSDeployLog +} + +// WebAppsGetMSDeployLogSlotResponse contains the response from method WebApps.GetMSDeployLogSlot. +type WebAppsGetMSDeployLogSlotResponse struct { + WebAppsGetMSDeployLogSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsGetMSDeployLogSlotResult contains the result from method WebApps.GetMSDeployLogSlot. +type WebAppsGetMSDeployLogSlotResult struct { + MSDeployLog +} + +// WebAppsGetMSDeployStatusResponse contains the response from method WebApps.GetMSDeployStatus. +type WebAppsGetMSDeployStatusResponse struct { + WebAppsGetMSDeployStatusResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsGetMSDeployStatusResult contains the result from method WebApps.GetMSDeployStatus. +type WebAppsGetMSDeployStatusResult struct { + MSDeployStatus +} + +// WebAppsGetMSDeployStatusSlotResponse contains the response from method WebApps.GetMSDeployStatusSlot. +type WebAppsGetMSDeployStatusSlotResponse struct { + WebAppsGetMSDeployStatusSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsGetMSDeployStatusSlotResult contains the result from method WebApps.GetMSDeployStatusSlot. +type WebAppsGetMSDeployStatusSlotResult struct { + MSDeployStatus +} + +// WebAppsGetMigrateMySQLStatusResponse contains the response from method WebApps.GetMigrateMySQLStatus. +type WebAppsGetMigrateMySQLStatusResponse struct { + WebAppsGetMigrateMySQLStatusResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsGetMigrateMySQLStatusResult contains the result from method WebApps.GetMigrateMySQLStatus. +type WebAppsGetMigrateMySQLStatusResult struct { + MigrateMySQLStatus +} + +// WebAppsGetMigrateMySQLStatusSlotResponse contains the response from method WebApps.GetMigrateMySQLStatusSlot. +type WebAppsGetMigrateMySQLStatusSlotResponse struct { + WebAppsGetMigrateMySQLStatusSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsGetMigrateMySQLStatusSlotResult contains the result from method WebApps.GetMigrateMySQLStatusSlot. +type WebAppsGetMigrateMySQLStatusSlotResult struct { + MigrateMySQLStatus +} + +// WebAppsGetNetworkTraceOperationResponse contains the response from method WebApps.GetNetworkTraceOperation. +type WebAppsGetNetworkTraceOperationResponse struct { + WebAppsGetNetworkTraceOperationResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsGetNetworkTraceOperationResult contains the result from method WebApps.GetNetworkTraceOperation. +type WebAppsGetNetworkTraceOperationResult struct { + // Array of NetworkTrace + NetworkTraceArray []*NetworkTrace +} + +// WebAppsGetNetworkTraceOperationSlotResponse contains the response from method WebApps.GetNetworkTraceOperationSlot. +type WebAppsGetNetworkTraceOperationSlotResponse struct { + WebAppsGetNetworkTraceOperationSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsGetNetworkTraceOperationSlotResult contains the result from method WebApps.GetNetworkTraceOperationSlot. +type WebAppsGetNetworkTraceOperationSlotResult struct { + // Array of NetworkTrace + NetworkTraceArray []*NetworkTrace +} + +// WebAppsGetNetworkTraceOperationSlotV2Response contains the response from method WebApps.GetNetworkTraceOperationSlotV2. +type WebAppsGetNetworkTraceOperationSlotV2Response struct { + WebAppsGetNetworkTraceOperationSlotV2Result + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsGetNetworkTraceOperationSlotV2Result contains the result from method WebApps.GetNetworkTraceOperationSlotV2. +type WebAppsGetNetworkTraceOperationSlotV2Result struct { + // Array of NetworkTrace + NetworkTraceArray []*NetworkTrace +} + +// WebAppsGetNetworkTraceOperationV2Response contains the response from method WebApps.GetNetworkTraceOperationV2. +type WebAppsGetNetworkTraceOperationV2Response struct { + WebAppsGetNetworkTraceOperationV2Result + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsGetNetworkTraceOperationV2Result contains the result from method WebApps.GetNetworkTraceOperationV2. +type WebAppsGetNetworkTraceOperationV2Result struct { + // Array of NetworkTrace + NetworkTraceArray []*NetworkTrace +} + +// WebAppsGetNetworkTracesResponse contains the response from method WebApps.GetNetworkTraces. +type WebAppsGetNetworkTracesResponse struct { + WebAppsGetNetworkTracesResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsGetNetworkTracesResult contains the result from method WebApps.GetNetworkTraces. +type WebAppsGetNetworkTracesResult struct { + // Array of NetworkTrace + NetworkTraceArray []*NetworkTrace +} + +// WebAppsGetNetworkTracesSlotResponse contains the response from method WebApps.GetNetworkTracesSlot. +type WebAppsGetNetworkTracesSlotResponse struct { + WebAppsGetNetworkTracesSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsGetNetworkTracesSlotResult contains the result from method WebApps.GetNetworkTracesSlot. +type WebAppsGetNetworkTracesSlotResult struct { + // Array of NetworkTrace + NetworkTraceArray []*NetworkTrace +} + +// WebAppsGetNetworkTracesSlotV2Response contains the response from method WebApps.GetNetworkTracesSlotV2. +type WebAppsGetNetworkTracesSlotV2Response struct { + WebAppsGetNetworkTracesSlotV2Result + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsGetNetworkTracesSlotV2Result contains the result from method WebApps.GetNetworkTracesSlotV2. +type WebAppsGetNetworkTracesSlotV2Result struct { + // Array of NetworkTrace + NetworkTraceArray []*NetworkTrace +} + +// WebAppsGetNetworkTracesV2Response contains the response from method WebApps.GetNetworkTracesV2. +type WebAppsGetNetworkTracesV2Response struct { + WebAppsGetNetworkTracesV2Result + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsGetNetworkTracesV2Result contains the result from method WebApps.GetNetworkTracesV2. +type WebAppsGetNetworkTracesV2Result struct { + // Array of NetworkTrace + NetworkTraceArray []*NetworkTrace +} + +// WebAppsGetPremierAddOnResponse contains the response from method WebApps.GetPremierAddOn. +type WebAppsGetPremierAddOnResponse struct { + WebAppsGetPremierAddOnResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsGetPremierAddOnResult contains the result from method WebApps.GetPremierAddOn. +type WebAppsGetPremierAddOnResult struct { + PremierAddOn +} + +// WebAppsGetPremierAddOnSlotResponse contains the response from method WebApps.GetPremierAddOnSlot. +type WebAppsGetPremierAddOnSlotResponse struct { + WebAppsGetPremierAddOnSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsGetPremierAddOnSlotResult contains the result from method WebApps.GetPremierAddOnSlot. +type WebAppsGetPremierAddOnSlotResult struct { + PremierAddOn +} + +// WebAppsGetPrivateAccessResponse contains the response from method WebApps.GetPrivateAccess. +type WebAppsGetPrivateAccessResponse struct { + WebAppsGetPrivateAccessResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsGetPrivateAccessResult contains the result from method WebApps.GetPrivateAccess. +type WebAppsGetPrivateAccessResult struct { + PrivateAccess +} + +// WebAppsGetPrivateAccessSlotResponse contains the response from method WebApps.GetPrivateAccessSlot. +type WebAppsGetPrivateAccessSlotResponse struct { + WebAppsGetPrivateAccessSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsGetPrivateAccessSlotResult contains the result from method WebApps.GetPrivateAccessSlot. +type WebAppsGetPrivateAccessSlotResult struct { + PrivateAccess +} + +// WebAppsGetPrivateEndpointConnectionListResponse contains the response from method WebApps.GetPrivateEndpointConnectionList. +type WebAppsGetPrivateEndpointConnectionListResponse struct { + WebAppsGetPrivateEndpointConnectionListResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsGetPrivateEndpointConnectionListResult contains the result from method WebApps.GetPrivateEndpointConnectionList. +type WebAppsGetPrivateEndpointConnectionListResult struct { + PrivateEndpointConnectionCollection +} + +// WebAppsGetPrivateEndpointConnectionListSlotResponse contains the response from method WebApps.GetPrivateEndpointConnectionListSlot. +type WebAppsGetPrivateEndpointConnectionListSlotResponse struct { + WebAppsGetPrivateEndpointConnectionListSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsGetPrivateEndpointConnectionListSlotResult contains the result from method WebApps.GetPrivateEndpointConnectionListSlot. +type WebAppsGetPrivateEndpointConnectionListSlotResult struct { + PrivateEndpointConnectionCollection +} + +// WebAppsGetPrivateEndpointConnectionResponse contains the response from method WebApps.GetPrivateEndpointConnection. +type WebAppsGetPrivateEndpointConnectionResponse struct { + WebAppsGetPrivateEndpointConnectionResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsGetPrivateEndpointConnectionResult contains the result from method WebApps.GetPrivateEndpointConnection. +type WebAppsGetPrivateEndpointConnectionResult struct { + RemotePrivateEndpointConnectionARMResource +} + +// WebAppsGetPrivateEndpointConnectionSlotResponse contains the response from method WebApps.GetPrivateEndpointConnectionSlot. +type WebAppsGetPrivateEndpointConnectionSlotResponse struct { + WebAppsGetPrivateEndpointConnectionSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsGetPrivateEndpointConnectionSlotResult contains the result from method WebApps.GetPrivateEndpointConnectionSlot. +type WebAppsGetPrivateEndpointConnectionSlotResult struct { + RemotePrivateEndpointConnectionARMResource +} + +// WebAppsGetPrivateLinkResourcesResponse contains the response from method WebApps.GetPrivateLinkResources. +type WebAppsGetPrivateLinkResourcesResponse struct { + WebAppsGetPrivateLinkResourcesResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsGetPrivateLinkResourcesResult contains the result from method WebApps.GetPrivateLinkResources. +type WebAppsGetPrivateLinkResourcesResult struct { + PrivateLinkResourcesWrapper +} + +// WebAppsGetPrivateLinkResourcesSlotResponse contains the response from method WebApps.GetPrivateLinkResourcesSlot. +type WebAppsGetPrivateLinkResourcesSlotResponse struct { + WebAppsGetPrivateLinkResourcesSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsGetPrivateLinkResourcesSlotResult contains the result from method WebApps.GetPrivateLinkResourcesSlot. +type WebAppsGetPrivateLinkResourcesSlotResult struct { + PrivateLinkResourcesWrapper +} + +// WebAppsGetProcessDumpResponse contains the response from method WebApps.GetProcessDump. +type WebAppsGetProcessDumpResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsGetProcessDumpSlotResponse contains the response from method WebApps.GetProcessDumpSlot. +type WebAppsGetProcessDumpSlotResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsGetProcessModuleResponse contains the response from method WebApps.GetProcessModule. +type WebAppsGetProcessModuleResponse struct { + WebAppsGetProcessModuleResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsGetProcessModuleResult contains the result from method WebApps.GetProcessModule. +type WebAppsGetProcessModuleResult struct { + ProcessModuleInfo +} + +// WebAppsGetProcessModuleSlotResponse contains the response from method WebApps.GetProcessModuleSlot. +type WebAppsGetProcessModuleSlotResponse struct { + WebAppsGetProcessModuleSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsGetProcessModuleSlotResult contains the result from method WebApps.GetProcessModuleSlot. +type WebAppsGetProcessModuleSlotResult struct { + ProcessModuleInfo +} + +// WebAppsGetProcessResponse contains the response from method WebApps.GetProcess. +type WebAppsGetProcessResponse struct { + WebAppsGetProcessResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsGetProcessResult contains the result from method WebApps.GetProcess. +type WebAppsGetProcessResult struct { + ProcessInfo +} + +// WebAppsGetProcessSlotResponse contains the response from method WebApps.GetProcessSlot. +type WebAppsGetProcessSlotResponse struct { + WebAppsGetProcessSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsGetProcessSlotResult contains the result from method WebApps.GetProcessSlot. +type WebAppsGetProcessSlotResult struct { + ProcessInfo +} + +// WebAppsGetPublicCertificateResponse contains the response from method WebApps.GetPublicCertificate. +type WebAppsGetPublicCertificateResponse struct { + WebAppsGetPublicCertificateResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsGetPublicCertificateResult contains the result from method WebApps.GetPublicCertificate. +type WebAppsGetPublicCertificateResult struct { + PublicCertificate +} + +// WebAppsGetPublicCertificateSlotResponse contains the response from method WebApps.GetPublicCertificateSlot. +type WebAppsGetPublicCertificateSlotResponse struct { + WebAppsGetPublicCertificateSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsGetPublicCertificateSlotResult contains the result from method WebApps.GetPublicCertificateSlot. +type WebAppsGetPublicCertificateSlotResult struct { + PublicCertificate +} + +// WebAppsGetRelayServiceConnectionResponse contains the response from method WebApps.GetRelayServiceConnection. +type WebAppsGetRelayServiceConnectionResponse struct { + WebAppsGetRelayServiceConnectionResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsGetRelayServiceConnectionResult contains the result from method WebApps.GetRelayServiceConnection. +type WebAppsGetRelayServiceConnectionResult struct { + RelayServiceConnectionEntity +} + +// WebAppsGetRelayServiceConnectionSlotResponse contains the response from method WebApps.GetRelayServiceConnectionSlot. +type WebAppsGetRelayServiceConnectionSlotResponse struct { + WebAppsGetRelayServiceConnectionSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsGetRelayServiceConnectionSlotResult contains the result from method WebApps.GetRelayServiceConnectionSlot. +type WebAppsGetRelayServiceConnectionSlotResult struct { + RelayServiceConnectionEntity +} + +// WebAppsGetResponse contains the response from method WebApps.Get. +type WebAppsGetResponse struct { + WebAppsGetResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsGetResult contains the result from method WebApps.Get. +type WebAppsGetResult struct { + Site +} + +// WebAppsGetScmAllowedResponse contains the response from method WebApps.GetScmAllowed. +type WebAppsGetScmAllowedResponse struct { + WebAppsGetScmAllowedResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsGetScmAllowedResult contains the result from method WebApps.GetScmAllowed. +type WebAppsGetScmAllowedResult struct { + CsmPublishingCredentialsPoliciesEntity +} + +// WebAppsGetScmAllowedSlotResponse contains the response from method WebApps.GetScmAllowedSlot. +type WebAppsGetScmAllowedSlotResponse struct { + WebAppsGetScmAllowedSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsGetScmAllowedSlotResult contains the result from method WebApps.GetScmAllowedSlot. +type WebAppsGetScmAllowedSlotResult struct { + CsmPublishingCredentialsPoliciesEntity +} + +// WebAppsGetSiteConnectionStringKeyVaultReferenceResponse contains the response from method WebApps.GetSiteConnectionStringKeyVaultReference. +type WebAppsGetSiteConnectionStringKeyVaultReferenceResponse struct { + WebAppsGetSiteConnectionStringKeyVaultReferenceResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsGetSiteConnectionStringKeyVaultReferenceResult contains the result from method WebApps.GetSiteConnectionStringKeyVaultReference. +type WebAppsGetSiteConnectionStringKeyVaultReferenceResult struct { + APIKVReference +} + +// WebAppsGetSiteConnectionStringKeyVaultReferenceSlotResponse contains the response from method WebApps.GetSiteConnectionStringKeyVaultReferenceSlot. +type WebAppsGetSiteConnectionStringKeyVaultReferenceSlotResponse struct { + WebAppsGetSiteConnectionStringKeyVaultReferenceSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsGetSiteConnectionStringKeyVaultReferenceSlotResult contains the result from method WebApps.GetSiteConnectionStringKeyVaultReferenceSlot. +type WebAppsGetSiteConnectionStringKeyVaultReferenceSlotResult struct { + APIKVReference +} + +// WebAppsGetSiteConnectionStringKeyVaultReferencesResponse contains the response from method WebApps.GetSiteConnectionStringKeyVaultReferences. +type WebAppsGetSiteConnectionStringKeyVaultReferencesResponse struct { + WebAppsGetSiteConnectionStringKeyVaultReferencesResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsGetSiteConnectionStringKeyVaultReferencesResult contains the result from method WebApps.GetSiteConnectionStringKeyVaultReferences. +type WebAppsGetSiteConnectionStringKeyVaultReferencesResult struct { + APIKVReferenceCollection +} + +// WebAppsGetSiteConnectionStringKeyVaultReferencesSlotResponse contains the response from method WebApps.GetSiteConnectionStringKeyVaultReferencesSlot. +type WebAppsGetSiteConnectionStringKeyVaultReferencesSlotResponse struct { + WebAppsGetSiteConnectionStringKeyVaultReferencesSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsGetSiteConnectionStringKeyVaultReferencesSlotResult contains the result from method WebApps.GetSiteConnectionStringKeyVaultReferencesSlot. +type WebAppsGetSiteConnectionStringKeyVaultReferencesSlotResult struct { + APIKVReferenceCollection +} + +// WebAppsGetSiteExtensionResponse contains the response from method WebApps.GetSiteExtension. +type WebAppsGetSiteExtensionResponse struct { + WebAppsGetSiteExtensionResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsGetSiteExtensionResult contains the result from method WebApps.GetSiteExtension. +type WebAppsGetSiteExtensionResult struct { + SiteExtensionInfo +} + +// WebAppsGetSiteExtensionSlotResponse contains the response from method WebApps.GetSiteExtensionSlot. +type WebAppsGetSiteExtensionSlotResponse struct { + WebAppsGetSiteExtensionSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsGetSiteExtensionSlotResult contains the result from method WebApps.GetSiteExtensionSlot. +type WebAppsGetSiteExtensionSlotResult struct { + SiteExtensionInfo +} + +// WebAppsGetSitePhpErrorLogFlagResponse contains the response from method WebApps.GetSitePhpErrorLogFlag. +type WebAppsGetSitePhpErrorLogFlagResponse struct { + WebAppsGetSitePhpErrorLogFlagResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsGetSitePhpErrorLogFlagResult contains the result from method WebApps.GetSitePhpErrorLogFlag. +type WebAppsGetSitePhpErrorLogFlagResult struct { + SitePhpErrorLogFlag +} + +// WebAppsGetSitePhpErrorLogFlagSlotResponse contains the response from method WebApps.GetSitePhpErrorLogFlagSlot. +type WebAppsGetSitePhpErrorLogFlagSlotResponse struct { + WebAppsGetSitePhpErrorLogFlagSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsGetSitePhpErrorLogFlagSlotResult contains the result from method WebApps.GetSitePhpErrorLogFlagSlot. +type WebAppsGetSitePhpErrorLogFlagSlotResult struct { + SitePhpErrorLogFlag +} + +// WebAppsGetSlotResponse contains the response from method WebApps.GetSlot. +type WebAppsGetSlotResponse struct { + WebAppsGetSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsGetSlotResult contains the result from method WebApps.GetSlot. +type WebAppsGetSlotResult struct { + Site +} + +// WebAppsGetSourceControlResponse contains the response from method WebApps.GetSourceControl. +type WebAppsGetSourceControlResponse struct { + WebAppsGetSourceControlResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsGetSourceControlResult contains the result from method WebApps.GetSourceControl. +type WebAppsGetSourceControlResult struct { + SiteSourceControl +} + +// WebAppsGetSourceControlSlotResponse contains the response from method WebApps.GetSourceControlSlot. +type WebAppsGetSourceControlSlotResponse struct { + WebAppsGetSourceControlSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsGetSourceControlSlotResult contains the result from method WebApps.GetSourceControlSlot. +type WebAppsGetSourceControlSlotResult struct { + SiteSourceControl +} + +// WebAppsGetSwiftVirtualNetworkConnectionResponse contains the response from method WebApps.GetSwiftVirtualNetworkConnection. +type WebAppsGetSwiftVirtualNetworkConnectionResponse struct { + WebAppsGetSwiftVirtualNetworkConnectionResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsGetSwiftVirtualNetworkConnectionResult contains the result from method WebApps.GetSwiftVirtualNetworkConnection. +type WebAppsGetSwiftVirtualNetworkConnectionResult struct { + SwiftVirtualNetwork +} + +// WebAppsGetSwiftVirtualNetworkConnectionSlotResponse contains the response from method WebApps.GetSwiftVirtualNetworkConnectionSlot. +type WebAppsGetSwiftVirtualNetworkConnectionSlotResponse struct { + WebAppsGetSwiftVirtualNetworkConnectionSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsGetSwiftVirtualNetworkConnectionSlotResult contains the result from method WebApps.GetSwiftVirtualNetworkConnectionSlot. +type WebAppsGetSwiftVirtualNetworkConnectionSlotResult struct { + SwiftVirtualNetwork +} + +// WebAppsGetTriggeredWebJobHistoryResponse contains the response from method WebApps.GetTriggeredWebJobHistory. +type WebAppsGetTriggeredWebJobHistoryResponse struct { + WebAppsGetTriggeredWebJobHistoryResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsGetTriggeredWebJobHistoryResult contains the result from method WebApps.GetTriggeredWebJobHistory. +type WebAppsGetTriggeredWebJobHistoryResult struct { + TriggeredJobHistory +} + +// WebAppsGetTriggeredWebJobHistorySlotResponse contains the response from method WebApps.GetTriggeredWebJobHistorySlot. +type WebAppsGetTriggeredWebJobHistorySlotResponse struct { + WebAppsGetTriggeredWebJobHistorySlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsGetTriggeredWebJobHistorySlotResult contains the result from method WebApps.GetTriggeredWebJobHistorySlot. +type WebAppsGetTriggeredWebJobHistorySlotResult struct { + TriggeredJobHistory +} + +// WebAppsGetTriggeredWebJobResponse contains the response from method WebApps.GetTriggeredWebJob. +type WebAppsGetTriggeredWebJobResponse struct { + WebAppsGetTriggeredWebJobResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsGetTriggeredWebJobResult contains the result from method WebApps.GetTriggeredWebJob. +type WebAppsGetTriggeredWebJobResult struct { + TriggeredWebJob +} + +// WebAppsGetTriggeredWebJobSlotResponse contains the response from method WebApps.GetTriggeredWebJobSlot. +type WebAppsGetTriggeredWebJobSlotResponse struct { + WebAppsGetTriggeredWebJobSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsGetTriggeredWebJobSlotResult contains the result from method WebApps.GetTriggeredWebJobSlot. +type WebAppsGetTriggeredWebJobSlotResult struct { + TriggeredWebJob +} + +// WebAppsGetVnetConnectionGatewayResponse contains the response from method WebApps.GetVnetConnectionGateway. +type WebAppsGetVnetConnectionGatewayResponse struct { + WebAppsGetVnetConnectionGatewayResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsGetVnetConnectionGatewayResult contains the result from method WebApps.GetVnetConnectionGateway. +type WebAppsGetVnetConnectionGatewayResult struct { + VnetGateway +} + +// WebAppsGetVnetConnectionGatewaySlotResponse contains the response from method WebApps.GetVnetConnectionGatewaySlot. +type WebAppsGetVnetConnectionGatewaySlotResponse struct { + WebAppsGetVnetConnectionGatewaySlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsGetVnetConnectionGatewaySlotResult contains the result from method WebApps.GetVnetConnectionGatewaySlot. +type WebAppsGetVnetConnectionGatewaySlotResult struct { + VnetGateway +} + +// WebAppsGetVnetConnectionResponse contains the response from method WebApps.GetVnetConnection. +type WebAppsGetVnetConnectionResponse struct { + WebAppsGetVnetConnectionResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsGetVnetConnectionResult contains the result from method WebApps.GetVnetConnection. +type WebAppsGetVnetConnectionResult struct { + VnetInfoResource +} + +// WebAppsGetVnetConnectionSlotResponse contains the response from method WebApps.GetVnetConnectionSlot. +type WebAppsGetVnetConnectionSlotResponse struct { + WebAppsGetVnetConnectionSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsGetVnetConnectionSlotResult contains the result from method WebApps.GetVnetConnectionSlot. +type WebAppsGetVnetConnectionSlotResult struct { + VnetInfoResource +} + +// WebAppsGetWebJobResponse contains the response from method WebApps.GetWebJob. +type WebAppsGetWebJobResponse struct { + WebAppsGetWebJobResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsGetWebJobResult contains the result from method WebApps.GetWebJob. +type WebAppsGetWebJobResult struct { + WebJob +} + +// WebAppsGetWebJobSlotResponse contains the response from method WebApps.GetWebJobSlot. +type WebAppsGetWebJobSlotResponse struct { + WebAppsGetWebJobSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsGetWebJobSlotResult contains the result from method WebApps.GetWebJobSlot. +type WebAppsGetWebJobSlotResult struct { + WebJob +} + +// WebAppsGetWebSiteContainerLogsResponse contains the response from method WebApps.GetWebSiteContainerLogs. +type WebAppsGetWebSiteContainerLogsResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsGetWebSiteContainerLogsSlotResponse contains the response from method WebApps.GetWebSiteContainerLogsSlot. +type WebAppsGetWebSiteContainerLogsSlotResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsInstallSiteExtensionPollerResponse contains the response from method WebApps.InstallSiteExtension. +type WebAppsInstallSiteExtensionPollerResponse struct { + // Poller contains an initialized poller. + Poller *WebAppsInstallSiteExtensionPoller + + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. +// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. +// A good starting value is 30 seconds. Note that some resources might benefit from a different value. +func (l WebAppsInstallSiteExtensionPollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (WebAppsInstallSiteExtensionResponse, error) { + respType := WebAppsInstallSiteExtensionResponse{} + resp, err := l.Poller.pt.PollUntilDone(ctx, freq, &respType.SiteExtensionInfo) + if err != nil { + return respType, err + } + respType.RawResponse = resp + return respType, nil +} + +// Resume rehydrates a WebAppsInstallSiteExtensionPollerResponse from the provided client and resume token. +func (l *WebAppsInstallSiteExtensionPollerResponse) Resume(ctx context.Context, client *WebAppsClient, token string) error { + pt, err := armruntime.NewPollerFromResumeToken("WebAppsClient.InstallSiteExtension", token, client.pl, client.installSiteExtensionHandleError) + if err != nil { + return err + } + poller := &WebAppsInstallSiteExtensionPoller{ + pt: pt, + } + resp, err := poller.Poll(ctx) + if err != nil { + return err + } + l.Poller = poller + l.RawResponse = resp + return nil +} + +// WebAppsInstallSiteExtensionResponse contains the response from method WebApps.InstallSiteExtension. +type WebAppsInstallSiteExtensionResponse struct { + WebAppsInstallSiteExtensionResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsInstallSiteExtensionResult contains the result from method WebApps.InstallSiteExtension. +type WebAppsInstallSiteExtensionResult struct { + SiteExtensionInfo +} + +// WebAppsInstallSiteExtensionSlotPollerResponse contains the response from method WebApps.InstallSiteExtensionSlot. +type WebAppsInstallSiteExtensionSlotPollerResponse struct { + // Poller contains an initialized poller. + Poller *WebAppsInstallSiteExtensionSlotPoller + + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. +// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. +// A good starting value is 30 seconds. Note that some resources might benefit from a different value. +func (l WebAppsInstallSiteExtensionSlotPollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (WebAppsInstallSiteExtensionSlotResponse, error) { + respType := WebAppsInstallSiteExtensionSlotResponse{} + resp, err := l.Poller.pt.PollUntilDone(ctx, freq, &respType.SiteExtensionInfo) + if err != nil { + return respType, err + } + respType.RawResponse = resp + return respType, nil +} + +// Resume rehydrates a WebAppsInstallSiteExtensionSlotPollerResponse from the provided client and resume token. +func (l *WebAppsInstallSiteExtensionSlotPollerResponse) Resume(ctx context.Context, client *WebAppsClient, token string) error { + pt, err := armruntime.NewPollerFromResumeToken("WebAppsClient.InstallSiteExtensionSlot", token, client.pl, client.installSiteExtensionSlotHandleError) + if err != nil { + return err + } + poller := &WebAppsInstallSiteExtensionSlotPoller{ + pt: pt, + } + resp, err := poller.Poll(ctx) + if err != nil { + return err + } + l.Poller = poller + l.RawResponse = resp + return nil +} + +// WebAppsInstallSiteExtensionSlotResponse contains the response from method WebApps.InstallSiteExtensionSlot. +type WebAppsInstallSiteExtensionSlotResponse struct { + WebAppsInstallSiteExtensionSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsInstallSiteExtensionSlotResult contains the result from method WebApps.InstallSiteExtensionSlot. +type WebAppsInstallSiteExtensionSlotResult struct { + SiteExtensionInfo +} + +// WebAppsIsCloneableResponse contains the response from method WebApps.IsCloneable. +type WebAppsIsCloneableResponse struct { + WebAppsIsCloneableResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsIsCloneableResult contains the result from method WebApps.IsCloneable. +type WebAppsIsCloneableResult struct { + SiteCloneability +} + +// WebAppsIsCloneableSlotResponse contains the response from method WebApps.IsCloneableSlot. +type WebAppsIsCloneableSlotResponse struct { + WebAppsIsCloneableSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsIsCloneableSlotResult contains the result from method WebApps.IsCloneableSlot. +type WebAppsIsCloneableSlotResult struct { + SiteCloneability +} + +// WebAppsListApplicationSettingsResponse contains the response from method WebApps.ListApplicationSettings. +type WebAppsListApplicationSettingsResponse struct { + WebAppsListApplicationSettingsResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsListApplicationSettingsResult contains the result from method WebApps.ListApplicationSettings. +type WebAppsListApplicationSettingsResult struct { + StringDictionary +} + +// WebAppsListApplicationSettingsSlotResponse contains the response from method WebApps.ListApplicationSettingsSlot. +type WebAppsListApplicationSettingsSlotResponse struct { + WebAppsListApplicationSettingsSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsListApplicationSettingsSlotResult contains the result from method WebApps.ListApplicationSettingsSlot. +type WebAppsListApplicationSettingsSlotResult struct { + StringDictionary +} + +// WebAppsListAzureStorageAccountsResponse contains the response from method WebApps.ListAzureStorageAccounts. +type WebAppsListAzureStorageAccountsResponse struct { + WebAppsListAzureStorageAccountsResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsListAzureStorageAccountsResult contains the result from method WebApps.ListAzureStorageAccounts. +type WebAppsListAzureStorageAccountsResult struct { + AzureStoragePropertyDictionaryResource +} + +// WebAppsListAzureStorageAccountsSlotResponse contains the response from method WebApps.ListAzureStorageAccountsSlot. +type WebAppsListAzureStorageAccountsSlotResponse struct { + WebAppsListAzureStorageAccountsSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsListAzureStorageAccountsSlotResult contains the result from method WebApps.ListAzureStorageAccountsSlot. +type WebAppsListAzureStorageAccountsSlotResult struct { + AzureStoragePropertyDictionaryResource +} + +// WebAppsListBackupStatusSecretsResponse contains the response from method WebApps.ListBackupStatusSecrets. +type WebAppsListBackupStatusSecretsResponse struct { + WebAppsListBackupStatusSecretsResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsListBackupStatusSecretsResult contains the result from method WebApps.ListBackupStatusSecrets. +type WebAppsListBackupStatusSecretsResult struct { + BackupItem +} + +// WebAppsListBackupStatusSecretsSlotResponse contains the response from method WebApps.ListBackupStatusSecretsSlot. +type WebAppsListBackupStatusSecretsSlotResponse struct { + WebAppsListBackupStatusSecretsSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsListBackupStatusSecretsSlotResult contains the result from method WebApps.ListBackupStatusSecretsSlot. +type WebAppsListBackupStatusSecretsSlotResult struct { + BackupItem +} + +// WebAppsListBackupsResponse contains the response from method WebApps.ListBackups. +type WebAppsListBackupsResponse struct { + WebAppsListBackupsResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsListBackupsResult contains the result from method WebApps.ListBackups. +type WebAppsListBackupsResult struct { + BackupItemCollection +} + +// WebAppsListBackupsSlotResponse contains the response from method WebApps.ListBackupsSlot. +type WebAppsListBackupsSlotResponse struct { + WebAppsListBackupsSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsListBackupsSlotResult contains the result from method WebApps.ListBackupsSlot. +type WebAppsListBackupsSlotResult struct { + BackupItemCollection +} + +// WebAppsListBasicPublishingCredentialsPoliciesResponse contains the response from method WebApps.ListBasicPublishingCredentialsPolicies. +type WebAppsListBasicPublishingCredentialsPoliciesResponse struct { + WebAppsListBasicPublishingCredentialsPoliciesResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsListBasicPublishingCredentialsPoliciesResult contains the result from method WebApps.ListBasicPublishingCredentialsPolicies. +type WebAppsListBasicPublishingCredentialsPoliciesResult struct { + PublishingCredentialsPoliciesCollection +} + +// WebAppsListBasicPublishingCredentialsPoliciesSlotResponse contains the response from method WebApps.ListBasicPublishingCredentialsPoliciesSlot. +type WebAppsListBasicPublishingCredentialsPoliciesSlotResponse struct { + WebAppsListBasicPublishingCredentialsPoliciesSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsListBasicPublishingCredentialsPoliciesSlotResult contains the result from method WebApps.ListBasicPublishingCredentialsPoliciesSlot. +type WebAppsListBasicPublishingCredentialsPoliciesSlotResult struct { + PublishingCredentialsPoliciesCollection +} + +// WebAppsListByResourceGroupResponse contains the response from method WebApps.ListByResourceGroup. +type WebAppsListByResourceGroupResponse struct { + WebAppsListByResourceGroupResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsListByResourceGroupResult contains the result from method WebApps.ListByResourceGroup. +type WebAppsListByResourceGroupResult struct { + WebAppCollection +} + +// WebAppsListConfigurationSnapshotInfoResponse contains the response from method WebApps.ListConfigurationSnapshotInfo. +type WebAppsListConfigurationSnapshotInfoResponse struct { + WebAppsListConfigurationSnapshotInfoResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsListConfigurationSnapshotInfoResult contains the result from method WebApps.ListConfigurationSnapshotInfo. +type WebAppsListConfigurationSnapshotInfoResult struct { + SiteConfigurationSnapshotInfoCollection +} + +// WebAppsListConfigurationSnapshotInfoSlotResponse contains the response from method WebApps.ListConfigurationSnapshotInfoSlot. +type WebAppsListConfigurationSnapshotInfoSlotResponse struct { + WebAppsListConfigurationSnapshotInfoSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsListConfigurationSnapshotInfoSlotResult contains the result from method WebApps.ListConfigurationSnapshotInfoSlot. +type WebAppsListConfigurationSnapshotInfoSlotResult struct { + SiteConfigurationSnapshotInfoCollection +} + +// WebAppsListConfigurationsResponse contains the response from method WebApps.ListConfigurations. +type WebAppsListConfigurationsResponse struct { + WebAppsListConfigurationsResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsListConfigurationsResult contains the result from method WebApps.ListConfigurations. +type WebAppsListConfigurationsResult struct { + SiteConfigResourceCollection +} + +// WebAppsListConfigurationsSlotResponse contains the response from method WebApps.ListConfigurationsSlot. +type WebAppsListConfigurationsSlotResponse struct { + WebAppsListConfigurationsSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsListConfigurationsSlotResult contains the result from method WebApps.ListConfigurationsSlot. +type WebAppsListConfigurationsSlotResult struct { + SiteConfigResourceCollection +} + +// WebAppsListConnectionStringsResponse contains the response from method WebApps.ListConnectionStrings. +type WebAppsListConnectionStringsResponse struct { + WebAppsListConnectionStringsResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsListConnectionStringsResult contains the result from method WebApps.ListConnectionStrings. +type WebAppsListConnectionStringsResult struct { + ConnectionStringDictionary +} + +// WebAppsListConnectionStringsSlotResponse contains the response from method WebApps.ListConnectionStringsSlot. +type WebAppsListConnectionStringsSlotResponse struct { + WebAppsListConnectionStringsSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsListConnectionStringsSlotResult contains the result from method WebApps.ListConnectionStringsSlot. +type WebAppsListConnectionStringsSlotResult struct { + ConnectionStringDictionary +} + +// WebAppsListContinuousWebJobsResponse contains the response from method WebApps.ListContinuousWebJobs. +type WebAppsListContinuousWebJobsResponse struct { + WebAppsListContinuousWebJobsResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsListContinuousWebJobsResult contains the result from method WebApps.ListContinuousWebJobs. +type WebAppsListContinuousWebJobsResult struct { + ContinuousWebJobCollection +} + +// WebAppsListContinuousWebJobsSlotResponse contains the response from method WebApps.ListContinuousWebJobsSlot. +type WebAppsListContinuousWebJobsSlotResponse struct { + WebAppsListContinuousWebJobsSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsListContinuousWebJobsSlotResult contains the result from method WebApps.ListContinuousWebJobsSlot. +type WebAppsListContinuousWebJobsSlotResult struct { + ContinuousWebJobCollection +} + +// WebAppsListDeploymentLogResponse contains the response from method WebApps.ListDeploymentLog. +type WebAppsListDeploymentLogResponse struct { + WebAppsListDeploymentLogResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsListDeploymentLogResult contains the result from method WebApps.ListDeploymentLog. +type WebAppsListDeploymentLogResult struct { + Deployment +} + +// WebAppsListDeploymentLogSlotResponse contains the response from method WebApps.ListDeploymentLogSlot. +type WebAppsListDeploymentLogSlotResponse struct { + WebAppsListDeploymentLogSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsListDeploymentLogSlotResult contains the result from method WebApps.ListDeploymentLogSlot. +type WebAppsListDeploymentLogSlotResult struct { + Deployment +} + +// WebAppsListDeploymentsResponse contains the response from method WebApps.ListDeployments. +type WebAppsListDeploymentsResponse struct { + WebAppsListDeploymentsResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsListDeploymentsResult contains the result from method WebApps.ListDeployments. +type WebAppsListDeploymentsResult struct { + DeploymentCollection +} + +// WebAppsListDeploymentsSlotResponse contains the response from method WebApps.ListDeploymentsSlot. +type WebAppsListDeploymentsSlotResponse struct { + WebAppsListDeploymentsSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsListDeploymentsSlotResult contains the result from method WebApps.ListDeploymentsSlot. +type WebAppsListDeploymentsSlotResult struct { + DeploymentCollection +} + +// WebAppsListDomainOwnershipIdentifiersResponse contains the response from method WebApps.ListDomainOwnershipIdentifiers. +type WebAppsListDomainOwnershipIdentifiersResponse struct { + WebAppsListDomainOwnershipIdentifiersResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsListDomainOwnershipIdentifiersResult contains the result from method WebApps.ListDomainOwnershipIdentifiers. +type WebAppsListDomainOwnershipIdentifiersResult struct { + IdentifierCollection +} + +// WebAppsListDomainOwnershipIdentifiersSlotResponse contains the response from method WebApps.ListDomainOwnershipIdentifiersSlot. +type WebAppsListDomainOwnershipIdentifiersSlotResponse struct { + WebAppsListDomainOwnershipIdentifiersSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsListDomainOwnershipIdentifiersSlotResult contains the result from method WebApps.ListDomainOwnershipIdentifiersSlot. +type WebAppsListDomainOwnershipIdentifiersSlotResult struct { + IdentifierCollection +} + +// WebAppsListFunctionKeysResponse contains the response from method WebApps.ListFunctionKeys. +type WebAppsListFunctionKeysResponse struct { + WebAppsListFunctionKeysResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsListFunctionKeysResult contains the result from method WebApps.ListFunctionKeys. +type WebAppsListFunctionKeysResult struct { + StringDictionary +} + +// WebAppsListFunctionKeysSlotResponse contains the response from method WebApps.ListFunctionKeysSlot. +type WebAppsListFunctionKeysSlotResponse struct { + WebAppsListFunctionKeysSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsListFunctionKeysSlotResult contains the result from method WebApps.ListFunctionKeysSlot. +type WebAppsListFunctionKeysSlotResult struct { + StringDictionary +} + +// WebAppsListFunctionSecretsResponse contains the response from method WebApps.ListFunctionSecrets. +type WebAppsListFunctionSecretsResponse struct { + WebAppsListFunctionSecretsResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsListFunctionSecretsResult contains the result from method WebApps.ListFunctionSecrets. +type WebAppsListFunctionSecretsResult struct { + FunctionSecrets +} + +// WebAppsListFunctionSecretsSlotResponse contains the response from method WebApps.ListFunctionSecretsSlot. +type WebAppsListFunctionSecretsSlotResponse struct { + WebAppsListFunctionSecretsSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsListFunctionSecretsSlotResult contains the result from method WebApps.ListFunctionSecretsSlot. +type WebAppsListFunctionSecretsSlotResult struct { + FunctionSecrets +} + +// WebAppsListFunctionsResponse contains the response from method WebApps.ListFunctions. +type WebAppsListFunctionsResponse struct { + WebAppsListFunctionsResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsListFunctionsResult contains the result from method WebApps.ListFunctions. +type WebAppsListFunctionsResult struct { + FunctionEnvelopeCollection +} + +// WebAppsListHostKeysResponse contains the response from method WebApps.ListHostKeys. +type WebAppsListHostKeysResponse struct { + WebAppsListHostKeysResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsListHostKeysResult contains the result from method WebApps.ListHostKeys. +type WebAppsListHostKeysResult struct { + HostKeys +} + +// WebAppsListHostKeysSlotResponse contains the response from method WebApps.ListHostKeysSlot. +type WebAppsListHostKeysSlotResponse struct { + WebAppsListHostKeysSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsListHostKeysSlotResult contains the result from method WebApps.ListHostKeysSlot. +type WebAppsListHostKeysSlotResult struct { + HostKeys +} + +// WebAppsListHostNameBindingsResponse contains the response from method WebApps.ListHostNameBindings. +type WebAppsListHostNameBindingsResponse struct { + WebAppsListHostNameBindingsResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsListHostNameBindingsResult contains the result from method WebApps.ListHostNameBindings. +type WebAppsListHostNameBindingsResult struct { + HostNameBindingCollection +} + +// WebAppsListHostNameBindingsSlotResponse contains the response from method WebApps.ListHostNameBindingsSlot. +type WebAppsListHostNameBindingsSlotResponse struct { + WebAppsListHostNameBindingsSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsListHostNameBindingsSlotResult contains the result from method WebApps.ListHostNameBindingsSlot. +type WebAppsListHostNameBindingsSlotResult struct { + HostNameBindingCollection +} + +// WebAppsListHybridConnectionsResponse contains the response from method WebApps.ListHybridConnections. +type WebAppsListHybridConnectionsResponse struct { + WebAppsListHybridConnectionsResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsListHybridConnectionsResult contains the result from method WebApps.ListHybridConnections. +type WebAppsListHybridConnectionsResult struct { + HybridConnection +} + +// WebAppsListHybridConnectionsSlotResponse contains the response from method WebApps.ListHybridConnectionsSlot. +type WebAppsListHybridConnectionsSlotResponse struct { + WebAppsListHybridConnectionsSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsListHybridConnectionsSlotResult contains the result from method WebApps.ListHybridConnectionsSlot. +type WebAppsListHybridConnectionsSlotResult struct { + HybridConnection +} + +// WebAppsListInstanceFunctionsSlotResponse contains the response from method WebApps.ListInstanceFunctionsSlot. +type WebAppsListInstanceFunctionsSlotResponse struct { + WebAppsListInstanceFunctionsSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsListInstanceFunctionsSlotResult contains the result from method WebApps.ListInstanceFunctionsSlot. +type WebAppsListInstanceFunctionsSlotResult struct { + FunctionEnvelopeCollection +} + +// WebAppsListInstanceIdentifiersResponse contains the response from method WebApps.ListInstanceIdentifiers. +type WebAppsListInstanceIdentifiersResponse struct { + WebAppsListInstanceIdentifiersResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsListInstanceIdentifiersResult contains the result from method WebApps.ListInstanceIdentifiers. +type WebAppsListInstanceIdentifiersResult struct { + WebAppInstanceStatusCollection +} + +// WebAppsListInstanceIdentifiersSlotResponse contains the response from method WebApps.ListInstanceIdentifiersSlot. +type WebAppsListInstanceIdentifiersSlotResponse struct { + WebAppsListInstanceIdentifiersSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsListInstanceIdentifiersSlotResult contains the result from method WebApps.ListInstanceIdentifiersSlot. +type WebAppsListInstanceIdentifiersSlotResult struct { + WebAppInstanceStatusCollection +} + +// WebAppsListInstanceProcessModulesResponse contains the response from method WebApps.ListInstanceProcessModules. +type WebAppsListInstanceProcessModulesResponse struct { + WebAppsListInstanceProcessModulesResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsListInstanceProcessModulesResult contains the result from method WebApps.ListInstanceProcessModules. +type WebAppsListInstanceProcessModulesResult struct { + ProcessModuleInfoCollection +} + +// WebAppsListInstanceProcessModulesSlotResponse contains the response from method WebApps.ListInstanceProcessModulesSlot. +type WebAppsListInstanceProcessModulesSlotResponse struct { + WebAppsListInstanceProcessModulesSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsListInstanceProcessModulesSlotResult contains the result from method WebApps.ListInstanceProcessModulesSlot. +type WebAppsListInstanceProcessModulesSlotResult struct { + ProcessModuleInfoCollection +} + +// WebAppsListInstanceProcessThreadsResponse contains the response from method WebApps.ListInstanceProcessThreads. +type WebAppsListInstanceProcessThreadsResponse struct { + WebAppsListInstanceProcessThreadsResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsListInstanceProcessThreadsResult contains the result from method WebApps.ListInstanceProcessThreads. +type WebAppsListInstanceProcessThreadsResult struct { + ProcessThreadInfoCollection +} + +// WebAppsListInstanceProcessThreadsSlotResponse contains the response from method WebApps.ListInstanceProcessThreadsSlot. +type WebAppsListInstanceProcessThreadsSlotResponse struct { + WebAppsListInstanceProcessThreadsSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsListInstanceProcessThreadsSlotResult contains the result from method WebApps.ListInstanceProcessThreadsSlot. +type WebAppsListInstanceProcessThreadsSlotResult struct { + ProcessThreadInfoCollection +} + +// WebAppsListInstanceProcessesResponse contains the response from method WebApps.ListInstanceProcesses. +type WebAppsListInstanceProcessesResponse struct { + WebAppsListInstanceProcessesResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsListInstanceProcessesResult contains the result from method WebApps.ListInstanceProcesses. +type WebAppsListInstanceProcessesResult struct { + ProcessInfoCollection +} + +// WebAppsListInstanceProcessesSlotResponse contains the response from method WebApps.ListInstanceProcessesSlot. +type WebAppsListInstanceProcessesSlotResponse struct { + WebAppsListInstanceProcessesSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsListInstanceProcessesSlotResult contains the result from method WebApps.ListInstanceProcessesSlot. +type WebAppsListInstanceProcessesSlotResult struct { + ProcessInfoCollection +} + +// WebAppsListMetadataResponse contains the response from method WebApps.ListMetadata. +type WebAppsListMetadataResponse struct { + WebAppsListMetadataResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsListMetadataResult contains the result from method WebApps.ListMetadata. +type WebAppsListMetadataResult struct { + StringDictionary +} + +// WebAppsListMetadataSlotResponse contains the response from method WebApps.ListMetadataSlot. +type WebAppsListMetadataSlotResponse struct { + WebAppsListMetadataSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsListMetadataSlotResult contains the result from method WebApps.ListMetadataSlot. +type WebAppsListMetadataSlotResult struct { + StringDictionary +} + +// WebAppsListNetworkFeaturesResponse contains the response from method WebApps.ListNetworkFeatures. +type WebAppsListNetworkFeaturesResponse struct { + WebAppsListNetworkFeaturesResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsListNetworkFeaturesResult contains the result from method WebApps.ListNetworkFeatures. +type WebAppsListNetworkFeaturesResult struct { + NetworkFeatures +} + +// WebAppsListNetworkFeaturesSlotResponse contains the response from method WebApps.ListNetworkFeaturesSlot. +type WebAppsListNetworkFeaturesSlotResponse struct { + WebAppsListNetworkFeaturesSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsListNetworkFeaturesSlotResult contains the result from method WebApps.ListNetworkFeaturesSlot. +type WebAppsListNetworkFeaturesSlotResult struct { + NetworkFeatures +} + +// WebAppsListPerfMonCountersResponse contains the response from method WebApps.ListPerfMonCounters. +type WebAppsListPerfMonCountersResponse struct { + WebAppsListPerfMonCountersResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsListPerfMonCountersResult contains the result from method WebApps.ListPerfMonCounters. +type WebAppsListPerfMonCountersResult struct { + PerfMonCounterCollection +} + +// WebAppsListPerfMonCountersSlotResponse contains the response from method WebApps.ListPerfMonCountersSlot. +type WebAppsListPerfMonCountersSlotResponse struct { + WebAppsListPerfMonCountersSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsListPerfMonCountersSlotResult contains the result from method WebApps.ListPerfMonCountersSlot. +type WebAppsListPerfMonCountersSlotResult struct { + PerfMonCounterCollection +} + +// WebAppsListPremierAddOnsResponse contains the response from method WebApps.ListPremierAddOns. +type WebAppsListPremierAddOnsResponse struct { + WebAppsListPremierAddOnsResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsListPremierAddOnsResult contains the result from method WebApps.ListPremierAddOns. +type WebAppsListPremierAddOnsResult struct { + PremierAddOn +} + +// WebAppsListPremierAddOnsSlotResponse contains the response from method WebApps.ListPremierAddOnsSlot. +type WebAppsListPremierAddOnsSlotResponse struct { + WebAppsListPremierAddOnsSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsListPremierAddOnsSlotResult contains the result from method WebApps.ListPremierAddOnsSlot. +type WebAppsListPremierAddOnsSlotResult struct { + PremierAddOn +} + +// WebAppsListProcessModulesResponse contains the response from method WebApps.ListProcessModules. +type WebAppsListProcessModulesResponse struct { + WebAppsListProcessModulesResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsListProcessModulesResult contains the result from method WebApps.ListProcessModules. +type WebAppsListProcessModulesResult struct { + ProcessModuleInfoCollection +} + +// WebAppsListProcessModulesSlotResponse contains the response from method WebApps.ListProcessModulesSlot. +type WebAppsListProcessModulesSlotResponse struct { + WebAppsListProcessModulesSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsListProcessModulesSlotResult contains the result from method WebApps.ListProcessModulesSlot. +type WebAppsListProcessModulesSlotResult struct { + ProcessModuleInfoCollection +} + +// WebAppsListProcessThreadsResponse contains the response from method WebApps.ListProcessThreads. +type WebAppsListProcessThreadsResponse struct { + WebAppsListProcessThreadsResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsListProcessThreadsResult contains the result from method WebApps.ListProcessThreads. +type WebAppsListProcessThreadsResult struct { + ProcessThreadInfoCollection +} + +// WebAppsListProcessThreadsSlotResponse contains the response from method WebApps.ListProcessThreadsSlot. +type WebAppsListProcessThreadsSlotResponse struct { + WebAppsListProcessThreadsSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsListProcessThreadsSlotResult contains the result from method WebApps.ListProcessThreadsSlot. +type WebAppsListProcessThreadsSlotResult struct { + ProcessThreadInfoCollection +} + +// WebAppsListProcessesResponse contains the response from method WebApps.ListProcesses. +type WebAppsListProcessesResponse struct { + WebAppsListProcessesResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsListProcessesResult contains the result from method WebApps.ListProcesses. +type WebAppsListProcessesResult struct { + ProcessInfoCollection +} + +// WebAppsListProcessesSlotResponse contains the response from method WebApps.ListProcessesSlot. +type WebAppsListProcessesSlotResponse struct { + WebAppsListProcessesSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsListProcessesSlotResult contains the result from method WebApps.ListProcessesSlot. +type WebAppsListProcessesSlotResult struct { + ProcessInfoCollection +} + +// WebAppsListPublicCertificatesResponse contains the response from method WebApps.ListPublicCertificates. +type WebAppsListPublicCertificatesResponse struct { + WebAppsListPublicCertificatesResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsListPublicCertificatesResult contains the result from method WebApps.ListPublicCertificates. +type WebAppsListPublicCertificatesResult struct { + PublicCertificateCollection +} + +// WebAppsListPublicCertificatesSlotResponse contains the response from method WebApps.ListPublicCertificatesSlot. +type WebAppsListPublicCertificatesSlotResponse struct { + WebAppsListPublicCertificatesSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsListPublicCertificatesSlotResult contains the result from method WebApps.ListPublicCertificatesSlot. +type WebAppsListPublicCertificatesSlotResult struct { + PublicCertificateCollection +} + +// WebAppsListPublishingCredentialsPollerResponse contains the response from method WebApps.ListPublishingCredentials. +type WebAppsListPublishingCredentialsPollerResponse struct { + // Poller contains an initialized poller. + Poller *WebAppsListPublishingCredentialsPoller + + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. +// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. +// A good starting value is 30 seconds. Note that some resources might benefit from a different value. +func (l WebAppsListPublishingCredentialsPollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (WebAppsListPublishingCredentialsResponse, error) { + respType := WebAppsListPublishingCredentialsResponse{} + resp, err := l.Poller.pt.PollUntilDone(ctx, freq, &respType.User) + if err != nil { + return respType, err + } + respType.RawResponse = resp + return respType, nil +} + +// Resume rehydrates a WebAppsListPublishingCredentialsPollerResponse from the provided client and resume token. +func (l *WebAppsListPublishingCredentialsPollerResponse) Resume(ctx context.Context, client *WebAppsClient, token string) error { + pt, err := armruntime.NewPollerFromResumeToken("WebAppsClient.ListPublishingCredentials", token, client.pl, client.listPublishingCredentialsHandleError) + if err != nil { + return err + } + poller := &WebAppsListPublishingCredentialsPoller{ + pt: pt, + } + resp, err := poller.Poll(ctx) + if err != nil { + return err + } + l.Poller = poller + l.RawResponse = resp + return nil +} + +// WebAppsListPublishingCredentialsResponse contains the response from method WebApps.ListPublishingCredentials. +type WebAppsListPublishingCredentialsResponse struct { + WebAppsListPublishingCredentialsResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsListPublishingCredentialsResult contains the result from method WebApps.ListPublishingCredentials. +type WebAppsListPublishingCredentialsResult struct { + User +} + +// WebAppsListPublishingCredentialsSlotPollerResponse contains the response from method WebApps.ListPublishingCredentialsSlot. +type WebAppsListPublishingCredentialsSlotPollerResponse struct { + // Poller contains an initialized poller. + Poller *WebAppsListPublishingCredentialsSlotPoller + + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. +// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. +// A good starting value is 30 seconds. Note that some resources might benefit from a different value. +func (l WebAppsListPublishingCredentialsSlotPollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (WebAppsListPublishingCredentialsSlotResponse, error) { + respType := WebAppsListPublishingCredentialsSlotResponse{} + resp, err := l.Poller.pt.PollUntilDone(ctx, freq, &respType.User) + if err != nil { + return respType, err + } + respType.RawResponse = resp + return respType, nil +} + +// Resume rehydrates a WebAppsListPublishingCredentialsSlotPollerResponse from the provided client and resume token. +func (l *WebAppsListPublishingCredentialsSlotPollerResponse) Resume(ctx context.Context, client *WebAppsClient, token string) error { + pt, err := armruntime.NewPollerFromResumeToken("WebAppsClient.ListPublishingCredentialsSlot", token, client.pl, client.listPublishingCredentialsSlotHandleError) + if err != nil { + return err + } + poller := &WebAppsListPublishingCredentialsSlotPoller{ + pt: pt, + } + resp, err := poller.Poll(ctx) + if err != nil { + return err + } + l.Poller = poller + l.RawResponse = resp + return nil +} + +// WebAppsListPublishingCredentialsSlotResponse contains the response from method WebApps.ListPublishingCredentialsSlot. +type WebAppsListPublishingCredentialsSlotResponse struct { + WebAppsListPublishingCredentialsSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsListPublishingCredentialsSlotResult contains the result from method WebApps.ListPublishingCredentialsSlot. +type WebAppsListPublishingCredentialsSlotResult struct { + User +} + +// WebAppsListPublishingProfileXMLWithSecretsResponse contains the response from method WebApps.ListPublishingProfileXMLWithSecrets. +type WebAppsListPublishingProfileXMLWithSecretsResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsListPublishingProfileXMLWithSecretsSlotResponse contains the response from method WebApps.ListPublishingProfileXMLWithSecretsSlot. +type WebAppsListPublishingProfileXMLWithSecretsSlotResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsListRelayServiceConnectionsResponse contains the response from method WebApps.ListRelayServiceConnections. +type WebAppsListRelayServiceConnectionsResponse struct { + WebAppsListRelayServiceConnectionsResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsListRelayServiceConnectionsResult contains the result from method WebApps.ListRelayServiceConnections. +type WebAppsListRelayServiceConnectionsResult struct { + RelayServiceConnectionEntity +} + +// WebAppsListRelayServiceConnectionsSlotResponse contains the response from method WebApps.ListRelayServiceConnectionsSlot. +type WebAppsListRelayServiceConnectionsSlotResponse struct { + WebAppsListRelayServiceConnectionsSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsListRelayServiceConnectionsSlotResult contains the result from method WebApps.ListRelayServiceConnectionsSlot. +type WebAppsListRelayServiceConnectionsSlotResult struct { + RelayServiceConnectionEntity +} + +// WebAppsListResponse contains the response from method WebApps.List. +type WebAppsListResponse struct { + WebAppsListResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsListResult contains the result from method WebApps.List. +type WebAppsListResult struct { + WebAppCollection +} + +// WebAppsListSiteBackupsResponse contains the response from method WebApps.ListSiteBackups. +type WebAppsListSiteBackupsResponse struct { + WebAppsListSiteBackupsResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsListSiteBackupsResult contains the result from method WebApps.ListSiteBackups. +type WebAppsListSiteBackupsResult struct { + BackupItemCollection +} + +// WebAppsListSiteBackupsSlotResponse contains the response from method WebApps.ListSiteBackupsSlot. +type WebAppsListSiteBackupsSlotResponse struct { + WebAppsListSiteBackupsSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsListSiteBackupsSlotResult contains the result from method WebApps.ListSiteBackupsSlot. +type WebAppsListSiteBackupsSlotResult struct { + BackupItemCollection +} + +// WebAppsListSiteExtensionsResponse contains the response from method WebApps.ListSiteExtensions. +type WebAppsListSiteExtensionsResponse struct { + WebAppsListSiteExtensionsResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsListSiteExtensionsResult contains the result from method WebApps.ListSiteExtensions. +type WebAppsListSiteExtensionsResult struct { + SiteExtensionInfoCollection +} + +// WebAppsListSiteExtensionsSlotResponse contains the response from method WebApps.ListSiteExtensionsSlot. +type WebAppsListSiteExtensionsSlotResponse struct { + WebAppsListSiteExtensionsSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsListSiteExtensionsSlotResult contains the result from method WebApps.ListSiteExtensionsSlot. +type WebAppsListSiteExtensionsSlotResult struct { + SiteExtensionInfoCollection +} + +// WebAppsListSitePushSettingsResponse contains the response from method WebApps.ListSitePushSettings. +type WebAppsListSitePushSettingsResponse struct { + WebAppsListSitePushSettingsResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsListSitePushSettingsResult contains the result from method WebApps.ListSitePushSettings. +type WebAppsListSitePushSettingsResult struct { + PushSettings +} + +// WebAppsListSitePushSettingsSlotResponse contains the response from method WebApps.ListSitePushSettingsSlot. +type WebAppsListSitePushSettingsSlotResponse struct { + WebAppsListSitePushSettingsSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsListSitePushSettingsSlotResult contains the result from method WebApps.ListSitePushSettingsSlot. +type WebAppsListSitePushSettingsSlotResult struct { + PushSettings +} + +// WebAppsListSlotConfigurationNamesResponse contains the response from method WebApps.ListSlotConfigurationNames. +type WebAppsListSlotConfigurationNamesResponse struct { + WebAppsListSlotConfigurationNamesResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsListSlotConfigurationNamesResult contains the result from method WebApps.ListSlotConfigurationNames. +type WebAppsListSlotConfigurationNamesResult struct { + SlotConfigNamesResource +} + +// WebAppsListSlotDifferencesFromProductionResponse contains the response from method WebApps.ListSlotDifferencesFromProduction. +type WebAppsListSlotDifferencesFromProductionResponse struct { + WebAppsListSlotDifferencesFromProductionResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsListSlotDifferencesFromProductionResult contains the result from method WebApps.ListSlotDifferencesFromProduction. +type WebAppsListSlotDifferencesFromProductionResult struct { + SlotDifferenceCollection +} + +// WebAppsListSlotDifferencesSlotResponse contains the response from method WebApps.ListSlotDifferencesSlot. +type WebAppsListSlotDifferencesSlotResponse struct { + WebAppsListSlotDifferencesSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsListSlotDifferencesSlotResult contains the result from method WebApps.ListSlotDifferencesSlot. +type WebAppsListSlotDifferencesSlotResult struct { + SlotDifferenceCollection +} + +// WebAppsListSlotsResponse contains the response from method WebApps.ListSlots. +type WebAppsListSlotsResponse struct { + WebAppsListSlotsResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsListSlotsResult contains the result from method WebApps.ListSlots. +type WebAppsListSlotsResult struct { + WebAppCollection +} + +// WebAppsListSnapshotsFromDRSecondaryResponse contains the response from method WebApps.ListSnapshotsFromDRSecondary. +type WebAppsListSnapshotsFromDRSecondaryResponse struct { + WebAppsListSnapshotsFromDRSecondaryResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsListSnapshotsFromDRSecondaryResult contains the result from method WebApps.ListSnapshotsFromDRSecondary. +type WebAppsListSnapshotsFromDRSecondaryResult struct { + SnapshotCollection +} + +// WebAppsListSnapshotsFromDRSecondarySlotResponse contains the response from method WebApps.ListSnapshotsFromDRSecondarySlot. +type WebAppsListSnapshotsFromDRSecondarySlotResponse struct { + WebAppsListSnapshotsFromDRSecondarySlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsListSnapshotsFromDRSecondarySlotResult contains the result from method WebApps.ListSnapshotsFromDRSecondarySlot. +type WebAppsListSnapshotsFromDRSecondarySlotResult struct { + SnapshotCollection +} + +// WebAppsListSnapshotsResponse contains the response from method WebApps.ListSnapshots. +type WebAppsListSnapshotsResponse struct { + WebAppsListSnapshotsResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsListSnapshotsResult contains the result from method WebApps.ListSnapshots. +type WebAppsListSnapshotsResult struct { + SnapshotCollection +} + +// WebAppsListSnapshotsSlotResponse contains the response from method WebApps.ListSnapshotsSlot. +type WebAppsListSnapshotsSlotResponse struct { + WebAppsListSnapshotsSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsListSnapshotsSlotResult contains the result from method WebApps.ListSnapshotsSlot. +type WebAppsListSnapshotsSlotResult struct { + SnapshotCollection +} + +// WebAppsListSyncFunctionTriggersResponse contains the response from method WebApps.ListSyncFunctionTriggers. +type WebAppsListSyncFunctionTriggersResponse struct { + WebAppsListSyncFunctionTriggersResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsListSyncFunctionTriggersResult contains the result from method WebApps.ListSyncFunctionTriggers. +type WebAppsListSyncFunctionTriggersResult struct { + FunctionSecrets +} + +// WebAppsListSyncFunctionTriggersSlotResponse contains the response from method WebApps.ListSyncFunctionTriggersSlot. +type WebAppsListSyncFunctionTriggersSlotResponse struct { + WebAppsListSyncFunctionTriggersSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsListSyncFunctionTriggersSlotResult contains the result from method WebApps.ListSyncFunctionTriggersSlot. +type WebAppsListSyncFunctionTriggersSlotResult struct { + FunctionSecrets +} + +// WebAppsListSyncStatusResponse contains the response from method WebApps.ListSyncStatus. +type WebAppsListSyncStatusResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsListSyncStatusSlotResponse contains the response from method WebApps.ListSyncStatusSlot. +type WebAppsListSyncStatusSlotResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsListTriggeredWebJobHistoryResponse contains the response from method WebApps.ListTriggeredWebJobHistory. +type WebAppsListTriggeredWebJobHistoryResponse struct { + WebAppsListTriggeredWebJobHistoryResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsListTriggeredWebJobHistoryResult contains the result from method WebApps.ListTriggeredWebJobHistory. +type WebAppsListTriggeredWebJobHistoryResult struct { + TriggeredJobHistoryCollection +} + +// WebAppsListTriggeredWebJobHistorySlotResponse contains the response from method WebApps.ListTriggeredWebJobHistorySlot. +type WebAppsListTriggeredWebJobHistorySlotResponse struct { + WebAppsListTriggeredWebJobHistorySlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsListTriggeredWebJobHistorySlotResult contains the result from method WebApps.ListTriggeredWebJobHistorySlot. +type WebAppsListTriggeredWebJobHistorySlotResult struct { + TriggeredJobHistoryCollection +} + +// WebAppsListTriggeredWebJobsResponse contains the response from method WebApps.ListTriggeredWebJobs. +type WebAppsListTriggeredWebJobsResponse struct { + WebAppsListTriggeredWebJobsResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsListTriggeredWebJobsResult contains the result from method WebApps.ListTriggeredWebJobs. +type WebAppsListTriggeredWebJobsResult struct { + TriggeredWebJobCollection +} + +// WebAppsListTriggeredWebJobsSlotResponse contains the response from method WebApps.ListTriggeredWebJobsSlot. +type WebAppsListTriggeredWebJobsSlotResponse struct { + WebAppsListTriggeredWebJobsSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsListTriggeredWebJobsSlotResult contains the result from method WebApps.ListTriggeredWebJobsSlot. +type WebAppsListTriggeredWebJobsSlotResult struct { + TriggeredWebJobCollection +} + +// WebAppsListUsagesResponse contains the response from method WebApps.ListUsages. +type WebAppsListUsagesResponse struct { + WebAppsListUsagesResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsListUsagesResult contains the result from method WebApps.ListUsages. +type WebAppsListUsagesResult struct { + CsmUsageQuotaCollection +} + +// WebAppsListUsagesSlotResponse contains the response from method WebApps.ListUsagesSlot. +type WebAppsListUsagesSlotResponse struct { + WebAppsListUsagesSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsListUsagesSlotResult contains the result from method WebApps.ListUsagesSlot. +type WebAppsListUsagesSlotResult struct { + CsmUsageQuotaCollection +} + +// WebAppsListVnetConnectionsResponse contains the response from method WebApps.ListVnetConnections. +type WebAppsListVnetConnectionsResponse struct { + WebAppsListVnetConnectionsResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsListVnetConnectionsResult contains the result from method WebApps.ListVnetConnections. +type WebAppsListVnetConnectionsResult struct { + // Array of VnetInfoResource + VnetInfoResourceArray []*VnetInfoResource +} + +// WebAppsListVnetConnectionsSlotResponse contains the response from method WebApps.ListVnetConnectionsSlot. +type WebAppsListVnetConnectionsSlotResponse struct { + WebAppsListVnetConnectionsSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsListVnetConnectionsSlotResult contains the result from method WebApps.ListVnetConnectionsSlot. +type WebAppsListVnetConnectionsSlotResult struct { + // Array of VnetInfoResource + VnetInfoResourceArray []*VnetInfoResource +} + +// WebAppsListWebJobsResponse contains the response from method WebApps.ListWebJobs. +type WebAppsListWebJobsResponse struct { + WebAppsListWebJobsResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsListWebJobsResult contains the result from method WebApps.ListWebJobs. +type WebAppsListWebJobsResult struct { + WebJobCollection +} + +// WebAppsListWebJobsSlotResponse contains the response from method WebApps.ListWebJobsSlot. +type WebAppsListWebJobsSlotResponse struct { + WebAppsListWebJobsSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsListWebJobsSlotResult contains the result from method WebApps.ListWebJobsSlot. +type WebAppsListWebJobsSlotResult struct { + WebJobCollection +} + +// WebAppsMigrateMySQLPollerResponse contains the response from method WebApps.MigrateMySQL. +type WebAppsMigrateMySQLPollerResponse struct { + // Poller contains an initialized poller. + Poller *WebAppsMigrateMySQLPoller + + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. +// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. +// A good starting value is 30 seconds. Note that some resources might benefit from a different value. +func (l WebAppsMigrateMySQLPollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (WebAppsMigrateMySQLResponse, error) { + respType := WebAppsMigrateMySQLResponse{} + resp, err := l.Poller.pt.PollUntilDone(ctx, freq, &respType.Operation) + if err != nil { + return respType, err + } + respType.RawResponse = resp + return respType, nil +} + +// Resume rehydrates a WebAppsMigrateMySQLPollerResponse from the provided client and resume token. +func (l *WebAppsMigrateMySQLPollerResponse) Resume(ctx context.Context, client *WebAppsClient, token string) error { + pt, err := armruntime.NewPollerFromResumeToken("WebAppsClient.MigrateMySQL", token, client.pl, client.migrateMySQLHandleError) + if err != nil { + return err + } + poller := &WebAppsMigrateMySQLPoller{ + pt: pt, + } + resp, err := poller.Poll(ctx) + if err != nil { + return err + } + l.Poller = poller + l.RawResponse = resp + return nil +} + +// WebAppsMigrateMySQLResponse contains the response from method WebApps.MigrateMySQL. +type WebAppsMigrateMySQLResponse struct { + WebAppsMigrateMySQLResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsMigrateMySQLResult contains the result from method WebApps.MigrateMySQL. +type WebAppsMigrateMySQLResult struct { + Operation +} + +// WebAppsMigrateStoragePollerResponse contains the response from method WebApps.MigrateStorage. +type WebAppsMigrateStoragePollerResponse struct { + // Poller contains an initialized poller. + Poller *WebAppsMigrateStoragePoller + + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. +// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. +// A good starting value is 30 seconds. Note that some resources might benefit from a different value. +func (l WebAppsMigrateStoragePollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (WebAppsMigrateStorageResponse, error) { + respType := WebAppsMigrateStorageResponse{} + resp, err := l.Poller.pt.PollUntilDone(ctx, freq, &respType.StorageMigrationResponse) + if err != nil { + return respType, err + } + respType.RawResponse = resp + return respType, nil +} + +// Resume rehydrates a WebAppsMigrateStoragePollerResponse from the provided client and resume token. +func (l *WebAppsMigrateStoragePollerResponse) Resume(ctx context.Context, client *WebAppsClient, token string) error { + pt, err := armruntime.NewPollerFromResumeToken("WebAppsClient.MigrateStorage", token, client.pl, client.migrateStorageHandleError) + if err != nil { + return err + } + poller := &WebAppsMigrateStoragePoller{ + pt: pt, + } + resp, err := poller.Poll(ctx) + if err != nil { + return err + } + l.Poller = poller + l.RawResponse = resp + return nil +} + +// WebAppsMigrateStorageResponse contains the response from method WebApps.MigrateStorage. +type WebAppsMigrateStorageResponse struct { + WebAppsMigrateStorageResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsMigrateStorageResult contains the result from method WebApps.MigrateStorage. +type WebAppsMigrateStorageResult struct { + StorageMigrationResponse +} + +// WebAppsPutPrivateAccessVnetResponse contains the response from method WebApps.PutPrivateAccessVnet. +type WebAppsPutPrivateAccessVnetResponse struct { + WebAppsPutPrivateAccessVnetResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsPutPrivateAccessVnetResult contains the result from method WebApps.PutPrivateAccessVnet. +type WebAppsPutPrivateAccessVnetResult struct { + PrivateAccess +} + +// WebAppsPutPrivateAccessVnetSlotResponse contains the response from method WebApps.PutPrivateAccessVnetSlot. +type WebAppsPutPrivateAccessVnetSlotResponse struct { + WebAppsPutPrivateAccessVnetSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsPutPrivateAccessVnetSlotResult contains the result from method WebApps.PutPrivateAccessVnetSlot. +type WebAppsPutPrivateAccessVnetSlotResult struct { + PrivateAccess +} + +// WebAppsRecoverSiteConfigurationSnapshotResponse contains the response from method WebApps.RecoverSiteConfigurationSnapshot. +type WebAppsRecoverSiteConfigurationSnapshotResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsRecoverSiteConfigurationSnapshotSlotResponse contains the response from method WebApps.RecoverSiteConfigurationSnapshotSlot. +type WebAppsRecoverSiteConfigurationSnapshotSlotResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsResetProductionSlotConfigResponse contains the response from method WebApps.ResetProductionSlotConfig. +type WebAppsResetProductionSlotConfigResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsResetSlotConfigurationSlotResponse contains the response from method WebApps.ResetSlotConfigurationSlot. +type WebAppsResetSlotConfigurationSlotResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsRestartResponse contains the response from method WebApps.Restart. +type WebAppsRestartResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsRestartSlotResponse contains the response from method WebApps.RestartSlot. +type WebAppsRestartSlotResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsRestoreFromBackupBlobPollerResponse contains the response from method WebApps.RestoreFromBackupBlob. +type WebAppsRestoreFromBackupBlobPollerResponse struct { + // Poller contains an initialized poller. + Poller *WebAppsRestoreFromBackupBlobPoller + + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. +// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. +// A good starting value is 30 seconds. Note that some resources might benefit from a different value. +func (l WebAppsRestoreFromBackupBlobPollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (WebAppsRestoreFromBackupBlobResponse, error) { + respType := WebAppsRestoreFromBackupBlobResponse{} + resp, err := l.Poller.pt.PollUntilDone(ctx, freq, nil) + if err != nil { + return respType, err + } + respType.RawResponse = resp + return respType, nil +} + +// Resume rehydrates a WebAppsRestoreFromBackupBlobPollerResponse from the provided client and resume token. +func (l *WebAppsRestoreFromBackupBlobPollerResponse) Resume(ctx context.Context, client *WebAppsClient, token string) error { + pt, err := armruntime.NewPollerFromResumeToken("WebAppsClient.RestoreFromBackupBlob", token, client.pl, client.restoreFromBackupBlobHandleError) + if err != nil { + return err + } + poller := &WebAppsRestoreFromBackupBlobPoller{ + pt: pt, + } + resp, err := poller.Poll(ctx) + if err != nil { + return err + } + l.Poller = poller + l.RawResponse = resp + return nil +} + +// WebAppsRestoreFromBackupBlobResponse contains the response from method WebApps.RestoreFromBackupBlob. +type WebAppsRestoreFromBackupBlobResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsRestoreFromBackupBlobSlotPollerResponse contains the response from method WebApps.RestoreFromBackupBlobSlot. +type WebAppsRestoreFromBackupBlobSlotPollerResponse struct { + // Poller contains an initialized poller. + Poller *WebAppsRestoreFromBackupBlobSlotPoller + + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. +// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. +// A good starting value is 30 seconds. Note that some resources might benefit from a different value. +func (l WebAppsRestoreFromBackupBlobSlotPollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (WebAppsRestoreFromBackupBlobSlotResponse, error) { + respType := WebAppsRestoreFromBackupBlobSlotResponse{} + resp, err := l.Poller.pt.PollUntilDone(ctx, freq, nil) + if err != nil { + return respType, err + } + respType.RawResponse = resp + return respType, nil +} + +// Resume rehydrates a WebAppsRestoreFromBackupBlobSlotPollerResponse from the provided client and resume token. +func (l *WebAppsRestoreFromBackupBlobSlotPollerResponse) Resume(ctx context.Context, client *WebAppsClient, token string) error { + pt, err := armruntime.NewPollerFromResumeToken("WebAppsClient.RestoreFromBackupBlobSlot", token, client.pl, client.restoreFromBackupBlobSlotHandleError) + if err != nil { + return err + } + poller := &WebAppsRestoreFromBackupBlobSlotPoller{ + pt: pt, + } + resp, err := poller.Poll(ctx) + if err != nil { + return err + } + l.Poller = poller + l.RawResponse = resp + return nil +} + +// WebAppsRestoreFromBackupBlobSlotResponse contains the response from method WebApps.RestoreFromBackupBlobSlot. +type WebAppsRestoreFromBackupBlobSlotResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsRestoreFromDeletedAppPollerResponse contains the response from method WebApps.RestoreFromDeletedApp. +type WebAppsRestoreFromDeletedAppPollerResponse struct { + // Poller contains an initialized poller. + Poller *WebAppsRestoreFromDeletedAppPoller + + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. +// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. +// A good starting value is 30 seconds. Note that some resources might benefit from a different value. +func (l WebAppsRestoreFromDeletedAppPollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (WebAppsRestoreFromDeletedAppResponse, error) { + respType := WebAppsRestoreFromDeletedAppResponse{} + resp, err := l.Poller.pt.PollUntilDone(ctx, freq, nil) + if err != nil { + return respType, err + } + respType.RawResponse = resp + return respType, nil +} + +// Resume rehydrates a WebAppsRestoreFromDeletedAppPollerResponse from the provided client and resume token. +func (l *WebAppsRestoreFromDeletedAppPollerResponse) Resume(ctx context.Context, client *WebAppsClient, token string) error { + pt, err := armruntime.NewPollerFromResumeToken("WebAppsClient.RestoreFromDeletedApp", token, client.pl, client.restoreFromDeletedAppHandleError) + if err != nil { + return err + } + poller := &WebAppsRestoreFromDeletedAppPoller{ + pt: pt, + } + resp, err := poller.Poll(ctx) + if err != nil { + return err + } + l.Poller = poller + l.RawResponse = resp + return nil +} + +// WebAppsRestoreFromDeletedAppResponse contains the response from method WebApps.RestoreFromDeletedApp. +type WebAppsRestoreFromDeletedAppResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsRestoreFromDeletedAppSlotPollerResponse contains the response from method WebApps.RestoreFromDeletedAppSlot. +type WebAppsRestoreFromDeletedAppSlotPollerResponse struct { + // Poller contains an initialized poller. + Poller *WebAppsRestoreFromDeletedAppSlotPoller + + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. +// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. +// A good starting value is 30 seconds. Note that some resources might benefit from a different value. +func (l WebAppsRestoreFromDeletedAppSlotPollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (WebAppsRestoreFromDeletedAppSlotResponse, error) { + respType := WebAppsRestoreFromDeletedAppSlotResponse{} + resp, err := l.Poller.pt.PollUntilDone(ctx, freq, nil) + if err != nil { + return respType, err + } + respType.RawResponse = resp + return respType, nil +} + +// Resume rehydrates a WebAppsRestoreFromDeletedAppSlotPollerResponse from the provided client and resume token. +func (l *WebAppsRestoreFromDeletedAppSlotPollerResponse) Resume(ctx context.Context, client *WebAppsClient, token string) error { + pt, err := armruntime.NewPollerFromResumeToken("WebAppsClient.RestoreFromDeletedAppSlot", token, client.pl, client.restoreFromDeletedAppSlotHandleError) + if err != nil { + return err + } + poller := &WebAppsRestoreFromDeletedAppSlotPoller{ + pt: pt, + } + resp, err := poller.Poll(ctx) + if err != nil { + return err + } + l.Poller = poller + l.RawResponse = resp + return nil +} + +// WebAppsRestoreFromDeletedAppSlotResponse contains the response from method WebApps.RestoreFromDeletedAppSlot. +type WebAppsRestoreFromDeletedAppSlotResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsRestorePollerResponse contains the response from method WebApps.Restore. +type WebAppsRestorePollerResponse struct { + // Poller contains an initialized poller. + Poller *WebAppsRestorePoller + + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. +// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. +// A good starting value is 30 seconds. Note that some resources might benefit from a different value. +func (l WebAppsRestorePollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (WebAppsRestoreResponse, error) { + respType := WebAppsRestoreResponse{} + resp, err := l.Poller.pt.PollUntilDone(ctx, freq, nil) + if err != nil { + return respType, err + } + respType.RawResponse = resp + return respType, nil +} + +// Resume rehydrates a WebAppsRestorePollerResponse from the provided client and resume token. +func (l *WebAppsRestorePollerResponse) Resume(ctx context.Context, client *WebAppsClient, token string) error { + pt, err := armruntime.NewPollerFromResumeToken("WebAppsClient.Restore", token, client.pl, client.restoreHandleError) + if err != nil { + return err + } + poller := &WebAppsRestorePoller{ + pt: pt, + } + resp, err := poller.Poll(ctx) + if err != nil { + return err + } + l.Poller = poller + l.RawResponse = resp + return nil +} + +// WebAppsRestoreResponse contains the response from method WebApps.Restore. +type WebAppsRestoreResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsRestoreSlotPollerResponse contains the response from method WebApps.RestoreSlot. +type WebAppsRestoreSlotPollerResponse struct { + // Poller contains an initialized poller. + Poller *WebAppsRestoreSlotPoller + + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. +// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. +// A good starting value is 30 seconds. Note that some resources might benefit from a different value. +func (l WebAppsRestoreSlotPollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (WebAppsRestoreSlotResponse, error) { + respType := WebAppsRestoreSlotResponse{} + resp, err := l.Poller.pt.PollUntilDone(ctx, freq, nil) + if err != nil { + return respType, err + } + respType.RawResponse = resp + return respType, nil +} + +// Resume rehydrates a WebAppsRestoreSlotPollerResponse from the provided client and resume token. +func (l *WebAppsRestoreSlotPollerResponse) Resume(ctx context.Context, client *WebAppsClient, token string) error { + pt, err := armruntime.NewPollerFromResumeToken("WebAppsClient.RestoreSlot", token, client.pl, client.restoreSlotHandleError) + if err != nil { + return err + } + poller := &WebAppsRestoreSlotPoller{ + pt: pt, + } + resp, err := poller.Poll(ctx) + if err != nil { + return err + } + l.Poller = poller + l.RawResponse = resp + return nil +} + +// WebAppsRestoreSlotResponse contains the response from method WebApps.RestoreSlot. +type WebAppsRestoreSlotResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsRestoreSnapshotPollerResponse contains the response from method WebApps.RestoreSnapshot. +type WebAppsRestoreSnapshotPollerResponse struct { + // Poller contains an initialized poller. + Poller *WebAppsRestoreSnapshotPoller + + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. +// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. +// A good starting value is 30 seconds. Note that some resources might benefit from a different value. +func (l WebAppsRestoreSnapshotPollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (WebAppsRestoreSnapshotResponse, error) { + respType := WebAppsRestoreSnapshotResponse{} + resp, err := l.Poller.pt.PollUntilDone(ctx, freq, nil) + if err != nil { + return respType, err + } + respType.RawResponse = resp + return respType, nil +} + +// Resume rehydrates a WebAppsRestoreSnapshotPollerResponse from the provided client and resume token. +func (l *WebAppsRestoreSnapshotPollerResponse) Resume(ctx context.Context, client *WebAppsClient, token string) error { + pt, err := armruntime.NewPollerFromResumeToken("WebAppsClient.RestoreSnapshot", token, client.pl, client.restoreSnapshotHandleError) + if err != nil { + return err + } + poller := &WebAppsRestoreSnapshotPoller{ + pt: pt, + } + resp, err := poller.Poll(ctx) + if err != nil { + return err + } + l.Poller = poller + l.RawResponse = resp + return nil +} + +// WebAppsRestoreSnapshotResponse contains the response from method WebApps.RestoreSnapshot. +type WebAppsRestoreSnapshotResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsRestoreSnapshotSlotPollerResponse contains the response from method WebApps.RestoreSnapshotSlot. +type WebAppsRestoreSnapshotSlotPollerResponse struct { + // Poller contains an initialized poller. + Poller *WebAppsRestoreSnapshotSlotPoller + + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. +// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. +// A good starting value is 30 seconds. Note that some resources might benefit from a different value. +func (l WebAppsRestoreSnapshotSlotPollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (WebAppsRestoreSnapshotSlotResponse, error) { + respType := WebAppsRestoreSnapshotSlotResponse{} + resp, err := l.Poller.pt.PollUntilDone(ctx, freq, nil) + if err != nil { + return respType, err + } + respType.RawResponse = resp + return respType, nil +} + +// Resume rehydrates a WebAppsRestoreSnapshotSlotPollerResponse from the provided client and resume token. +func (l *WebAppsRestoreSnapshotSlotPollerResponse) Resume(ctx context.Context, client *WebAppsClient, token string) error { + pt, err := armruntime.NewPollerFromResumeToken("WebAppsClient.RestoreSnapshotSlot", token, client.pl, client.restoreSnapshotSlotHandleError) + if err != nil { + return err + } + poller := &WebAppsRestoreSnapshotSlotPoller{ + pt: pt, + } + resp, err := poller.Poll(ctx) + if err != nil { + return err + } + l.Poller = poller + l.RawResponse = resp + return nil +} + +// WebAppsRestoreSnapshotSlotResponse contains the response from method WebApps.RestoreSnapshotSlot. +type WebAppsRestoreSnapshotSlotResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsRunTriggeredWebJobResponse contains the response from method WebApps.RunTriggeredWebJob. +type WebAppsRunTriggeredWebJobResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsRunTriggeredWebJobSlotResponse contains the response from method WebApps.RunTriggeredWebJobSlot. +type WebAppsRunTriggeredWebJobSlotResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsStartContinuousWebJobResponse contains the response from method WebApps.StartContinuousWebJob. +type WebAppsStartContinuousWebJobResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsStartContinuousWebJobSlotResponse contains the response from method WebApps.StartContinuousWebJobSlot. +type WebAppsStartContinuousWebJobSlotResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsStartNetworkTracePollerResponse contains the response from method WebApps.StartNetworkTrace. +type WebAppsStartNetworkTracePollerResponse struct { + // Poller contains an initialized poller. + Poller *WebAppsStartNetworkTracePoller + + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. +// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. +// A good starting value is 30 seconds. Note that some resources might benefit from a different value. +func (l WebAppsStartNetworkTracePollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (WebAppsStartNetworkTraceResponse, error) { + respType := WebAppsStartNetworkTraceResponse{} + resp, err := l.Poller.pt.PollUntilDone(ctx, freq, &respType.NetworkTraceArray) + if err != nil { + return respType, err + } + respType.RawResponse = resp + return respType, nil +} + +// Resume rehydrates a WebAppsStartNetworkTracePollerResponse from the provided client and resume token. +func (l *WebAppsStartNetworkTracePollerResponse) Resume(ctx context.Context, client *WebAppsClient, token string) error { + pt, err := armruntime.NewPollerFromResumeToken("WebAppsClient.StartNetworkTrace", token, client.pl, client.startNetworkTraceHandleError) + if err != nil { + return err + } + poller := &WebAppsStartNetworkTracePoller{ + pt: pt, + } + resp, err := poller.Poll(ctx) + if err != nil { + return err + } + l.Poller = poller + l.RawResponse = resp + return nil +} + +// WebAppsStartNetworkTraceResponse contains the response from method WebApps.StartNetworkTrace. +type WebAppsStartNetworkTraceResponse struct { + WebAppsStartNetworkTraceResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsStartNetworkTraceResult contains the result from method WebApps.StartNetworkTrace. +type WebAppsStartNetworkTraceResult struct { + // Array of NetworkTrace + NetworkTraceArray []*NetworkTrace +} + +// WebAppsStartNetworkTraceSlotPollerResponse contains the response from method WebApps.StartNetworkTraceSlot. +type WebAppsStartNetworkTraceSlotPollerResponse struct { + // Poller contains an initialized poller. + Poller *WebAppsStartNetworkTraceSlotPoller + + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. +// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. +// A good starting value is 30 seconds. Note that some resources might benefit from a different value. +func (l WebAppsStartNetworkTraceSlotPollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (WebAppsStartNetworkTraceSlotResponse, error) { + respType := WebAppsStartNetworkTraceSlotResponse{} + resp, err := l.Poller.pt.PollUntilDone(ctx, freq, &respType.NetworkTraceArray) + if err != nil { + return respType, err + } + respType.RawResponse = resp + return respType, nil +} + +// Resume rehydrates a WebAppsStartNetworkTraceSlotPollerResponse from the provided client and resume token. +func (l *WebAppsStartNetworkTraceSlotPollerResponse) Resume(ctx context.Context, client *WebAppsClient, token string) error { + pt, err := armruntime.NewPollerFromResumeToken("WebAppsClient.StartNetworkTraceSlot", token, client.pl, client.startNetworkTraceSlotHandleError) + if err != nil { + return err + } + poller := &WebAppsStartNetworkTraceSlotPoller{ + pt: pt, + } + resp, err := poller.Poll(ctx) + if err != nil { + return err + } + l.Poller = poller + l.RawResponse = resp + return nil +} + +// WebAppsStartNetworkTraceSlotResponse contains the response from method WebApps.StartNetworkTraceSlot. +type WebAppsStartNetworkTraceSlotResponse struct { + WebAppsStartNetworkTraceSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsStartNetworkTraceSlotResult contains the result from method WebApps.StartNetworkTraceSlot. +type WebAppsStartNetworkTraceSlotResult struct { + // Array of NetworkTrace + NetworkTraceArray []*NetworkTrace +} + +// WebAppsStartResponse contains the response from method WebApps.Start. +type WebAppsStartResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsStartSlotResponse contains the response from method WebApps.StartSlot. +type WebAppsStartSlotResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsStartWebSiteNetworkTraceOperationPollerResponse contains the response from method WebApps.StartWebSiteNetworkTraceOperation. +type WebAppsStartWebSiteNetworkTraceOperationPollerResponse struct { + // Poller contains an initialized poller. + Poller *WebAppsStartWebSiteNetworkTraceOperationPoller + + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. +// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. +// A good starting value is 30 seconds. Note that some resources might benefit from a different value. +func (l WebAppsStartWebSiteNetworkTraceOperationPollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (WebAppsStartWebSiteNetworkTraceOperationResponse, error) { + respType := WebAppsStartWebSiteNetworkTraceOperationResponse{} + resp, err := l.Poller.pt.PollUntilDone(ctx, freq, &respType.NetworkTraceArray) + if err != nil { + return respType, err + } + respType.RawResponse = resp + return respType, nil +} + +// Resume rehydrates a WebAppsStartWebSiteNetworkTraceOperationPollerResponse from the provided client and resume token. +func (l *WebAppsStartWebSiteNetworkTraceOperationPollerResponse) Resume(ctx context.Context, client *WebAppsClient, token string) error { + pt, err := armruntime.NewPollerFromResumeToken("WebAppsClient.StartWebSiteNetworkTraceOperation", token, client.pl, client.startWebSiteNetworkTraceOperationHandleError) + if err != nil { + return err + } + poller := &WebAppsStartWebSiteNetworkTraceOperationPoller{ + pt: pt, + } + resp, err := poller.Poll(ctx) + if err != nil { + return err + } + l.Poller = poller + l.RawResponse = resp + return nil +} + +// WebAppsStartWebSiteNetworkTraceOperationResponse contains the response from method WebApps.StartWebSiteNetworkTraceOperation. +type WebAppsStartWebSiteNetworkTraceOperationResponse struct { + WebAppsStartWebSiteNetworkTraceOperationResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsStartWebSiteNetworkTraceOperationResult contains the result from method WebApps.StartWebSiteNetworkTraceOperation. +type WebAppsStartWebSiteNetworkTraceOperationResult struct { + // Array of NetworkTrace + NetworkTraceArray []*NetworkTrace +} + +// WebAppsStartWebSiteNetworkTraceOperationSlotPollerResponse contains the response from method WebApps.StartWebSiteNetworkTraceOperationSlot. +type WebAppsStartWebSiteNetworkTraceOperationSlotPollerResponse struct { + // Poller contains an initialized poller. + Poller *WebAppsStartWebSiteNetworkTraceOperationSlotPoller + + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. +// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. +// A good starting value is 30 seconds. Note that some resources might benefit from a different value. +func (l WebAppsStartWebSiteNetworkTraceOperationSlotPollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (WebAppsStartWebSiteNetworkTraceOperationSlotResponse, error) { + respType := WebAppsStartWebSiteNetworkTraceOperationSlotResponse{} + resp, err := l.Poller.pt.PollUntilDone(ctx, freq, &respType.NetworkTraceArray) + if err != nil { + return respType, err + } + respType.RawResponse = resp + return respType, nil +} + +// Resume rehydrates a WebAppsStartWebSiteNetworkTraceOperationSlotPollerResponse from the provided client and resume token. +func (l *WebAppsStartWebSiteNetworkTraceOperationSlotPollerResponse) Resume(ctx context.Context, client *WebAppsClient, token string) error { + pt, err := armruntime.NewPollerFromResumeToken("WebAppsClient.StartWebSiteNetworkTraceOperationSlot", token, client.pl, client.startWebSiteNetworkTraceOperationSlotHandleError) + if err != nil { + return err + } + poller := &WebAppsStartWebSiteNetworkTraceOperationSlotPoller{ + pt: pt, + } + resp, err := poller.Poll(ctx) + if err != nil { + return err + } + l.Poller = poller + l.RawResponse = resp + return nil +} + +// WebAppsStartWebSiteNetworkTraceOperationSlotResponse contains the response from method WebApps.StartWebSiteNetworkTraceOperationSlot. +type WebAppsStartWebSiteNetworkTraceOperationSlotResponse struct { + WebAppsStartWebSiteNetworkTraceOperationSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsStartWebSiteNetworkTraceOperationSlotResult contains the result from method WebApps.StartWebSiteNetworkTraceOperationSlot. +type WebAppsStartWebSiteNetworkTraceOperationSlotResult struct { + // Array of NetworkTrace + NetworkTraceArray []*NetworkTrace +} + +// WebAppsStartWebSiteNetworkTraceResponse contains the response from method WebApps.StartWebSiteNetworkTrace. +type WebAppsStartWebSiteNetworkTraceResponse struct { + WebAppsStartWebSiteNetworkTraceResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsStartWebSiteNetworkTraceResult contains the result from method WebApps.StartWebSiteNetworkTrace. +type WebAppsStartWebSiteNetworkTraceResult struct { + Value *string +} + +// WebAppsStartWebSiteNetworkTraceSlotResponse contains the response from method WebApps.StartWebSiteNetworkTraceSlot. +type WebAppsStartWebSiteNetworkTraceSlotResponse struct { + WebAppsStartWebSiteNetworkTraceSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsStartWebSiteNetworkTraceSlotResult contains the result from method WebApps.StartWebSiteNetworkTraceSlot. +type WebAppsStartWebSiteNetworkTraceSlotResult struct { + Value *string +} + +// WebAppsStopContinuousWebJobResponse contains the response from method WebApps.StopContinuousWebJob. +type WebAppsStopContinuousWebJobResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsStopContinuousWebJobSlotResponse contains the response from method WebApps.StopContinuousWebJobSlot. +type WebAppsStopContinuousWebJobSlotResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsStopNetworkTraceResponse contains the response from method WebApps.StopNetworkTrace. +type WebAppsStopNetworkTraceResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsStopNetworkTraceSlotResponse contains the response from method WebApps.StopNetworkTraceSlot. +type WebAppsStopNetworkTraceSlotResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsStopResponse contains the response from method WebApps.Stop. +type WebAppsStopResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsStopSlotResponse contains the response from method WebApps.StopSlot. +type WebAppsStopSlotResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsStopWebSiteNetworkTraceResponse contains the response from method WebApps.StopWebSiteNetworkTrace. +type WebAppsStopWebSiteNetworkTraceResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsStopWebSiteNetworkTraceSlotResponse contains the response from method WebApps.StopWebSiteNetworkTraceSlot. +type WebAppsStopWebSiteNetworkTraceSlotResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsSwapSlotPollerResponse contains the response from method WebApps.SwapSlot. +type WebAppsSwapSlotPollerResponse struct { + // Poller contains an initialized poller. + Poller *WebAppsSwapSlotPoller + + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. +// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. +// A good starting value is 30 seconds. Note that some resources might benefit from a different value. +func (l WebAppsSwapSlotPollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (WebAppsSwapSlotResponse, error) { + respType := WebAppsSwapSlotResponse{} + resp, err := l.Poller.pt.PollUntilDone(ctx, freq, nil) + if err != nil { + return respType, err + } + respType.RawResponse = resp + return respType, nil +} + +// Resume rehydrates a WebAppsSwapSlotPollerResponse from the provided client and resume token. +func (l *WebAppsSwapSlotPollerResponse) Resume(ctx context.Context, client *WebAppsClient, token string) error { + pt, err := armruntime.NewPollerFromResumeToken("WebAppsClient.SwapSlot", token, client.pl, client.swapSlotHandleError) + if err != nil { + return err + } + poller := &WebAppsSwapSlotPoller{ + pt: pt, + } + resp, err := poller.Poll(ctx) + if err != nil { + return err + } + l.Poller = poller + l.RawResponse = resp + return nil +} + +// WebAppsSwapSlotResponse contains the response from method WebApps.SwapSlot. +type WebAppsSwapSlotResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsSwapSlotWithProductionPollerResponse contains the response from method WebApps.SwapSlotWithProduction. +type WebAppsSwapSlotWithProductionPollerResponse struct { + // Poller contains an initialized poller. + Poller *WebAppsSwapSlotWithProductionPoller + + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. +// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. +// A good starting value is 30 seconds. Note that some resources might benefit from a different value. +func (l WebAppsSwapSlotWithProductionPollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (WebAppsSwapSlotWithProductionResponse, error) { + respType := WebAppsSwapSlotWithProductionResponse{} + resp, err := l.Poller.pt.PollUntilDone(ctx, freq, nil) + if err != nil { + return respType, err + } + respType.RawResponse = resp + return respType, nil +} + +// Resume rehydrates a WebAppsSwapSlotWithProductionPollerResponse from the provided client and resume token. +func (l *WebAppsSwapSlotWithProductionPollerResponse) Resume(ctx context.Context, client *WebAppsClient, token string) error { + pt, err := armruntime.NewPollerFromResumeToken("WebAppsClient.SwapSlotWithProduction", token, client.pl, client.swapSlotWithProductionHandleError) + if err != nil { + return err + } + poller := &WebAppsSwapSlotWithProductionPoller{ + pt: pt, + } + resp, err := poller.Poll(ctx) + if err != nil { + return err + } + l.Poller = poller + l.RawResponse = resp + return nil +} + +// WebAppsSwapSlotWithProductionResponse contains the response from method WebApps.SwapSlotWithProduction. +type WebAppsSwapSlotWithProductionResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsSyncFunctionTriggersResponse contains the response from method WebApps.SyncFunctionTriggers. +type WebAppsSyncFunctionTriggersResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsSyncFunctionTriggersSlotResponse contains the response from method WebApps.SyncFunctionTriggersSlot. +type WebAppsSyncFunctionTriggersSlotResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsSyncFunctionsResponse contains the response from method WebApps.SyncFunctions. +type WebAppsSyncFunctionsResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsSyncFunctionsSlotResponse contains the response from method WebApps.SyncFunctionsSlot. +type WebAppsSyncFunctionsSlotResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsSyncRepositoryResponse contains the response from method WebApps.SyncRepository. +type WebAppsSyncRepositoryResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsSyncRepositorySlotResponse contains the response from method WebApps.SyncRepositorySlot. +type WebAppsSyncRepositorySlotResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsUpdateApplicationSettingsResponse contains the response from method WebApps.UpdateApplicationSettings. +type WebAppsUpdateApplicationSettingsResponse struct { + WebAppsUpdateApplicationSettingsResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsUpdateApplicationSettingsResult contains the result from method WebApps.UpdateApplicationSettings. +type WebAppsUpdateApplicationSettingsResult struct { + StringDictionary +} + +// WebAppsUpdateApplicationSettingsSlotResponse contains the response from method WebApps.UpdateApplicationSettingsSlot. +type WebAppsUpdateApplicationSettingsSlotResponse struct { + WebAppsUpdateApplicationSettingsSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsUpdateApplicationSettingsSlotResult contains the result from method WebApps.UpdateApplicationSettingsSlot. +type WebAppsUpdateApplicationSettingsSlotResult struct { + StringDictionary +} + +// WebAppsUpdateAuthSettingsResponse contains the response from method WebApps.UpdateAuthSettings. +type WebAppsUpdateAuthSettingsResponse struct { + WebAppsUpdateAuthSettingsResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsUpdateAuthSettingsResult contains the result from method WebApps.UpdateAuthSettings. +type WebAppsUpdateAuthSettingsResult struct { + SiteAuthSettings +} + +// WebAppsUpdateAuthSettingsSlotResponse contains the response from method WebApps.UpdateAuthSettingsSlot. +type WebAppsUpdateAuthSettingsSlotResponse struct { + WebAppsUpdateAuthSettingsSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsUpdateAuthSettingsSlotResult contains the result from method WebApps.UpdateAuthSettingsSlot. +type WebAppsUpdateAuthSettingsSlotResult struct { + SiteAuthSettings +} + +// WebAppsUpdateAuthSettingsV2Response contains the response from method WebApps.UpdateAuthSettingsV2. +type WebAppsUpdateAuthSettingsV2Response struct { + WebAppsUpdateAuthSettingsV2Result + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsUpdateAuthSettingsV2Result contains the result from method WebApps.UpdateAuthSettingsV2. +type WebAppsUpdateAuthSettingsV2Result struct { + SiteAuthSettingsV2 +} + +// WebAppsUpdateAuthSettingsV2SlotResponse contains the response from method WebApps.UpdateAuthSettingsV2Slot. +type WebAppsUpdateAuthSettingsV2SlotResponse struct { + WebAppsUpdateAuthSettingsV2SlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsUpdateAuthSettingsV2SlotResult contains the result from method WebApps.UpdateAuthSettingsV2Slot. +type WebAppsUpdateAuthSettingsV2SlotResult struct { + SiteAuthSettingsV2 +} + +// WebAppsUpdateAzureStorageAccountsResponse contains the response from method WebApps.UpdateAzureStorageAccounts. +type WebAppsUpdateAzureStorageAccountsResponse struct { + WebAppsUpdateAzureStorageAccountsResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsUpdateAzureStorageAccountsResult contains the result from method WebApps.UpdateAzureStorageAccounts. +type WebAppsUpdateAzureStorageAccountsResult struct { + AzureStoragePropertyDictionaryResource +} + +// WebAppsUpdateAzureStorageAccountsSlotResponse contains the response from method WebApps.UpdateAzureStorageAccountsSlot. +type WebAppsUpdateAzureStorageAccountsSlotResponse struct { + WebAppsUpdateAzureStorageAccountsSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsUpdateAzureStorageAccountsSlotResult contains the result from method WebApps.UpdateAzureStorageAccountsSlot. +type WebAppsUpdateAzureStorageAccountsSlotResult struct { + AzureStoragePropertyDictionaryResource +} + +// WebAppsUpdateBackupConfigurationResponse contains the response from method WebApps.UpdateBackupConfiguration. +type WebAppsUpdateBackupConfigurationResponse struct { + WebAppsUpdateBackupConfigurationResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsUpdateBackupConfigurationResult contains the result from method WebApps.UpdateBackupConfiguration. +type WebAppsUpdateBackupConfigurationResult struct { + BackupRequest +} + +// WebAppsUpdateBackupConfigurationSlotResponse contains the response from method WebApps.UpdateBackupConfigurationSlot. +type WebAppsUpdateBackupConfigurationSlotResponse struct { + WebAppsUpdateBackupConfigurationSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsUpdateBackupConfigurationSlotResult contains the result from method WebApps.UpdateBackupConfigurationSlot. +type WebAppsUpdateBackupConfigurationSlotResult struct { + BackupRequest +} + +// WebAppsUpdateConfigurationResponse contains the response from method WebApps.UpdateConfiguration. +type WebAppsUpdateConfigurationResponse struct { + WebAppsUpdateConfigurationResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsUpdateConfigurationResult contains the result from method WebApps.UpdateConfiguration. +type WebAppsUpdateConfigurationResult struct { + SiteConfigResource +} + +// WebAppsUpdateConfigurationSlotResponse contains the response from method WebApps.UpdateConfigurationSlot. +type WebAppsUpdateConfigurationSlotResponse struct { + WebAppsUpdateConfigurationSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsUpdateConfigurationSlotResult contains the result from method WebApps.UpdateConfigurationSlot. +type WebAppsUpdateConfigurationSlotResult struct { + SiteConfigResource +} + +// WebAppsUpdateConnectionStringsResponse contains the response from method WebApps.UpdateConnectionStrings. +type WebAppsUpdateConnectionStringsResponse struct { + WebAppsUpdateConnectionStringsResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsUpdateConnectionStringsResult contains the result from method WebApps.UpdateConnectionStrings. +type WebAppsUpdateConnectionStringsResult struct { + ConnectionStringDictionary +} + +// WebAppsUpdateConnectionStringsSlotResponse contains the response from method WebApps.UpdateConnectionStringsSlot. +type WebAppsUpdateConnectionStringsSlotResponse struct { + WebAppsUpdateConnectionStringsSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsUpdateConnectionStringsSlotResult contains the result from method WebApps.UpdateConnectionStringsSlot. +type WebAppsUpdateConnectionStringsSlotResult struct { + ConnectionStringDictionary +} + +// WebAppsUpdateDiagnosticLogsConfigResponse contains the response from method WebApps.UpdateDiagnosticLogsConfig. +type WebAppsUpdateDiagnosticLogsConfigResponse struct { + WebAppsUpdateDiagnosticLogsConfigResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsUpdateDiagnosticLogsConfigResult contains the result from method WebApps.UpdateDiagnosticLogsConfig. +type WebAppsUpdateDiagnosticLogsConfigResult struct { + SiteLogsConfig +} + +// WebAppsUpdateDiagnosticLogsConfigSlotResponse contains the response from method WebApps.UpdateDiagnosticLogsConfigSlot. +type WebAppsUpdateDiagnosticLogsConfigSlotResponse struct { + WebAppsUpdateDiagnosticLogsConfigSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsUpdateDiagnosticLogsConfigSlotResult contains the result from method WebApps.UpdateDiagnosticLogsConfigSlot. +type WebAppsUpdateDiagnosticLogsConfigSlotResult struct { + SiteLogsConfig +} + +// WebAppsUpdateDomainOwnershipIdentifierResponse contains the response from method WebApps.UpdateDomainOwnershipIdentifier. +type WebAppsUpdateDomainOwnershipIdentifierResponse struct { + WebAppsUpdateDomainOwnershipIdentifierResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsUpdateDomainOwnershipIdentifierResult contains the result from method WebApps.UpdateDomainOwnershipIdentifier. +type WebAppsUpdateDomainOwnershipIdentifierResult struct { + Identifier +} + +// WebAppsUpdateDomainOwnershipIdentifierSlotResponse contains the response from method WebApps.UpdateDomainOwnershipIdentifierSlot. +type WebAppsUpdateDomainOwnershipIdentifierSlotResponse struct { + WebAppsUpdateDomainOwnershipIdentifierSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsUpdateDomainOwnershipIdentifierSlotResult contains the result from method WebApps.UpdateDomainOwnershipIdentifierSlot. +type WebAppsUpdateDomainOwnershipIdentifierSlotResult struct { + Identifier +} + +// WebAppsUpdateFtpAllowedResponse contains the response from method WebApps.UpdateFtpAllowed. +type WebAppsUpdateFtpAllowedResponse struct { + WebAppsUpdateFtpAllowedResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsUpdateFtpAllowedResult contains the result from method WebApps.UpdateFtpAllowed. +type WebAppsUpdateFtpAllowedResult struct { + CsmPublishingCredentialsPoliciesEntity +} + +// WebAppsUpdateFtpAllowedSlotResponse contains the response from method WebApps.UpdateFtpAllowedSlot. +type WebAppsUpdateFtpAllowedSlotResponse struct { + WebAppsUpdateFtpAllowedSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsUpdateFtpAllowedSlotResult contains the result from method WebApps.UpdateFtpAllowedSlot. +type WebAppsUpdateFtpAllowedSlotResult struct { + CsmPublishingCredentialsPoliciesEntity +} + +// WebAppsUpdateHybridConnectionResponse contains the response from method WebApps.UpdateHybridConnection. +type WebAppsUpdateHybridConnectionResponse struct { + WebAppsUpdateHybridConnectionResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsUpdateHybridConnectionResult contains the result from method WebApps.UpdateHybridConnection. +type WebAppsUpdateHybridConnectionResult struct { + HybridConnection +} + +// WebAppsUpdateHybridConnectionSlotResponse contains the response from method WebApps.UpdateHybridConnectionSlot. +type WebAppsUpdateHybridConnectionSlotResponse struct { + WebAppsUpdateHybridConnectionSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsUpdateHybridConnectionSlotResult contains the result from method WebApps.UpdateHybridConnectionSlot. +type WebAppsUpdateHybridConnectionSlotResult struct { + HybridConnection +} + +// WebAppsUpdateMetadataResponse contains the response from method WebApps.UpdateMetadata. +type WebAppsUpdateMetadataResponse struct { + WebAppsUpdateMetadataResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsUpdateMetadataResult contains the result from method WebApps.UpdateMetadata. +type WebAppsUpdateMetadataResult struct { + StringDictionary +} + +// WebAppsUpdateMetadataSlotResponse contains the response from method WebApps.UpdateMetadataSlot. +type WebAppsUpdateMetadataSlotResponse struct { + WebAppsUpdateMetadataSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsUpdateMetadataSlotResult contains the result from method WebApps.UpdateMetadataSlot. +type WebAppsUpdateMetadataSlotResult struct { + StringDictionary +} + +// WebAppsUpdatePremierAddOnResponse contains the response from method WebApps.UpdatePremierAddOn. +type WebAppsUpdatePremierAddOnResponse struct { + WebAppsUpdatePremierAddOnResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsUpdatePremierAddOnResult contains the result from method WebApps.UpdatePremierAddOn. +type WebAppsUpdatePremierAddOnResult struct { + PremierAddOn +} + +// WebAppsUpdatePremierAddOnSlotResponse contains the response from method WebApps.UpdatePremierAddOnSlot. +type WebAppsUpdatePremierAddOnSlotResponse struct { + WebAppsUpdatePremierAddOnSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsUpdatePremierAddOnSlotResult contains the result from method WebApps.UpdatePremierAddOnSlot. +type WebAppsUpdatePremierAddOnSlotResult struct { + PremierAddOn +} + +// WebAppsUpdateRelayServiceConnectionResponse contains the response from method WebApps.UpdateRelayServiceConnection. +type WebAppsUpdateRelayServiceConnectionResponse struct { + WebAppsUpdateRelayServiceConnectionResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsUpdateRelayServiceConnectionResult contains the result from method WebApps.UpdateRelayServiceConnection. +type WebAppsUpdateRelayServiceConnectionResult struct { + RelayServiceConnectionEntity +} + +// WebAppsUpdateRelayServiceConnectionSlotResponse contains the response from method WebApps.UpdateRelayServiceConnectionSlot. +type WebAppsUpdateRelayServiceConnectionSlotResponse struct { + WebAppsUpdateRelayServiceConnectionSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsUpdateRelayServiceConnectionSlotResult contains the result from method WebApps.UpdateRelayServiceConnectionSlot. +type WebAppsUpdateRelayServiceConnectionSlotResult struct { + RelayServiceConnectionEntity +} + +// WebAppsUpdateResponse contains the response from method WebApps.Update. +type WebAppsUpdateResponse struct { + WebAppsUpdateResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsUpdateResult contains the result from method WebApps.Update. +type WebAppsUpdateResult struct { + Site +} + +// WebAppsUpdateScmAllowedResponse contains the response from method WebApps.UpdateScmAllowed. +type WebAppsUpdateScmAllowedResponse struct { + WebAppsUpdateScmAllowedResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsUpdateScmAllowedResult contains the result from method WebApps.UpdateScmAllowed. +type WebAppsUpdateScmAllowedResult struct { + CsmPublishingCredentialsPoliciesEntity +} + +// WebAppsUpdateScmAllowedSlotResponse contains the response from method WebApps.UpdateScmAllowedSlot. +type WebAppsUpdateScmAllowedSlotResponse struct { + WebAppsUpdateScmAllowedSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsUpdateScmAllowedSlotResult contains the result from method WebApps.UpdateScmAllowedSlot. +type WebAppsUpdateScmAllowedSlotResult struct { + CsmPublishingCredentialsPoliciesEntity +} + +// WebAppsUpdateSitePushSettingsResponse contains the response from method WebApps.UpdateSitePushSettings. +type WebAppsUpdateSitePushSettingsResponse struct { + WebAppsUpdateSitePushSettingsResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsUpdateSitePushSettingsResult contains the result from method WebApps.UpdateSitePushSettings. +type WebAppsUpdateSitePushSettingsResult struct { + PushSettings +} + +// WebAppsUpdateSitePushSettingsSlotResponse contains the response from method WebApps.UpdateSitePushSettingsSlot. +type WebAppsUpdateSitePushSettingsSlotResponse struct { + WebAppsUpdateSitePushSettingsSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsUpdateSitePushSettingsSlotResult contains the result from method WebApps.UpdateSitePushSettingsSlot. +type WebAppsUpdateSitePushSettingsSlotResult struct { + PushSettings +} + +// WebAppsUpdateSlotConfigurationNamesResponse contains the response from method WebApps.UpdateSlotConfigurationNames. +type WebAppsUpdateSlotConfigurationNamesResponse struct { + WebAppsUpdateSlotConfigurationNamesResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsUpdateSlotConfigurationNamesResult contains the result from method WebApps.UpdateSlotConfigurationNames. +type WebAppsUpdateSlotConfigurationNamesResult struct { + SlotConfigNamesResource +} + +// WebAppsUpdateSlotResponse contains the response from method WebApps.UpdateSlot. +type WebAppsUpdateSlotResponse struct { + WebAppsUpdateSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsUpdateSlotResult contains the result from method WebApps.UpdateSlot. +type WebAppsUpdateSlotResult struct { + Site +} + +// WebAppsUpdateSourceControlResponse contains the response from method WebApps.UpdateSourceControl. +type WebAppsUpdateSourceControlResponse struct { + WebAppsUpdateSourceControlResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsUpdateSourceControlResult contains the result from method WebApps.UpdateSourceControl. +type WebAppsUpdateSourceControlResult struct { + SiteSourceControl +} + +// WebAppsUpdateSourceControlSlotResponse contains the response from method WebApps.UpdateSourceControlSlot. +type WebAppsUpdateSourceControlSlotResponse struct { + WebAppsUpdateSourceControlSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsUpdateSourceControlSlotResult contains the result from method WebApps.UpdateSourceControlSlot. +type WebAppsUpdateSourceControlSlotResult struct { + SiteSourceControl +} + +// WebAppsUpdateSwiftVirtualNetworkConnectionWithCheckResponse contains the response from method WebApps.UpdateSwiftVirtualNetworkConnectionWithCheck. +type WebAppsUpdateSwiftVirtualNetworkConnectionWithCheckResponse struct { + WebAppsUpdateSwiftVirtualNetworkConnectionWithCheckResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsUpdateSwiftVirtualNetworkConnectionWithCheckResult contains the result from method WebApps.UpdateSwiftVirtualNetworkConnectionWithCheck. +type WebAppsUpdateSwiftVirtualNetworkConnectionWithCheckResult struct { + SwiftVirtualNetwork +} + +// WebAppsUpdateSwiftVirtualNetworkConnectionWithCheckSlotResponse contains the response from method WebApps.UpdateSwiftVirtualNetworkConnectionWithCheckSlot. +type WebAppsUpdateSwiftVirtualNetworkConnectionWithCheckSlotResponse struct { + WebAppsUpdateSwiftVirtualNetworkConnectionWithCheckSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsUpdateSwiftVirtualNetworkConnectionWithCheckSlotResult contains the result from method WebApps.UpdateSwiftVirtualNetworkConnectionWithCheckSlot. +type WebAppsUpdateSwiftVirtualNetworkConnectionWithCheckSlotResult struct { + SwiftVirtualNetwork +} + +// WebAppsUpdateVnetConnectionGatewayResponse contains the response from method WebApps.UpdateVnetConnectionGateway. +type WebAppsUpdateVnetConnectionGatewayResponse struct { + WebAppsUpdateVnetConnectionGatewayResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsUpdateVnetConnectionGatewayResult contains the result from method WebApps.UpdateVnetConnectionGateway. +type WebAppsUpdateVnetConnectionGatewayResult struct { + VnetGateway +} + +// WebAppsUpdateVnetConnectionGatewaySlotResponse contains the response from method WebApps.UpdateVnetConnectionGatewaySlot. +type WebAppsUpdateVnetConnectionGatewaySlotResponse struct { + WebAppsUpdateVnetConnectionGatewaySlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsUpdateVnetConnectionGatewaySlotResult contains the result from method WebApps.UpdateVnetConnectionGatewaySlot. +type WebAppsUpdateVnetConnectionGatewaySlotResult struct { + VnetGateway +} + +// WebAppsUpdateVnetConnectionResponse contains the response from method WebApps.UpdateVnetConnection. +type WebAppsUpdateVnetConnectionResponse struct { + WebAppsUpdateVnetConnectionResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsUpdateVnetConnectionResult contains the result from method WebApps.UpdateVnetConnection. +type WebAppsUpdateVnetConnectionResult struct { + VnetInfoResource +} + +// WebAppsUpdateVnetConnectionSlotResponse contains the response from method WebApps.UpdateVnetConnectionSlot. +type WebAppsUpdateVnetConnectionSlotResponse struct { + WebAppsUpdateVnetConnectionSlotResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebAppsUpdateVnetConnectionSlotResult contains the result from method WebApps.UpdateVnetConnectionSlot. +type WebAppsUpdateVnetConnectionSlotResult struct { + VnetInfoResource +} + +// WebSiteManagementClientCheckNameAvailabilityResponse contains the response from method WebSiteManagementClient.CheckNameAvailability. +type WebSiteManagementClientCheckNameAvailabilityResponse struct { + WebSiteManagementClientCheckNameAvailabilityResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebSiteManagementClientCheckNameAvailabilityResult contains the result from method WebSiteManagementClient.CheckNameAvailability. +type WebSiteManagementClientCheckNameAvailabilityResult struct { + ResourceNameAvailability +} + +// WebSiteManagementClientGetPublishingUserResponse contains the response from method WebSiteManagementClient.GetPublishingUser. +type WebSiteManagementClientGetPublishingUserResponse struct { + WebSiteManagementClientGetPublishingUserResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebSiteManagementClientGetPublishingUserResult contains the result from method WebSiteManagementClient.GetPublishingUser. +type WebSiteManagementClientGetPublishingUserResult struct { + User +} + +// WebSiteManagementClientGetSourceControlResponse contains the response from method WebSiteManagementClient.GetSourceControl. +type WebSiteManagementClientGetSourceControlResponse struct { + WebSiteManagementClientGetSourceControlResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebSiteManagementClientGetSourceControlResult contains the result from method WebSiteManagementClient.GetSourceControl. +type WebSiteManagementClientGetSourceControlResult struct { + SourceControl +} + +// WebSiteManagementClientGetSubscriptionDeploymentLocationsResponse contains the response from method WebSiteManagementClient.GetSubscriptionDeploymentLocations. +type WebSiteManagementClientGetSubscriptionDeploymentLocationsResponse struct { + WebSiteManagementClientGetSubscriptionDeploymentLocationsResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebSiteManagementClientGetSubscriptionDeploymentLocationsResult contains the result from method WebSiteManagementClient.GetSubscriptionDeploymentLocations. +type WebSiteManagementClientGetSubscriptionDeploymentLocationsResult struct { + DeploymentLocations +} + +// WebSiteManagementClientListBillingMetersResponse contains the response from method WebSiteManagementClient.ListBillingMeters. +type WebSiteManagementClientListBillingMetersResponse struct { + WebSiteManagementClientListBillingMetersResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebSiteManagementClientListBillingMetersResult contains the result from method WebSiteManagementClient.ListBillingMeters. +type WebSiteManagementClientListBillingMetersResult struct { + BillingMeterCollection +} + +// WebSiteManagementClientListGeoRegionsResponse contains the response from method WebSiteManagementClient.ListGeoRegions. +type WebSiteManagementClientListGeoRegionsResponse struct { + WebSiteManagementClientListGeoRegionsResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebSiteManagementClientListGeoRegionsResult contains the result from method WebSiteManagementClient.ListGeoRegions. +type WebSiteManagementClientListGeoRegionsResult struct { + GeoRegionCollection +} + +// WebSiteManagementClientListPremierAddOnOffersResponse contains the response from method WebSiteManagementClient.ListPremierAddOnOffers. +type WebSiteManagementClientListPremierAddOnOffersResponse struct { + WebSiteManagementClientListPremierAddOnOffersResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebSiteManagementClientListPremierAddOnOffersResult contains the result from method WebSiteManagementClient.ListPremierAddOnOffers. +type WebSiteManagementClientListPremierAddOnOffersResult struct { + PremierAddOnOfferCollection +} + +// WebSiteManagementClientListSKUsResponse contains the response from method WebSiteManagementClient.ListSKUs. +type WebSiteManagementClientListSKUsResponse struct { + WebSiteManagementClientListSKUsResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebSiteManagementClientListSKUsResult contains the result from method WebSiteManagementClient.ListSKUs. +type WebSiteManagementClientListSKUsResult struct { + SKUInfos +} + +// WebSiteManagementClientListSiteIdentifiersAssignedToHostNameResponse contains the response from method WebSiteManagementClient.ListSiteIdentifiersAssignedToHostName. +type WebSiteManagementClientListSiteIdentifiersAssignedToHostNameResponse struct { + WebSiteManagementClientListSiteIdentifiersAssignedToHostNameResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebSiteManagementClientListSiteIdentifiersAssignedToHostNameResult contains the result from method WebSiteManagementClient.ListSiteIdentifiersAssignedToHostName. +type WebSiteManagementClientListSiteIdentifiersAssignedToHostNameResult struct { + IdentifierCollection +} + +// WebSiteManagementClientListSourceControlsResponse contains the response from method WebSiteManagementClient.ListSourceControls. +type WebSiteManagementClientListSourceControlsResponse struct { + WebSiteManagementClientListSourceControlsResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebSiteManagementClientListSourceControlsResult contains the result from method WebSiteManagementClient.ListSourceControls. +type WebSiteManagementClientListSourceControlsResult struct { + SourceControlCollection +} + +// WebSiteManagementClientMoveResponse contains the response from method WebSiteManagementClient.Move. +type WebSiteManagementClientMoveResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebSiteManagementClientUpdatePublishingUserResponse contains the response from method WebSiteManagementClient.UpdatePublishingUser. +type WebSiteManagementClientUpdatePublishingUserResponse struct { + WebSiteManagementClientUpdatePublishingUserResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebSiteManagementClientUpdatePublishingUserResult contains the result from method WebSiteManagementClient.UpdatePublishingUser. +type WebSiteManagementClientUpdatePublishingUserResult struct { + User +} + +// WebSiteManagementClientUpdateSourceControlResponse contains the response from method WebSiteManagementClient.UpdateSourceControl. +type WebSiteManagementClientUpdateSourceControlResponse struct { + WebSiteManagementClientUpdateSourceControlResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebSiteManagementClientUpdateSourceControlResult contains the result from method WebSiteManagementClient.UpdateSourceControl. +type WebSiteManagementClientUpdateSourceControlResult struct { + SourceControl +} + +// WebSiteManagementClientValidateMoveResponse contains the response from method WebSiteManagementClient.ValidateMove. +type WebSiteManagementClientValidateMoveResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebSiteManagementClientValidateResponse contains the response from method WebSiteManagementClient.Validate. +type WebSiteManagementClientValidateResponse struct { + WebSiteManagementClientValidateResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebSiteManagementClientValidateResult contains the result from method WebSiteManagementClient.Validate. +type WebSiteManagementClientValidateResult struct { + ValidateResponse +} + +// WebSiteManagementClientVerifyHostingEnvironmentVnetResponse contains the response from method WebSiteManagementClient.VerifyHostingEnvironmentVnet. +type WebSiteManagementClientVerifyHostingEnvironmentVnetResponse struct { + WebSiteManagementClientVerifyHostingEnvironmentVnetResult + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// WebSiteManagementClientVerifyHostingEnvironmentVnetResult contains the result from method WebSiteManagementClient.VerifyHostingEnvironmentVnet. +type WebSiteManagementClientVerifyHostingEnvironmentVnetResult struct { + VnetValidationFailureDetails +} diff --git a/sdk/resourcemanager/appservice/armappservice/zz_generated_staticsites_client.go b/sdk/resourcemanager/appservice/armappservice/zz_generated_staticsites_client.go new file mode 100644 index 000000000000..fc027e5fb415 --- /dev/null +++ b/sdk/resourcemanager/appservice/armappservice/zz_generated_staticsites_client.go @@ -0,0 +1,3351 @@ +//go:build go1.16 +// +build go1.16 + +// 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. + +package armappservice + +import ( + "context" + "errors" + "fmt" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strconv" + "strings" +) + +// StaticSitesClient contains the methods for the StaticSites group. +// Don't use this type directly, use NewStaticSitesClient() instead. +type StaticSitesClient struct { + ep string + pl runtime.Pipeline + subscriptionID string +} + +// NewStaticSitesClient creates a new instance of StaticSitesClient with the specified values. +func NewStaticSitesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *StaticSitesClient { + cp := arm.ClientOptions{} + if options != nil { + cp = *options + } + if len(cp.Host) == 0 { + cp.Host = arm.AzurePublicCloud + } + return &StaticSitesClient{subscriptionID: subscriptionID, ep: string(cp.Host), pl: armruntime.NewPipeline(module, version, credential, &cp)} +} + +// BeginApproveOrRejectPrivateEndpointConnection - Description for Approves or rejects a private endpoint connection +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *StaticSitesClient) BeginApproveOrRejectPrivateEndpointConnection(ctx context.Context, resourceGroupName string, name string, privateEndpointConnectionName string, privateEndpointWrapper PrivateLinkConnectionApprovalRequestResource, options *StaticSitesBeginApproveOrRejectPrivateEndpointConnectionOptions) (StaticSitesApproveOrRejectPrivateEndpointConnectionPollerResponse, error) { + resp, err := client.approveOrRejectPrivateEndpointConnection(ctx, resourceGroupName, name, privateEndpointConnectionName, privateEndpointWrapper, options) + if err != nil { + return StaticSitesApproveOrRejectPrivateEndpointConnectionPollerResponse{}, err + } + result := StaticSitesApproveOrRejectPrivateEndpointConnectionPollerResponse{ + RawResponse: resp, + } + pt, err := armruntime.NewPoller("StaticSitesClient.ApproveOrRejectPrivateEndpointConnection", "", resp, client.pl, client.approveOrRejectPrivateEndpointConnectionHandleError) + if err != nil { + return StaticSitesApproveOrRejectPrivateEndpointConnectionPollerResponse{}, err + } + result.Poller = &StaticSitesApproveOrRejectPrivateEndpointConnectionPoller{ + pt: pt, + } + return result, nil +} + +// ApproveOrRejectPrivateEndpointConnection - Description for Approves or rejects a private endpoint connection +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *StaticSitesClient) approveOrRejectPrivateEndpointConnection(ctx context.Context, resourceGroupName string, name string, privateEndpointConnectionName string, privateEndpointWrapper PrivateLinkConnectionApprovalRequestResource, options *StaticSitesBeginApproveOrRejectPrivateEndpointConnectionOptions) (*http.Response, error) { + req, err := client.approveOrRejectPrivateEndpointConnectionCreateRequest(ctx, resourceGroupName, name, privateEndpointConnectionName, privateEndpointWrapper, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, client.approveOrRejectPrivateEndpointConnectionHandleError(resp) + } + return resp, nil +} + +// approveOrRejectPrivateEndpointConnectionCreateRequest creates the ApproveOrRejectPrivateEndpointConnection request. +func (client *StaticSitesClient) approveOrRejectPrivateEndpointConnectionCreateRequest(ctx context.Context, resourceGroupName string, name string, privateEndpointConnectionName string, privateEndpointWrapper PrivateLinkConnectionApprovalRequestResource, options *StaticSitesBeginApproveOrRejectPrivateEndpointConnectionOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/privateEndpointConnections/{privateEndpointConnectionName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if privateEndpointConnectionName == "" { + return nil, errors.New("parameter privateEndpointConnectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{privateEndpointConnectionName}", url.PathEscape(privateEndpointConnectionName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, privateEndpointWrapper) +} + +// approveOrRejectPrivateEndpointConnectionHandleError handles the ApproveOrRejectPrivateEndpointConnection error response. +func (client *StaticSitesClient) approveOrRejectPrivateEndpointConnectionHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// BeginCreateOrUpdateStaticSite - Description for Creates a new static site in an existing resource group, or updates an existing static site. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *StaticSitesClient) BeginCreateOrUpdateStaticSite(ctx context.Context, resourceGroupName string, name string, staticSiteEnvelope StaticSiteARMResource, options *StaticSitesBeginCreateOrUpdateStaticSiteOptions) (StaticSitesCreateOrUpdateStaticSitePollerResponse, error) { + resp, err := client.createOrUpdateStaticSite(ctx, resourceGroupName, name, staticSiteEnvelope, options) + if err != nil { + return StaticSitesCreateOrUpdateStaticSitePollerResponse{}, err + } + result := StaticSitesCreateOrUpdateStaticSitePollerResponse{ + RawResponse: resp, + } + pt, err := armruntime.NewPoller("StaticSitesClient.CreateOrUpdateStaticSite", "", resp, client.pl, client.createOrUpdateStaticSiteHandleError) + if err != nil { + return StaticSitesCreateOrUpdateStaticSitePollerResponse{}, err + } + result.Poller = &StaticSitesCreateOrUpdateStaticSitePoller{ + pt: pt, + } + return result, nil +} + +// CreateOrUpdateStaticSite - Description for Creates a new static site in an existing resource group, or updates an existing static site. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *StaticSitesClient) createOrUpdateStaticSite(ctx context.Context, resourceGroupName string, name string, staticSiteEnvelope StaticSiteARMResource, options *StaticSitesBeginCreateOrUpdateStaticSiteOptions) (*http.Response, error) { + req, err := client.createOrUpdateStaticSiteCreateRequest(ctx, resourceGroupName, name, staticSiteEnvelope, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, client.createOrUpdateStaticSiteHandleError(resp) + } + return resp, nil +} + +// createOrUpdateStaticSiteCreateRequest creates the CreateOrUpdateStaticSite request. +func (client *StaticSitesClient) createOrUpdateStaticSiteCreateRequest(ctx context.Context, resourceGroupName string, name string, staticSiteEnvelope StaticSiteARMResource, options *StaticSitesBeginCreateOrUpdateStaticSiteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, staticSiteEnvelope) +} + +// createOrUpdateStaticSiteHandleError handles the CreateOrUpdateStaticSite error response. +func (client *StaticSitesClient) createOrUpdateStaticSiteHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// CreateOrUpdateStaticSiteAppSettings - Description for Creates or updates the app settings of a static site. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *StaticSitesClient) CreateOrUpdateStaticSiteAppSettings(ctx context.Context, resourceGroupName string, name string, appSettings StringDictionary, options *StaticSitesCreateOrUpdateStaticSiteAppSettingsOptions) (StaticSitesCreateOrUpdateStaticSiteAppSettingsResponse, error) { + req, err := client.createOrUpdateStaticSiteAppSettingsCreateRequest(ctx, resourceGroupName, name, appSettings, options) + if err != nil { + return StaticSitesCreateOrUpdateStaticSiteAppSettingsResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return StaticSitesCreateOrUpdateStaticSiteAppSettingsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return StaticSitesCreateOrUpdateStaticSiteAppSettingsResponse{}, client.createOrUpdateStaticSiteAppSettingsHandleError(resp) + } + return client.createOrUpdateStaticSiteAppSettingsHandleResponse(resp) +} + +// createOrUpdateStaticSiteAppSettingsCreateRequest creates the CreateOrUpdateStaticSiteAppSettings request. +func (client *StaticSitesClient) createOrUpdateStaticSiteAppSettingsCreateRequest(ctx context.Context, resourceGroupName string, name string, appSettings StringDictionary, options *StaticSitesCreateOrUpdateStaticSiteAppSettingsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/config/appsettings" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, appSettings) +} + +// createOrUpdateStaticSiteAppSettingsHandleResponse handles the CreateOrUpdateStaticSiteAppSettings response. +func (client *StaticSitesClient) createOrUpdateStaticSiteAppSettingsHandleResponse(resp *http.Response) (StaticSitesCreateOrUpdateStaticSiteAppSettingsResponse, error) { + result := StaticSitesCreateOrUpdateStaticSiteAppSettingsResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.StringDictionary); err != nil { + return StaticSitesCreateOrUpdateStaticSiteAppSettingsResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// createOrUpdateStaticSiteAppSettingsHandleError handles the CreateOrUpdateStaticSiteAppSettings error response. +func (client *StaticSitesClient) createOrUpdateStaticSiteAppSettingsHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// CreateOrUpdateStaticSiteBuildAppSettings - Description for Creates or updates the app settings of a static site build. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *StaticSitesClient) CreateOrUpdateStaticSiteBuildAppSettings(ctx context.Context, resourceGroupName string, name string, environmentName string, appSettings StringDictionary, options *StaticSitesCreateOrUpdateStaticSiteBuildAppSettingsOptions) (StaticSitesCreateOrUpdateStaticSiteBuildAppSettingsResponse, error) { + req, err := client.createOrUpdateStaticSiteBuildAppSettingsCreateRequest(ctx, resourceGroupName, name, environmentName, appSettings, options) + if err != nil { + return StaticSitesCreateOrUpdateStaticSiteBuildAppSettingsResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return StaticSitesCreateOrUpdateStaticSiteBuildAppSettingsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return StaticSitesCreateOrUpdateStaticSiteBuildAppSettingsResponse{}, client.createOrUpdateStaticSiteBuildAppSettingsHandleError(resp) + } + return client.createOrUpdateStaticSiteBuildAppSettingsHandleResponse(resp) +} + +// createOrUpdateStaticSiteBuildAppSettingsCreateRequest creates the CreateOrUpdateStaticSiteBuildAppSettings request. +func (client *StaticSitesClient) createOrUpdateStaticSiteBuildAppSettingsCreateRequest(ctx context.Context, resourceGroupName string, name string, environmentName string, appSettings StringDictionary, options *StaticSitesCreateOrUpdateStaticSiteBuildAppSettingsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{environmentName}/config/appsettings" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if environmentName == "" { + return nil, errors.New("parameter environmentName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{environmentName}", url.PathEscape(environmentName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, appSettings) +} + +// createOrUpdateStaticSiteBuildAppSettingsHandleResponse handles the CreateOrUpdateStaticSiteBuildAppSettings response. +func (client *StaticSitesClient) createOrUpdateStaticSiteBuildAppSettingsHandleResponse(resp *http.Response) (StaticSitesCreateOrUpdateStaticSiteBuildAppSettingsResponse, error) { + result := StaticSitesCreateOrUpdateStaticSiteBuildAppSettingsResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.StringDictionary); err != nil { + return StaticSitesCreateOrUpdateStaticSiteBuildAppSettingsResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// createOrUpdateStaticSiteBuildAppSettingsHandleError handles the CreateOrUpdateStaticSiteBuildAppSettings error response. +func (client *StaticSitesClient) createOrUpdateStaticSiteBuildAppSettingsHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// CreateOrUpdateStaticSiteBuildFunctionAppSettings - Description for Creates or updates the function app settings of a static site build. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *StaticSitesClient) CreateOrUpdateStaticSiteBuildFunctionAppSettings(ctx context.Context, resourceGroupName string, name string, environmentName string, appSettings StringDictionary, options *StaticSitesCreateOrUpdateStaticSiteBuildFunctionAppSettingsOptions) (StaticSitesCreateOrUpdateStaticSiteBuildFunctionAppSettingsResponse, error) { + req, err := client.createOrUpdateStaticSiteBuildFunctionAppSettingsCreateRequest(ctx, resourceGroupName, name, environmentName, appSettings, options) + if err != nil { + return StaticSitesCreateOrUpdateStaticSiteBuildFunctionAppSettingsResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return StaticSitesCreateOrUpdateStaticSiteBuildFunctionAppSettingsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return StaticSitesCreateOrUpdateStaticSiteBuildFunctionAppSettingsResponse{}, client.createOrUpdateStaticSiteBuildFunctionAppSettingsHandleError(resp) + } + return client.createOrUpdateStaticSiteBuildFunctionAppSettingsHandleResponse(resp) +} + +// createOrUpdateStaticSiteBuildFunctionAppSettingsCreateRequest creates the CreateOrUpdateStaticSiteBuildFunctionAppSettings request. +func (client *StaticSitesClient) createOrUpdateStaticSiteBuildFunctionAppSettingsCreateRequest(ctx context.Context, resourceGroupName string, name string, environmentName string, appSettings StringDictionary, options *StaticSitesCreateOrUpdateStaticSiteBuildFunctionAppSettingsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{environmentName}/config/functionappsettings" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if environmentName == "" { + return nil, errors.New("parameter environmentName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{environmentName}", url.PathEscape(environmentName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, appSettings) +} + +// createOrUpdateStaticSiteBuildFunctionAppSettingsHandleResponse handles the CreateOrUpdateStaticSiteBuildFunctionAppSettings response. +func (client *StaticSitesClient) createOrUpdateStaticSiteBuildFunctionAppSettingsHandleResponse(resp *http.Response) (StaticSitesCreateOrUpdateStaticSiteBuildFunctionAppSettingsResponse, error) { + result := StaticSitesCreateOrUpdateStaticSiteBuildFunctionAppSettingsResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.StringDictionary); err != nil { + return StaticSitesCreateOrUpdateStaticSiteBuildFunctionAppSettingsResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// createOrUpdateStaticSiteBuildFunctionAppSettingsHandleError handles the CreateOrUpdateStaticSiteBuildFunctionAppSettings error response. +func (client *StaticSitesClient) createOrUpdateStaticSiteBuildFunctionAppSettingsHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// BeginCreateOrUpdateStaticSiteCustomDomain - Description for Creates a new static site custom domain in an existing resource group and static site. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *StaticSitesClient) BeginCreateOrUpdateStaticSiteCustomDomain(ctx context.Context, resourceGroupName string, name string, domainName string, staticSiteCustomDomainRequestPropertiesEnvelope StaticSiteCustomDomainRequestPropertiesARMResource, options *StaticSitesBeginCreateOrUpdateStaticSiteCustomDomainOptions) (StaticSitesCreateOrUpdateStaticSiteCustomDomainPollerResponse, error) { + resp, err := client.createOrUpdateStaticSiteCustomDomain(ctx, resourceGroupName, name, domainName, staticSiteCustomDomainRequestPropertiesEnvelope, options) + if err != nil { + return StaticSitesCreateOrUpdateStaticSiteCustomDomainPollerResponse{}, err + } + result := StaticSitesCreateOrUpdateStaticSiteCustomDomainPollerResponse{ + RawResponse: resp, + } + pt, err := armruntime.NewPoller("StaticSitesClient.CreateOrUpdateStaticSiteCustomDomain", "", resp, client.pl, client.createOrUpdateStaticSiteCustomDomainHandleError) + if err != nil { + return StaticSitesCreateOrUpdateStaticSiteCustomDomainPollerResponse{}, err + } + result.Poller = &StaticSitesCreateOrUpdateStaticSiteCustomDomainPoller{ + pt: pt, + } + return result, nil +} + +// CreateOrUpdateStaticSiteCustomDomain - Description for Creates a new static site custom domain in an existing resource group and static site. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *StaticSitesClient) createOrUpdateStaticSiteCustomDomain(ctx context.Context, resourceGroupName string, name string, domainName string, staticSiteCustomDomainRequestPropertiesEnvelope StaticSiteCustomDomainRequestPropertiesARMResource, options *StaticSitesBeginCreateOrUpdateStaticSiteCustomDomainOptions) (*http.Response, error) { + req, err := client.createOrUpdateStaticSiteCustomDomainCreateRequest(ctx, resourceGroupName, name, domainName, staticSiteCustomDomainRequestPropertiesEnvelope, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, client.createOrUpdateStaticSiteCustomDomainHandleError(resp) + } + return resp, nil +} + +// createOrUpdateStaticSiteCustomDomainCreateRequest creates the CreateOrUpdateStaticSiteCustomDomain request. +func (client *StaticSitesClient) createOrUpdateStaticSiteCustomDomainCreateRequest(ctx context.Context, resourceGroupName string, name string, domainName string, staticSiteCustomDomainRequestPropertiesEnvelope StaticSiteCustomDomainRequestPropertiesARMResource, options *StaticSitesBeginCreateOrUpdateStaticSiteCustomDomainOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/customDomains/{domainName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if domainName == "" { + return nil, errors.New("parameter domainName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{domainName}", url.PathEscape(domainName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, staticSiteCustomDomainRequestPropertiesEnvelope) +} + +// createOrUpdateStaticSiteCustomDomainHandleError handles the CreateOrUpdateStaticSiteCustomDomain error response. +func (client *StaticSitesClient) createOrUpdateStaticSiteCustomDomainHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// CreateOrUpdateStaticSiteFunctionAppSettings - Description for Creates or updates the function app settings of a static site. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *StaticSitesClient) CreateOrUpdateStaticSiteFunctionAppSettings(ctx context.Context, resourceGroupName string, name string, appSettings StringDictionary, options *StaticSitesCreateOrUpdateStaticSiteFunctionAppSettingsOptions) (StaticSitesCreateOrUpdateStaticSiteFunctionAppSettingsResponse, error) { + req, err := client.createOrUpdateStaticSiteFunctionAppSettingsCreateRequest(ctx, resourceGroupName, name, appSettings, options) + if err != nil { + return StaticSitesCreateOrUpdateStaticSiteFunctionAppSettingsResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return StaticSitesCreateOrUpdateStaticSiteFunctionAppSettingsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return StaticSitesCreateOrUpdateStaticSiteFunctionAppSettingsResponse{}, client.createOrUpdateStaticSiteFunctionAppSettingsHandleError(resp) + } + return client.createOrUpdateStaticSiteFunctionAppSettingsHandleResponse(resp) +} + +// createOrUpdateStaticSiteFunctionAppSettingsCreateRequest creates the CreateOrUpdateStaticSiteFunctionAppSettings request. +func (client *StaticSitesClient) createOrUpdateStaticSiteFunctionAppSettingsCreateRequest(ctx context.Context, resourceGroupName string, name string, appSettings StringDictionary, options *StaticSitesCreateOrUpdateStaticSiteFunctionAppSettingsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/config/functionappsettings" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, appSettings) +} + +// createOrUpdateStaticSiteFunctionAppSettingsHandleResponse handles the CreateOrUpdateStaticSiteFunctionAppSettings response. +func (client *StaticSitesClient) createOrUpdateStaticSiteFunctionAppSettingsHandleResponse(resp *http.Response) (StaticSitesCreateOrUpdateStaticSiteFunctionAppSettingsResponse, error) { + result := StaticSitesCreateOrUpdateStaticSiteFunctionAppSettingsResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.StringDictionary); err != nil { + return StaticSitesCreateOrUpdateStaticSiteFunctionAppSettingsResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// createOrUpdateStaticSiteFunctionAppSettingsHandleError handles the CreateOrUpdateStaticSiteFunctionAppSettings error response. +func (client *StaticSitesClient) createOrUpdateStaticSiteFunctionAppSettingsHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// CreateUserRolesInvitationLink - Description for Creates an invitation link for a user with the role +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *StaticSitesClient) CreateUserRolesInvitationLink(ctx context.Context, resourceGroupName string, name string, staticSiteUserRolesInvitationEnvelope StaticSiteUserInvitationRequestResource, options *StaticSitesCreateUserRolesInvitationLinkOptions) (StaticSitesCreateUserRolesInvitationLinkResponse, error) { + req, err := client.createUserRolesInvitationLinkCreateRequest(ctx, resourceGroupName, name, staticSiteUserRolesInvitationEnvelope, options) + if err != nil { + return StaticSitesCreateUserRolesInvitationLinkResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return StaticSitesCreateUserRolesInvitationLinkResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return StaticSitesCreateUserRolesInvitationLinkResponse{}, client.createUserRolesInvitationLinkHandleError(resp) + } + return client.createUserRolesInvitationLinkHandleResponse(resp) +} + +// createUserRolesInvitationLinkCreateRequest creates the CreateUserRolesInvitationLink request. +func (client *StaticSitesClient) createUserRolesInvitationLinkCreateRequest(ctx context.Context, resourceGroupName string, name string, staticSiteUserRolesInvitationEnvelope StaticSiteUserInvitationRequestResource, options *StaticSitesCreateUserRolesInvitationLinkOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/createUserInvitation" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, staticSiteUserRolesInvitationEnvelope) +} + +// createUserRolesInvitationLinkHandleResponse handles the CreateUserRolesInvitationLink response. +func (client *StaticSitesClient) createUserRolesInvitationLinkHandleResponse(resp *http.Response) (StaticSitesCreateUserRolesInvitationLinkResponse, error) { + result := StaticSitesCreateUserRolesInvitationLinkResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.StaticSiteUserInvitationResponseResource); err != nil { + return StaticSitesCreateUserRolesInvitationLinkResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// createUserRolesInvitationLinkHandleError handles the CreateUserRolesInvitationLink error response. +func (client *StaticSitesClient) createUserRolesInvitationLinkHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// BeginCreateZipDeploymentForStaticSite - Description for Deploys zipped content to a static site. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *StaticSitesClient) BeginCreateZipDeploymentForStaticSite(ctx context.Context, resourceGroupName string, name string, staticSiteZipDeploymentEnvelope StaticSiteZipDeploymentARMResource, options *StaticSitesBeginCreateZipDeploymentForStaticSiteOptions) (StaticSitesCreateZipDeploymentForStaticSitePollerResponse, error) { + resp, err := client.createZipDeploymentForStaticSite(ctx, resourceGroupName, name, staticSiteZipDeploymentEnvelope, options) + if err != nil { + return StaticSitesCreateZipDeploymentForStaticSitePollerResponse{}, err + } + result := StaticSitesCreateZipDeploymentForStaticSitePollerResponse{ + RawResponse: resp, + } + pt, err := armruntime.NewPoller("StaticSitesClient.CreateZipDeploymentForStaticSite", "", resp, client.pl, client.createZipDeploymentForStaticSiteHandleError) + if err != nil { + return StaticSitesCreateZipDeploymentForStaticSitePollerResponse{}, err + } + result.Poller = &StaticSitesCreateZipDeploymentForStaticSitePoller{ + pt: pt, + } + return result, nil +} + +// CreateZipDeploymentForStaticSite - Description for Deploys zipped content to a static site. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *StaticSitesClient) createZipDeploymentForStaticSite(ctx context.Context, resourceGroupName string, name string, staticSiteZipDeploymentEnvelope StaticSiteZipDeploymentARMResource, options *StaticSitesBeginCreateZipDeploymentForStaticSiteOptions) (*http.Response, error) { + req, err := client.createZipDeploymentForStaticSiteCreateRequest(ctx, resourceGroupName, name, staticSiteZipDeploymentEnvelope, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, client.createZipDeploymentForStaticSiteHandleError(resp) + } + return resp, nil +} + +// createZipDeploymentForStaticSiteCreateRequest creates the CreateZipDeploymentForStaticSite request. +func (client *StaticSitesClient) createZipDeploymentForStaticSiteCreateRequest(ctx context.Context, resourceGroupName string, name string, staticSiteZipDeploymentEnvelope StaticSiteZipDeploymentARMResource, options *StaticSitesBeginCreateZipDeploymentForStaticSiteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/zipdeploy" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, staticSiteZipDeploymentEnvelope) +} + +// createZipDeploymentForStaticSiteHandleError handles the CreateZipDeploymentForStaticSite error response. +func (client *StaticSitesClient) createZipDeploymentForStaticSiteHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// BeginCreateZipDeploymentForStaticSiteBuild - Description for Deploys zipped content to a specific environment of a static site. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *StaticSitesClient) BeginCreateZipDeploymentForStaticSiteBuild(ctx context.Context, resourceGroupName string, name string, environmentName string, staticSiteZipDeploymentEnvelope StaticSiteZipDeploymentARMResource, options *StaticSitesBeginCreateZipDeploymentForStaticSiteBuildOptions) (StaticSitesCreateZipDeploymentForStaticSiteBuildPollerResponse, error) { + resp, err := client.createZipDeploymentForStaticSiteBuild(ctx, resourceGroupName, name, environmentName, staticSiteZipDeploymentEnvelope, options) + if err != nil { + return StaticSitesCreateZipDeploymentForStaticSiteBuildPollerResponse{}, err + } + result := StaticSitesCreateZipDeploymentForStaticSiteBuildPollerResponse{ + RawResponse: resp, + } + pt, err := armruntime.NewPoller("StaticSitesClient.CreateZipDeploymentForStaticSiteBuild", "", resp, client.pl, client.createZipDeploymentForStaticSiteBuildHandleError) + if err != nil { + return StaticSitesCreateZipDeploymentForStaticSiteBuildPollerResponse{}, err + } + result.Poller = &StaticSitesCreateZipDeploymentForStaticSiteBuildPoller{ + pt: pt, + } + return result, nil +} + +// CreateZipDeploymentForStaticSiteBuild - Description for Deploys zipped content to a specific environment of a static site. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *StaticSitesClient) createZipDeploymentForStaticSiteBuild(ctx context.Context, resourceGroupName string, name string, environmentName string, staticSiteZipDeploymentEnvelope StaticSiteZipDeploymentARMResource, options *StaticSitesBeginCreateZipDeploymentForStaticSiteBuildOptions) (*http.Response, error) { + req, err := client.createZipDeploymentForStaticSiteBuildCreateRequest(ctx, resourceGroupName, name, environmentName, staticSiteZipDeploymentEnvelope, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, client.createZipDeploymentForStaticSiteBuildHandleError(resp) + } + return resp, nil +} + +// createZipDeploymentForStaticSiteBuildCreateRequest creates the CreateZipDeploymentForStaticSiteBuild request. +func (client *StaticSitesClient) createZipDeploymentForStaticSiteBuildCreateRequest(ctx context.Context, resourceGroupName string, name string, environmentName string, staticSiteZipDeploymentEnvelope StaticSiteZipDeploymentARMResource, options *StaticSitesBeginCreateZipDeploymentForStaticSiteBuildOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{environmentName}/zipdeploy" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if environmentName == "" { + return nil, errors.New("parameter environmentName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{environmentName}", url.PathEscape(environmentName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, staticSiteZipDeploymentEnvelope) +} + +// createZipDeploymentForStaticSiteBuildHandleError handles the CreateZipDeploymentForStaticSiteBuild error response. +func (client *StaticSitesClient) createZipDeploymentForStaticSiteBuildHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// BeginDeletePrivateEndpointConnection - Description for Deletes a private endpoint connection +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *StaticSitesClient) BeginDeletePrivateEndpointConnection(ctx context.Context, resourceGroupName string, name string, privateEndpointConnectionName string, options *StaticSitesBeginDeletePrivateEndpointConnectionOptions) (StaticSitesDeletePrivateEndpointConnectionPollerResponse, error) { + resp, err := client.deletePrivateEndpointConnection(ctx, resourceGroupName, name, privateEndpointConnectionName, options) + if err != nil { + return StaticSitesDeletePrivateEndpointConnectionPollerResponse{}, err + } + result := StaticSitesDeletePrivateEndpointConnectionPollerResponse{ + RawResponse: resp, + } + pt, err := armruntime.NewPoller("StaticSitesClient.DeletePrivateEndpointConnection", "", resp, client.pl, client.deletePrivateEndpointConnectionHandleError) + if err != nil { + return StaticSitesDeletePrivateEndpointConnectionPollerResponse{}, err + } + result.Poller = &StaticSitesDeletePrivateEndpointConnectionPoller{ + pt: pt, + } + return result, nil +} + +// DeletePrivateEndpointConnection - Description for Deletes a private endpoint connection +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *StaticSitesClient) deletePrivateEndpointConnection(ctx context.Context, resourceGroupName string, name string, privateEndpointConnectionName string, options *StaticSitesBeginDeletePrivateEndpointConnectionOptions) (*http.Response, error) { + req, err := client.deletePrivateEndpointConnectionCreateRequest(ctx, resourceGroupName, name, privateEndpointConnectionName, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, client.deletePrivateEndpointConnectionHandleError(resp) + } + return resp, nil +} + +// deletePrivateEndpointConnectionCreateRequest creates the DeletePrivateEndpointConnection request. +func (client *StaticSitesClient) deletePrivateEndpointConnectionCreateRequest(ctx context.Context, resourceGroupName string, name string, privateEndpointConnectionName string, options *StaticSitesBeginDeletePrivateEndpointConnectionOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/privateEndpointConnections/{privateEndpointConnectionName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if privateEndpointConnectionName == "" { + return nil, errors.New("parameter privateEndpointConnectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{privateEndpointConnectionName}", url.PathEscape(privateEndpointConnectionName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// deletePrivateEndpointConnectionHandleError handles the DeletePrivateEndpointConnection error response. +func (client *StaticSitesClient) deletePrivateEndpointConnectionHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// BeginDeleteStaticSite - Description for Deletes a static site. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *StaticSitesClient) BeginDeleteStaticSite(ctx context.Context, resourceGroupName string, name string, options *StaticSitesBeginDeleteStaticSiteOptions) (StaticSitesDeleteStaticSitePollerResponse, error) { + resp, err := client.deleteStaticSite(ctx, resourceGroupName, name, options) + if err != nil { + return StaticSitesDeleteStaticSitePollerResponse{}, err + } + result := StaticSitesDeleteStaticSitePollerResponse{ + RawResponse: resp, + } + pt, err := armruntime.NewPoller("StaticSitesClient.DeleteStaticSite", "", resp, client.pl, client.deleteStaticSiteHandleError) + if err != nil { + return StaticSitesDeleteStaticSitePollerResponse{}, err + } + result.Poller = &StaticSitesDeleteStaticSitePoller{ + pt: pt, + } + return result, nil +} + +// DeleteStaticSite - Description for Deletes a static site. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *StaticSitesClient) deleteStaticSite(ctx context.Context, resourceGroupName string, name string, options *StaticSitesBeginDeleteStaticSiteOptions) (*http.Response, error) { + req, err := client.deleteStaticSiteCreateRequest(ctx, resourceGroupName, name, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, client.deleteStaticSiteHandleError(resp) + } + return resp, nil +} + +// deleteStaticSiteCreateRequest creates the DeleteStaticSite request. +func (client *StaticSitesClient) deleteStaticSiteCreateRequest(ctx context.Context, resourceGroupName string, name string, options *StaticSitesBeginDeleteStaticSiteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// deleteStaticSiteHandleError handles the DeleteStaticSite error response. +func (client *StaticSitesClient) deleteStaticSiteHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// BeginDeleteStaticSiteBuild - Description for Deletes a static site build. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *StaticSitesClient) BeginDeleteStaticSiteBuild(ctx context.Context, resourceGroupName string, name string, environmentName string, options *StaticSitesBeginDeleteStaticSiteBuildOptions) (StaticSitesDeleteStaticSiteBuildPollerResponse, error) { + resp, err := client.deleteStaticSiteBuild(ctx, resourceGroupName, name, environmentName, options) + if err != nil { + return StaticSitesDeleteStaticSiteBuildPollerResponse{}, err + } + result := StaticSitesDeleteStaticSiteBuildPollerResponse{ + RawResponse: resp, + } + pt, err := armruntime.NewPoller("StaticSitesClient.DeleteStaticSiteBuild", "", resp, client.pl, client.deleteStaticSiteBuildHandleError) + if err != nil { + return StaticSitesDeleteStaticSiteBuildPollerResponse{}, err + } + result.Poller = &StaticSitesDeleteStaticSiteBuildPoller{ + pt: pt, + } + return result, nil +} + +// DeleteStaticSiteBuild - Description for Deletes a static site build. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *StaticSitesClient) deleteStaticSiteBuild(ctx context.Context, resourceGroupName string, name string, environmentName string, options *StaticSitesBeginDeleteStaticSiteBuildOptions) (*http.Response, error) { + req, err := client.deleteStaticSiteBuildCreateRequest(ctx, resourceGroupName, name, environmentName, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, client.deleteStaticSiteBuildHandleError(resp) + } + return resp, nil +} + +// deleteStaticSiteBuildCreateRequest creates the DeleteStaticSiteBuild request. +func (client *StaticSitesClient) deleteStaticSiteBuildCreateRequest(ctx context.Context, resourceGroupName string, name string, environmentName string, options *StaticSitesBeginDeleteStaticSiteBuildOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{environmentName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if environmentName == "" { + return nil, errors.New("parameter environmentName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{environmentName}", url.PathEscape(environmentName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// deleteStaticSiteBuildHandleError handles the DeleteStaticSiteBuild error response. +func (client *StaticSitesClient) deleteStaticSiteBuildHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// BeginDeleteStaticSiteCustomDomain - Description for Deletes a custom domain. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *StaticSitesClient) BeginDeleteStaticSiteCustomDomain(ctx context.Context, resourceGroupName string, name string, domainName string, options *StaticSitesBeginDeleteStaticSiteCustomDomainOptions) (StaticSitesDeleteStaticSiteCustomDomainPollerResponse, error) { + resp, err := client.deleteStaticSiteCustomDomain(ctx, resourceGroupName, name, domainName, options) + if err != nil { + return StaticSitesDeleteStaticSiteCustomDomainPollerResponse{}, err + } + result := StaticSitesDeleteStaticSiteCustomDomainPollerResponse{ + RawResponse: resp, + } + pt, err := armruntime.NewPoller("StaticSitesClient.DeleteStaticSiteCustomDomain", "", resp, client.pl, client.deleteStaticSiteCustomDomainHandleError) + if err != nil { + return StaticSitesDeleteStaticSiteCustomDomainPollerResponse{}, err + } + result.Poller = &StaticSitesDeleteStaticSiteCustomDomainPoller{ + pt: pt, + } + return result, nil +} + +// DeleteStaticSiteCustomDomain - Description for Deletes a custom domain. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *StaticSitesClient) deleteStaticSiteCustomDomain(ctx context.Context, resourceGroupName string, name string, domainName string, options *StaticSitesBeginDeleteStaticSiteCustomDomainOptions) (*http.Response, error) { + req, err := client.deleteStaticSiteCustomDomainCreateRequest(ctx, resourceGroupName, name, domainName, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, client.deleteStaticSiteCustomDomainHandleError(resp) + } + return resp, nil +} + +// deleteStaticSiteCustomDomainCreateRequest creates the DeleteStaticSiteCustomDomain request. +func (client *StaticSitesClient) deleteStaticSiteCustomDomainCreateRequest(ctx context.Context, resourceGroupName string, name string, domainName string, options *StaticSitesBeginDeleteStaticSiteCustomDomainOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/customDomains/{domainName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if domainName == "" { + return nil, errors.New("parameter domainName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{domainName}", url.PathEscape(domainName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// deleteStaticSiteCustomDomainHandleError handles the DeleteStaticSiteCustomDomain error response. +func (client *StaticSitesClient) deleteStaticSiteCustomDomainHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// DeleteStaticSiteUser - Description for Deletes the user entry from the static site. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *StaticSitesClient) DeleteStaticSiteUser(ctx context.Context, resourceGroupName string, name string, authprovider string, userid string, options *StaticSitesDeleteStaticSiteUserOptions) (StaticSitesDeleteStaticSiteUserResponse, error) { + req, err := client.deleteStaticSiteUserCreateRequest(ctx, resourceGroupName, name, authprovider, userid, options) + if err != nil { + return StaticSitesDeleteStaticSiteUserResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return StaticSitesDeleteStaticSiteUserResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return StaticSitesDeleteStaticSiteUserResponse{}, client.deleteStaticSiteUserHandleError(resp) + } + return StaticSitesDeleteStaticSiteUserResponse{RawResponse: resp}, nil +} + +// deleteStaticSiteUserCreateRequest creates the DeleteStaticSiteUser request. +func (client *StaticSitesClient) deleteStaticSiteUserCreateRequest(ctx context.Context, resourceGroupName string, name string, authprovider string, userid string, options *StaticSitesDeleteStaticSiteUserOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/authproviders/{authprovider}/users/{userid}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if authprovider == "" { + return nil, errors.New("parameter authprovider cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{authprovider}", url.PathEscape(authprovider)) + if userid == "" { + return nil, errors.New("parameter userid cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{userid}", url.PathEscape(userid)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// deleteStaticSiteUserHandleError handles the DeleteStaticSiteUser error response. +func (client *StaticSitesClient) deleteStaticSiteUserHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// BeginDetachStaticSite - Description for Detaches a static site. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *StaticSitesClient) BeginDetachStaticSite(ctx context.Context, resourceGroupName string, name string, options *StaticSitesBeginDetachStaticSiteOptions) (StaticSitesDetachStaticSitePollerResponse, error) { + resp, err := client.detachStaticSite(ctx, resourceGroupName, name, options) + if err != nil { + return StaticSitesDetachStaticSitePollerResponse{}, err + } + result := StaticSitesDetachStaticSitePollerResponse{ + RawResponse: resp, + } + pt, err := armruntime.NewPoller("StaticSitesClient.DetachStaticSite", "", resp, client.pl, client.detachStaticSiteHandleError) + if err != nil { + return StaticSitesDetachStaticSitePollerResponse{}, err + } + result.Poller = &StaticSitesDetachStaticSitePoller{ + pt: pt, + } + return result, nil +} + +// DetachStaticSite - Description for Detaches a static site. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *StaticSitesClient) detachStaticSite(ctx context.Context, resourceGroupName string, name string, options *StaticSitesBeginDetachStaticSiteOptions) (*http.Response, error) { + req, err := client.detachStaticSiteCreateRequest(ctx, resourceGroupName, name, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, client.detachStaticSiteHandleError(resp) + } + return resp, nil +} + +// detachStaticSiteCreateRequest creates the DetachStaticSite request. +func (client *StaticSitesClient) detachStaticSiteCreateRequest(ctx context.Context, resourceGroupName string, name string, options *StaticSitesBeginDetachStaticSiteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/detach" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// detachStaticSiteHandleError handles the DetachStaticSite error response. +func (client *StaticSitesClient) detachStaticSiteHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// DetachUserProvidedFunctionAppFromStaticSite - Description for Detach the user provided function app from the static site +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *StaticSitesClient) DetachUserProvidedFunctionAppFromStaticSite(ctx context.Context, resourceGroupName string, name string, functionAppName string, options *StaticSitesDetachUserProvidedFunctionAppFromStaticSiteOptions) (StaticSitesDetachUserProvidedFunctionAppFromStaticSiteResponse, error) { + req, err := client.detachUserProvidedFunctionAppFromStaticSiteCreateRequest(ctx, resourceGroupName, name, functionAppName, options) + if err != nil { + return StaticSitesDetachUserProvidedFunctionAppFromStaticSiteResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return StaticSitesDetachUserProvidedFunctionAppFromStaticSiteResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { + return StaticSitesDetachUserProvidedFunctionAppFromStaticSiteResponse{}, client.detachUserProvidedFunctionAppFromStaticSiteHandleError(resp) + } + return StaticSitesDetachUserProvidedFunctionAppFromStaticSiteResponse{RawResponse: resp}, nil +} + +// detachUserProvidedFunctionAppFromStaticSiteCreateRequest creates the DetachUserProvidedFunctionAppFromStaticSite request. +func (client *StaticSitesClient) detachUserProvidedFunctionAppFromStaticSiteCreateRequest(ctx context.Context, resourceGroupName string, name string, functionAppName string, options *StaticSitesDetachUserProvidedFunctionAppFromStaticSiteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/userProvidedFunctionApps/{functionAppName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if functionAppName == "" { + return nil, errors.New("parameter functionAppName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{functionAppName}", url.PathEscape(functionAppName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// detachUserProvidedFunctionAppFromStaticSiteHandleError handles the DetachUserProvidedFunctionAppFromStaticSite error response. +func (client *StaticSitesClient) detachUserProvidedFunctionAppFromStaticSiteHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// DetachUserProvidedFunctionAppFromStaticSiteBuild - Description for Detach the user provided function app from the static site build +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *StaticSitesClient) DetachUserProvidedFunctionAppFromStaticSiteBuild(ctx context.Context, resourceGroupName string, name string, environmentName string, functionAppName string, options *StaticSitesDetachUserProvidedFunctionAppFromStaticSiteBuildOptions) (StaticSitesDetachUserProvidedFunctionAppFromStaticSiteBuildResponse, error) { + req, err := client.detachUserProvidedFunctionAppFromStaticSiteBuildCreateRequest(ctx, resourceGroupName, name, environmentName, functionAppName, options) + if err != nil { + return StaticSitesDetachUserProvidedFunctionAppFromStaticSiteBuildResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return StaticSitesDetachUserProvidedFunctionAppFromStaticSiteBuildResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { + return StaticSitesDetachUserProvidedFunctionAppFromStaticSiteBuildResponse{}, client.detachUserProvidedFunctionAppFromStaticSiteBuildHandleError(resp) + } + return StaticSitesDetachUserProvidedFunctionAppFromStaticSiteBuildResponse{RawResponse: resp}, nil +} + +// detachUserProvidedFunctionAppFromStaticSiteBuildCreateRequest creates the DetachUserProvidedFunctionAppFromStaticSiteBuild request. +func (client *StaticSitesClient) detachUserProvidedFunctionAppFromStaticSiteBuildCreateRequest(ctx context.Context, resourceGroupName string, name string, environmentName string, functionAppName string, options *StaticSitesDetachUserProvidedFunctionAppFromStaticSiteBuildOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{environmentName}/userProvidedFunctionApps/{functionAppName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if environmentName == "" { + return nil, errors.New("parameter environmentName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{environmentName}", url.PathEscape(environmentName)) + if functionAppName == "" { + return nil, errors.New("parameter functionAppName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{functionAppName}", url.PathEscape(functionAppName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// detachUserProvidedFunctionAppFromStaticSiteBuildHandleError handles the DetachUserProvidedFunctionAppFromStaticSiteBuild error response. +func (client *StaticSitesClient) detachUserProvidedFunctionAppFromStaticSiteBuildHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetPrivateEndpointConnection - Description for Gets a private endpoint connection +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *StaticSitesClient) GetPrivateEndpointConnection(ctx context.Context, resourceGroupName string, name string, privateEndpointConnectionName string, options *StaticSitesGetPrivateEndpointConnectionOptions) (StaticSitesGetPrivateEndpointConnectionResponse, error) { + req, err := client.getPrivateEndpointConnectionCreateRequest(ctx, resourceGroupName, name, privateEndpointConnectionName, options) + if err != nil { + return StaticSitesGetPrivateEndpointConnectionResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return StaticSitesGetPrivateEndpointConnectionResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return StaticSitesGetPrivateEndpointConnectionResponse{}, client.getPrivateEndpointConnectionHandleError(resp) + } + return client.getPrivateEndpointConnectionHandleResponse(resp) +} + +// getPrivateEndpointConnectionCreateRequest creates the GetPrivateEndpointConnection request. +func (client *StaticSitesClient) getPrivateEndpointConnectionCreateRequest(ctx context.Context, resourceGroupName string, name string, privateEndpointConnectionName string, options *StaticSitesGetPrivateEndpointConnectionOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/privateEndpointConnections/{privateEndpointConnectionName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if privateEndpointConnectionName == "" { + return nil, errors.New("parameter privateEndpointConnectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{privateEndpointConnectionName}", url.PathEscape(privateEndpointConnectionName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getPrivateEndpointConnectionHandleResponse handles the GetPrivateEndpointConnection response. +func (client *StaticSitesClient) getPrivateEndpointConnectionHandleResponse(resp *http.Response) (StaticSitesGetPrivateEndpointConnectionResponse, error) { + result := StaticSitesGetPrivateEndpointConnectionResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.RemotePrivateEndpointConnectionARMResource); err != nil { + return StaticSitesGetPrivateEndpointConnectionResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getPrivateEndpointConnectionHandleError handles the GetPrivateEndpointConnection error response. +func (client *StaticSitesClient) getPrivateEndpointConnectionHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetPrivateEndpointConnectionList - Description for Gets the list of private endpoint connections associated with a static site +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *StaticSitesClient) GetPrivateEndpointConnectionList(resourceGroupName string, name string, options *StaticSitesGetPrivateEndpointConnectionListOptions) *StaticSitesGetPrivateEndpointConnectionListPager { + return &StaticSitesGetPrivateEndpointConnectionListPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.getPrivateEndpointConnectionListCreateRequest(ctx, resourceGroupName, name, options) + }, + advancer: func(ctx context.Context, resp StaticSitesGetPrivateEndpointConnectionListResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.PrivateEndpointConnectionCollection.NextLink) + }, + } +} + +// getPrivateEndpointConnectionListCreateRequest creates the GetPrivateEndpointConnectionList request. +func (client *StaticSitesClient) getPrivateEndpointConnectionListCreateRequest(ctx context.Context, resourceGroupName string, name string, options *StaticSitesGetPrivateEndpointConnectionListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/privateEndpointConnections" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getPrivateEndpointConnectionListHandleResponse handles the GetPrivateEndpointConnectionList response. +func (client *StaticSitesClient) getPrivateEndpointConnectionListHandleResponse(resp *http.Response) (StaticSitesGetPrivateEndpointConnectionListResponse, error) { + result := StaticSitesGetPrivateEndpointConnectionListResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.PrivateEndpointConnectionCollection); err != nil { + return StaticSitesGetPrivateEndpointConnectionListResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getPrivateEndpointConnectionListHandleError handles the GetPrivateEndpointConnectionList error response. +func (client *StaticSitesClient) getPrivateEndpointConnectionListHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetPrivateLinkResources - Description for Gets the private link resources +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *StaticSitesClient) GetPrivateLinkResources(ctx context.Context, resourceGroupName string, name string, options *StaticSitesGetPrivateLinkResourcesOptions) (StaticSitesGetPrivateLinkResourcesResponse, error) { + req, err := client.getPrivateLinkResourcesCreateRequest(ctx, resourceGroupName, name, options) + if err != nil { + return StaticSitesGetPrivateLinkResourcesResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return StaticSitesGetPrivateLinkResourcesResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return StaticSitesGetPrivateLinkResourcesResponse{}, client.getPrivateLinkResourcesHandleError(resp) + } + return client.getPrivateLinkResourcesHandleResponse(resp) +} + +// getPrivateLinkResourcesCreateRequest creates the GetPrivateLinkResources request. +func (client *StaticSitesClient) getPrivateLinkResourcesCreateRequest(ctx context.Context, resourceGroupName string, name string, options *StaticSitesGetPrivateLinkResourcesOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/privateLinkResources" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getPrivateLinkResourcesHandleResponse handles the GetPrivateLinkResources response. +func (client *StaticSitesClient) getPrivateLinkResourcesHandleResponse(resp *http.Response) (StaticSitesGetPrivateLinkResourcesResponse, error) { + result := StaticSitesGetPrivateLinkResourcesResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.PrivateLinkResourcesWrapper); err != nil { + return StaticSitesGetPrivateLinkResourcesResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getPrivateLinkResourcesHandleError handles the GetPrivateLinkResources error response. +func (client *StaticSitesClient) getPrivateLinkResourcesHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetStaticSite - Description for Gets the details of a static site. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *StaticSitesClient) GetStaticSite(ctx context.Context, resourceGroupName string, name string, options *StaticSitesGetStaticSiteOptions) (StaticSitesGetStaticSiteResponse, error) { + req, err := client.getStaticSiteCreateRequest(ctx, resourceGroupName, name, options) + if err != nil { + return StaticSitesGetStaticSiteResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return StaticSitesGetStaticSiteResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return StaticSitesGetStaticSiteResponse{}, client.getStaticSiteHandleError(resp) + } + return client.getStaticSiteHandleResponse(resp) +} + +// getStaticSiteCreateRequest creates the GetStaticSite request. +func (client *StaticSitesClient) getStaticSiteCreateRequest(ctx context.Context, resourceGroupName string, name string, options *StaticSitesGetStaticSiteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getStaticSiteHandleResponse handles the GetStaticSite response. +func (client *StaticSitesClient) getStaticSiteHandleResponse(resp *http.Response) (StaticSitesGetStaticSiteResponse, error) { + result := StaticSitesGetStaticSiteResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.StaticSiteARMResource); err != nil { + return StaticSitesGetStaticSiteResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getStaticSiteHandleError handles the GetStaticSite error response. +func (client *StaticSitesClient) getStaticSiteHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetStaticSiteBuild - Description for Gets the details of a static site build. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *StaticSitesClient) GetStaticSiteBuild(ctx context.Context, resourceGroupName string, name string, environmentName string, options *StaticSitesGetStaticSiteBuildOptions) (StaticSitesGetStaticSiteBuildResponse, error) { + req, err := client.getStaticSiteBuildCreateRequest(ctx, resourceGroupName, name, environmentName, options) + if err != nil { + return StaticSitesGetStaticSiteBuildResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return StaticSitesGetStaticSiteBuildResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return StaticSitesGetStaticSiteBuildResponse{}, client.getStaticSiteBuildHandleError(resp) + } + return client.getStaticSiteBuildHandleResponse(resp) +} + +// getStaticSiteBuildCreateRequest creates the GetStaticSiteBuild request. +func (client *StaticSitesClient) getStaticSiteBuildCreateRequest(ctx context.Context, resourceGroupName string, name string, environmentName string, options *StaticSitesGetStaticSiteBuildOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{environmentName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if environmentName == "" { + return nil, errors.New("parameter environmentName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{environmentName}", url.PathEscape(environmentName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getStaticSiteBuildHandleResponse handles the GetStaticSiteBuild response. +func (client *StaticSitesClient) getStaticSiteBuildHandleResponse(resp *http.Response) (StaticSitesGetStaticSiteBuildResponse, error) { + result := StaticSitesGetStaticSiteBuildResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.StaticSiteBuildARMResource); err != nil { + return StaticSitesGetStaticSiteBuildResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getStaticSiteBuildHandleError handles the GetStaticSiteBuild error response. +func (client *StaticSitesClient) getStaticSiteBuildHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetStaticSiteBuilds - Description for Gets all static site builds for a particular static site. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *StaticSitesClient) GetStaticSiteBuilds(resourceGroupName string, name string, options *StaticSitesGetStaticSiteBuildsOptions) *StaticSitesGetStaticSiteBuildsPager { + return &StaticSitesGetStaticSiteBuildsPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.getStaticSiteBuildsCreateRequest(ctx, resourceGroupName, name, options) + }, + advancer: func(ctx context.Context, resp StaticSitesGetStaticSiteBuildsResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.StaticSiteBuildCollection.NextLink) + }, + } +} + +// getStaticSiteBuildsCreateRequest creates the GetStaticSiteBuilds request. +func (client *StaticSitesClient) getStaticSiteBuildsCreateRequest(ctx context.Context, resourceGroupName string, name string, options *StaticSitesGetStaticSiteBuildsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getStaticSiteBuildsHandleResponse handles the GetStaticSiteBuilds response. +func (client *StaticSitesClient) getStaticSiteBuildsHandleResponse(resp *http.Response) (StaticSitesGetStaticSiteBuildsResponse, error) { + result := StaticSitesGetStaticSiteBuildsResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.StaticSiteBuildCollection); err != nil { + return StaticSitesGetStaticSiteBuildsResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getStaticSiteBuildsHandleError handles the GetStaticSiteBuilds error response. +func (client *StaticSitesClient) getStaticSiteBuildsHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetStaticSiteCustomDomain - Description for Gets an existing custom domain for a particular static site. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *StaticSitesClient) GetStaticSiteCustomDomain(ctx context.Context, resourceGroupName string, name string, domainName string, options *StaticSitesGetStaticSiteCustomDomainOptions) (StaticSitesGetStaticSiteCustomDomainResponse, error) { + req, err := client.getStaticSiteCustomDomainCreateRequest(ctx, resourceGroupName, name, domainName, options) + if err != nil { + return StaticSitesGetStaticSiteCustomDomainResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return StaticSitesGetStaticSiteCustomDomainResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return StaticSitesGetStaticSiteCustomDomainResponse{}, client.getStaticSiteCustomDomainHandleError(resp) + } + return client.getStaticSiteCustomDomainHandleResponse(resp) +} + +// getStaticSiteCustomDomainCreateRequest creates the GetStaticSiteCustomDomain request. +func (client *StaticSitesClient) getStaticSiteCustomDomainCreateRequest(ctx context.Context, resourceGroupName string, name string, domainName string, options *StaticSitesGetStaticSiteCustomDomainOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/customDomains/{domainName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if domainName == "" { + return nil, errors.New("parameter domainName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{domainName}", url.PathEscape(domainName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getStaticSiteCustomDomainHandleResponse handles the GetStaticSiteCustomDomain response. +func (client *StaticSitesClient) getStaticSiteCustomDomainHandleResponse(resp *http.Response) (StaticSitesGetStaticSiteCustomDomainResponse, error) { + result := StaticSitesGetStaticSiteCustomDomainResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.StaticSiteCustomDomainOverviewARMResource); err != nil { + return StaticSitesGetStaticSiteCustomDomainResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getStaticSiteCustomDomainHandleError handles the GetStaticSiteCustomDomain error response. +func (client *StaticSitesClient) getStaticSiteCustomDomainHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetStaticSitesByResourceGroup - Description for Gets all static sites in the specified resource group. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *StaticSitesClient) GetStaticSitesByResourceGroup(resourceGroupName string, options *StaticSitesGetStaticSitesByResourceGroupOptions) *StaticSitesGetStaticSitesByResourceGroupPager { + return &StaticSitesGetStaticSitesByResourceGroupPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.getStaticSitesByResourceGroupCreateRequest(ctx, resourceGroupName, options) + }, + advancer: func(ctx context.Context, resp StaticSitesGetStaticSitesByResourceGroupResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.StaticSiteCollection.NextLink) + }, + } +} + +// getStaticSitesByResourceGroupCreateRequest creates the GetStaticSitesByResourceGroup request. +func (client *StaticSitesClient) getStaticSitesByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *StaticSitesGetStaticSitesByResourceGroupOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getStaticSitesByResourceGroupHandleResponse handles the GetStaticSitesByResourceGroup response. +func (client *StaticSitesClient) getStaticSitesByResourceGroupHandleResponse(resp *http.Response) (StaticSitesGetStaticSitesByResourceGroupResponse, error) { + result := StaticSitesGetStaticSitesByResourceGroupResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.StaticSiteCollection); err != nil { + return StaticSitesGetStaticSitesByResourceGroupResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getStaticSitesByResourceGroupHandleError handles the GetStaticSitesByResourceGroup error response. +func (client *StaticSitesClient) getStaticSitesByResourceGroupHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetUserProvidedFunctionAppForStaticSite - Description for Gets the details of the user provided function app registered with a static site +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *StaticSitesClient) GetUserProvidedFunctionAppForStaticSite(ctx context.Context, resourceGroupName string, name string, functionAppName string, options *StaticSitesGetUserProvidedFunctionAppForStaticSiteOptions) (StaticSitesGetUserProvidedFunctionAppForStaticSiteResponse, error) { + req, err := client.getUserProvidedFunctionAppForStaticSiteCreateRequest(ctx, resourceGroupName, name, functionAppName, options) + if err != nil { + return StaticSitesGetUserProvidedFunctionAppForStaticSiteResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return StaticSitesGetUserProvidedFunctionAppForStaticSiteResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return StaticSitesGetUserProvidedFunctionAppForStaticSiteResponse{}, client.getUserProvidedFunctionAppForStaticSiteHandleError(resp) + } + return client.getUserProvidedFunctionAppForStaticSiteHandleResponse(resp) +} + +// getUserProvidedFunctionAppForStaticSiteCreateRequest creates the GetUserProvidedFunctionAppForStaticSite request. +func (client *StaticSitesClient) getUserProvidedFunctionAppForStaticSiteCreateRequest(ctx context.Context, resourceGroupName string, name string, functionAppName string, options *StaticSitesGetUserProvidedFunctionAppForStaticSiteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/userProvidedFunctionApps/{functionAppName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if functionAppName == "" { + return nil, errors.New("parameter functionAppName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{functionAppName}", url.PathEscape(functionAppName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getUserProvidedFunctionAppForStaticSiteHandleResponse handles the GetUserProvidedFunctionAppForStaticSite response. +func (client *StaticSitesClient) getUserProvidedFunctionAppForStaticSiteHandleResponse(resp *http.Response) (StaticSitesGetUserProvidedFunctionAppForStaticSiteResponse, error) { + result := StaticSitesGetUserProvidedFunctionAppForStaticSiteResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.StaticSiteUserProvidedFunctionAppARMResource); err != nil { + return StaticSitesGetUserProvidedFunctionAppForStaticSiteResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getUserProvidedFunctionAppForStaticSiteHandleError handles the GetUserProvidedFunctionAppForStaticSite error response. +func (client *StaticSitesClient) getUserProvidedFunctionAppForStaticSiteHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetUserProvidedFunctionAppForStaticSiteBuild - Description for Gets the details of the user provided function app registered with a static site build +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *StaticSitesClient) GetUserProvidedFunctionAppForStaticSiteBuild(ctx context.Context, resourceGroupName string, name string, environmentName string, functionAppName string, options *StaticSitesGetUserProvidedFunctionAppForStaticSiteBuildOptions) (StaticSitesGetUserProvidedFunctionAppForStaticSiteBuildResponse, error) { + req, err := client.getUserProvidedFunctionAppForStaticSiteBuildCreateRequest(ctx, resourceGroupName, name, environmentName, functionAppName, options) + if err != nil { + return StaticSitesGetUserProvidedFunctionAppForStaticSiteBuildResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return StaticSitesGetUserProvidedFunctionAppForStaticSiteBuildResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return StaticSitesGetUserProvidedFunctionAppForStaticSiteBuildResponse{}, client.getUserProvidedFunctionAppForStaticSiteBuildHandleError(resp) + } + return client.getUserProvidedFunctionAppForStaticSiteBuildHandleResponse(resp) +} + +// getUserProvidedFunctionAppForStaticSiteBuildCreateRequest creates the GetUserProvidedFunctionAppForStaticSiteBuild request. +func (client *StaticSitesClient) getUserProvidedFunctionAppForStaticSiteBuildCreateRequest(ctx context.Context, resourceGroupName string, name string, environmentName string, functionAppName string, options *StaticSitesGetUserProvidedFunctionAppForStaticSiteBuildOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{environmentName}/userProvidedFunctionApps/{functionAppName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if environmentName == "" { + return nil, errors.New("parameter environmentName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{environmentName}", url.PathEscape(environmentName)) + if functionAppName == "" { + return nil, errors.New("parameter functionAppName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{functionAppName}", url.PathEscape(functionAppName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getUserProvidedFunctionAppForStaticSiteBuildHandleResponse handles the GetUserProvidedFunctionAppForStaticSiteBuild response. +func (client *StaticSitesClient) getUserProvidedFunctionAppForStaticSiteBuildHandleResponse(resp *http.Response) (StaticSitesGetUserProvidedFunctionAppForStaticSiteBuildResponse, error) { + result := StaticSitesGetUserProvidedFunctionAppForStaticSiteBuildResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.StaticSiteUserProvidedFunctionAppARMResource); err != nil { + return StaticSitesGetUserProvidedFunctionAppForStaticSiteBuildResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getUserProvidedFunctionAppForStaticSiteBuildHandleError handles the GetUserProvidedFunctionAppForStaticSiteBuild error response. +func (client *StaticSitesClient) getUserProvidedFunctionAppForStaticSiteBuildHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetUserProvidedFunctionAppsForStaticSite - Description for Gets the details of the user provided function apps registered with a static site +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *StaticSitesClient) GetUserProvidedFunctionAppsForStaticSite(resourceGroupName string, name string, options *StaticSitesGetUserProvidedFunctionAppsForStaticSiteOptions) *StaticSitesGetUserProvidedFunctionAppsForStaticSitePager { + return &StaticSitesGetUserProvidedFunctionAppsForStaticSitePager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.getUserProvidedFunctionAppsForStaticSiteCreateRequest(ctx, resourceGroupName, name, options) + }, + advancer: func(ctx context.Context, resp StaticSitesGetUserProvidedFunctionAppsForStaticSiteResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.StaticSiteUserProvidedFunctionAppsCollection.NextLink) + }, + } +} + +// getUserProvidedFunctionAppsForStaticSiteCreateRequest creates the GetUserProvidedFunctionAppsForStaticSite request. +func (client *StaticSitesClient) getUserProvidedFunctionAppsForStaticSiteCreateRequest(ctx context.Context, resourceGroupName string, name string, options *StaticSitesGetUserProvidedFunctionAppsForStaticSiteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/userProvidedFunctionApps" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getUserProvidedFunctionAppsForStaticSiteHandleResponse handles the GetUserProvidedFunctionAppsForStaticSite response. +func (client *StaticSitesClient) getUserProvidedFunctionAppsForStaticSiteHandleResponse(resp *http.Response) (StaticSitesGetUserProvidedFunctionAppsForStaticSiteResponse, error) { + result := StaticSitesGetUserProvidedFunctionAppsForStaticSiteResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.StaticSiteUserProvidedFunctionAppsCollection); err != nil { + return StaticSitesGetUserProvidedFunctionAppsForStaticSiteResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getUserProvidedFunctionAppsForStaticSiteHandleError handles the GetUserProvidedFunctionAppsForStaticSite error response. +func (client *StaticSitesClient) getUserProvidedFunctionAppsForStaticSiteHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetUserProvidedFunctionAppsForStaticSiteBuild - Description for Gets the details of the user provided function apps registered with a static site build +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *StaticSitesClient) GetUserProvidedFunctionAppsForStaticSiteBuild(resourceGroupName string, name string, environmentName string, options *StaticSitesGetUserProvidedFunctionAppsForStaticSiteBuildOptions) *StaticSitesGetUserProvidedFunctionAppsForStaticSiteBuildPager { + return &StaticSitesGetUserProvidedFunctionAppsForStaticSiteBuildPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.getUserProvidedFunctionAppsForStaticSiteBuildCreateRequest(ctx, resourceGroupName, name, environmentName, options) + }, + advancer: func(ctx context.Context, resp StaticSitesGetUserProvidedFunctionAppsForStaticSiteBuildResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.StaticSiteUserProvidedFunctionAppsCollection.NextLink) + }, + } +} + +// getUserProvidedFunctionAppsForStaticSiteBuildCreateRequest creates the GetUserProvidedFunctionAppsForStaticSiteBuild request. +func (client *StaticSitesClient) getUserProvidedFunctionAppsForStaticSiteBuildCreateRequest(ctx context.Context, resourceGroupName string, name string, environmentName string, options *StaticSitesGetUserProvidedFunctionAppsForStaticSiteBuildOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{environmentName}/userProvidedFunctionApps" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if environmentName == "" { + return nil, errors.New("parameter environmentName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{environmentName}", url.PathEscape(environmentName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getUserProvidedFunctionAppsForStaticSiteBuildHandleResponse handles the GetUserProvidedFunctionAppsForStaticSiteBuild response. +func (client *StaticSitesClient) getUserProvidedFunctionAppsForStaticSiteBuildHandleResponse(resp *http.Response) (StaticSitesGetUserProvidedFunctionAppsForStaticSiteBuildResponse, error) { + result := StaticSitesGetUserProvidedFunctionAppsForStaticSiteBuildResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.StaticSiteUserProvidedFunctionAppsCollection); err != nil { + return StaticSitesGetUserProvidedFunctionAppsForStaticSiteBuildResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getUserProvidedFunctionAppsForStaticSiteBuildHandleError handles the GetUserProvidedFunctionAppsForStaticSiteBuild error response. +func (client *StaticSitesClient) getUserProvidedFunctionAppsForStaticSiteBuildHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// List - Description for Get all Static Sites for a subscription. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *StaticSitesClient) List(options *StaticSitesListOptions) *StaticSitesListPager { + return &StaticSitesListPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listCreateRequest(ctx, options) + }, + advancer: func(ctx context.Context, resp StaticSitesListResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.StaticSiteCollection.NextLink) + }, + } +} + +// listCreateRequest creates the List request. +func (client *StaticSitesClient) listCreateRequest(ctx context.Context, options *StaticSitesListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Web/staticSites" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listHandleResponse handles the List response. +func (client *StaticSitesClient) listHandleResponse(resp *http.Response) (StaticSitesListResponse, error) { + result := StaticSitesListResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.StaticSiteCollection); err != nil { + return StaticSitesListResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listHandleError handles the List error response. +func (client *StaticSitesClient) listHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListStaticSiteAppSettings - Description for Gets the application settings of a static site. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *StaticSitesClient) ListStaticSiteAppSettings(ctx context.Context, resourceGroupName string, name string, options *StaticSitesListStaticSiteAppSettingsOptions) (StaticSitesListStaticSiteAppSettingsResponse, error) { + req, err := client.listStaticSiteAppSettingsCreateRequest(ctx, resourceGroupName, name, options) + if err != nil { + return StaticSitesListStaticSiteAppSettingsResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return StaticSitesListStaticSiteAppSettingsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return StaticSitesListStaticSiteAppSettingsResponse{}, client.listStaticSiteAppSettingsHandleError(resp) + } + return client.listStaticSiteAppSettingsHandleResponse(resp) +} + +// listStaticSiteAppSettingsCreateRequest creates the ListStaticSiteAppSettings request. +func (client *StaticSitesClient) listStaticSiteAppSettingsCreateRequest(ctx context.Context, resourceGroupName string, name string, options *StaticSitesListStaticSiteAppSettingsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/listAppSettings" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listStaticSiteAppSettingsHandleResponse handles the ListStaticSiteAppSettings response. +func (client *StaticSitesClient) listStaticSiteAppSettingsHandleResponse(resp *http.Response) (StaticSitesListStaticSiteAppSettingsResponse, error) { + result := StaticSitesListStaticSiteAppSettingsResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.StringDictionary); err != nil { + return StaticSitesListStaticSiteAppSettingsResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listStaticSiteAppSettingsHandleError handles the ListStaticSiteAppSettings error response. +func (client *StaticSitesClient) listStaticSiteAppSettingsHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListStaticSiteBuildAppSettings - Description for Gets the application settings of a static site build. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *StaticSitesClient) ListStaticSiteBuildAppSettings(ctx context.Context, resourceGroupName string, name string, environmentName string, options *StaticSitesListStaticSiteBuildAppSettingsOptions) (StaticSitesListStaticSiteBuildAppSettingsResponse, error) { + req, err := client.listStaticSiteBuildAppSettingsCreateRequest(ctx, resourceGroupName, name, environmentName, options) + if err != nil { + return StaticSitesListStaticSiteBuildAppSettingsResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return StaticSitesListStaticSiteBuildAppSettingsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return StaticSitesListStaticSiteBuildAppSettingsResponse{}, client.listStaticSiteBuildAppSettingsHandleError(resp) + } + return client.listStaticSiteBuildAppSettingsHandleResponse(resp) +} + +// listStaticSiteBuildAppSettingsCreateRequest creates the ListStaticSiteBuildAppSettings request. +func (client *StaticSitesClient) listStaticSiteBuildAppSettingsCreateRequest(ctx context.Context, resourceGroupName string, name string, environmentName string, options *StaticSitesListStaticSiteBuildAppSettingsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{environmentName}/listAppSettings" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if environmentName == "" { + return nil, errors.New("parameter environmentName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{environmentName}", url.PathEscape(environmentName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listStaticSiteBuildAppSettingsHandleResponse handles the ListStaticSiteBuildAppSettings response. +func (client *StaticSitesClient) listStaticSiteBuildAppSettingsHandleResponse(resp *http.Response) (StaticSitesListStaticSiteBuildAppSettingsResponse, error) { + result := StaticSitesListStaticSiteBuildAppSettingsResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.StringDictionary); err != nil { + return StaticSitesListStaticSiteBuildAppSettingsResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listStaticSiteBuildAppSettingsHandleError handles the ListStaticSiteBuildAppSettings error response. +func (client *StaticSitesClient) listStaticSiteBuildAppSettingsHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListStaticSiteBuildFunctionAppSettings - Description for Gets the application settings of a static site build. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *StaticSitesClient) ListStaticSiteBuildFunctionAppSettings(ctx context.Context, resourceGroupName string, name string, environmentName string, options *StaticSitesListStaticSiteBuildFunctionAppSettingsOptions) (StaticSitesListStaticSiteBuildFunctionAppSettingsResponse, error) { + req, err := client.listStaticSiteBuildFunctionAppSettingsCreateRequest(ctx, resourceGroupName, name, environmentName, options) + if err != nil { + return StaticSitesListStaticSiteBuildFunctionAppSettingsResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return StaticSitesListStaticSiteBuildFunctionAppSettingsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return StaticSitesListStaticSiteBuildFunctionAppSettingsResponse{}, client.listStaticSiteBuildFunctionAppSettingsHandleError(resp) + } + return client.listStaticSiteBuildFunctionAppSettingsHandleResponse(resp) +} + +// listStaticSiteBuildFunctionAppSettingsCreateRequest creates the ListStaticSiteBuildFunctionAppSettings request. +func (client *StaticSitesClient) listStaticSiteBuildFunctionAppSettingsCreateRequest(ctx context.Context, resourceGroupName string, name string, environmentName string, options *StaticSitesListStaticSiteBuildFunctionAppSettingsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{environmentName}/listFunctionAppSettings" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if environmentName == "" { + return nil, errors.New("parameter environmentName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{environmentName}", url.PathEscape(environmentName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listStaticSiteBuildFunctionAppSettingsHandleResponse handles the ListStaticSiteBuildFunctionAppSettings response. +func (client *StaticSitesClient) listStaticSiteBuildFunctionAppSettingsHandleResponse(resp *http.Response) (StaticSitesListStaticSiteBuildFunctionAppSettingsResponse, error) { + result := StaticSitesListStaticSiteBuildFunctionAppSettingsResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.StringDictionary); err != nil { + return StaticSitesListStaticSiteBuildFunctionAppSettingsResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listStaticSiteBuildFunctionAppSettingsHandleError handles the ListStaticSiteBuildFunctionAppSettings error response. +func (client *StaticSitesClient) listStaticSiteBuildFunctionAppSettingsHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListStaticSiteBuildFunctions - Description for Gets the functions of a particular static site build. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *StaticSitesClient) ListStaticSiteBuildFunctions(resourceGroupName string, name string, environmentName string, options *StaticSitesListStaticSiteBuildFunctionsOptions) *StaticSitesListStaticSiteBuildFunctionsPager { + return &StaticSitesListStaticSiteBuildFunctionsPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listStaticSiteBuildFunctionsCreateRequest(ctx, resourceGroupName, name, environmentName, options) + }, + advancer: func(ctx context.Context, resp StaticSitesListStaticSiteBuildFunctionsResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.StaticSiteFunctionOverviewCollection.NextLink) + }, + } +} + +// listStaticSiteBuildFunctionsCreateRequest creates the ListStaticSiteBuildFunctions request. +func (client *StaticSitesClient) listStaticSiteBuildFunctionsCreateRequest(ctx context.Context, resourceGroupName string, name string, environmentName string, options *StaticSitesListStaticSiteBuildFunctionsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{environmentName}/functions" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if environmentName == "" { + return nil, errors.New("parameter environmentName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{environmentName}", url.PathEscape(environmentName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listStaticSiteBuildFunctionsHandleResponse handles the ListStaticSiteBuildFunctions response. +func (client *StaticSitesClient) listStaticSiteBuildFunctionsHandleResponse(resp *http.Response) (StaticSitesListStaticSiteBuildFunctionsResponse, error) { + result := StaticSitesListStaticSiteBuildFunctionsResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.StaticSiteFunctionOverviewCollection); err != nil { + return StaticSitesListStaticSiteBuildFunctionsResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listStaticSiteBuildFunctionsHandleError handles the ListStaticSiteBuildFunctions error response. +func (client *StaticSitesClient) listStaticSiteBuildFunctionsHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListStaticSiteConfiguredRoles - Description for Lists the roles configured for the static site. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *StaticSitesClient) ListStaticSiteConfiguredRoles(ctx context.Context, resourceGroupName string, name string, options *StaticSitesListStaticSiteConfiguredRolesOptions) (StaticSitesListStaticSiteConfiguredRolesResponse, error) { + req, err := client.listStaticSiteConfiguredRolesCreateRequest(ctx, resourceGroupName, name, options) + if err != nil { + return StaticSitesListStaticSiteConfiguredRolesResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return StaticSitesListStaticSiteConfiguredRolesResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return StaticSitesListStaticSiteConfiguredRolesResponse{}, client.listStaticSiteConfiguredRolesHandleError(resp) + } + return client.listStaticSiteConfiguredRolesHandleResponse(resp) +} + +// listStaticSiteConfiguredRolesCreateRequest creates the ListStaticSiteConfiguredRoles request. +func (client *StaticSitesClient) listStaticSiteConfiguredRolesCreateRequest(ctx context.Context, resourceGroupName string, name string, options *StaticSitesListStaticSiteConfiguredRolesOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/listConfiguredRoles" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listStaticSiteConfiguredRolesHandleResponse handles the ListStaticSiteConfiguredRoles response. +func (client *StaticSitesClient) listStaticSiteConfiguredRolesHandleResponse(resp *http.Response) (StaticSitesListStaticSiteConfiguredRolesResponse, error) { + result := StaticSitesListStaticSiteConfiguredRolesResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.StringList); err != nil { + return StaticSitesListStaticSiteConfiguredRolesResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listStaticSiteConfiguredRolesHandleError handles the ListStaticSiteConfiguredRoles error response. +func (client *StaticSitesClient) listStaticSiteConfiguredRolesHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListStaticSiteCustomDomains - Description for Gets all static site custom domains for a particular static site. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *StaticSitesClient) ListStaticSiteCustomDomains(resourceGroupName string, name string, options *StaticSitesListStaticSiteCustomDomainsOptions) *StaticSitesListStaticSiteCustomDomainsPager { + return &StaticSitesListStaticSiteCustomDomainsPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listStaticSiteCustomDomainsCreateRequest(ctx, resourceGroupName, name, options) + }, + advancer: func(ctx context.Context, resp StaticSitesListStaticSiteCustomDomainsResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.StaticSiteCustomDomainOverviewCollection.NextLink) + }, + } +} + +// listStaticSiteCustomDomainsCreateRequest creates the ListStaticSiteCustomDomains request. +func (client *StaticSitesClient) listStaticSiteCustomDomainsCreateRequest(ctx context.Context, resourceGroupName string, name string, options *StaticSitesListStaticSiteCustomDomainsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/customDomains" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listStaticSiteCustomDomainsHandleResponse handles the ListStaticSiteCustomDomains response. +func (client *StaticSitesClient) listStaticSiteCustomDomainsHandleResponse(resp *http.Response) (StaticSitesListStaticSiteCustomDomainsResponse, error) { + result := StaticSitesListStaticSiteCustomDomainsResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.StaticSiteCustomDomainOverviewCollection); err != nil { + return StaticSitesListStaticSiteCustomDomainsResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listStaticSiteCustomDomainsHandleError handles the ListStaticSiteCustomDomains error response. +func (client *StaticSitesClient) listStaticSiteCustomDomainsHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListStaticSiteFunctionAppSettings - Description for Gets the application settings of a static site. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *StaticSitesClient) ListStaticSiteFunctionAppSettings(ctx context.Context, resourceGroupName string, name string, options *StaticSitesListStaticSiteFunctionAppSettingsOptions) (StaticSitesListStaticSiteFunctionAppSettingsResponse, error) { + req, err := client.listStaticSiteFunctionAppSettingsCreateRequest(ctx, resourceGroupName, name, options) + if err != nil { + return StaticSitesListStaticSiteFunctionAppSettingsResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return StaticSitesListStaticSiteFunctionAppSettingsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return StaticSitesListStaticSiteFunctionAppSettingsResponse{}, client.listStaticSiteFunctionAppSettingsHandleError(resp) + } + return client.listStaticSiteFunctionAppSettingsHandleResponse(resp) +} + +// listStaticSiteFunctionAppSettingsCreateRequest creates the ListStaticSiteFunctionAppSettings request. +func (client *StaticSitesClient) listStaticSiteFunctionAppSettingsCreateRequest(ctx context.Context, resourceGroupName string, name string, options *StaticSitesListStaticSiteFunctionAppSettingsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/listFunctionAppSettings" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listStaticSiteFunctionAppSettingsHandleResponse handles the ListStaticSiteFunctionAppSettings response. +func (client *StaticSitesClient) listStaticSiteFunctionAppSettingsHandleResponse(resp *http.Response) (StaticSitesListStaticSiteFunctionAppSettingsResponse, error) { + result := StaticSitesListStaticSiteFunctionAppSettingsResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.StringDictionary); err != nil { + return StaticSitesListStaticSiteFunctionAppSettingsResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listStaticSiteFunctionAppSettingsHandleError handles the ListStaticSiteFunctionAppSettings error response. +func (client *StaticSitesClient) listStaticSiteFunctionAppSettingsHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListStaticSiteFunctions - Description for Gets the functions of a static site. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *StaticSitesClient) ListStaticSiteFunctions(resourceGroupName string, name string, options *StaticSitesListStaticSiteFunctionsOptions) *StaticSitesListStaticSiteFunctionsPager { + return &StaticSitesListStaticSiteFunctionsPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listStaticSiteFunctionsCreateRequest(ctx, resourceGroupName, name, options) + }, + advancer: func(ctx context.Context, resp StaticSitesListStaticSiteFunctionsResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.StaticSiteFunctionOverviewCollection.NextLink) + }, + } +} + +// listStaticSiteFunctionsCreateRequest creates the ListStaticSiteFunctions request. +func (client *StaticSitesClient) listStaticSiteFunctionsCreateRequest(ctx context.Context, resourceGroupName string, name string, options *StaticSitesListStaticSiteFunctionsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/functions" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listStaticSiteFunctionsHandleResponse handles the ListStaticSiteFunctions response. +func (client *StaticSitesClient) listStaticSiteFunctionsHandleResponse(resp *http.Response) (StaticSitesListStaticSiteFunctionsResponse, error) { + result := StaticSitesListStaticSiteFunctionsResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.StaticSiteFunctionOverviewCollection); err != nil { + return StaticSitesListStaticSiteFunctionsResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listStaticSiteFunctionsHandleError handles the ListStaticSiteFunctions error response. +func (client *StaticSitesClient) listStaticSiteFunctionsHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListStaticSiteSecrets - Description for Lists the secrets for an existing static site. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *StaticSitesClient) ListStaticSiteSecrets(ctx context.Context, resourceGroupName string, name string, options *StaticSitesListStaticSiteSecretsOptions) (StaticSitesListStaticSiteSecretsResponse, error) { + req, err := client.listStaticSiteSecretsCreateRequest(ctx, resourceGroupName, name, options) + if err != nil { + return StaticSitesListStaticSiteSecretsResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return StaticSitesListStaticSiteSecretsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return StaticSitesListStaticSiteSecretsResponse{}, client.listStaticSiteSecretsHandleError(resp) + } + return client.listStaticSiteSecretsHandleResponse(resp) +} + +// listStaticSiteSecretsCreateRequest creates the ListStaticSiteSecrets request. +func (client *StaticSitesClient) listStaticSiteSecretsCreateRequest(ctx context.Context, resourceGroupName string, name string, options *StaticSitesListStaticSiteSecretsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/listSecrets" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listStaticSiteSecretsHandleResponse handles the ListStaticSiteSecrets response. +func (client *StaticSitesClient) listStaticSiteSecretsHandleResponse(resp *http.Response) (StaticSitesListStaticSiteSecretsResponse, error) { + result := StaticSitesListStaticSiteSecretsResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.StringDictionary); err != nil { + return StaticSitesListStaticSiteSecretsResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listStaticSiteSecretsHandleError handles the ListStaticSiteSecrets error response. +func (client *StaticSitesClient) listStaticSiteSecretsHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListStaticSiteUsers - Description for Gets the list of users of a static site. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *StaticSitesClient) ListStaticSiteUsers(resourceGroupName string, name string, authprovider string, options *StaticSitesListStaticSiteUsersOptions) *StaticSitesListStaticSiteUsersPager { + return &StaticSitesListStaticSiteUsersPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listStaticSiteUsersCreateRequest(ctx, resourceGroupName, name, authprovider, options) + }, + advancer: func(ctx context.Context, resp StaticSitesListStaticSiteUsersResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.StaticSiteUserCollection.NextLink) + }, + } +} + +// listStaticSiteUsersCreateRequest creates the ListStaticSiteUsers request. +func (client *StaticSitesClient) listStaticSiteUsersCreateRequest(ctx context.Context, resourceGroupName string, name string, authprovider string, options *StaticSitesListStaticSiteUsersOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/authproviders/{authprovider}/listUsers" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if authprovider == "" { + return nil, errors.New("parameter authprovider cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{authprovider}", url.PathEscape(authprovider)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listStaticSiteUsersHandleResponse handles the ListStaticSiteUsers response. +func (client *StaticSitesClient) listStaticSiteUsersHandleResponse(resp *http.Response) (StaticSitesListStaticSiteUsersResponse, error) { + result := StaticSitesListStaticSiteUsersResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.StaticSiteUserCollection); err != nil { + return StaticSitesListStaticSiteUsersResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listStaticSiteUsersHandleError handles the ListStaticSiteUsers error response. +func (client *StaticSitesClient) listStaticSiteUsersHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// PreviewWorkflow - Description for Generates a preview workflow file for the static site +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *StaticSitesClient) PreviewWorkflow(ctx context.Context, location string, staticSitesWorkflowPreviewRequest StaticSitesWorkflowPreviewRequest, options *StaticSitesPreviewWorkflowOptions) (StaticSitesPreviewWorkflowResponse, error) { + req, err := client.previewWorkflowCreateRequest(ctx, location, staticSitesWorkflowPreviewRequest, options) + if err != nil { + return StaticSitesPreviewWorkflowResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return StaticSitesPreviewWorkflowResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return StaticSitesPreviewWorkflowResponse{}, client.previewWorkflowHandleError(resp) + } + return client.previewWorkflowHandleResponse(resp) +} + +// previewWorkflowCreateRequest creates the PreviewWorkflow request. +func (client *StaticSitesClient) previewWorkflowCreateRequest(ctx context.Context, location string, staticSitesWorkflowPreviewRequest StaticSitesWorkflowPreviewRequest, options *StaticSitesPreviewWorkflowOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Web/locations/{location}/previewStaticSiteWorkflowFile" + if location == "" { + return nil, errors.New("parameter location cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, staticSitesWorkflowPreviewRequest) +} + +// previewWorkflowHandleResponse handles the PreviewWorkflow response. +func (client *StaticSitesClient) previewWorkflowHandleResponse(resp *http.Response) (StaticSitesPreviewWorkflowResponse, error) { + result := StaticSitesPreviewWorkflowResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.StaticSitesWorkflowPreview); err != nil { + return StaticSitesPreviewWorkflowResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// previewWorkflowHandleError handles the PreviewWorkflow error response. +func (client *StaticSitesClient) previewWorkflowHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// BeginRegisterUserProvidedFunctionAppWithStaticSite - Description for Register a user provided function app with a static site +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *StaticSitesClient) BeginRegisterUserProvidedFunctionAppWithStaticSite(ctx context.Context, resourceGroupName string, name string, functionAppName string, staticSiteUserProvidedFunctionEnvelope StaticSiteUserProvidedFunctionAppARMResource, options *StaticSitesBeginRegisterUserProvidedFunctionAppWithStaticSiteOptions) (StaticSitesRegisterUserProvidedFunctionAppWithStaticSitePollerResponse, error) { + resp, err := client.registerUserProvidedFunctionAppWithStaticSite(ctx, resourceGroupName, name, functionAppName, staticSiteUserProvidedFunctionEnvelope, options) + if err != nil { + return StaticSitesRegisterUserProvidedFunctionAppWithStaticSitePollerResponse{}, err + } + result := StaticSitesRegisterUserProvidedFunctionAppWithStaticSitePollerResponse{ + RawResponse: resp, + } + pt, err := armruntime.NewPoller("StaticSitesClient.RegisterUserProvidedFunctionAppWithStaticSite", "", resp, client.pl, client.registerUserProvidedFunctionAppWithStaticSiteHandleError) + if err != nil { + return StaticSitesRegisterUserProvidedFunctionAppWithStaticSitePollerResponse{}, err + } + result.Poller = &StaticSitesRegisterUserProvidedFunctionAppWithStaticSitePoller{ + pt: pt, + } + return result, nil +} + +// RegisterUserProvidedFunctionAppWithStaticSite - Description for Register a user provided function app with a static site +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *StaticSitesClient) registerUserProvidedFunctionAppWithStaticSite(ctx context.Context, resourceGroupName string, name string, functionAppName string, staticSiteUserProvidedFunctionEnvelope StaticSiteUserProvidedFunctionAppARMResource, options *StaticSitesBeginRegisterUserProvidedFunctionAppWithStaticSiteOptions) (*http.Response, error) { + req, err := client.registerUserProvidedFunctionAppWithStaticSiteCreateRequest(ctx, resourceGroupName, name, functionAppName, staticSiteUserProvidedFunctionEnvelope, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, client.registerUserProvidedFunctionAppWithStaticSiteHandleError(resp) + } + return resp, nil +} + +// registerUserProvidedFunctionAppWithStaticSiteCreateRequest creates the RegisterUserProvidedFunctionAppWithStaticSite request. +func (client *StaticSitesClient) registerUserProvidedFunctionAppWithStaticSiteCreateRequest(ctx context.Context, resourceGroupName string, name string, functionAppName string, staticSiteUserProvidedFunctionEnvelope StaticSiteUserProvidedFunctionAppARMResource, options *StaticSitesBeginRegisterUserProvidedFunctionAppWithStaticSiteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/userProvidedFunctionApps/{functionAppName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if functionAppName == "" { + return nil, errors.New("parameter functionAppName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{functionAppName}", url.PathEscape(functionAppName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + if options != nil && options.IsForced != nil { + reqQP.Set("isForced", strconv.FormatBool(*options.IsForced)) + } + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, staticSiteUserProvidedFunctionEnvelope) +} + +// registerUserProvidedFunctionAppWithStaticSiteHandleError handles the RegisterUserProvidedFunctionAppWithStaticSite error response. +func (client *StaticSitesClient) registerUserProvidedFunctionAppWithStaticSiteHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// BeginRegisterUserProvidedFunctionAppWithStaticSiteBuild - Description for Register a user provided function app with a static site build +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *StaticSitesClient) BeginRegisterUserProvidedFunctionAppWithStaticSiteBuild(ctx context.Context, resourceGroupName string, name string, environmentName string, functionAppName string, staticSiteUserProvidedFunctionEnvelope StaticSiteUserProvidedFunctionAppARMResource, options *StaticSitesBeginRegisterUserProvidedFunctionAppWithStaticSiteBuildOptions) (StaticSitesRegisterUserProvidedFunctionAppWithStaticSiteBuildPollerResponse, error) { + resp, err := client.registerUserProvidedFunctionAppWithStaticSiteBuild(ctx, resourceGroupName, name, environmentName, functionAppName, staticSiteUserProvidedFunctionEnvelope, options) + if err != nil { + return StaticSitesRegisterUserProvidedFunctionAppWithStaticSiteBuildPollerResponse{}, err + } + result := StaticSitesRegisterUserProvidedFunctionAppWithStaticSiteBuildPollerResponse{ + RawResponse: resp, + } + pt, err := armruntime.NewPoller("StaticSitesClient.RegisterUserProvidedFunctionAppWithStaticSiteBuild", "", resp, client.pl, client.registerUserProvidedFunctionAppWithStaticSiteBuildHandleError) + if err != nil { + return StaticSitesRegisterUserProvidedFunctionAppWithStaticSiteBuildPollerResponse{}, err + } + result.Poller = &StaticSitesRegisterUserProvidedFunctionAppWithStaticSiteBuildPoller{ + pt: pt, + } + return result, nil +} + +// RegisterUserProvidedFunctionAppWithStaticSiteBuild - Description for Register a user provided function app with a static site build +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *StaticSitesClient) registerUserProvidedFunctionAppWithStaticSiteBuild(ctx context.Context, resourceGroupName string, name string, environmentName string, functionAppName string, staticSiteUserProvidedFunctionEnvelope StaticSiteUserProvidedFunctionAppARMResource, options *StaticSitesBeginRegisterUserProvidedFunctionAppWithStaticSiteBuildOptions) (*http.Response, error) { + req, err := client.registerUserProvidedFunctionAppWithStaticSiteBuildCreateRequest(ctx, resourceGroupName, name, environmentName, functionAppName, staticSiteUserProvidedFunctionEnvelope, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, client.registerUserProvidedFunctionAppWithStaticSiteBuildHandleError(resp) + } + return resp, nil +} + +// registerUserProvidedFunctionAppWithStaticSiteBuildCreateRequest creates the RegisterUserProvidedFunctionAppWithStaticSiteBuild request. +func (client *StaticSitesClient) registerUserProvidedFunctionAppWithStaticSiteBuildCreateRequest(ctx context.Context, resourceGroupName string, name string, environmentName string, functionAppName string, staticSiteUserProvidedFunctionEnvelope StaticSiteUserProvidedFunctionAppARMResource, options *StaticSitesBeginRegisterUserProvidedFunctionAppWithStaticSiteBuildOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{environmentName}/userProvidedFunctionApps/{functionAppName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if environmentName == "" { + return nil, errors.New("parameter environmentName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{environmentName}", url.PathEscape(environmentName)) + if functionAppName == "" { + return nil, errors.New("parameter functionAppName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{functionAppName}", url.PathEscape(functionAppName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + if options != nil && options.IsForced != nil { + reqQP.Set("isForced", strconv.FormatBool(*options.IsForced)) + } + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, staticSiteUserProvidedFunctionEnvelope) +} + +// registerUserProvidedFunctionAppWithStaticSiteBuildHandleError handles the RegisterUserProvidedFunctionAppWithStaticSiteBuild error response. +func (client *StaticSitesClient) registerUserProvidedFunctionAppWithStaticSiteBuildHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ResetStaticSiteAPIKey - Description for Resets the api key for an existing static site. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *StaticSitesClient) ResetStaticSiteAPIKey(ctx context.Context, resourceGroupName string, name string, resetPropertiesEnvelope StaticSiteResetPropertiesARMResource, options *StaticSitesResetStaticSiteAPIKeyOptions) (StaticSitesResetStaticSiteAPIKeyResponse, error) { + req, err := client.resetStaticSiteAPIKeyCreateRequest(ctx, resourceGroupName, name, resetPropertiesEnvelope, options) + if err != nil { + return StaticSitesResetStaticSiteAPIKeyResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return StaticSitesResetStaticSiteAPIKeyResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return StaticSitesResetStaticSiteAPIKeyResponse{}, client.resetStaticSiteAPIKeyHandleError(resp) + } + return StaticSitesResetStaticSiteAPIKeyResponse{RawResponse: resp}, nil +} + +// resetStaticSiteAPIKeyCreateRequest creates the ResetStaticSiteAPIKey request. +func (client *StaticSitesClient) resetStaticSiteAPIKeyCreateRequest(ctx context.Context, resourceGroupName string, name string, resetPropertiesEnvelope StaticSiteResetPropertiesARMResource, options *StaticSitesResetStaticSiteAPIKeyOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/resetapikey" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, resetPropertiesEnvelope) +} + +// resetStaticSiteAPIKeyHandleError handles the ResetStaticSiteAPIKey error response. +func (client *StaticSitesClient) resetStaticSiteAPIKeyHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// UpdateStaticSite - Description for Creates a new static site in an existing resource group, or updates an existing static site. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *StaticSitesClient) UpdateStaticSite(ctx context.Context, resourceGroupName string, name string, staticSiteEnvelope StaticSitePatchResource, options *StaticSitesUpdateStaticSiteOptions) (StaticSitesUpdateStaticSiteResponse, error) { + req, err := client.updateStaticSiteCreateRequest(ctx, resourceGroupName, name, staticSiteEnvelope, options) + if err != nil { + return StaticSitesUpdateStaticSiteResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return StaticSitesUpdateStaticSiteResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return StaticSitesUpdateStaticSiteResponse{}, client.updateStaticSiteHandleError(resp) + } + return client.updateStaticSiteHandleResponse(resp) +} + +// updateStaticSiteCreateRequest creates the UpdateStaticSite request. +func (client *StaticSitesClient) updateStaticSiteCreateRequest(ctx context.Context, resourceGroupName string, name string, staticSiteEnvelope StaticSitePatchResource, options *StaticSitesUpdateStaticSiteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, staticSiteEnvelope) +} + +// updateStaticSiteHandleResponse handles the UpdateStaticSite response. +func (client *StaticSitesClient) updateStaticSiteHandleResponse(resp *http.Response) (StaticSitesUpdateStaticSiteResponse, error) { + result := StaticSitesUpdateStaticSiteResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.StaticSiteARMResource); err != nil { + return StaticSitesUpdateStaticSiteResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// updateStaticSiteHandleError handles the UpdateStaticSite error response. +func (client *StaticSitesClient) updateStaticSiteHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// UpdateStaticSiteUser - Description for Updates a user entry with the listed roles +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *StaticSitesClient) UpdateStaticSiteUser(ctx context.Context, resourceGroupName string, name string, authprovider string, userid string, staticSiteUserEnvelope StaticSiteUserARMResource, options *StaticSitesUpdateStaticSiteUserOptions) (StaticSitesUpdateStaticSiteUserResponse, error) { + req, err := client.updateStaticSiteUserCreateRequest(ctx, resourceGroupName, name, authprovider, userid, staticSiteUserEnvelope, options) + if err != nil { + return StaticSitesUpdateStaticSiteUserResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return StaticSitesUpdateStaticSiteUserResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return StaticSitesUpdateStaticSiteUserResponse{}, client.updateStaticSiteUserHandleError(resp) + } + return client.updateStaticSiteUserHandleResponse(resp) +} + +// updateStaticSiteUserCreateRequest creates the UpdateStaticSiteUser request. +func (client *StaticSitesClient) updateStaticSiteUserCreateRequest(ctx context.Context, resourceGroupName string, name string, authprovider string, userid string, staticSiteUserEnvelope StaticSiteUserARMResource, options *StaticSitesUpdateStaticSiteUserOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/authproviders/{authprovider}/users/{userid}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if authprovider == "" { + return nil, errors.New("parameter authprovider cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{authprovider}", url.PathEscape(authprovider)) + if userid == "" { + return nil, errors.New("parameter userid cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{userid}", url.PathEscape(userid)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, staticSiteUserEnvelope) +} + +// updateStaticSiteUserHandleResponse handles the UpdateStaticSiteUser response. +func (client *StaticSitesClient) updateStaticSiteUserHandleResponse(resp *http.Response) (StaticSitesUpdateStaticSiteUserResponse, error) { + result := StaticSitesUpdateStaticSiteUserResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.StaticSiteUserARMResource); err != nil { + return StaticSitesUpdateStaticSiteUserResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// updateStaticSiteUserHandleError handles the UpdateStaticSiteUser error response. +func (client *StaticSitesClient) updateStaticSiteUserHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// BeginValidateCustomDomainCanBeAddedToStaticSite - Description for Validates a particular custom domain can be added to a static site. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *StaticSitesClient) BeginValidateCustomDomainCanBeAddedToStaticSite(ctx context.Context, resourceGroupName string, name string, domainName string, staticSiteCustomDomainRequestPropertiesEnvelope StaticSiteCustomDomainRequestPropertiesARMResource, options *StaticSitesBeginValidateCustomDomainCanBeAddedToStaticSiteOptions) (StaticSitesValidateCustomDomainCanBeAddedToStaticSitePollerResponse, error) { + resp, err := client.validateCustomDomainCanBeAddedToStaticSite(ctx, resourceGroupName, name, domainName, staticSiteCustomDomainRequestPropertiesEnvelope, options) + if err != nil { + return StaticSitesValidateCustomDomainCanBeAddedToStaticSitePollerResponse{}, err + } + result := StaticSitesValidateCustomDomainCanBeAddedToStaticSitePollerResponse{ + RawResponse: resp, + } + pt, err := armruntime.NewPoller("StaticSitesClient.ValidateCustomDomainCanBeAddedToStaticSite", "", resp, client.pl, client.validateCustomDomainCanBeAddedToStaticSiteHandleError) + if err != nil { + return StaticSitesValidateCustomDomainCanBeAddedToStaticSitePollerResponse{}, err + } + result.Poller = &StaticSitesValidateCustomDomainCanBeAddedToStaticSitePoller{ + pt: pt, + } + return result, nil +} + +// ValidateCustomDomainCanBeAddedToStaticSite - Description for Validates a particular custom domain can be added to a static site. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *StaticSitesClient) validateCustomDomainCanBeAddedToStaticSite(ctx context.Context, resourceGroupName string, name string, domainName string, staticSiteCustomDomainRequestPropertiesEnvelope StaticSiteCustomDomainRequestPropertiesARMResource, options *StaticSitesBeginValidateCustomDomainCanBeAddedToStaticSiteOptions) (*http.Response, error) { + req, err := client.validateCustomDomainCanBeAddedToStaticSiteCreateRequest(ctx, resourceGroupName, name, domainName, staticSiteCustomDomainRequestPropertiesEnvelope, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, client.validateCustomDomainCanBeAddedToStaticSiteHandleError(resp) + } + return resp, nil +} + +// validateCustomDomainCanBeAddedToStaticSiteCreateRequest creates the ValidateCustomDomainCanBeAddedToStaticSite request. +func (client *StaticSitesClient) validateCustomDomainCanBeAddedToStaticSiteCreateRequest(ctx context.Context, resourceGroupName string, name string, domainName string, staticSiteCustomDomainRequestPropertiesEnvelope StaticSiteCustomDomainRequestPropertiesARMResource, options *StaticSitesBeginValidateCustomDomainCanBeAddedToStaticSiteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/customDomains/{domainName}/validate" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if domainName == "" { + return nil, errors.New("parameter domainName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{domainName}", url.PathEscape(domainName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, staticSiteCustomDomainRequestPropertiesEnvelope) +} + +// validateCustomDomainCanBeAddedToStaticSiteHandleError handles the ValidateCustomDomainCanBeAddedToStaticSite error response. +func (client *StaticSitesClient) validateCustomDomainCanBeAddedToStaticSiteHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} diff --git a/sdk/resourcemanager/appservice/armappservice/zz_generated_time_rfc3339.go b/sdk/resourcemanager/appservice/armappservice/zz_generated_time_rfc3339.go new file mode 100644 index 000000000000..1ef51d74a189 --- /dev/null +++ b/sdk/resourcemanager/appservice/armappservice/zz_generated_time_rfc3339.go @@ -0,0 +1,85 @@ +//go:build go1.16 +// +build go1.16 + +// 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. + +package armappservice + +import ( + "encoding/json" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "reflect" + "regexp" + "strings" + "time" +) + +const ( + utcLayoutJSON = `"2006-01-02T15:04:05.999999999"` + utcLayout = "2006-01-02T15:04:05.999999999" + rfc3339JSON = `"` + time.RFC3339Nano + `"` +) + +// Azure reports time in UTC but it doesn't include the 'Z' time zone suffix in some cases. +var tzOffsetRegex = regexp.MustCompile(`(Z|z|\+|-)(\d+:\d+)*"*$`) + +type timeRFC3339 time.Time + +func (t timeRFC3339) MarshalJSON() (json []byte, err error) { + tt := time.Time(t) + return tt.MarshalJSON() +} + +func (t timeRFC3339) MarshalText() (text []byte, err error) { + tt := time.Time(t) + return tt.MarshalText() +} + +func (t *timeRFC3339) UnmarshalJSON(data []byte) error { + layout := utcLayoutJSON + if tzOffsetRegex.Match(data) { + layout = rfc3339JSON + } + return t.Parse(layout, string(data)) +} + +func (t *timeRFC3339) UnmarshalText(data []byte) (err error) { + layout := utcLayout + if tzOffsetRegex.Match(data) { + layout = time.RFC3339Nano + } + return t.Parse(layout, string(data)) +} + +func (t *timeRFC3339) Parse(layout, value string) error { + p, err := time.Parse(layout, strings.ToUpper(value)) + *t = timeRFC3339(p) + return err +} + +func populateTimeRFC3339(m map[string]interface{}, k string, t *time.Time) { + if t == nil { + return + } else if azcore.IsNullValue(t) { + m[k] = nil + return + } else if reflect.ValueOf(t).IsNil() { + return + } + m[k] = (*timeRFC3339)(t) +} + +func unpopulateTimeRFC3339(data json.RawMessage, t **time.Time) error { + if data == nil || strings.EqualFold(string(data), "null") { + return nil + } + var aux timeRFC3339 + if err := json.Unmarshal(data, &aux); err != nil { + return err + } + *t = (*time.Time)(&aux) + return nil +} diff --git a/sdk/resourcemanager/appservice/armappservice/zz_generated_topleveldomains_client.go b/sdk/resourcemanager/appservice/armappservice/zz_generated_topleveldomains_client.go new file mode 100644 index 000000000000..1876d4b978b4 --- /dev/null +++ b/sdk/resourcemanager/appservice/armappservice/zz_generated_topleveldomains_client.go @@ -0,0 +1,216 @@ +//go:build go1.16 +// +build go1.16 + +// 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. + +package armappservice + +import ( + "context" + "errors" + "fmt" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// TopLevelDomainsClient contains the methods for the TopLevelDomains group. +// Don't use this type directly, use NewTopLevelDomainsClient() instead. +type TopLevelDomainsClient struct { + ep string + pl runtime.Pipeline + subscriptionID string +} + +// NewTopLevelDomainsClient creates a new instance of TopLevelDomainsClient with the specified values. +func NewTopLevelDomainsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *TopLevelDomainsClient { + cp := arm.ClientOptions{} + if options != nil { + cp = *options + } + if len(cp.Host) == 0 { + cp.Host = arm.AzurePublicCloud + } + return &TopLevelDomainsClient{subscriptionID: subscriptionID, ep: string(cp.Host), pl: armruntime.NewPipeline(module, version, credential, &cp)} +} + +// Get - Description for Get details of a top-level domain. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *TopLevelDomainsClient) Get(ctx context.Context, name string, options *TopLevelDomainsGetOptions) (TopLevelDomainsGetResponse, error) { + req, err := client.getCreateRequest(ctx, name, options) + if err != nil { + return TopLevelDomainsGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return TopLevelDomainsGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return TopLevelDomainsGetResponse{}, client.getHandleError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *TopLevelDomainsClient) getCreateRequest(ctx context.Context, name string, options *TopLevelDomainsGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.DomainRegistration/topLevelDomains/{name}" + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *TopLevelDomainsClient) getHandleResponse(resp *http.Response) (TopLevelDomainsGetResponse, error) { + result := TopLevelDomainsGetResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.TopLevelDomain); err != nil { + return TopLevelDomainsGetResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getHandleError handles the Get error response. +func (client *TopLevelDomainsClient) getHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// List - Description for Get all top-level domains supported for registration. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *TopLevelDomainsClient) List(options *TopLevelDomainsListOptions) *TopLevelDomainsListPager { + return &TopLevelDomainsListPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listCreateRequest(ctx, options) + }, + advancer: func(ctx context.Context, resp TopLevelDomainsListResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.TopLevelDomainCollection.NextLink) + }, + } +} + +// listCreateRequest creates the List request. +func (client *TopLevelDomainsClient) listCreateRequest(ctx context.Context, options *TopLevelDomainsListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.DomainRegistration/topLevelDomains" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listHandleResponse handles the List response. +func (client *TopLevelDomainsClient) listHandleResponse(resp *http.Response) (TopLevelDomainsListResponse, error) { + result := TopLevelDomainsListResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.TopLevelDomainCollection); err != nil { + return TopLevelDomainsListResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listHandleError handles the List error response. +func (client *TopLevelDomainsClient) listHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListAgreements - Description for Gets all legal agreements that user needs to accept before purchasing a domain. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *TopLevelDomainsClient) ListAgreements(name string, agreementOption TopLevelDomainAgreementOption, options *TopLevelDomainsListAgreementsOptions) *TopLevelDomainsListAgreementsPager { + return &TopLevelDomainsListAgreementsPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listAgreementsCreateRequest(ctx, name, agreementOption, options) + }, + advancer: func(ctx context.Context, resp TopLevelDomainsListAgreementsResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.TldLegalAgreementCollection.NextLink) + }, + } +} + +// listAgreementsCreateRequest creates the ListAgreements request. +func (client *TopLevelDomainsClient) listAgreementsCreateRequest(ctx context.Context, name string, agreementOption TopLevelDomainAgreementOption, options *TopLevelDomainsListAgreementsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.DomainRegistration/topLevelDomains/{name}/listAgreements" + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, agreementOption) +} + +// listAgreementsHandleResponse handles the ListAgreements response. +func (client *TopLevelDomainsClient) listAgreementsHandleResponse(resp *http.Response) (TopLevelDomainsListAgreementsResponse, error) { + result := TopLevelDomainsListAgreementsResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.TldLegalAgreementCollection); err != nil { + return TopLevelDomainsListAgreementsResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listAgreementsHandleError handles the ListAgreements error response. +func (client *TopLevelDomainsClient) listAgreementsHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} diff --git a/sdk/resourcemanager/appservice/armappservice/zz_generated_webapps_client.go b/sdk/resourcemanager/appservice/armappservice/zz_generated_webapps_client.go new file mode 100644 index 000000000000..eb316147bb21 --- /dev/null +++ b/sdk/resourcemanager/appservice/armappservice/zz_generated_webapps_client.go @@ -0,0 +1,27356 @@ +//go:build go1.16 +// +build go1.16 + +// 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. + +package armappservice + +import ( + "context" + "errors" + "fmt" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strconv" + "strings" +) + +// WebAppsClient contains the methods for the WebApps group. +// Don't use this type directly, use NewWebAppsClient() instead. +type WebAppsClient struct { + ep string + pl runtime.Pipeline + subscriptionID string +} + +// NewWebAppsClient creates a new instance of WebAppsClient with the specified values. +func NewWebAppsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *WebAppsClient { + cp := arm.ClientOptions{} + if options != nil { + cp = *options + } + if len(cp.Host) == 0 { + cp.Host = arm.AzurePublicCloud + } + return &WebAppsClient{subscriptionID: subscriptionID, ep: string(cp.Host), pl: armruntime.NewPipeline(module, version, credential, &cp)} +} + +// AddPremierAddOn - Description for Updates a named add-on of an app. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) AddPremierAddOn(ctx context.Context, resourceGroupName string, name string, premierAddOnName string, premierAddOn PremierAddOn, options *WebAppsAddPremierAddOnOptions) (WebAppsAddPremierAddOnResponse, error) { + req, err := client.addPremierAddOnCreateRequest(ctx, resourceGroupName, name, premierAddOnName, premierAddOn, options) + if err != nil { + return WebAppsAddPremierAddOnResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsAddPremierAddOnResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsAddPremierAddOnResponse{}, client.addPremierAddOnHandleError(resp) + } + return client.addPremierAddOnHandleResponse(resp) +} + +// addPremierAddOnCreateRequest creates the AddPremierAddOn request. +func (client *WebAppsClient) addPremierAddOnCreateRequest(ctx context.Context, resourceGroupName string, name string, premierAddOnName string, premierAddOn PremierAddOn, options *WebAppsAddPremierAddOnOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/premieraddons/{premierAddOnName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if premierAddOnName == "" { + return nil, errors.New("parameter premierAddOnName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{premierAddOnName}", url.PathEscape(premierAddOnName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, premierAddOn) +} + +// addPremierAddOnHandleResponse handles the AddPremierAddOn response. +func (client *WebAppsClient) addPremierAddOnHandleResponse(resp *http.Response) (WebAppsAddPremierAddOnResponse, error) { + result := WebAppsAddPremierAddOnResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.PremierAddOn); err != nil { + return WebAppsAddPremierAddOnResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// addPremierAddOnHandleError handles the AddPremierAddOn error response. +func (client *WebAppsClient) addPremierAddOnHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// AddPremierAddOnSlot - Description for Updates a named add-on of an app. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) AddPremierAddOnSlot(ctx context.Context, resourceGroupName string, name string, premierAddOnName string, slot string, premierAddOn PremierAddOn, options *WebAppsAddPremierAddOnSlotOptions) (WebAppsAddPremierAddOnSlotResponse, error) { + req, err := client.addPremierAddOnSlotCreateRequest(ctx, resourceGroupName, name, premierAddOnName, slot, premierAddOn, options) + if err != nil { + return WebAppsAddPremierAddOnSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsAddPremierAddOnSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsAddPremierAddOnSlotResponse{}, client.addPremierAddOnSlotHandleError(resp) + } + return client.addPremierAddOnSlotHandleResponse(resp) +} + +// addPremierAddOnSlotCreateRequest creates the AddPremierAddOnSlot request. +func (client *WebAppsClient) addPremierAddOnSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, premierAddOnName string, slot string, premierAddOn PremierAddOn, options *WebAppsAddPremierAddOnSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/premieraddons/{premierAddOnName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if premierAddOnName == "" { + return nil, errors.New("parameter premierAddOnName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{premierAddOnName}", url.PathEscape(premierAddOnName)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, premierAddOn) +} + +// addPremierAddOnSlotHandleResponse handles the AddPremierAddOnSlot response. +func (client *WebAppsClient) addPremierAddOnSlotHandleResponse(resp *http.Response) (WebAppsAddPremierAddOnSlotResponse, error) { + result := WebAppsAddPremierAddOnSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.PremierAddOn); err != nil { + return WebAppsAddPremierAddOnSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// addPremierAddOnSlotHandleError handles the AddPremierAddOnSlot error response. +func (client *WebAppsClient) addPremierAddOnSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// AnalyzeCustomHostname - Description for Analyze a custom hostname. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) AnalyzeCustomHostname(ctx context.Context, resourceGroupName string, name string, options *WebAppsAnalyzeCustomHostnameOptions) (WebAppsAnalyzeCustomHostnameResponse, error) { + req, err := client.analyzeCustomHostnameCreateRequest(ctx, resourceGroupName, name, options) + if err != nil { + return WebAppsAnalyzeCustomHostnameResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsAnalyzeCustomHostnameResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsAnalyzeCustomHostnameResponse{}, client.analyzeCustomHostnameHandleError(resp) + } + return client.analyzeCustomHostnameHandleResponse(resp) +} + +// analyzeCustomHostnameCreateRequest creates the AnalyzeCustomHostname request. +func (client *WebAppsClient) analyzeCustomHostnameCreateRequest(ctx context.Context, resourceGroupName string, name string, options *WebAppsAnalyzeCustomHostnameOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/analyzeCustomHostname" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + if options != nil && options.HostName != nil { + reqQP.Set("hostName", *options.HostName) + } + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// analyzeCustomHostnameHandleResponse handles the AnalyzeCustomHostname response. +func (client *WebAppsClient) analyzeCustomHostnameHandleResponse(resp *http.Response) (WebAppsAnalyzeCustomHostnameResponse, error) { + result := WebAppsAnalyzeCustomHostnameResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.CustomHostnameAnalysisResult); err != nil { + return WebAppsAnalyzeCustomHostnameResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// analyzeCustomHostnameHandleError handles the AnalyzeCustomHostname error response. +func (client *WebAppsClient) analyzeCustomHostnameHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// AnalyzeCustomHostnameSlot - Description for Analyze a custom hostname. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) AnalyzeCustomHostnameSlot(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsAnalyzeCustomHostnameSlotOptions) (WebAppsAnalyzeCustomHostnameSlotResponse, error) { + req, err := client.analyzeCustomHostnameSlotCreateRequest(ctx, resourceGroupName, name, slot, options) + if err != nil { + return WebAppsAnalyzeCustomHostnameSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsAnalyzeCustomHostnameSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsAnalyzeCustomHostnameSlotResponse{}, client.analyzeCustomHostnameSlotHandleError(resp) + } + return client.analyzeCustomHostnameSlotHandleResponse(resp) +} + +// analyzeCustomHostnameSlotCreateRequest creates the AnalyzeCustomHostnameSlot request. +func (client *WebAppsClient) analyzeCustomHostnameSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsAnalyzeCustomHostnameSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/analyzeCustomHostname" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + if options != nil && options.HostName != nil { + reqQP.Set("hostName", *options.HostName) + } + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// analyzeCustomHostnameSlotHandleResponse handles the AnalyzeCustomHostnameSlot response. +func (client *WebAppsClient) analyzeCustomHostnameSlotHandleResponse(resp *http.Response) (WebAppsAnalyzeCustomHostnameSlotResponse, error) { + result := WebAppsAnalyzeCustomHostnameSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.CustomHostnameAnalysisResult); err != nil { + return WebAppsAnalyzeCustomHostnameSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// analyzeCustomHostnameSlotHandleError handles the AnalyzeCustomHostnameSlot error response. +func (client *WebAppsClient) analyzeCustomHostnameSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ApplySlotConfigToProduction - Description for Applies the configuration settings from the target slot onto the current slot. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) ApplySlotConfigToProduction(ctx context.Context, resourceGroupName string, name string, slotSwapEntity CsmSlotEntity, options *WebAppsApplySlotConfigToProductionOptions) (WebAppsApplySlotConfigToProductionResponse, error) { + req, err := client.applySlotConfigToProductionCreateRequest(ctx, resourceGroupName, name, slotSwapEntity, options) + if err != nil { + return WebAppsApplySlotConfigToProductionResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsApplySlotConfigToProductionResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsApplySlotConfigToProductionResponse{}, client.applySlotConfigToProductionHandleError(resp) + } + return WebAppsApplySlotConfigToProductionResponse{RawResponse: resp}, nil +} + +// applySlotConfigToProductionCreateRequest creates the ApplySlotConfigToProduction request. +func (client *WebAppsClient) applySlotConfigToProductionCreateRequest(ctx context.Context, resourceGroupName string, name string, slotSwapEntity CsmSlotEntity, options *WebAppsApplySlotConfigToProductionOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/applySlotConfig" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, slotSwapEntity) +} + +// applySlotConfigToProductionHandleError handles the ApplySlotConfigToProduction error response. +func (client *WebAppsClient) applySlotConfigToProductionHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ApplySlotConfigurationSlot - Description for Applies the configuration settings from the target slot onto the current slot. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) ApplySlotConfigurationSlot(ctx context.Context, resourceGroupName string, name string, slot string, slotSwapEntity CsmSlotEntity, options *WebAppsApplySlotConfigurationSlotOptions) (WebAppsApplySlotConfigurationSlotResponse, error) { + req, err := client.applySlotConfigurationSlotCreateRequest(ctx, resourceGroupName, name, slot, slotSwapEntity, options) + if err != nil { + return WebAppsApplySlotConfigurationSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsApplySlotConfigurationSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsApplySlotConfigurationSlotResponse{}, client.applySlotConfigurationSlotHandleError(resp) + } + return WebAppsApplySlotConfigurationSlotResponse{RawResponse: resp}, nil +} + +// applySlotConfigurationSlotCreateRequest creates the ApplySlotConfigurationSlot request. +func (client *WebAppsClient) applySlotConfigurationSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, slot string, slotSwapEntity CsmSlotEntity, options *WebAppsApplySlotConfigurationSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/applySlotConfig" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, slotSwapEntity) +} + +// applySlotConfigurationSlotHandleError handles the ApplySlotConfigurationSlot error response. +func (client *WebAppsClient) applySlotConfigurationSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// BeginApproveOrRejectPrivateEndpointConnection - Description for Approves or rejects a private endpoint connection +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) BeginApproveOrRejectPrivateEndpointConnection(ctx context.Context, resourceGroupName string, name string, privateEndpointConnectionName string, privateEndpointWrapper PrivateLinkConnectionApprovalRequestResource, options *WebAppsBeginApproveOrRejectPrivateEndpointConnectionOptions) (WebAppsApproveOrRejectPrivateEndpointConnectionPollerResponse, error) { + resp, err := client.approveOrRejectPrivateEndpointConnection(ctx, resourceGroupName, name, privateEndpointConnectionName, privateEndpointWrapper, options) + if err != nil { + return WebAppsApproveOrRejectPrivateEndpointConnectionPollerResponse{}, err + } + result := WebAppsApproveOrRejectPrivateEndpointConnectionPollerResponse{ + RawResponse: resp, + } + pt, err := armruntime.NewPoller("WebAppsClient.ApproveOrRejectPrivateEndpointConnection", "", resp, client.pl, client.approveOrRejectPrivateEndpointConnectionHandleError) + if err != nil { + return WebAppsApproveOrRejectPrivateEndpointConnectionPollerResponse{}, err + } + result.Poller = &WebAppsApproveOrRejectPrivateEndpointConnectionPoller{ + pt: pt, + } + return result, nil +} + +// ApproveOrRejectPrivateEndpointConnection - Description for Approves or rejects a private endpoint connection +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) approveOrRejectPrivateEndpointConnection(ctx context.Context, resourceGroupName string, name string, privateEndpointConnectionName string, privateEndpointWrapper PrivateLinkConnectionApprovalRequestResource, options *WebAppsBeginApproveOrRejectPrivateEndpointConnectionOptions) (*http.Response, error) { + req, err := client.approveOrRejectPrivateEndpointConnectionCreateRequest(ctx, resourceGroupName, name, privateEndpointConnectionName, privateEndpointWrapper, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, client.approveOrRejectPrivateEndpointConnectionHandleError(resp) + } + return resp, nil +} + +// approveOrRejectPrivateEndpointConnectionCreateRequest creates the ApproveOrRejectPrivateEndpointConnection request. +func (client *WebAppsClient) approveOrRejectPrivateEndpointConnectionCreateRequest(ctx context.Context, resourceGroupName string, name string, privateEndpointConnectionName string, privateEndpointWrapper PrivateLinkConnectionApprovalRequestResource, options *WebAppsBeginApproveOrRejectPrivateEndpointConnectionOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateEndpointConnections/{privateEndpointConnectionName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if privateEndpointConnectionName == "" { + return nil, errors.New("parameter privateEndpointConnectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{privateEndpointConnectionName}", url.PathEscape(privateEndpointConnectionName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, privateEndpointWrapper) +} + +// approveOrRejectPrivateEndpointConnectionHandleError handles the ApproveOrRejectPrivateEndpointConnection error response. +func (client *WebAppsClient) approveOrRejectPrivateEndpointConnectionHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// BeginApproveOrRejectPrivateEndpointConnectionSlot - Description for Approves or rejects a private endpoint connection +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) BeginApproveOrRejectPrivateEndpointConnectionSlot(ctx context.Context, resourceGroupName string, name string, privateEndpointConnectionName string, slot string, privateEndpointWrapper PrivateLinkConnectionApprovalRequestResource, options *WebAppsBeginApproveOrRejectPrivateEndpointConnectionSlotOptions) (WebAppsApproveOrRejectPrivateEndpointConnectionSlotPollerResponse, error) { + resp, err := client.approveOrRejectPrivateEndpointConnectionSlot(ctx, resourceGroupName, name, privateEndpointConnectionName, slot, privateEndpointWrapper, options) + if err != nil { + return WebAppsApproveOrRejectPrivateEndpointConnectionSlotPollerResponse{}, err + } + result := WebAppsApproveOrRejectPrivateEndpointConnectionSlotPollerResponse{ + RawResponse: resp, + } + pt, err := armruntime.NewPoller("WebAppsClient.ApproveOrRejectPrivateEndpointConnectionSlot", "", resp, client.pl, client.approveOrRejectPrivateEndpointConnectionSlotHandleError) + if err != nil { + return WebAppsApproveOrRejectPrivateEndpointConnectionSlotPollerResponse{}, err + } + result.Poller = &WebAppsApproveOrRejectPrivateEndpointConnectionSlotPoller{ + pt: pt, + } + return result, nil +} + +// ApproveOrRejectPrivateEndpointConnectionSlot - Description for Approves or rejects a private endpoint connection +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) approveOrRejectPrivateEndpointConnectionSlot(ctx context.Context, resourceGroupName string, name string, privateEndpointConnectionName string, slot string, privateEndpointWrapper PrivateLinkConnectionApprovalRequestResource, options *WebAppsBeginApproveOrRejectPrivateEndpointConnectionSlotOptions) (*http.Response, error) { + req, err := client.approveOrRejectPrivateEndpointConnectionSlotCreateRequest(ctx, resourceGroupName, name, privateEndpointConnectionName, slot, privateEndpointWrapper, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, client.approveOrRejectPrivateEndpointConnectionSlotHandleError(resp) + } + return resp, nil +} + +// approveOrRejectPrivateEndpointConnectionSlotCreateRequest creates the ApproveOrRejectPrivateEndpointConnectionSlot request. +func (client *WebAppsClient) approveOrRejectPrivateEndpointConnectionSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, privateEndpointConnectionName string, slot string, privateEndpointWrapper PrivateLinkConnectionApprovalRequestResource, options *WebAppsBeginApproveOrRejectPrivateEndpointConnectionSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/privateEndpointConnections/{privateEndpointConnectionName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if privateEndpointConnectionName == "" { + return nil, errors.New("parameter privateEndpointConnectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{privateEndpointConnectionName}", url.PathEscape(privateEndpointConnectionName)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, privateEndpointWrapper) +} + +// approveOrRejectPrivateEndpointConnectionSlotHandleError handles the ApproveOrRejectPrivateEndpointConnectionSlot error response. +func (client *WebAppsClient) approveOrRejectPrivateEndpointConnectionSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// Backup - Description for Creates a backup of an app. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) Backup(ctx context.Context, resourceGroupName string, name string, request BackupRequest, options *WebAppsBackupOptions) (WebAppsBackupResponse, error) { + req, err := client.backupCreateRequest(ctx, resourceGroupName, name, request, options) + if err != nil { + return WebAppsBackupResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsBackupResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsBackupResponse{}, client.backupHandleError(resp) + } + return client.backupHandleResponse(resp) +} + +// backupCreateRequest creates the Backup request. +func (client *WebAppsClient) backupCreateRequest(ctx context.Context, resourceGroupName string, name string, request BackupRequest, options *WebAppsBackupOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/backup" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, request) +} + +// backupHandleResponse handles the Backup response. +func (client *WebAppsClient) backupHandleResponse(resp *http.Response) (WebAppsBackupResponse, error) { + result := WebAppsBackupResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.BackupItem); err != nil { + return WebAppsBackupResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// backupHandleError handles the Backup error response. +func (client *WebAppsClient) backupHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// BackupSlot - Description for Creates a backup of an app. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) BackupSlot(ctx context.Context, resourceGroupName string, name string, slot string, request BackupRequest, options *WebAppsBackupSlotOptions) (WebAppsBackupSlotResponse, error) { + req, err := client.backupSlotCreateRequest(ctx, resourceGroupName, name, slot, request, options) + if err != nil { + return WebAppsBackupSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsBackupSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsBackupSlotResponse{}, client.backupSlotHandleError(resp) + } + return client.backupSlotHandleResponse(resp) +} + +// backupSlotCreateRequest creates the BackupSlot request. +func (client *WebAppsClient) backupSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, slot string, request BackupRequest, options *WebAppsBackupSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backup" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, request) +} + +// backupSlotHandleResponse handles the BackupSlot response. +func (client *WebAppsClient) backupSlotHandleResponse(resp *http.Response) (WebAppsBackupSlotResponse, error) { + result := WebAppsBackupSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.BackupItem); err != nil { + return WebAppsBackupSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// backupSlotHandleError handles the BackupSlot error response. +func (client *WebAppsClient) backupSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// CreateDeployment - Description for Create a deployment for an app, or a deployment slot. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) CreateDeployment(ctx context.Context, resourceGroupName string, name string, id string, deployment Deployment, options *WebAppsCreateDeploymentOptions) (WebAppsCreateDeploymentResponse, error) { + req, err := client.createDeploymentCreateRequest(ctx, resourceGroupName, name, id, deployment, options) + if err != nil { + return WebAppsCreateDeploymentResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsCreateDeploymentResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsCreateDeploymentResponse{}, client.createDeploymentHandleError(resp) + } + return client.createDeploymentHandleResponse(resp) +} + +// createDeploymentCreateRequest creates the CreateDeployment request. +func (client *WebAppsClient) createDeploymentCreateRequest(ctx context.Context, resourceGroupName string, name string, id string, deployment Deployment, options *WebAppsCreateDeploymentOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/deployments/{id}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if id == "" { + return nil, errors.New("parameter id cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{id}", url.PathEscape(id)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, deployment) +} + +// createDeploymentHandleResponse handles the CreateDeployment response. +func (client *WebAppsClient) createDeploymentHandleResponse(resp *http.Response) (WebAppsCreateDeploymentResponse, error) { + result := WebAppsCreateDeploymentResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.Deployment); err != nil { + return WebAppsCreateDeploymentResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// createDeploymentHandleError handles the CreateDeployment error response. +func (client *WebAppsClient) createDeploymentHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// CreateDeploymentSlot - Description for Create a deployment for an app, or a deployment slot. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) CreateDeploymentSlot(ctx context.Context, resourceGroupName string, name string, id string, slot string, deployment Deployment, options *WebAppsCreateDeploymentSlotOptions) (WebAppsCreateDeploymentSlotResponse, error) { + req, err := client.createDeploymentSlotCreateRequest(ctx, resourceGroupName, name, id, slot, deployment, options) + if err != nil { + return WebAppsCreateDeploymentSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsCreateDeploymentSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsCreateDeploymentSlotResponse{}, client.createDeploymentSlotHandleError(resp) + } + return client.createDeploymentSlotHandleResponse(resp) +} + +// createDeploymentSlotCreateRequest creates the CreateDeploymentSlot request. +func (client *WebAppsClient) createDeploymentSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, id string, slot string, deployment Deployment, options *WebAppsCreateDeploymentSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/deployments/{id}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if id == "" { + return nil, errors.New("parameter id cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{id}", url.PathEscape(id)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, deployment) +} + +// createDeploymentSlotHandleResponse handles the CreateDeploymentSlot response. +func (client *WebAppsClient) createDeploymentSlotHandleResponse(resp *http.Response) (WebAppsCreateDeploymentSlotResponse, error) { + result := WebAppsCreateDeploymentSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.Deployment); err != nil { + return WebAppsCreateDeploymentSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// createDeploymentSlotHandleError handles the CreateDeploymentSlot error response. +func (client *WebAppsClient) createDeploymentSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// BeginCreateFunction - Description for Create function for web site, or a deployment slot. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) BeginCreateFunction(ctx context.Context, resourceGroupName string, name string, functionName string, functionEnvelope FunctionEnvelope, options *WebAppsBeginCreateFunctionOptions) (WebAppsCreateFunctionPollerResponse, error) { + resp, err := client.createFunction(ctx, resourceGroupName, name, functionName, functionEnvelope, options) + if err != nil { + return WebAppsCreateFunctionPollerResponse{}, err + } + result := WebAppsCreateFunctionPollerResponse{ + RawResponse: resp, + } + pt, err := armruntime.NewPoller("WebAppsClient.CreateFunction", "", resp, client.pl, client.createFunctionHandleError) + if err != nil { + return WebAppsCreateFunctionPollerResponse{}, err + } + result.Poller = &WebAppsCreateFunctionPoller{ + pt: pt, + } + return result, nil +} + +// CreateFunction - Description for Create function for web site, or a deployment slot. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) createFunction(ctx context.Context, resourceGroupName string, name string, functionName string, functionEnvelope FunctionEnvelope, options *WebAppsBeginCreateFunctionOptions) (*http.Response, error) { + req, err := client.createFunctionCreateRequest(ctx, resourceGroupName, name, functionName, functionEnvelope, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusCreated) { + return nil, client.createFunctionHandleError(resp) + } + return resp, nil +} + +// createFunctionCreateRequest creates the CreateFunction request. +func (client *WebAppsClient) createFunctionCreateRequest(ctx context.Context, resourceGroupName string, name string, functionName string, functionEnvelope FunctionEnvelope, options *WebAppsBeginCreateFunctionOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if functionName == "" { + return nil, errors.New("parameter functionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{functionName}", url.PathEscape(functionName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, functionEnvelope) +} + +// createFunctionHandleError handles the CreateFunction error response. +func (client *WebAppsClient) createFunctionHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// BeginCreateInstanceFunctionSlot - Description for Create function for web site, or a deployment slot. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) BeginCreateInstanceFunctionSlot(ctx context.Context, resourceGroupName string, name string, functionName string, slot string, functionEnvelope FunctionEnvelope, options *WebAppsBeginCreateInstanceFunctionSlotOptions) (WebAppsCreateInstanceFunctionSlotPollerResponse, error) { + resp, err := client.createInstanceFunctionSlot(ctx, resourceGroupName, name, functionName, slot, functionEnvelope, options) + if err != nil { + return WebAppsCreateInstanceFunctionSlotPollerResponse{}, err + } + result := WebAppsCreateInstanceFunctionSlotPollerResponse{ + RawResponse: resp, + } + pt, err := armruntime.NewPoller("WebAppsClient.CreateInstanceFunctionSlot", "", resp, client.pl, client.createInstanceFunctionSlotHandleError) + if err != nil { + return WebAppsCreateInstanceFunctionSlotPollerResponse{}, err + } + result.Poller = &WebAppsCreateInstanceFunctionSlotPoller{ + pt: pt, + } + return result, nil +} + +// CreateInstanceFunctionSlot - Description for Create function for web site, or a deployment slot. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) createInstanceFunctionSlot(ctx context.Context, resourceGroupName string, name string, functionName string, slot string, functionEnvelope FunctionEnvelope, options *WebAppsBeginCreateInstanceFunctionSlotOptions) (*http.Response, error) { + req, err := client.createInstanceFunctionSlotCreateRequest(ctx, resourceGroupName, name, functionName, slot, functionEnvelope, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusCreated) { + return nil, client.createInstanceFunctionSlotHandleError(resp) + } + return resp, nil +} + +// createInstanceFunctionSlotCreateRequest creates the CreateInstanceFunctionSlot request. +func (client *WebAppsClient) createInstanceFunctionSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, functionName string, slot string, functionEnvelope FunctionEnvelope, options *WebAppsBeginCreateInstanceFunctionSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if functionName == "" { + return nil, errors.New("parameter functionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{functionName}", url.PathEscape(functionName)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, functionEnvelope) +} + +// createInstanceFunctionSlotHandleError handles the CreateInstanceFunctionSlot error response. +func (client *WebAppsClient) createInstanceFunctionSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// BeginCreateInstanceMSDeployOperation - Description for Invoke the MSDeploy web app extension. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) BeginCreateInstanceMSDeployOperation(ctx context.Context, resourceGroupName string, name string, instanceID string, msDeploy MSDeploy, options *WebAppsBeginCreateInstanceMSDeployOperationOptions) (WebAppsCreateInstanceMSDeployOperationPollerResponse, error) { + resp, err := client.createInstanceMSDeployOperation(ctx, resourceGroupName, name, instanceID, msDeploy, options) + if err != nil { + return WebAppsCreateInstanceMSDeployOperationPollerResponse{}, err + } + result := WebAppsCreateInstanceMSDeployOperationPollerResponse{ + RawResponse: resp, + } + pt, err := armruntime.NewPoller("WebAppsClient.CreateInstanceMSDeployOperation", "", resp, client.pl, client.createInstanceMSDeployOperationHandleError) + if err != nil { + return WebAppsCreateInstanceMSDeployOperationPollerResponse{}, err + } + result.Poller = &WebAppsCreateInstanceMSDeployOperationPoller{ + pt: pt, + } + return result, nil +} + +// CreateInstanceMSDeployOperation - Description for Invoke the MSDeploy web app extension. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) createInstanceMSDeployOperation(ctx context.Context, resourceGroupName string, name string, instanceID string, msDeploy MSDeploy, options *WebAppsBeginCreateInstanceMSDeployOperationOptions) (*http.Response, error) { + req, err := client.createInstanceMSDeployOperationCreateRequest(ctx, resourceGroupName, name, instanceID, msDeploy, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusCreated) { + return nil, client.createInstanceMSDeployOperationHandleError(resp) + } + return resp, nil +} + +// createInstanceMSDeployOperationCreateRequest creates the CreateInstanceMSDeployOperation request. +func (client *WebAppsClient) createInstanceMSDeployOperationCreateRequest(ctx context.Context, resourceGroupName string, name string, instanceID string, msDeploy MSDeploy, options *WebAppsBeginCreateInstanceMSDeployOperationOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/extensions/MSDeploy" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if instanceID == "" { + return nil, errors.New("parameter instanceID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, msDeploy) +} + +// createInstanceMSDeployOperationHandleError handles the CreateInstanceMSDeployOperation error response. +func (client *WebAppsClient) createInstanceMSDeployOperationHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + switch resp.StatusCode { + case http.StatusConflict: + if len(body) == 0 { + return runtime.NewResponseError(errors.New(resp.Status), resp) + } + return runtime.NewResponseError(errors.New(string(body)), resp) + default: + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) + } +} + +// BeginCreateInstanceMSDeployOperationSlot - Description for Invoke the MSDeploy web app extension. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) BeginCreateInstanceMSDeployOperationSlot(ctx context.Context, resourceGroupName string, name string, slot string, instanceID string, msDeploy MSDeploy, options *WebAppsBeginCreateInstanceMSDeployOperationSlotOptions) (WebAppsCreateInstanceMSDeployOperationSlotPollerResponse, error) { + resp, err := client.createInstanceMSDeployOperationSlot(ctx, resourceGroupName, name, slot, instanceID, msDeploy, options) + if err != nil { + return WebAppsCreateInstanceMSDeployOperationSlotPollerResponse{}, err + } + result := WebAppsCreateInstanceMSDeployOperationSlotPollerResponse{ + RawResponse: resp, + } + pt, err := armruntime.NewPoller("WebAppsClient.CreateInstanceMSDeployOperationSlot", "", resp, client.pl, client.createInstanceMSDeployOperationSlotHandleError) + if err != nil { + return WebAppsCreateInstanceMSDeployOperationSlotPollerResponse{}, err + } + result.Poller = &WebAppsCreateInstanceMSDeployOperationSlotPoller{ + pt: pt, + } + return result, nil +} + +// CreateInstanceMSDeployOperationSlot - Description for Invoke the MSDeploy web app extension. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) createInstanceMSDeployOperationSlot(ctx context.Context, resourceGroupName string, name string, slot string, instanceID string, msDeploy MSDeploy, options *WebAppsBeginCreateInstanceMSDeployOperationSlotOptions) (*http.Response, error) { + req, err := client.createInstanceMSDeployOperationSlotCreateRequest(ctx, resourceGroupName, name, slot, instanceID, msDeploy, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusCreated) { + return nil, client.createInstanceMSDeployOperationSlotHandleError(resp) + } + return resp, nil +} + +// createInstanceMSDeployOperationSlotCreateRequest creates the CreateInstanceMSDeployOperationSlot request. +func (client *WebAppsClient) createInstanceMSDeployOperationSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, slot string, instanceID string, msDeploy MSDeploy, options *WebAppsBeginCreateInstanceMSDeployOperationSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/extensions/MSDeploy" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if instanceID == "" { + return nil, errors.New("parameter instanceID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, msDeploy) +} + +// createInstanceMSDeployOperationSlotHandleError handles the CreateInstanceMSDeployOperationSlot error response. +func (client *WebAppsClient) createInstanceMSDeployOperationSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + switch resp.StatusCode { + case http.StatusConflict: + if len(body) == 0 { + return runtime.NewResponseError(errors.New(resp.Status), resp) + } + return runtime.NewResponseError(errors.New(string(body)), resp) + default: + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) + } +} + +// BeginCreateMSDeployOperation - Description for Invoke the MSDeploy web app extension. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) BeginCreateMSDeployOperation(ctx context.Context, resourceGroupName string, name string, msDeploy MSDeploy, options *WebAppsBeginCreateMSDeployOperationOptions) (WebAppsCreateMSDeployOperationPollerResponse, error) { + resp, err := client.createMSDeployOperation(ctx, resourceGroupName, name, msDeploy, options) + if err != nil { + return WebAppsCreateMSDeployOperationPollerResponse{}, err + } + result := WebAppsCreateMSDeployOperationPollerResponse{ + RawResponse: resp, + } + pt, err := armruntime.NewPoller("WebAppsClient.CreateMSDeployOperation", "", resp, client.pl, client.createMSDeployOperationHandleError) + if err != nil { + return WebAppsCreateMSDeployOperationPollerResponse{}, err + } + result.Poller = &WebAppsCreateMSDeployOperationPoller{ + pt: pt, + } + return result, nil +} + +// CreateMSDeployOperation - Description for Invoke the MSDeploy web app extension. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) createMSDeployOperation(ctx context.Context, resourceGroupName string, name string, msDeploy MSDeploy, options *WebAppsBeginCreateMSDeployOperationOptions) (*http.Response, error) { + req, err := client.createMSDeployOperationCreateRequest(ctx, resourceGroupName, name, msDeploy, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusCreated) { + return nil, client.createMSDeployOperationHandleError(resp) + } + return resp, nil +} + +// createMSDeployOperationCreateRequest creates the CreateMSDeployOperation request. +func (client *WebAppsClient) createMSDeployOperationCreateRequest(ctx context.Context, resourceGroupName string, name string, msDeploy MSDeploy, options *WebAppsBeginCreateMSDeployOperationOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/extensions/MSDeploy" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, msDeploy) +} + +// createMSDeployOperationHandleError handles the CreateMSDeployOperation error response. +func (client *WebAppsClient) createMSDeployOperationHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + switch resp.StatusCode { + case http.StatusConflict: + if len(body) == 0 { + return runtime.NewResponseError(errors.New(resp.Status), resp) + } + return runtime.NewResponseError(errors.New(string(body)), resp) + default: + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) + } +} + +// BeginCreateMSDeployOperationSlot - Description for Invoke the MSDeploy web app extension. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) BeginCreateMSDeployOperationSlot(ctx context.Context, resourceGroupName string, name string, slot string, msDeploy MSDeploy, options *WebAppsBeginCreateMSDeployOperationSlotOptions) (WebAppsCreateMSDeployOperationSlotPollerResponse, error) { + resp, err := client.createMSDeployOperationSlot(ctx, resourceGroupName, name, slot, msDeploy, options) + if err != nil { + return WebAppsCreateMSDeployOperationSlotPollerResponse{}, err + } + result := WebAppsCreateMSDeployOperationSlotPollerResponse{ + RawResponse: resp, + } + pt, err := armruntime.NewPoller("WebAppsClient.CreateMSDeployOperationSlot", "", resp, client.pl, client.createMSDeployOperationSlotHandleError) + if err != nil { + return WebAppsCreateMSDeployOperationSlotPollerResponse{}, err + } + result.Poller = &WebAppsCreateMSDeployOperationSlotPoller{ + pt: pt, + } + return result, nil +} + +// CreateMSDeployOperationSlot - Description for Invoke the MSDeploy web app extension. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) createMSDeployOperationSlot(ctx context.Context, resourceGroupName string, name string, slot string, msDeploy MSDeploy, options *WebAppsBeginCreateMSDeployOperationSlotOptions) (*http.Response, error) { + req, err := client.createMSDeployOperationSlotCreateRequest(ctx, resourceGroupName, name, slot, msDeploy, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusCreated) { + return nil, client.createMSDeployOperationSlotHandleError(resp) + } + return resp, nil +} + +// createMSDeployOperationSlotCreateRequest creates the CreateMSDeployOperationSlot request. +func (client *WebAppsClient) createMSDeployOperationSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, slot string, msDeploy MSDeploy, options *WebAppsBeginCreateMSDeployOperationSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/extensions/MSDeploy" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, msDeploy) +} + +// createMSDeployOperationSlotHandleError handles the CreateMSDeployOperationSlot error response. +func (client *WebAppsClient) createMSDeployOperationSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + switch resp.StatusCode { + case http.StatusConflict: + if len(body) == 0 { + return runtime.NewResponseError(errors.New(resp.Status), resp) + } + return runtime.NewResponseError(errors.New(string(body)), resp) + default: + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) + } +} + +// BeginCreateOrUpdate - Description for Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, name string, siteEnvelope Site, options *WebAppsBeginCreateOrUpdateOptions) (WebAppsCreateOrUpdatePollerResponse, error) { + resp, err := client.createOrUpdate(ctx, resourceGroupName, name, siteEnvelope, options) + if err != nil { + return WebAppsCreateOrUpdatePollerResponse{}, err + } + result := WebAppsCreateOrUpdatePollerResponse{ + RawResponse: resp, + } + pt, err := armruntime.NewPoller("WebAppsClient.CreateOrUpdate", "", resp, client.pl, client.createOrUpdateHandleError) + if err != nil { + return WebAppsCreateOrUpdatePollerResponse{}, err + } + result.Poller = &WebAppsCreateOrUpdatePoller{ + pt: pt, + } + return result, nil +} + +// CreateOrUpdate - Description for Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) createOrUpdate(ctx context.Context, resourceGroupName string, name string, siteEnvelope Site, options *WebAppsBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, name, siteEnvelope, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, client.createOrUpdateHandleError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *WebAppsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, name string, siteEnvelope Site, options *WebAppsBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, siteEnvelope) +} + +// createOrUpdateHandleError handles the CreateOrUpdate error response. +func (client *WebAppsClient) createOrUpdateHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// CreateOrUpdateConfiguration - Description for Updates the configuration of an app. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) CreateOrUpdateConfiguration(ctx context.Context, resourceGroupName string, name string, siteConfig SiteConfigResource, options *WebAppsCreateOrUpdateConfigurationOptions) (WebAppsCreateOrUpdateConfigurationResponse, error) { + req, err := client.createOrUpdateConfigurationCreateRequest(ctx, resourceGroupName, name, siteConfig, options) + if err != nil { + return WebAppsCreateOrUpdateConfigurationResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsCreateOrUpdateConfigurationResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsCreateOrUpdateConfigurationResponse{}, client.createOrUpdateConfigurationHandleError(resp) + } + return client.createOrUpdateConfigurationHandleResponse(resp) +} + +// createOrUpdateConfigurationCreateRequest creates the CreateOrUpdateConfiguration request. +func (client *WebAppsClient) createOrUpdateConfigurationCreateRequest(ctx context.Context, resourceGroupName string, name string, siteConfig SiteConfigResource, options *WebAppsCreateOrUpdateConfigurationOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, siteConfig) +} + +// createOrUpdateConfigurationHandleResponse handles the CreateOrUpdateConfiguration response. +func (client *WebAppsClient) createOrUpdateConfigurationHandleResponse(resp *http.Response) (WebAppsCreateOrUpdateConfigurationResponse, error) { + result := WebAppsCreateOrUpdateConfigurationResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.SiteConfigResource); err != nil { + return WebAppsCreateOrUpdateConfigurationResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// createOrUpdateConfigurationHandleError handles the CreateOrUpdateConfiguration error response. +func (client *WebAppsClient) createOrUpdateConfigurationHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// CreateOrUpdateConfigurationSlot - Description for Updates the configuration of an app. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) CreateOrUpdateConfigurationSlot(ctx context.Context, resourceGroupName string, name string, slot string, siteConfig SiteConfigResource, options *WebAppsCreateOrUpdateConfigurationSlotOptions) (WebAppsCreateOrUpdateConfigurationSlotResponse, error) { + req, err := client.createOrUpdateConfigurationSlotCreateRequest(ctx, resourceGroupName, name, slot, siteConfig, options) + if err != nil { + return WebAppsCreateOrUpdateConfigurationSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsCreateOrUpdateConfigurationSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsCreateOrUpdateConfigurationSlotResponse{}, client.createOrUpdateConfigurationSlotHandleError(resp) + } + return client.createOrUpdateConfigurationSlotHandleResponse(resp) +} + +// createOrUpdateConfigurationSlotCreateRequest creates the CreateOrUpdateConfigurationSlot request. +func (client *WebAppsClient) createOrUpdateConfigurationSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, slot string, siteConfig SiteConfigResource, options *WebAppsCreateOrUpdateConfigurationSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, siteConfig) +} + +// createOrUpdateConfigurationSlotHandleResponse handles the CreateOrUpdateConfigurationSlot response. +func (client *WebAppsClient) createOrUpdateConfigurationSlotHandleResponse(resp *http.Response) (WebAppsCreateOrUpdateConfigurationSlotResponse, error) { + result := WebAppsCreateOrUpdateConfigurationSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.SiteConfigResource); err != nil { + return WebAppsCreateOrUpdateConfigurationSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// createOrUpdateConfigurationSlotHandleError handles the CreateOrUpdateConfigurationSlot error response. +func (client *WebAppsClient) createOrUpdateConfigurationSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// CreateOrUpdateDomainOwnershipIdentifier - Description for Creates a domain ownership identifier for web app, or updates an existing ownership identifier. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) CreateOrUpdateDomainOwnershipIdentifier(ctx context.Context, resourceGroupName string, name string, domainOwnershipIdentifierName string, domainOwnershipIdentifier Identifier, options *WebAppsCreateOrUpdateDomainOwnershipIdentifierOptions) (WebAppsCreateOrUpdateDomainOwnershipIdentifierResponse, error) { + req, err := client.createOrUpdateDomainOwnershipIdentifierCreateRequest(ctx, resourceGroupName, name, domainOwnershipIdentifierName, domainOwnershipIdentifier, options) + if err != nil { + return WebAppsCreateOrUpdateDomainOwnershipIdentifierResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsCreateOrUpdateDomainOwnershipIdentifierResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsCreateOrUpdateDomainOwnershipIdentifierResponse{}, client.createOrUpdateDomainOwnershipIdentifierHandleError(resp) + } + return client.createOrUpdateDomainOwnershipIdentifierHandleResponse(resp) +} + +// createOrUpdateDomainOwnershipIdentifierCreateRequest creates the CreateOrUpdateDomainOwnershipIdentifier request. +func (client *WebAppsClient) createOrUpdateDomainOwnershipIdentifierCreateRequest(ctx context.Context, resourceGroupName string, name string, domainOwnershipIdentifierName string, domainOwnershipIdentifier Identifier, options *WebAppsCreateOrUpdateDomainOwnershipIdentifierOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if domainOwnershipIdentifierName == "" { + return nil, errors.New("parameter domainOwnershipIdentifierName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{domainOwnershipIdentifierName}", url.PathEscape(domainOwnershipIdentifierName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, domainOwnershipIdentifier) +} + +// createOrUpdateDomainOwnershipIdentifierHandleResponse handles the CreateOrUpdateDomainOwnershipIdentifier response. +func (client *WebAppsClient) createOrUpdateDomainOwnershipIdentifierHandleResponse(resp *http.Response) (WebAppsCreateOrUpdateDomainOwnershipIdentifierResponse, error) { + result := WebAppsCreateOrUpdateDomainOwnershipIdentifierResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.Identifier); err != nil { + return WebAppsCreateOrUpdateDomainOwnershipIdentifierResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// createOrUpdateDomainOwnershipIdentifierHandleError handles the CreateOrUpdateDomainOwnershipIdentifier error response. +func (client *WebAppsClient) createOrUpdateDomainOwnershipIdentifierHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// CreateOrUpdateDomainOwnershipIdentifierSlot - Description for Creates a domain ownership identifier for web app, or updates an existing ownership identifier. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) CreateOrUpdateDomainOwnershipIdentifierSlot(ctx context.Context, resourceGroupName string, name string, domainOwnershipIdentifierName string, slot string, domainOwnershipIdentifier Identifier, options *WebAppsCreateOrUpdateDomainOwnershipIdentifierSlotOptions) (WebAppsCreateOrUpdateDomainOwnershipIdentifierSlotResponse, error) { + req, err := client.createOrUpdateDomainOwnershipIdentifierSlotCreateRequest(ctx, resourceGroupName, name, domainOwnershipIdentifierName, slot, domainOwnershipIdentifier, options) + if err != nil { + return WebAppsCreateOrUpdateDomainOwnershipIdentifierSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsCreateOrUpdateDomainOwnershipIdentifierSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsCreateOrUpdateDomainOwnershipIdentifierSlotResponse{}, client.createOrUpdateDomainOwnershipIdentifierSlotHandleError(resp) + } + return client.createOrUpdateDomainOwnershipIdentifierSlotHandleResponse(resp) +} + +// createOrUpdateDomainOwnershipIdentifierSlotCreateRequest creates the CreateOrUpdateDomainOwnershipIdentifierSlot request. +func (client *WebAppsClient) createOrUpdateDomainOwnershipIdentifierSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, domainOwnershipIdentifierName string, slot string, domainOwnershipIdentifier Identifier, options *WebAppsCreateOrUpdateDomainOwnershipIdentifierSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if domainOwnershipIdentifierName == "" { + return nil, errors.New("parameter domainOwnershipIdentifierName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{domainOwnershipIdentifierName}", url.PathEscape(domainOwnershipIdentifierName)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, domainOwnershipIdentifier) +} + +// createOrUpdateDomainOwnershipIdentifierSlotHandleResponse handles the CreateOrUpdateDomainOwnershipIdentifierSlot response. +func (client *WebAppsClient) createOrUpdateDomainOwnershipIdentifierSlotHandleResponse(resp *http.Response) (WebAppsCreateOrUpdateDomainOwnershipIdentifierSlotResponse, error) { + result := WebAppsCreateOrUpdateDomainOwnershipIdentifierSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.Identifier); err != nil { + return WebAppsCreateOrUpdateDomainOwnershipIdentifierSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// createOrUpdateDomainOwnershipIdentifierSlotHandleError handles the CreateOrUpdateDomainOwnershipIdentifierSlot error response. +func (client *WebAppsClient) createOrUpdateDomainOwnershipIdentifierSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// CreateOrUpdateFunctionSecret - Description for Add or update a function secret. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) CreateOrUpdateFunctionSecret(ctx context.Context, resourceGroupName string, name string, functionName string, keyName string, key KeyInfo, options *WebAppsCreateOrUpdateFunctionSecretOptions) (WebAppsCreateOrUpdateFunctionSecretResponse, error) { + req, err := client.createOrUpdateFunctionSecretCreateRequest(ctx, resourceGroupName, name, functionName, keyName, key, options) + if err != nil { + return WebAppsCreateOrUpdateFunctionSecretResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsCreateOrUpdateFunctionSecretResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return WebAppsCreateOrUpdateFunctionSecretResponse{}, client.createOrUpdateFunctionSecretHandleError(resp) + } + return client.createOrUpdateFunctionSecretHandleResponse(resp) +} + +// createOrUpdateFunctionSecretCreateRequest creates the CreateOrUpdateFunctionSecret request. +func (client *WebAppsClient) createOrUpdateFunctionSecretCreateRequest(ctx context.Context, resourceGroupName string, name string, functionName string, keyName string, key KeyInfo, options *WebAppsCreateOrUpdateFunctionSecretOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}/keys/{keyName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if functionName == "" { + return nil, errors.New("parameter functionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{functionName}", url.PathEscape(functionName)) + if keyName == "" { + return nil, errors.New("parameter keyName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{keyName}", url.PathEscape(keyName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, key) +} + +// createOrUpdateFunctionSecretHandleResponse handles the CreateOrUpdateFunctionSecret response. +func (client *WebAppsClient) createOrUpdateFunctionSecretHandleResponse(resp *http.Response) (WebAppsCreateOrUpdateFunctionSecretResponse, error) { + result := WebAppsCreateOrUpdateFunctionSecretResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.KeyInfo); err != nil { + return WebAppsCreateOrUpdateFunctionSecretResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// createOrUpdateFunctionSecretHandleError handles the CreateOrUpdateFunctionSecret error response. +func (client *WebAppsClient) createOrUpdateFunctionSecretHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// CreateOrUpdateFunctionSecretSlot - Description for Add or update a function secret. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) CreateOrUpdateFunctionSecretSlot(ctx context.Context, resourceGroupName string, name string, functionName string, keyName string, slot string, key KeyInfo, options *WebAppsCreateOrUpdateFunctionSecretSlotOptions) (WebAppsCreateOrUpdateFunctionSecretSlotResponse, error) { + req, err := client.createOrUpdateFunctionSecretSlotCreateRequest(ctx, resourceGroupName, name, functionName, keyName, slot, key, options) + if err != nil { + return WebAppsCreateOrUpdateFunctionSecretSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsCreateOrUpdateFunctionSecretSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return WebAppsCreateOrUpdateFunctionSecretSlotResponse{}, client.createOrUpdateFunctionSecretSlotHandleError(resp) + } + return client.createOrUpdateFunctionSecretSlotHandleResponse(resp) +} + +// createOrUpdateFunctionSecretSlotCreateRequest creates the CreateOrUpdateFunctionSecretSlot request. +func (client *WebAppsClient) createOrUpdateFunctionSecretSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, functionName string, keyName string, slot string, key KeyInfo, options *WebAppsCreateOrUpdateFunctionSecretSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}/keys/{keyName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if functionName == "" { + return nil, errors.New("parameter functionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{functionName}", url.PathEscape(functionName)) + if keyName == "" { + return nil, errors.New("parameter keyName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{keyName}", url.PathEscape(keyName)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, key) +} + +// createOrUpdateFunctionSecretSlotHandleResponse handles the CreateOrUpdateFunctionSecretSlot response. +func (client *WebAppsClient) createOrUpdateFunctionSecretSlotHandleResponse(resp *http.Response) (WebAppsCreateOrUpdateFunctionSecretSlotResponse, error) { + result := WebAppsCreateOrUpdateFunctionSecretSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.KeyInfo); err != nil { + return WebAppsCreateOrUpdateFunctionSecretSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// createOrUpdateFunctionSecretSlotHandleError handles the CreateOrUpdateFunctionSecretSlot error response. +func (client *WebAppsClient) createOrUpdateFunctionSecretSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// CreateOrUpdateHostNameBinding - Description for Creates a hostname binding for an app. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) CreateOrUpdateHostNameBinding(ctx context.Context, resourceGroupName string, name string, hostName string, hostNameBinding HostNameBinding, options *WebAppsCreateOrUpdateHostNameBindingOptions) (WebAppsCreateOrUpdateHostNameBindingResponse, error) { + req, err := client.createOrUpdateHostNameBindingCreateRequest(ctx, resourceGroupName, name, hostName, hostNameBinding, options) + if err != nil { + return WebAppsCreateOrUpdateHostNameBindingResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsCreateOrUpdateHostNameBindingResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsCreateOrUpdateHostNameBindingResponse{}, client.createOrUpdateHostNameBindingHandleError(resp) + } + return client.createOrUpdateHostNameBindingHandleResponse(resp) +} + +// createOrUpdateHostNameBindingCreateRequest creates the CreateOrUpdateHostNameBinding request. +func (client *WebAppsClient) createOrUpdateHostNameBindingCreateRequest(ctx context.Context, resourceGroupName string, name string, hostName string, hostNameBinding HostNameBinding, options *WebAppsCreateOrUpdateHostNameBindingOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hostNameBindings/{hostName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if hostName == "" { + return nil, errors.New("parameter hostName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{hostName}", url.PathEscape(hostName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, hostNameBinding) +} + +// createOrUpdateHostNameBindingHandleResponse handles the CreateOrUpdateHostNameBinding response. +func (client *WebAppsClient) createOrUpdateHostNameBindingHandleResponse(resp *http.Response) (WebAppsCreateOrUpdateHostNameBindingResponse, error) { + result := WebAppsCreateOrUpdateHostNameBindingResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.HostNameBinding); err != nil { + return WebAppsCreateOrUpdateHostNameBindingResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// createOrUpdateHostNameBindingHandleError handles the CreateOrUpdateHostNameBinding error response. +func (client *WebAppsClient) createOrUpdateHostNameBindingHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// CreateOrUpdateHostNameBindingSlot - Description for Creates a hostname binding for an app. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) CreateOrUpdateHostNameBindingSlot(ctx context.Context, resourceGroupName string, name string, hostName string, slot string, hostNameBinding HostNameBinding, options *WebAppsCreateOrUpdateHostNameBindingSlotOptions) (WebAppsCreateOrUpdateHostNameBindingSlotResponse, error) { + req, err := client.createOrUpdateHostNameBindingSlotCreateRequest(ctx, resourceGroupName, name, hostName, slot, hostNameBinding, options) + if err != nil { + return WebAppsCreateOrUpdateHostNameBindingSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsCreateOrUpdateHostNameBindingSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsCreateOrUpdateHostNameBindingSlotResponse{}, client.createOrUpdateHostNameBindingSlotHandleError(resp) + } + return client.createOrUpdateHostNameBindingSlotHandleResponse(resp) +} + +// createOrUpdateHostNameBindingSlotCreateRequest creates the CreateOrUpdateHostNameBindingSlot request. +func (client *WebAppsClient) createOrUpdateHostNameBindingSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, hostName string, slot string, hostNameBinding HostNameBinding, options *WebAppsCreateOrUpdateHostNameBindingSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hostNameBindings/{hostName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if hostName == "" { + return nil, errors.New("parameter hostName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{hostName}", url.PathEscape(hostName)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, hostNameBinding) +} + +// createOrUpdateHostNameBindingSlotHandleResponse handles the CreateOrUpdateHostNameBindingSlot response. +func (client *WebAppsClient) createOrUpdateHostNameBindingSlotHandleResponse(resp *http.Response) (WebAppsCreateOrUpdateHostNameBindingSlotResponse, error) { + result := WebAppsCreateOrUpdateHostNameBindingSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.HostNameBinding); err != nil { + return WebAppsCreateOrUpdateHostNameBindingSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// createOrUpdateHostNameBindingSlotHandleError handles the CreateOrUpdateHostNameBindingSlot error response. +func (client *WebAppsClient) createOrUpdateHostNameBindingSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// CreateOrUpdateHostSecret - Description for Add or update a host level secret. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) CreateOrUpdateHostSecret(ctx context.Context, resourceGroupName string, name string, keyType string, keyName string, key KeyInfo, options *WebAppsCreateOrUpdateHostSecretOptions) (WebAppsCreateOrUpdateHostSecretResponse, error) { + req, err := client.createOrUpdateHostSecretCreateRequest(ctx, resourceGroupName, name, keyType, keyName, key, options) + if err != nil { + return WebAppsCreateOrUpdateHostSecretResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsCreateOrUpdateHostSecretResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return WebAppsCreateOrUpdateHostSecretResponse{}, client.createOrUpdateHostSecretHandleError(resp) + } + return client.createOrUpdateHostSecretHandleResponse(resp) +} + +// createOrUpdateHostSecretCreateRequest creates the CreateOrUpdateHostSecret request. +func (client *WebAppsClient) createOrUpdateHostSecretCreateRequest(ctx context.Context, resourceGroupName string, name string, keyType string, keyName string, key KeyInfo, options *WebAppsCreateOrUpdateHostSecretOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/host/default/{keyType}/{keyName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if keyType == "" { + return nil, errors.New("parameter keyType cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{keyType}", url.PathEscape(keyType)) + if keyName == "" { + return nil, errors.New("parameter keyName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{keyName}", url.PathEscape(keyName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, key) +} + +// createOrUpdateHostSecretHandleResponse handles the CreateOrUpdateHostSecret response. +func (client *WebAppsClient) createOrUpdateHostSecretHandleResponse(resp *http.Response) (WebAppsCreateOrUpdateHostSecretResponse, error) { + result := WebAppsCreateOrUpdateHostSecretResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.KeyInfo); err != nil { + return WebAppsCreateOrUpdateHostSecretResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// createOrUpdateHostSecretHandleError handles the CreateOrUpdateHostSecret error response. +func (client *WebAppsClient) createOrUpdateHostSecretHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// CreateOrUpdateHostSecretSlot - Description for Add or update a host level secret. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) CreateOrUpdateHostSecretSlot(ctx context.Context, resourceGroupName string, name string, keyType string, keyName string, slot string, key KeyInfo, options *WebAppsCreateOrUpdateHostSecretSlotOptions) (WebAppsCreateOrUpdateHostSecretSlotResponse, error) { + req, err := client.createOrUpdateHostSecretSlotCreateRequest(ctx, resourceGroupName, name, keyType, keyName, slot, key, options) + if err != nil { + return WebAppsCreateOrUpdateHostSecretSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsCreateOrUpdateHostSecretSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return WebAppsCreateOrUpdateHostSecretSlotResponse{}, client.createOrUpdateHostSecretSlotHandleError(resp) + } + return client.createOrUpdateHostSecretSlotHandleResponse(resp) +} + +// createOrUpdateHostSecretSlotCreateRequest creates the CreateOrUpdateHostSecretSlot request. +func (client *WebAppsClient) createOrUpdateHostSecretSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, keyType string, keyName string, slot string, key KeyInfo, options *WebAppsCreateOrUpdateHostSecretSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/host/default/{keyType}/{keyName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if keyType == "" { + return nil, errors.New("parameter keyType cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{keyType}", url.PathEscape(keyType)) + if keyName == "" { + return nil, errors.New("parameter keyName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{keyName}", url.PathEscape(keyName)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, key) +} + +// createOrUpdateHostSecretSlotHandleResponse handles the CreateOrUpdateHostSecretSlot response. +func (client *WebAppsClient) createOrUpdateHostSecretSlotHandleResponse(resp *http.Response) (WebAppsCreateOrUpdateHostSecretSlotResponse, error) { + result := WebAppsCreateOrUpdateHostSecretSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.KeyInfo); err != nil { + return WebAppsCreateOrUpdateHostSecretSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// createOrUpdateHostSecretSlotHandleError handles the CreateOrUpdateHostSecretSlot error response. +func (client *WebAppsClient) createOrUpdateHostSecretSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// CreateOrUpdateHybridConnection - Description for Creates a new Hybrid Connection using a Service Bus relay. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) CreateOrUpdateHybridConnection(ctx context.Context, resourceGroupName string, name string, namespaceName string, relayName string, connectionEnvelope HybridConnection, options *WebAppsCreateOrUpdateHybridConnectionOptions) (WebAppsCreateOrUpdateHybridConnectionResponse, error) { + req, err := client.createOrUpdateHybridConnectionCreateRequest(ctx, resourceGroupName, name, namespaceName, relayName, connectionEnvelope, options) + if err != nil { + return WebAppsCreateOrUpdateHybridConnectionResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsCreateOrUpdateHybridConnectionResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsCreateOrUpdateHybridConnectionResponse{}, client.createOrUpdateHybridConnectionHandleError(resp) + } + return client.createOrUpdateHybridConnectionHandleResponse(resp) +} + +// createOrUpdateHybridConnectionCreateRequest creates the CreateOrUpdateHybridConnection request. +func (client *WebAppsClient) createOrUpdateHybridConnectionCreateRequest(ctx context.Context, resourceGroupName string, name string, namespaceName string, relayName string, connectionEnvelope HybridConnection, options *WebAppsCreateOrUpdateHybridConnectionOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if namespaceName == "" { + return nil, errors.New("parameter namespaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{namespaceName}", url.PathEscape(namespaceName)) + if relayName == "" { + return nil, errors.New("parameter relayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{relayName}", url.PathEscape(relayName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, connectionEnvelope) +} + +// createOrUpdateHybridConnectionHandleResponse handles the CreateOrUpdateHybridConnection response. +func (client *WebAppsClient) createOrUpdateHybridConnectionHandleResponse(resp *http.Response) (WebAppsCreateOrUpdateHybridConnectionResponse, error) { + result := WebAppsCreateOrUpdateHybridConnectionResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.HybridConnection); err != nil { + return WebAppsCreateOrUpdateHybridConnectionResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// createOrUpdateHybridConnectionHandleError handles the CreateOrUpdateHybridConnection error response. +func (client *WebAppsClient) createOrUpdateHybridConnectionHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// CreateOrUpdateHybridConnectionSlot - Description for Creates a new Hybrid Connection using a Service Bus relay. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) CreateOrUpdateHybridConnectionSlot(ctx context.Context, resourceGroupName string, name string, namespaceName string, relayName string, slot string, connectionEnvelope HybridConnection, options *WebAppsCreateOrUpdateHybridConnectionSlotOptions) (WebAppsCreateOrUpdateHybridConnectionSlotResponse, error) { + req, err := client.createOrUpdateHybridConnectionSlotCreateRequest(ctx, resourceGroupName, name, namespaceName, relayName, slot, connectionEnvelope, options) + if err != nil { + return WebAppsCreateOrUpdateHybridConnectionSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsCreateOrUpdateHybridConnectionSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsCreateOrUpdateHybridConnectionSlotResponse{}, client.createOrUpdateHybridConnectionSlotHandleError(resp) + } + return client.createOrUpdateHybridConnectionSlotHandleResponse(resp) +} + +// createOrUpdateHybridConnectionSlotCreateRequest creates the CreateOrUpdateHybridConnectionSlot request. +func (client *WebAppsClient) createOrUpdateHybridConnectionSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, namespaceName string, relayName string, slot string, connectionEnvelope HybridConnection, options *WebAppsCreateOrUpdateHybridConnectionSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if namespaceName == "" { + return nil, errors.New("parameter namespaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{namespaceName}", url.PathEscape(namespaceName)) + if relayName == "" { + return nil, errors.New("parameter relayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{relayName}", url.PathEscape(relayName)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, connectionEnvelope) +} + +// createOrUpdateHybridConnectionSlotHandleResponse handles the CreateOrUpdateHybridConnectionSlot response. +func (client *WebAppsClient) createOrUpdateHybridConnectionSlotHandleResponse(resp *http.Response) (WebAppsCreateOrUpdateHybridConnectionSlotResponse, error) { + result := WebAppsCreateOrUpdateHybridConnectionSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.HybridConnection); err != nil { + return WebAppsCreateOrUpdateHybridConnectionSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// createOrUpdateHybridConnectionSlotHandleError handles the CreateOrUpdateHybridConnectionSlot error response. +func (client *WebAppsClient) createOrUpdateHybridConnectionSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// CreateOrUpdatePublicCertificate - Description for Creates a hostname binding for an app. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) CreateOrUpdatePublicCertificate(ctx context.Context, resourceGroupName string, name string, publicCertificateName string, publicCertificate PublicCertificate, options *WebAppsCreateOrUpdatePublicCertificateOptions) (WebAppsCreateOrUpdatePublicCertificateResponse, error) { + req, err := client.createOrUpdatePublicCertificateCreateRequest(ctx, resourceGroupName, name, publicCertificateName, publicCertificate, options) + if err != nil { + return WebAppsCreateOrUpdatePublicCertificateResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsCreateOrUpdatePublicCertificateResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsCreateOrUpdatePublicCertificateResponse{}, client.createOrUpdatePublicCertificateHandleError(resp) + } + return client.createOrUpdatePublicCertificateHandleResponse(resp) +} + +// createOrUpdatePublicCertificateCreateRequest creates the CreateOrUpdatePublicCertificate request. +func (client *WebAppsClient) createOrUpdatePublicCertificateCreateRequest(ctx context.Context, resourceGroupName string, name string, publicCertificateName string, publicCertificate PublicCertificate, options *WebAppsCreateOrUpdatePublicCertificateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/publicCertificates/{publicCertificateName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if publicCertificateName == "" { + return nil, errors.New("parameter publicCertificateName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{publicCertificateName}", url.PathEscape(publicCertificateName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, publicCertificate) +} + +// createOrUpdatePublicCertificateHandleResponse handles the CreateOrUpdatePublicCertificate response. +func (client *WebAppsClient) createOrUpdatePublicCertificateHandleResponse(resp *http.Response) (WebAppsCreateOrUpdatePublicCertificateResponse, error) { + result := WebAppsCreateOrUpdatePublicCertificateResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.PublicCertificate); err != nil { + return WebAppsCreateOrUpdatePublicCertificateResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// createOrUpdatePublicCertificateHandleError handles the CreateOrUpdatePublicCertificate error response. +func (client *WebAppsClient) createOrUpdatePublicCertificateHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// CreateOrUpdatePublicCertificateSlot - Description for Creates a hostname binding for an app. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) CreateOrUpdatePublicCertificateSlot(ctx context.Context, resourceGroupName string, name string, publicCertificateName string, slot string, publicCertificate PublicCertificate, options *WebAppsCreateOrUpdatePublicCertificateSlotOptions) (WebAppsCreateOrUpdatePublicCertificateSlotResponse, error) { + req, err := client.createOrUpdatePublicCertificateSlotCreateRequest(ctx, resourceGroupName, name, publicCertificateName, slot, publicCertificate, options) + if err != nil { + return WebAppsCreateOrUpdatePublicCertificateSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsCreateOrUpdatePublicCertificateSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsCreateOrUpdatePublicCertificateSlotResponse{}, client.createOrUpdatePublicCertificateSlotHandleError(resp) + } + return client.createOrUpdatePublicCertificateSlotHandleResponse(resp) +} + +// createOrUpdatePublicCertificateSlotCreateRequest creates the CreateOrUpdatePublicCertificateSlot request. +func (client *WebAppsClient) createOrUpdatePublicCertificateSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, publicCertificateName string, slot string, publicCertificate PublicCertificate, options *WebAppsCreateOrUpdatePublicCertificateSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/publicCertificates/{publicCertificateName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if publicCertificateName == "" { + return nil, errors.New("parameter publicCertificateName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{publicCertificateName}", url.PathEscape(publicCertificateName)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, publicCertificate) +} + +// createOrUpdatePublicCertificateSlotHandleResponse handles the CreateOrUpdatePublicCertificateSlot response. +func (client *WebAppsClient) createOrUpdatePublicCertificateSlotHandleResponse(resp *http.Response) (WebAppsCreateOrUpdatePublicCertificateSlotResponse, error) { + result := WebAppsCreateOrUpdatePublicCertificateSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.PublicCertificate); err != nil { + return WebAppsCreateOrUpdatePublicCertificateSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// createOrUpdatePublicCertificateSlotHandleError handles the CreateOrUpdatePublicCertificateSlot error response. +func (client *WebAppsClient) createOrUpdatePublicCertificateSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// CreateOrUpdateRelayServiceConnection - Description for Creates a new hybrid connection configuration (PUT), or updates an existing one (PATCH). +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) CreateOrUpdateRelayServiceConnection(ctx context.Context, resourceGroupName string, name string, entityName string, connectionEnvelope RelayServiceConnectionEntity, options *WebAppsCreateOrUpdateRelayServiceConnectionOptions) (WebAppsCreateOrUpdateRelayServiceConnectionResponse, error) { + req, err := client.createOrUpdateRelayServiceConnectionCreateRequest(ctx, resourceGroupName, name, entityName, connectionEnvelope, options) + if err != nil { + return WebAppsCreateOrUpdateRelayServiceConnectionResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsCreateOrUpdateRelayServiceConnectionResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsCreateOrUpdateRelayServiceConnectionResponse{}, client.createOrUpdateRelayServiceConnectionHandleError(resp) + } + return client.createOrUpdateRelayServiceConnectionHandleResponse(resp) +} + +// createOrUpdateRelayServiceConnectionCreateRequest creates the CreateOrUpdateRelayServiceConnection request. +func (client *WebAppsClient) createOrUpdateRelayServiceConnectionCreateRequest(ctx context.Context, resourceGroupName string, name string, entityName string, connectionEnvelope RelayServiceConnectionEntity, options *WebAppsCreateOrUpdateRelayServiceConnectionOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection/{entityName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if entityName == "" { + return nil, errors.New("parameter entityName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{entityName}", url.PathEscape(entityName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, connectionEnvelope) +} + +// createOrUpdateRelayServiceConnectionHandleResponse handles the CreateOrUpdateRelayServiceConnection response. +func (client *WebAppsClient) createOrUpdateRelayServiceConnectionHandleResponse(resp *http.Response) (WebAppsCreateOrUpdateRelayServiceConnectionResponse, error) { + result := WebAppsCreateOrUpdateRelayServiceConnectionResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.RelayServiceConnectionEntity); err != nil { + return WebAppsCreateOrUpdateRelayServiceConnectionResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// createOrUpdateRelayServiceConnectionHandleError handles the CreateOrUpdateRelayServiceConnection error response. +func (client *WebAppsClient) createOrUpdateRelayServiceConnectionHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// CreateOrUpdateRelayServiceConnectionSlot - Description for Creates a new hybrid connection configuration (PUT), or updates an existing one (PATCH). +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) CreateOrUpdateRelayServiceConnectionSlot(ctx context.Context, resourceGroupName string, name string, entityName string, slot string, connectionEnvelope RelayServiceConnectionEntity, options *WebAppsCreateOrUpdateRelayServiceConnectionSlotOptions) (WebAppsCreateOrUpdateRelayServiceConnectionSlotResponse, error) { + req, err := client.createOrUpdateRelayServiceConnectionSlotCreateRequest(ctx, resourceGroupName, name, entityName, slot, connectionEnvelope, options) + if err != nil { + return WebAppsCreateOrUpdateRelayServiceConnectionSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsCreateOrUpdateRelayServiceConnectionSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsCreateOrUpdateRelayServiceConnectionSlotResponse{}, client.createOrUpdateRelayServiceConnectionSlotHandleError(resp) + } + return client.createOrUpdateRelayServiceConnectionSlotHandleResponse(resp) +} + +// createOrUpdateRelayServiceConnectionSlotCreateRequest creates the CreateOrUpdateRelayServiceConnectionSlot request. +func (client *WebAppsClient) createOrUpdateRelayServiceConnectionSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, entityName string, slot string, connectionEnvelope RelayServiceConnectionEntity, options *WebAppsCreateOrUpdateRelayServiceConnectionSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridconnection/{entityName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if entityName == "" { + return nil, errors.New("parameter entityName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{entityName}", url.PathEscape(entityName)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, connectionEnvelope) +} + +// createOrUpdateRelayServiceConnectionSlotHandleResponse handles the CreateOrUpdateRelayServiceConnectionSlot response. +func (client *WebAppsClient) createOrUpdateRelayServiceConnectionSlotHandleResponse(resp *http.Response) (WebAppsCreateOrUpdateRelayServiceConnectionSlotResponse, error) { + result := WebAppsCreateOrUpdateRelayServiceConnectionSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.RelayServiceConnectionEntity); err != nil { + return WebAppsCreateOrUpdateRelayServiceConnectionSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// createOrUpdateRelayServiceConnectionSlotHandleError handles the CreateOrUpdateRelayServiceConnectionSlot error response. +func (client *WebAppsClient) createOrUpdateRelayServiceConnectionSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// BeginCreateOrUpdateSlot - Description for Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) BeginCreateOrUpdateSlot(ctx context.Context, resourceGroupName string, name string, slot string, siteEnvelope Site, options *WebAppsBeginCreateOrUpdateSlotOptions) (WebAppsCreateOrUpdateSlotPollerResponse, error) { + resp, err := client.createOrUpdateSlot(ctx, resourceGroupName, name, slot, siteEnvelope, options) + if err != nil { + return WebAppsCreateOrUpdateSlotPollerResponse{}, err + } + result := WebAppsCreateOrUpdateSlotPollerResponse{ + RawResponse: resp, + } + pt, err := armruntime.NewPoller("WebAppsClient.CreateOrUpdateSlot", "", resp, client.pl, client.createOrUpdateSlotHandleError) + if err != nil { + return WebAppsCreateOrUpdateSlotPollerResponse{}, err + } + result.Poller = &WebAppsCreateOrUpdateSlotPoller{ + pt: pt, + } + return result, nil +} + +// CreateOrUpdateSlot - Description for Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) createOrUpdateSlot(ctx context.Context, resourceGroupName string, name string, slot string, siteEnvelope Site, options *WebAppsBeginCreateOrUpdateSlotOptions) (*http.Response, error) { + req, err := client.createOrUpdateSlotCreateRequest(ctx, resourceGroupName, name, slot, siteEnvelope, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, client.createOrUpdateSlotHandleError(resp) + } + return resp, nil +} + +// createOrUpdateSlotCreateRequest creates the CreateOrUpdateSlot request. +func (client *WebAppsClient) createOrUpdateSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, slot string, siteEnvelope Site, options *WebAppsBeginCreateOrUpdateSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, siteEnvelope) +} + +// createOrUpdateSlotHandleError handles the CreateOrUpdateSlot error response. +func (client *WebAppsClient) createOrUpdateSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// BeginCreateOrUpdateSourceControl - Description for Updates the source control configuration of an app. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) BeginCreateOrUpdateSourceControl(ctx context.Context, resourceGroupName string, name string, siteSourceControl SiteSourceControl, options *WebAppsBeginCreateOrUpdateSourceControlOptions) (WebAppsCreateOrUpdateSourceControlPollerResponse, error) { + resp, err := client.createOrUpdateSourceControl(ctx, resourceGroupName, name, siteSourceControl, options) + if err != nil { + return WebAppsCreateOrUpdateSourceControlPollerResponse{}, err + } + result := WebAppsCreateOrUpdateSourceControlPollerResponse{ + RawResponse: resp, + } + pt, err := armruntime.NewPoller("WebAppsClient.CreateOrUpdateSourceControl", "", resp, client.pl, client.createOrUpdateSourceControlHandleError) + if err != nil { + return WebAppsCreateOrUpdateSourceControlPollerResponse{}, err + } + result.Poller = &WebAppsCreateOrUpdateSourceControlPoller{ + pt: pt, + } + return result, nil +} + +// CreateOrUpdateSourceControl - Description for Updates the source control configuration of an app. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) createOrUpdateSourceControl(ctx context.Context, resourceGroupName string, name string, siteSourceControl SiteSourceControl, options *WebAppsBeginCreateOrUpdateSourceControlOptions) (*http.Response, error) { + req, err := client.createOrUpdateSourceControlCreateRequest(ctx, resourceGroupName, name, siteSourceControl, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { + return nil, client.createOrUpdateSourceControlHandleError(resp) + } + return resp, nil +} + +// createOrUpdateSourceControlCreateRequest creates the CreateOrUpdateSourceControl request. +func (client *WebAppsClient) createOrUpdateSourceControlCreateRequest(ctx context.Context, resourceGroupName string, name string, siteSourceControl SiteSourceControl, options *WebAppsBeginCreateOrUpdateSourceControlOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/sourcecontrols/web" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, siteSourceControl) +} + +// createOrUpdateSourceControlHandleError handles the CreateOrUpdateSourceControl error response. +func (client *WebAppsClient) createOrUpdateSourceControlHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// BeginCreateOrUpdateSourceControlSlot - Description for Updates the source control configuration of an app. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) BeginCreateOrUpdateSourceControlSlot(ctx context.Context, resourceGroupName string, name string, slot string, siteSourceControl SiteSourceControl, options *WebAppsBeginCreateOrUpdateSourceControlSlotOptions) (WebAppsCreateOrUpdateSourceControlSlotPollerResponse, error) { + resp, err := client.createOrUpdateSourceControlSlot(ctx, resourceGroupName, name, slot, siteSourceControl, options) + if err != nil { + return WebAppsCreateOrUpdateSourceControlSlotPollerResponse{}, err + } + result := WebAppsCreateOrUpdateSourceControlSlotPollerResponse{ + RawResponse: resp, + } + pt, err := armruntime.NewPoller("WebAppsClient.CreateOrUpdateSourceControlSlot", "", resp, client.pl, client.createOrUpdateSourceControlSlotHandleError) + if err != nil { + return WebAppsCreateOrUpdateSourceControlSlotPollerResponse{}, err + } + result.Poller = &WebAppsCreateOrUpdateSourceControlSlotPoller{ + pt: pt, + } + return result, nil +} + +// CreateOrUpdateSourceControlSlot - Description for Updates the source control configuration of an app. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) createOrUpdateSourceControlSlot(ctx context.Context, resourceGroupName string, name string, slot string, siteSourceControl SiteSourceControl, options *WebAppsBeginCreateOrUpdateSourceControlSlotOptions) (*http.Response, error) { + req, err := client.createOrUpdateSourceControlSlotCreateRequest(ctx, resourceGroupName, name, slot, siteSourceControl, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { + return nil, client.createOrUpdateSourceControlSlotHandleError(resp) + } + return resp, nil +} + +// createOrUpdateSourceControlSlotCreateRequest creates the CreateOrUpdateSourceControlSlot request. +func (client *WebAppsClient) createOrUpdateSourceControlSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, slot string, siteSourceControl SiteSourceControl, options *WebAppsBeginCreateOrUpdateSourceControlSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/sourcecontrols/web" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, siteSourceControl) +} + +// createOrUpdateSourceControlSlotHandleError handles the CreateOrUpdateSourceControlSlot error response. +func (client *WebAppsClient) createOrUpdateSourceControlSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// CreateOrUpdateSwiftVirtualNetworkConnectionWithCheck - Description for Integrates this Web App with a Virtual Network. This requires that 1) "swiftSupported" +// is true when doing a GET against this resource, and 2) that the target Subnet has already been +// delegated, and is not in use by another App Service Plan other than the one this App is in. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) CreateOrUpdateSwiftVirtualNetworkConnectionWithCheck(ctx context.Context, resourceGroupName string, name string, connectionEnvelope SwiftVirtualNetwork, options *WebAppsCreateOrUpdateSwiftVirtualNetworkConnectionWithCheckOptions) (WebAppsCreateOrUpdateSwiftVirtualNetworkConnectionWithCheckResponse, error) { + req, err := client.createOrUpdateSwiftVirtualNetworkConnectionWithCheckCreateRequest(ctx, resourceGroupName, name, connectionEnvelope, options) + if err != nil { + return WebAppsCreateOrUpdateSwiftVirtualNetworkConnectionWithCheckResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsCreateOrUpdateSwiftVirtualNetworkConnectionWithCheckResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsCreateOrUpdateSwiftVirtualNetworkConnectionWithCheckResponse{}, client.createOrUpdateSwiftVirtualNetworkConnectionWithCheckHandleError(resp) + } + return client.createOrUpdateSwiftVirtualNetworkConnectionWithCheckHandleResponse(resp) +} + +// createOrUpdateSwiftVirtualNetworkConnectionWithCheckCreateRequest creates the CreateOrUpdateSwiftVirtualNetworkConnectionWithCheck request. +func (client *WebAppsClient) createOrUpdateSwiftVirtualNetworkConnectionWithCheckCreateRequest(ctx context.Context, resourceGroupName string, name string, connectionEnvelope SwiftVirtualNetwork, options *WebAppsCreateOrUpdateSwiftVirtualNetworkConnectionWithCheckOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkConfig/virtualNetwork" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, connectionEnvelope) +} + +// createOrUpdateSwiftVirtualNetworkConnectionWithCheckHandleResponse handles the CreateOrUpdateSwiftVirtualNetworkConnectionWithCheck response. +func (client *WebAppsClient) createOrUpdateSwiftVirtualNetworkConnectionWithCheckHandleResponse(resp *http.Response) (WebAppsCreateOrUpdateSwiftVirtualNetworkConnectionWithCheckResponse, error) { + result := WebAppsCreateOrUpdateSwiftVirtualNetworkConnectionWithCheckResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.SwiftVirtualNetwork); err != nil { + return WebAppsCreateOrUpdateSwiftVirtualNetworkConnectionWithCheckResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// createOrUpdateSwiftVirtualNetworkConnectionWithCheckHandleError handles the CreateOrUpdateSwiftVirtualNetworkConnectionWithCheck error response. +func (client *WebAppsClient) createOrUpdateSwiftVirtualNetworkConnectionWithCheckHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// CreateOrUpdateSwiftVirtualNetworkConnectionWithCheckSlot - Description for Integrates this Web App with a Virtual Network. This requires that 1) "swiftSupported" +// is true when doing a GET against this resource, and 2) that the target Subnet has already been +// delegated, and is not in use by another App Service Plan other than the one this App is in. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) CreateOrUpdateSwiftVirtualNetworkConnectionWithCheckSlot(ctx context.Context, resourceGroupName string, name string, slot string, connectionEnvelope SwiftVirtualNetwork, options *WebAppsCreateOrUpdateSwiftVirtualNetworkConnectionWithCheckSlotOptions) (WebAppsCreateOrUpdateSwiftVirtualNetworkConnectionWithCheckSlotResponse, error) { + req, err := client.createOrUpdateSwiftVirtualNetworkConnectionWithCheckSlotCreateRequest(ctx, resourceGroupName, name, slot, connectionEnvelope, options) + if err != nil { + return WebAppsCreateOrUpdateSwiftVirtualNetworkConnectionWithCheckSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsCreateOrUpdateSwiftVirtualNetworkConnectionWithCheckSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsCreateOrUpdateSwiftVirtualNetworkConnectionWithCheckSlotResponse{}, client.createOrUpdateSwiftVirtualNetworkConnectionWithCheckSlotHandleError(resp) + } + return client.createOrUpdateSwiftVirtualNetworkConnectionWithCheckSlotHandleResponse(resp) +} + +// createOrUpdateSwiftVirtualNetworkConnectionWithCheckSlotCreateRequest creates the CreateOrUpdateSwiftVirtualNetworkConnectionWithCheckSlot request. +func (client *WebAppsClient) createOrUpdateSwiftVirtualNetworkConnectionWithCheckSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, slot string, connectionEnvelope SwiftVirtualNetwork, options *WebAppsCreateOrUpdateSwiftVirtualNetworkConnectionWithCheckSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkConfig/virtualNetwork" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, connectionEnvelope) +} + +// createOrUpdateSwiftVirtualNetworkConnectionWithCheckSlotHandleResponse handles the CreateOrUpdateSwiftVirtualNetworkConnectionWithCheckSlot response. +func (client *WebAppsClient) createOrUpdateSwiftVirtualNetworkConnectionWithCheckSlotHandleResponse(resp *http.Response) (WebAppsCreateOrUpdateSwiftVirtualNetworkConnectionWithCheckSlotResponse, error) { + result := WebAppsCreateOrUpdateSwiftVirtualNetworkConnectionWithCheckSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.SwiftVirtualNetwork); err != nil { + return WebAppsCreateOrUpdateSwiftVirtualNetworkConnectionWithCheckSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// createOrUpdateSwiftVirtualNetworkConnectionWithCheckSlotHandleError handles the CreateOrUpdateSwiftVirtualNetworkConnectionWithCheckSlot error response. +func (client *WebAppsClient) createOrUpdateSwiftVirtualNetworkConnectionWithCheckSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// CreateOrUpdateVnetConnection - Description for Adds a Virtual Network connection to an app or slot (PUT) or updates the connection properties (PATCH). +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) CreateOrUpdateVnetConnection(ctx context.Context, resourceGroupName string, name string, vnetName string, connectionEnvelope VnetInfoResource, options *WebAppsCreateOrUpdateVnetConnectionOptions) (WebAppsCreateOrUpdateVnetConnectionResponse, error) { + req, err := client.createOrUpdateVnetConnectionCreateRequest(ctx, resourceGroupName, name, vnetName, connectionEnvelope, options) + if err != nil { + return WebAppsCreateOrUpdateVnetConnectionResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsCreateOrUpdateVnetConnectionResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsCreateOrUpdateVnetConnectionResponse{}, client.createOrUpdateVnetConnectionHandleError(resp) + } + return client.createOrUpdateVnetConnectionHandleResponse(resp) +} + +// createOrUpdateVnetConnectionCreateRequest creates the CreateOrUpdateVnetConnection request. +func (client *WebAppsClient) createOrUpdateVnetConnectionCreateRequest(ctx context.Context, resourceGroupName string, name string, vnetName string, connectionEnvelope VnetInfoResource, options *WebAppsCreateOrUpdateVnetConnectionOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if vnetName == "" { + return nil, errors.New("parameter vnetName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{vnetName}", url.PathEscape(vnetName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, connectionEnvelope) +} + +// createOrUpdateVnetConnectionHandleResponse handles the CreateOrUpdateVnetConnection response. +func (client *WebAppsClient) createOrUpdateVnetConnectionHandleResponse(resp *http.Response) (WebAppsCreateOrUpdateVnetConnectionResponse, error) { + result := WebAppsCreateOrUpdateVnetConnectionResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.VnetInfoResource); err != nil { + return WebAppsCreateOrUpdateVnetConnectionResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// createOrUpdateVnetConnectionHandleError handles the CreateOrUpdateVnetConnection error response. +func (client *WebAppsClient) createOrUpdateVnetConnectionHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// CreateOrUpdateVnetConnectionGateway - Description for Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) CreateOrUpdateVnetConnectionGateway(ctx context.Context, resourceGroupName string, name string, vnetName string, gatewayName string, connectionEnvelope VnetGateway, options *WebAppsCreateOrUpdateVnetConnectionGatewayOptions) (WebAppsCreateOrUpdateVnetConnectionGatewayResponse, error) { + req, err := client.createOrUpdateVnetConnectionGatewayCreateRequest(ctx, resourceGroupName, name, vnetName, gatewayName, connectionEnvelope, options) + if err != nil { + return WebAppsCreateOrUpdateVnetConnectionGatewayResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsCreateOrUpdateVnetConnectionGatewayResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsCreateOrUpdateVnetConnectionGatewayResponse{}, client.createOrUpdateVnetConnectionGatewayHandleError(resp) + } + return client.createOrUpdateVnetConnectionGatewayHandleResponse(resp) +} + +// createOrUpdateVnetConnectionGatewayCreateRequest creates the CreateOrUpdateVnetConnectionGateway request. +func (client *WebAppsClient) createOrUpdateVnetConnectionGatewayCreateRequest(ctx context.Context, resourceGroupName string, name string, vnetName string, gatewayName string, connectionEnvelope VnetGateway, options *WebAppsCreateOrUpdateVnetConnectionGatewayOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if vnetName == "" { + return nil, errors.New("parameter vnetName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{vnetName}", url.PathEscape(vnetName)) + if gatewayName == "" { + return nil, errors.New("parameter gatewayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{gatewayName}", url.PathEscape(gatewayName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, connectionEnvelope) +} + +// createOrUpdateVnetConnectionGatewayHandleResponse handles the CreateOrUpdateVnetConnectionGateway response. +func (client *WebAppsClient) createOrUpdateVnetConnectionGatewayHandleResponse(resp *http.Response) (WebAppsCreateOrUpdateVnetConnectionGatewayResponse, error) { + result := WebAppsCreateOrUpdateVnetConnectionGatewayResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.VnetGateway); err != nil { + return WebAppsCreateOrUpdateVnetConnectionGatewayResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// createOrUpdateVnetConnectionGatewayHandleError handles the CreateOrUpdateVnetConnectionGateway error response. +func (client *WebAppsClient) createOrUpdateVnetConnectionGatewayHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// CreateOrUpdateVnetConnectionGatewaySlot - Description for Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) CreateOrUpdateVnetConnectionGatewaySlot(ctx context.Context, resourceGroupName string, name string, vnetName string, gatewayName string, slot string, connectionEnvelope VnetGateway, options *WebAppsCreateOrUpdateVnetConnectionGatewaySlotOptions) (WebAppsCreateOrUpdateVnetConnectionGatewaySlotResponse, error) { + req, err := client.createOrUpdateVnetConnectionGatewaySlotCreateRequest(ctx, resourceGroupName, name, vnetName, gatewayName, slot, connectionEnvelope, options) + if err != nil { + return WebAppsCreateOrUpdateVnetConnectionGatewaySlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsCreateOrUpdateVnetConnectionGatewaySlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsCreateOrUpdateVnetConnectionGatewaySlotResponse{}, client.createOrUpdateVnetConnectionGatewaySlotHandleError(resp) + } + return client.createOrUpdateVnetConnectionGatewaySlotHandleResponse(resp) +} + +// createOrUpdateVnetConnectionGatewaySlotCreateRequest creates the CreateOrUpdateVnetConnectionGatewaySlot request. +func (client *WebAppsClient) createOrUpdateVnetConnectionGatewaySlotCreateRequest(ctx context.Context, resourceGroupName string, name string, vnetName string, gatewayName string, slot string, connectionEnvelope VnetGateway, options *WebAppsCreateOrUpdateVnetConnectionGatewaySlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if vnetName == "" { + return nil, errors.New("parameter vnetName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{vnetName}", url.PathEscape(vnetName)) + if gatewayName == "" { + return nil, errors.New("parameter gatewayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{gatewayName}", url.PathEscape(gatewayName)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, connectionEnvelope) +} + +// createOrUpdateVnetConnectionGatewaySlotHandleResponse handles the CreateOrUpdateVnetConnectionGatewaySlot response. +func (client *WebAppsClient) createOrUpdateVnetConnectionGatewaySlotHandleResponse(resp *http.Response) (WebAppsCreateOrUpdateVnetConnectionGatewaySlotResponse, error) { + result := WebAppsCreateOrUpdateVnetConnectionGatewaySlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.VnetGateway); err != nil { + return WebAppsCreateOrUpdateVnetConnectionGatewaySlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// createOrUpdateVnetConnectionGatewaySlotHandleError handles the CreateOrUpdateVnetConnectionGatewaySlot error response. +func (client *WebAppsClient) createOrUpdateVnetConnectionGatewaySlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// CreateOrUpdateVnetConnectionSlot - Description for Adds a Virtual Network connection to an app or slot (PUT) or updates the connection properties (PATCH). +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) CreateOrUpdateVnetConnectionSlot(ctx context.Context, resourceGroupName string, name string, vnetName string, slot string, connectionEnvelope VnetInfoResource, options *WebAppsCreateOrUpdateVnetConnectionSlotOptions) (WebAppsCreateOrUpdateVnetConnectionSlotResponse, error) { + req, err := client.createOrUpdateVnetConnectionSlotCreateRequest(ctx, resourceGroupName, name, vnetName, slot, connectionEnvelope, options) + if err != nil { + return WebAppsCreateOrUpdateVnetConnectionSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsCreateOrUpdateVnetConnectionSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsCreateOrUpdateVnetConnectionSlotResponse{}, client.createOrUpdateVnetConnectionSlotHandleError(resp) + } + return client.createOrUpdateVnetConnectionSlotHandleResponse(resp) +} + +// createOrUpdateVnetConnectionSlotCreateRequest creates the CreateOrUpdateVnetConnectionSlot request. +func (client *WebAppsClient) createOrUpdateVnetConnectionSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, vnetName string, slot string, connectionEnvelope VnetInfoResource, options *WebAppsCreateOrUpdateVnetConnectionSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if vnetName == "" { + return nil, errors.New("parameter vnetName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{vnetName}", url.PathEscape(vnetName)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, connectionEnvelope) +} + +// createOrUpdateVnetConnectionSlotHandleResponse handles the CreateOrUpdateVnetConnectionSlot response. +func (client *WebAppsClient) createOrUpdateVnetConnectionSlotHandleResponse(resp *http.Response) (WebAppsCreateOrUpdateVnetConnectionSlotResponse, error) { + result := WebAppsCreateOrUpdateVnetConnectionSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.VnetInfoResource); err != nil { + return WebAppsCreateOrUpdateVnetConnectionSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// createOrUpdateVnetConnectionSlotHandleError handles the CreateOrUpdateVnetConnectionSlot error response. +func (client *WebAppsClient) createOrUpdateVnetConnectionSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// Delete - Description for Deletes a web, mobile, or API app, or one of the deployment slots. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) Delete(ctx context.Context, resourceGroupName string, name string, options *WebAppsDeleteOptions) (WebAppsDeleteResponse, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, name, options) + if err != nil { + return WebAppsDeleteResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsDeleteResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { + return WebAppsDeleteResponse{}, client.deleteHandleError(resp) + } + return WebAppsDeleteResponse{RawResponse: resp}, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *WebAppsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, name string, options *WebAppsDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + if options != nil && options.DeleteMetrics != nil { + reqQP.Set("deleteMetrics", strconv.FormatBool(*options.DeleteMetrics)) + } + if options != nil && options.DeleteEmptyServerFarm != nil { + reqQP.Set("deleteEmptyServerFarm", strconv.FormatBool(*options.DeleteEmptyServerFarm)) + } + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// deleteHandleError handles the Delete error response. +func (client *WebAppsClient) deleteHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + switch resp.StatusCode { + case http.StatusNotFound: + if len(body) == 0 { + return runtime.NewResponseError(errors.New(resp.Status), resp) + } + return runtime.NewResponseError(errors.New(string(body)), resp) + default: + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) + } +} + +// DeleteBackup - Description for Deletes a backup of an app by its ID. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) DeleteBackup(ctx context.Context, resourceGroupName string, name string, backupID string, options *WebAppsDeleteBackupOptions) (WebAppsDeleteBackupResponse, error) { + req, err := client.deleteBackupCreateRequest(ctx, resourceGroupName, name, backupID, options) + if err != nil { + return WebAppsDeleteBackupResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsDeleteBackupResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsDeleteBackupResponse{}, client.deleteBackupHandleError(resp) + } + return WebAppsDeleteBackupResponse{RawResponse: resp}, nil +} + +// deleteBackupCreateRequest creates the DeleteBackup request. +func (client *WebAppsClient) deleteBackupCreateRequest(ctx context.Context, resourceGroupName string, name string, backupID string, options *WebAppsDeleteBackupOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/backups/{backupId}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if backupID == "" { + return nil, errors.New("parameter backupID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{backupId}", url.PathEscape(backupID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// deleteBackupHandleError handles the DeleteBackup error response. +func (client *WebAppsClient) deleteBackupHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + switch resp.StatusCode { + case http.StatusNotFound: + if len(body) == 0 { + return runtime.NewResponseError(errors.New(resp.Status), resp) + } + return runtime.NewResponseError(errors.New(string(body)), resp) + default: + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) + } +} + +// DeleteBackupConfiguration - Description for Deletes the backup configuration of an app. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) DeleteBackupConfiguration(ctx context.Context, resourceGroupName string, name string, options *WebAppsDeleteBackupConfigurationOptions) (WebAppsDeleteBackupConfigurationResponse, error) { + req, err := client.deleteBackupConfigurationCreateRequest(ctx, resourceGroupName, name, options) + if err != nil { + return WebAppsDeleteBackupConfigurationResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsDeleteBackupConfigurationResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsDeleteBackupConfigurationResponse{}, client.deleteBackupConfigurationHandleError(resp) + } + return WebAppsDeleteBackupConfigurationResponse{RawResponse: resp}, nil +} + +// deleteBackupConfigurationCreateRequest creates the DeleteBackupConfiguration request. +func (client *WebAppsClient) deleteBackupConfigurationCreateRequest(ctx context.Context, resourceGroupName string, name string, options *WebAppsDeleteBackupConfigurationOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/backup" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// deleteBackupConfigurationHandleError handles the DeleteBackupConfiguration error response. +func (client *WebAppsClient) deleteBackupConfigurationHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// DeleteBackupConfigurationSlot - Description for Deletes the backup configuration of an app. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) DeleteBackupConfigurationSlot(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsDeleteBackupConfigurationSlotOptions) (WebAppsDeleteBackupConfigurationSlotResponse, error) { + req, err := client.deleteBackupConfigurationSlotCreateRequest(ctx, resourceGroupName, name, slot, options) + if err != nil { + return WebAppsDeleteBackupConfigurationSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsDeleteBackupConfigurationSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsDeleteBackupConfigurationSlotResponse{}, client.deleteBackupConfigurationSlotHandleError(resp) + } + return WebAppsDeleteBackupConfigurationSlotResponse{RawResponse: resp}, nil +} + +// deleteBackupConfigurationSlotCreateRequest creates the DeleteBackupConfigurationSlot request. +func (client *WebAppsClient) deleteBackupConfigurationSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsDeleteBackupConfigurationSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/backup" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// deleteBackupConfigurationSlotHandleError handles the DeleteBackupConfigurationSlot error response. +func (client *WebAppsClient) deleteBackupConfigurationSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// DeleteBackupSlot - Description for Deletes a backup of an app by its ID. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) DeleteBackupSlot(ctx context.Context, resourceGroupName string, name string, backupID string, slot string, options *WebAppsDeleteBackupSlotOptions) (WebAppsDeleteBackupSlotResponse, error) { + req, err := client.deleteBackupSlotCreateRequest(ctx, resourceGroupName, name, backupID, slot, options) + if err != nil { + return WebAppsDeleteBackupSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsDeleteBackupSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsDeleteBackupSlotResponse{}, client.deleteBackupSlotHandleError(resp) + } + return WebAppsDeleteBackupSlotResponse{RawResponse: resp}, nil +} + +// deleteBackupSlotCreateRequest creates the DeleteBackupSlot request. +func (client *WebAppsClient) deleteBackupSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, backupID string, slot string, options *WebAppsDeleteBackupSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups/{backupId}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if backupID == "" { + return nil, errors.New("parameter backupID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{backupId}", url.PathEscape(backupID)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// deleteBackupSlotHandleError handles the DeleteBackupSlot error response. +func (client *WebAppsClient) deleteBackupSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + switch resp.StatusCode { + case http.StatusNotFound: + if len(body) == 0 { + return runtime.NewResponseError(errors.New(resp.Status), resp) + } + return runtime.NewResponseError(errors.New(string(body)), resp) + default: + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) + } +} + +// DeleteContinuousWebJob - Description for Delete a continuous web job by its ID for an app, or a deployment slot. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) DeleteContinuousWebJob(ctx context.Context, resourceGroupName string, name string, webJobName string, options *WebAppsDeleteContinuousWebJobOptions) (WebAppsDeleteContinuousWebJobResponse, error) { + req, err := client.deleteContinuousWebJobCreateRequest(ctx, resourceGroupName, name, webJobName, options) + if err != nil { + return WebAppsDeleteContinuousWebJobResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsDeleteContinuousWebJobResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { + return WebAppsDeleteContinuousWebJobResponse{}, client.deleteContinuousWebJobHandleError(resp) + } + return WebAppsDeleteContinuousWebJobResponse{RawResponse: resp}, nil +} + +// deleteContinuousWebJobCreateRequest creates the DeleteContinuousWebJob request. +func (client *WebAppsClient) deleteContinuousWebJobCreateRequest(ctx context.Context, resourceGroupName string, name string, webJobName string, options *WebAppsDeleteContinuousWebJobOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/continuouswebjobs/{webJobName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if webJobName == "" { + return nil, errors.New("parameter webJobName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{webJobName}", url.PathEscape(webJobName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// deleteContinuousWebJobHandleError handles the DeleteContinuousWebJob error response. +func (client *WebAppsClient) deleteContinuousWebJobHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// DeleteContinuousWebJobSlot - Description for Delete a continuous web job by its ID for an app, or a deployment slot. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) DeleteContinuousWebJobSlot(ctx context.Context, resourceGroupName string, name string, webJobName string, slot string, options *WebAppsDeleteContinuousWebJobSlotOptions) (WebAppsDeleteContinuousWebJobSlotResponse, error) { + req, err := client.deleteContinuousWebJobSlotCreateRequest(ctx, resourceGroupName, name, webJobName, slot, options) + if err != nil { + return WebAppsDeleteContinuousWebJobSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsDeleteContinuousWebJobSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { + return WebAppsDeleteContinuousWebJobSlotResponse{}, client.deleteContinuousWebJobSlotHandleError(resp) + } + return WebAppsDeleteContinuousWebJobSlotResponse{RawResponse: resp}, nil +} + +// deleteContinuousWebJobSlotCreateRequest creates the DeleteContinuousWebJobSlot request. +func (client *WebAppsClient) deleteContinuousWebJobSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, webJobName string, slot string, options *WebAppsDeleteContinuousWebJobSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/continuouswebjobs/{webJobName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if webJobName == "" { + return nil, errors.New("parameter webJobName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{webJobName}", url.PathEscape(webJobName)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// deleteContinuousWebJobSlotHandleError handles the DeleteContinuousWebJobSlot error response. +func (client *WebAppsClient) deleteContinuousWebJobSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// DeleteDeployment - Description for Delete a deployment by its ID for an app, or a deployment slot. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) DeleteDeployment(ctx context.Context, resourceGroupName string, name string, id string, options *WebAppsDeleteDeploymentOptions) (WebAppsDeleteDeploymentResponse, error) { + req, err := client.deleteDeploymentCreateRequest(ctx, resourceGroupName, name, id, options) + if err != nil { + return WebAppsDeleteDeploymentResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsDeleteDeploymentResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { + return WebAppsDeleteDeploymentResponse{}, client.deleteDeploymentHandleError(resp) + } + return WebAppsDeleteDeploymentResponse{RawResponse: resp}, nil +} + +// deleteDeploymentCreateRequest creates the DeleteDeployment request. +func (client *WebAppsClient) deleteDeploymentCreateRequest(ctx context.Context, resourceGroupName string, name string, id string, options *WebAppsDeleteDeploymentOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/deployments/{id}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if id == "" { + return nil, errors.New("parameter id cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{id}", url.PathEscape(id)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// deleteDeploymentHandleError handles the DeleteDeployment error response. +func (client *WebAppsClient) deleteDeploymentHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// DeleteDeploymentSlot - Description for Delete a deployment by its ID for an app, or a deployment slot. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) DeleteDeploymentSlot(ctx context.Context, resourceGroupName string, name string, id string, slot string, options *WebAppsDeleteDeploymentSlotOptions) (WebAppsDeleteDeploymentSlotResponse, error) { + req, err := client.deleteDeploymentSlotCreateRequest(ctx, resourceGroupName, name, id, slot, options) + if err != nil { + return WebAppsDeleteDeploymentSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsDeleteDeploymentSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { + return WebAppsDeleteDeploymentSlotResponse{}, client.deleteDeploymentSlotHandleError(resp) + } + return WebAppsDeleteDeploymentSlotResponse{RawResponse: resp}, nil +} + +// deleteDeploymentSlotCreateRequest creates the DeleteDeploymentSlot request. +func (client *WebAppsClient) deleteDeploymentSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, id string, slot string, options *WebAppsDeleteDeploymentSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/deployments/{id}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if id == "" { + return nil, errors.New("parameter id cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{id}", url.PathEscape(id)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// deleteDeploymentSlotHandleError handles the DeleteDeploymentSlot error response. +func (client *WebAppsClient) deleteDeploymentSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// DeleteDomainOwnershipIdentifier - Description for Deletes a domain ownership identifier for a web app. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) DeleteDomainOwnershipIdentifier(ctx context.Context, resourceGroupName string, name string, domainOwnershipIdentifierName string, options *WebAppsDeleteDomainOwnershipIdentifierOptions) (WebAppsDeleteDomainOwnershipIdentifierResponse, error) { + req, err := client.deleteDomainOwnershipIdentifierCreateRequest(ctx, resourceGroupName, name, domainOwnershipIdentifierName, options) + if err != nil { + return WebAppsDeleteDomainOwnershipIdentifierResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsDeleteDomainOwnershipIdentifierResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { + return WebAppsDeleteDomainOwnershipIdentifierResponse{}, client.deleteDomainOwnershipIdentifierHandleError(resp) + } + return WebAppsDeleteDomainOwnershipIdentifierResponse{RawResponse: resp}, nil +} + +// deleteDomainOwnershipIdentifierCreateRequest creates the DeleteDomainOwnershipIdentifier request. +func (client *WebAppsClient) deleteDomainOwnershipIdentifierCreateRequest(ctx context.Context, resourceGroupName string, name string, domainOwnershipIdentifierName string, options *WebAppsDeleteDomainOwnershipIdentifierOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if domainOwnershipIdentifierName == "" { + return nil, errors.New("parameter domainOwnershipIdentifierName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{domainOwnershipIdentifierName}", url.PathEscape(domainOwnershipIdentifierName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// deleteDomainOwnershipIdentifierHandleError handles the DeleteDomainOwnershipIdentifier error response. +func (client *WebAppsClient) deleteDomainOwnershipIdentifierHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// DeleteDomainOwnershipIdentifierSlot - Description for Deletes a domain ownership identifier for a web app. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) DeleteDomainOwnershipIdentifierSlot(ctx context.Context, resourceGroupName string, name string, domainOwnershipIdentifierName string, slot string, options *WebAppsDeleteDomainOwnershipIdentifierSlotOptions) (WebAppsDeleteDomainOwnershipIdentifierSlotResponse, error) { + req, err := client.deleteDomainOwnershipIdentifierSlotCreateRequest(ctx, resourceGroupName, name, domainOwnershipIdentifierName, slot, options) + if err != nil { + return WebAppsDeleteDomainOwnershipIdentifierSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsDeleteDomainOwnershipIdentifierSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { + return WebAppsDeleteDomainOwnershipIdentifierSlotResponse{}, client.deleteDomainOwnershipIdentifierSlotHandleError(resp) + } + return WebAppsDeleteDomainOwnershipIdentifierSlotResponse{RawResponse: resp}, nil +} + +// deleteDomainOwnershipIdentifierSlotCreateRequest creates the DeleteDomainOwnershipIdentifierSlot request. +func (client *WebAppsClient) deleteDomainOwnershipIdentifierSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, domainOwnershipIdentifierName string, slot string, options *WebAppsDeleteDomainOwnershipIdentifierSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if domainOwnershipIdentifierName == "" { + return nil, errors.New("parameter domainOwnershipIdentifierName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{domainOwnershipIdentifierName}", url.PathEscape(domainOwnershipIdentifierName)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// deleteDomainOwnershipIdentifierSlotHandleError handles the DeleteDomainOwnershipIdentifierSlot error response. +func (client *WebAppsClient) deleteDomainOwnershipIdentifierSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// DeleteFunction - Description for Delete a function for web site, or a deployment slot. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) DeleteFunction(ctx context.Context, resourceGroupName string, name string, functionName string, options *WebAppsDeleteFunctionOptions) (WebAppsDeleteFunctionResponse, error) { + req, err := client.deleteFunctionCreateRequest(ctx, resourceGroupName, name, functionName, options) + if err != nil { + return WebAppsDeleteFunctionResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsDeleteFunctionResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusNoContent) { + return WebAppsDeleteFunctionResponse{}, client.deleteFunctionHandleError(resp) + } + return WebAppsDeleteFunctionResponse{RawResponse: resp}, nil +} + +// deleteFunctionCreateRequest creates the DeleteFunction request. +func (client *WebAppsClient) deleteFunctionCreateRequest(ctx context.Context, resourceGroupName string, name string, functionName string, options *WebAppsDeleteFunctionOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if functionName == "" { + return nil, errors.New("parameter functionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{functionName}", url.PathEscape(functionName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// deleteFunctionHandleError handles the DeleteFunction error response. +func (client *WebAppsClient) deleteFunctionHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + switch resp.StatusCode { + case http.StatusNotFound: + if len(body) == 0 { + return runtime.NewResponseError(errors.New(resp.Status), resp) + } + return runtime.NewResponseError(errors.New(string(body)), resp) + default: + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) + } +} + +// DeleteFunctionSecret - Description for Delete a function secret. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) DeleteFunctionSecret(ctx context.Context, resourceGroupName string, name string, functionName string, keyName string, options *WebAppsDeleteFunctionSecretOptions) (WebAppsDeleteFunctionSecretResponse, error) { + req, err := client.deleteFunctionSecretCreateRequest(ctx, resourceGroupName, name, functionName, keyName, options) + if err != nil { + return WebAppsDeleteFunctionSecretResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsDeleteFunctionSecretResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusNoContent) { + return WebAppsDeleteFunctionSecretResponse{}, client.deleteFunctionSecretHandleError(resp) + } + return WebAppsDeleteFunctionSecretResponse{RawResponse: resp}, nil +} + +// deleteFunctionSecretCreateRequest creates the DeleteFunctionSecret request. +func (client *WebAppsClient) deleteFunctionSecretCreateRequest(ctx context.Context, resourceGroupName string, name string, functionName string, keyName string, options *WebAppsDeleteFunctionSecretOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}/keys/{keyName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if functionName == "" { + return nil, errors.New("parameter functionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{functionName}", url.PathEscape(functionName)) + if keyName == "" { + return nil, errors.New("parameter keyName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{keyName}", url.PathEscape(keyName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// deleteFunctionSecretHandleError handles the DeleteFunctionSecret error response. +func (client *WebAppsClient) deleteFunctionSecretHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + switch resp.StatusCode { + case http.StatusNotFound: + if len(body) == 0 { + return runtime.NewResponseError(errors.New(resp.Status), resp) + } + return runtime.NewResponseError(errors.New(string(body)), resp) + default: + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) + } +} + +// DeleteFunctionSecretSlot - Description for Delete a function secret. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) DeleteFunctionSecretSlot(ctx context.Context, resourceGroupName string, name string, functionName string, keyName string, slot string, options *WebAppsDeleteFunctionSecretSlotOptions) (WebAppsDeleteFunctionSecretSlotResponse, error) { + req, err := client.deleteFunctionSecretSlotCreateRequest(ctx, resourceGroupName, name, functionName, keyName, slot, options) + if err != nil { + return WebAppsDeleteFunctionSecretSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsDeleteFunctionSecretSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusNoContent) { + return WebAppsDeleteFunctionSecretSlotResponse{}, client.deleteFunctionSecretSlotHandleError(resp) + } + return WebAppsDeleteFunctionSecretSlotResponse{RawResponse: resp}, nil +} + +// deleteFunctionSecretSlotCreateRequest creates the DeleteFunctionSecretSlot request. +func (client *WebAppsClient) deleteFunctionSecretSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, functionName string, keyName string, slot string, options *WebAppsDeleteFunctionSecretSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}/keys/{keyName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if functionName == "" { + return nil, errors.New("parameter functionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{functionName}", url.PathEscape(functionName)) + if keyName == "" { + return nil, errors.New("parameter keyName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{keyName}", url.PathEscape(keyName)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// deleteFunctionSecretSlotHandleError handles the DeleteFunctionSecretSlot error response. +func (client *WebAppsClient) deleteFunctionSecretSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + switch resp.StatusCode { + case http.StatusNotFound: + if len(body) == 0 { + return runtime.NewResponseError(errors.New(resp.Status), resp) + } + return runtime.NewResponseError(errors.New(string(body)), resp) + default: + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) + } +} + +// DeleteHostNameBinding - Description for Deletes a hostname binding for an app. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) DeleteHostNameBinding(ctx context.Context, resourceGroupName string, name string, hostName string, options *WebAppsDeleteHostNameBindingOptions) (WebAppsDeleteHostNameBindingResponse, error) { + req, err := client.deleteHostNameBindingCreateRequest(ctx, resourceGroupName, name, hostName, options) + if err != nil { + return WebAppsDeleteHostNameBindingResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsDeleteHostNameBindingResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { + return WebAppsDeleteHostNameBindingResponse{}, client.deleteHostNameBindingHandleError(resp) + } + return WebAppsDeleteHostNameBindingResponse{RawResponse: resp}, nil +} + +// deleteHostNameBindingCreateRequest creates the DeleteHostNameBinding request. +func (client *WebAppsClient) deleteHostNameBindingCreateRequest(ctx context.Context, resourceGroupName string, name string, hostName string, options *WebAppsDeleteHostNameBindingOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hostNameBindings/{hostName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if hostName == "" { + return nil, errors.New("parameter hostName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{hostName}", url.PathEscape(hostName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// deleteHostNameBindingHandleError handles the DeleteHostNameBinding error response. +func (client *WebAppsClient) deleteHostNameBindingHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// DeleteHostNameBindingSlot - Description for Deletes a hostname binding for an app. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) DeleteHostNameBindingSlot(ctx context.Context, resourceGroupName string, name string, slot string, hostName string, options *WebAppsDeleteHostNameBindingSlotOptions) (WebAppsDeleteHostNameBindingSlotResponse, error) { + req, err := client.deleteHostNameBindingSlotCreateRequest(ctx, resourceGroupName, name, slot, hostName, options) + if err != nil { + return WebAppsDeleteHostNameBindingSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsDeleteHostNameBindingSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { + return WebAppsDeleteHostNameBindingSlotResponse{}, client.deleteHostNameBindingSlotHandleError(resp) + } + return WebAppsDeleteHostNameBindingSlotResponse{RawResponse: resp}, nil +} + +// deleteHostNameBindingSlotCreateRequest creates the DeleteHostNameBindingSlot request. +func (client *WebAppsClient) deleteHostNameBindingSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, slot string, hostName string, options *WebAppsDeleteHostNameBindingSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hostNameBindings/{hostName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if hostName == "" { + return nil, errors.New("parameter hostName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{hostName}", url.PathEscape(hostName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// deleteHostNameBindingSlotHandleError handles the DeleteHostNameBindingSlot error response. +func (client *WebAppsClient) deleteHostNameBindingSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// DeleteHostSecret - Description for Delete a host level secret. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) DeleteHostSecret(ctx context.Context, resourceGroupName string, name string, keyType string, keyName string, options *WebAppsDeleteHostSecretOptions) (WebAppsDeleteHostSecretResponse, error) { + req, err := client.deleteHostSecretCreateRequest(ctx, resourceGroupName, name, keyType, keyName, options) + if err != nil { + return WebAppsDeleteHostSecretResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsDeleteHostSecretResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusNoContent) { + return WebAppsDeleteHostSecretResponse{}, client.deleteHostSecretHandleError(resp) + } + return WebAppsDeleteHostSecretResponse{RawResponse: resp}, nil +} + +// deleteHostSecretCreateRequest creates the DeleteHostSecret request. +func (client *WebAppsClient) deleteHostSecretCreateRequest(ctx context.Context, resourceGroupName string, name string, keyType string, keyName string, options *WebAppsDeleteHostSecretOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/host/default/{keyType}/{keyName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if keyType == "" { + return nil, errors.New("parameter keyType cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{keyType}", url.PathEscape(keyType)) + if keyName == "" { + return nil, errors.New("parameter keyName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{keyName}", url.PathEscape(keyName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// deleteHostSecretHandleError handles the DeleteHostSecret error response. +func (client *WebAppsClient) deleteHostSecretHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + switch resp.StatusCode { + case http.StatusNotFound: + if len(body) == 0 { + return runtime.NewResponseError(errors.New(resp.Status), resp) + } + return runtime.NewResponseError(errors.New(string(body)), resp) + default: + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) + } +} + +// DeleteHostSecretSlot - Description for Delete a host level secret. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) DeleteHostSecretSlot(ctx context.Context, resourceGroupName string, name string, keyType string, keyName string, slot string, options *WebAppsDeleteHostSecretSlotOptions) (WebAppsDeleteHostSecretSlotResponse, error) { + req, err := client.deleteHostSecretSlotCreateRequest(ctx, resourceGroupName, name, keyType, keyName, slot, options) + if err != nil { + return WebAppsDeleteHostSecretSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsDeleteHostSecretSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusNoContent) { + return WebAppsDeleteHostSecretSlotResponse{}, client.deleteHostSecretSlotHandleError(resp) + } + return WebAppsDeleteHostSecretSlotResponse{RawResponse: resp}, nil +} + +// deleteHostSecretSlotCreateRequest creates the DeleteHostSecretSlot request. +func (client *WebAppsClient) deleteHostSecretSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, keyType string, keyName string, slot string, options *WebAppsDeleteHostSecretSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/host/default/{keyType}/{keyName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if keyType == "" { + return nil, errors.New("parameter keyType cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{keyType}", url.PathEscape(keyType)) + if keyName == "" { + return nil, errors.New("parameter keyName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{keyName}", url.PathEscape(keyName)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// deleteHostSecretSlotHandleError handles the DeleteHostSecretSlot error response. +func (client *WebAppsClient) deleteHostSecretSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + switch resp.StatusCode { + case http.StatusNotFound: + if len(body) == 0 { + return runtime.NewResponseError(errors.New(resp.Status), resp) + } + return runtime.NewResponseError(errors.New(string(body)), resp) + default: + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) + } +} + +// DeleteHybridConnection - Description for Removes a Hybrid Connection from this site. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) DeleteHybridConnection(ctx context.Context, resourceGroupName string, name string, namespaceName string, relayName string, options *WebAppsDeleteHybridConnectionOptions) (WebAppsDeleteHybridConnectionResponse, error) { + req, err := client.deleteHybridConnectionCreateRequest(ctx, resourceGroupName, name, namespaceName, relayName, options) + if err != nil { + return WebAppsDeleteHybridConnectionResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsDeleteHybridConnectionResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsDeleteHybridConnectionResponse{}, client.deleteHybridConnectionHandleError(resp) + } + return WebAppsDeleteHybridConnectionResponse{RawResponse: resp}, nil +} + +// deleteHybridConnectionCreateRequest creates the DeleteHybridConnection request. +func (client *WebAppsClient) deleteHybridConnectionCreateRequest(ctx context.Context, resourceGroupName string, name string, namespaceName string, relayName string, options *WebAppsDeleteHybridConnectionOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if namespaceName == "" { + return nil, errors.New("parameter namespaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{namespaceName}", url.PathEscape(namespaceName)) + if relayName == "" { + return nil, errors.New("parameter relayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{relayName}", url.PathEscape(relayName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// deleteHybridConnectionHandleError handles the DeleteHybridConnection error response. +func (client *WebAppsClient) deleteHybridConnectionHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + switch resp.StatusCode { + case http.StatusNotFound: + if len(body) == 0 { + return runtime.NewResponseError(errors.New(resp.Status), resp) + } + return runtime.NewResponseError(errors.New(string(body)), resp) + default: + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) + } +} + +// DeleteHybridConnectionSlot - Description for Removes a Hybrid Connection from this site. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) DeleteHybridConnectionSlot(ctx context.Context, resourceGroupName string, name string, namespaceName string, relayName string, slot string, options *WebAppsDeleteHybridConnectionSlotOptions) (WebAppsDeleteHybridConnectionSlotResponse, error) { + req, err := client.deleteHybridConnectionSlotCreateRequest(ctx, resourceGroupName, name, namespaceName, relayName, slot, options) + if err != nil { + return WebAppsDeleteHybridConnectionSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsDeleteHybridConnectionSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsDeleteHybridConnectionSlotResponse{}, client.deleteHybridConnectionSlotHandleError(resp) + } + return WebAppsDeleteHybridConnectionSlotResponse{RawResponse: resp}, nil +} + +// deleteHybridConnectionSlotCreateRequest creates the DeleteHybridConnectionSlot request. +func (client *WebAppsClient) deleteHybridConnectionSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, namespaceName string, relayName string, slot string, options *WebAppsDeleteHybridConnectionSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if namespaceName == "" { + return nil, errors.New("parameter namespaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{namespaceName}", url.PathEscape(namespaceName)) + if relayName == "" { + return nil, errors.New("parameter relayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{relayName}", url.PathEscape(relayName)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// deleteHybridConnectionSlotHandleError handles the DeleteHybridConnectionSlot error response. +func (client *WebAppsClient) deleteHybridConnectionSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + switch resp.StatusCode { + case http.StatusNotFound: + if len(body) == 0 { + return runtime.NewResponseError(errors.New(resp.Status), resp) + } + return runtime.NewResponseError(errors.New(string(body)), resp) + default: + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) + } +} + +// DeleteInstanceFunctionSlot - Description for Delete a function for web site, or a deployment slot. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) DeleteInstanceFunctionSlot(ctx context.Context, resourceGroupName string, name string, functionName string, slot string, options *WebAppsDeleteInstanceFunctionSlotOptions) (WebAppsDeleteInstanceFunctionSlotResponse, error) { + req, err := client.deleteInstanceFunctionSlotCreateRequest(ctx, resourceGroupName, name, functionName, slot, options) + if err != nil { + return WebAppsDeleteInstanceFunctionSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsDeleteInstanceFunctionSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusNoContent) { + return WebAppsDeleteInstanceFunctionSlotResponse{}, client.deleteInstanceFunctionSlotHandleError(resp) + } + return WebAppsDeleteInstanceFunctionSlotResponse{RawResponse: resp}, nil +} + +// deleteInstanceFunctionSlotCreateRequest creates the DeleteInstanceFunctionSlot request. +func (client *WebAppsClient) deleteInstanceFunctionSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, functionName string, slot string, options *WebAppsDeleteInstanceFunctionSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if functionName == "" { + return nil, errors.New("parameter functionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{functionName}", url.PathEscape(functionName)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// deleteInstanceFunctionSlotHandleError handles the DeleteInstanceFunctionSlot error response. +func (client *WebAppsClient) deleteInstanceFunctionSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + switch resp.StatusCode { + case http.StatusNotFound: + if len(body) == 0 { + return runtime.NewResponseError(errors.New(resp.Status), resp) + } + return runtime.NewResponseError(errors.New(string(body)), resp) + default: + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) + } +} + +// DeleteInstanceProcess - Description for Terminate a process by its ID for a web site, or a deployment slot, or specific scaled-out instance in a web +// site. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) DeleteInstanceProcess(ctx context.Context, resourceGroupName string, name string, processID string, instanceID string, options *WebAppsDeleteInstanceProcessOptions) (WebAppsDeleteInstanceProcessResponse, error) { + req, err := client.deleteInstanceProcessCreateRequest(ctx, resourceGroupName, name, processID, instanceID, options) + if err != nil { + return WebAppsDeleteInstanceProcessResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsDeleteInstanceProcessResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusNoContent) { + return WebAppsDeleteInstanceProcessResponse{}, client.deleteInstanceProcessHandleError(resp) + } + return WebAppsDeleteInstanceProcessResponse{RawResponse: resp}, nil +} + +// deleteInstanceProcessCreateRequest creates the DeleteInstanceProcess request. +func (client *WebAppsClient) deleteInstanceProcessCreateRequest(ctx context.Context, resourceGroupName string, name string, processID string, instanceID string, options *WebAppsDeleteInstanceProcessOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if processID == "" { + return nil, errors.New("parameter processID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{processId}", url.PathEscape(processID)) + if instanceID == "" { + return nil, errors.New("parameter instanceID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// deleteInstanceProcessHandleError handles the DeleteInstanceProcess error response. +func (client *WebAppsClient) deleteInstanceProcessHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + switch resp.StatusCode { + case http.StatusNotFound: + if len(body) == 0 { + return runtime.NewResponseError(errors.New(resp.Status), resp) + } + return runtime.NewResponseError(errors.New(string(body)), resp) + default: + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) + } +} + +// DeleteInstanceProcessSlot - Description for Terminate a process by its ID for a web site, or a deployment slot, or specific scaled-out instance in a +// web site. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) DeleteInstanceProcessSlot(ctx context.Context, resourceGroupName string, name string, processID string, slot string, instanceID string, options *WebAppsDeleteInstanceProcessSlotOptions) (WebAppsDeleteInstanceProcessSlotResponse, error) { + req, err := client.deleteInstanceProcessSlotCreateRequest(ctx, resourceGroupName, name, processID, slot, instanceID, options) + if err != nil { + return WebAppsDeleteInstanceProcessSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsDeleteInstanceProcessSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusNoContent) { + return WebAppsDeleteInstanceProcessSlotResponse{}, client.deleteInstanceProcessSlotHandleError(resp) + } + return WebAppsDeleteInstanceProcessSlotResponse{RawResponse: resp}, nil +} + +// deleteInstanceProcessSlotCreateRequest creates the DeleteInstanceProcessSlot request. +func (client *WebAppsClient) deleteInstanceProcessSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, processID string, slot string, instanceID string, options *WebAppsDeleteInstanceProcessSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if processID == "" { + return nil, errors.New("parameter processID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{processId}", url.PathEscape(processID)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if instanceID == "" { + return nil, errors.New("parameter instanceID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// deleteInstanceProcessSlotHandleError handles the DeleteInstanceProcessSlot error response. +func (client *WebAppsClient) deleteInstanceProcessSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + switch resp.StatusCode { + case http.StatusNotFound: + if len(body) == 0 { + return runtime.NewResponseError(errors.New(resp.Status), resp) + } + return runtime.NewResponseError(errors.New(string(body)), resp) + default: + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) + } +} + +// DeletePremierAddOn - Description for Delete a premier add-on from an app. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) DeletePremierAddOn(ctx context.Context, resourceGroupName string, name string, premierAddOnName string, options *WebAppsDeletePremierAddOnOptions) (WebAppsDeletePremierAddOnResponse, error) { + req, err := client.deletePremierAddOnCreateRequest(ctx, resourceGroupName, name, premierAddOnName, options) + if err != nil { + return WebAppsDeletePremierAddOnResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsDeletePremierAddOnResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsDeletePremierAddOnResponse{}, client.deletePremierAddOnHandleError(resp) + } + return WebAppsDeletePremierAddOnResponse{RawResponse: resp}, nil +} + +// deletePremierAddOnCreateRequest creates the DeletePremierAddOn request. +func (client *WebAppsClient) deletePremierAddOnCreateRequest(ctx context.Context, resourceGroupName string, name string, premierAddOnName string, options *WebAppsDeletePremierAddOnOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/premieraddons/{premierAddOnName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if premierAddOnName == "" { + return nil, errors.New("parameter premierAddOnName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{premierAddOnName}", url.PathEscape(premierAddOnName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// deletePremierAddOnHandleError handles the DeletePremierAddOn error response. +func (client *WebAppsClient) deletePremierAddOnHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// DeletePremierAddOnSlot - Description for Delete a premier add-on from an app. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) DeletePremierAddOnSlot(ctx context.Context, resourceGroupName string, name string, premierAddOnName string, slot string, options *WebAppsDeletePremierAddOnSlotOptions) (WebAppsDeletePremierAddOnSlotResponse, error) { + req, err := client.deletePremierAddOnSlotCreateRequest(ctx, resourceGroupName, name, premierAddOnName, slot, options) + if err != nil { + return WebAppsDeletePremierAddOnSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsDeletePremierAddOnSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsDeletePremierAddOnSlotResponse{}, client.deletePremierAddOnSlotHandleError(resp) + } + return WebAppsDeletePremierAddOnSlotResponse{RawResponse: resp}, nil +} + +// deletePremierAddOnSlotCreateRequest creates the DeletePremierAddOnSlot request. +func (client *WebAppsClient) deletePremierAddOnSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, premierAddOnName string, slot string, options *WebAppsDeletePremierAddOnSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/premieraddons/{premierAddOnName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if premierAddOnName == "" { + return nil, errors.New("parameter premierAddOnName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{premierAddOnName}", url.PathEscape(premierAddOnName)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// deletePremierAddOnSlotHandleError handles the DeletePremierAddOnSlot error response. +func (client *WebAppsClient) deletePremierAddOnSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// BeginDeletePrivateEndpointConnection - Description for Deletes a private endpoint connection +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) BeginDeletePrivateEndpointConnection(ctx context.Context, resourceGroupName string, name string, privateEndpointConnectionName string, options *WebAppsBeginDeletePrivateEndpointConnectionOptions) (WebAppsDeletePrivateEndpointConnectionPollerResponse, error) { + resp, err := client.deletePrivateEndpointConnection(ctx, resourceGroupName, name, privateEndpointConnectionName, options) + if err != nil { + return WebAppsDeletePrivateEndpointConnectionPollerResponse{}, err + } + result := WebAppsDeletePrivateEndpointConnectionPollerResponse{ + RawResponse: resp, + } + pt, err := armruntime.NewPoller("WebAppsClient.DeletePrivateEndpointConnection", "", resp, client.pl, client.deletePrivateEndpointConnectionHandleError) + if err != nil { + return WebAppsDeletePrivateEndpointConnectionPollerResponse{}, err + } + result.Poller = &WebAppsDeletePrivateEndpointConnectionPoller{ + pt: pt, + } + return result, nil +} + +// DeletePrivateEndpointConnection - Description for Deletes a private endpoint connection +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) deletePrivateEndpointConnection(ctx context.Context, resourceGroupName string, name string, privateEndpointConnectionName string, options *WebAppsBeginDeletePrivateEndpointConnectionOptions) (*http.Response, error) { + req, err := client.deletePrivateEndpointConnectionCreateRequest(ctx, resourceGroupName, name, privateEndpointConnectionName, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, client.deletePrivateEndpointConnectionHandleError(resp) + } + return resp, nil +} + +// deletePrivateEndpointConnectionCreateRequest creates the DeletePrivateEndpointConnection request. +func (client *WebAppsClient) deletePrivateEndpointConnectionCreateRequest(ctx context.Context, resourceGroupName string, name string, privateEndpointConnectionName string, options *WebAppsBeginDeletePrivateEndpointConnectionOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateEndpointConnections/{privateEndpointConnectionName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if privateEndpointConnectionName == "" { + return nil, errors.New("parameter privateEndpointConnectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{privateEndpointConnectionName}", url.PathEscape(privateEndpointConnectionName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// deletePrivateEndpointConnectionHandleError handles the DeletePrivateEndpointConnection error response. +func (client *WebAppsClient) deletePrivateEndpointConnectionHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// BeginDeletePrivateEndpointConnectionSlot - Description for Deletes a private endpoint connection +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) BeginDeletePrivateEndpointConnectionSlot(ctx context.Context, resourceGroupName string, name string, privateEndpointConnectionName string, slot string, options *WebAppsBeginDeletePrivateEndpointConnectionSlotOptions) (WebAppsDeletePrivateEndpointConnectionSlotPollerResponse, error) { + resp, err := client.deletePrivateEndpointConnectionSlot(ctx, resourceGroupName, name, privateEndpointConnectionName, slot, options) + if err != nil { + return WebAppsDeletePrivateEndpointConnectionSlotPollerResponse{}, err + } + result := WebAppsDeletePrivateEndpointConnectionSlotPollerResponse{ + RawResponse: resp, + } + pt, err := armruntime.NewPoller("WebAppsClient.DeletePrivateEndpointConnectionSlot", "", resp, client.pl, client.deletePrivateEndpointConnectionSlotHandleError) + if err != nil { + return WebAppsDeletePrivateEndpointConnectionSlotPollerResponse{}, err + } + result.Poller = &WebAppsDeletePrivateEndpointConnectionSlotPoller{ + pt: pt, + } + return result, nil +} + +// DeletePrivateEndpointConnectionSlot - Description for Deletes a private endpoint connection +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) deletePrivateEndpointConnectionSlot(ctx context.Context, resourceGroupName string, name string, privateEndpointConnectionName string, slot string, options *WebAppsBeginDeletePrivateEndpointConnectionSlotOptions) (*http.Response, error) { + req, err := client.deletePrivateEndpointConnectionSlotCreateRequest(ctx, resourceGroupName, name, privateEndpointConnectionName, slot, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, client.deletePrivateEndpointConnectionSlotHandleError(resp) + } + return resp, nil +} + +// deletePrivateEndpointConnectionSlotCreateRequest creates the DeletePrivateEndpointConnectionSlot request. +func (client *WebAppsClient) deletePrivateEndpointConnectionSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, privateEndpointConnectionName string, slot string, options *WebAppsBeginDeletePrivateEndpointConnectionSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/privateEndpointConnections/{privateEndpointConnectionName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if privateEndpointConnectionName == "" { + return nil, errors.New("parameter privateEndpointConnectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{privateEndpointConnectionName}", url.PathEscape(privateEndpointConnectionName)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// deletePrivateEndpointConnectionSlotHandleError handles the DeletePrivateEndpointConnectionSlot error response. +func (client *WebAppsClient) deletePrivateEndpointConnectionSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// DeleteProcess - Description for Terminate a process by its ID for a web site, or a deployment slot, or specific scaled-out instance in a web site. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) DeleteProcess(ctx context.Context, resourceGroupName string, name string, processID string, options *WebAppsDeleteProcessOptions) (WebAppsDeleteProcessResponse, error) { + req, err := client.deleteProcessCreateRequest(ctx, resourceGroupName, name, processID, options) + if err != nil { + return WebAppsDeleteProcessResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsDeleteProcessResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusNoContent) { + return WebAppsDeleteProcessResponse{}, client.deleteProcessHandleError(resp) + } + return WebAppsDeleteProcessResponse{RawResponse: resp}, nil +} + +// deleteProcessCreateRequest creates the DeleteProcess request. +func (client *WebAppsClient) deleteProcessCreateRequest(ctx context.Context, resourceGroupName string, name string, processID string, options *WebAppsDeleteProcessOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if processID == "" { + return nil, errors.New("parameter processID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{processId}", url.PathEscape(processID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// deleteProcessHandleError handles the DeleteProcess error response. +func (client *WebAppsClient) deleteProcessHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + switch resp.StatusCode { + case http.StatusNotFound: + if len(body) == 0 { + return runtime.NewResponseError(errors.New(resp.Status), resp) + } + return runtime.NewResponseError(errors.New(string(body)), resp) + default: + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) + } +} + +// DeleteProcessSlot - Description for Terminate a process by its ID for a web site, or a deployment slot, or specific scaled-out instance in a web site. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) DeleteProcessSlot(ctx context.Context, resourceGroupName string, name string, processID string, slot string, options *WebAppsDeleteProcessSlotOptions) (WebAppsDeleteProcessSlotResponse, error) { + req, err := client.deleteProcessSlotCreateRequest(ctx, resourceGroupName, name, processID, slot, options) + if err != nil { + return WebAppsDeleteProcessSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsDeleteProcessSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusNoContent) { + return WebAppsDeleteProcessSlotResponse{}, client.deleteProcessSlotHandleError(resp) + } + return WebAppsDeleteProcessSlotResponse{RawResponse: resp}, nil +} + +// deleteProcessSlotCreateRequest creates the DeleteProcessSlot request. +func (client *WebAppsClient) deleteProcessSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, processID string, slot string, options *WebAppsDeleteProcessSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes/{processId}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if processID == "" { + return nil, errors.New("parameter processID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{processId}", url.PathEscape(processID)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// deleteProcessSlotHandleError handles the DeleteProcessSlot error response. +func (client *WebAppsClient) deleteProcessSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + switch resp.StatusCode { + case http.StatusNotFound: + if len(body) == 0 { + return runtime.NewResponseError(errors.New(resp.Status), resp) + } + return runtime.NewResponseError(errors.New(string(body)), resp) + default: + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) + } +} + +// DeletePublicCertificate - Description for Deletes a hostname binding for an app. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) DeletePublicCertificate(ctx context.Context, resourceGroupName string, name string, publicCertificateName string, options *WebAppsDeletePublicCertificateOptions) (WebAppsDeletePublicCertificateResponse, error) { + req, err := client.deletePublicCertificateCreateRequest(ctx, resourceGroupName, name, publicCertificateName, options) + if err != nil { + return WebAppsDeletePublicCertificateResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsDeletePublicCertificateResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { + return WebAppsDeletePublicCertificateResponse{}, client.deletePublicCertificateHandleError(resp) + } + return WebAppsDeletePublicCertificateResponse{RawResponse: resp}, nil +} + +// deletePublicCertificateCreateRequest creates the DeletePublicCertificate request. +func (client *WebAppsClient) deletePublicCertificateCreateRequest(ctx context.Context, resourceGroupName string, name string, publicCertificateName string, options *WebAppsDeletePublicCertificateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/publicCertificates/{publicCertificateName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if publicCertificateName == "" { + return nil, errors.New("parameter publicCertificateName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{publicCertificateName}", url.PathEscape(publicCertificateName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// deletePublicCertificateHandleError handles the DeletePublicCertificate error response. +func (client *WebAppsClient) deletePublicCertificateHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// DeletePublicCertificateSlot - Description for Deletes a hostname binding for an app. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) DeletePublicCertificateSlot(ctx context.Context, resourceGroupName string, name string, slot string, publicCertificateName string, options *WebAppsDeletePublicCertificateSlotOptions) (WebAppsDeletePublicCertificateSlotResponse, error) { + req, err := client.deletePublicCertificateSlotCreateRequest(ctx, resourceGroupName, name, slot, publicCertificateName, options) + if err != nil { + return WebAppsDeletePublicCertificateSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsDeletePublicCertificateSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { + return WebAppsDeletePublicCertificateSlotResponse{}, client.deletePublicCertificateSlotHandleError(resp) + } + return WebAppsDeletePublicCertificateSlotResponse{RawResponse: resp}, nil +} + +// deletePublicCertificateSlotCreateRequest creates the DeletePublicCertificateSlot request. +func (client *WebAppsClient) deletePublicCertificateSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, slot string, publicCertificateName string, options *WebAppsDeletePublicCertificateSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/publicCertificates/{publicCertificateName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if publicCertificateName == "" { + return nil, errors.New("parameter publicCertificateName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{publicCertificateName}", url.PathEscape(publicCertificateName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// deletePublicCertificateSlotHandleError handles the DeletePublicCertificateSlot error response. +func (client *WebAppsClient) deletePublicCertificateSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// DeleteRelayServiceConnection - Description for Deletes a relay service connection by its name. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) DeleteRelayServiceConnection(ctx context.Context, resourceGroupName string, name string, entityName string, options *WebAppsDeleteRelayServiceConnectionOptions) (WebAppsDeleteRelayServiceConnectionResponse, error) { + req, err := client.deleteRelayServiceConnectionCreateRequest(ctx, resourceGroupName, name, entityName, options) + if err != nil { + return WebAppsDeleteRelayServiceConnectionResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsDeleteRelayServiceConnectionResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsDeleteRelayServiceConnectionResponse{}, client.deleteRelayServiceConnectionHandleError(resp) + } + return WebAppsDeleteRelayServiceConnectionResponse{RawResponse: resp}, nil +} + +// deleteRelayServiceConnectionCreateRequest creates the DeleteRelayServiceConnection request. +func (client *WebAppsClient) deleteRelayServiceConnectionCreateRequest(ctx context.Context, resourceGroupName string, name string, entityName string, options *WebAppsDeleteRelayServiceConnectionOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection/{entityName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if entityName == "" { + return nil, errors.New("parameter entityName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{entityName}", url.PathEscape(entityName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// deleteRelayServiceConnectionHandleError handles the DeleteRelayServiceConnection error response. +func (client *WebAppsClient) deleteRelayServiceConnectionHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + switch resp.StatusCode { + case http.StatusNotFound: + if len(body) == 0 { + return runtime.NewResponseError(errors.New(resp.Status), resp) + } + return runtime.NewResponseError(errors.New(string(body)), resp) + default: + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) + } +} + +// DeleteRelayServiceConnectionSlot - Description for Deletes a relay service connection by its name. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) DeleteRelayServiceConnectionSlot(ctx context.Context, resourceGroupName string, name string, entityName string, slot string, options *WebAppsDeleteRelayServiceConnectionSlotOptions) (WebAppsDeleteRelayServiceConnectionSlotResponse, error) { + req, err := client.deleteRelayServiceConnectionSlotCreateRequest(ctx, resourceGroupName, name, entityName, slot, options) + if err != nil { + return WebAppsDeleteRelayServiceConnectionSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsDeleteRelayServiceConnectionSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsDeleteRelayServiceConnectionSlotResponse{}, client.deleteRelayServiceConnectionSlotHandleError(resp) + } + return WebAppsDeleteRelayServiceConnectionSlotResponse{RawResponse: resp}, nil +} + +// deleteRelayServiceConnectionSlotCreateRequest creates the DeleteRelayServiceConnectionSlot request. +func (client *WebAppsClient) deleteRelayServiceConnectionSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, entityName string, slot string, options *WebAppsDeleteRelayServiceConnectionSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridconnection/{entityName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if entityName == "" { + return nil, errors.New("parameter entityName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{entityName}", url.PathEscape(entityName)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// deleteRelayServiceConnectionSlotHandleError handles the DeleteRelayServiceConnectionSlot error response. +func (client *WebAppsClient) deleteRelayServiceConnectionSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + switch resp.StatusCode { + case http.StatusNotFound: + if len(body) == 0 { + return runtime.NewResponseError(errors.New(resp.Status), resp) + } + return runtime.NewResponseError(errors.New(string(body)), resp) + default: + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) + } +} + +// DeleteSiteExtension - Description for Remove a site extension from a web site, or a deployment slot. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) DeleteSiteExtension(ctx context.Context, resourceGroupName string, name string, siteExtensionID string, options *WebAppsDeleteSiteExtensionOptions) (WebAppsDeleteSiteExtensionResponse, error) { + req, err := client.deleteSiteExtensionCreateRequest(ctx, resourceGroupName, name, siteExtensionID, options) + if err != nil { + return WebAppsDeleteSiteExtensionResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsDeleteSiteExtensionResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusNoContent) { + return WebAppsDeleteSiteExtensionResponse{}, client.deleteSiteExtensionHandleError(resp) + } + return WebAppsDeleteSiteExtensionResponse{RawResponse: resp}, nil +} + +// deleteSiteExtensionCreateRequest creates the DeleteSiteExtension request. +func (client *WebAppsClient) deleteSiteExtensionCreateRequest(ctx context.Context, resourceGroupName string, name string, siteExtensionID string, options *WebAppsDeleteSiteExtensionOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/siteextensions/{siteExtensionId}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if siteExtensionID == "" { + return nil, errors.New("parameter siteExtensionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{siteExtensionId}", url.PathEscape(siteExtensionID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// deleteSiteExtensionHandleError handles the DeleteSiteExtension error response. +func (client *WebAppsClient) deleteSiteExtensionHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + switch resp.StatusCode { + case http.StatusNotFound: + if len(body) == 0 { + return runtime.NewResponseError(errors.New(resp.Status), resp) + } + return runtime.NewResponseError(errors.New(string(body)), resp) + default: + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) + } +} + +// DeleteSiteExtensionSlot - Description for Remove a site extension from a web site, or a deployment slot. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) DeleteSiteExtensionSlot(ctx context.Context, resourceGroupName string, name string, siteExtensionID string, slot string, options *WebAppsDeleteSiteExtensionSlotOptions) (WebAppsDeleteSiteExtensionSlotResponse, error) { + req, err := client.deleteSiteExtensionSlotCreateRequest(ctx, resourceGroupName, name, siteExtensionID, slot, options) + if err != nil { + return WebAppsDeleteSiteExtensionSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsDeleteSiteExtensionSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusNoContent) { + return WebAppsDeleteSiteExtensionSlotResponse{}, client.deleteSiteExtensionSlotHandleError(resp) + } + return WebAppsDeleteSiteExtensionSlotResponse{RawResponse: resp}, nil +} + +// deleteSiteExtensionSlotCreateRequest creates the DeleteSiteExtensionSlot request. +func (client *WebAppsClient) deleteSiteExtensionSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, siteExtensionID string, slot string, options *WebAppsDeleteSiteExtensionSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/siteextensions/{siteExtensionId}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if siteExtensionID == "" { + return nil, errors.New("parameter siteExtensionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{siteExtensionId}", url.PathEscape(siteExtensionID)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// deleteSiteExtensionSlotHandleError handles the DeleteSiteExtensionSlot error response. +func (client *WebAppsClient) deleteSiteExtensionSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + switch resp.StatusCode { + case http.StatusNotFound: + if len(body) == 0 { + return runtime.NewResponseError(errors.New(resp.Status), resp) + } + return runtime.NewResponseError(errors.New(string(body)), resp) + default: + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) + } +} + +// DeleteSlot - Description for Deletes a web, mobile, or API app, or one of the deployment slots. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) DeleteSlot(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsDeleteSlotOptions) (WebAppsDeleteSlotResponse, error) { + req, err := client.deleteSlotCreateRequest(ctx, resourceGroupName, name, slot, options) + if err != nil { + return WebAppsDeleteSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsDeleteSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { + return WebAppsDeleteSlotResponse{}, client.deleteSlotHandleError(resp) + } + return WebAppsDeleteSlotResponse{RawResponse: resp}, nil +} + +// deleteSlotCreateRequest creates the DeleteSlot request. +func (client *WebAppsClient) deleteSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsDeleteSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + if options != nil && options.DeleteMetrics != nil { + reqQP.Set("deleteMetrics", strconv.FormatBool(*options.DeleteMetrics)) + } + if options != nil && options.DeleteEmptyServerFarm != nil { + reqQP.Set("deleteEmptyServerFarm", strconv.FormatBool(*options.DeleteEmptyServerFarm)) + } + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// deleteSlotHandleError handles the DeleteSlot error response. +func (client *WebAppsClient) deleteSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + switch resp.StatusCode { + case http.StatusNotFound: + if len(body) == 0 { + return runtime.NewResponseError(errors.New(resp.Status), resp) + } + return runtime.NewResponseError(errors.New(string(body)), resp) + default: + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) + } +} + +// DeleteSourceControl - Description for Deletes the source control configuration of an app. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) DeleteSourceControl(ctx context.Context, resourceGroupName string, name string, options *WebAppsDeleteSourceControlOptions) (WebAppsDeleteSourceControlResponse, error) { + req, err := client.deleteSourceControlCreateRequest(ctx, resourceGroupName, name, options) + if err != nil { + return WebAppsDeleteSourceControlResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsDeleteSourceControlResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return WebAppsDeleteSourceControlResponse{}, client.deleteSourceControlHandleError(resp) + } + return WebAppsDeleteSourceControlResponse{RawResponse: resp}, nil +} + +// deleteSourceControlCreateRequest creates the DeleteSourceControl request. +func (client *WebAppsClient) deleteSourceControlCreateRequest(ctx context.Context, resourceGroupName string, name string, options *WebAppsDeleteSourceControlOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/sourcecontrols/web" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + if options != nil && options.AdditionalFlags != nil { + reqQP.Set("additionalFlags", *options.AdditionalFlags) + } + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// deleteSourceControlHandleError handles the DeleteSourceControl error response. +func (client *WebAppsClient) deleteSourceControlHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + switch resp.StatusCode { + case http.StatusNotFound: + if len(body) == 0 { + return runtime.NewResponseError(errors.New(resp.Status), resp) + } + return runtime.NewResponseError(errors.New(string(body)), resp) + default: + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) + } +} + +// DeleteSourceControlSlot - Description for Deletes the source control configuration of an app. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) DeleteSourceControlSlot(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsDeleteSourceControlSlotOptions) (WebAppsDeleteSourceControlSlotResponse, error) { + req, err := client.deleteSourceControlSlotCreateRequest(ctx, resourceGroupName, name, slot, options) + if err != nil { + return WebAppsDeleteSourceControlSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsDeleteSourceControlSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return WebAppsDeleteSourceControlSlotResponse{}, client.deleteSourceControlSlotHandleError(resp) + } + return WebAppsDeleteSourceControlSlotResponse{RawResponse: resp}, nil +} + +// deleteSourceControlSlotCreateRequest creates the DeleteSourceControlSlot request. +func (client *WebAppsClient) deleteSourceControlSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsDeleteSourceControlSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/sourcecontrols/web" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + if options != nil && options.AdditionalFlags != nil { + reqQP.Set("additionalFlags", *options.AdditionalFlags) + } + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// deleteSourceControlSlotHandleError handles the DeleteSourceControlSlot error response. +func (client *WebAppsClient) deleteSourceControlSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + switch resp.StatusCode { + case http.StatusNotFound: + if len(body) == 0 { + return runtime.NewResponseError(errors.New(resp.Status), resp) + } + return runtime.NewResponseError(errors.New(string(body)), resp) + default: + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) + } +} + +// DeleteSwiftVirtualNetwork - Description for Deletes a Swift Virtual Network connection from an app (or deployment slot). +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) DeleteSwiftVirtualNetwork(ctx context.Context, resourceGroupName string, name string, options *WebAppsDeleteSwiftVirtualNetworkOptions) (WebAppsDeleteSwiftVirtualNetworkResponse, error) { + req, err := client.deleteSwiftVirtualNetworkCreateRequest(ctx, resourceGroupName, name, options) + if err != nil { + return WebAppsDeleteSwiftVirtualNetworkResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsDeleteSwiftVirtualNetworkResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsDeleteSwiftVirtualNetworkResponse{}, client.deleteSwiftVirtualNetworkHandleError(resp) + } + return WebAppsDeleteSwiftVirtualNetworkResponse{RawResponse: resp}, nil +} + +// deleteSwiftVirtualNetworkCreateRequest creates the DeleteSwiftVirtualNetwork request. +func (client *WebAppsClient) deleteSwiftVirtualNetworkCreateRequest(ctx context.Context, resourceGroupName string, name string, options *WebAppsDeleteSwiftVirtualNetworkOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkConfig/virtualNetwork" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// deleteSwiftVirtualNetworkHandleError handles the DeleteSwiftVirtualNetwork error response. +func (client *WebAppsClient) deleteSwiftVirtualNetworkHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + switch resp.StatusCode { + case http.StatusNotFound: + if len(body) == 0 { + return runtime.NewResponseError(errors.New(resp.Status), resp) + } + return runtime.NewResponseError(errors.New(string(body)), resp) + default: + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) + } +} + +// DeleteSwiftVirtualNetworkSlot - Description for Deletes a Swift Virtual Network connection from an app (or deployment slot). +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) DeleteSwiftVirtualNetworkSlot(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsDeleteSwiftVirtualNetworkSlotOptions) (WebAppsDeleteSwiftVirtualNetworkSlotResponse, error) { + req, err := client.deleteSwiftVirtualNetworkSlotCreateRequest(ctx, resourceGroupName, name, slot, options) + if err != nil { + return WebAppsDeleteSwiftVirtualNetworkSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsDeleteSwiftVirtualNetworkSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsDeleteSwiftVirtualNetworkSlotResponse{}, client.deleteSwiftVirtualNetworkSlotHandleError(resp) + } + return WebAppsDeleteSwiftVirtualNetworkSlotResponse{RawResponse: resp}, nil +} + +// deleteSwiftVirtualNetworkSlotCreateRequest creates the DeleteSwiftVirtualNetworkSlot request. +func (client *WebAppsClient) deleteSwiftVirtualNetworkSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsDeleteSwiftVirtualNetworkSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkConfig/virtualNetwork" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// deleteSwiftVirtualNetworkSlotHandleError handles the DeleteSwiftVirtualNetworkSlot error response. +func (client *WebAppsClient) deleteSwiftVirtualNetworkSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + switch resp.StatusCode { + case http.StatusNotFound: + if len(body) == 0 { + return runtime.NewResponseError(errors.New(resp.Status), resp) + } + return runtime.NewResponseError(errors.New(string(body)), resp) + default: + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) + } +} + +// DeleteTriggeredWebJob - Description for Delete a triggered web job by its ID for an app, or a deployment slot. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) DeleteTriggeredWebJob(ctx context.Context, resourceGroupName string, name string, webJobName string, options *WebAppsDeleteTriggeredWebJobOptions) (WebAppsDeleteTriggeredWebJobResponse, error) { + req, err := client.deleteTriggeredWebJobCreateRequest(ctx, resourceGroupName, name, webJobName, options) + if err != nil { + return WebAppsDeleteTriggeredWebJobResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsDeleteTriggeredWebJobResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { + return WebAppsDeleteTriggeredWebJobResponse{}, client.deleteTriggeredWebJobHandleError(resp) + } + return WebAppsDeleteTriggeredWebJobResponse{RawResponse: resp}, nil +} + +// deleteTriggeredWebJobCreateRequest creates the DeleteTriggeredWebJob request. +func (client *WebAppsClient) deleteTriggeredWebJobCreateRequest(ctx context.Context, resourceGroupName string, name string, webJobName string, options *WebAppsDeleteTriggeredWebJobOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/triggeredwebjobs/{webJobName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if webJobName == "" { + return nil, errors.New("parameter webJobName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{webJobName}", url.PathEscape(webJobName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// deleteTriggeredWebJobHandleError handles the DeleteTriggeredWebJob error response. +func (client *WebAppsClient) deleteTriggeredWebJobHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// DeleteTriggeredWebJobSlot - Description for Delete a triggered web job by its ID for an app, or a deployment slot. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) DeleteTriggeredWebJobSlot(ctx context.Context, resourceGroupName string, name string, webJobName string, slot string, options *WebAppsDeleteTriggeredWebJobSlotOptions) (WebAppsDeleteTriggeredWebJobSlotResponse, error) { + req, err := client.deleteTriggeredWebJobSlotCreateRequest(ctx, resourceGroupName, name, webJobName, slot, options) + if err != nil { + return WebAppsDeleteTriggeredWebJobSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsDeleteTriggeredWebJobSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { + return WebAppsDeleteTriggeredWebJobSlotResponse{}, client.deleteTriggeredWebJobSlotHandleError(resp) + } + return WebAppsDeleteTriggeredWebJobSlotResponse{RawResponse: resp}, nil +} + +// deleteTriggeredWebJobSlotCreateRequest creates the DeleteTriggeredWebJobSlot request. +func (client *WebAppsClient) deleteTriggeredWebJobSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, webJobName string, slot string, options *WebAppsDeleteTriggeredWebJobSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs/{webJobName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if webJobName == "" { + return nil, errors.New("parameter webJobName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{webJobName}", url.PathEscape(webJobName)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// deleteTriggeredWebJobSlotHandleError handles the DeleteTriggeredWebJobSlot error response. +func (client *WebAppsClient) deleteTriggeredWebJobSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// DeleteVnetConnection - Description for Deletes a connection from an app (or deployment slot to a named virtual network. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) DeleteVnetConnection(ctx context.Context, resourceGroupName string, name string, vnetName string, options *WebAppsDeleteVnetConnectionOptions) (WebAppsDeleteVnetConnectionResponse, error) { + req, err := client.deleteVnetConnectionCreateRequest(ctx, resourceGroupName, name, vnetName, options) + if err != nil { + return WebAppsDeleteVnetConnectionResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsDeleteVnetConnectionResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsDeleteVnetConnectionResponse{}, client.deleteVnetConnectionHandleError(resp) + } + return WebAppsDeleteVnetConnectionResponse{RawResponse: resp}, nil +} + +// deleteVnetConnectionCreateRequest creates the DeleteVnetConnection request. +func (client *WebAppsClient) deleteVnetConnectionCreateRequest(ctx context.Context, resourceGroupName string, name string, vnetName string, options *WebAppsDeleteVnetConnectionOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if vnetName == "" { + return nil, errors.New("parameter vnetName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{vnetName}", url.PathEscape(vnetName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// deleteVnetConnectionHandleError handles the DeleteVnetConnection error response. +func (client *WebAppsClient) deleteVnetConnectionHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + switch resp.StatusCode { + case http.StatusNotFound: + if len(body) == 0 { + return runtime.NewResponseError(errors.New(resp.Status), resp) + } + return runtime.NewResponseError(errors.New(string(body)), resp) + default: + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) + } +} + +// DeleteVnetConnectionSlot - Description for Deletes a connection from an app (or deployment slot to a named virtual network. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) DeleteVnetConnectionSlot(ctx context.Context, resourceGroupName string, name string, vnetName string, slot string, options *WebAppsDeleteVnetConnectionSlotOptions) (WebAppsDeleteVnetConnectionSlotResponse, error) { + req, err := client.deleteVnetConnectionSlotCreateRequest(ctx, resourceGroupName, name, vnetName, slot, options) + if err != nil { + return WebAppsDeleteVnetConnectionSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsDeleteVnetConnectionSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsDeleteVnetConnectionSlotResponse{}, client.deleteVnetConnectionSlotHandleError(resp) + } + return WebAppsDeleteVnetConnectionSlotResponse{RawResponse: resp}, nil +} + +// deleteVnetConnectionSlotCreateRequest creates the DeleteVnetConnectionSlot request. +func (client *WebAppsClient) deleteVnetConnectionSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, vnetName string, slot string, options *WebAppsDeleteVnetConnectionSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if vnetName == "" { + return nil, errors.New("parameter vnetName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{vnetName}", url.PathEscape(vnetName)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// deleteVnetConnectionSlotHandleError handles the DeleteVnetConnectionSlot error response. +func (client *WebAppsClient) deleteVnetConnectionSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + switch resp.StatusCode { + case http.StatusNotFound: + if len(body) == 0 { + return runtime.NewResponseError(errors.New(resp.Status), resp) + } + return runtime.NewResponseError(errors.New(string(body)), resp) + default: + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) + } +} + +// DiscoverBackup - Description for Discovers an existing app backup that can be restored from a blob in Azure storage. Use this to get information about +// the databases stored in a backup. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) DiscoverBackup(ctx context.Context, resourceGroupName string, name string, request RestoreRequest, options *WebAppsDiscoverBackupOptions) (WebAppsDiscoverBackupResponse, error) { + req, err := client.discoverBackupCreateRequest(ctx, resourceGroupName, name, request, options) + if err != nil { + return WebAppsDiscoverBackupResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsDiscoverBackupResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsDiscoverBackupResponse{}, client.discoverBackupHandleError(resp) + } + return client.discoverBackupHandleResponse(resp) +} + +// discoverBackupCreateRequest creates the DiscoverBackup request. +func (client *WebAppsClient) discoverBackupCreateRequest(ctx context.Context, resourceGroupName string, name string, request RestoreRequest, options *WebAppsDiscoverBackupOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/discoverbackup" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, request) +} + +// discoverBackupHandleResponse handles the DiscoverBackup response. +func (client *WebAppsClient) discoverBackupHandleResponse(resp *http.Response) (WebAppsDiscoverBackupResponse, error) { + result := WebAppsDiscoverBackupResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.RestoreRequest); err != nil { + return WebAppsDiscoverBackupResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// discoverBackupHandleError handles the DiscoverBackup error response. +func (client *WebAppsClient) discoverBackupHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// DiscoverBackupSlot - Description for Discovers an existing app backup that can be restored from a blob in Azure storage. Use this to get information +// about the databases stored in a backup. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) DiscoverBackupSlot(ctx context.Context, resourceGroupName string, name string, slot string, request RestoreRequest, options *WebAppsDiscoverBackupSlotOptions) (WebAppsDiscoverBackupSlotResponse, error) { + req, err := client.discoverBackupSlotCreateRequest(ctx, resourceGroupName, name, slot, request, options) + if err != nil { + return WebAppsDiscoverBackupSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsDiscoverBackupSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsDiscoverBackupSlotResponse{}, client.discoverBackupSlotHandleError(resp) + } + return client.discoverBackupSlotHandleResponse(resp) +} + +// discoverBackupSlotCreateRequest creates the DiscoverBackupSlot request. +func (client *WebAppsClient) discoverBackupSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, slot string, request RestoreRequest, options *WebAppsDiscoverBackupSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/discoverbackup" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, request) +} + +// discoverBackupSlotHandleResponse handles the DiscoverBackupSlot response. +func (client *WebAppsClient) discoverBackupSlotHandleResponse(resp *http.Response) (WebAppsDiscoverBackupSlotResponse, error) { + result := WebAppsDiscoverBackupSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.RestoreRequest); err != nil { + return WebAppsDiscoverBackupSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// discoverBackupSlotHandleError handles the DiscoverBackupSlot error response. +func (client *WebAppsClient) discoverBackupSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GenerateNewSitePublishingPassword - Description for Generates a new publishing password for an app (or deployment slot, if specified). +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) GenerateNewSitePublishingPassword(ctx context.Context, resourceGroupName string, name string, options *WebAppsGenerateNewSitePublishingPasswordOptions) (WebAppsGenerateNewSitePublishingPasswordResponse, error) { + req, err := client.generateNewSitePublishingPasswordCreateRequest(ctx, resourceGroupName, name, options) + if err != nil { + return WebAppsGenerateNewSitePublishingPasswordResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsGenerateNewSitePublishingPasswordResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { + return WebAppsGenerateNewSitePublishingPasswordResponse{}, client.generateNewSitePublishingPasswordHandleError(resp) + } + return WebAppsGenerateNewSitePublishingPasswordResponse{RawResponse: resp}, nil +} + +// generateNewSitePublishingPasswordCreateRequest creates the GenerateNewSitePublishingPassword request. +func (client *WebAppsClient) generateNewSitePublishingPasswordCreateRequest(ctx context.Context, resourceGroupName string, name string, options *WebAppsGenerateNewSitePublishingPasswordOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/newpassword" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// generateNewSitePublishingPasswordHandleError handles the GenerateNewSitePublishingPassword error response. +func (client *WebAppsClient) generateNewSitePublishingPasswordHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GenerateNewSitePublishingPasswordSlot - Description for Generates a new publishing password for an app (or deployment slot, if specified). +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) GenerateNewSitePublishingPasswordSlot(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsGenerateNewSitePublishingPasswordSlotOptions) (WebAppsGenerateNewSitePublishingPasswordSlotResponse, error) { + req, err := client.generateNewSitePublishingPasswordSlotCreateRequest(ctx, resourceGroupName, name, slot, options) + if err != nil { + return WebAppsGenerateNewSitePublishingPasswordSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsGenerateNewSitePublishingPasswordSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { + return WebAppsGenerateNewSitePublishingPasswordSlotResponse{}, client.generateNewSitePublishingPasswordSlotHandleError(resp) + } + return WebAppsGenerateNewSitePublishingPasswordSlotResponse{RawResponse: resp}, nil +} + +// generateNewSitePublishingPasswordSlotCreateRequest creates the GenerateNewSitePublishingPasswordSlot request. +func (client *WebAppsClient) generateNewSitePublishingPasswordSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsGenerateNewSitePublishingPasswordSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/newpassword" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// generateNewSitePublishingPasswordSlotHandleError handles the GenerateNewSitePublishingPasswordSlot error response. +func (client *WebAppsClient) generateNewSitePublishingPasswordSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// Get - Description for Gets the details of a web, mobile, or API app. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) Get(ctx context.Context, resourceGroupName string, name string, options *WebAppsGetOptions) (WebAppsGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, name, options) + if err != nil { + return WebAppsGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsGetResponse{}, client.getHandleError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *WebAppsClient) getCreateRequest(ctx context.Context, resourceGroupName string, name string, options *WebAppsGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *WebAppsClient) getHandleResponse(resp *http.Response) (WebAppsGetResponse, error) { + result := WebAppsGetResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.Site); err != nil { + return WebAppsGetResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getHandleError handles the Get error response. +func (client *WebAppsClient) getHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + switch resp.StatusCode { + case http.StatusNotFound: + if len(body) == 0 { + return runtime.NewResponseError(errors.New(resp.Status), resp) + } + return runtime.NewResponseError(errors.New(string(body)), resp) + default: + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) + } +} + +// GetAppSettingKeyVaultReference - Description for Gets the config reference and status of an app +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) GetAppSettingKeyVaultReference(ctx context.Context, resourceGroupName string, name string, appSettingKey string, options *WebAppsGetAppSettingKeyVaultReferenceOptions) (WebAppsGetAppSettingKeyVaultReferenceResponse, error) { + req, err := client.getAppSettingKeyVaultReferenceCreateRequest(ctx, resourceGroupName, name, appSettingKey, options) + if err != nil { + return WebAppsGetAppSettingKeyVaultReferenceResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsGetAppSettingKeyVaultReferenceResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsGetAppSettingKeyVaultReferenceResponse{}, client.getAppSettingKeyVaultReferenceHandleError(resp) + } + return client.getAppSettingKeyVaultReferenceHandleResponse(resp) +} + +// getAppSettingKeyVaultReferenceCreateRequest creates the GetAppSettingKeyVaultReference request. +func (client *WebAppsClient) getAppSettingKeyVaultReferenceCreateRequest(ctx context.Context, resourceGroupName string, name string, appSettingKey string, options *WebAppsGetAppSettingKeyVaultReferenceOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/configreferences/appsettings/{appSettingKey}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if appSettingKey == "" { + return nil, errors.New("parameter appSettingKey cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{appSettingKey}", url.PathEscape(appSettingKey)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getAppSettingKeyVaultReferenceHandleResponse handles the GetAppSettingKeyVaultReference response. +func (client *WebAppsClient) getAppSettingKeyVaultReferenceHandleResponse(resp *http.Response) (WebAppsGetAppSettingKeyVaultReferenceResponse, error) { + result := WebAppsGetAppSettingKeyVaultReferenceResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.APIKVReference); err != nil { + return WebAppsGetAppSettingKeyVaultReferenceResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getAppSettingKeyVaultReferenceHandleError handles the GetAppSettingKeyVaultReference error response. +func (client *WebAppsClient) getAppSettingKeyVaultReferenceHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetAppSettingKeyVaultReferenceSlot - Description for Gets the config reference and status of an app +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) GetAppSettingKeyVaultReferenceSlot(ctx context.Context, resourceGroupName string, name string, appSettingKey string, slot string, options *WebAppsGetAppSettingKeyVaultReferenceSlotOptions) (WebAppsGetAppSettingKeyVaultReferenceSlotResponse, error) { + req, err := client.getAppSettingKeyVaultReferenceSlotCreateRequest(ctx, resourceGroupName, name, appSettingKey, slot, options) + if err != nil { + return WebAppsGetAppSettingKeyVaultReferenceSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsGetAppSettingKeyVaultReferenceSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsGetAppSettingKeyVaultReferenceSlotResponse{}, client.getAppSettingKeyVaultReferenceSlotHandleError(resp) + } + return client.getAppSettingKeyVaultReferenceSlotHandleResponse(resp) +} + +// getAppSettingKeyVaultReferenceSlotCreateRequest creates the GetAppSettingKeyVaultReferenceSlot request. +func (client *WebAppsClient) getAppSettingKeyVaultReferenceSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, appSettingKey string, slot string, options *WebAppsGetAppSettingKeyVaultReferenceSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/configreferences/appsettings/{appSettingKey}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if appSettingKey == "" { + return nil, errors.New("parameter appSettingKey cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{appSettingKey}", url.PathEscape(appSettingKey)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getAppSettingKeyVaultReferenceSlotHandleResponse handles the GetAppSettingKeyVaultReferenceSlot response. +func (client *WebAppsClient) getAppSettingKeyVaultReferenceSlotHandleResponse(resp *http.Response) (WebAppsGetAppSettingKeyVaultReferenceSlotResponse, error) { + result := WebAppsGetAppSettingKeyVaultReferenceSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.APIKVReference); err != nil { + return WebAppsGetAppSettingKeyVaultReferenceSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getAppSettingKeyVaultReferenceSlotHandleError handles the GetAppSettingKeyVaultReferenceSlot error response. +func (client *WebAppsClient) getAppSettingKeyVaultReferenceSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetAppSettingsKeyVaultReferences - Description for Gets the config reference app settings and status of an app +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) GetAppSettingsKeyVaultReferences(resourceGroupName string, name string, options *WebAppsGetAppSettingsKeyVaultReferencesOptions) *WebAppsGetAppSettingsKeyVaultReferencesPager { + return &WebAppsGetAppSettingsKeyVaultReferencesPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.getAppSettingsKeyVaultReferencesCreateRequest(ctx, resourceGroupName, name, options) + }, + advancer: func(ctx context.Context, resp WebAppsGetAppSettingsKeyVaultReferencesResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.APIKVReferenceCollection.NextLink) + }, + } +} + +// getAppSettingsKeyVaultReferencesCreateRequest creates the GetAppSettingsKeyVaultReferences request. +func (client *WebAppsClient) getAppSettingsKeyVaultReferencesCreateRequest(ctx context.Context, resourceGroupName string, name string, options *WebAppsGetAppSettingsKeyVaultReferencesOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/configreferences/appsettings" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getAppSettingsKeyVaultReferencesHandleResponse handles the GetAppSettingsKeyVaultReferences response. +func (client *WebAppsClient) getAppSettingsKeyVaultReferencesHandleResponse(resp *http.Response) (WebAppsGetAppSettingsKeyVaultReferencesResponse, error) { + result := WebAppsGetAppSettingsKeyVaultReferencesResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.APIKVReferenceCollection); err != nil { + return WebAppsGetAppSettingsKeyVaultReferencesResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getAppSettingsKeyVaultReferencesHandleError handles the GetAppSettingsKeyVaultReferences error response. +func (client *WebAppsClient) getAppSettingsKeyVaultReferencesHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetAppSettingsKeyVaultReferencesSlot - Description for Gets the config reference app settings and status of an app +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) GetAppSettingsKeyVaultReferencesSlot(resourceGroupName string, name string, slot string, options *WebAppsGetAppSettingsKeyVaultReferencesSlotOptions) *WebAppsGetAppSettingsKeyVaultReferencesSlotPager { + return &WebAppsGetAppSettingsKeyVaultReferencesSlotPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.getAppSettingsKeyVaultReferencesSlotCreateRequest(ctx, resourceGroupName, name, slot, options) + }, + advancer: func(ctx context.Context, resp WebAppsGetAppSettingsKeyVaultReferencesSlotResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.APIKVReferenceCollection.NextLink) + }, + } +} + +// getAppSettingsKeyVaultReferencesSlotCreateRequest creates the GetAppSettingsKeyVaultReferencesSlot request. +func (client *WebAppsClient) getAppSettingsKeyVaultReferencesSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsGetAppSettingsKeyVaultReferencesSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/configreferences/appsettings" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getAppSettingsKeyVaultReferencesSlotHandleResponse handles the GetAppSettingsKeyVaultReferencesSlot response. +func (client *WebAppsClient) getAppSettingsKeyVaultReferencesSlotHandleResponse(resp *http.Response) (WebAppsGetAppSettingsKeyVaultReferencesSlotResponse, error) { + result := WebAppsGetAppSettingsKeyVaultReferencesSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.APIKVReferenceCollection); err != nil { + return WebAppsGetAppSettingsKeyVaultReferencesSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getAppSettingsKeyVaultReferencesSlotHandleError handles the GetAppSettingsKeyVaultReferencesSlot error response. +func (client *WebAppsClient) getAppSettingsKeyVaultReferencesSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetAuthSettings - Description for Gets the Authentication/Authorization settings of an app. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) GetAuthSettings(ctx context.Context, resourceGroupName string, name string, options *WebAppsGetAuthSettingsOptions) (WebAppsGetAuthSettingsResponse, error) { + req, err := client.getAuthSettingsCreateRequest(ctx, resourceGroupName, name, options) + if err != nil { + return WebAppsGetAuthSettingsResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsGetAuthSettingsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsGetAuthSettingsResponse{}, client.getAuthSettingsHandleError(resp) + } + return client.getAuthSettingsHandleResponse(resp) +} + +// getAuthSettingsCreateRequest creates the GetAuthSettings request. +func (client *WebAppsClient) getAuthSettingsCreateRequest(ctx context.Context, resourceGroupName string, name string, options *WebAppsGetAuthSettingsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/authsettings/list" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getAuthSettingsHandleResponse handles the GetAuthSettings response. +func (client *WebAppsClient) getAuthSettingsHandleResponse(resp *http.Response) (WebAppsGetAuthSettingsResponse, error) { + result := WebAppsGetAuthSettingsResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.SiteAuthSettings); err != nil { + return WebAppsGetAuthSettingsResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getAuthSettingsHandleError handles the GetAuthSettings error response. +func (client *WebAppsClient) getAuthSettingsHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetAuthSettingsSlot - Description for Gets the Authentication/Authorization settings of an app. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) GetAuthSettingsSlot(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsGetAuthSettingsSlotOptions) (WebAppsGetAuthSettingsSlotResponse, error) { + req, err := client.getAuthSettingsSlotCreateRequest(ctx, resourceGroupName, name, slot, options) + if err != nil { + return WebAppsGetAuthSettingsSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsGetAuthSettingsSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsGetAuthSettingsSlotResponse{}, client.getAuthSettingsSlotHandleError(resp) + } + return client.getAuthSettingsSlotHandleResponse(resp) +} + +// getAuthSettingsSlotCreateRequest creates the GetAuthSettingsSlot request. +func (client *WebAppsClient) getAuthSettingsSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsGetAuthSettingsSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/authsettings/list" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getAuthSettingsSlotHandleResponse handles the GetAuthSettingsSlot response. +func (client *WebAppsClient) getAuthSettingsSlotHandleResponse(resp *http.Response) (WebAppsGetAuthSettingsSlotResponse, error) { + result := WebAppsGetAuthSettingsSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.SiteAuthSettings); err != nil { + return WebAppsGetAuthSettingsSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getAuthSettingsSlotHandleError handles the GetAuthSettingsSlot error response. +func (client *WebAppsClient) getAuthSettingsSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetAuthSettingsV2 - Description for Gets site's Authentication / Authorization settings for apps via the V2 format +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) GetAuthSettingsV2(ctx context.Context, resourceGroupName string, name string, options *WebAppsGetAuthSettingsV2Options) (WebAppsGetAuthSettingsV2Response, error) { + req, err := client.getAuthSettingsV2CreateRequest(ctx, resourceGroupName, name, options) + if err != nil { + return WebAppsGetAuthSettingsV2Response{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsGetAuthSettingsV2Response{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsGetAuthSettingsV2Response{}, client.getAuthSettingsV2HandleError(resp) + } + return client.getAuthSettingsV2HandleResponse(resp) +} + +// getAuthSettingsV2CreateRequest creates the GetAuthSettingsV2 request. +func (client *WebAppsClient) getAuthSettingsV2CreateRequest(ctx context.Context, resourceGroupName string, name string, options *WebAppsGetAuthSettingsV2Options) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/authsettingsV2/list" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getAuthSettingsV2HandleResponse handles the GetAuthSettingsV2 response. +func (client *WebAppsClient) getAuthSettingsV2HandleResponse(resp *http.Response) (WebAppsGetAuthSettingsV2Response, error) { + result := WebAppsGetAuthSettingsV2Response{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.SiteAuthSettingsV2); err != nil { + return WebAppsGetAuthSettingsV2Response{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getAuthSettingsV2HandleError handles the GetAuthSettingsV2 error response. +func (client *WebAppsClient) getAuthSettingsV2HandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetAuthSettingsV2Slot - Description for Gets site's Authentication / Authorization settings for apps via the V2 format +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) GetAuthSettingsV2Slot(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsGetAuthSettingsV2SlotOptions) (WebAppsGetAuthSettingsV2SlotResponse, error) { + req, err := client.getAuthSettingsV2SlotCreateRequest(ctx, resourceGroupName, name, slot, options) + if err != nil { + return WebAppsGetAuthSettingsV2SlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsGetAuthSettingsV2SlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsGetAuthSettingsV2SlotResponse{}, client.getAuthSettingsV2SlotHandleError(resp) + } + return client.getAuthSettingsV2SlotHandleResponse(resp) +} + +// getAuthSettingsV2SlotCreateRequest creates the GetAuthSettingsV2Slot request. +func (client *WebAppsClient) getAuthSettingsV2SlotCreateRequest(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsGetAuthSettingsV2SlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/authsettingsV2/list" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getAuthSettingsV2SlotHandleResponse handles the GetAuthSettingsV2Slot response. +func (client *WebAppsClient) getAuthSettingsV2SlotHandleResponse(resp *http.Response) (WebAppsGetAuthSettingsV2SlotResponse, error) { + result := WebAppsGetAuthSettingsV2SlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.SiteAuthSettingsV2); err != nil { + return WebAppsGetAuthSettingsV2SlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getAuthSettingsV2SlotHandleError handles the GetAuthSettingsV2Slot error response. +func (client *WebAppsClient) getAuthSettingsV2SlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetBackupConfiguration - Description for Gets the backup configuration of an app. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) GetBackupConfiguration(ctx context.Context, resourceGroupName string, name string, options *WebAppsGetBackupConfigurationOptions) (WebAppsGetBackupConfigurationResponse, error) { + req, err := client.getBackupConfigurationCreateRequest(ctx, resourceGroupName, name, options) + if err != nil { + return WebAppsGetBackupConfigurationResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsGetBackupConfigurationResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsGetBackupConfigurationResponse{}, client.getBackupConfigurationHandleError(resp) + } + return client.getBackupConfigurationHandleResponse(resp) +} + +// getBackupConfigurationCreateRequest creates the GetBackupConfiguration request. +func (client *WebAppsClient) getBackupConfigurationCreateRequest(ctx context.Context, resourceGroupName string, name string, options *WebAppsGetBackupConfigurationOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/backup/list" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getBackupConfigurationHandleResponse handles the GetBackupConfiguration response. +func (client *WebAppsClient) getBackupConfigurationHandleResponse(resp *http.Response) (WebAppsGetBackupConfigurationResponse, error) { + result := WebAppsGetBackupConfigurationResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.BackupRequest); err != nil { + return WebAppsGetBackupConfigurationResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getBackupConfigurationHandleError handles the GetBackupConfiguration error response. +func (client *WebAppsClient) getBackupConfigurationHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetBackupConfigurationSlot - Description for Gets the backup configuration of an app. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) GetBackupConfigurationSlot(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsGetBackupConfigurationSlotOptions) (WebAppsGetBackupConfigurationSlotResponse, error) { + req, err := client.getBackupConfigurationSlotCreateRequest(ctx, resourceGroupName, name, slot, options) + if err != nil { + return WebAppsGetBackupConfigurationSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsGetBackupConfigurationSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsGetBackupConfigurationSlotResponse{}, client.getBackupConfigurationSlotHandleError(resp) + } + return client.getBackupConfigurationSlotHandleResponse(resp) +} + +// getBackupConfigurationSlotCreateRequest creates the GetBackupConfigurationSlot request. +func (client *WebAppsClient) getBackupConfigurationSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsGetBackupConfigurationSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/backup/list" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getBackupConfigurationSlotHandleResponse handles the GetBackupConfigurationSlot response. +func (client *WebAppsClient) getBackupConfigurationSlotHandleResponse(resp *http.Response) (WebAppsGetBackupConfigurationSlotResponse, error) { + result := WebAppsGetBackupConfigurationSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.BackupRequest); err != nil { + return WebAppsGetBackupConfigurationSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getBackupConfigurationSlotHandleError handles the GetBackupConfigurationSlot error response. +func (client *WebAppsClient) getBackupConfigurationSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetBackupStatus - Description for Gets a backup of an app by its ID. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) GetBackupStatus(ctx context.Context, resourceGroupName string, name string, backupID string, options *WebAppsGetBackupStatusOptions) (WebAppsGetBackupStatusResponse, error) { + req, err := client.getBackupStatusCreateRequest(ctx, resourceGroupName, name, backupID, options) + if err != nil { + return WebAppsGetBackupStatusResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsGetBackupStatusResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsGetBackupStatusResponse{}, client.getBackupStatusHandleError(resp) + } + return client.getBackupStatusHandleResponse(resp) +} + +// getBackupStatusCreateRequest creates the GetBackupStatus request. +func (client *WebAppsClient) getBackupStatusCreateRequest(ctx context.Context, resourceGroupName string, name string, backupID string, options *WebAppsGetBackupStatusOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/backups/{backupId}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if backupID == "" { + return nil, errors.New("parameter backupID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{backupId}", url.PathEscape(backupID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getBackupStatusHandleResponse handles the GetBackupStatus response. +func (client *WebAppsClient) getBackupStatusHandleResponse(resp *http.Response) (WebAppsGetBackupStatusResponse, error) { + result := WebAppsGetBackupStatusResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.BackupItem); err != nil { + return WebAppsGetBackupStatusResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getBackupStatusHandleError handles the GetBackupStatus error response. +func (client *WebAppsClient) getBackupStatusHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetBackupStatusSlot - Description for Gets a backup of an app by its ID. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) GetBackupStatusSlot(ctx context.Context, resourceGroupName string, name string, backupID string, slot string, options *WebAppsGetBackupStatusSlotOptions) (WebAppsGetBackupStatusSlotResponse, error) { + req, err := client.getBackupStatusSlotCreateRequest(ctx, resourceGroupName, name, backupID, slot, options) + if err != nil { + return WebAppsGetBackupStatusSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsGetBackupStatusSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsGetBackupStatusSlotResponse{}, client.getBackupStatusSlotHandleError(resp) + } + return client.getBackupStatusSlotHandleResponse(resp) +} + +// getBackupStatusSlotCreateRequest creates the GetBackupStatusSlot request. +func (client *WebAppsClient) getBackupStatusSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, backupID string, slot string, options *WebAppsGetBackupStatusSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups/{backupId}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if backupID == "" { + return nil, errors.New("parameter backupID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{backupId}", url.PathEscape(backupID)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getBackupStatusSlotHandleResponse handles the GetBackupStatusSlot response. +func (client *WebAppsClient) getBackupStatusSlotHandleResponse(resp *http.Response) (WebAppsGetBackupStatusSlotResponse, error) { + result := WebAppsGetBackupStatusSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.BackupItem); err != nil { + return WebAppsGetBackupStatusSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getBackupStatusSlotHandleError handles the GetBackupStatusSlot error response. +func (client *WebAppsClient) getBackupStatusSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetConfiguration - Description for Gets the configuration of an app, such as platform version and bitness, default documents, virtual applications, Always +// On, etc. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) GetConfiguration(ctx context.Context, resourceGroupName string, name string, options *WebAppsGetConfigurationOptions) (WebAppsGetConfigurationResponse, error) { + req, err := client.getConfigurationCreateRequest(ctx, resourceGroupName, name, options) + if err != nil { + return WebAppsGetConfigurationResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsGetConfigurationResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsGetConfigurationResponse{}, client.getConfigurationHandleError(resp) + } + return client.getConfigurationHandleResponse(resp) +} + +// getConfigurationCreateRequest creates the GetConfiguration request. +func (client *WebAppsClient) getConfigurationCreateRequest(ctx context.Context, resourceGroupName string, name string, options *WebAppsGetConfigurationOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getConfigurationHandleResponse handles the GetConfiguration response. +func (client *WebAppsClient) getConfigurationHandleResponse(resp *http.Response) (WebAppsGetConfigurationResponse, error) { + result := WebAppsGetConfigurationResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.SiteConfigResource); err != nil { + return WebAppsGetConfigurationResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getConfigurationHandleError handles the GetConfiguration error response. +func (client *WebAppsClient) getConfigurationHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetConfigurationSlot - Description for Gets the configuration of an app, such as platform version and bitness, default documents, virtual applications, +// Always On, etc. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) GetConfigurationSlot(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsGetConfigurationSlotOptions) (WebAppsGetConfigurationSlotResponse, error) { + req, err := client.getConfigurationSlotCreateRequest(ctx, resourceGroupName, name, slot, options) + if err != nil { + return WebAppsGetConfigurationSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsGetConfigurationSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsGetConfigurationSlotResponse{}, client.getConfigurationSlotHandleError(resp) + } + return client.getConfigurationSlotHandleResponse(resp) +} + +// getConfigurationSlotCreateRequest creates the GetConfigurationSlot request. +func (client *WebAppsClient) getConfigurationSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsGetConfigurationSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getConfigurationSlotHandleResponse handles the GetConfigurationSlot response. +func (client *WebAppsClient) getConfigurationSlotHandleResponse(resp *http.Response) (WebAppsGetConfigurationSlotResponse, error) { + result := WebAppsGetConfigurationSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.SiteConfigResource); err != nil { + return WebAppsGetConfigurationSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getConfigurationSlotHandleError handles the GetConfigurationSlot error response. +func (client *WebAppsClient) getConfigurationSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetConfigurationSnapshot - Description for Gets a snapshot of the configuration of an app at a previous point in time. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) GetConfigurationSnapshot(ctx context.Context, resourceGroupName string, name string, snapshotID string, options *WebAppsGetConfigurationSnapshotOptions) (WebAppsGetConfigurationSnapshotResponse, error) { + req, err := client.getConfigurationSnapshotCreateRequest(ctx, resourceGroupName, name, snapshotID, options) + if err != nil { + return WebAppsGetConfigurationSnapshotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsGetConfigurationSnapshotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsGetConfigurationSnapshotResponse{}, client.getConfigurationSnapshotHandleError(resp) + } + return client.getConfigurationSnapshotHandleResponse(resp) +} + +// getConfigurationSnapshotCreateRequest creates the GetConfigurationSnapshot request. +func (client *WebAppsClient) getConfigurationSnapshotCreateRequest(ctx context.Context, resourceGroupName string, name string, snapshotID string, options *WebAppsGetConfigurationSnapshotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web/snapshots/{snapshotId}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if snapshotID == "" { + return nil, errors.New("parameter snapshotID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{snapshotId}", url.PathEscape(snapshotID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getConfigurationSnapshotHandleResponse handles the GetConfigurationSnapshot response. +func (client *WebAppsClient) getConfigurationSnapshotHandleResponse(resp *http.Response) (WebAppsGetConfigurationSnapshotResponse, error) { + result := WebAppsGetConfigurationSnapshotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.SiteConfigResource); err != nil { + return WebAppsGetConfigurationSnapshotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getConfigurationSnapshotHandleError handles the GetConfigurationSnapshot error response. +func (client *WebAppsClient) getConfigurationSnapshotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetConfigurationSnapshotSlot - Description for Gets a snapshot of the configuration of an app at a previous point in time. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) GetConfigurationSnapshotSlot(ctx context.Context, resourceGroupName string, name string, snapshotID string, slot string, options *WebAppsGetConfigurationSnapshotSlotOptions) (WebAppsGetConfigurationSnapshotSlotResponse, error) { + req, err := client.getConfigurationSnapshotSlotCreateRequest(ctx, resourceGroupName, name, snapshotID, slot, options) + if err != nil { + return WebAppsGetConfigurationSnapshotSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsGetConfigurationSnapshotSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsGetConfigurationSnapshotSlotResponse{}, client.getConfigurationSnapshotSlotHandleError(resp) + } + return client.getConfigurationSnapshotSlotHandleResponse(resp) +} + +// getConfigurationSnapshotSlotCreateRequest creates the GetConfigurationSnapshotSlot request. +func (client *WebAppsClient) getConfigurationSnapshotSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, snapshotID string, slot string, options *WebAppsGetConfigurationSnapshotSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web/snapshots/{snapshotId}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if snapshotID == "" { + return nil, errors.New("parameter snapshotID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{snapshotId}", url.PathEscape(snapshotID)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getConfigurationSnapshotSlotHandleResponse handles the GetConfigurationSnapshotSlot response. +func (client *WebAppsClient) getConfigurationSnapshotSlotHandleResponse(resp *http.Response) (WebAppsGetConfigurationSnapshotSlotResponse, error) { + result := WebAppsGetConfigurationSnapshotSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.SiteConfigResource); err != nil { + return WebAppsGetConfigurationSnapshotSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getConfigurationSnapshotSlotHandleError handles the GetConfigurationSnapshotSlot error response. +func (client *WebAppsClient) getConfigurationSnapshotSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetContainerLogsZip - Description for Gets the ZIP archived docker log files for the given site +// If the operation fails it returns a generic error. +func (client *WebAppsClient) GetContainerLogsZip(ctx context.Context, resourceGroupName string, name string, options *WebAppsGetContainerLogsZipOptions) (WebAppsGetContainerLogsZipResponse, error) { + req, err := client.getContainerLogsZipCreateRequest(ctx, resourceGroupName, name, options) + if err != nil { + return WebAppsGetContainerLogsZipResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsGetContainerLogsZipResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { + return WebAppsGetContainerLogsZipResponse{}, client.getContainerLogsZipHandleError(resp) + } + return WebAppsGetContainerLogsZipResponse{RawResponse: resp}, nil +} + +// getContainerLogsZipCreateRequest creates the GetContainerLogsZip request. +func (client *WebAppsClient) getContainerLogsZipCreateRequest(ctx context.Context, resourceGroupName string, name string, options *WebAppsGetContainerLogsZipOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/containerlogs/zip/download" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.SkipBodyDownload() + req.Raw().Header.Set("Accept", "application/zip") + return req, nil +} + +// getContainerLogsZipHandleError handles the GetContainerLogsZip error response. +func (client *WebAppsClient) getContainerLogsZipHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + if len(body) == 0 { + return runtime.NewResponseError(errors.New(resp.Status), resp) + } + return runtime.NewResponseError(errors.New(string(body)), resp) +} + +// GetContainerLogsZipSlot - Description for Gets the ZIP archived docker log files for the given site +// If the operation fails it returns a generic error. +func (client *WebAppsClient) GetContainerLogsZipSlot(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsGetContainerLogsZipSlotOptions) (WebAppsGetContainerLogsZipSlotResponse, error) { + req, err := client.getContainerLogsZipSlotCreateRequest(ctx, resourceGroupName, name, slot, options) + if err != nil { + return WebAppsGetContainerLogsZipSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsGetContainerLogsZipSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { + return WebAppsGetContainerLogsZipSlotResponse{}, client.getContainerLogsZipSlotHandleError(resp) + } + return WebAppsGetContainerLogsZipSlotResponse{RawResponse: resp}, nil +} + +// getContainerLogsZipSlotCreateRequest creates the GetContainerLogsZipSlot request. +func (client *WebAppsClient) getContainerLogsZipSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsGetContainerLogsZipSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/containerlogs/zip/download" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.SkipBodyDownload() + req.Raw().Header.Set("Accept", "application/zip") + return req, nil +} + +// getContainerLogsZipSlotHandleError handles the GetContainerLogsZipSlot error response. +func (client *WebAppsClient) getContainerLogsZipSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + if len(body) == 0 { + return runtime.NewResponseError(errors.New(resp.Status), resp) + } + return runtime.NewResponseError(errors.New(string(body)), resp) +} + +// GetContinuousWebJob - Description for Gets a continuous web job by its ID for an app, or a deployment slot. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) GetContinuousWebJob(ctx context.Context, resourceGroupName string, name string, webJobName string, options *WebAppsGetContinuousWebJobOptions) (WebAppsGetContinuousWebJobResponse, error) { + req, err := client.getContinuousWebJobCreateRequest(ctx, resourceGroupName, name, webJobName, options) + if err != nil { + return WebAppsGetContinuousWebJobResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsGetContinuousWebJobResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsGetContinuousWebJobResponse{}, client.getContinuousWebJobHandleError(resp) + } + return client.getContinuousWebJobHandleResponse(resp) +} + +// getContinuousWebJobCreateRequest creates the GetContinuousWebJob request. +func (client *WebAppsClient) getContinuousWebJobCreateRequest(ctx context.Context, resourceGroupName string, name string, webJobName string, options *WebAppsGetContinuousWebJobOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/continuouswebjobs/{webJobName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if webJobName == "" { + return nil, errors.New("parameter webJobName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{webJobName}", url.PathEscape(webJobName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getContinuousWebJobHandleResponse handles the GetContinuousWebJob response. +func (client *WebAppsClient) getContinuousWebJobHandleResponse(resp *http.Response) (WebAppsGetContinuousWebJobResponse, error) { + result := WebAppsGetContinuousWebJobResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.ContinuousWebJob); err != nil { + return WebAppsGetContinuousWebJobResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getContinuousWebJobHandleError handles the GetContinuousWebJob error response. +func (client *WebAppsClient) getContinuousWebJobHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + switch resp.StatusCode { + case http.StatusNotFound: + if len(body) == 0 { + return runtime.NewResponseError(errors.New(resp.Status), resp) + } + return runtime.NewResponseError(errors.New(string(body)), resp) + default: + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) + } +} + +// GetContinuousWebJobSlot - Description for Gets a continuous web job by its ID for an app, or a deployment slot. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) GetContinuousWebJobSlot(ctx context.Context, resourceGroupName string, name string, webJobName string, slot string, options *WebAppsGetContinuousWebJobSlotOptions) (WebAppsGetContinuousWebJobSlotResponse, error) { + req, err := client.getContinuousWebJobSlotCreateRequest(ctx, resourceGroupName, name, webJobName, slot, options) + if err != nil { + return WebAppsGetContinuousWebJobSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsGetContinuousWebJobSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsGetContinuousWebJobSlotResponse{}, client.getContinuousWebJobSlotHandleError(resp) + } + return client.getContinuousWebJobSlotHandleResponse(resp) +} + +// getContinuousWebJobSlotCreateRequest creates the GetContinuousWebJobSlot request. +func (client *WebAppsClient) getContinuousWebJobSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, webJobName string, slot string, options *WebAppsGetContinuousWebJobSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/continuouswebjobs/{webJobName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if webJobName == "" { + return nil, errors.New("parameter webJobName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{webJobName}", url.PathEscape(webJobName)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getContinuousWebJobSlotHandleResponse handles the GetContinuousWebJobSlot response. +func (client *WebAppsClient) getContinuousWebJobSlotHandleResponse(resp *http.Response) (WebAppsGetContinuousWebJobSlotResponse, error) { + result := WebAppsGetContinuousWebJobSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.ContinuousWebJob); err != nil { + return WebAppsGetContinuousWebJobSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getContinuousWebJobSlotHandleError handles the GetContinuousWebJobSlot error response. +func (client *WebAppsClient) getContinuousWebJobSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + switch resp.StatusCode { + case http.StatusNotFound: + if len(body) == 0 { + return runtime.NewResponseError(errors.New(resp.Status), resp) + } + return runtime.NewResponseError(errors.New(string(body)), resp) + default: + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) + } +} + +// GetDeployment - Description for Get a deployment by its ID for an app, or a deployment slot. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) GetDeployment(ctx context.Context, resourceGroupName string, name string, id string, options *WebAppsGetDeploymentOptions) (WebAppsGetDeploymentResponse, error) { + req, err := client.getDeploymentCreateRequest(ctx, resourceGroupName, name, id, options) + if err != nil { + return WebAppsGetDeploymentResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsGetDeploymentResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsGetDeploymentResponse{}, client.getDeploymentHandleError(resp) + } + return client.getDeploymentHandleResponse(resp) +} + +// getDeploymentCreateRequest creates the GetDeployment request. +func (client *WebAppsClient) getDeploymentCreateRequest(ctx context.Context, resourceGroupName string, name string, id string, options *WebAppsGetDeploymentOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/deployments/{id}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if id == "" { + return nil, errors.New("parameter id cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{id}", url.PathEscape(id)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getDeploymentHandleResponse handles the GetDeployment response. +func (client *WebAppsClient) getDeploymentHandleResponse(resp *http.Response) (WebAppsGetDeploymentResponse, error) { + result := WebAppsGetDeploymentResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.Deployment); err != nil { + return WebAppsGetDeploymentResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getDeploymentHandleError handles the GetDeployment error response. +func (client *WebAppsClient) getDeploymentHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetDeploymentSlot - Description for Get a deployment by its ID for an app, or a deployment slot. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) GetDeploymentSlot(ctx context.Context, resourceGroupName string, name string, id string, slot string, options *WebAppsGetDeploymentSlotOptions) (WebAppsGetDeploymentSlotResponse, error) { + req, err := client.getDeploymentSlotCreateRequest(ctx, resourceGroupName, name, id, slot, options) + if err != nil { + return WebAppsGetDeploymentSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsGetDeploymentSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsGetDeploymentSlotResponse{}, client.getDeploymentSlotHandleError(resp) + } + return client.getDeploymentSlotHandleResponse(resp) +} + +// getDeploymentSlotCreateRequest creates the GetDeploymentSlot request. +func (client *WebAppsClient) getDeploymentSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, id string, slot string, options *WebAppsGetDeploymentSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/deployments/{id}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if id == "" { + return nil, errors.New("parameter id cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{id}", url.PathEscape(id)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getDeploymentSlotHandleResponse handles the GetDeploymentSlot response. +func (client *WebAppsClient) getDeploymentSlotHandleResponse(resp *http.Response) (WebAppsGetDeploymentSlotResponse, error) { + result := WebAppsGetDeploymentSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.Deployment); err != nil { + return WebAppsGetDeploymentSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getDeploymentSlotHandleError handles the GetDeploymentSlot error response. +func (client *WebAppsClient) getDeploymentSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetDiagnosticLogsConfiguration - Description for Gets the logging configuration of an app. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) GetDiagnosticLogsConfiguration(ctx context.Context, resourceGroupName string, name string, options *WebAppsGetDiagnosticLogsConfigurationOptions) (WebAppsGetDiagnosticLogsConfigurationResponse, error) { + req, err := client.getDiagnosticLogsConfigurationCreateRequest(ctx, resourceGroupName, name, options) + if err != nil { + return WebAppsGetDiagnosticLogsConfigurationResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsGetDiagnosticLogsConfigurationResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsGetDiagnosticLogsConfigurationResponse{}, client.getDiagnosticLogsConfigurationHandleError(resp) + } + return client.getDiagnosticLogsConfigurationHandleResponse(resp) +} + +// getDiagnosticLogsConfigurationCreateRequest creates the GetDiagnosticLogsConfiguration request. +func (client *WebAppsClient) getDiagnosticLogsConfigurationCreateRequest(ctx context.Context, resourceGroupName string, name string, options *WebAppsGetDiagnosticLogsConfigurationOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/logs" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getDiagnosticLogsConfigurationHandleResponse handles the GetDiagnosticLogsConfiguration response. +func (client *WebAppsClient) getDiagnosticLogsConfigurationHandleResponse(resp *http.Response) (WebAppsGetDiagnosticLogsConfigurationResponse, error) { + result := WebAppsGetDiagnosticLogsConfigurationResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.SiteLogsConfig); err != nil { + return WebAppsGetDiagnosticLogsConfigurationResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getDiagnosticLogsConfigurationHandleError handles the GetDiagnosticLogsConfiguration error response. +func (client *WebAppsClient) getDiagnosticLogsConfigurationHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetDiagnosticLogsConfigurationSlot - Description for Gets the logging configuration of an app. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) GetDiagnosticLogsConfigurationSlot(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsGetDiagnosticLogsConfigurationSlotOptions) (WebAppsGetDiagnosticLogsConfigurationSlotResponse, error) { + req, err := client.getDiagnosticLogsConfigurationSlotCreateRequest(ctx, resourceGroupName, name, slot, options) + if err != nil { + return WebAppsGetDiagnosticLogsConfigurationSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsGetDiagnosticLogsConfigurationSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsGetDiagnosticLogsConfigurationSlotResponse{}, client.getDiagnosticLogsConfigurationSlotHandleError(resp) + } + return client.getDiagnosticLogsConfigurationSlotHandleResponse(resp) +} + +// getDiagnosticLogsConfigurationSlotCreateRequest creates the GetDiagnosticLogsConfigurationSlot request. +func (client *WebAppsClient) getDiagnosticLogsConfigurationSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsGetDiagnosticLogsConfigurationSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/logs" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getDiagnosticLogsConfigurationSlotHandleResponse handles the GetDiagnosticLogsConfigurationSlot response. +func (client *WebAppsClient) getDiagnosticLogsConfigurationSlotHandleResponse(resp *http.Response) (WebAppsGetDiagnosticLogsConfigurationSlotResponse, error) { + result := WebAppsGetDiagnosticLogsConfigurationSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.SiteLogsConfig); err != nil { + return WebAppsGetDiagnosticLogsConfigurationSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getDiagnosticLogsConfigurationSlotHandleError handles the GetDiagnosticLogsConfigurationSlot error response. +func (client *WebAppsClient) getDiagnosticLogsConfigurationSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetDomainOwnershipIdentifier - Description for Get domain ownership identifier for web app. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) GetDomainOwnershipIdentifier(ctx context.Context, resourceGroupName string, name string, domainOwnershipIdentifierName string, options *WebAppsGetDomainOwnershipIdentifierOptions) (WebAppsGetDomainOwnershipIdentifierResponse, error) { + req, err := client.getDomainOwnershipIdentifierCreateRequest(ctx, resourceGroupName, name, domainOwnershipIdentifierName, options) + if err != nil { + return WebAppsGetDomainOwnershipIdentifierResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsGetDomainOwnershipIdentifierResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsGetDomainOwnershipIdentifierResponse{}, client.getDomainOwnershipIdentifierHandleError(resp) + } + return client.getDomainOwnershipIdentifierHandleResponse(resp) +} + +// getDomainOwnershipIdentifierCreateRequest creates the GetDomainOwnershipIdentifier request. +func (client *WebAppsClient) getDomainOwnershipIdentifierCreateRequest(ctx context.Context, resourceGroupName string, name string, domainOwnershipIdentifierName string, options *WebAppsGetDomainOwnershipIdentifierOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if domainOwnershipIdentifierName == "" { + return nil, errors.New("parameter domainOwnershipIdentifierName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{domainOwnershipIdentifierName}", url.PathEscape(domainOwnershipIdentifierName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getDomainOwnershipIdentifierHandleResponse handles the GetDomainOwnershipIdentifier response. +func (client *WebAppsClient) getDomainOwnershipIdentifierHandleResponse(resp *http.Response) (WebAppsGetDomainOwnershipIdentifierResponse, error) { + result := WebAppsGetDomainOwnershipIdentifierResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.Identifier); err != nil { + return WebAppsGetDomainOwnershipIdentifierResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getDomainOwnershipIdentifierHandleError handles the GetDomainOwnershipIdentifier error response. +func (client *WebAppsClient) getDomainOwnershipIdentifierHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetDomainOwnershipIdentifierSlot - Description for Get domain ownership identifier for web app. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) GetDomainOwnershipIdentifierSlot(ctx context.Context, resourceGroupName string, name string, domainOwnershipIdentifierName string, slot string, options *WebAppsGetDomainOwnershipIdentifierSlotOptions) (WebAppsGetDomainOwnershipIdentifierSlotResponse, error) { + req, err := client.getDomainOwnershipIdentifierSlotCreateRequest(ctx, resourceGroupName, name, domainOwnershipIdentifierName, slot, options) + if err != nil { + return WebAppsGetDomainOwnershipIdentifierSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsGetDomainOwnershipIdentifierSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsGetDomainOwnershipIdentifierSlotResponse{}, client.getDomainOwnershipIdentifierSlotHandleError(resp) + } + return client.getDomainOwnershipIdentifierSlotHandleResponse(resp) +} + +// getDomainOwnershipIdentifierSlotCreateRequest creates the GetDomainOwnershipIdentifierSlot request. +func (client *WebAppsClient) getDomainOwnershipIdentifierSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, domainOwnershipIdentifierName string, slot string, options *WebAppsGetDomainOwnershipIdentifierSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if domainOwnershipIdentifierName == "" { + return nil, errors.New("parameter domainOwnershipIdentifierName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{domainOwnershipIdentifierName}", url.PathEscape(domainOwnershipIdentifierName)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getDomainOwnershipIdentifierSlotHandleResponse handles the GetDomainOwnershipIdentifierSlot response. +func (client *WebAppsClient) getDomainOwnershipIdentifierSlotHandleResponse(resp *http.Response) (WebAppsGetDomainOwnershipIdentifierSlotResponse, error) { + result := WebAppsGetDomainOwnershipIdentifierSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.Identifier); err != nil { + return WebAppsGetDomainOwnershipIdentifierSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getDomainOwnershipIdentifierSlotHandleError handles the GetDomainOwnershipIdentifierSlot error response. +func (client *WebAppsClient) getDomainOwnershipIdentifierSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetFtpAllowed - Description for Returns whether FTP is allowed on the site or not. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) GetFtpAllowed(ctx context.Context, resourceGroupName string, name string, options *WebAppsGetFtpAllowedOptions) (WebAppsGetFtpAllowedResponse, error) { + req, err := client.getFtpAllowedCreateRequest(ctx, resourceGroupName, name, options) + if err != nil { + return WebAppsGetFtpAllowedResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsGetFtpAllowedResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsGetFtpAllowedResponse{}, client.getFtpAllowedHandleError(resp) + } + return client.getFtpAllowedHandleResponse(resp) +} + +// getFtpAllowedCreateRequest creates the GetFtpAllowed request. +func (client *WebAppsClient) getFtpAllowedCreateRequest(ctx context.Context, resourceGroupName string, name string, options *WebAppsGetFtpAllowedOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/basicPublishingCredentialsPolicies/ftp" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getFtpAllowedHandleResponse handles the GetFtpAllowed response. +func (client *WebAppsClient) getFtpAllowedHandleResponse(resp *http.Response) (WebAppsGetFtpAllowedResponse, error) { + result := WebAppsGetFtpAllowedResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.CsmPublishingCredentialsPoliciesEntity); err != nil { + return WebAppsGetFtpAllowedResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getFtpAllowedHandleError handles the GetFtpAllowed error response. +func (client *WebAppsClient) getFtpAllowedHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetFtpAllowedSlot - Description for Returns whether FTP is allowed on the site or not. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) GetFtpAllowedSlot(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsGetFtpAllowedSlotOptions) (WebAppsGetFtpAllowedSlotResponse, error) { + req, err := client.getFtpAllowedSlotCreateRequest(ctx, resourceGroupName, name, slot, options) + if err != nil { + return WebAppsGetFtpAllowedSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsGetFtpAllowedSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsGetFtpAllowedSlotResponse{}, client.getFtpAllowedSlotHandleError(resp) + } + return client.getFtpAllowedSlotHandleResponse(resp) +} + +// getFtpAllowedSlotCreateRequest creates the GetFtpAllowedSlot request. +func (client *WebAppsClient) getFtpAllowedSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsGetFtpAllowedSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/basicPublishingCredentialsPolicies/ftp" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getFtpAllowedSlotHandleResponse handles the GetFtpAllowedSlot response. +func (client *WebAppsClient) getFtpAllowedSlotHandleResponse(resp *http.Response) (WebAppsGetFtpAllowedSlotResponse, error) { + result := WebAppsGetFtpAllowedSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.CsmPublishingCredentialsPoliciesEntity); err != nil { + return WebAppsGetFtpAllowedSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getFtpAllowedSlotHandleError handles the GetFtpAllowedSlot error response. +func (client *WebAppsClient) getFtpAllowedSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetFunction - Description for Get function information by its ID for web site, or a deployment slot. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) GetFunction(ctx context.Context, resourceGroupName string, name string, functionName string, options *WebAppsGetFunctionOptions) (WebAppsGetFunctionResponse, error) { + req, err := client.getFunctionCreateRequest(ctx, resourceGroupName, name, functionName, options) + if err != nil { + return WebAppsGetFunctionResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsGetFunctionResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsGetFunctionResponse{}, client.getFunctionHandleError(resp) + } + return client.getFunctionHandleResponse(resp) +} + +// getFunctionCreateRequest creates the GetFunction request. +func (client *WebAppsClient) getFunctionCreateRequest(ctx context.Context, resourceGroupName string, name string, functionName string, options *WebAppsGetFunctionOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if functionName == "" { + return nil, errors.New("parameter functionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{functionName}", url.PathEscape(functionName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getFunctionHandleResponse handles the GetFunction response. +func (client *WebAppsClient) getFunctionHandleResponse(resp *http.Response) (WebAppsGetFunctionResponse, error) { + result := WebAppsGetFunctionResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.FunctionEnvelope); err != nil { + return WebAppsGetFunctionResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getFunctionHandleError handles the GetFunction error response. +func (client *WebAppsClient) getFunctionHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + switch resp.StatusCode { + case http.StatusNotFound: + if len(body) == 0 { + return runtime.NewResponseError(errors.New(resp.Status), resp) + } + return runtime.NewResponseError(errors.New(string(body)), resp) + default: + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) + } +} + +// GetFunctionsAdminToken - Description for Fetch a short lived token that can be exchanged for a master key. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) GetFunctionsAdminToken(ctx context.Context, resourceGroupName string, name string, options *WebAppsGetFunctionsAdminTokenOptions) (WebAppsGetFunctionsAdminTokenResponse, error) { + req, err := client.getFunctionsAdminTokenCreateRequest(ctx, resourceGroupName, name, options) + if err != nil { + return WebAppsGetFunctionsAdminTokenResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsGetFunctionsAdminTokenResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsGetFunctionsAdminTokenResponse{}, client.getFunctionsAdminTokenHandleError(resp) + } + return client.getFunctionsAdminTokenHandleResponse(resp) +} + +// getFunctionsAdminTokenCreateRequest creates the GetFunctionsAdminToken request. +func (client *WebAppsClient) getFunctionsAdminTokenCreateRequest(ctx context.Context, resourceGroupName string, name string, options *WebAppsGetFunctionsAdminTokenOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/admin/token" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getFunctionsAdminTokenHandleResponse handles the GetFunctionsAdminToken response. +func (client *WebAppsClient) getFunctionsAdminTokenHandleResponse(resp *http.Response) (WebAppsGetFunctionsAdminTokenResponse, error) { + result := WebAppsGetFunctionsAdminTokenResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.Value); err != nil { + return WebAppsGetFunctionsAdminTokenResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getFunctionsAdminTokenHandleError handles the GetFunctionsAdminToken error response. +func (client *WebAppsClient) getFunctionsAdminTokenHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetFunctionsAdminTokenSlot - Description for Fetch a short lived token that can be exchanged for a master key. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) GetFunctionsAdminTokenSlot(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsGetFunctionsAdminTokenSlotOptions) (WebAppsGetFunctionsAdminTokenSlotResponse, error) { + req, err := client.getFunctionsAdminTokenSlotCreateRequest(ctx, resourceGroupName, name, slot, options) + if err != nil { + return WebAppsGetFunctionsAdminTokenSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsGetFunctionsAdminTokenSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsGetFunctionsAdminTokenSlotResponse{}, client.getFunctionsAdminTokenSlotHandleError(resp) + } + return client.getFunctionsAdminTokenSlotHandleResponse(resp) +} + +// getFunctionsAdminTokenSlotCreateRequest creates the GetFunctionsAdminTokenSlot request. +func (client *WebAppsClient) getFunctionsAdminTokenSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsGetFunctionsAdminTokenSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/admin/token" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getFunctionsAdminTokenSlotHandleResponse handles the GetFunctionsAdminTokenSlot response. +func (client *WebAppsClient) getFunctionsAdminTokenSlotHandleResponse(resp *http.Response) (WebAppsGetFunctionsAdminTokenSlotResponse, error) { + result := WebAppsGetFunctionsAdminTokenSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.Value); err != nil { + return WebAppsGetFunctionsAdminTokenSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getFunctionsAdminTokenSlotHandleError handles the GetFunctionsAdminTokenSlot error response. +func (client *WebAppsClient) getFunctionsAdminTokenSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetHostNameBinding - Description for Get the named hostname binding for an app (or deployment slot, if specified). +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) GetHostNameBinding(ctx context.Context, resourceGroupName string, name string, hostName string, options *WebAppsGetHostNameBindingOptions) (WebAppsGetHostNameBindingResponse, error) { + req, err := client.getHostNameBindingCreateRequest(ctx, resourceGroupName, name, hostName, options) + if err != nil { + return WebAppsGetHostNameBindingResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsGetHostNameBindingResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsGetHostNameBindingResponse{}, client.getHostNameBindingHandleError(resp) + } + return client.getHostNameBindingHandleResponse(resp) +} + +// getHostNameBindingCreateRequest creates the GetHostNameBinding request. +func (client *WebAppsClient) getHostNameBindingCreateRequest(ctx context.Context, resourceGroupName string, name string, hostName string, options *WebAppsGetHostNameBindingOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hostNameBindings/{hostName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if hostName == "" { + return nil, errors.New("parameter hostName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{hostName}", url.PathEscape(hostName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getHostNameBindingHandleResponse handles the GetHostNameBinding response. +func (client *WebAppsClient) getHostNameBindingHandleResponse(resp *http.Response) (WebAppsGetHostNameBindingResponse, error) { + result := WebAppsGetHostNameBindingResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.HostNameBinding); err != nil { + return WebAppsGetHostNameBindingResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getHostNameBindingHandleError handles the GetHostNameBinding error response. +func (client *WebAppsClient) getHostNameBindingHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetHostNameBindingSlot - Description for Get the named hostname binding for an app (or deployment slot, if specified). +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) GetHostNameBindingSlot(ctx context.Context, resourceGroupName string, name string, slot string, hostName string, options *WebAppsGetHostNameBindingSlotOptions) (WebAppsGetHostNameBindingSlotResponse, error) { + req, err := client.getHostNameBindingSlotCreateRequest(ctx, resourceGroupName, name, slot, hostName, options) + if err != nil { + return WebAppsGetHostNameBindingSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsGetHostNameBindingSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsGetHostNameBindingSlotResponse{}, client.getHostNameBindingSlotHandleError(resp) + } + return client.getHostNameBindingSlotHandleResponse(resp) +} + +// getHostNameBindingSlotCreateRequest creates the GetHostNameBindingSlot request. +func (client *WebAppsClient) getHostNameBindingSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, slot string, hostName string, options *WebAppsGetHostNameBindingSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hostNameBindings/{hostName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if hostName == "" { + return nil, errors.New("parameter hostName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{hostName}", url.PathEscape(hostName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getHostNameBindingSlotHandleResponse handles the GetHostNameBindingSlot response. +func (client *WebAppsClient) getHostNameBindingSlotHandleResponse(resp *http.Response) (WebAppsGetHostNameBindingSlotResponse, error) { + result := WebAppsGetHostNameBindingSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.HostNameBinding); err != nil { + return WebAppsGetHostNameBindingSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getHostNameBindingSlotHandleError handles the GetHostNameBindingSlot error response. +func (client *WebAppsClient) getHostNameBindingSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetHybridConnection - Description for Retrieves a specific Service Bus Hybrid Connection used by this Web App. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) GetHybridConnection(ctx context.Context, resourceGroupName string, name string, namespaceName string, relayName string, options *WebAppsGetHybridConnectionOptions) (WebAppsGetHybridConnectionResponse, error) { + req, err := client.getHybridConnectionCreateRequest(ctx, resourceGroupName, name, namespaceName, relayName, options) + if err != nil { + return WebAppsGetHybridConnectionResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsGetHybridConnectionResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsGetHybridConnectionResponse{}, client.getHybridConnectionHandleError(resp) + } + return client.getHybridConnectionHandleResponse(resp) +} + +// getHybridConnectionCreateRequest creates the GetHybridConnection request. +func (client *WebAppsClient) getHybridConnectionCreateRequest(ctx context.Context, resourceGroupName string, name string, namespaceName string, relayName string, options *WebAppsGetHybridConnectionOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if namespaceName == "" { + return nil, errors.New("parameter namespaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{namespaceName}", url.PathEscape(namespaceName)) + if relayName == "" { + return nil, errors.New("parameter relayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{relayName}", url.PathEscape(relayName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getHybridConnectionHandleResponse handles the GetHybridConnection response. +func (client *WebAppsClient) getHybridConnectionHandleResponse(resp *http.Response) (WebAppsGetHybridConnectionResponse, error) { + result := WebAppsGetHybridConnectionResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.HybridConnection); err != nil { + return WebAppsGetHybridConnectionResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getHybridConnectionHandleError handles the GetHybridConnection error response. +func (client *WebAppsClient) getHybridConnectionHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetHybridConnectionSlot - Description for Retrieves a specific Service Bus Hybrid Connection used by this Web App. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) GetHybridConnectionSlot(ctx context.Context, resourceGroupName string, name string, namespaceName string, relayName string, slot string, options *WebAppsGetHybridConnectionSlotOptions) (WebAppsGetHybridConnectionSlotResponse, error) { + req, err := client.getHybridConnectionSlotCreateRequest(ctx, resourceGroupName, name, namespaceName, relayName, slot, options) + if err != nil { + return WebAppsGetHybridConnectionSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsGetHybridConnectionSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsGetHybridConnectionSlotResponse{}, client.getHybridConnectionSlotHandleError(resp) + } + return client.getHybridConnectionSlotHandleResponse(resp) +} + +// getHybridConnectionSlotCreateRequest creates the GetHybridConnectionSlot request. +func (client *WebAppsClient) getHybridConnectionSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, namespaceName string, relayName string, slot string, options *WebAppsGetHybridConnectionSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if namespaceName == "" { + return nil, errors.New("parameter namespaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{namespaceName}", url.PathEscape(namespaceName)) + if relayName == "" { + return nil, errors.New("parameter relayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{relayName}", url.PathEscape(relayName)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getHybridConnectionSlotHandleResponse handles the GetHybridConnectionSlot response. +func (client *WebAppsClient) getHybridConnectionSlotHandleResponse(resp *http.Response) (WebAppsGetHybridConnectionSlotResponse, error) { + result := WebAppsGetHybridConnectionSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.HybridConnection); err != nil { + return WebAppsGetHybridConnectionSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getHybridConnectionSlotHandleError handles the GetHybridConnectionSlot error response. +func (client *WebAppsClient) getHybridConnectionSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetInstanceFunctionSlot - Description for Get function information by its ID for web site, or a deployment slot. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) GetInstanceFunctionSlot(ctx context.Context, resourceGroupName string, name string, functionName string, slot string, options *WebAppsGetInstanceFunctionSlotOptions) (WebAppsGetInstanceFunctionSlotResponse, error) { + req, err := client.getInstanceFunctionSlotCreateRequest(ctx, resourceGroupName, name, functionName, slot, options) + if err != nil { + return WebAppsGetInstanceFunctionSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsGetInstanceFunctionSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsGetInstanceFunctionSlotResponse{}, client.getInstanceFunctionSlotHandleError(resp) + } + return client.getInstanceFunctionSlotHandleResponse(resp) +} + +// getInstanceFunctionSlotCreateRequest creates the GetInstanceFunctionSlot request. +func (client *WebAppsClient) getInstanceFunctionSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, functionName string, slot string, options *WebAppsGetInstanceFunctionSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if functionName == "" { + return nil, errors.New("parameter functionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{functionName}", url.PathEscape(functionName)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getInstanceFunctionSlotHandleResponse handles the GetInstanceFunctionSlot response. +func (client *WebAppsClient) getInstanceFunctionSlotHandleResponse(resp *http.Response) (WebAppsGetInstanceFunctionSlotResponse, error) { + result := WebAppsGetInstanceFunctionSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.FunctionEnvelope); err != nil { + return WebAppsGetInstanceFunctionSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getInstanceFunctionSlotHandleError handles the GetInstanceFunctionSlot error response. +func (client *WebAppsClient) getInstanceFunctionSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + switch resp.StatusCode { + case http.StatusNotFound: + if len(body) == 0 { + return runtime.NewResponseError(errors.New(resp.Status), resp) + } + return runtime.NewResponseError(errors.New(string(body)), resp) + default: + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) + } +} + +// GetInstanceInfo - Description for Gets all scale-out instances of an app. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) GetInstanceInfo(ctx context.Context, resourceGroupName string, name string, instanceID string, options *WebAppsGetInstanceInfoOptions) (WebAppsGetInstanceInfoResponse, error) { + req, err := client.getInstanceInfoCreateRequest(ctx, resourceGroupName, name, instanceID, options) + if err != nil { + return WebAppsGetInstanceInfoResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsGetInstanceInfoResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsGetInstanceInfoResponse{}, client.getInstanceInfoHandleError(resp) + } + return client.getInstanceInfoHandleResponse(resp) +} + +// getInstanceInfoCreateRequest creates the GetInstanceInfo request. +func (client *WebAppsClient) getInstanceInfoCreateRequest(ctx context.Context, resourceGroupName string, name string, instanceID string, options *WebAppsGetInstanceInfoOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if instanceID == "" { + return nil, errors.New("parameter instanceID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getInstanceInfoHandleResponse handles the GetInstanceInfo response. +func (client *WebAppsClient) getInstanceInfoHandleResponse(resp *http.Response) (WebAppsGetInstanceInfoResponse, error) { + result := WebAppsGetInstanceInfoResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.WebSiteInstanceStatus); err != nil { + return WebAppsGetInstanceInfoResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getInstanceInfoHandleError handles the GetInstanceInfo error response. +func (client *WebAppsClient) getInstanceInfoHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetInstanceInfoSlot - Description for Gets all scale-out instances of an app. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) GetInstanceInfoSlot(ctx context.Context, resourceGroupName string, name string, instanceID string, slot string, options *WebAppsGetInstanceInfoSlotOptions) (WebAppsGetInstanceInfoSlotResponse, error) { + req, err := client.getInstanceInfoSlotCreateRequest(ctx, resourceGroupName, name, instanceID, slot, options) + if err != nil { + return WebAppsGetInstanceInfoSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsGetInstanceInfoSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsGetInstanceInfoSlotResponse{}, client.getInstanceInfoSlotHandleError(resp) + } + return client.getInstanceInfoSlotHandleResponse(resp) +} + +// getInstanceInfoSlotCreateRequest creates the GetInstanceInfoSlot request. +func (client *WebAppsClient) getInstanceInfoSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, instanceID string, slot string, options *WebAppsGetInstanceInfoSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if instanceID == "" { + return nil, errors.New("parameter instanceID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getInstanceInfoSlotHandleResponse handles the GetInstanceInfoSlot response. +func (client *WebAppsClient) getInstanceInfoSlotHandleResponse(resp *http.Response) (WebAppsGetInstanceInfoSlotResponse, error) { + result := WebAppsGetInstanceInfoSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.WebSiteInstanceStatus); err != nil { + return WebAppsGetInstanceInfoSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getInstanceInfoSlotHandleError handles the GetInstanceInfoSlot error response. +func (client *WebAppsClient) getInstanceInfoSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetInstanceMSDeployLog - Description for Get the MSDeploy Log for the last MSDeploy operation. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) GetInstanceMSDeployLog(ctx context.Context, resourceGroupName string, name string, instanceID string, options *WebAppsGetInstanceMSDeployLogOptions) (WebAppsGetInstanceMSDeployLogResponse, error) { + req, err := client.getInstanceMSDeployLogCreateRequest(ctx, resourceGroupName, name, instanceID, options) + if err != nil { + return WebAppsGetInstanceMSDeployLogResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsGetInstanceMSDeployLogResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsGetInstanceMSDeployLogResponse{}, client.getInstanceMSDeployLogHandleError(resp) + } + return client.getInstanceMSDeployLogHandleResponse(resp) +} + +// getInstanceMSDeployLogCreateRequest creates the GetInstanceMSDeployLog request. +func (client *WebAppsClient) getInstanceMSDeployLogCreateRequest(ctx context.Context, resourceGroupName string, name string, instanceID string, options *WebAppsGetInstanceMSDeployLogOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/extensions/MSDeploy/log" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if instanceID == "" { + return nil, errors.New("parameter instanceID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getInstanceMSDeployLogHandleResponse handles the GetInstanceMSDeployLog response. +func (client *WebAppsClient) getInstanceMSDeployLogHandleResponse(resp *http.Response) (WebAppsGetInstanceMSDeployLogResponse, error) { + result := WebAppsGetInstanceMSDeployLogResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.MSDeployLog); err != nil { + return WebAppsGetInstanceMSDeployLogResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getInstanceMSDeployLogHandleError handles the GetInstanceMSDeployLog error response. +func (client *WebAppsClient) getInstanceMSDeployLogHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + switch resp.StatusCode { + case http.StatusNotFound: + if len(body) == 0 { + return runtime.NewResponseError(errors.New(resp.Status), resp) + } + return runtime.NewResponseError(errors.New(string(body)), resp) + default: + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) + } +} + +// GetInstanceMSDeployLogSlot - Description for Get the MSDeploy Log for the last MSDeploy operation. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) GetInstanceMSDeployLogSlot(ctx context.Context, resourceGroupName string, name string, slot string, instanceID string, options *WebAppsGetInstanceMSDeployLogSlotOptions) (WebAppsGetInstanceMSDeployLogSlotResponse, error) { + req, err := client.getInstanceMSDeployLogSlotCreateRequest(ctx, resourceGroupName, name, slot, instanceID, options) + if err != nil { + return WebAppsGetInstanceMSDeployLogSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsGetInstanceMSDeployLogSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsGetInstanceMSDeployLogSlotResponse{}, client.getInstanceMSDeployLogSlotHandleError(resp) + } + return client.getInstanceMSDeployLogSlotHandleResponse(resp) +} + +// getInstanceMSDeployLogSlotCreateRequest creates the GetInstanceMSDeployLogSlot request. +func (client *WebAppsClient) getInstanceMSDeployLogSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, slot string, instanceID string, options *WebAppsGetInstanceMSDeployLogSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/extensions/MSDeploy/log" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if instanceID == "" { + return nil, errors.New("parameter instanceID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getInstanceMSDeployLogSlotHandleResponse handles the GetInstanceMSDeployLogSlot response. +func (client *WebAppsClient) getInstanceMSDeployLogSlotHandleResponse(resp *http.Response) (WebAppsGetInstanceMSDeployLogSlotResponse, error) { + result := WebAppsGetInstanceMSDeployLogSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.MSDeployLog); err != nil { + return WebAppsGetInstanceMSDeployLogSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getInstanceMSDeployLogSlotHandleError handles the GetInstanceMSDeployLogSlot error response. +func (client *WebAppsClient) getInstanceMSDeployLogSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + switch resp.StatusCode { + case http.StatusNotFound: + if len(body) == 0 { + return runtime.NewResponseError(errors.New(resp.Status), resp) + } + return runtime.NewResponseError(errors.New(string(body)), resp) + default: + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) + } +} + +// GetInstanceMsDeployStatus - Description for Get the status of the last MSDeploy operation. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) GetInstanceMsDeployStatus(ctx context.Context, resourceGroupName string, name string, instanceID string, options *WebAppsGetInstanceMsDeployStatusOptions) (WebAppsGetInstanceMsDeployStatusResponse, error) { + req, err := client.getInstanceMsDeployStatusCreateRequest(ctx, resourceGroupName, name, instanceID, options) + if err != nil { + return WebAppsGetInstanceMsDeployStatusResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsGetInstanceMsDeployStatusResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsGetInstanceMsDeployStatusResponse{}, client.getInstanceMsDeployStatusHandleError(resp) + } + return client.getInstanceMsDeployStatusHandleResponse(resp) +} + +// getInstanceMsDeployStatusCreateRequest creates the GetInstanceMsDeployStatus request. +func (client *WebAppsClient) getInstanceMsDeployStatusCreateRequest(ctx context.Context, resourceGroupName string, name string, instanceID string, options *WebAppsGetInstanceMsDeployStatusOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/extensions/MSDeploy" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if instanceID == "" { + return nil, errors.New("parameter instanceID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getInstanceMsDeployStatusHandleResponse handles the GetInstanceMsDeployStatus response. +func (client *WebAppsClient) getInstanceMsDeployStatusHandleResponse(resp *http.Response) (WebAppsGetInstanceMsDeployStatusResponse, error) { + result := WebAppsGetInstanceMsDeployStatusResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.MSDeployStatus); err != nil { + return WebAppsGetInstanceMsDeployStatusResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getInstanceMsDeployStatusHandleError handles the GetInstanceMsDeployStatus error response. +func (client *WebAppsClient) getInstanceMsDeployStatusHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetInstanceMsDeployStatusSlot - Description for Get the status of the last MSDeploy operation. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) GetInstanceMsDeployStatusSlot(ctx context.Context, resourceGroupName string, name string, slot string, instanceID string, options *WebAppsGetInstanceMsDeployStatusSlotOptions) (WebAppsGetInstanceMsDeployStatusSlotResponse, error) { + req, err := client.getInstanceMsDeployStatusSlotCreateRequest(ctx, resourceGroupName, name, slot, instanceID, options) + if err != nil { + return WebAppsGetInstanceMsDeployStatusSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsGetInstanceMsDeployStatusSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsGetInstanceMsDeployStatusSlotResponse{}, client.getInstanceMsDeployStatusSlotHandleError(resp) + } + return client.getInstanceMsDeployStatusSlotHandleResponse(resp) +} + +// getInstanceMsDeployStatusSlotCreateRequest creates the GetInstanceMsDeployStatusSlot request. +func (client *WebAppsClient) getInstanceMsDeployStatusSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, slot string, instanceID string, options *WebAppsGetInstanceMsDeployStatusSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/extensions/MSDeploy" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if instanceID == "" { + return nil, errors.New("parameter instanceID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getInstanceMsDeployStatusSlotHandleResponse handles the GetInstanceMsDeployStatusSlot response. +func (client *WebAppsClient) getInstanceMsDeployStatusSlotHandleResponse(resp *http.Response) (WebAppsGetInstanceMsDeployStatusSlotResponse, error) { + result := WebAppsGetInstanceMsDeployStatusSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.MSDeployStatus); err != nil { + return WebAppsGetInstanceMsDeployStatusSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getInstanceMsDeployStatusSlotHandleError handles the GetInstanceMsDeployStatusSlot error response. +func (client *WebAppsClient) getInstanceMsDeployStatusSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetInstanceProcess - Description for Get process information by its ID for a specific scaled-out instance in a web site. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) GetInstanceProcess(ctx context.Context, resourceGroupName string, name string, processID string, instanceID string, options *WebAppsGetInstanceProcessOptions) (WebAppsGetInstanceProcessResponse, error) { + req, err := client.getInstanceProcessCreateRequest(ctx, resourceGroupName, name, processID, instanceID, options) + if err != nil { + return WebAppsGetInstanceProcessResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsGetInstanceProcessResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsGetInstanceProcessResponse{}, client.getInstanceProcessHandleError(resp) + } + return client.getInstanceProcessHandleResponse(resp) +} + +// getInstanceProcessCreateRequest creates the GetInstanceProcess request. +func (client *WebAppsClient) getInstanceProcessCreateRequest(ctx context.Context, resourceGroupName string, name string, processID string, instanceID string, options *WebAppsGetInstanceProcessOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if processID == "" { + return nil, errors.New("parameter processID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{processId}", url.PathEscape(processID)) + if instanceID == "" { + return nil, errors.New("parameter instanceID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getInstanceProcessHandleResponse handles the GetInstanceProcess response. +func (client *WebAppsClient) getInstanceProcessHandleResponse(resp *http.Response) (WebAppsGetInstanceProcessResponse, error) { + result := WebAppsGetInstanceProcessResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.ProcessInfo); err != nil { + return WebAppsGetInstanceProcessResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getInstanceProcessHandleError handles the GetInstanceProcess error response. +func (client *WebAppsClient) getInstanceProcessHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + switch resp.StatusCode { + case http.StatusNotFound: + if len(body) == 0 { + return runtime.NewResponseError(errors.New(resp.Status), resp) + } + return runtime.NewResponseError(errors.New(string(body)), resp) + default: + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) + } +} + +// GetInstanceProcessDump - Description for Get a memory dump of a process by its ID for a specific scaled-out instance in a web site. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) GetInstanceProcessDump(ctx context.Context, resourceGroupName string, name string, processID string, instanceID string, options *WebAppsGetInstanceProcessDumpOptions) (WebAppsGetInstanceProcessDumpResponse, error) { + req, err := client.getInstanceProcessDumpCreateRequest(ctx, resourceGroupName, name, processID, instanceID, options) + if err != nil { + return WebAppsGetInstanceProcessDumpResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsGetInstanceProcessDumpResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsGetInstanceProcessDumpResponse{}, client.getInstanceProcessDumpHandleError(resp) + } + return WebAppsGetInstanceProcessDumpResponse{RawResponse: resp}, nil +} + +// getInstanceProcessDumpCreateRequest creates the GetInstanceProcessDump request. +func (client *WebAppsClient) getInstanceProcessDumpCreateRequest(ctx context.Context, resourceGroupName string, name string, processID string, instanceID string, options *WebAppsGetInstanceProcessDumpOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}/dump" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if processID == "" { + return nil, errors.New("parameter processID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{processId}", url.PathEscape(processID)) + if instanceID == "" { + return nil, errors.New("parameter instanceID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.SkipBodyDownload() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getInstanceProcessDumpHandleError handles the GetInstanceProcessDump error response. +func (client *WebAppsClient) getInstanceProcessDumpHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + switch resp.StatusCode { + case http.StatusNotFound: + if len(body) == 0 { + return runtime.NewResponseError(errors.New(resp.Status), resp) + } + return runtime.NewResponseError(errors.New(string(body)), resp) + default: + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) + } +} + +// GetInstanceProcessDumpSlot - Description for Get a memory dump of a process by its ID for a specific scaled-out instance in a web site. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) GetInstanceProcessDumpSlot(ctx context.Context, resourceGroupName string, name string, processID string, slot string, instanceID string, options *WebAppsGetInstanceProcessDumpSlotOptions) (WebAppsGetInstanceProcessDumpSlotResponse, error) { + req, err := client.getInstanceProcessDumpSlotCreateRequest(ctx, resourceGroupName, name, processID, slot, instanceID, options) + if err != nil { + return WebAppsGetInstanceProcessDumpSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsGetInstanceProcessDumpSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsGetInstanceProcessDumpSlotResponse{}, client.getInstanceProcessDumpSlotHandleError(resp) + } + return WebAppsGetInstanceProcessDumpSlotResponse{RawResponse: resp}, nil +} + +// getInstanceProcessDumpSlotCreateRequest creates the GetInstanceProcessDumpSlot request. +func (client *WebAppsClient) getInstanceProcessDumpSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, processID string, slot string, instanceID string, options *WebAppsGetInstanceProcessDumpSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}/dump" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if processID == "" { + return nil, errors.New("parameter processID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{processId}", url.PathEscape(processID)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if instanceID == "" { + return nil, errors.New("parameter instanceID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.SkipBodyDownload() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getInstanceProcessDumpSlotHandleError handles the GetInstanceProcessDumpSlot error response. +func (client *WebAppsClient) getInstanceProcessDumpSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + switch resp.StatusCode { + case http.StatusNotFound: + if len(body) == 0 { + return runtime.NewResponseError(errors.New(resp.Status), resp) + } + return runtime.NewResponseError(errors.New(string(body)), resp) + default: + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) + } +} + +// GetInstanceProcessModule - Description for Get process information by its ID for a specific scaled-out instance in a web site. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) GetInstanceProcessModule(ctx context.Context, resourceGroupName string, name string, processID string, baseAddress string, instanceID string, options *WebAppsGetInstanceProcessModuleOptions) (WebAppsGetInstanceProcessModuleResponse, error) { + req, err := client.getInstanceProcessModuleCreateRequest(ctx, resourceGroupName, name, processID, baseAddress, instanceID, options) + if err != nil { + return WebAppsGetInstanceProcessModuleResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsGetInstanceProcessModuleResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsGetInstanceProcessModuleResponse{}, client.getInstanceProcessModuleHandleError(resp) + } + return client.getInstanceProcessModuleHandleResponse(resp) +} + +// getInstanceProcessModuleCreateRequest creates the GetInstanceProcessModule request. +func (client *WebAppsClient) getInstanceProcessModuleCreateRequest(ctx context.Context, resourceGroupName string, name string, processID string, baseAddress string, instanceID string, options *WebAppsGetInstanceProcessModuleOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}/modules/{baseAddress}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if processID == "" { + return nil, errors.New("parameter processID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{processId}", url.PathEscape(processID)) + if baseAddress == "" { + return nil, errors.New("parameter baseAddress cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{baseAddress}", url.PathEscape(baseAddress)) + if instanceID == "" { + return nil, errors.New("parameter instanceID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getInstanceProcessModuleHandleResponse handles the GetInstanceProcessModule response. +func (client *WebAppsClient) getInstanceProcessModuleHandleResponse(resp *http.Response) (WebAppsGetInstanceProcessModuleResponse, error) { + result := WebAppsGetInstanceProcessModuleResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.ProcessModuleInfo); err != nil { + return WebAppsGetInstanceProcessModuleResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getInstanceProcessModuleHandleError handles the GetInstanceProcessModule error response. +func (client *WebAppsClient) getInstanceProcessModuleHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + switch resp.StatusCode { + case http.StatusNotFound: + if len(body) == 0 { + return runtime.NewResponseError(errors.New(resp.Status), resp) + } + return runtime.NewResponseError(errors.New(string(body)), resp) + default: + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) + } +} + +// GetInstanceProcessModuleSlot - Description for Get process information by its ID for a specific scaled-out instance in a web site. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) GetInstanceProcessModuleSlot(ctx context.Context, resourceGroupName string, name string, processID string, baseAddress string, slot string, instanceID string, options *WebAppsGetInstanceProcessModuleSlotOptions) (WebAppsGetInstanceProcessModuleSlotResponse, error) { + req, err := client.getInstanceProcessModuleSlotCreateRequest(ctx, resourceGroupName, name, processID, baseAddress, slot, instanceID, options) + if err != nil { + return WebAppsGetInstanceProcessModuleSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsGetInstanceProcessModuleSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsGetInstanceProcessModuleSlotResponse{}, client.getInstanceProcessModuleSlotHandleError(resp) + } + return client.getInstanceProcessModuleSlotHandleResponse(resp) +} + +// getInstanceProcessModuleSlotCreateRequest creates the GetInstanceProcessModuleSlot request. +func (client *WebAppsClient) getInstanceProcessModuleSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, processID string, baseAddress string, slot string, instanceID string, options *WebAppsGetInstanceProcessModuleSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}/modules/{baseAddress}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if processID == "" { + return nil, errors.New("parameter processID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{processId}", url.PathEscape(processID)) + if baseAddress == "" { + return nil, errors.New("parameter baseAddress cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{baseAddress}", url.PathEscape(baseAddress)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if instanceID == "" { + return nil, errors.New("parameter instanceID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getInstanceProcessModuleSlotHandleResponse handles the GetInstanceProcessModuleSlot response. +func (client *WebAppsClient) getInstanceProcessModuleSlotHandleResponse(resp *http.Response) (WebAppsGetInstanceProcessModuleSlotResponse, error) { + result := WebAppsGetInstanceProcessModuleSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.ProcessModuleInfo); err != nil { + return WebAppsGetInstanceProcessModuleSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getInstanceProcessModuleSlotHandleError handles the GetInstanceProcessModuleSlot error response. +func (client *WebAppsClient) getInstanceProcessModuleSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + switch resp.StatusCode { + case http.StatusNotFound: + if len(body) == 0 { + return runtime.NewResponseError(errors.New(resp.Status), resp) + } + return runtime.NewResponseError(errors.New(string(body)), resp) + default: + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) + } +} + +// GetInstanceProcessSlot - Description for Get process information by its ID for a specific scaled-out instance in a web site. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) GetInstanceProcessSlot(ctx context.Context, resourceGroupName string, name string, processID string, slot string, instanceID string, options *WebAppsGetInstanceProcessSlotOptions) (WebAppsGetInstanceProcessSlotResponse, error) { + req, err := client.getInstanceProcessSlotCreateRequest(ctx, resourceGroupName, name, processID, slot, instanceID, options) + if err != nil { + return WebAppsGetInstanceProcessSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsGetInstanceProcessSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsGetInstanceProcessSlotResponse{}, client.getInstanceProcessSlotHandleError(resp) + } + return client.getInstanceProcessSlotHandleResponse(resp) +} + +// getInstanceProcessSlotCreateRequest creates the GetInstanceProcessSlot request. +func (client *WebAppsClient) getInstanceProcessSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, processID string, slot string, instanceID string, options *WebAppsGetInstanceProcessSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if processID == "" { + return nil, errors.New("parameter processID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{processId}", url.PathEscape(processID)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if instanceID == "" { + return nil, errors.New("parameter instanceID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getInstanceProcessSlotHandleResponse handles the GetInstanceProcessSlot response. +func (client *WebAppsClient) getInstanceProcessSlotHandleResponse(resp *http.Response) (WebAppsGetInstanceProcessSlotResponse, error) { + result := WebAppsGetInstanceProcessSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.ProcessInfo); err != nil { + return WebAppsGetInstanceProcessSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getInstanceProcessSlotHandleError handles the GetInstanceProcessSlot error response. +func (client *WebAppsClient) getInstanceProcessSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + switch resp.StatusCode { + case http.StatusNotFound: + if len(body) == 0 { + return runtime.NewResponseError(errors.New(resp.Status), resp) + } + return runtime.NewResponseError(errors.New(string(body)), resp) + default: + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) + } +} + +// GetMSDeployLog - Description for Get the MSDeploy Log for the last MSDeploy operation. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) GetMSDeployLog(ctx context.Context, resourceGroupName string, name string, options *WebAppsGetMSDeployLogOptions) (WebAppsGetMSDeployLogResponse, error) { + req, err := client.getMSDeployLogCreateRequest(ctx, resourceGroupName, name, options) + if err != nil { + return WebAppsGetMSDeployLogResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsGetMSDeployLogResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsGetMSDeployLogResponse{}, client.getMSDeployLogHandleError(resp) + } + return client.getMSDeployLogHandleResponse(resp) +} + +// getMSDeployLogCreateRequest creates the GetMSDeployLog request. +func (client *WebAppsClient) getMSDeployLogCreateRequest(ctx context.Context, resourceGroupName string, name string, options *WebAppsGetMSDeployLogOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/extensions/MSDeploy/log" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getMSDeployLogHandleResponse handles the GetMSDeployLog response. +func (client *WebAppsClient) getMSDeployLogHandleResponse(resp *http.Response) (WebAppsGetMSDeployLogResponse, error) { + result := WebAppsGetMSDeployLogResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.MSDeployLog); err != nil { + return WebAppsGetMSDeployLogResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getMSDeployLogHandleError handles the GetMSDeployLog error response. +func (client *WebAppsClient) getMSDeployLogHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + switch resp.StatusCode { + case http.StatusNotFound: + if len(body) == 0 { + return runtime.NewResponseError(errors.New(resp.Status), resp) + } + return runtime.NewResponseError(errors.New(string(body)), resp) + default: + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) + } +} + +// GetMSDeployLogSlot - Description for Get the MSDeploy Log for the last MSDeploy operation. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) GetMSDeployLogSlot(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsGetMSDeployLogSlotOptions) (WebAppsGetMSDeployLogSlotResponse, error) { + req, err := client.getMSDeployLogSlotCreateRequest(ctx, resourceGroupName, name, slot, options) + if err != nil { + return WebAppsGetMSDeployLogSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsGetMSDeployLogSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsGetMSDeployLogSlotResponse{}, client.getMSDeployLogSlotHandleError(resp) + } + return client.getMSDeployLogSlotHandleResponse(resp) +} + +// getMSDeployLogSlotCreateRequest creates the GetMSDeployLogSlot request. +func (client *WebAppsClient) getMSDeployLogSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsGetMSDeployLogSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/extensions/MSDeploy/log" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getMSDeployLogSlotHandleResponse handles the GetMSDeployLogSlot response. +func (client *WebAppsClient) getMSDeployLogSlotHandleResponse(resp *http.Response) (WebAppsGetMSDeployLogSlotResponse, error) { + result := WebAppsGetMSDeployLogSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.MSDeployLog); err != nil { + return WebAppsGetMSDeployLogSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getMSDeployLogSlotHandleError handles the GetMSDeployLogSlot error response. +func (client *WebAppsClient) getMSDeployLogSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + switch resp.StatusCode { + case http.StatusNotFound: + if len(body) == 0 { + return runtime.NewResponseError(errors.New(resp.Status), resp) + } + return runtime.NewResponseError(errors.New(string(body)), resp) + default: + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) + } +} + +// GetMSDeployStatus - Description for Get the status of the last MSDeploy operation. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) GetMSDeployStatus(ctx context.Context, resourceGroupName string, name string, options *WebAppsGetMSDeployStatusOptions) (WebAppsGetMSDeployStatusResponse, error) { + req, err := client.getMSDeployStatusCreateRequest(ctx, resourceGroupName, name, options) + if err != nil { + return WebAppsGetMSDeployStatusResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsGetMSDeployStatusResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsGetMSDeployStatusResponse{}, client.getMSDeployStatusHandleError(resp) + } + return client.getMSDeployStatusHandleResponse(resp) +} + +// getMSDeployStatusCreateRequest creates the GetMSDeployStatus request. +func (client *WebAppsClient) getMSDeployStatusCreateRequest(ctx context.Context, resourceGroupName string, name string, options *WebAppsGetMSDeployStatusOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/extensions/MSDeploy" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getMSDeployStatusHandleResponse handles the GetMSDeployStatus response. +func (client *WebAppsClient) getMSDeployStatusHandleResponse(resp *http.Response) (WebAppsGetMSDeployStatusResponse, error) { + result := WebAppsGetMSDeployStatusResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.MSDeployStatus); err != nil { + return WebAppsGetMSDeployStatusResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getMSDeployStatusHandleError handles the GetMSDeployStatus error response. +func (client *WebAppsClient) getMSDeployStatusHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetMSDeployStatusSlot - Description for Get the status of the last MSDeploy operation. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) GetMSDeployStatusSlot(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsGetMSDeployStatusSlotOptions) (WebAppsGetMSDeployStatusSlotResponse, error) { + req, err := client.getMSDeployStatusSlotCreateRequest(ctx, resourceGroupName, name, slot, options) + if err != nil { + return WebAppsGetMSDeployStatusSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsGetMSDeployStatusSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsGetMSDeployStatusSlotResponse{}, client.getMSDeployStatusSlotHandleError(resp) + } + return client.getMSDeployStatusSlotHandleResponse(resp) +} + +// getMSDeployStatusSlotCreateRequest creates the GetMSDeployStatusSlot request. +func (client *WebAppsClient) getMSDeployStatusSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsGetMSDeployStatusSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/extensions/MSDeploy" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getMSDeployStatusSlotHandleResponse handles the GetMSDeployStatusSlot response. +func (client *WebAppsClient) getMSDeployStatusSlotHandleResponse(resp *http.Response) (WebAppsGetMSDeployStatusSlotResponse, error) { + result := WebAppsGetMSDeployStatusSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.MSDeployStatus); err != nil { + return WebAppsGetMSDeployStatusSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getMSDeployStatusSlotHandleError handles the GetMSDeployStatusSlot error response. +func (client *WebAppsClient) getMSDeployStatusSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetMigrateMySQLStatus - Description for Returns the status of MySql in app migration, if one is active, and whether or not MySql in app is enabled +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) GetMigrateMySQLStatus(ctx context.Context, resourceGroupName string, name string, options *WebAppsGetMigrateMySQLStatusOptions) (WebAppsGetMigrateMySQLStatusResponse, error) { + req, err := client.getMigrateMySQLStatusCreateRequest(ctx, resourceGroupName, name, options) + if err != nil { + return WebAppsGetMigrateMySQLStatusResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsGetMigrateMySQLStatusResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsGetMigrateMySQLStatusResponse{}, client.getMigrateMySQLStatusHandleError(resp) + } + return client.getMigrateMySQLStatusHandleResponse(resp) +} + +// getMigrateMySQLStatusCreateRequest creates the GetMigrateMySQLStatus request. +func (client *WebAppsClient) getMigrateMySQLStatusCreateRequest(ctx context.Context, resourceGroupName string, name string, options *WebAppsGetMigrateMySQLStatusOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/migratemysql/status" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getMigrateMySQLStatusHandleResponse handles the GetMigrateMySQLStatus response. +func (client *WebAppsClient) getMigrateMySQLStatusHandleResponse(resp *http.Response) (WebAppsGetMigrateMySQLStatusResponse, error) { + result := WebAppsGetMigrateMySQLStatusResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.MigrateMySQLStatus); err != nil { + return WebAppsGetMigrateMySQLStatusResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getMigrateMySQLStatusHandleError handles the GetMigrateMySQLStatus error response. +func (client *WebAppsClient) getMigrateMySQLStatusHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetMigrateMySQLStatusSlot - Description for Returns the status of MySql in app migration, if one is active, and whether or not MySql in app is enabled +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) GetMigrateMySQLStatusSlot(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsGetMigrateMySQLStatusSlotOptions) (WebAppsGetMigrateMySQLStatusSlotResponse, error) { + req, err := client.getMigrateMySQLStatusSlotCreateRequest(ctx, resourceGroupName, name, slot, options) + if err != nil { + return WebAppsGetMigrateMySQLStatusSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsGetMigrateMySQLStatusSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsGetMigrateMySQLStatusSlotResponse{}, client.getMigrateMySQLStatusSlotHandleError(resp) + } + return client.getMigrateMySQLStatusSlotHandleResponse(resp) +} + +// getMigrateMySQLStatusSlotCreateRequest creates the GetMigrateMySQLStatusSlot request. +func (client *WebAppsClient) getMigrateMySQLStatusSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsGetMigrateMySQLStatusSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/migratemysql/status" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getMigrateMySQLStatusSlotHandleResponse handles the GetMigrateMySQLStatusSlot response. +func (client *WebAppsClient) getMigrateMySQLStatusSlotHandleResponse(resp *http.Response) (WebAppsGetMigrateMySQLStatusSlotResponse, error) { + result := WebAppsGetMigrateMySQLStatusSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.MigrateMySQLStatus); err != nil { + return WebAppsGetMigrateMySQLStatusSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getMigrateMySQLStatusSlotHandleError handles the GetMigrateMySQLStatusSlot error response. +func (client *WebAppsClient) getMigrateMySQLStatusSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetNetworkTraceOperation - Description for Gets a named operation for a network trace capturing (or deployment slot, if specified). +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) GetNetworkTraceOperation(ctx context.Context, resourceGroupName string, name string, operationID string, options *WebAppsGetNetworkTraceOperationOptions) (WebAppsGetNetworkTraceOperationResponse, error) { + req, err := client.getNetworkTraceOperationCreateRequest(ctx, resourceGroupName, name, operationID, options) + if err != nil { + return WebAppsGetNetworkTraceOperationResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsGetNetworkTraceOperationResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return WebAppsGetNetworkTraceOperationResponse{}, client.getNetworkTraceOperationHandleError(resp) + } + return client.getNetworkTraceOperationHandleResponse(resp) +} + +// getNetworkTraceOperationCreateRequest creates the GetNetworkTraceOperation request. +func (client *WebAppsClient) getNetworkTraceOperationCreateRequest(ctx context.Context, resourceGroupName string, name string, operationID string, options *WebAppsGetNetworkTraceOperationOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTrace/operationresults/{operationId}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if operationID == "" { + return nil, errors.New("parameter operationID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{operationId}", url.PathEscape(operationID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getNetworkTraceOperationHandleResponse handles the GetNetworkTraceOperation response. +func (client *WebAppsClient) getNetworkTraceOperationHandleResponse(resp *http.Response) (WebAppsGetNetworkTraceOperationResponse, error) { + result := WebAppsGetNetworkTraceOperationResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.NetworkTraceArray); err != nil { + return WebAppsGetNetworkTraceOperationResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getNetworkTraceOperationHandleError handles the GetNetworkTraceOperation error response. +func (client *WebAppsClient) getNetworkTraceOperationHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetNetworkTraceOperationSlot - Description for Gets a named operation for a network trace capturing (or deployment slot, if specified). +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) GetNetworkTraceOperationSlot(ctx context.Context, resourceGroupName string, name string, operationID string, slot string, options *WebAppsGetNetworkTraceOperationSlotOptions) (WebAppsGetNetworkTraceOperationSlotResponse, error) { + req, err := client.getNetworkTraceOperationSlotCreateRequest(ctx, resourceGroupName, name, operationID, slot, options) + if err != nil { + return WebAppsGetNetworkTraceOperationSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsGetNetworkTraceOperationSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return WebAppsGetNetworkTraceOperationSlotResponse{}, client.getNetworkTraceOperationSlotHandleError(resp) + } + return client.getNetworkTraceOperationSlotHandleResponse(resp) +} + +// getNetworkTraceOperationSlotCreateRequest creates the GetNetworkTraceOperationSlot request. +func (client *WebAppsClient) getNetworkTraceOperationSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, operationID string, slot string, options *WebAppsGetNetworkTraceOperationSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTrace/operationresults/{operationId}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if operationID == "" { + return nil, errors.New("parameter operationID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{operationId}", url.PathEscape(operationID)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getNetworkTraceOperationSlotHandleResponse handles the GetNetworkTraceOperationSlot response. +func (client *WebAppsClient) getNetworkTraceOperationSlotHandleResponse(resp *http.Response) (WebAppsGetNetworkTraceOperationSlotResponse, error) { + result := WebAppsGetNetworkTraceOperationSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.NetworkTraceArray); err != nil { + return WebAppsGetNetworkTraceOperationSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getNetworkTraceOperationSlotHandleError handles the GetNetworkTraceOperationSlot error response. +func (client *WebAppsClient) getNetworkTraceOperationSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetNetworkTraceOperationSlotV2 - Description for Gets a named operation for a network trace capturing (or deployment slot, if specified). +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) GetNetworkTraceOperationSlotV2(ctx context.Context, resourceGroupName string, name string, operationID string, slot string, options *WebAppsGetNetworkTraceOperationSlotV2Options) (WebAppsGetNetworkTraceOperationSlotV2Response, error) { + req, err := client.getNetworkTraceOperationSlotV2CreateRequest(ctx, resourceGroupName, name, operationID, slot, options) + if err != nil { + return WebAppsGetNetworkTraceOperationSlotV2Response{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsGetNetworkTraceOperationSlotV2Response{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return WebAppsGetNetworkTraceOperationSlotV2Response{}, client.getNetworkTraceOperationSlotV2HandleError(resp) + } + return client.getNetworkTraceOperationSlotV2HandleResponse(resp) +} + +// getNetworkTraceOperationSlotV2CreateRequest creates the GetNetworkTraceOperationSlotV2 request. +func (client *WebAppsClient) getNetworkTraceOperationSlotV2CreateRequest(ctx context.Context, resourceGroupName string, name string, operationID string, slot string, options *WebAppsGetNetworkTraceOperationSlotV2Options) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTraces/current/operationresults/{operationId}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if operationID == "" { + return nil, errors.New("parameter operationID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{operationId}", url.PathEscape(operationID)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getNetworkTraceOperationSlotV2HandleResponse handles the GetNetworkTraceOperationSlotV2 response. +func (client *WebAppsClient) getNetworkTraceOperationSlotV2HandleResponse(resp *http.Response) (WebAppsGetNetworkTraceOperationSlotV2Response, error) { + result := WebAppsGetNetworkTraceOperationSlotV2Response{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.NetworkTraceArray); err != nil { + return WebAppsGetNetworkTraceOperationSlotV2Response{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getNetworkTraceOperationSlotV2HandleError handles the GetNetworkTraceOperationSlotV2 error response. +func (client *WebAppsClient) getNetworkTraceOperationSlotV2HandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetNetworkTraceOperationV2 - Description for Gets a named operation for a network trace capturing (or deployment slot, if specified). +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) GetNetworkTraceOperationV2(ctx context.Context, resourceGroupName string, name string, operationID string, options *WebAppsGetNetworkTraceOperationV2Options) (WebAppsGetNetworkTraceOperationV2Response, error) { + req, err := client.getNetworkTraceOperationV2CreateRequest(ctx, resourceGroupName, name, operationID, options) + if err != nil { + return WebAppsGetNetworkTraceOperationV2Response{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsGetNetworkTraceOperationV2Response{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return WebAppsGetNetworkTraceOperationV2Response{}, client.getNetworkTraceOperationV2HandleError(resp) + } + return client.getNetworkTraceOperationV2HandleResponse(resp) +} + +// getNetworkTraceOperationV2CreateRequest creates the GetNetworkTraceOperationV2 request. +func (client *WebAppsClient) getNetworkTraceOperationV2CreateRequest(ctx context.Context, resourceGroupName string, name string, operationID string, options *WebAppsGetNetworkTraceOperationV2Options) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTraces/current/operationresults/{operationId}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if operationID == "" { + return nil, errors.New("parameter operationID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{operationId}", url.PathEscape(operationID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getNetworkTraceOperationV2HandleResponse handles the GetNetworkTraceOperationV2 response. +func (client *WebAppsClient) getNetworkTraceOperationV2HandleResponse(resp *http.Response) (WebAppsGetNetworkTraceOperationV2Response, error) { + result := WebAppsGetNetworkTraceOperationV2Response{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.NetworkTraceArray); err != nil { + return WebAppsGetNetworkTraceOperationV2Response{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getNetworkTraceOperationV2HandleError handles the GetNetworkTraceOperationV2 error response. +func (client *WebAppsClient) getNetworkTraceOperationV2HandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetNetworkTraces - Description for Gets a named operation for a network trace capturing (or deployment slot, if specified). +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) GetNetworkTraces(ctx context.Context, resourceGroupName string, name string, operationID string, options *WebAppsGetNetworkTracesOptions) (WebAppsGetNetworkTracesResponse, error) { + req, err := client.getNetworkTracesCreateRequest(ctx, resourceGroupName, name, operationID, options) + if err != nil { + return WebAppsGetNetworkTracesResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsGetNetworkTracesResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsGetNetworkTracesResponse{}, client.getNetworkTracesHandleError(resp) + } + return client.getNetworkTracesHandleResponse(resp) +} + +// getNetworkTracesCreateRequest creates the GetNetworkTraces request. +func (client *WebAppsClient) getNetworkTracesCreateRequest(ctx context.Context, resourceGroupName string, name string, operationID string, options *WebAppsGetNetworkTracesOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTrace/{operationId}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if operationID == "" { + return nil, errors.New("parameter operationID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{operationId}", url.PathEscape(operationID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getNetworkTracesHandleResponse handles the GetNetworkTraces response. +func (client *WebAppsClient) getNetworkTracesHandleResponse(resp *http.Response) (WebAppsGetNetworkTracesResponse, error) { + result := WebAppsGetNetworkTracesResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.NetworkTraceArray); err != nil { + return WebAppsGetNetworkTracesResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getNetworkTracesHandleError handles the GetNetworkTraces error response. +func (client *WebAppsClient) getNetworkTracesHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetNetworkTracesSlot - Description for Gets a named operation for a network trace capturing (or deployment slot, if specified). +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) GetNetworkTracesSlot(ctx context.Context, resourceGroupName string, name string, operationID string, slot string, options *WebAppsGetNetworkTracesSlotOptions) (WebAppsGetNetworkTracesSlotResponse, error) { + req, err := client.getNetworkTracesSlotCreateRequest(ctx, resourceGroupName, name, operationID, slot, options) + if err != nil { + return WebAppsGetNetworkTracesSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsGetNetworkTracesSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsGetNetworkTracesSlotResponse{}, client.getNetworkTracesSlotHandleError(resp) + } + return client.getNetworkTracesSlotHandleResponse(resp) +} + +// getNetworkTracesSlotCreateRequest creates the GetNetworkTracesSlot request. +func (client *WebAppsClient) getNetworkTracesSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, operationID string, slot string, options *WebAppsGetNetworkTracesSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTrace/{operationId}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if operationID == "" { + return nil, errors.New("parameter operationID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{operationId}", url.PathEscape(operationID)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getNetworkTracesSlotHandleResponse handles the GetNetworkTracesSlot response. +func (client *WebAppsClient) getNetworkTracesSlotHandleResponse(resp *http.Response) (WebAppsGetNetworkTracesSlotResponse, error) { + result := WebAppsGetNetworkTracesSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.NetworkTraceArray); err != nil { + return WebAppsGetNetworkTracesSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getNetworkTracesSlotHandleError handles the GetNetworkTracesSlot error response. +func (client *WebAppsClient) getNetworkTracesSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetNetworkTracesSlotV2 - Description for Gets a named operation for a network trace capturing (or deployment slot, if specified). +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) GetNetworkTracesSlotV2(ctx context.Context, resourceGroupName string, name string, operationID string, slot string, options *WebAppsGetNetworkTracesSlotV2Options) (WebAppsGetNetworkTracesSlotV2Response, error) { + req, err := client.getNetworkTracesSlotV2CreateRequest(ctx, resourceGroupName, name, operationID, slot, options) + if err != nil { + return WebAppsGetNetworkTracesSlotV2Response{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsGetNetworkTracesSlotV2Response{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsGetNetworkTracesSlotV2Response{}, client.getNetworkTracesSlotV2HandleError(resp) + } + return client.getNetworkTracesSlotV2HandleResponse(resp) +} + +// getNetworkTracesSlotV2CreateRequest creates the GetNetworkTracesSlotV2 request. +func (client *WebAppsClient) getNetworkTracesSlotV2CreateRequest(ctx context.Context, resourceGroupName string, name string, operationID string, slot string, options *WebAppsGetNetworkTracesSlotV2Options) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTraces/{operationId}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if operationID == "" { + return nil, errors.New("parameter operationID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{operationId}", url.PathEscape(operationID)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getNetworkTracesSlotV2HandleResponse handles the GetNetworkTracesSlotV2 response. +func (client *WebAppsClient) getNetworkTracesSlotV2HandleResponse(resp *http.Response) (WebAppsGetNetworkTracesSlotV2Response, error) { + result := WebAppsGetNetworkTracesSlotV2Response{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.NetworkTraceArray); err != nil { + return WebAppsGetNetworkTracesSlotV2Response{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getNetworkTracesSlotV2HandleError handles the GetNetworkTracesSlotV2 error response. +func (client *WebAppsClient) getNetworkTracesSlotV2HandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetNetworkTracesV2 - Description for Gets a named operation for a network trace capturing (or deployment slot, if specified). +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) GetNetworkTracesV2(ctx context.Context, resourceGroupName string, name string, operationID string, options *WebAppsGetNetworkTracesV2Options) (WebAppsGetNetworkTracesV2Response, error) { + req, err := client.getNetworkTracesV2CreateRequest(ctx, resourceGroupName, name, operationID, options) + if err != nil { + return WebAppsGetNetworkTracesV2Response{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsGetNetworkTracesV2Response{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsGetNetworkTracesV2Response{}, client.getNetworkTracesV2HandleError(resp) + } + return client.getNetworkTracesV2HandleResponse(resp) +} + +// getNetworkTracesV2CreateRequest creates the GetNetworkTracesV2 request. +func (client *WebAppsClient) getNetworkTracesV2CreateRequest(ctx context.Context, resourceGroupName string, name string, operationID string, options *WebAppsGetNetworkTracesV2Options) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTraces/{operationId}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if operationID == "" { + return nil, errors.New("parameter operationID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{operationId}", url.PathEscape(operationID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getNetworkTracesV2HandleResponse handles the GetNetworkTracesV2 response. +func (client *WebAppsClient) getNetworkTracesV2HandleResponse(resp *http.Response) (WebAppsGetNetworkTracesV2Response, error) { + result := WebAppsGetNetworkTracesV2Response{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.NetworkTraceArray); err != nil { + return WebAppsGetNetworkTracesV2Response{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getNetworkTracesV2HandleError handles the GetNetworkTracesV2 error response. +func (client *WebAppsClient) getNetworkTracesV2HandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetPremierAddOn - Description for Gets a named add-on of an app. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) GetPremierAddOn(ctx context.Context, resourceGroupName string, name string, premierAddOnName string, options *WebAppsGetPremierAddOnOptions) (WebAppsGetPremierAddOnResponse, error) { + req, err := client.getPremierAddOnCreateRequest(ctx, resourceGroupName, name, premierAddOnName, options) + if err != nil { + return WebAppsGetPremierAddOnResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsGetPremierAddOnResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsGetPremierAddOnResponse{}, client.getPremierAddOnHandleError(resp) + } + return client.getPremierAddOnHandleResponse(resp) +} + +// getPremierAddOnCreateRequest creates the GetPremierAddOn request. +func (client *WebAppsClient) getPremierAddOnCreateRequest(ctx context.Context, resourceGroupName string, name string, premierAddOnName string, options *WebAppsGetPremierAddOnOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/premieraddons/{premierAddOnName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if premierAddOnName == "" { + return nil, errors.New("parameter premierAddOnName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{premierAddOnName}", url.PathEscape(premierAddOnName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getPremierAddOnHandleResponse handles the GetPremierAddOn response. +func (client *WebAppsClient) getPremierAddOnHandleResponse(resp *http.Response) (WebAppsGetPremierAddOnResponse, error) { + result := WebAppsGetPremierAddOnResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.PremierAddOn); err != nil { + return WebAppsGetPremierAddOnResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getPremierAddOnHandleError handles the GetPremierAddOn error response. +func (client *WebAppsClient) getPremierAddOnHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetPremierAddOnSlot - Description for Gets a named add-on of an app. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) GetPremierAddOnSlot(ctx context.Context, resourceGroupName string, name string, premierAddOnName string, slot string, options *WebAppsGetPremierAddOnSlotOptions) (WebAppsGetPremierAddOnSlotResponse, error) { + req, err := client.getPremierAddOnSlotCreateRequest(ctx, resourceGroupName, name, premierAddOnName, slot, options) + if err != nil { + return WebAppsGetPremierAddOnSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsGetPremierAddOnSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsGetPremierAddOnSlotResponse{}, client.getPremierAddOnSlotHandleError(resp) + } + return client.getPremierAddOnSlotHandleResponse(resp) +} + +// getPremierAddOnSlotCreateRequest creates the GetPremierAddOnSlot request. +func (client *WebAppsClient) getPremierAddOnSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, premierAddOnName string, slot string, options *WebAppsGetPremierAddOnSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/premieraddons/{premierAddOnName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if premierAddOnName == "" { + return nil, errors.New("parameter premierAddOnName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{premierAddOnName}", url.PathEscape(premierAddOnName)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getPremierAddOnSlotHandleResponse handles the GetPremierAddOnSlot response. +func (client *WebAppsClient) getPremierAddOnSlotHandleResponse(resp *http.Response) (WebAppsGetPremierAddOnSlotResponse, error) { + result := WebAppsGetPremierAddOnSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.PremierAddOn); err != nil { + return WebAppsGetPremierAddOnSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getPremierAddOnSlotHandleError handles the GetPremierAddOnSlot error response. +func (client *WebAppsClient) getPremierAddOnSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetPrivateAccess - Description for Gets data around private site access enablement and authorized Virtual Networks that can access the site. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) GetPrivateAccess(ctx context.Context, resourceGroupName string, name string, options *WebAppsGetPrivateAccessOptions) (WebAppsGetPrivateAccessResponse, error) { + req, err := client.getPrivateAccessCreateRequest(ctx, resourceGroupName, name, options) + if err != nil { + return WebAppsGetPrivateAccessResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsGetPrivateAccessResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsGetPrivateAccessResponse{}, client.getPrivateAccessHandleError(resp) + } + return client.getPrivateAccessHandleResponse(resp) +} + +// getPrivateAccessCreateRequest creates the GetPrivateAccess request. +func (client *WebAppsClient) getPrivateAccessCreateRequest(ctx context.Context, resourceGroupName string, name string, options *WebAppsGetPrivateAccessOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateAccess/virtualNetworks" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getPrivateAccessHandleResponse handles the GetPrivateAccess response. +func (client *WebAppsClient) getPrivateAccessHandleResponse(resp *http.Response) (WebAppsGetPrivateAccessResponse, error) { + result := WebAppsGetPrivateAccessResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.PrivateAccess); err != nil { + return WebAppsGetPrivateAccessResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getPrivateAccessHandleError handles the GetPrivateAccess error response. +func (client *WebAppsClient) getPrivateAccessHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetPrivateAccessSlot - Description for Gets data around private site access enablement and authorized Virtual Networks that can access the site. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) GetPrivateAccessSlot(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsGetPrivateAccessSlotOptions) (WebAppsGetPrivateAccessSlotResponse, error) { + req, err := client.getPrivateAccessSlotCreateRequest(ctx, resourceGroupName, name, slot, options) + if err != nil { + return WebAppsGetPrivateAccessSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsGetPrivateAccessSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsGetPrivateAccessSlotResponse{}, client.getPrivateAccessSlotHandleError(resp) + } + return client.getPrivateAccessSlotHandleResponse(resp) +} + +// getPrivateAccessSlotCreateRequest creates the GetPrivateAccessSlot request. +func (client *WebAppsClient) getPrivateAccessSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsGetPrivateAccessSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/privateAccess/virtualNetworks" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getPrivateAccessSlotHandleResponse handles the GetPrivateAccessSlot response. +func (client *WebAppsClient) getPrivateAccessSlotHandleResponse(resp *http.Response) (WebAppsGetPrivateAccessSlotResponse, error) { + result := WebAppsGetPrivateAccessSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.PrivateAccess); err != nil { + return WebAppsGetPrivateAccessSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getPrivateAccessSlotHandleError handles the GetPrivateAccessSlot error response. +func (client *WebAppsClient) getPrivateAccessSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetPrivateEndpointConnection - Description for Gets a private endpoint connection +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) GetPrivateEndpointConnection(ctx context.Context, resourceGroupName string, name string, privateEndpointConnectionName string, options *WebAppsGetPrivateEndpointConnectionOptions) (WebAppsGetPrivateEndpointConnectionResponse, error) { + req, err := client.getPrivateEndpointConnectionCreateRequest(ctx, resourceGroupName, name, privateEndpointConnectionName, options) + if err != nil { + return WebAppsGetPrivateEndpointConnectionResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsGetPrivateEndpointConnectionResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsGetPrivateEndpointConnectionResponse{}, client.getPrivateEndpointConnectionHandleError(resp) + } + return client.getPrivateEndpointConnectionHandleResponse(resp) +} + +// getPrivateEndpointConnectionCreateRequest creates the GetPrivateEndpointConnection request. +func (client *WebAppsClient) getPrivateEndpointConnectionCreateRequest(ctx context.Context, resourceGroupName string, name string, privateEndpointConnectionName string, options *WebAppsGetPrivateEndpointConnectionOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateEndpointConnections/{privateEndpointConnectionName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if privateEndpointConnectionName == "" { + return nil, errors.New("parameter privateEndpointConnectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{privateEndpointConnectionName}", url.PathEscape(privateEndpointConnectionName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getPrivateEndpointConnectionHandleResponse handles the GetPrivateEndpointConnection response. +func (client *WebAppsClient) getPrivateEndpointConnectionHandleResponse(resp *http.Response) (WebAppsGetPrivateEndpointConnectionResponse, error) { + result := WebAppsGetPrivateEndpointConnectionResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.RemotePrivateEndpointConnectionARMResource); err != nil { + return WebAppsGetPrivateEndpointConnectionResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getPrivateEndpointConnectionHandleError handles the GetPrivateEndpointConnection error response. +func (client *WebAppsClient) getPrivateEndpointConnectionHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetPrivateEndpointConnectionList - Description for Gets the list of private endpoint connections associated with a site +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) GetPrivateEndpointConnectionList(resourceGroupName string, name string, options *WebAppsGetPrivateEndpointConnectionListOptions) *WebAppsGetPrivateEndpointConnectionListPager { + return &WebAppsGetPrivateEndpointConnectionListPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.getPrivateEndpointConnectionListCreateRequest(ctx, resourceGroupName, name, options) + }, + advancer: func(ctx context.Context, resp WebAppsGetPrivateEndpointConnectionListResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.PrivateEndpointConnectionCollection.NextLink) + }, + } +} + +// getPrivateEndpointConnectionListCreateRequest creates the GetPrivateEndpointConnectionList request. +func (client *WebAppsClient) getPrivateEndpointConnectionListCreateRequest(ctx context.Context, resourceGroupName string, name string, options *WebAppsGetPrivateEndpointConnectionListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateEndpointConnections" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getPrivateEndpointConnectionListHandleResponse handles the GetPrivateEndpointConnectionList response. +func (client *WebAppsClient) getPrivateEndpointConnectionListHandleResponse(resp *http.Response) (WebAppsGetPrivateEndpointConnectionListResponse, error) { + result := WebAppsGetPrivateEndpointConnectionListResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.PrivateEndpointConnectionCollection); err != nil { + return WebAppsGetPrivateEndpointConnectionListResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getPrivateEndpointConnectionListHandleError handles the GetPrivateEndpointConnectionList error response. +func (client *WebAppsClient) getPrivateEndpointConnectionListHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetPrivateEndpointConnectionListSlot - Description for Gets the list of private endpoint connections associated with a site +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) GetPrivateEndpointConnectionListSlot(resourceGroupName string, name string, slot string, options *WebAppsGetPrivateEndpointConnectionListSlotOptions) *WebAppsGetPrivateEndpointConnectionListSlotPager { + return &WebAppsGetPrivateEndpointConnectionListSlotPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.getPrivateEndpointConnectionListSlotCreateRequest(ctx, resourceGroupName, name, slot, options) + }, + advancer: func(ctx context.Context, resp WebAppsGetPrivateEndpointConnectionListSlotResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.PrivateEndpointConnectionCollection.NextLink) + }, + } +} + +// getPrivateEndpointConnectionListSlotCreateRequest creates the GetPrivateEndpointConnectionListSlot request. +func (client *WebAppsClient) getPrivateEndpointConnectionListSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsGetPrivateEndpointConnectionListSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/privateEndpointConnections" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getPrivateEndpointConnectionListSlotHandleResponse handles the GetPrivateEndpointConnectionListSlot response. +func (client *WebAppsClient) getPrivateEndpointConnectionListSlotHandleResponse(resp *http.Response) (WebAppsGetPrivateEndpointConnectionListSlotResponse, error) { + result := WebAppsGetPrivateEndpointConnectionListSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.PrivateEndpointConnectionCollection); err != nil { + return WebAppsGetPrivateEndpointConnectionListSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getPrivateEndpointConnectionListSlotHandleError handles the GetPrivateEndpointConnectionListSlot error response. +func (client *WebAppsClient) getPrivateEndpointConnectionListSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetPrivateEndpointConnectionSlot - Description for Gets a private endpoint connection +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) GetPrivateEndpointConnectionSlot(ctx context.Context, resourceGroupName string, name string, privateEndpointConnectionName string, slot string, options *WebAppsGetPrivateEndpointConnectionSlotOptions) (WebAppsGetPrivateEndpointConnectionSlotResponse, error) { + req, err := client.getPrivateEndpointConnectionSlotCreateRequest(ctx, resourceGroupName, name, privateEndpointConnectionName, slot, options) + if err != nil { + return WebAppsGetPrivateEndpointConnectionSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsGetPrivateEndpointConnectionSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsGetPrivateEndpointConnectionSlotResponse{}, client.getPrivateEndpointConnectionSlotHandleError(resp) + } + return client.getPrivateEndpointConnectionSlotHandleResponse(resp) +} + +// getPrivateEndpointConnectionSlotCreateRequest creates the GetPrivateEndpointConnectionSlot request. +func (client *WebAppsClient) getPrivateEndpointConnectionSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, privateEndpointConnectionName string, slot string, options *WebAppsGetPrivateEndpointConnectionSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/privateEndpointConnections/{privateEndpointConnectionName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if privateEndpointConnectionName == "" { + return nil, errors.New("parameter privateEndpointConnectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{privateEndpointConnectionName}", url.PathEscape(privateEndpointConnectionName)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getPrivateEndpointConnectionSlotHandleResponse handles the GetPrivateEndpointConnectionSlot response. +func (client *WebAppsClient) getPrivateEndpointConnectionSlotHandleResponse(resp *http.Response) (WebAppsGetPrivateEndpointConnectionSlotResponse, error) { + result := WebAppsGetPrivateEndpointConnectionSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.RemotePrivateEndpointConnectionARMResource); err != nil { + return WebAppsGetPrivateEndpointConnectionSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getPrivateEndpointConnectionSlotHandleError handles the GetPrivateEndpointConnectionSlot error response. +func (client *WebAppsClient) getPrivateEndpointConnectionSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetPrivateLinkResources - Description for Gets the private link resources +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) GetPrivateLinkResources(ctx context.Context, resourceGroupName string, name string, options *WebAppsGetPrivateLinkResourcesOptions) (WebAppsGetPrivateLinkResourcesResponse, error) { + req, err := client.getPrivateLinkResourcesCreateRequest(ctx, resourceGroupName, name, options) + if err != nil { + return WebAppsGetPrivateLinkResourcesResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsGetPrivateLinkResourcesResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsGetPrivateLinkResourcesResponse{}, client.getPrivateLinkResourcesHandleError(resp) + } + return client.getPrivateLinkResourcesHandleResponse(resp) +} + +// getPrivateLinkResourcesCreateRequest creates the GetPrivateLinkResources request. +func (client *WebAppsClient) getPrivateLinkResourcesCreateRequest(ctx context.Context, resourceGroupName string, name string, options *WebAppsGetPrivateLinkResourcesOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateLinkResources" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getPrivateLinkResourcesHandleResponse handles the GetPrivateLinkResources response. +func (client *WebAppsClient) getPrivateLinkResourcesHandleResponse(resp *http.Response) (WebAppsGetPrivateLinkResourcesResponse, error) { + result := WebAppsGetPrivateLinkResourcesResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.PrivateLinkResourcesWrapper); err != nil { + return WebAppsGetPrivateLinkResourcesResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getPrivateLinkResourcesHandleError handles the GetPrivateLinkResources error response. +func (client *WebAppsClient) getPrivateLinkResourcesHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetPrivateLinkResourcesSlot - Description for Gets the private link resources +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) GetPrivateLinkResourcesSlot(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsGetPrivateLinkResourcesSlotOptions) (WebAppsGetPrivateLinkResourcesSlotResponse, error) { + req, err := client.getPrivateLinkResourcesSlotCreateRequest(ctx, resourceGroupName, name, slot, options) + if err != nil { + return WebAppsGetPrivateLinkResourcesSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsGetPrivateLinkResourcesSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsGetPrivateLinkResourcesSlotResponse{}, client.getPrivateLinkResourcesSlotHandleError(resp) + } + return client.getPrivateLinkResourcesSlotHandleResponse(resp) +} + +// getPrivateLinkResourcesSlotCreateRequest creates the GetPrivateLinkResourcesSlot request. +func (client *WebAppsClient) getPrivateLinkResourcesSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsGetPrivateLinkResourcesSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/privateLinkResources" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getPrivateLinkResourcesSlotHandleResponse handles the GetPrivateLinkResourcesSlot response. +func (client *WebAppsClient) getPrivateLinkResourcesSlotHandleResponse(resp *http.Response) (WebAppsGetPrivateLinkResourcesSlotResponse, error) { + result := WebAppsGetPrivateLinkResourcesSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.PrivateLinkResourcesWrapper); err != nil { + return WebAppsGetPrivateLinkResourcesSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getPrivateLinkResourcesSlotHandleError handles the GetPrivateLinkResourcesSlot error response. +func (client *WebAppsClient) getPrivateLinkResourcesSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetProcess - Description for Get process information by its ID for a specific scaled-out instance in a web site. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) GetProcess(ctx context.Context, resourceGroupName string, name string, processID string, options *WebAppsGetProcessOptions) (WebAppsGetProcessResponse, error) { + req, err := client.getProcessCreateRequest(ctx, resourceGroupName, name, processID, options) + if err != nil { + return WebAppsGetProcessResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsGetProcessResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsGetProcessResponse{}, client.getProcessHandleError(resp) + } + return client.getProcessHandleResponse(resp) +} + +// getProcessCreateRequest creates the GetProcess request. +func (client *WebAppsClient) getProcessCreateRequest(ctx context.Context, resourceGroupName string, name string, processID string, options *WebAppsGetProcessOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if processID == "" { + return nil, errors.New("parameter processID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{processId}", url.PathEscape(processID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getProcessHandleResponse handles the GetProcess response. +func (client *WebAppsClient) getProcessHandleResponse(resp *http.Response) (WebAppsGetProcessResponse, error) { + result := WebAppsGetProcessResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.ProcessInfo); err != nil { + return WebAppsGetProcessResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getProcessHandleError handles the GetProcess error response. +func (client *WebAppsClient) getProcessHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + switch resp.StatusCode { + case http.StatusNotFound: + if len(body) == 0 { + return runtime.NewResponseError(errors.New(resp.Status), resp) + } + return runtime.NewResponseError(errors.New(string(body)), resp) + default: + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) + } +} + +// GetProcessDump - Description for Get a memory dump of a process by its ID for a specific scaled-out instance in a web site. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) GetProcessDump(ctx context.Context, resourceGroupName string, name string, processID string, options *WebAppsGetProcessDumpOptions) (WebAppsGetProcessDumpResponse, error) { + req, err := client.getProcessDumpCreateRequest(ctx, resourceGroupName, name, processID, options) + if err != nil { + return WebAppsGetProcessDumpResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsGetProcessDumpResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsGetProcessDumpResponse{}, client.getProcessDumpHandleError(resp) + } + return WebAppsGetProcessDumpResponse{RawResponse: resp}, nil +} + +// getProcessDumpCreateRequest creates the GetProcessDump request. +func (client *WebAppsClient) getProcessDumpCreateRequest(ctx context.Context, resourceGroupName string, name string, processID string, options *WebAppsGetProcessDumpOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}/dump" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if processID == "" { + return nil, errors.New("parameter processID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{processId}", url.PathEscape(processID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.SkipBodyDownload() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getProcessDumpHandleError handles the GetProcessDump error response. +func (client *WebAppsClient) getProcessDumpHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + switch resp.StatusCode { + case http.StatusNotFound: + if len(body) == 0 { + return runtime.NewResponseError(errors.New(resp.Status), resp) + } + return runtime.NewResponseError(errors.New(string(body)), resp) + default: + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) + } +} + +// GetProcessDumpSlot - Description for Get a memory dump of a process by its ID for a specific scaled-out instance in a web site. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) GetProcessDumpSlot(ctx context.Context, resourceGroupName string, name string, processID string, slot string, options *WebAppsGetProcessDumpSlotOptions) (WebAppsGetProcessDumpSlotResponse, error) { + req, err := client.getProcessDumpSlotCreateRequest(ctx, resourceGroupName, name, processID, slot, options) + if err != nil { + return WebAppsGetProcessDumpSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsGetProcessDumpSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsGetProcessDumpSlotResponse{}, client.getProcessDumpSlotHandleError(resp) + } + return WebAppsGetProcessDumpSlotResponse{RawResponse: resp}, nil +} + +// getProcessDumpSlotCreateRequest creates the GetProcessDumpSlot request. +func (client *WebAppsClient) getProcessDumpSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, processID string, slot string, options *WebAppsGetProcessDumpSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes/{processId}/dump" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if processID == "" { + return nil, errors.New("parameter processID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{processId}", url.PathEscape(processID)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.SkipBodyDownload() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getProcessDumpSlotHandleError handles the GetProcessDumpSlot error response. +func (client *WebAppsClient) getProcessDumpSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + switch resp.StatusCode { + case http.StatusNotFound: + if len(body) == 0 { + return runtime.NewResponseError(errors.New(resp.Status), resp) + } + return runtime.NewResponseError(errors.New(string(body)), resp) + default: + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) + } +} + +// GetProcessModule - Description for Get process information by its ID for a specific scaled-out instance in a web site. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) GetProcessModule(ctx context.Context, resourceGroupName string, name string, processID string, baseAddress string, options *WebAppsGetProcessModuleOptions) (WebAppsGetProcessModuleResponse, error) { + req, err := client.getProcessModuleCreateRequest(ctx, resourceGroupName, name, processID, baseAddress, options) + if err != nil { + return WebAppsGetProcessModuleResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsGetProcessModuleResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsGetProcessModuleResponse{}, client.getProcessModuleHandleError(resp) + } + return client.getProcessModuleHandleResponse(resp) +} + +// getProcessModuleCreateRequest creates the GetProcessModule request. +func (client *WebAppsClient) getProcessModuleCreateRequest(ctx context.Context, resourceGroupName string, name string, processID string, baseAddress string, options *WebAppsGetProcessModuleOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}/modules/{baseAddress}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if processID == "" { + return nil, errors.New("parameter processID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{processId}", url.PathEscape(processID)) + if baseAddress == "" { + return nil, errors.New("parameter baseAddress cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{baseAddress}", url.PathEscape(baseAddress)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getProcessModuleHandleResponse handles the GetProcessModule response. +func (client *WebAppsClient) getProcessModuleHandleResponse(resp *http.Response) (WebAppsGetProcessModuleResponse, error) { + result := WebAppsGetProcessModuleResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.ProcessModuleInfo); err != nil { + return WebAppsGetProcessModuleResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getProcessModuleHandleError handles the GetProcessModule error response. +func (client *WebAppsClient) getProcessModuleHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + switch resp.StatusCode { + case http.StatusNotFound: + if len(body) == 0 { + return runtime.NewResponseError(errors.New(resp.Status), resp) + } + return runtime.NewResponseError(errors.New(string(body)), resp) + default: + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) + } +} + +// GetProcessModuleSlot - Description for Get process information by its ID for a specific scaled-out instance in a web site. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) GetProcessModuleSlot(ctx context.Context, resourceGroupName string, name string, processID string, baseAddress string, slot string, options *WebAppsGetProcessModuleSlotOptions) (WebAppsGetProcessModuleSlotResponse, error) { + req, err := client.getProcessModuleSlotCreateRequest(ctx, resourceGroupName, name, processID, baseAddress, slot, options) + if err != nil { + return WebAppsGetProcessModuleSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsGetProcessModuleSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsGetProcessModuleSlotResponse{}, client.getProcessModuleSlotHandleError(resp) + } + return client.getProcessModuleSlotHandleResponse(resp) +} + +// getProcessModuleSlotCreateRequest creates the GetProcessModuleSlot request. +func (client *WebAppsClient) getProcessModuleSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, processID string, baseAddress string, slot string, options *WebAppsGetProcessModuleSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes/{processId}/modules/{baseAddress}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if processID == "" { + return nil, errors.New("parameter processID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{processId}", url.PathEscape(processID)) + if baseAddress == "" { + return nil, errors.New("parameter baseAddress cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{baseAddress}", url.PathEscape(baseAddress)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getProcessModuleSlotHandleResponse handles the GetProcessModuleSlot response. +func (client *WebAppsClient) getProcessModuleSlotHandleResponse(resp *http.Response) (WebAppsGetProcessModuleSlotResponse, error) { + result := WebAppsGetProcessModuleSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.ProcessModuleInfo); err != nil { + return WebAppsGetProcessModuleSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getProcessModuleSlotHandleError handles the GetProcessModuleSlot error response. +func (client *WebAppsClient) getProcessModuleSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + switch resp.StatusCode { + case http.StatusNotFound: + if len(body) == 0 { + return runtime.NewResponseError(errors.New(resp.Status), resp) + } + return runtime.NewResponseError(errors.New(string(body)), resp) + default: + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) + } +} + +// GetProcessSlot - Description for Get process information by its ID for a specific scaled-out instance in a web site. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) GetProcessSlot(ctx context.Context, resourceGroupName string, name string, processID string, slot string, options *WebAppsGetProcessSlotOptions) (WebAppsGetProcessSlotResponse, error) { + req, err := client.getProcessSlotCreateRequest(ctx, resourceGroupName, name, processID, slot, options) + if err != nil { + return WebAppsGetProcessSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsGetProcessSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsGetProcessSlotResponse{}, client.getProcessSlotHandleError(resp) + } + return client.getProcessSlotHandleResponse(resp) +} + +// getProcessSlotCreateRequest creates the GetProcessSlot request. +func (client *WebAppsClient) getProcessSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, processID string, slot string, options *WebAppsGetProcessSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes/{processId}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if processID == "" { + return nil, errors.New("parameter processID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{processId}", url.PathEscape(processID)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getProcessSlotHandleResponse handles the GetProcessSlot response. +func (client *WebAppsClient) getProcessSlotHandleResponse(resp *http.Response) (WebAppsGetProcessSlotResponse, error) { + result := WebAppsGetProcessSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.ProcessInfo); err != nil { + return WebAppsGetProcessSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getProcessSlotHandleError handles the GetProcessSlot error response. +func (client *WebAppsClient) getProcessSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + switch resp.StatusCode { + case http.StatusNotFound: + if len(body) == 0 { + return runtime.NewResponseError(errors.New(resp.Status), resp) + } + return runtime.NewResponseError(errors.New(string(body)), resp) + default: + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) + } +} + +// GetPublicCertificate - Description for Get the named public certificate for an app (or deployment slot, if specified). +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) GetPublicCertificate(ctx context.Context, resourceGroupName string, name string, publicCertificateName string, options *WebAppsGetPublicCertificateOptions) (WebAppsGetPublicCertificateResponse, error) { + req, err := client.getPublicCertificateCreateRequest(ctx, resourceGroupName, name, publicCertificateName, options) + if err != nil { + return WebAppsGetPublicCertificateResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsGetPublicCertificateResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsGetPublicCertificateResponse{}, client.getPublicCertificateHandleError(resp) + } + return client.getPublicCertificateHandleResponse(resp) +} + +// getPublicCertificateCreateRequest creates the GetPublicCertificate request. +func (client *WebAppsClient) getPublicCertificateCreateRequest(ctx context.Context, resourceGroupName string, name string, publicCertificateName string, options *WebAppsGetPublicCertificateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/publicCertificates/{publicCertificateName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if publicCertificateName == "" { + return nil, errors.New("parameter publicCertificateName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{publicCertificateName}", url.PathEscape(publicCertificateName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getPublicCertificateHandleResponse handles the GetPublicCertificate response. +func (client *WebAppsClient) getPublicCertificateHandleResponse(resp *http.Response) (WebAppsGetPublicCertificateResponse, error) { + result := WebAppsGetPublicCertificateResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.PublicCertificate); err != nil { + return WebAppsGetPublicCertificateResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getPublicCertificateHandleError handles the GetPublicCertificate error response. +func (client *WebAppsClient) getPublicCertificateHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetPublicCertificateSlot - Description for Get the named public certificate for an app (or deployment slot, if specified). +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) GetPublicCertificateSlot(ctx context.Context, resourceGroupName string, name string, slot string, publicCertificateName string, options *WebAppsGetPublicCertificateSlotOptions) (WebAppsGetPublicCertificateSlotResponse, error) { + req, err := client.getPublicCertificateSlotCreateRequest(ctx, resourceGroupName, name, slot, publicCertificateName, options) + if err != nil { + return WebAppsGetPublicCertificateSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsGetPublicCertificateSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsGetPublicCertificateSlotResponse{}, client.getPublicCertificateSlotHandleError(resp) + } + return client.getPublicCertificateSlotHandleResponse(resp) +} + +// getPublicCertificateSlotCreateRequest creates the GetPublicCertificateSlot request. +func (client *WebAppsClient) getPublicCertificateSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, slot string, publicCertificateName string, options *WebAppsGetPublicCertificateSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/publicCertificates/{publicCertificateName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if publicCertificateName == "" { + return nil, errors.New("parameter publicCertificateName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{publicCertificateName}", url.PathEscape(publicCertificateName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getPublicCertificateSlotHandleResponse handles the GetPublicCertificateSlot response. +func (client *WebAppsClient) getPublicCertificateSlotHandleResponse(resp *http.Response) (WebAppsGetPublicCertificateSlotResponse, error) { + result := WebAppsGetPublicCertificateSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.PublicCertificate); err != nil { + return WebAppsGetPublicCertificateSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getPublicCertificateSlotHandleError handles the GetPublicCertificateSlot error response. +func (client *WebAppsClient) getPublicCertificateSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetRelayServiceConnection - Description for Gets a hybrid connection configuration by its name. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) GetRelayServiceConnection(ctx context.Context, resourceGroupName string, name string, entityName string, options *WebAppsGetRelayServiceConnectionOptions) (WebAppsGetRelayServiceConnectionResponse, error) { + req, err := client.getRelayServiceConnectionCreateRequest(ctx, resourceGroupName, name, entityName, options) + if err != nil { + return WebAppsGetRelayServiceConnectionResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsGetRelayServiceConnectionResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsGetRelayServiceConnectionResponse{}, client.getRelayServiceConnectionHandleError(resp) + } + return client.getRelayServiceConnectionHandleResponse(resp) +} + +// getRelayServiceConnectionCreateRequest creates the GetRelayServiceConnection request. +func (client *WebAppsClient) getRelayServiceConnectionCreateRequest(ctx context.Context, resourceGroupName string, name string, entityName string, options *WebAppsGetRelayServiceConnectionOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection/{entityName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if entityName == "" { + return nil, errors.New("parameter entityName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{entityName}", url.PathEscape(entityName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getRelayServiceConnectionHandleResponse handles the GetRelayServiceConnection response. +func (client *WebAppsClient) getRelayServiceConnectionHandleResponse(resp *http.Response) (WebAppsGetRelayServiceConnectionResponse, error) { + result := WebAppsGetRelayServiceConnectionResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.RelayServiceConnectionEntity); err != nil { + return WebAppsGetRelayServiceConnectionResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getRelayServiceConnectionHandleError handles the GetRelayServiceConnection error response. +func (client *WebAppsClient) getRelayServiceConnectionHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetRelayServiceConnectionSlot - Description for Gets a hybrid connection configuration by its name. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) GetRelayServiceConnectionSlot(ctx context.Context, resourceGroupName string, name string, entityName string, slot string, options *WebAppsGetRelayServiceConnectionSlotOptions) (WebAppsGetRelayServiceConnectionSlotResponse, error) { + req, err := client.getRelayServiceConnectionSlotCreateRequest(ctx, resourceGroupName, name, entityName, slot, options) + if err != nil { + return WebAppsGetRelayServiceConnectionSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsGetRelayServiceConnectionSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsGetRelayServiceConnectionSlotResponse{}, client.getRelayServiceConnectionSlotHandleError(resp) + } + return client.getRelayServiceConnectionSlotHandleResponse(resp) +} + +// getRelayServiceConnectionSlotCreateRequest creates the GetRelayServiceConnectionSlot request. +func (client *WebAppsClient) getRelayServiceConnectionSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, entityName string, slot string, options *WebAppsGetRelayServiceConnectionSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridconnection/{entityName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if entityName == "" { + return nil, errors.New("parameter entityName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{entityName}", url.PathEscape(entityName)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getRelayServiceConnectionSlotHandleResponse handles the GetRelayServiceConnectionSlot response. +func (client *WebAppsClient) getRelayServiceConnectionSlotHandleResponse(resp *http.Response) (WebAppsGetRelayServiceConnectionSlotResponse, error) { + result := WebAppsGetRelayServiceConnectionSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.RelayServiceConnectionEntity); err != nil { + return WebAppsGetRelayServiceConnectionSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getRelayServiceConnectionSlotHandleError handles the GetRelayServiceConnectionSlot error response. +func (client *WebAppsClient) getRelayServiceConnectionSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetScmAllowed - Description for Returns whether Scm basic auth is allowed on the site or not. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) GetScmAllowed(ctx context.Context, resourceGroupName string, name string, options *WebAppsGetScmAllowedOptions) (WebAppsGetScmAllowedResponse, error) { + req, err := client.getScmAllowedCreateRequest(ctx, resourceGroupName, name, options) + if err != nil { + return WebAppsGetScmAllowedResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsGetScmAllowedResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsGetScmAllowedResponse{}, client.getScmAllowedHandleError(resp) + } + return client.getScmAllowedHandleResponse(resp) +} + +// getScmAllowedCreateRequest creates the GetScmAllowed request. +func (client *WebAppsClient) getScmAllowedCreateRequest(ctx context.Context, resourceGroupName string, name string, options *WebAppsGetScmAllowedOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/basicPublishingCredentialsPolicies/scm" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getScmAllowedHandleResponse handles the GetScmAllowed response. +func (client *WebAppsClient) getScmAllowedHandleResponse(resp *http.Response) (WebAppsGetScmAllowedResponse, error) { + result := WebAppsGetScmAllowedResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.CsmPublishingCredentialsPoliciesEntity); err != nil { + return WebAppsGetScmAllowedResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getScmAllowedHandleError handles the GetScmAllowed error response. +func (client *WebAppsClient) getScmAllowedHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetScmAllowedSlot - Description for Returns whether Scm basic auth is allowed on the site or not. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) GetScmAllowedSlot(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsGetScmAllowedSlotOptions) (WebAppsGetScmAllowedSlotResponse, error) { + req, err := client.getScmAllowedSlotCreateRequest(ctx, resourceGroupName, name, slot, options) + if err != nil { + return WebAppsGetScmAllowedSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsGetScmAllowedSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsGetScmAllowedSlotResponse{}, client.getScmAllowedSlotHandleError(resp) + } + return client.getScmAllowedSlotHandleResponse(resp) +} + +// getScmAllowedSlotCreateRequest creates the GetScmAllowedSlot request. +func (client *WebAppsClient) getScmAllowedSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsGetScmAllowedSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/basicPublishingCredentialsPolicies/scm" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getScmAllowedSlotHandleResponse handles the GetScmAllowedSlot response. +func (client *WebAppsClient) getScmAllowedSlotHandleResponse(resp *http.Response) (WebAppsGetScmAllowedSlotResponse, error) { + result := WebAppsGetScmAllowedSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.CsmPublishingCredentialsPoliciesEntity); err != nil { + return WebAppsGetScmAllowedSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getScmAllowedSlotHandleError handles the GetScmAllowedSlot error response. +func (client *WebAppsClient) getScmAllowedSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetSiteConnectionStringKeyVaultReference - Description for Gets the config reference and status of an app +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) GetSiteConnectionStringKeyVaultReference(ctx context.Context, resourceGroupName string, name string, connectionStringKey string, options *WebAppsGetSiteConnectionStringKeyVaultReferenceOptions) (WebAppsGetSiteConnectionStringKeyVaultReferenceResponse, error) { + req, err := client.getSiteConnectionStringKeyVaultReferenceCreateRequest(ctx, resourceGroupName, name, connectionStringKey, options) + if err != nil { + return WebAppsGetSiteConnectionStringKeyVaultReferenceResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsGetSiteConnectionStringKeyVaultReferenceResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsGetSiteConnectionStringKeyVaultReferenceResponse{}, client.getSiteConnectionStringKeyVaultReferenceHandleError(resp) + } + return client.getSiteConnectionStringKeyVaultReferenceHandleResponse(resp) +} + +// getSiteConnectionStringKeyVaultReferenceCreateRequest creates the GetSiteConnectionStringKeyVaultReference request. +func (client *WebAppsClient) getSiteConnectionStringKeyVaultReferenceCreateRequest(ctx context.Context, resourceGroupName string, name string, connectionStringKey string, options *WebAppsGetSiteConnectionStringKeyVaultReferenceOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/configreferences/connectionstrings/{connectionStringKey}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if connectionStringKey == "" { + return nil, errors.New("parameter connectionStringKey cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{connectionStringKey}", url.PathEscape(connectionStringKey)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getSiteConnectionStringKeyVaultReferenceHandleResponse handles the GetSiteConnectionStringKeyVaultReference response. +func (client *WebAppsClient) getSiteConnectionStringKeyVaultReferenceHandleResponse(resp *http.Response) (WebAppsGetSiteConnectionStringKeyVaultReferenceResponse, error) { + result := WebAppsGetSiteConnectionStringKeyVaultReferenceResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.APIKVReference); err != nil { + return WebAppsGetSiteConnectionStringKeyVaultReferenceResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getSiteConnectionStringKeyVaultReferenceHandleError handles the GetSiteConnectionStringKeyVaultReference error response. +func (client *WebAppsClient) getSiteConnectionStringKeyVaultReferenceHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetSiteConnectionStringKeyVaultReferenceSlot - Description for Gets the config reference and status of an app +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) GetSiteConnectionStringKeyVaultReferenceSlot(ctx context.Context, resourceGroupName string, name string, connectionStringKey string, slot string, options *WebAppsGetSiteConnectionStringKeyVaultReferenceSlotOptions) (WebAppsGetSiteConnectionStringKeyVaultReferenceSlotResponse, error) { + req, err := client.getSiteConnectionStringKeyVaultReferenceSlotCreateRequest(ctx, resourceGroupName, name, connectionStringKey, slot, options) + if err != nil { + return WebAppsGetSiteConnectionStringKeyVaultReferenceSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsGetSiteConnectionStringKeyVaultReferenceSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsGetSiteConnectionStringKeyVaultReferenceSlotResponse{}, client.getSiteConnectionStringKeyVaultReferenceSlotHandleError(resp) + } + return client.getSiteConnectionStringKeyVaultReferenceSlotHandleResponse(resp) +} + +// getSiteConnectionStringKeyVaultReferenceSlotCreateRequest creates the GetSiteConnectionStringKeyVaultReferenceSlot request. +func (client *WebAppsClient) getSiteConnectionStringKeyVaultReferenceSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, connectionStringKey string, slot string, options *WebAppsGetSiteConnectionStringKeyVaultReferenceSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/configreferences/connectionstrings/{connectionStringKey}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if connectionStringKey == "" { + return nil, errors.New("parameter connectionStringKey cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{connectionStringKey}", url.PathEscape(connectionStringKey)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getSiteConnectionStringKeyVaultReferenceSlotHandleResponse handles the GetSiteConnectionStringKeyVaultReferenceSlot response. +func (client *WebAppsClient) getSiteConnectionStringKeyVaultReferenceSlotHandleResponse(resp *http.Response) (WebAppsGetSiteConnectionStringKeyVaultReferenceSlotResponse, error) { + result := WebAppsGetSiteConnectionStringKeyVaultReferenceSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.APIKVReference); err != nil { + return WebAppsGetSiteConnectionStringKeyVaultReferenceSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getSiteConnectionStringKeyVaultReferenceSlotHandleError handles the GetSiteConnectionStringKeyVaultReferenceSlot error response. +func (client *WebAppsClient) getSiteConnectionStringKeyVaultReferenceSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetSiteConnectionStringKeyVaultReferences - Description for Gets the config reference app settings and status of an app +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) GetSiteConnectionStringKeyVaultReferences(resourceGroupName string, name string, options *WebAppsGetSiteConnectionStringKeyVaultReferencesOptions) *WebAppsGetSiteConnectionStringKeyVaultReferencesPager { + return &WebAppsGetSiteConnectionStringKeyVaultReferencesPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.getSiteConnectionStringKeyVaultReferencesCreateRequest(ctx, resourceGroupName, name, options) + }, + advancer: func(ctx context.Context, resp WebAppsGetSiteConnectionStringKeyVaultReferencesResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.APIKVReferenceCollection.NextLink) + }, + } +} + +// getSiteConnectionStringKeyVaultReferencesCreateRequest creates the GetSiteConnectionStringKeyVaultReferences request. +func (client *WebAppsClient) getSiteConnectionStringKeyVaultReferencesCreateRequest(ctx context.Context, resourceGroupName string, name string, options *WebAppsGetSiteConnectionStringKeyVaultReferencesOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/configreferences/connectionstrings" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getSiteConnectionStringKeyVaultReferencesHandleResponse handles the GetSiteConnectionStringKeyVaultReferences response. +func (client *WebAppsClient) getSiteConnectionStringKeyVaultReferencesHandleResponse(resp *http.Response) (WebAppsGetSiteConnectionStringKeyVaultReferencesResponse, error) { + result := WebAppsGetSiteConnectionStringKeyVaultReferencesResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.APIKVReferenceCollection); err != nil { + return WebAppsGetSiteConnectionStringKeyVaultReferencesResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getSiteConnectionStringKeyVaultReferencesHandleError handles the GetSiteConnectionStringKeyVaultReferences error response. +func (client *WebAppsClient) getSiteConnectionStringKeyVaultReferencesHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetSiteConnectionStringKeyVaultReferencesSlot - Description for Gets the config reference app settings and status of an app +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) GetSiteConnectionStringKeyVaultReferencesSlot(resourceGroupName string, name string, slot string, options *WebAppsGetSiteConnectionStringKeyVaultReferencesSlotOptions) *WebAppsGetSiteConnectionStringKeyVaultReferencesSlotPager { + return &WebAppsGetSiteConnectionStringKeyVaultReferencesSlotPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.getSiteConnectionStringKeyVaultReferencesSlotCreateRequest(ctx, resourceGroupName, name, slot, options) + }, + advancer: func(ctx context.Context, resp WebAppsGetSiteConnectionStringKeyVaultReferencesSlotResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.APIKVReferenceCollection.NextLink) + }, + } +} + +// getSiteConnectionStringKeyVaultReferencesSlotCreateRequest creates the GetSiteConnectionStringKeyVaultReferencesSlot request. +func (client *WebAppsClient) getSiteConnectionStringKeyVaultReferencesSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsGetSiteConnectionStringKeyVaultReferencesSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/configreferences/connectionstrings" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getSiteConnectionStringKeyVaultReferencesSlotHandleResponse handles the GetSiteConnectionStringKeyVaultReferencesSlot response. +func (client *WebAppsClient) getSiteConnectionStringKeyVaultReferencesSlotHandleResponse(resp *http.Response) (WebAppsGetSiteConnectionStringKeyVaultReferencesSlotResponse, error) { + result := WebAppsGetSiteConnectionStringKeyVaultReferencesSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.APIKVReferenceCollection); err != nil { + return WebAppsGetSiteConnectionStringKeyVaultReferencesSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getSiteConnectionStringKeyVaultReferencesSlotHandleError handles the GetSiteConnectionStringKeyVaultReferencesSlot error response. +func (client *WebAppsClient) getSiteConnectionStringKeyVaultReferencesSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetSiteExtension - Description for Get site extension information by its ID for a web site, or a deployment slot. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) GetSiteExtension(ctx context.Context, resourceGroupName string, name string, siteExtensionID string, options *WebAppsGetSiteExtensionOptions) (WebAppsGetSiteExtensionResponse, error) { + req, err := client.getSiteExtensionCreateRequest(ctx, resourceGroupName, name, siteExtensionID, options) + if err != nil { + return WebAppsGetSiteExtensionResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsGetSiteExtensionResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsGetSiteExtensionResponse{}, client.getSiteExtensionHandleError(resp) + } + return client.getSiteExtensionHandleResponse(resp) +} + +// getSiteExtensionCreateRequest creates the GetSiteExtension request. +func (client *WebAppsClient) getSiteExtensionCreateRequest(ctx context.Context, resourceGroupName string, name string, siteExtensionID string, options *WebAppsGetSiteExtensionOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/siteextensions/{siteExtensionId}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if siteExtensionID == "" { + return nil, errors.New("parameter siteExtensionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{siteExtensionId}", url.PathEscape(siteExtensionID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getSiteExtensionHandleResponse handles the GetSiteExtension response. +func (client *WebAppsClient) getSiteExtensionHandleResponse(resp *http.Response) (WebAppsGetSiteExtensionResponse, error) { + result := WebAppsGetSiteExtensionResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.SiteExtensionInfo); err != nil { + return WebAppsGetSiteExtensionResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getSiteExtensionHandleError handles the GetSiteExtension error response. +func (client *WebAppsClient) getSiteExtensionHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + switch resp.StatusCode { + case http.StatusNotFound: + if len(body) == 0 { + return runtime.NewResponseError(errors.New(resp.Status), resp) + } + return runtime.NewResponseError(errors.New(string(body)), resp) + default: + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) + } +} + +// GetSiteExtensionSlot - Description for Get site extension information by its ID for a web site, or a deployment slot. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) GetSiteExtensionSlot(ctx context.Context, resourceGroupName string, name string, siteExtensionID string, slot string, options *WebAppsGetSiteExtensionSlotOptions) (WebAppsGetSiteExtensionSlotResponse, error) { + req, err := client.getSiteExtensionSlotCreateRequest(ctx, resourceGroupName, name, siteExtensionID, slot, options) + if err != nil { + return WebAppsGetSiteExtensionSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsGetSiteExtensionSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsGetSiteExtensionSlotResponse{}, client.getSiteExtensionSlotHandleError(resp) + } + return client.getSiteExtensionSlotHandleResponse(resp) +} + +// getSiteExtensionSlotCreateRequest creates the GetSiteExtensionSlot request. +func (client *WebAppsClient) getSiteExtensionSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, siteExtensionID string, slot string, options *WebAppsGetSiteExtensionSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/siteextensions/{siteExtensionId}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if siteExtensionID == "" { + return nil, errors.New("parameter siteExtensionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{siteExtensionId}", url.PathEscape(siteExtensionID)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getSiteExtensionSlotHandleResponse handles the GetSiteExtensionSlot response. +func (client *WebAppsClient) getSiteExtensionSlotHandleResponse(resp *http.Response) (WebAppsGetSiteExtensionSlotResponse, error) { + result := WebAppsGetSiteExtensionSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.SiteExtensionInfo); err != nil { + return WebAppsGetSiteExtensionSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getSiteExtensionSlotHandleError handles the GetSiteExtensionSlot error response. +func (client *WebAppsClient) getSiteExtensionSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + switch resp.StatusCode { + case http.StatusNotFound: + if len(body) == 0 { + return runtime.NewResponseError(errors.New(resp.Status), resp) + } + return runtime.NewResponseError(errors.New(string(body)), resp) + default: + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) + } +} + +// GetSitePhpErrorLogFlag - Description for Gets web app's event logs. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) GetSitePhpErrorLogFlag(ctx context.Context, resourceGroupName string, name string, options *WebAppsGetSitePhpErrorLogFlagOptions) (WebAppsGetSitePhpErrorLogFlagResponse, error) { + req, err := client.getSitePhpErrorLogFlagCreateRequest(ctx, resourceGroupName, name, options) + if err != nil { + return WebAppsGetSitePhpErrorLogFlagResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsGetSitePhpErrorLogFlagResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsGetSitePhpErrorLogFlagResponse{}, client.getSitePhpErrorLogFlagHandleError(resp) + } + return client.getSitePhpErrorLogFlagHandleResponse(resp) +} + +// getSitePhpErrorLogFlagCreateRequest creates the GetSitePhpErrorLogFlag request. +func (client *WebAppsClient) getSitePhpErrorLogFlagCreateRequest(ctx context.Context, resourceGroupName string, name string, options *WebAppsGetSitePhpErrorLogFlagOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/phplogging" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getSitePhpErrorLogFlagHandleResponse handles the GetSitePhpErrorLogFlag response. +func (client *WebAppsClient) getSitePhpErrorLogFlagHandleResponse(resp *http.Response) (WebAppsGetSitePhpErrorLogFlagResponse, error) { + result := WebAppsGetSitePhpErrorLogFlagResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.SitePhpErrorLogFlag); err != nil { + return WebAppsGetSitePhpErrorLogFlagResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getSitePhpErrorLogFlagHandleError handles the GetSitePhpErrorLogFlag error response. +func (client *WebAppsClient) getSitePhpErrorLogFlagHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetSitePhpErrorLogFlagSlot - Description for Gets web app's event logs. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) GetSitePhpErrorLogFlagSlot(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsGetSitePhpErrorLogFlagSlotOptions) (WebAppsGetSitePhpErrorLogFlagSlotResponse, error) { + req, err := client.getSitePhpErrorLogFlagSlotCreateRequest(ctx, resourceGroupName, name, slot, options) + if err != nil { + return WebAppsGetSitePhpErrorLogFlagSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsGetSitePhpErrorLogFlagSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsGetSitePhpErrorLogFlagSlotResponse{}, client.getSitePhpErrorLogFlagSlotHandleError(resp) + } + return client.getSitePhpErrorLogFlagSlotHandleResponse(resp) +} + +// getSitePhpErrorLogFlagSlotCreateRequest creates the GetSitePhpErrorLogFlagSlot request. +func (client *WebAppsClient) getSitePhpErrorLogFlagSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsGetSitePhpErrorLogFlagSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/phplogging" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getSitePhpErrorLogFlagSlotHandleResponse handles the GetSitePhpErrorLogFlagSlot response. +func (client *WebAppsClient) getSitePhpErrorLogFlagSlotHandleResponse(resp *http.Response) (WebAppsGetSitePhpErrorLogFlagSlotResponse, error) { + result := WebAppsGetSitePhpErrorLogFlagSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.SitePhpErrorLogFlag); err != nil { + return WebAppsGetSitePhpErrorLogFlagSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getSitePhpErrorLogFlagSlotHandleError handles the GetSitePhpErrorLogFlagSlot error response. +func (client *WebAppsClient) getSitePhpErrorLogFlagSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetSlot - Description for Gets the details of a web, mobile, or API app. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) GetSlot(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsGetSlotOptions) (WebAppsGetSlotResponse, error) { + req, err := client.getSlotCreateRequest(ctx, resourceGroupName, name, slot, options) + if err != nil { + return WebAppsGetSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsGetSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsGetSlotResponse{}, client.getSlotHandleError(resp) + } + return client.getSlotHandleResponse(resp) +} + +// getSlotCreateRequest creates the GetSlot request. +func (client *WebAppsClient) getSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsGetSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getSlotHandleResponse handles the GetSlot response. +func (client *WebAppsClient) getSlotHandleResponse(resp *http.Response) (WebAppsGetSlotResponse, error) { + result := WebAppsGetSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.Site); err != nil { + return WebAppsGetSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getSlotHandleError handles the GetSlot error response. +func (client *WebAppsClient) getSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + switch resp.StatusCode { + case http.StatusNotFound: + if len(body) == 0 { + return runtime.NewResponseError(errors.New(resp.Status), resp) + } + return runtime.NewResponseError(errors.New(string(body)), resp) + default: + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) + } +} + +// GetSourceControl - Description for Gets the source control configuration of an app. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) GetSourceControl(ctx context.Context, resourceGroupName string, name string, options *WebAppsGetSourceControlOptions) (WebAppsGetSourceControlResponse, error) { + req, err := client.getSourceControlCreateRequest(ctx, resourceGroupName, name, options) + if err != nil { + return WebAppsGetSourceControlResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsGetSourceControlResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { + return WebAppsGetSourceControlResponse{}, client.getSourceControlHandleError(resp) + } + return client.getSourceControlHandleResponse(resp) +} + +// getSourceControlCreateRequest creates the GetSourceControl request. +func (client *WebAppsClient) getSourceControlCreateRequest(ctx context.Context, resourceGroupName string, name string, options *WebAppsGetSourceControlOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/sourcecontrols/web" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getSourceControlHandleResponse handles the GetSourceControl response. +func (client *WebAppsClient) getSourceControlHandleResponse(resp *http.Response) (WebAppsGetSourceControlResponse, error) { + result := WebAppsGetSourceControlResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.SiteSourceControl); err != nil { + return WebAppsGetSourceControlResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getSourceControlHandleError handles the GetSourceControl error response. +func (client *WebAppsClient) getSourceControlHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetSourceControlSlot - Description for Gets the source control configuration of an app. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) GetSourceControlSlot(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsGetSourceControlSlotOptions) (WebAppsGetSourceControlSlotResponse, error) { + req, err := client.getSourceControlSlotCreateRequest(ctx, resourceGroupName, name, slot, options) + if err != nil { + return WebAppsGetSourceControlSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsGetSourceControlSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { + return WebAppsGetSourceControlSlotResponse{}, client.getSourceControlSlotHandleError(resp) + } + return client.getSourceControlSlotHandleResponse(resp) +} + +// getSourceControlSlotCreateRequest creates the GetSourceControlSlot request. +func (client *WebAppsClient) getSourceControlSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsGetSourceControlSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/sourcecontrols/web" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getSourceControlSlotHandleResponse handles the GetSourceControlSlot response. +func (client *WebAppsClient) getSourceControlSlotHandleResponse(resp *http.Response) (WebAppsGetSourceControlSlotResponse, error) { + result := WebAppsGetSourceControlSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.SiteSourceControl); err != nil { + return WebAppsGetSourceControlSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getSourceControlSlotHandleError handles the GetSourceControlSlot error response. +func (client *WebAppsClient) getSourceControlSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetSwiftVirtualNetworkConnection - Description for Gets a Swift Virtual Network connection. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) GetSwiftVirtualNetworkConnection(ctx context.Context, resourceGroupName string, name string, options *WebAppsGetSwiftVirtualNetworkConnectionOptions) (WebAppsGetSwiftVirtualNetworkConnectionResponse, error) { + req, err := client.getSwiftVirtualNetworkConnectionCreateRequest(ctx, resourceGroupName, name, options) + if err != nil { + return WebAppsGetSwiftVirtualNetworkConnectionResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsGetSwiftVirtualNetworkConnectionResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsGetSwiftVirtualNetworkConnectionResponse{}, client.getSwiftVirtualNetworkConnectionHandleError(resp) + } + return client.getSwiftVirtualNetworkConnectionHandleResponse(resp) +} + +// getSwiftVirtualNetworkConnectionCreateRequest creates the GetSwiftVirtualNetworkConnection request. +func (client *WebAppsClient) getSwiftVirtualNetworkConnectionCreateRequest(ctx context.Context, resourceGroupName string, name string, options *WebAppsGetSwiftVirtualNetworkConnectionOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkConfig/virtualNetwork" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getSwiftVirtualNetworkConnectionHandleResponse handles the GetSwiftVirtualNetworkConnection response. +func (client *WebAppsClient) getSwiftVirtualNetworkConnectionHandleResponse(resp *http.Response) (WebAppsGetSwiftVirtualNetworkConnectionResponse, error) { + result := WebAppsGetSwiftVirtualNetworkConnectionResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.SwiftVirtualNetwork); err != nil { + return WebAppsGetSwiftVirtualNetworkConnectionResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getSwiftVirtualNetworkConnectionHandleError handles the GetSwiftVirtualNetworkConnection error response. +func (client *WebAppsClient) getSwiftVirtualNetworkConnectionHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetSwiftVirtualNetworkConnectionSlot - Description for Gets a Swift Virtual Network connection. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) GetSwiftVirtualNetworkConnectionSlot(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsGetSwiftVirtualNetworkConnectionSlotOptions) (WebAppsGetSwiftVirtualNetworkConnectionSlotResponse, error) { + req, err := client.getSwiftVirtualNetworkConnectionSlotCreateRequest(ctx, resourceGroupName, name, slot, options) + if err != nil { + return WebAppsGetSwiftVirtualNetworkConnectionSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsGetSwiftVirtualNetworkConnectionSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsGetSwiftVirtualNetworkConnectionSlotResponse{}, client.getSwiftVirtualNetworkConnectionSlotHandleError(resp) + } + return client.getSwiftVirtualNetworkConnectionSlotHandleResponse(resp) +} + +// getSwiftVirtualNetworkConnectionSlotCreateRequest creates the GetSwiftVirtualNetworkConnectionSlot request. +func (client *WebAppsClient) getSwiftVirtualNetworkConnectionSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsGetSwiftVirtualNetworkConnectionSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkConfig/virtualNetwork" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getSwiftVirtualNetworkConnectionSlotHandleResponse handles the GetSwiftVirtualNetworkConnectionSlot response. +func (client *WebAppsClient) getSwiftVirtualNetworkConnectionSlotHandleResponse(resp *http.Response) (WebAppsGetSwiftVirtualNetworkConnectionSlotResponse, error) { + result := WebAppsGetSwiftVirtualNetworkConnectionSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.SwiftVirtualNetwork); err != nil { + return WebAppsGetSwiftVirtualNetworkConnectionSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getSwiftVirtualNetworkConnectionSlotHandleError handles the GetSwiftVirtualNetworkConnectionSlot error response. +func (client *WebAppsClient) getSwiftVirtualNetworkConnectionSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetTriggeredWebJob - Description for Gets a triggered web job by its ID for an app, or a deployment slot. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) GetTriggeredWebJob(ctx context.Context, resourceGroupName string, name string, webJobName string, options *WebAppsGetTriggeredWebJobOptions) (WebAppsGetTriggeredWebJobResponse, error) { + req, err := client.getTriggeredWebJobCreateRequest(ctx, resourceGroupName, name, webJobName, options) + if err != nil { + return WebAppsGetTriggeredWebJobResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsGetTriggeredWebJobResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsGetTriggeredWebJobResponse{}, client.getTriggeredWebJobHandleError(resp) + } + return client.getTriggeredWebJobHandleResponse(resp) +} + +// getTriggeredWebJobCreateRequest creates the GetTriggeredWebJob request. +func (client *WebAppsClient) getTriggeredWebJobCreateRequest(ctx context.Context, resourceGroupName string, name string, webJobName string, options *WebAppsGetTriggeredWebJobOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/triggeredwebjobs/{webJobName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if webJobName == "" { + return nil, errors.New("parameter webJobName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{webJobName}", url.PathEscape(webJobName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getTriggeredWebJobHandleResponse handles the GetTriggeredWebJob response. +func (client *WebAppsClient) getTriggeredWebJobHandleResponse(resp *http.Response) (WebAppsGetTriggeredWebJobResponse, error) { + result := WebAppsGetTriggeredWebJobResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.TriggeredWebJob); err != nil { + return WebAppsGetTriggeredWebJobResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getTriggeredWebJobHandleError handles the GetTriggeredWebJob error response. +func (client *WebAppsClient) getTriggeredWebJobHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + switch resp.StatusCode { + case http.StatusNotFound: + if len(body) == 0 { + return runtime.NewResponseError(errors.New(resp.Status), resp) + } + return runtime.NewResponseError(errors.New(string(body)), resp) + default: + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) + } +} + +// GetTriggeredWebJobHistory - Description for Gets a triggered web job's history by its ID for an app, , or a deployment slot. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) GetTriggeredWebJobHistory(ctx context.Context, resourceGroupName string, name string, webJobName string, id string, options *WebAppsGetTriggeredWebJobHistoryOptions) (WebAppsGetTriggeredWebJobHistoryResponse, error) { + req, err := client.getTriggeredWebJobHistoryCreateRequest(ctx, resourceGroupName, name, webJobName, id, options) + if err != nil { + return WebAppsGetTriggeredWebJobHistoryResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsGetTriggeredWebJobHistoryResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsGetTriggeredWebJobHistoryResponse{}, client.getTriggeredWebJobHistoryHandleError(resp) + } + return client.getTriggeredWebJobHistoryHandleResponse(resp) +} + +// getTriggeredWebJobHistoryCreateRequest creates the GetTriggeredWebJobHistory request. +func (client *WebAppsClient) getTriggeredWebJobHistoryCreateRequest(ctx context.Context, resourceGroupName string, name string, webJobName string, id string, options *WebAppsGetTriggeredWebJobHistoryOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/triggeredwebjobs/{webJobName}/history/{id}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if webJobName == "" { + return nil, errors.New("parameter webJobName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{webJobName}", url.PathEscape(webJobName)) + if id == "" { + return nil, errors.New("parameter id cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{id}", url.PathEscape(id)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getTriggeredWebJobHistoryHandleResponse handles the GetTriggeredWebJobHistory response. +func (client *WebAppsClient) getTriggeredWebJobHistoryHandleResponse(resp *http.Response) (WebAppsGetTriggeredWebJobHistoryResponse, error) { + result := WebAppsGetTriggeredWebJobHistoryResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.TriggeredJobHistory); err != nil { + return WebAppsGetTriggeredWebJobHistoryResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getTriggeredWebJobHistoryHandleError handles the GetTriggeredWebJobHistory error response. +func (client *WebAppsClient) getTriggeredWebJobHistoryHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + switch resp.StatusCode { + case http.StatusNotFound: + if len(body) == 0 { + return runtime.NewResponseError(errors.New(resp.Status), resp) + } + return runtime.NewResponseError(errors.New(string(body)), resp) + default: + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) + } +} + +// GetTriggeredWebJobHistorySlot - Description for Gets a triggered web job's history by its ID for an app, , or a deployment slot. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) GetTriggeredWebJobHistorySlot(ctx context.Context, resourceGroupName string, name string, webJobName string, id string, slot string, options *WebAppsGetTriggeredWebJobHistorySlotOptions) (WebAppsGetTriggeredWebJobHistorySlotResponse, error) { + req, err := client.getTriggeredWebJobHistorySlotCreateRequest(ctx, resourceGroupName, name, webJobName, id, slot, options) + if err != nil { + return WebAppsGetTriggeredWebJobHistorySlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsGetTriggeredWebJobHistorySlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsGetTriggeredWebJobHistorySlotResponse{}, client.getTriggeredWebJobHistorySlotHandleError(resp) + } + return client.getTriggeredWebJobHistorySlotHandleResponse(resp) +} + +// getTriggeredWebJobHistorySlotCreateRequest creates the GetTriggeredWebJobHistorySlot request. +func (client *WebAppsClient) getTriggeredWebJobHistorySlotCreateRequest(ctx context.Context, resourceGroupName string, name string, webJobName string, id string, slot string, options *WebAppsGetTriggeredWebJobHistorySlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs/{webJobName}/history/{id}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if webJobName == "" { + return nil, errors.New("parameter webJobName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{webJobName}", url.PathEscape(webJobName)) + if id == "" { + return nil, errors.New("parameter id cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{id}", url.PathEscape(id)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getTriggeredWebJobHistorySlotHandleResponse handles the GetTriggeredWebJobHistorySlot response. +func (client *WebAppsClient) getTriggeredWebJobHistorySlotHandleResponse(resp *http.Response) (WebAppsGetTriggeredWebJobHistorySlotResponse, error) { + result := WebAppsGetTriggeredWebJobHistorySlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.TriggeredJobHistory); err != nil { + return WebAppsGetTriggeredWebJobHistorySlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getTriggeredWebJobHistorySlotHandleError handles the GetTriggeredWebJobHistorySlot error response. +func (client *WebAppsClient) getTriggeredWebJobHistorySlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + switch resp.StatusCode { + case http.StatusNotFound: + if len(body) == 0 { + return runtime.NewResponseError(errors.New(resp.Status), resp) + } + return runtime.NewResponseError(errors.New(string(body)), resp) + default: + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) + } +} + +// GetTriggeredWebJobSlot - Description for Gets a triggered web job by its ID for an app, or a deployment slot. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) GetTriggeredWebJobSlot(ctx context.Context, resourceGroupName string, name string, webJobName string, slot string, options *WebAppsGetTriggeredWebJobSlotOptions) (WebAppsGetTriggeredWebJobSlotResponse, error) { + req, err := client.getTriggeredWebJobSlotCreateRequest(ctx, resourceGroupName, name, webJobName, slot, options) + if err != nil { + return WebAppsGetTriggeredWebJobSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsGetTriggeredWebJobSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsGetTriggeredWebJobSlotResponse{}, client.getTriggeredWebJobSlotHandleError(resp) + } + return client.getTriggeredWebJobSlotHandleResponse(resp) +} + +// getTriggeredWebJobSlotCreateRequest creates the GetTriggeredWebJobSlot request. +func (client *WebAppsClient) getTriggeredWebJobSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, webJobName string, slot string, options *WebAppsGetTriggeredWebJobSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs/{webJobName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if webJobName == "" { + return nil, errors.New("parameter webJobName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{webJobName}", url.PathEscape(webJobName)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getTriggeredWebJobSlotHandleResponse handles the GetTriggeredWebJobSlot response. +func (client *WebAppsClient) getTriggeredWebJobSlotHandleResponse(resp *http.Response) (WebAppsGetTriggeredWebJobSlotResponse, error) { + result := WebAppsGetTriggeredWebJobSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.TriggeredWebJob); err != nil { + return WebAppsGetTriggeredWebJobSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getTriggeredWebJobSlotHandleError handles the GetTriggeredWebJobSlot error response. +func (client *WebAppsClient) getTriggeredWebJobSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + switch resp.StatusCode { + case http.StatusNotFound: + if len(body) == 0 { + return runtime.NewResponseError(errors.New(resp.Status), resp) + } + return runtime.NewResponseError(errors.New(string(body)), resp) + default: + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) + } +} + +// GetVnetConnection - Description for Gets a virtual network the app (or deployment slot) is connected to by name. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) GetVnetConnection(ctx context.Context, resourceGroupName string, name string, vnetName string, options *WebAppsGetVnetConnectionOptions) (WebAppsGetVnetConnectionResponse, error) { + req, err := client.getVnetConnectionCreateRequest(ctx, resourceGroupName, name, vnetName, options) + if err != nil { + return WebAppsGetVnetConnectionResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsGetVnetConnectionResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsGetVnetConnectionResponse{}, client.getVnetConnectionHandleError(resp) + } + return client.getVnetConnectionHandleResponse(resp) +} + +// getVnetConnectionCreateRequest creates the GetVnetConnection request. +func (client *WebAppsClient) getVnetConnectionCreateRequest(ctx context.Context, resourceGroupName string, name string, vnetName string, options *WebAppsGetVnetConnectionOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if vnetName == "" { + return nil, errors.New("parameter vnetName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{vnetName}", url.PathEscape(vnetName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getVnetConnectionHandleResponse handles the GetVnetConnection response. +func (client *WebAppsClient) getVnetConnectionHandleResponse(resp *http.Response) (WebAppsGetVnetConnectionResponse, error) { + result := WebAppsGetVnetConnectionResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.VnetInfoResource); err != nil { + return WebAppsGetVnetConnectionResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getVnetConnectionHandleError handles the GetVnetConnection error response. +func (client *WebAppsClient) getVnetConnectionHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetVnetConnectionGateway - Description for Gets an app's Virtual Network gateway. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) GetVnetConnectionGateway(ctx context.Context, resourceGroupName string, name string, vnetName string, gatewayName string, options *WebAppsGetVnetConnectionGatewayOptions) (WebAppsGetVnetConnectionGatewayResponse, error) { + req, err := client.getVnetConnectionGatewayCreateRequest(ctx, resourceGroupName, name, vnetName, gatewayName, options) + if err != nil { + return WebAppsGetVnetConnectionGatewayResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsGetVnetConnectionGatewayResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsGetVnetConnectionGatewayResponse{}, client.getVnetConnectionGatewayHandleError(resp) + } + return client.getVnetConnectionGatewayHandleResponse(resp) +} + +// getVnetConnectionGatewayCreateRequest creates the GetVnetConnectionGateway request. +func (client *WebAppsClient) getVnetConnectionGatewayCreateRequest(ctx context.Context, resourceGroupName string, name string, vnetName string, gatewayName string, options *WebAppsGetVnetConnectionGatewayOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if vnetName == "" { + return nil, errors.New("parameter vnetName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{vnetName}", url.PathEscape(vnetName)) + if gatewayName == "" { + return nil, errors.New("parameter gatewayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{gatewayName}", url.PathEscape(gatewayName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getVnetConnectionGatewayHandleResponse handles the GetVnetConnectionGateway response. +func (client *WebAppsClient) getVnetConnectionGatewayHandleResponse(resp *http.Response) (WebAppsGetVnetConnectionGatewayResponse, error) { + result := WebAppsGetVnetConnectionGatewayResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.VnetGateway); err != nil { + return WebAppsGetVnetConnectionGatewayResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getVnetConnectionGatewayHandleError handles the GetVnetConnectionGateway error response. +func (client *WebAppsClient) getVnetConnectionGatewayHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + switch resp.StatusCode { + case http.StatusNotFound: + if len(body) == 0 { + return runtime.NewResponseError(errors.New(resp.Status), resp) + } + return runtime.NewResponseError(errors.New(string(body)), resp) + default: + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) + } +} + +// GetVnetConnectionGatewaySlot - Description for Gets an app's Virtual Network gateway. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) GetVnetConnectionGatewaySlot(ctx context.Context, resourceGroupName string, name string, vnetName string, gatewayName string, slot string, options *WebAppsGetVnetConnectionGatewaySlotOptions) (WebAppsGetVnetConnectionGatewaySlotResponse, error) { + req, err := client.getVnetConnectionGatewaySlotCreateRequest(ctx, resourceGroupName, name, vnetName, gatewayName, slot, options) + if err != nil { + return WebAppsGetVnetConnectionGatewaySlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsGetVnetConnectionGatewaySlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsGetVnetConnectionGatewaySlotResponse{}, client.getVnetConnectionGatewaySlotHandleError(resp) + } + return client.getVnetConnectionGatewaySlotHandleResponse(resp) +} + +// getVnetConnectionGatewaySlotCreateRequest creates the GetVnetConnectionGatewaySlot request. +func (client *WebAppsClient) getVnetConnectionGatewaySlotCreateRequest(ctx context.Context, resourceGroupName string, name string, vnetName string, gatewayName string, slot string, options *WebAppsGetVnetConnectionGatewaySlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if vnetName == "" { + return nil, errors.New("parameter vnetName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{vnetName}", url.PathEscape(vnetName)) + if gatewayName == "" { + return nil, errors.New("parameter gatewayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{gatewayName}", url.PathEscape(gatewayName)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getVnetConnectionGatewaySlotHandleResponse handles the GetVnetConnectionGatewaySlot response. +func (client *WebAppsClient) getVnetConnectionGatewaySlotHandleResponse(resp *http.Response) (WebAppsGetVnetConnectionGatewaySlotResponse, error) { + result := WebAppsGetVnetConnectionGatewaySlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.VnetGateway); err != nil { + return WebAppsGetVnetConnectionGatewaySlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getVnetConnectionGatewaySlotHandleError handles the GetVnetConnectionGatewaySlot error response. +func (client *WebAppsClient) getVnetConnectionGatewaySlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + switch resp.StatusCode { + case http.StatusNotFound: + if len(body) == 0 { + return runtime.NewResponseError(errors.New(resp.Status), resp) + } + return runtime.NewResponseError(errors.New(string(body)), resp) + default: + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) + } +} + +// GetVnetConnectionSlot - Description for Gets a virtual network the app (or deployment slot) is connected to by name. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) GetVnetConnectionSlot(ctx context.Context, resourceGroupName string, name string, vnetName string, slot string, options *WebAppsGetVnetConnectionSlotOptions) (WebAppsGetVnetConnectionSlotResponse, error) { + req, err := client.getVnetConnectionSlotCreateRequest(ctx, resourceGroupName, name, vnetName, slot, options) + if err != nil { + return WebAppsGetVnetConnectionSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsGetVnetConnectionSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsGetVnetConnectionSlotResponse{}, client.getVnetConnectionSlotHandleError(resp) + } + return client.getVnetConnectionSlotHandleResponse(resp) +} + +// getVnetConnectionSlotCreateRequest creates the GetVnetConnectionSlot request. +func (client *WebAppsClient) getVnetConnectionSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, vnetName string, slot string, options *WebAppsGetVnetConnectionSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if vnetName == "" { + return nil, errors.New("parameter vnetName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{vnetName}", url.PathEscape(vnetName)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getVnetConnectionSlotHandleResponse handles the GetVnetConnectionSlot response. +func (client *WebAppsClient) getVnetConnectionSlotHandleResponse(resp *http.Response) (WebAppsGetVnetConnectionSlotResponse, error) { + result := WebAppsGetVnetConnectionSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.VnetInfoResource); err != nil { + return WebAppsGetVnetConnectionSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getVnetConnectionSlotHandleError handles the GetVnetConnectionSlot error response. +func (client *WebAppsClient) getVnetConnectionSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetWebJob - Description for Get webjob information for an app, or a deployment slot. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) GetWebJob(ctx context.Context, resourceGroupName string, name string, webJobName string, options *WebAppsGetWebJobOptions) (WebAppsGetWebJobResponse, error) { + req, err := client.getWebJobCreateRequest(ctx, resourceGroupName, name, webJobName, options) + if err != nil { + return WebAppsGetWebJobResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsGetWebJobResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsGetWebJobResponse{}, client.getWebJobHandleError(resp) + } + return client.getWebJobHandleResponse(resp) +} + +// getWebJobCreateRequest creates the GetWebJob request. +func (client *WebAppsClient) getWebJobCreateRequest(ctx context.Context, resourceGroupName string, name string, webJobName string, options *WebAppsGetWebJobOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/webjobs/{webJobName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if webJobName == "" { + return nil, errors.New("parameter webJobName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{webJobName}", url.PathEscape(webJobName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getWebJobHandleResponse handles the GetWebJob response. +func (client *WebAppsClient) getWebJobHandleResponse(resp *http.Response) (WebAppsGetWebJobResponse, error) { + result := WebAppsGetWebJobResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.WebJob); err != nil { + return WebAppsGetWebJobResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getWebJobHandleError handles the GetWebJob error response. +func (client *WebAppsClient) getWebJobHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetWebJobSlot - Description for Get webjob information for an app, or a deployment slot. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) GetWebJobSlot(ctx context.Context, resourceGroupName string, name string, webJobName string, slot string, options *WebAppsGetWebJobSlotOptions) (WebAppsGetWebJobSlotResponse, error) { + req, err := client.getWebJobSlotCreateRequest(ctx, resourceGroupName, name, webJobName, slot, options) + if err != nil { + return WebAppsGetWebJobSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsGetWebJobSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsGetWebJobSlotResponse{}, client.getWebJobSlotHandleError(resp) + } + return client.getWebJobSlotHandleResponse(resp) +} + +// getWebJobSlotCreateRequest creates the GetWebJobSlot request. +func (client *WebAppsClient) getWebJobSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, webJobName string, slot string, options *WebAppsGetWebJobSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/webjobs/{webJobName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if webJobName == "" { + return nil, errors.New("parameter webJobName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{webJobName}", url.PathEscape(webJobName)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getWebJobSlotHandleResponse handles the GetWebJobSlot response. +func (client *WebAppsClient) getWebJobSlotHandleResponse(resp *http.Response) (WebAppsGetWebJobSlotResponse, error) { + result := WebAppsGetWebJobSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.WebJob); err != nil { + return WebAppsGetWebJobSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getWebJobSlotHandleError handles the GetWebJobSlot error response. +func (client *WebAppsClient) getWebJobSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetWebSiteContainerLogs - Description for Gets the last lines of docker logs for the given site +// If the operation fails it returns a generic error. +func (client *WebAppsClient) GetWebSiteContainerLogs(ctx context.Context, resourceGroupName string, name string, options *WebAppsGetWebSiteContainerLogsOptions) (WebAppsGetWebSiteContainerLogsResponse, error) { + req, err := client.getWebSiteContainerLogsCreateRequest(ctx, resourceGroupName, name, options) + if err != nil { + return WebAppsGetWebSiteContainerLogsResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsGetWebSiteContainerLogsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { + return WebAppsGetWebSiteContainerLogsResponse{}, client.getWebSiteContainerLogsHandleError(resp) + } + return WebAppsGetWebSiteContainerLogsResponse{RawResponse: resp}, nil +} + +// getWebSiteContainerLogsCreateRequest creates the GetWebSiteContainerLogs request. +func (client *WebAppsClient) getWebSiteContainerLogsCreateRequest(ctx context.Context, resourceGroupName string, name string, options *WebAppsGetWebSiteContainerLogsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/containerlogs" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.SkipBodyDownload() + req.Raw().Header.Set("Accept", "application/octet-stream") + return req, nil +} + +// getWebSiteContainerLogsHandleError handles the GetWebSiteContainerLogs error response. +func (client *WebAppsClient) getWebSiteContainerLogsHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + if len(body) == 0 { + return runtime.NewResponseError(errors.New(resp.Status), resp) + } + return runtime.NewResponseError(errors.New(string(body)), resp) +} + +// GetWebSiteContainerLogsSlot - Description for Gets the last lines of docker logs for the given site +// If the operation fails it returns a generic error. +func (client *WebAppsClient) GetWebSiteContainerLogsSlot(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsGetWebSiteContainerLogsSlotOptions) (WebAppsGetWebSiteContainerLogsSlotResponse, error) { + req, err := client.getWebSiteContainerLogsSlotCreateRequest(ctx, resourceGroupName, name, slot, options) + if err != nil { + return WebAppsGetWebSiteContainerLogsSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsGetWebSiteContainerLogsSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { + return WebAppsGetWebSiteContainerLogsSlotResponse{}, client.getWebSiteContainerLogsSlotHandleError(resp) + } + return WebAppsGetWebSiteContainerLogsSlotResponse{RawResponse: resp}, nil +} + +// getWebSiteContainerLogsSlotCreateRequest creates the GetWebSiteContainerLogsSlot request. +func (client *WebAppsClient) getWebSiteContainerLogsSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsGetWebSiteContainerLogsSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/containerlogs" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.SkipBodyDownload() + req.Raw().Header.Set("Accept", "application/octet-stream") + return req, nil +} + +// getWebSiteContainerLogsSlotHandleError handles the GetWebSiteContainerLogsSlot error response. +func (client *WebAppsClient) getWebSiteContainerLogsSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + if len(body) == 0 { + return runtime.NewResponseError(errors.New(resp.Status), resp) + } + return runtime.NewResponseError(errors.New(string(body)), resp) +} + +// BeginInstallSiteExtension - Description for Install site extension on a web site, or a deployment slot. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) BeginInstallSiteExtension(ctx context.Context, resourceGroupName string, name string, siteExtensionID string, options *WebAppsBeginInstallSiteExtensionOptions) (WebAppsInstallSiteExtensionPollerResponse, error) { + resp, err := client.installSiteExtension(ctx, resourceGroupName, name, siteExtensionID, options) + if err != nil { + return WebAppsInstallSiteExtensionPollerResponse{}, err + } + result := WebAppsInstallSiteExtensionPollerResponse{ + RawResponse: resp, + } + pt, err := armruntime.NewPoller("WebAppsClient.InstallSiteExtension", "", resp, client.pl, client.installSiteExtensionHandleError) + if err != nil { + return WebAppsInstallSiteExtensionPollerResponse{}, err + } + result.Poller = &WebAppsInstallSiteExtensionPoller{ + pt: pt, + } + return result, nil +} + +// InstallSiteExtension - Description for Install site extension on a web site, or a deployment slot. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) installSiteExtension(ctx context.Context, resourceGroupName string, name string, siteExtensionID string, options *WebAppsBeginInstallSiteExtensionOptions) (*http.Response, error) { + req, err := client.installSiteExtensionCreateRequest(ctx, resourceGroupName, name, siteExtensionID, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, client.installSiteExtensionHandleError(resp) + } + return resp, nil +} + +// installSiteExtensionCreateRequest creates the InstallSiteExtension request. +func (client *WebAppsClient) installSiteExtensionCreateRequest(ctx context.Context, resourceGroupName string, name string, siteExtensionID string, options *WebAppsBeginInstallSiteExtensionOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/siteextensions/{siteExtensionId}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if siteExtensionID == "" { + return nil, errors.New("parameter siteExtensionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{siteExtensionId}", url.PathEscape(siteExtensionID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// installSiteExtensionHandleError handles the InstallSiteExtension error response. +func (client *WebAppsClient) installSiteExtensionHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + switch resp.StatusCode { + case http.StatusTooManyRequests: + if len(body) == 0 { + return runtime.NewResponseError(errors.New(resp.Status), resp) + } + return runtime.NewResponseError(errors.New(string(body)), resp) + default: + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) + } +} + +// BeginInstallSiteExtensionSlot - Description for Install site extension on a web site, or a deployment slot. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) BeginInstallSiteExtensionSlot(ctx context.Context, resourceGroupName string, name string, siteExtensionID string, slot string, options *WebAppsBeginInstallSiteExtensionSlotOptions) (WebAppsInstallSiteExtensionSlotPollerResponse, error) { + resp, err := client.installSiteExtensionSlot(ctx, resourceGroupName, name, siteExtensionID, slot, options) + if err != nil { + return WebAppsInstallSiteExtensionSlotPollerResponse{}, err + } + result := WebAppsInstallSiteExtensionSlotPollerResponse{ + RawResponse: resp, + } + pt, err := armruntime.NewPoller("WebAppsClient.InstallSiteExtensionSlot", "", resp, client.pl, client.installSiteExtensionSlotHandleError) + if err != nil { + return WebAppsInstallSiteExtensionSlotPollerResponse{}, err + } + result.Poller = &WebAppsInstallSiteExtensionSlotPoller{ + pt: pt, + } + return result, nil +} + +// InstallSiteExtensionSlot - Description for Install site extension on a web site, or a deployment slot. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) installSiteExtensionSlot(ctx context.Context, resourceGroupName string, name string, siteExtensionID string, slot string, options *WebAppsBeginInstallSiteExtensionSlotOptions) (*http.Response, error) { + req, err := client.installSiteExtensionSlotCreateRequest(ctx, resourceGroupName, name, siteExtensionID, slot, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, client.installSiteExtensionSlotHandleError(resp) + } + return resp, nil +} + +// installSiteExtensionSlotCreateRequest creates the InstallSiteExtensionSlot request. +func (client *WebAppsClient) installSiteExtensionSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, siteExtensionID string, slot string, options *WebAppsBeginInstallSiteExtensionSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/siteextensions/{siteExtensionId}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if siteExtensionID == "" { + return nil, errors.New("parameter siteExtensionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{siteExtensionId}", url.PathEscape(siteExtensionID)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// installSiteExtensionSlotHandleError handles the InstallSiteExtensionSlot error response. +func (client *WebAppsClient) installSiteExtensionSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + switch resp.StatusCode { + case http.StatusTooManyRequests: + if len(body) == 0 { + return runtime.NewResponseError(errors.New(resp.Status), resp) + } + return runtime.NewResponseError(errors.New(string(body)), resp) + default: + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) + } +} + +// IsCloneable - Description for Shows whether an app can be cloned to another resource group or subscription. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) IsCloneable(ctx context.Context, resourceGroupName string, name string, options *WebAppsIsCloneableOptions) (WebAppsIsCloneableResponse, error) { + req, err := client.isCloneableCreateRequest(ctx, resourceGroupName, name, options) + if err != nil { + return WebAppsIsCloneableResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsIsCloneableResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsIsCloneableResponse{}, client.isCloneableHandleError(resp) + } + return client.isCloneableHandleResponse(resp) +} + +// isCloneableCreateRequest creates the IsCloneable request. +func (client *WebAppsClient) isCloneableCreateRequest(ctx context.Context, resourceGroupName string, name string, options *WebAppsIsCloneableOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/iscloneable" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// isCloneableHandleResponse handles the IsCloneable response. +func (client *WebAppsClient) isCloneableHandleResponse(resp *http.Response) (WebAppsIsCloneableResponse, error) { + result := WebAppsIsCloneableResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.SiteCloneability); err != nil { + return WebAppsIsCloneableResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// isCloneableHandleError handles the IsCloneable error response. +func (client *WebAppsClient) isCloneableHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// IsCloneableSlot - Description for Shows whether an app can be cloned to another resource group or subscription. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) IsCloneableSlot(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsIsCloneableSlotOptions) (WebAppsIsCloneableSlotResponse, error) { + req, err := client.isCloneableSlotCreateRequest(ctx, resourceGroupName, name, slot, options) + if err != nil { + return WebAppsIsCloneableSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsIsCloneableSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsIsCloneableSlotResponse{}, client.isCloneableSlotHandleError(resp) + } + return client.isCloneableSlotHandleResponse(resp) +} + +// isCloneableSlotCreateRequest creates the IsCloneableSlot request. +func (client *WebAppsClient) isCloneableSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsIsCloneableSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/iscloneable" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// isCloneableSlotHandleResponse handles the IsCloneableSlot response. +func (client *WebAppsClient) isCloneableSlotHandleResponse(resp *http.Response) (WebAppsIsCloneableSlotResponse, error) { + result := WebAppsIsCloneableSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.SiteCloneability); err != nil { + return WebAppsIsCloneableSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// isCloneableSlotHandleError handles the IsCloneableSlot error response. +func (client *WebAppsClient) isCloneableSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// List - Description for Get all apps for a subscription. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) List(options *WebAppsListOptions) *WebAppsListPager { + return &WebAppsListPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listCreateRequest(ctx, options) + }, + advancer: func(ctx context.Context, resp WebAppsListResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.WebAppCollection.NextLink) + }, + } +} + +// listCreateRequest creates the List request. +func (client *WebAppsClient) listCreateRequest(ctx context.Context, options *WebAppsListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Web/sites" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listHandleResponse handles the List response. +func (client *WebAppsClient) listHandleResponse(resp *http.Response) (WebAppsListResponse, error) { + result := WebAppsListResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.WebAppCollection); err != nil { + return WebAppsListResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listHandleError handles the List error response. +func (client *WebAppsClient) listHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListApplicationSettings - Description for Gets the application settings of an app. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) ListApplicationSettings(ctx context.Context, resourceGroupName string, name string, options *WebAppsListApplicationSettingsOptions) (WebAppsListApplicationSettingsResponse, error) { + req, err := client.listApplicationSettingsCreateRequest(ctx, resourceGroupName, name, options) + if err != nil { + return WebAppsListApplicationSettingsResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsListApplicationSettingsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsListApplicationSettingsResponse{}, client.listApplicationSettingsHandleError(resp) + } + return client.listApplicationSettingsHandleResponse(resp) +} + +// listApplicationSettingsCreateRequest creates the ListApplicationSettings request. +func (client *WebAppsClient) listApplicationSettingsCreateRequest(ctx context.Context, resourceGroupName string, name string, options *WebAppsListApplicationSettingsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/appsettings/list" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listApplicationSettingsHandleResponse handles the ListApplicationSettings response. +func (client *WebAppsClient) listApplicationSettingsHandleResponse(resp *http.Response) (WebAppsListApplicationSettingsResponse, error) { + result := WebAppsListApplicationSettingsResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.StringDictionary); err != nil { + return WebAppsListApplicationSettingsResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listApplicationSettingsHandleError handles the ListApplicationSettings error response. +func (client *WebAppsClient) listApplicationSettingsHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListApplicationSettingsSlot - Description for Gets the application settings of an app. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) ListApplicationSettingsSlot(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsListApplicationSettingsSlotOptions) (WebAppsListApplicationSettingsSlotResponse, error) { + req, err := client.listApplicationSettingsSlotCreateRequest(ctx, resourceGroupName, name, slot, options) + if err != nil { + return WebAppsListApplicationSettingsSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsListApplicationSettingsSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsListApplicationSettingsSlotResponse{}, client.listApplicationSettingsSlotHandleError(resp) + } + return client.listApplicationSettingsSlotHandleResponse(resp) +} + +// listApplicationSettingsSlotCreateRequest creates the ListApplicationSettingsSlot request. +func (client *WebAppsClient) listApplicationSettingsSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsListApplicationSettingsSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/appsettings/list" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listApplicationSettingsSlotHandleResponse handles the ListApplicationSettingsSlot response. +func (client *WebAppsClient) listApplicationSettingsSlotHandleResponse(resp *http.Response) (WebAppsListApplicationSettingsSlotResponse, error) { + result := WebAppsListApplicationSettingsSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.StringDictionary); err != nil { + return WebAppsListApplicationSettingsSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listApplicationSettingsSlotHandleError handles the ListApplicationSettingsSlot error response. +func (client *WebAppsClient) listApplicationSettingsSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListAzureStorageAccounts - Description for Gets the Azure storage account configurations of an app. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) ListAzureStorageAccounts(ctx context.Context, resourceGroupName string, name string, options *WebAppsListAzureStorageAccountsOptions) (WebAppsListAzureStorageAccountsResponse, error) { + req, err := client.listAzureStorageAccountsCreateRequest(ctx, resourceGroupName, name, options) + if err != nil { + return WebAppsListAzureStorageAccountsResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsListAzureStorageAccountsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsListAzureStorageAccountsResponse{}, client.listAzureStorageAccountsHandleError(resp) + } + return client.listAzureStorageAccountsHandleResponse(resp) +} + +// listAzureStorageAccountsCreateRequest creates the ListAzureStorageAccounts request. +func (client *WebAppsClient) listAzureStorageAccountsCreateRequest(ctx context.Context, resourceGroupName string, name string, options *WebAppsListAzureStorageAccountsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/azurestorageaccounts/list" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listAzureStorageAccountsHandleResponse handles the ListAzureStorageAccounts response. +func (client *WebAppsClient) listAzureStorageAccountsHandleResponse(resp *http.Response) (WebAppsListAzureStorageAccountsResponse, error) { + result := WebAppsListAzureStorageAccountsResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.AzureStoragePropertyDictionaryResource); err != nil { + return WebAppsListAzureStorageAccountsResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listAzureStorageAccountsHandleError handles the ListAzureStorageAccounts error response. +func (client *WebAppsClient) listAzureStorageAccountsHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListAzureStorageAccountsSlot - Description for Gets the Azure storage account configurations of an app. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) ListAzureStorageAccountsSlot(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsListAzureStorageAccountsSlotOptions) (WebAppsListAzureStorageAccountsSlotResponse, error) { + req, err := client.listAzureStorageAccountsSlotCreateRequest(ctx, resourceGroupName, name, slot, options) + if err != nil { + return WebAppsListAzureStorageAccountsSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsListAzureStorageAccountsSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsListAzureStorageAccountsSlotResponse{}, client.listAzureStorageAccountsSlotHandleError(resp) + } + return client.listAzureStorageAccountsSlotHandleResponse(resp) +} + +// listAzureStorageAccountsSlotCreateRequest creates the ListAzureStorageAccountsSlot request. +func (client *WebAppsClient) listAzureStorageAccountsSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsListAzureStorageAccountsSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/azurestorageaccounts/list" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listAzureStorageAccountsSlotHandleResponse handles the ListAzureStorageAccountsSlot response. +func (client *WebAppsClient) listAzureStorageAccountsSlotHandleResponse(resp *http.Response) (WebAppsListAzureStorageAccountsSlotResponse, error) { + result := WebAppsListAzureStorageAccountsSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.AzureStoragePropertyDictionaryResource); err != nil { + return WebAppsListAzureStorageAccountsSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listAzureStorageAccountsSlotHandleError handles the ListAzureStorageAccountsSlot error response. +func (client *WebAppsClient) listAzureStorageAccountsSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListBackupStatusSecrets - Description for Gets status of a web app backup that may be in progress, including secrets associated with the backup, such +// as the Azure Storage SAS URL. Also can be used to update the SAS URL for the +// backup if a new URL is passed in the request body. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) ListBackupStatusSecrets(ctx context.Context, resourceGroupName string, name string, backupID string, request BackupRequest, options *WebAppsListBackupStatusSecretsOptions) (WebAppsListBackupStatusSecretsResponse, error) { + req, err := client.listBackupStatusSecretsCreateRequest(ctx, resourceGroupName, name, backupID, request, options) + if err != nil { + return WebAppsListBackupStatusSecretsResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsListBackupStatusSecretsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsListBackupStatusSecretsResponse{}, client.listBackupStatusSecretsHandleError(resp) + } + return client.listBackupStatusSecretsHandleResponse(resp) +} + +// listBackupStatusSecretsCreateRequest creates the ListBackupStatusSecrets request. +func (client *WebAppsClient) listBackupStatusSecretsCreateRequest(ctx context.Context, resourceGroupName string, name string, backupID string, request BackupRequest, options *WebAppsListBackupStatusSecretsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/backups/{backupId}/list" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if backupID == "" { + return nil, errors.New("parameter backupID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{backupId}", url.PathEscape(backupID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, request) +} + +// listBackupStatusSecretsHandleResponse handles the ListBackupStatusSecrets response. +func (client *WebAppsClient) listBackupStatusSecretsHandleResponse(resp *http.Response) (WebAppsListBackupStatusSecretsResponse, error) { + result := WebAppsListBackupStatusSecretsResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.BackupItem); err != nil { + return WebAppsListBackupStatusSecretsResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listBackupStatusSecretsHandleError handles the ListBackupStatusSecrets error response. +func (client *WebAppsClient) listBackupStatusSecretsHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListBackupStatusSecretsSlot - Description for Gets status of a web app backup that may be in progress, including secrets associated with the backup, +// such as the Azure Storage SAS URL. Also can be used to update the SAS URL for the +// backup if a new URL is passed in the request body. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) ListBackupStatusSecretsSlot(ctx context.Context, resourceGroupName string, name string, backupID string, slot string, request BackupRequest, options *WebAppsListBackupStatusSecretsSlotOptions) (WebAppsListBackupStatusSecretsSlotResponse, error) { + req, err := client.listBackupStatusSecretsSlotCreateRequest(ctx, resourceGroupName, name, backupID, slot, request, options) + if err != nil { + return WebAppsListBackupStatusSecretsSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsListBackupStatusSecretsSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsListBackupStatusSecretsSlotResponse{}, client.listBackupStatusSecretsSlotHandleError(resp) + } + return client.listBackupStatusSecretsSlotHandleResponse(resp) +} + +// listBackupStatusSecretsSlotCreateRequest creates the ListBackupStatusSecretsSlot request. +func (client *WebAppsClient) listBackupStatusSecretsSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, backupID string, slot string, request BackupRequest, options *WebAppsListBackupStatusSecretsSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups/{backupId}/list" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if backupID == "" { + return nil, errors.New("parameter backupID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{backupId}", url.PathEscape(backupID)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, request) +} + +// listBackupStatusSecretsSlotHandleResponse handles the ListBackupStatusSecretsSlot response. +func (client *WebAppsClient) listBackupStatusSecretsSlotHandleResponse(resp *http.Response) (WebAppsListBackupStatusSecretsSlotResponse, error) { + result := WebAppsListBackupStatusSecretsSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.BackupItem); err != nil { + return WebAppsListBackupStatusSecretsSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listBackupStatusSecretsSlotHandleError handles the ListBackupStatusSecretsSlot error response. +func (client *WebAppsClient) listBackupStatusSecretsSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListBackups - Description for Gets existing backups of an app. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) ListBackups(resourceGroupName string, name string, options *WebAppsListBackupsOptions) *WebAppsListBackupsPager { + return &WebAppsListBackupsPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listBackupsCreateRequest(ctx, resourceGroupName, name, options) + }, + advancer: func(ctx context.Context, resp WebAppsListBackupsResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.BackupItemCollection.NextLink) + }, + } +} + +// listBackupsCreateRequest creates the ListBackups request. +func (client *WebAppsClient) listBackupsCreateRequest(ctx context.Context, resourceGroupName string, name string, options *WebAppsListBackupsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/backups" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listBackupsHandleResponse handles the ListBackups response. +func (client *WebAppsClient) listBackupsHandleResponse(resp *http.Response) (WebAppsListBackupsResponse, error) { + result := WebAppsListBackupsResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.BackupItemCollection); err != nil { + return WebAppsListBackupsResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listBackupsHandleError handles the ListBackups error response. +func (client *WebAppsClient) listBackupsHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListBackupsSlot - Description for Gets existing backups of an app. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) ListBackupsSlot(resourceGroupName string, name string, slot string, options *WebAppsListBackupsSlotOptions) *WebAppsListBackupsSlotPager { + return &WebAppsListBackupsSlotPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listBackupsSlotCreateRequest(ctx, resourceGroupName, name, slot, options) + }, + advancer: func(ctx context.Context, resp WebAppsListBackupsSlotResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.BackupItemCollection.NextLink) + }, + } +} + +// listBackupsSlotCreateRequest creates the ListBackupsSlot request. +func (client *WebAppsClient) listBackupsSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsListBackupsSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listBackupsSlotHandleResponse handles the ListBackupsSlot response. +func (client *WebAppsClient) listBackupsSlotHandleResponse(resp *http.Response) (WebAppsListBackupsSlotResponse, error) { + result := WebAppsListBackupsSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.BackupItemCollection); err != nil { + return WebAppsListBackupsSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listBackupsSlotHandleError handles the ListBackupsSlot error response. +func (client *WebAppsClient) listBackupsSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListBasicPublishingCredentialsPolicies - Description for Returns whether Scm basic auth is allowed and whether Ftp is allowed for a given site. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) ListBasicPublishingCredentialsPolicies(resourceGroupName string, name string, options *WebAppsListBasicPublishingCredentialsPoliciesOptions) *WebAppsListBasicPublishingCredentialsPoliciesPager { + return &WebAppsListBasicPublishingCredentialsPoliciesPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listBasicPublishingCredentialsPoliciesCreateRequest(ctx, resourceGroupName, name, options) + }, + advancer: func(ctx context.Context, resp WebAppsListBasicPublishingCredentialsPoliciesResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.PublishingCredentialsPoliciesCollection.NextLink) + }, + } +} + +// listBasicPublishingCredentialsPoliciesCreateRequest creates the ListBasicPublishingCredentialsPolicies request. +func (client *WebAppsClient) listBasicPublishingCredentialsPoliciesCreateRequest(ctx context.Context, resourceGroupName string, name string, options *WebAppsListBasicPublishingCredentialsPoliciesOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/basicPublishingCredentialsPolicies" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listBasicPublishingCredentialsPoliciesHandleResponse handles the ListBasicPublishingCredentialsPolicies response. +func (client *WebAppsClient) listBasicPublishingCredentialsPoliciesHandleResponse(resp *http.Response) (WebAppsListBasicPublishingCredentialsPoliciesResponse, error) { + result := WebAppsListBasicPublishingCredentialsPoliciesResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.PublishingCredentialsPoliciesCollection); err != nil { + return WebAppsListBasicPublishingCredentialsPoliciesResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listBasicPublishingCredentialsPoliciesHandleError handles the ListBasicPublishingCredentialsPolicies error response. +func (client *WebAppsClient) listBasicPublishingCredentialsPoliciesHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListBasicPublishingCredentialsPoliciesSlot - Description for Returns whether Scm basic auth is allowed and whether Ftp is allowed for a given site. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) ListBasicPublishingCredentialsPoliciesSlot(resourceGroupName string, name string, slot string, options *WebAppsListBasicPublishingCredentialsPoliciesSlotOptions) *WebAppsListBasicPublishingCredentialsPoliciesSlotPager { + return &WebAppsListBasicPublishingCredentialsPoliciesSlotPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listBasicPublishingCredentialsPoliciesSlotCreateRequest(ctx, resourceGroupName, name, slot, options) + }, + advancer: func(ctx context.Context, resp WebAppsListBasicPublishingCredentialsPoliciesSlotResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.PublishingCredentialsPoliciesCollection.NextLink) + }, + } +} + +// listBasicPublishingCredentialsPoliciesSlotCreateRequest creates the ListBasicPublishingCredentialsPoliciesSlot request. +func (client *WebAppsClient) listBasicPublishingCredentialsPoliciesSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsListBasicPublishingCredentialsPoliciesSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/basicPublishingCredentialsPolicies" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listBasicPublishingCredentialsPoliciesSlotHandleResponse handles the ListBasicPublishingCredentialsPoliciesSlot response. +func (client *WebAppsClient) listBasicPublishingCredentialsPoliciesSlotHandleResponse(resp *http.Response) (WebAppsListBasicPublishingCredentialsPoliciesSlotResponse, error) { + result := WebAppsListBasicPublishingCredentialsPoliciesSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.PublishingCredentialsPoliciesCollection); err != nil { + return WebAppsListBasicPublishingCredentialsPoliciesSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listBasicPublishingCredentialsPoliciesSlotHandleError handles the ListBasicPublishingCredentialsPoliciesSlot error response. +func (client *WebAppsClient) listBasicPublishingCredentialsPoliciesSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListByResourceGroup - Description for Gets all web, mobile, and API apps in the specified resource group. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) ListByResourceGroup(resourceGroupName string, options *WebAppsListByResourceGroupOptions) *WebAppsListByResourceGroupPager { + return &WebAppsListByResourceGroupPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) + }, + advancer: func(ctx context.Context, resp WebAppsListByResourceGroupResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.WebAppCollection.NextLink) + }, + } +} + +// listByResourceGroupCreateRequest creates the ListByResourceGroup request. +func (client *WebAppsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *WebAppsListByResourceGroupOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + if options != nil && options.IncludeSlots != nil { + reqQP.Set("includeSlots", strconv.FormatBool(*options.IncludeSlots)) + } + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listByResourceGroupHandleResponse handles the ListByResourceGroup response. +func (client *WebAppsClient) listByResourceGroupHandleResponse(resp *http.Response) (WebAppsListByResourceGroupResponse, error) { + result := WebAppsListByResourceGroupResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.WebAppCollection); err != nil { + return WebAppsListByResourceGroupResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listByResourceGroupHandleError handles the ListByResourceGroup error response. +func (client *WebAppsClient) listByResourceGroupHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListConfigurationSnapshotInfo - Description for Gets a list of web app configuration snapshots identifiers. Each element of the list contains a timestamp +// and the ID of the snapshot. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) ListConfigurationSnapshotInfo(resourceGroupName string, name string, options *WebAppsListConfigurationSnapshotInfoOptions) *WebAppsListConfigurationSnapshotInfoPager { + return &WebAppsListConfigurationSnapshotInfoPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listConfigurationSnapshotInfoCreateRequest(ctx, resourceGroupName, name, options) + }, + advancer: func(ctx context.Context, resp WebAppsListConfigurationSnapshotInfoResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.SiteConfigurationSnapshotInfoCollection.NextLink) + }, + } +} + +// listConfigurationSnapshotInfoCreateRequest creates the ListConfigurationSnapshotInfo request. +func (client *WebAppsClient) listConfigurationSnapshotInfoCreateRequest(ctx context.Context, resourceGroupName string, name string, options *WebAppsListConfigurationSnapshotInfoOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web/snapshots" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listConfigurationSnapshotInfoHandleResponse handles the ListConfigurationSnapshotInfo response. +func (client *WebAppsClient) listConfigurationSnapshotInfoHandleResponse(resp *http.Response) (WebAppsListConfigurationSnapshotInfoResponse, error) { + result := WebAppsListConfigurationSnapshotInfoResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.SiteConfigurationSnapshotInfoCollection); err != nil { + return WebAppsListConfigurationSnapshotInfoResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listConfigurationSnapshotInfoHandleError handles the ListConfigurationSnapshotInfo error response. +func (client *WebAppsClient) listConfigurationSnapshotInfoHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListConfigurationSnapshotInfoSlot - Description for Gets a list of web app configuration snapshots identifiers. Each element of the list contains a timestamp +// and the ID of the snapshot. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) ListConfigurationSnapshotInfoSlot(resourceGroupName string, name string, slot string, options *WebAppsListConfigurationSnapshotInfoSlotOptions) *WebAppsListConfigurationSnapshotInfoSlotPager { + return &WebAppsListConfigurationSnapshotInfoSlotPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listConfigurationSnapshotInfoSlotCreateRequest(ctx, resourceGroupName, name, slot, options) + }, + advancer: func(ctx context.Context, resp WebAppsListConfigurationSnapshotInfoSlotResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.SiteConfigurationSnapshotInfoCollection.NextLink) + }, + } +} + +// listConfigurationSnapshotInfoSlotCreateRequest creates the ListConfigurationSnapshotInfoSlot request. +func (client *WebAppsClient) listConfigurationSnapshotInfoSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsListConfigurationSnapshotInfoSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web/snapshots" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listConfigurationSnapshotInfoSlotHandleResponse handles the ListConfigurationSnapshotInfoSlot response. +func (client *WebAppsClient) listConfigurationSnapshotInfoSlotHandleResponse(resp *http.Response) (WebAppsListConfigurationSnapshotInfoSlotResponse, error) { + result := WebAppsListConfigurationSnapshotInfoSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.SiteConfigurationSnapshotInfoCollection); err != nil { + return WebAppsListConfigurationSnapshotInfoSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listConfigurationSnapshotInfoSlotHandleError handles the ListConfigurationSnapshotInfoSlot error response. +func (client *WebAppsClient) listConfigurationSnapshotInfoSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListConfigurations - Description for List the configurations of an app +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) ListConfigurations(resourceGroupName string, name string, options *WebAppsListConfigurationsOptions) *WebAppsListConfigurationsPager { + return &WebAppsListConfigurationsPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listConfigurationsCreateRequest(ctx, resourceGroupName, name, options) + }, + advancer: func(ctx context.Context, resp WebAppsListConfigurationsResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.SiteConfigResourceCollection.NextLink) + }, + } +} + +// listConfigurationsCreateRequest creates the ListConfigurations request. +func (client *WebAppsClient) listConfigurationsCreateRequest(ctx context.Context, resourceGroupName string, name string, options *WebAppsListConfigurationsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listConfigurationsHandleResponse handles the ListConfigurations response. +func (client *WebAppsClient) listConfigurationsHandleResponse(resp *http.Response) (WebAppsListConfigurationsResponse, error) { + result := WebAppsListConfigurationsResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.SiteConfigResourceCollection); err != nil { + return WebAppsListConfigurationsResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listConfigurationsHandleError handles the ListConfigurations error response. +func (client *WebAppsClient) listConfigurationsHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListConfigurationsSlot - Description for List the configurations of an app +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) ListConfigurationsSlot(resourceGroupName string, name string, slot string, options *WebAppsListConfigurationsSlotOptions) *WebAppsListConfigurationsSlotPager { + return &WebAppsListConfigurationsSlotPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listConfigurationsSlotCreateRequest(ctx, resourceGroupName, name, slot, options) + }, + advancer: func(ctx context.Context, resp WebAppsListConfigurationsSlotResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.SiteConfigResourceCollection.NextLink) + }, + } +} + +// listConfigurationsSlotCreateRequest creates the ListConfigurationsSlot request. +func (client *WebAppsClient) listConfigurationsSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsListConfigurationsSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listConfigurationsSlotHandleResponse handles the ListConfigurationsSlot response. +func (client *WebAppsClient) listConfigurationsSlotHandleResponse(resp *http.Response) (WebAppsListConfigurationsSlotResponse, error) { + result := WebAppsListConfigurationsSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.SiteConfigResourceCollection); err != nil { + return WebAppsListConfigurationsSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listConfigurationsSlotHandleError handles the ListConfigurationsSlot error response. +func (client *WebAppsClient) listConfigurationsSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListConnectionStrings - Description for Gets the connection strings of an app. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) ListConnectionStrings(ctx context.Context, resourceGroupName string, name string, options *WebAppsListConnectionStringsOptions) (WebAppsListConnectionStringsResponse, error) { + req, err := client.listConnectionStringsCreateRequest(ctx, resourceGroupName, name, options) + if err != nil { + return WebAppsListConnectionStringsResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsListConnectionStringsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsListConnectionStringsResponse{}, client.listConnectionStringsHandleError(resp) + } + return client.listConnectionStringsHandleResponse(resp) +} + +// listConnectionStringsCreateRequest creates the ListConnectionStrings request. +func (client *WebAppsClient) listConnectionStringsCreateRequest(ctx context.Context, resourceGroupName string, name string, options *WebAppsListConnectionStringsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/connectionstrings/list" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listConnectionStringsHandleResponse handles the ListConnectionStrings response. +func (client *WebAppsClient) listConnectionStringsHandleResponse(resp *http.Response) (WebAppsListConnectionStringsResponse, error) { + result := WebAppsListConnectionStringsResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.ConnectionStringDictionary); err != nil { + return WebAppsListConnectionStringsResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listConnectionStringsHandleError handles the ListConnectionStrings error response. +func (client *WebAppsClient) listConnectionStringsHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListConnectionStringsSlot - Description for Gets the connection strings of an app. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) ListConnectionStringsSlot(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsListConnectionStringsSlotOptions) (WebAppsListConnectionStringsSlotResponse, error) { + req, err := client.listConnectionStringsSlotCreateRequest(ctx, resourceGroupName, name, slot, options) + if err != nil { + return WebAppsListConnectionStringsSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsListConnectionStringsSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsListConnectionStringsSlotResponse{}, client.listConnectionStringsSlotHandleError(resp) + } + return client.listConnectionStringsSlotHandleResponse(resp) +} + +// listConnectionStringsSlotCreateRequest creates the ListConnectionStringsSlot request. +func (client *WebAppsClient) listConnectionStringsSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsListConnectionStringsSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/connectionstrings/list" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listConnectionStringsSlotHandleResponse handles the ListConnectionStringsSlot response. +func (client *WebAppsClient) listConnectionStringsSlotHandleResponse(resp *http.Response) (WebAppsListConnectionStringsSlotResponse, error) { + result := WebAppsListConnectionStringsSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.ConnectionStringDictionary); err != nil { + return WebAppsListConnectionStringsSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listConnectionStringsSlotHandleError handles the ListConnectionStringsSlot error response. +func (client *WebAppsClient) listConnectionStringsSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListContinuousWebJobs - Description for List continuous web jobs for an app, or a deployment slot. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) ListContinuousWebJobs(resourceGroupName string, name string, options *WebAppsListContinuousWebJobsOptions) *WebAppsListContinuousWebJobsPager { + return &WebAppsListContinuousWebJobsPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listContinuousWebJobsCreateRequest(ctx, resourceGroupName, name, options) + }, + advancer: func(ctx context.Context, resp WebAppsListContinuousWebJobsResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.ContinuousWebJobCollection.NextLink) + }, + } +} + +// listContinuousWebJobsCreateRequest creates the ListContinuousWebJobs request. +func (client *WebAppsClient) listContinuousWebJobsCreateRequest(ctx context.Context, resourceGroupName string, name string, options *WebAppsListContinuousWebJobsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/continuouswebjobs" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listContinuousWebJobsHandleResponse handles the ListContinuousWebJobs response. +func (client *WebAppsClient) listContinuousWebJobsHandleResponse(resp *http.Response) (WebAppsListContinuousWebJobsResponse, error) { + result := WebAppsListContinuousWebJobsResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.ContinuousWebJobCollection); err != nil { + return WebAppsListContinuousWebJobsResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listContinuousWebJobsHandleError handles the ListContinuousWebJobs error response. +func (client *WebAppsClient) listContinuousWebJobsHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListContinuousWebJobsSlot - Description for List continuous web jobs for an app, or a deployment slot. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) ListContinuousWebJobsSlot(resourceGroupName string, name string, slot string, options *WebAppsListContinuousWebJobsSlotOptions) *WebAppsListContinuousWebJobsSlotPager { + return &WebAppsListContinuousWebJobsSlotPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listContinuousWebJobsSlotCreateRequest(ctx, resourceGroupName, name, slot, options) + }, + advancer: func(ctx context.Context, resp WebAppsListContinuousWebJobsSlotResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.ContinuousWebJobCollection.NextLink) + }, + } +} + +// listContinuousWebJobsSlotCreateRequest creates the ListContinuousWebJobsSlot request. +func (client *WebAppsClient) listContinuousWebJobsSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsListContinuousWebJobsSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/continuouswebjobs" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listContinuousWebJobsSlotHandleResponse handles the ListContinuousWebJobsSlot response. +func (client *WebAppsClient) listContinuousWebJobsSlotHandleResponse(resp *http.Response) (WebAppsListContinuousWebJobsSlotResponse, error) { + result := WebAppsListContinuousWebJobsSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.ContinuousWebJobCollection); err != nil { + return WebAppsListContinuousWebJobsSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listContinuousWebJobsSlotHandleError handles the ListContinuousWebJobsSlot error response. +func (client *WebAppsClient) listContinuousWebJobsSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListDeploymentLog - Description for List deployment log for specific deployment for an app, or a deployment slot. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) ListDeploymentLog(ctx context.Context, resourceGroupName string, name string, id string, options *WebAppsListDeploymentLogOptions) (WebAppsListDeploymentLogResponse, error) { + req, err := client.listDeploymentLogCreateRequest(ctx, resourceGroupName, name, id, options) + if err != nil { + return WebAppsListDeploymentLogResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsListDeploymentLogResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsListDeploymentLogResponse{}, client.listDeploymentLogHandleError(resp) + } + return client.listDeploymentLogHandleResponse(resp) +} + +// listDeploymentLogCreateRequest creates the ListDeploymentLog request. +func (client *WebAppsClient) listDeploymentLogCreateRequest(ctx context.Context, resourceGroupName string, name string, id string, options *WebAppsListDeploymentLogOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/deployments/{id}/log" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if id == "" { + return nil, errors.New("parameter id cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{id}", url.PathEscape(id)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listDeploymentLogHandleResponse handles the ListDeploymentLog response. +func (client *WebAppsClient) listDeploymentLogHandleResponse(resp *http.Response) (WebAppsListDeploymentLogResponse, error) { + result := WebAppsListDeploymentLogResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.Deployment); err != nil { + return WebAppsListDeploymentLogResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listDeploymentLogHandleError handles the ListDeploymentLog error response. +func (client *WebAppsClient) listDeploymentLogHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListDeploymentLogSlot - Description for List deployment log for specific deployment for an app, or a deployment slot. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) ListDeploymentLogSlot(ctx context.Context, resourceGroupName string, name string, id string, slot string, options *WebAppsListDeploymentLogSlotOptions) (WebAppsListDeploymentLogSlotResponse, error) { + req, err := client.listDeploymentLogSlotCreateRequest(ctx, resourceGroupName, name, id, slot, options) + if err != nil { + return WebAppsListDeploymentLogSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsListDeploymentLogSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsListDeploymentLogSlotResponse{}, client.listDeploymentLogSlotHandleError(resp) + } + return client.listDeploymentLogSlotHandleResponse(resp) +} + +// listDeploymentLogSlotCreateRequest creates the ListDeploymentLogSlot request. +func (client *WebAppsClient) listDeploymentLogSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, id string, slot string, options *WebAppsListDeploymentLogSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/deployments/{id}/log" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if id == "" { + return nil, errors.New("parameter id cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{id}", url.PathEscape(id)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listDeploymentLogSlotHandleResponse handles the ListDeploymentLogSlot response. +func (client *WebAppsClient) listDeploymentLogSlotHandleResponse(resp *http.Response) (WebAppsListDeploymentLogSlotResponse, error) { + result := WebAppsListDeploymentLogSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.Deployment); err != nil { + return WebAppsListDeploymentLogSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listDeploymentLogSlotHandleError handles the ListDeploymentLogSlot error response. +func (client *WebAppsClient) listDeploymentLogSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListDeployments - Description for List deployments for an app, or a deployment slot. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) ListDeployments(resourceGroupName string, name string, options *WebAppsListDeploymentsOptions) *WebAppsListDeploymentsPager { + return &WebAppsListDeploymentsPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listDeploymentsCreateRequest(ctx, resourceGroupName, name, options) + }, + advancer: func(ctx context.Context, resp WebAppsListDeploymentsResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.DeploymentCollection.NextLink) + }, + } +} + +// listDeploymentsCreateRequest creates the ListDeployments request. +func (client *WebAppsClient) listDeploymentsCreateRequest(ctx context.Context, resourceGroupName string, name string, options *WebAppsListDeploymentsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/deployments" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listDeploymentsHandleResponse handles the ListDeployments response. +func (client *WebAppsClient) listDeploymentsHandleResponse(resp *http.Response) (WebAppsListDeploymentsResponse, error) { + result := WebAppsListDeploymentsResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.DeploymentCollection); err != nil { + return WebAppsListDeploymentsResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listDeploymentsHandleError handles the ListDeployments error response. +func (client *WebAppsClient) listDeploymentsHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListDeploymentsSlot - Description for List deployments for an app, or a deployment slot. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) ListDeploymentsSlot(resourceGroupName string, name string, slot string, options *WebAppsListDeploymentsSlotOptions) *WebAppsListDeploymentsSlotPager { + return &WebAppsListDeploymentsSlotPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listDeploymentsSlotCreateRequest(ctx, resourceGroupName, name, slot, options) + }, + advancer: func(ctx context.Context, resp WebAppsListDeploymentsSlotResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.DeploymentCollection.NextLink) + }, + } +} + +// listDeploymentsSlotCreateRequest creates the ListDeploymentsSlot request. +func (client *WebAppsClient) listDeploymentsSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsListDeploymentsSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/deployments" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listDeploymentsSlotHandleResponse handles the ListDeploymentsSlot response. +func (client *WebAppsClient) listDeploymentsSlotHandleResponse(resp *http.Response) (WebAppsListDeploymentsSlotResponse, error) { + result := WebAppsListDeploymentsSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.DeploymentCollection); err != nil { + return WebAppsListDeploymentsSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listDeploymentsSlotHandleError handles the ListDeploymentsSlot error response. +func (client *WebAppsClient) listDeploymentsSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListDomainOwnershipIdentifiers - Description for Lists ownership identifiers for domain associated with web app. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) ListDomainOwnershipIdentifiers(resourceGroupName string, name string, options *WebAppsListDomainOwnershipIdentifiersOptions) *WebAppsListDomainOwnershipIdentifiersPager { + return &WebAppsListDomainOwnershipIdentifiersPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listDomainOwnershipIdentifiersCreateRequest(ctx, resourceGroupName, name, options) + }, + advancer: func(ctx context.Context, resp WebAppsListDomainOwnershipIdentifiersResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.IdentifierCollection.NextLink) + }, + } +} + +// listDomainOwnershipIdentifiersCreateRequest creates the ListDomainOwnershipIdentifiers request. +func (client *WebAppsClient) listDomainOwnershipIdentifiersCreateRequest(ctx context.Context, resourceGroupName string, name string, options *WebAppsListDomainOwnershipIdentifiersOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/domainOwnershipIdentifiers" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listDomainOwnershipIdentifiersHandleResponse handles the ListDomainOwnershipIdentifiers response. +func (client *WebAppsClient) listDomainOwnershipIdentifiersHandleResponse(resp *http.Response) (WebAppsListDomainOwnershipIdentifiersResponse, error) { + result := WebAppsListDomainOwnershipIdentifiersResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.IdentifierCollection); err != nil { + return WebAppsListDomainOwnershipIdentifiersResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listDomainOwnershipIdentifiersHandleError handles the ListDomainOwnershipIdentifiers error response. +func (client *WebAppsClient) listDomainOwnershipIdentifiersHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListDomainOwnershipIdentifiersSlot - Description for Lists ownership identifiers for domain associated with web app. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) ListDomainOwnershipIdentifiersSlot(resourceGroupName string, name string, slot string, options *WebAppsListDomainOwnershipIdentifiersSlotOptions) *WebAppsListDomainOwnershipIdentifiersSlotPager { + return &WebAppsListDomainOwnershipIdentifiersSlotPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listDomainOwnershipIdentifiersSlotCreateRequest(ctx, resourceGroupName, name, slot, options) + }, + advancer: func(ctx context.Context, resp WebAppsListDomainOwnershipIdentifiersSlotResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.IdentifierCollection.NextLink) + }, + } +} + +// listDomainOwnershipIdentifiersSlotCreateRequest creates the ListDomainOwnershipIdentifiersSlot request. +func (client *WebAppsClient) listDomainOwnershipIdentifiersSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsListDomainOwnershipIdentifiersSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/domainOwnershipIdentifiers" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listDomainOwnershipIdentifiersSlotHandleResponse handles the ListDomainOwnershipIdentifiersSlot response. +func (client *WebAppsClient) listDomainOwnershipIdentifiersSlotHandleResponse(resp *http.Response) (WebAppsListDomainOwnershipIdentifiersSlotResponse, error) { + result := WebAppsListDomainOwnershipIdentifiersSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.IdentifierCollection); err != nil { + return WebAppsListDomainOwnershipIdentifiersSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listDomainOwnershipIdentifiersSlotHandleError handles the ListDomainOwnershipIdentifiersSlot error response. +func (client *WebAppsClient) listDomainOwnershipIdentifiersSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListFunctionKeys - Description for Get function keys for a function in a web site, or a deployment slot. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) ListFunctionKeys(ctx context.Context, resourceGroupName string, name string, functionName string, options *WebAppsListFunctionKeysOptions) (WebAppsListFunctionKeysResponse, error) { + req, err := client.listFunctionKeysCreateRequest(ctx, resourceGroupName, name, functionName, options) + if err != nil { + return WebAppsListFunctionKeysResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsListFunctionKeysResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsListFunctionKeysResponse{}, client.listFunctionKeysHandleError(resp) + } + return client.listFunctionKeysHandleResponse(resp) +} + +// listFunctionKeysCreateRequest creates the ListFunctionKeys request. +func (client *WebAppsClient) listFunctionKeysCreateRequest(ctx context.Context, resourceGroupName string, name string, functionName string, options *WebAppsListFunctionKeysOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}/listkeys" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if functionName == "" { + return nil, errors.New("parameter functionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{functionName}", url.PathEscape(functionName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listFunctionKeysHandleResponse handles the ListFunctionKeys response. +func (client *WebAppsClient) listFunctionKeysHandleResponse(resp *http.Response) (WebAppsListFunctionKeysResponse, error) { + result := WebAppsListFunctionKeysResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.StringDictionary); err != nil { + return WebAppsListFunctionKeysResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listFunctionKeysHandleError handles the ListFunctionKeys error response. +func (client *WebAppsClient) listFunctionKeysHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListFunctionKeysSlot - Description for Get function keys for a function in a web site, or a deployment slot. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) ListFunctionKeysSlot(ctx context.Context, resourceGroupName string, name string, functionName string, slot string, options *WebAppsListFunctionKeysSlotOptions) (WebAppsListFunctionKeysSlotResponse, error) { + req, err := client.listFunctionKeysSlotCreateRequest(ctx, resourceGroupName, name, functionName, slot, options) + if err != nil { + return WebAppsListFunctionKeysSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsListFunctionKeysSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsListFunctionKeysSlotResponse{}, client.listFunctionKeysSlotHandleError(resp) + } + return client.listFunctionKeysSlotHandleResponse(resp) +} + +// listFunctionKeysSlotCreateRequest creates the ListFunctionKeysSlot request. +func (client *WebAppsClient) listFunctionKeysSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, functionName string, slot string, options *WebAppsListFunctionKeysSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}/listkeys" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if functionName == "" { + return nil, errors.New("parameter functionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{functionName}", url.PathEscape(functionName)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listFunctionKeysSlotHandleResponse handles the ListFunctionKeysSlot response. +func (client *WebAppsClient) listFunctionKeysSlotHandleResponse(resp *http.Response) (WebAppsListFunctionKeysSlotResponse, error) { + result := WebAppsListFunctionKeysSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.StringDictionary); err != nil { + return WebAppsListFunctionKeysSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listFunctionKeysSlotHandleError handles the ListFunctionKeysSlot error response. +func (client *WebAppsClient) listFunctionKeysSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListFunctionSecrets - Description for Get function secrets for a function in a web site, or a deployment slot. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) ListFunctionSecrets(ctx context.Context, resourceGroupName string, name string, functionName string, options *WebAppsListFunctionSecretsOptions) (WebAppsListFunctionSecretsResponse, error) { + req, err := client.listFunctionSecretsCreateRequest(ctx, resourceGroupName, name, functionName, options) + if err != nil { + return WebAppsListFunctionSecretsResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsListFunctionSecretsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsListFunctionSecretsResponse{}, client.listFunctionSecretsHandleError(resp) + } + return client.listFunctionSecretsHandleResponse(resp) +} + +// listFunctionSecretsCreateRequest creates the ListFunctionSecrets request. +func (client *WebAppsClient) listFunctionSecretsCreateRequest(ctx context.Context, resourceGroupName string, name string, functionName string, options *WebAppsListFunctionSecretsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}/listsecrets" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if functionName == "" { + return nil, errors.New("parameter functionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{functionName}", url.PathEscape(functionName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listFunctionSecretsHandleResponse handles the ListFunctionSecrets response. +func (client *WebAppsClient) listFunctionSecretsHandleResponse(resp *http.Response) (WebAppsListFunctionSecretsResponse, error) { + result := WebAppsListFunctionSecretsResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.FunctionSecrets); err != nil { + return WebAppsListFunctionSecretsResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listFunctionSecretsHandleError handles the ListFunctionSecrets error response. +func (client *WebAppsClient) listFunctionSecretsHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListFunctionSecretsSlot - Description for Get function secrets for a function in a web site, or a deployment slot. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) ListFunctionSecretsSlot(ctx context.Context, resourceGroupName string, name string, functionName string, slot string, options *WebAppsListFunctionSecretsSlotOptions) (WebAppsListFunctionSecretsSlotResponse, error) { + req, err := client.listFunctionSecretsSlotCreateRequest(ctx, resourceGroupName, name, functionName, slot, options) + if err != nil { + return WebAppsListFunctionSecretsSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsListFunctionSecretsSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsListFunctionSecretsSlotResponse{}, client.listFunctionSecretsSlotHandleError(resp) + } + return client.listFunctionSecretsSlotHandleResponse(resp) +} + +// listFunctionSecretsSlotCreateRequest creates the ListFunctionSecretsSlot request. +func (client *WebAppsClient) listFunctionSecretsSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, functionName string, slot string, options *WebAppsListFunctionSecretsSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}/listsecrets" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if functionName == "" { + return nil, errors.New("parameter functionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{functionName}", url.PathEscape(functionName)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listFunctionSecretsSlotHandleResponse handles the ListFunctionSecretsSlot response. +func (client *WebAppsClient) listFunctionSecretsSlotHandleResponse(resp *http.Response) (WebAppsListFunctionSecretsSlotResponse, error) { + result := WebAppsListFunctionSecretsSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.FunctionSecrets); err != nil { + return WebAppsListFunctionSecretsSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listFunctionSecretsSlotHandleError handles the ListFunctionSecretsSlot error response. +func (client *WebAppsClient) listFunctionSecretsSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListFunctions - Description for List the functions for a web site, or a deployment slot. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) ListFunctions(resourceGroupName string, name string, options *WebAppsListFunctionsOptions) *WebAppsListFunctionsPager { + return &WebAppsListFunctionsPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listFunctionsCreateRequest(ctx, resourceGroupName, name, options) + }, + advancer: func(ctx context.Context, resp WebAppsListFunctionsResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.FunctionEnvelopeCollection.NextLink) + }, + } +} + +// listFunctionsCreateRequest creates the ListFunctions request. +func (client *WebAppsClient) listFunctionsCreateRequest(ctx context.Context, resourceGroupName string, name string, options *WebAppsListFunctionsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listFunctionsHandleResponse handles the ListFunctions response. +func (client *WebAppsClient) listFunctionsHandleResponse(resp *http.Response) (WebAppsListFunctionsResponse, error) { + result := WebAppsListFunctionsResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.FunctionEnvelopeCollection); err != nil { + return WebAppsListFunctionsResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listFunctionsHandleError handles the ListFunctions error response. +func (client *WebAppsClient) listFunctionsHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + switch resp.StatusCode { + case http.StatusNotFound: + if len(body) == 0 { + return runtime.NewResponseError(errors.New(resp.Status), resp) + } + return runtime.NewResponseError(errors.New(string(body)), resp) + default: + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) + } +} + +// ListHostKeys - Description for Get host secrets for a function app. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) ListHostKeys(ctx context.Context, resourceGroupName string, name string, options *WebAppsListHostKeysOptions) (WebAppsListHostKeysResponse, error) { + req, err := client.listHostKeysCreateRequest(ctx, resourceGroupName, name, options) + if err != nil { + return WebAppsListHostKeysResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsListHostKeysResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsListHostKeysResponse{}, client.listHostKeysHandleError(resp) + } + return client.listHostKeysHandleResponse(resp) +} + +// listHostKeysCreateRequest creates the ListHostKeys request. +func (client *WebAppsClient) listHostKeysCreateRequest(ctx context.Context, resourceGroupName string, name string, options *WebAppsListHostKeysOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/host/default/listkeys" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listHostKeysHandleResponse handles the ListHostKeys response. +func (client *WebAppsClient) listHostKeysHandleResponse(resp *http.Response) (WebAppsListHostKeysResponse, error) { + result := WebAppsListHostKeysResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.HostKeys); err != nil { + return WebAppsListHostKeysResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listHostKeysHandleError handles the ListHostKeys error response. +func (client *WebAppsClient) listHostKeysHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListHostKeysSlot - Description for Get host secrets for a function app. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) ListHostKeysSlot(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsListHostKeysSlotOptions) (WebAppsListHostKeysSlotResponse, error) { + req, err := client.listHostKeysSlotCreateRequest(ctx, resourceGroupName, name, slot, options) + if err != nil { + return WebAppsListHostKeysSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsListHostKeysSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsListHostKeysSlotResponse{}, client.listHostKeysSlotHandleError(resp) + } + return client.listHostKeysSlotHandleResponse(resp) +} + +// listHostKeysSlotCreateRequest creates the ListHostKeysSlot request. +func (client *WebAppsClient) listHostKeysSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsListHostKeysSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/host/default/listkeys" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listHostKeysSlotHandleResponse handles the ListHostKeysSlot response. +func (client *WebAppsClient) listHostKeysSlotHandleResponse(resp *http.Response) (WebAppsListHostKeysSlotResponse, error) { + result := WebAppsListHostKeysSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.HostKeys); err != nil { + return WebAppsListHostKeysSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listHostKeysSlotHandleError handles the ListHostKeysSlot error response. +func (client *WebAppsClient) listHostKeysSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListHostNameBindings - Description for Get hostname bindings for an app or a deployment slot. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) ListHostNameBindings(resourceGroupName string, name string, options *WebAppsListHostNameBindingsOptions) *WebAppsListHostNameBindingsPager { + return &WebAppsListHostNameBindingsPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listHostNameBindingsCreateRequest(ctx, resourceGroupName, name, options) + }, + advancer: func(ctx context.Context, resp WebAppsListHostNameBindingsResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.HostNameBindingCollection.NextLink) + }, + } +} + +// listHostNameBindingsCreateRequest creates the ListHostNameBindings request. +func (client *WebAppsClient) listHostNameBindingsCreateRequest(ctx context.Context, resourceGroupName string, name string, options *WebAppsListHostNameBindingsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hostNameBindings" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listHostNameBindingsHandleResponse handles the ListHostNameBindings response. +func (client *WebAppsClient) listHostNameBindingsHandleResponse(resp *http.Response) (WebAppsListHostNameBindingsResponse, error) { + result := WebAppsListHostNameBindingsResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.HostNameBindingCollection); err != nil { + return WebAppsListHostNameBindingsResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listHostNameBindingsHandleError handles the ListHostNameBindings error response. +func (client *WebAppsClient) listHostNameBindingsHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListHostNameBindingsSlot - Description for Get hostname bindings for an app or a deployment slot. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) ListHostNameBindingsSlot(resourceGroupName string, name string, slot string, options *WebAppsListHostNameBindingsSlotOptions) *WebAppsListHostNameBindingsSlotPager { + return &WebAppsListHostNameBindingsSlotPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listHostNameBindingsSlotCreateRequest(ctx, resourceGroupName, name, slot, options) + }, + advancer: func(ctx context.Context, resp WebAppsListHostNameBindingsSlotResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.HostNameBindingCollection.NextLink) + }, + } +} + +// listHostNameBindingsSlotCreateRequest creates the ListHostNameBindingsSlot request. +func (client *WebAppsClient) listHostNameBindingsSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsListHostNameBindingsSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hostNameBindings" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listHostNameBindingsSlotHandleResponse handles the ListHostNameBindingsSlot response. +func (client *WebAppsClient) listHostNameBindingsSlotHandleResponse(resp *http.Response) (WebAppsListHostNameBindingsSlotResponse, error) { + result := WebAppsListHostNameBindingsSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.HostNameBindingCollection); err != nil { + return WebAppsListHostNameBindingsSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listHostNameBindingsSlotHandleError handles the ListHostNameBindingsSlot error response. +func (client *WebAppsClient) listHostNameBindingsSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListHybridConnections - Description for Retrieves all Service Bus Hybrid Connections used by this Web App. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) ListHybridConnections(ctx context.Context, resourceGroupName string, name string, options *WebAppsListHybridConnectionsOptions) (WebAppsListHybridConnectionsResponse, error) { + req, err := client.listHybridConnectionsCreateRequest(ctx, resourceGroupName, name, options) + if err != nil { + return WebAppsListHybridConnectionsResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsListHybridConnectionsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsListHybridConnectionsResponse{}, client.listHybridConnectionsHandleError(resp) + } + return client.listHybridConnectionsHandleResponse(resp) +} + +// listHybridConnectionsCreateRequest creates the ListHybridConnections request. +func (client *WebAppsClient) listHybridConnectionsCreateRequest(ctx context.Context, resourceGroupName string, name string, options *WebAppsListHybridConnectionsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionRelays" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listHybridConnectionsHandleResponse handles the ListHybridConnections response. +func (client *WebAppsClient) listHybridConnectionsHandleResponse(resp *http.Response) (WebAppsListHybridConnectionsResponse, error) { + result := WebAppsListHybridConnectionsResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.HybridConnection); err != nil { + return WebAppsListHybridConnectionsResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listHybridConnectionsHandleError handles the ListHybridConnections error response. +func (client *WebAppsClient) listHybridConnectionsHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListHybridConnectionsSlot - Description for Retrieves all Service Bus Hybrid Connections used by this Web App. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) ListHybridConnectionsSlot(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsListHybridConnectionsSlotOptions) (WebAppsListHybridConnectionsSlotResponse, error) { + req, err := client.listHybridConnectionsSlotCreateRequest(ctx, resourceGroupName, name, slot, options) + if err != nil { + return WebAppsListHybridConnectionsSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsListHybridConnectionsSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsListHybridConnectionsSlotResponse{}, client.listHybridConnectionsSlotHandleError(resp) + } + return client.listHybridConnectionsSlotHandleResponse(resp) +} + +// listHybridConnectionsSlotCreateRequest creates the ListHybridConnectionsSlot request. +func (client *WebAppsClient) listHybridConnectionsSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsListHybridConnectionsSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridConnectionRelays" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listHybridConnectionsSlotHandleResponse handles the ListHybridConnectionsSlot response. +func (client *WebAppsClient) listHybridConnectionsSlotHandleResponse(resp *http.Response) (WebAppsListHybridConnectionsSlotResponse, error) { + result := WebAppsListHybridConnectionsSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.HybridConnection); err != nil { + return WebAppsListHybridConnectionsSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listHybridConnectionsSlotHandleError handles the ListHybridConnectionsSlot error response. +func (client *WebAppsClient) listHybridConnectionsSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListInstanceFunctionsSlot - Description for List the functions for a web site, or a deployment slot. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) ListInstanceFunctionsSlot(resourceGroupName string, name string, slot string, options *WebAppsListInstanceFunctionsSlotOptions) *WebAppsListInstanceFunctionsSlotPager { + return &WebAppsListInstanceFunctionsSlotPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listInstanceFunctionsSlotCreateRequest(ctx, resourceGroupName, name, slot, options) + }, + advancer: func(ctx context.Context, resp WebAppsListInstanceFunctionsSlotResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.FunctionEnvelopeCollection.NextLink) + }, + } +} + +// listInstanceFunctionsSlotCreateRequest creates the ListInstanceFunctionsSlot request. +func (client *WebAppsClient) listInstanceFunctionsSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsListInstanceFunctionsSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listInstanceFunctionsSlotHandleResponse handles the ListInstanceFunctionsSlot response. +func (client *WebAppsClient) listInstanceFunctionsSlotHandleResponse(resp *http.Response) (WebAppsListInstanceFunctionsSlotResponse, error) { + result := WebAppsListInstanceFunctionsSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.FunctionEnvelopeCollection); err != nil { + return WebAppsListInstanceFunctionsSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listInstanceFunctionsSlotHandleError handles the ListInstanceFunctionsSlot error response. +func (client *WebAppsClient) listInstanceFunctionsSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + switch resp.StatusCode { + case http.StatusNotFound: + if len(body) == 0 { + return runtime.NewResponseError(errors.New(resp.Status), resp) + } + return runtime.NewResponseError(errors.New(string(body)), resp) + default: + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) + } +} + +// ListInstanceIdentifiers - Description for Gets all scale-out instances of an app. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) ListInstanceIdentifiers(resourceGroupName string, name string, options *WebAppsListInstanceIdentifiersOptions) *WebAppsListInstanceIdentifiersPager { + return &WebAppsListInstanceIdentifiersPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listInstanceIdentifiersCreateRequest(ctx, resourceGroupName, name, options) + }, + advancer: func(ctx context.Context, resp WebAppsListInstanceIdentifiersResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.WebAppInstanceStatusCollection.NextLink) + }, + } +} + +// listInstanceIdentifiersCreateRequest creates the ListInstanceIdentifiers request. +func (client *WebAppsClient) listInstanceIdentifiersCreateRequest(ctx context.Context, resourceGroupName string, name string, options *WebAppsListInstanceIdentifiersOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listInstanceIdentifiersHandleResponse handles the ListInstanceIdentifiers response. +func (client *WebAppsClient) listInstanceIdentifiersHandleResponse(resp *http.Response) (WebAppsListInstanceIdentifiersResponse, error) { + result := WebAppsListInstanceIdentifiersResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.WebAppInstanceStatusCollection); err != nil { + return WebAppsListInstanceIdentifiersResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listInstanceIdentifiersHandleError handles the ListInstanceIdentifiers error response. +func (client *WebAppsClient) listInstanceIdentifiersHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListInstanceIdentifiersSlot - Description for Gets all scale-out instances of an app. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) ListInstanceIdentifiersSlot(resourceGroupName string, name string, slot string, options *WebAppsListInstanceIdentifiersSlotOptions) *WebAppsListInstanceIdentifiersSlotPager { + return &WebAppsListInstanceIdentifiersSlotPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listInstanceIdentifiersSlotCreateRequest(ctx, resourceGroupName, name, slot, options) + }, + advancer: func(ctx context.Context, resp WebAppsListInstanceIdentifiersSlotResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.WebAppInstanceStatusCollection.NextLink) + }, + } +} + +// listInstanceIdentifiersSlotCreateRequest creates the ListInstanceIdentifiersSlot request. +func (client *WebAppsClient) listInstanceIdentifiersSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsListInstanceIdentifiersSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listInstanceIdentifiersSlotHandleResponse handles the ListInstanceIdentifiersSlot response. +func (client *WebAppsClient) listInstanceIdentifiersSlotHandleResponse(resp *http.Response) (WebAppsListInstanceIdentifiersSlotResponse, error) { + result := WebAppsListInstanceIdentifiersSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.WebAppInstanceStatusCollection); err != nil { + return WebAppsListInstanceIdentifiersSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listInstanceIdentifiersSlotHandleError handles the ListInstanceIdentifiersSlot error response. +func (client *WebAppsClient) listInstanceIdentifiersSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListInstanceProcessModules - Description for List module information for a process by its ID for a specific scaled-out instance in a web site. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) ListInstanceProcessModules(resourceGroupName string, name string, processID string, instanceID string, options *WebAppsListInstanceProcessModulesOptions) *WebAppsListInstanceProcessModulesPager { + return &WebAppsListInstanceProcessModulesPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listInstanceProcessModulesCreateRequest(ctx, resourceGroupName, name, processID, instanceID, options) + }, + advancer: func(ctx context.Context, resp WebAppsListInstanceProcessModulesResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.ProcessModuleInfoCollection.NextLink) + }, + } +} + +// listInstanceProcessModulesCreateRequest creates the ListInstanceProcessModules request. +func (client *WebAppsClient) listInstanceProcessModulesCreateRequest(ctx context.Context, resourceGroupName string, name string, processID string, instanceID string, options *WebAppsListInstanceProcessModulesOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}/modules" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if processID == "" { + return nil, errors.New("parameter processID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{processId}", url.PathEscape(processID)) + if instanceID == "" { + return nil, errors.New("parameter instanceID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listInstanceProcessModulesHandleResponse handles the ListInstanceProcessModules response. +func (client *WebAppsClient) listInstanceProcessModulesHandleResponse(resp *http.Response) (WebAppsListInstanceProcessModulesResponse, error) { + result := WebAppsListInstanceProcessModulesResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.ProcessModuleInfoCollection); err != nil { + return WebAppsListInstanceProcessModulesResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listInstanceProcessModulesHandleError handles the ListInstanceProcessModules error response. +func (client *WebAppsClient) listInstanceProcessModulesHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + switch resp.StatusCode { + case http.StatusNotFound: + if len(body) == 0 { + return runtime.NewResponseError(errors.New(resp.Status), resp) + } + return runtime.NewResponseError(errors.New(string(body)), resp) + default: + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) + } +} + +// ListInstanceProcessModulesSlot - Description for List module information for a process by its ID for a specific scaled-out instance in a web site. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) ListInstanceProcessModulesSlot(resourceGroupName string, name string, processID string, slot string, instanceID string, options *WebAppsListInstanceProcessModulesSlotOptions) *WebAppsListInstanceProcessModulesSlotPager { + return &WebAppsListInstanceProcessModulesSlotPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listInstanceProcessModulesSlotCreateRequest(ctx, resourceGroupName, name, processID, slot, instanceID, options) + }, + advancer: func(ctx context.Context, resp WebAppsListInstanceProcessModulesSlotResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.ProcessModuleInfoCollection.NextLink) + }, + } +} + +// listInstanceProcessModulesSlotCreateRequest creates the ListInstanceProcessModulesSlot request. +func (client *WebAppsClient) listInstanceProcessModulesSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, processID string, slot string, instanceID string, options *WebAppsListInstanceProcessModulesSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}/modules" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if processID == "" { + return nil, errors.New("parameter processID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{processId}", url.PathEscape(processID)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if instanceID == "" { + return nil, errors.New("parameter instanceID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listInstanceProcessModulesSlotHandleResponse handles the ListInstanceProcessModulesSlot response. +func (client *WebAppsClient) listInstanceProcessModulesSlotHandleResponse(resp *http.Response) (WebAppsListInstanceProcessModulesSlotResponse, error) { + result := WebAppsListInstanceProcessModulesSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.ProcessModuleInfoCollection); err != nil { + return WebAppsListInstanceProcessModulesSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listInstanceProcessModulesSlotHandleError handles the ListInstanceProcessModulesSlot error response. +func (client *WebAppsClient) listInstanceProcessModulesSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + switch resp.StatusCode { + case http.StatusNotFound: + if len(body) == 0 { + return runtime.NewResponseError(errors.New(resp.Status), resp) + } + return runtime.NewResponseError(errors.New(string(body)), resp) + default: + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) + } +} + +// ListInstanceProcessThreads - Description for List the threads in a process by its ID for a specific scaled-out instance in a web site. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) ListInstanceProcessThreads(resourceGroupName string, name string, processID string, instanceID string, options *WebAppsListInstanceProcessThreadsOptions) *WebAppsListInstanceProcessThreadsPager { + return &WebAppsListInstanceProcessThreadsPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listInstanceProcessThreadsCreateRequest(ctx, resourceGroupName, name, processID, instanceID, options) + }, + advancer: func(ctx context.Context, resp WebAppsListInstanceProcessThreadsResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.ProcessThreadInfoCollection.NextLink) + }, + } +} + +// listInstanceProcessThreadsCreateRequest creates the ListInstanceProcessThreads request. +func (client *WebAppsClient) listInstanceProcessThreadsCreateRequest(ctx context.Context, resourceGroupName string, name string, processID string, instanceID string, options *WebAppsListInstanceProcessThreadsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}/threads" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if processID == "" { + return nil, errors.New("parameter processID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{processId}", url.PathEscape(processID)) + if instanceID == "" { + return nil, errors.New("parameter instanceID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listInstanceProcessThreadsHandleResponse handles the ListInstanceProcessThreads response. +func (client *WebAppsClient) listInstanceProcessThreadsHandleResponse(resp *http.Response) (WebAppsListInstanceProcessThreadsResponse, error) { + result := WebAppsListInstanceProcessThreadsResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.ProcessThreadInfoCollection); err != nil { + return WebAppsListInstanceProcessThreadsResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listInstanceProcessThreadsHandleError handles the ListInstanceProcessThreads error response. +func (client *WebAppsClient) listInstanceProcessThreadsHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + switch resp.StatusCode { + case http.StatusNotFound: + if len(body) == 0 { + return runtime.NewResponseError(errors.New(resp.Status), resp) + } + return runtime.NewResponseError(errors.New(string(body)), resp) + default: + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) + } +} + +// ListInstanceProcessThreadsSlot - Description for List the threads in a process by its ID for a specific scaled-out instance in a web site. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) ListInstanceProcessThreadsSlot(resourceGroupName string, name string, processID string, slot string, instanceID string, options *WebAppsListInstanceProcessThreadsSlotOptions) *WebAppsListInstanceProcessThreadsSlotPager { + return &WebAppsListInstanceProcessThreadsSlotPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listInstanceProcessThreadsSlotCreateRequest(ctx, resourceGroupName, name, processID, slot, instanceID, options) + }, + advancer: func(ctx context.Context, resp WebAppsListInstanceProcessThreadsSlotResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.ProcessThreadInfoCollection.NextLink) + }, + } +} + +// listInstanceProcessThreadsSlotCreateRequest creates the ListInstanceProcessThreadsSlot request. +func (client *WebAppsClient) listInstanceProcessThreadsSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, processID string, slot string, instanceID string, options *WebAppsListInstanceProcessThreadsSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}/threads" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if processID == "" { + return nil, errors.New("parameter processID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{processId}", url.PathEscape(processID)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if instanceID == "" { + return nil, errors.New("parameter instanceID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listInstanceProcessThreadsSlotHandleResponse handles the ListInstanceProcessThreadsSlot response. +func (client *WebAppsClient) listInstanceProcessThreadsSlotHandleResponse(resp *http.Response) (WebAppsListInstanceProcessThreadsSlotResponse, error) { + result := WebAppsListInstanceProcessThreadsSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.ProcessThreadInfoCollection); err != nil { + return WebAppsListInstanceProcessThreadsSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listInstanceProcessThreadsSlotHandleError handles the ListInstanceProcessThreadsSlot error response. +func (client *WebAppsClient) listInstanceProcessThreadsSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + switch resp.StatusCode { + case http.StatusNotFound: + if len(body) == 0 { + return runtime.NewResponseError(errors.New(resp.Status), resp) + } + return runtime.NewResponseError(errors.New(string(body)), resp) + default: + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) + } +} + +// ListInstanceProcesses - Description for Get list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web site. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) ListInstanceProcesses(resourceGroupName string, name string, instanceID string, options *WebAppsListInstanceProcessesOptions) *WebAppsListInstanceProcessesPager { + return &WebAppsListInstanceProcessesPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listInstanceProcessesCreateRequest(ctx, resourceGroupName, name, instanceID, options) + }, + advancer: func(ctx context.Context, resp WebAppsListInstanceProcessesResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.ProcessInfoCollection.NextLink) + }, + } +} + +// listInstanceProcessesCreateRequest creates the ListInstanceProcesses request. +func (client *WebAppsClient) listInstanceProcessesCreateRequest(ctx context.Context, resourceGroupName string, name string, instanceID string, options *WebAppsListInstanceProcessesOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if instanceID == "" { + return nil, errors.New("parameter instanceID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listInstanceProcessesHandleResponse handles the ListInstanceProcesses response. +func (client *WebAppsClient) listInstanceProcessesHandleResponse(resp *http.Response) (WebAppsListInstanceProcessesResponse, error) { + result := WebAppsListInstanceProcessesResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.ProcessInfoCollection); err != nil { + return WebAppsListInstanceProcessesResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listInstanceProcessesHandleError handles the ListInstanceProcesses error response. +func (client *WebAppsClient) listInstanceProcessesHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + switch resp.StatusCode { + case http.StatusNotFound: + if len(body) == 0 { + return runtime.NewResponseError(errors.New(resp.Status), resp) + } + return runtime.NewResponseError(errors.New(string(body)), resp) + default: + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) + } +} + +// ListInstanceProcessesSlot - Description for Get list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web +// site. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) ListInstanceProcessesSlot(resourceGroupName string, name string, slot string, instanceID string, options *WebAppsListInstanceProcessesSlotOptions) *WebAppsListInstanceProcessesSlotPager { + return &WebAppsListInstanceProcessesSlotPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listInstanceProcessesSlotCreateRequest(ctx, resourceGroupName, name, slot, instanceID, options) + }, + advancer: func(ctx context.Context, resp WebAppsListInstanceProcessesSlotResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.ProcessInfoCollection.NextLink) + }, + } +} + +// listInstanceProcessesSlotCreateRequest creates the ListInstanceProcessesSlot request. +func (client *WebAppsClient) listInstanceProcessesSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, slot string, instanceID string, options *WebAppsListInstanceProcessesSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if instanceID == "" { + return nil, errors.New("parameter instanceID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listInstanceProcessesSlotHandleResponse handles the ListInstanceProcessesSlot response. +func (client *WebAppsClient) listInstanceProcessesSlotHandleResponse(resp *http.Response) (WebAppsListInstanceProcessesSlotResponse, error) { + result := WebAppsListInstanceProcessesSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.ProcessInfoCollection); err != nil { + return WebAppsListInstanceProcessesSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listInstanceProcessesSlotHandleError handles the ListInstanceProcessesSlot error response. +func (client *WebAppsClient) listInstanceProcessesSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + switch resp.StatusCode { + case http.StatusNotFound: + if len(body) == 0 { + return runtime.NewResponseError(errors.New(resp.Status), resp) + } + return runtime.NewResponseError(errors.New(string(body)), resp) + default: + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) + } +} + +// ListMetadata - Description for Gets the metadata of an app. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) ListMetadata(ctx context.Context, resourceGroupName string, name string, options *WebAppsListMetadataOptions) (WebAppsListMetadataResponse, error) { + req, err := client.listMetadataCreateRequest(ctx, resourceGroupName, name, options) + if err != nil { + return WebAppsListMetadataResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsListMetadataResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsListMetadataResponse{}, client.listMetadataHandleError(resp) + } + return client.listMetadataHandleResponse(resp) +} + +// listMetadataCreateRequest creates the ListMetadata request. +func (client *WebAppsClient) listMetadataCreateRequest(ctx context.Context, resourceGroupName string, name string, options *WebAppsListMetadataOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/metadata/list" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listMetadataHandleResponse handles the ListMetadata response. +func (client *WebAppsClient) listMetadataHandleResponse(resp *http.Response) (WebAppsListMetadataResponse, error) { + result := WebAppsListMetadataResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.StringDictionary); err != nil { + return WebAppsListMetadataResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listMetadataHandleError handles the ListMetadata error response. +func (client *WebAppsClient) listMetadataHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListMetadataSlot - Description for Gets the metadata of an app. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) ListMetadataSlot(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsListMetadataSlotOptions) (WebAppsListMetadataSlotResponse, error) { + req, err := client.listMetadataSlotCreateRequest(ctx, resourceGroupName, name, slot, options) + if err != nil { + return WebAppsListMetadataSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsListMetadataSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsListMetadataSlotResponse{}, client.listMetadataSlotHandleError(resp) + } + return client.listMetadataSlotHandleResponse(resp) +} + +// listMetadataSlotCreateRequest creates the ListMetadataSlot request. +func (client *WebAppsClient) listMetadataSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsListMetadataSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/metadata/list" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listMetadataSlotHandleResponse handles the ListMetadataSlot response. +func (client *WebAppsClient) listMetadataSlotHandleResponse(resp *http.Response) (WebAppsListMetadataSlotResponse, error) { + result := WebAppsListMetadataSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.StringDictionary); err != nil { + return WebAppsListMetadataSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listMetadataSlotHandleError handles the ListMetadataSlot error response. +func (client *WebAppsClient) listMetadataSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListNetworkFeatures - Description for Gets all network features used by the app (or deployment slot, if specified). +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) ListNetworkFeatures(ctx context.Context, resourceGroupName string, name string, view string, options *WebAppsListNetworkFeaturesOptions) (WebAppsListNetworkFeaturesResponse, error) { + req, err := client.listNetworkFeaturesCreateRequest(ctx, resourceGroupName, name, view, options) + if err != nil { + return WebAppsListNetworkFeaturesResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsListNetworkFeaturesResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsListNetworkFeaturesResponse{}, client.listNetworkFeaturesHandleError(resp) + } + return client.listNetworkFeaturesHandleResponse(resp) +} + +// listNetworkFeaturesCreateRequest creates the ListNetworkFeatures request. +func (client *WebAppsClient) listNetworkFeaturesCreateRequest(ctx context.Context, resourceGroupName string, name string, view string, options *WebAppsListNetworkFeaturesOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkFeatures/{view}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if view == "" { + return nil, errors.New("parameter view cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{view}", url.PathEscape(view)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listNetworkFeaturesHandleResponse handles the ListNetworkFeatures response. +func (client *WebAppsClient) listNetworkFeaturesHandleResponse(resp *http.Response) (WebAppsListNetworkFeaturesResponse, error) { + result := WebAppsListNetworkFeaturesResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.NetworkFeatures); err != nil { + return WebAppsListNetworkFeaturesResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listNetworkFeaturesHandleError handles the ListNetworkFeatures error response. +func (client *WebAppsClient) listNetworkFeaturesHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + switch resp.StatusCode { + case http.StatusNotFound: + if len(body) == 0 { + return runtime.NewResponseError(errors.New(resp.Status), resp) + } + return runtime.NewResponseError(errors.New(string(body)), resp) + default: + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) + } +} + +// ListNetworkFeaturesSlot - Description for Gets all network features used by the app (or deployment slot, if specified). +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) ListNetworkFeaturesSlot(ctx context.Context, resourceGroupName string, name string, view string, slot string, options *WebAppsListNetworkFeaturesSlotOptions) (WebAppsListNetworkFeaturesSlotResponse, error) { + req, err := client.listNetworkFeaturesSlotCreateRequest(ctx, resourceGroupName, name, view, slot, options) + if err != nil { + return WebAppsListNetworkFeaturesSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsListNetworkFeaturesSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsListNetworkFeaturesSlotResponse{}, client.listNetworkFeaturesSlotHandleError(resp) + } + return client.listNetworkFeaturesSlotHandleResponse(resp) +} + +// listNetworkFeaturesSlotCreateRequest creates the ListNetworkFeaturesSlot request. +func (client *WebAppsClient) listNetworkFeaturesSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, view string, slot string, options *WebAppsListNetworkFeaturesSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkFeatures/{view}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if view == "" { + return nil, errors.New("parameter view cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{view}", url.PathEscape(view)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listNetworkFeaturesSlotHandleResponse handles the ListNetworkFeaturesSlot response. +func (client *WebAppsClient) listNetworkFeaturesSlotHandleResponse(resp *http.Response) (WebAppsListNetworkFeaturesSlotResponse, error) { + result := WebAppsListNetworkFeaturesSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.NetworkFeatures); err != nil { + return WebAppsListNetworkFeaturesSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listNetworkFeaturesSlotHandleError handles the ListNetworkFeaturesSlot error response. +func (client *WebAppsClient) listNetworkFeaturesSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + switch resp.StatusCode { + case http.StatusNotFound: + if len(body) == 0 { + return runtime.NewResponseError(errors.New(resp.Status), resp) + } + return runtime.NewResponseError(errors.New(string(body)), resp) + default: + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) + } +} + +// ListPerfMonCounters - Description for Gets perfmon counters for web app. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) ListPerfMonCounters(resourceGroupName string, name string, options *WebAppsListPerfMonCountersOptions) *WebAppsListPerfMonCountersPager { + return &WebAppsListPerfMonCountersPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listPerfMonCountersCreateRequest(ctx, resourceGroupName, name, options) + }, + advancer: func(ctx context.Context, resp WebAppsListPerfMonCountersResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.PerfMonCounterCollection.NextLink) + }, + } +} + +// listPerfMonCountersCreateRequest creates the ListPerfMonCounters request. +func (client *WebAppsClient) listPerfMonCountersCreateRequest(ctx context.Context, resourceGroupName string, name string, options *WebAppsListPerfMonCountersOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/perfcounters" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + unencodedParams := []string{req.Raw().URL.RawQuery} + if options != nil && options.Filter != nil { + unencodedParams = append(unencodedParams, "$filter="+*options.Filter) + } + req.Raw().URL.RawQuery = strings.Join(unencodedParams, "&") + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listPerfMonCountersHandleResponse handles the ListPerfMonCounters response. +func (client *WebAppsClient) listPerfMonCountersHandleResponse(resp *http.Response) (WebAppsListPerfMonCountersResponse, error) { + result := WebAppsListPerfMonCountersResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.PerfMonCounterCollection); err != nil { + return WebAppsListPerfMonCountersResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listPerfMonCountersHandleError handles the ListPerfMonCounters error response. +func (client *WebAppsClient) listPerfMonCountersHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListPerfMonCountersSlot - Description for Gets perfmon counters for web app. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) ListPerfMonCountersSlot(resourceGroupName string, name string, slot string, options *WebAppsListPerfMonCountersSlotOptions) *WebAppsListPerfMonCountersSlotPager { + return &WebAppsListPerfMonCountersSlotPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listPerfMonCountersSlotCreateRequest(ctx, resourceGroupName, name, slot, options) + }, + advancer: func(ctx context.Context, resp WebAppsListPerfMonCountersSlotResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.PerfMonCounterCollection.NextLink) + }, + } +} + +// listPerfMonCountersSlotCreateRequest creates the ListPerfMonCountersSlot request. +func (client *WebAppsClient) listPerfMonCountersSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsListPerfMonCountersSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/perfcounters" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + unencodedParams := []string{req.Raw().URL.RawQuery} + if options != nil && options.Filter != nil { + unencodedParams = append(unencodedParams, "$filter="+*options.Filter) + } + req.Raw().URL.RawQuery = strings.Join(unencodedParams, "&") + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listPerfMonCountersSlotHandleResponse handles the ListPerfMonCountersSlot response. +func (client *WebAppsClient) listPerfMonCountersSlotHandleResponse(resp *http.Response) (WebAppsListPerfMonCountersSlotResponse, error) { + result := WebAppsListPerfMonCountersSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.PerfMonCounterCollection); err != nil { + return WebAppsListPerfMonCountersSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listPerfMonCountersSlotHandleError handles the ListPerfMonCountersSlot error response. +func (client *WebAppsClient) listPerfMonCountersSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListPremierAddOns - Description for Gets the premier add-ons of an app. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) ListPremierAddOns(ctx context.Context, resourceGroupName string, name string, options *WebAppsListPremierAddOnsOptions) (WebAppsListPremierAddOnsResponse, error) { + req, err := client.listPremierAddOnsCreateRequest(ctx, resourceGroupName, name, options) + if err != nil { + return WebAppsListPremierAddOnsResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsListPremierAddOnsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsListPremierAddOnsResponse{}, client.listPremierAddOnsHandleError(resp) + } + return client.listPremierAddOnsHandleResponse(resp) +} + +// listPremierAddOnsCreateRequest creates the ListPremierAddOns request. +func (client *WebAppsClient) listPremierAddOnsCreateRequest(ctx context.Context, resourceGroupName string, name string, options *WebAppsListPremierAddOnsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/premieraddons" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listPremierAddOnsHandleResponse handles the ListPremierAddOns response. +func (client *WebAppsClient) listPremierAddOnsHandleResponse(resp *http.Response) (WebAppsListPremierAddOnsResponse, error) { + result := WebAppsListPremierAddOnsResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.PremierAddOn); err != nil { + return WebAppsListPremierAddOnsResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listPremierAddOnsHandleError handles the ListPremierAddOns error response. +func (client *WebAppsClient) listPremierAddOnsHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListPremierAddOnsSlot - Description for Gets the premier add-ons of an app. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) ListPremierAddOnsSlot(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsListPremierAddOnsSlotOptions) (WebAppsListPremierAddOnsSlotResponse, error) { + req, err := client.listPremierAddOnsSlotCreateRequest(ctx, resourceGroupName, name, slot, options) + if err != nil { + return WebAppsListPremierAddOnsSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsListPremierAddOnsSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsListPremierAddOnsSlotResponse{}, client.listPremierAddOnsSlotHandleError(resp) + } + return client.listPremierAddOnsSlotHandleResponse(resp) +} + +// listPremierAddOnsSlotCreateRequest creates the ListPremierAddOnsSlot request. +func (client *WebAppsClient) listPremierAddOnsSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsListPremierAddOnsSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/premieraddons" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listPremierAddOnsSlotHandleResponse handles the ListPremierAddOnsSlot response. +func (client *WebAppsClient) listPremierAddOnsSlotHandleResponse(resp *http.Response) (WebAppsListPremierAddOnsSlotResponse, error) { + result := WebAppsListPremierAddOnsSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.PremierAddOn); err != nil { + return WebAppsListPremierAddOnsSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listPremierAddOnsSlotHandleError handles the ListPremierAddOnsSlot error response. +func (client *WebAppsClient) listPremierAddOnsSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListProcessModules - Description for List module information for a process by its ID for a specific scaled-out instance in a web site. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) ListProcessModules(resourceGroupName string, name string, processID string, options *WebAppsListProcessModulesOptions) *WebAppsListProcessModulesPager { + return &WebAppsListProcessModulesPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listProcessModulesCreateRequest(ctx, resourceGroupName, name, processID, options) + }, + advancer: func(ctx context.Context, resp WebAppsListProcessModulesResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.ProcessModuleInfoCollection.NextLink) + }, + } +} + +// listProcessModulesCreateRequest creates the ListProcessModules request. +func (client *WebAppsClient) listProcessModulesCreateRequest(ctx context.Context, resourceGroupName string, name string, processID string, options *WebAppsListProcessModulesOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}/modules" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if processID == "" { + return nil, errors.New("parameter processID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{processId}", url.PathEscape(processID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listProcessModulesHandleResponse handles the ListProcessModules response. +func (client *WebAppsClient) listProcessModulesHandleResponse(resp *http.Response) (WebAppsListProcessModulesResponse, error) { + result := WebAppsListProcessModulesResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.ProcessModuleInfoCollection); err != nil { + return WebAppsListProcessModulesResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listProcessModulesHandleError handles the ListProcessModules error response. +func (client *WebAppsClient) listProcessModulesHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + switch resp.StatusCode { + case http.StatusNotFound: + if len(body) == 0 { + return runtime.NewResponseError(errors.New(resp.Status), resp) + } + return runtime.NewResponseError(errors.New(string(body)), resp) + default: + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) + } +} + +// ListProcessModulesSlot - Description for List module information for a process by its ID for a specific scaled-out instance in a web site. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) ListProcessModulesSlot(resourceGroupName string, name string, processID string, slot string, options *WebAppsListProcessModulesSlotOptions) *WebAppsListProcessModulesSlotPager { + return &WebAppsListProcessModulesSlotPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listProcessModulesSlotCreateRequest(ctx, resourceGroupName, name, processID, slot, options) + }, + advancer: func(ctx context.Context, resp WebAppsListProcessModulesSlotResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.ProcessModuleInfoCollection.NextLink) + }, + } +} + +// listProcessModulesSlotCreateRequest creates the ListProcessModulesSlot request. +func (client *WebAppsClient) listProcessModulesSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, processID string, slot string, options *WebAppsListProcessModulesSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes/{processId}/modules" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if processID == "" { + return nil, errors.New("parameter processID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{processId}", url.PathEscape(processID)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listProcessModulesSlotHandleResponse handles the ListProcessModulesSlot response. +func (client *WebAppsClient) listProcessModulesSlotHandleResponse(resp *http.Response) (WebAppsListProcessModulesSlotResponse, error) { + result := WebAppsListProcessModulesSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.ProcessModuleInfoCollection); err != nil { + return WebAppsListProcessModulesSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listProcessModulesSlotHandleError handles the ListProcessModulesSlot error response. +func (client *WebAppsClient) listProcessModulesSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + switch resp.StatusCode { + case http.StatusNotFound: + if len(body) == 0 { + return runtime.NewResponseError(errors.New(resp.Status), resp) + } + return runtime.NewResponseError(errors.New(string(body)), resp) + default: + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) + } +} + +// ListProcessThreads - Description for List the threads in a process by its ID for a specific scaled-out instance in a web site. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) ListProcessThreads(resourceGroupName string, name string, processID string, options *WebAppsListProcessThreadsOptions) *WebAppsListProcessThreadsPager { + return &WebAppsListProcessThreadsPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listProcessThreadsCreateRequest(ctx, resourceGroupName, name, processID, options) + }, + advancer: func(ctx context.Context, resp WebAppsListProcessThreadsResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.ProcessThreadInfoCollection.NextLink) + }, + } +} + +// listProcessThreadsCreateRequest creates the ListProcessThreads request. +func (client *WebAppsClient) listProcessThreadsCreateRequest(ctx context.Context, resourceGroupName string, name string, processID string, options *WebAppsListProcessThreadsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}/threads" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if processID == "" { + return nil, errors.New("parameter processID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{processId}", url.PathEscape(processID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listProcessThreadsHandleResponse handles the ListProcessThreads response. +func (client *WebAppsClient) listProcessThreadsHandleResponse(resp *http.Response) (WebAppsListProcessThreadsResponse, error) { + result := WebAppsListProcessThreadsResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.ProcessThreadInfoCollection); err != nil { + return WebAppsListProcessThreadsResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listProcessThreadsHandleError handles the ListProcessThreads error response. +func (client *WebAppsClient) listProcessThreadsHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + switch resp.StatusCode { + case http.StatusNotFound: + if len(body) == 0 { + return runtime.NewResponseError(errors.New(resp.Status), resp) + } + return runtime.NewResponseError(errors.New(string(body)), resp) + default: + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) + } +} + +// ListProcessThreadsSlot - Description for List the threads in a process by its ID for a specific scaled-out instance in a web site. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) ListProcessThreadsSlot(resourceGroupName string, name string, processID string, slot string, options *WebAppsListProcessThreadsSlotOptions) *WebAppsListProcessThreadsSlotPager { + return &WebAppsListProcessThreadsSlotPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listProcessThreadsSlotCreateRequest(ctx, resourceGroupName, name, processID, slot, options) + }, + advancer: func(ctx context.Context, resp WebAppsListProcessThreadsSlotResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.ProcessThreadInfoCollection.NextLink) + }, + } +} + +// listProcessThreadsSlotCreateRequest creates the ListProcessThreadsSlot request. +func (client *WebAppsClient) listProcessThreadsSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, processID string, slot string, options *WebAppsListProcessThreadsSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes/{processId}/threads" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if processID == "" { + return nil, errors.New("parameter processID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{processId}", url.PathEscape(processID)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listProcessThreadsSlotHandleResponse handles the ListProcessThreadsSlot response. +func (client *WebAppsClient) listProcessThreadsSlotHandleResponse(resp *http.Response) (WebAppsListProcessThreadsSlotResponse, error) { + result := WebAppsListProcessThreadsSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.ProcessThreadInfoCollection); err != nil { + return WebAppsListProcessThreadsSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listProcessThreadsSlotHandleError handles the ListProcessThreadsSlot error response. +func (client *WebAppsClient) listProcessThreadsSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + switch resp.StatusCode { + case http.StatusNotFound: + if len(body) == 0 { + return runtime.NewResponseError(errors.New(resp.Status), resp) + } + return runtime.NewResponseError(errors.New(string(body)), resp) + default: + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) + } +} + +// ListProcesses - Description for Get list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web site. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) ListProcesses(resourceGroupName string, name string, options *WebAppsListProcessesOptions) *WebAppsListProcessesPager { + return &WebAppsListProcessesPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listProcessesCreateRequest(ctx, resourceGroupName, name, options) + }, + advancer: func(ctx context.Context, resp WebAppsListProcessesResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.ProcessInfoCollection.NextLink) + }, + } +} + +// listProcessesCreateRequest creates the ListProcesses request. +func (client *WebAppsClient) listProcessesCreateRequest(ctx context.Context, resourceGroupName string, name string, options *WebAppsListProcessesOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listProcessesHandleResponse handles the ListProcesses response. +func (client *WebAppsClient) listProcessesHandleResponse(resp *http.Response) (WebAppsListProcessesResponse, error) { + result := WebAppsListProcessesResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.ProcessInfoCollection); err != nil { + return WebAppsListProcessesResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listProcessesHandleError handles the ListProcesses error response. +func (client *WebAppsClient) listProcessesHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + switch resp.StatusCode { + case http.StatusNotFound: + if len(body) == 0 { + return runtime.NewResponseError(errors.New(resp.Status), resp) + } + return runtime.NewResponseError(errors.New(string(body)), resp) + default: + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) + } +} + +// ListProcessesSlot - Description for Get list of processes for a web site, or a deployment slot, or for a specific scaled-out instance in a web site. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) ListProcessesSlot(resourceGroupName string, name string, slot string, options *WebAppsListProcessesSlotOptions) *WebAppsListProcessesSlotPager { + return &WebAppsListProcessesSlotPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listProcessesSlotCreateRequest(ctx, resourceGroupName, name, slot, options) + }, + advancer: func(ctx context.Context, resp WebAppsListProcessesSlotResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.ProcessInfoCollection.NextLink) + }, + } +} + +// listProcessesSlotCreateRequest creates the ListProcessesSlot request. +func (client *WebAppsClient) listProcessesSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsListProcessesSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listProcessesSlotHandleResponse handles the ListProcessesSlot response. +func (client *WebAppsClient) listProcessesSlotHandleResponse(resp *http.Response) (WebAppsListProcessesSlotResponse, error) { + result := WebAppsListProcessesSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.ProcessInfoCollection); err != nil { + return WebAppsListProcessesSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listProcessesSlotHandleError handles the ListProcessesSlot error response. +func (client *WebAppsClient) listProcessesSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + switch resp.StatusCode { + case http.StatusNotFound: + if len(body) == 0 { + return runtime.NewResponseError(errors.New(resp.Status), resp) + } + return runtime.NewResponseError(errors.New(string(body)), resp) + default: + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) + } +} + +// ListPublicCertificates - Description for Get public certificates for an app or a deployment slot. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) ListPublicCertificates(resourceGroupName string, name string, options *WebAppsListPublicCertificatesOptions) *WebAppsListPublicCertificatesPager { + return &WebAppsListPublicCertificatesPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listPublicCertificatesCreateRequest(ctx, resourceGroupName, name, options) + }, + advancer: func(ctx context.Context, resp WebAppsListPublicCertificatesResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.PublicCertificateCollection.NextLink) + }, + } +} + +// listPublicCertificatesCreateRequest creates the ListPublicCertificates request. +func (client *WebAppsClient) listPublicCertificatesCreateRequest(ctx context.Context, resourceGroupName string, name string, options *WebAppsListPublicCertificatesOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/publicCertificates" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listPublicCertificatesHandleResponse handles the ListPublicCertificates response. +func (client *WebAppsClient) listPublicCertificatesHandleResponse(resp *http.Response) (WebAppsListPublicCertificatesResponse, error) { + result := WebAppsListPublicCertificatesResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.PublicCertificateCollection); err != nil { + return WebAppsListPublicCertificatesResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listPublicCertificatesHandleError handles the ListPublicCertificates error response. +func (client *WebAppsClient) listPublicCertificatesHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListPublicCertificatesSlot - Description for Get public certificates for an app or a deployment slot. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) ListPublicCertificatesSlot(resourceGroupName string, name string, slot string, options *WebAppsListPublicCertificatesSlotOptions) *WebAppsListPublicCertificatesSlotPager { + return &WebAppsListPublicCertificatesSlotPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listPublicCertificatesSlotCreateRequest(ctx, resourceGroupName, name, slot, options) + }, + advancer: func(ctx context.Context, resp WebAppsListPublicCertificatesSlotResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.PublicCertificateCollection.NextLink) + }, + } +} + +// listPublicCertificatesSlotCreateRequest creates the ListPublicCertificatesSlot request. +func (client *WebAppsClient) listPublicCertificatesSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsListPublicCertificatesSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/publicCertificates" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listPublicCertificatesSlotHandleResponse handles the ListPublicCertificatesSlot response. +func (client *WebAppsClient) listPublicCertificatesSlotHandleResponse(resp *http.Response) (WebAppsListPublicCertificatesSlotResponse, error) { + result := WebAppsListPublicCertificatesSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.PublicCertificateCollection); err != nil { + return WebAppsListPublicCertificatesSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listPublicCertificatesSlotHandleError handles the ListPublicCertificatesSlot error response. +func (client *WebAppsClient) listPublicCertificatesSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// BeginListPublishingCredentials - Description for Gets the Git/FTP publishing credentials of an app. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) BeginListPublishingCredentials(ctx context.Context, resourceGroupName string, name string, options *WebAppsBeginListPublishingCredentialsOptions) (WebAppsListPublishingCredentialsPollerResponse, error) { + resp, err := client.listPublishingCredentials(ctx, resourceGroupName, name, options) + if err != nil { + return WebAppsListPublishingCredentialsPollerResponse{}, err + } + result := WebAppsListPublishingCredentialsPollerResponse{ + RawResponse: resp, + } + pt, err := armruntime.NewPoller("WebAppsClient.ListPublishingCredentials", "", resp, client.pl, client.listPublishingCredentialsHandleError) + if err != nil { + return WebAppsListPublishingCredentialsPollerResponse{}, err + } + result.Poller = &WebAppsListPublishingCredentialsPoller{ + pt: pt, + } + return result, nil +} + +// ListPublishingCredentials - Description for Gets the Git/FTP publishing credentials of an app. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) listPublishingCredentials(ctx context.Context, resourceGroupName string, name string, options *WebAppsBeginListPublishingCredentialsOptions) (*http.Response, error) { + req, err := client.listPublishingCredentialsCreateRequest(ctx, resourceGroupName, name, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return nil, client.listPublishingCredentialsHandleError(resp) + } + return resp, nil +} + +// listPublishingCredentialsCreateRequest creates the ListPublishingCredentials request. +func (client *WebAppsClient) listPublishingCredentialsCreateRequest(ctx context.Context, resourceGroupName string, name string, options *WebAppsBeginListPublishingCredentialsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/publishingcredentials/list" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listPublishingCredentialsHandleError handles the ListPublishingCredentials error response. +func (client *WebAppsClient) listPublishingCredentialsHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// BeginListPublishingCredentialsSlot - Description for Gets the Git/FTP publishing credentials of an app. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) BeginListPublishingCredentialsSlot(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsBeginListPublishingCredentialsSlotOptions) (WebAppsListPublishingCredentialsSlotPollerResponse, error) { + resp, err := client.listPublishingCredentialsSlot(ctx, resourceGroupName, name, slot, options) + if err != nil { + return WebAppsListPublishingCredentialsSlotPollerResponse{}, err + } + result := WebAppsListPublishingCredentialsSlotPollerResponse{ + RawResponse: resp, + } + pt, err := armruntime.NewPoller("WebAppsClient.ListPublishingCredentialsSlot", "", resp, client.pl, client.listPublishingCredentialsSlotHandleError) + if err != nil { + return WebAppsListPublishingCredentialsSlotPollerResponse{}, err + } + result.Poller = &WebAppsListPublishingCredentialsSlotPoller{ + pt: pt, + } + return result, nil +} + +// ListPublishingCredentialsSlot - Description for Gets the Git/FTP publishing credentials of an app. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) listPublishingCredentialsSlot(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsBeginListPublishingCredentialsSlotOptions) (*http.Response, error) { + req, err := client.listPublishingCredentialsSlotCreateRequest(ctx, resourceGroupName, name, slot, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return nil, client.listPublishingCredentialsSlotHandleError(resp) + } + return resp, nil +} + +// listPublishingCredentialsSlotCreateRequest creates the ListPublishingCredentialsSlot request. +func (client *WebAppsClient) listPublishingCredentialsSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsBeginListPublishingCredentialsSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/publishingcredentials/list" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listPublishingCredentialsSlotHandleError handles the ListPublishingCredentialsSlot error response. +func (client *WebAppsClient) listPublishingCredentialsSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListPublishingProfileXMLWithSecrets - Description for Gets the publishing profile for an app (or deployment slot, if specified). +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) ListPublishingProfileXMLWithSecrets(ctx context.Context, resourceGroupName string, name string, publishingProfileOptions CsmPublishingProfileOptions, options *WebAppsListPublishingProfileXMLWithSecretsOptions) (WebAppsListPublishingProfileXMLWithSecretsResponse, error) { + req, err := client.listPublishingProfileXMLWithSecretsCreateRequest(ctx, resourceGroupName, name, publishingProfileOptions, options) + if err != nil { + return WebAppsListPublishingProfileXMLWithSecretsResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsListPublishingProfileXMLWithSecretsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsListPublishingProfileXMLWithSecretsResponse{}, client.listPublishingProfileXMLWithSecretsHandleError(resp) + } + return WebAppsListPublishingProfileXMLWithSecretsResponse{RawResponse: resp}, nil +} + +// listPublishingProfileXMLWithSecretsCreateRequest creates the ListPublishingProfileXMLWithSecrets request. +func (client *WebAppsClient) listPublishingProfileXMLWithSecretsCreateRequest(ctx context.Context, resourceGroupName string, name string, publishingProfileOptions CsmPublishingProfileOptions, options *WebAppsListPublishingProfileXMLWithSecretsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/publishxml" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.SkipBodyDownload() + req.Raw().Header.Set("Accept", "application/xml") + return req, runtime.MarshalAsJSON(req, publishingProfileOptions) +} + +// listPublishingProfileXMLWithSecretsHandleError handles the ListPublishingProfileXMLWithSecrets error response. +func (client *WebAppsClient) listPublishingProfileXMLWithSecretsHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListPublishingProfileXMLWithSecretsSlot - Description for Gets the publishing profile for an app (or deployment slot, if specified). +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) ListPublishingProfileXMLWithSecretsSlot(ctx context.Context, resourceGroupName string, name string, slot string, publishingProfileOptions CsmPublishingProfileOptions, options *WebAppsListPublishingProfileXMLWithSecretsSlotOptions) (WebAppsListPublishingProfileXMLWithSecretsSlotResponse, error) { + req, err := client.listPublishingProfileXMLWithSecretsSlotCreateRequest(ctx, resourceGroupName, name, slot, publishingProfileOptions, options) + if err != nil { + return WebAppsListPublishingProfileXMLWithSecretsSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsListPublishingProfileXMLWithSecretsSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsListPublishingProfileXMLWithSecretsSlotResponse{}, client.listPublishingProfileXMLWithSecretsSlotHandleError(resp) + } + return WebAppsListPublishingProfileXMLWithSecretsSlotResponse{RawResponse: resp}, nil +} + +// listPublishingProfileXMLWithSecretsSlotCreateRequest creates the ListPublishingProfileXMLWithSecretsSlot request. +func (client *WebAppsClient) listPublishingProfileXMLWithSecretsSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, slot string, publishingProfileOptions CsmPublishingProfileOptions, options *WebAppsListPublishingProfileXMLWithSecretsSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/publishxml" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.SkipBodyDownload() + req.Raw().Header.Set("Accept", "application/xml") + return req, runtime.MarshalAsJSON(req, publishingProfileOptions) +} + +// listPublishingProfileXMLWithSecretsSlotHandleError handles the ListPublishingProfileXMLWithSecretsSlot error response. +func (client *WebAppsClient) listPublishingProfileXMLWithSecretsSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListRelayServiceConnections - Description for Gets hybrid connections configured for an app (or deployment slot, if specified). +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) ListRelayServiceConnections(ctx context.Context, resourceGroupName string, name string, options *WebAppsListRelayServiceConnectionsOptions) (WebAppsListRelayServiceConnectionsResponse, error) { + req, err := client.listRelayServiceConnectionsCreateRequest(ctx, resourceGroupName, name, options) + if err != nil { + return WebAppsListRelayServiceConnectionsResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsListRelayServiceConnectionsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsListRelayServiceConnectionsResponse{}, client.listRelayServiceConnectionsHandleError(resp) + } + return client.listRelayServiceConnectionsHandleResponse(resp) +} + +// listRelayServiceConnectionsCreateRequest creates the ListRelayServiceConnections request. +func (client *WebAppsClient) listRelayServiceConnectionsCreateRequest(ctx context.Context, resourceGroupName string, name string, options *WebAppsListRelayServiceConnectionsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listRelayServiceConnectionsHandleResponse handles the ListRelayServiceConnections response. +func (client *WebAppsClient) listRelayServiceConnectionsHandleResponse(resp *http.Response) (WebAppsListRelayServiceConnectionsResponse, error) { + result := WebAppsListRelayServiceConnectionsResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.RelayServiceConnectionEntity); err != nil { + return WebAppsListRelayServiceConnectionsResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listRelayServiceConnectionsHandleError handles the ListRelayServiceConnections error response. +func (client *WebAppsClient) listRelayServiceConnectionsHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListRelayServiceConnectionsSlot - Description for Gets hybrid connections configured for an app (or deployment slot, if specified). +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) ListRelayServiceConnectionsSlot(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsListRelayServiceConnectionsSlotOptions) (WebAppsListRelayServiceConnectionsSlotResponse, error) { + req, err := client.listRelayServiceConnectionsSlotCreateRequest(ctx, resourceGroupName, name, slot, options) + if err != nil { + return WebAppsListRelayServiceConnectionsSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsListRelayServiceConnectionsSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsListRelayServiceConnectionsSlotResponse{}, client.listRelayServiceConnectionsSlotHandleError(resp) + } + return client.listRelayServiceConnectionsSlotHandleResponse(resp) +} + +// listRelayServiceConnectionsSlotCreateRequest creates the ListRelayServiceConnectionsSlot request. +func (client *WebAppsClient) listRelayServiceConnectionsSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsListRelayServiceConnectionsSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridconnection" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listRelayServiceConnectionsSlotHandleResponse handles the ListRelayServiceConnectionsSlot response. +func (client *WebAppsClient) listRelayServiceConnectionsSlotHandleResponse(resp *http.Response) (WebAppsListRelayServiceConnectionsSlotResponse, error) { + result := WebAppsListRelayServiceConnectionsSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.RelayServiceConnectionEntity); err != nil { + return WebAppsListRelayServiceConnectionsSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listRelayServiceConnectionsSlotHandleError handles the ListRelayServiceConnectionsSlot error response. +func (client *WebAppsClient) listRelayServiceConnectionsSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListSiteBackups - Description for Gets existing backups of an app. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) ListSiteBackups(resourceGroupName string, name string, options *WebAppsListSiteBackupsOptions) *WebAppsListSiteBackupsPager { + return &WebAppsListSiteBackupsPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listSiteBackupsCreateRequest(ctx, resourceGroupName, name, options) + }, + advancer: func(ctx context.Context, resp WebAppsListSiteBackupsResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.BackupItemCollection.NextLink) + }, + } +} + +// listSiteBackupsCreateRequest creates the ListSiteBackups request. +func (client *WebAppsClient) listSiteBackupsCreateRequest(ctx context.Context, resourceGroupName string, name string, options *WebAppsListSiteBackupsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/listbackups" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listSiteBackupsHandleResponse handles the ListSiteBackups response. +func (client *WebAppsClient) listSiteBackupsHandleResponse(resp *http.Response) (WebAppsListSiteBackupsResponse, error) { + result := WebAppsListSiteBackupsResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.BackupItemCollection); err != nil { + return WebAppsListSiteBackupsResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listSiteBackupsHandleError handles the ListSiteBackups error response. +func (client *WebAppsClient) listSiteBackupsHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListSiteBackupsSlot - Description for Gets existing backups of an app. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) ListSiteBackupsSlot(resourceGroupName string, name string, slot string, options *WebAppsListSiteBackupsSlotOptions) *WebAppsListSiteBackupsSlotPager { + return &WebAppsListSiteBackupsSlotPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listSiteBackupsSlotCreateRequest(ctx, resourceGroupName, name, slot, options) + }, + advancer: func(ctx context.Context, resp WebAppsListSiteBackupsSlotResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.BackupItemCollection.NextLink) + }, + } +} + +// listSiteBackupsSlotCreateRequest creates the ListSiteBackupsSlot request. +func (client *WebAppsClient) listSiteBackupsSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsListSiteBackupsSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/listbackups" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listSiteBackupsSlotHandleResponse handles the ListSiteBackupsSlot response. +func (client *WebAppsClient) listSiteBackupsSlotHandleResponse(resp *http.Response) (WebAppsListSiteBackupsSlotResponse, error) { + result := WebAppsListSiteBackupsSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.BackupItemCollection); err != nil { + return WebAppsListSiteBackupsSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listSiteBackupsSlotHandleError handles the ListSiteBackupsSlot error response. +func (client *WebAppsClient) listSiteBackupsSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListSiteExtensions - Description for Get list of siteextensions for a web site, or a deployment slot. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) ListSiteExtensions(resourceGroupName string, name string, options *WebAppsListSiteExtensionsOptions) *WebAppsListSiteExtensionsPager { + return &WebAppsListSiteExtensionsPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listSiteExtensionsCreateRequest(ctx, resourceGroupName, name, options) + }, + advancer: func(ctx context.Context, resp WebAppsListSiteExtensionsResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.SiteExtensionInfoCollection.NextLink) + }, + } +} + +// listSiteExtensionsCreateRequest creates the ListSiteExtensions request. +func (client *WebAppsClient) listSiteExtensionsCreateRequest(ctx context.Context, resourceGroupName string, name string, options *WebAppsListSiteExtensionsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/siteextensions" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listSiteExtensionsHandleResponse handles the ListSiteExtensions response. +func (client *WebAppsClient) listSiteExtensionsHandleResponse(resp *http.Response) (WebAppsListSiteExtensionsResponse, error) { + result := WebAppsListSiteExtensionsResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.SiteExtensionInfoCollection); err != nil { + return WebAppsListSiteExtensionsResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listSiteExtensionsHandleError handles the ListSiteExtensions error response. +func (client *WebAppsClient) listSiteExtensionsHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + switch resp.StatusCode { + case http.StatusNotFound: + if len(body) == 0 { + return runtime.NewResponseError(errors.New(resp.Status), resp) + } + return runtime.NewResponseError(errors.New(string(body)), resp) + default: + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) + } +} + +// ListSiteExtensionsSlot - Description for Get list of siteextensions for a web site, or a deployment slot. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) ListSiteExtensionsSlot(resourceGroupName string, name string, slot string, options *WebAppsListSiteExtensionsSlotOptions) *WebAppsListSiteExtensionsSlotPager { + return &WebAppsListSiteExtensionsSlotPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listSiteExtensionsSlotCreateRequest(ctx, resourceGroupName, name, slot, options) + }, + advancer: func(ctx context.Context, resp WebAppsListSiteExtensionsSlotResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.SiteExtensionInfoCollection.NextLink) + }, + } +} + +// listSiteExtensionsSlotCreateRequest creates the ListSiteExtensionsSlot request. +func (client *WebAppsClient) listSiteExtensionsSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsListSiteExtensionsSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/siteextensions" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listSiteExtensionsSlotHandleResponse handles the ListSiteExtensionsSlot response. +func (client *WebAppsClient) listSiteExtensionsSlotHandleResponse(resp *http.Response) (WebAppsListSiteExtensionsSlotResponse, error) { + result := WebAppsListSiteExtensionsSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.SiteExtensionInfoCollection); err != nil { + return WebAppsListSiteExtensionsSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listSiteExtensionsSlotHandleError handles the ListSiteExtensionsSlot error response. +func (client *WebAppsClient) listSiteExtensionsSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + switch resp.StatusCode { + case http.StatusNotFound: + if len(body) == 0 { + return runtime.NewResponseError(errors.New(resp.Status), resp) + } + return runtime.NewResponseError(errors.New(string(body)), resp) + default: + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) + } +} + +// ListSitePushSettings - Description for Gets the Push settings associated with web app. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) ListSitePushSettings(ctx context.Context, resourceGroupName string, name string, options *WebAppsListSitePushSettingsOptions) (WebAppsListSitePushSettingsResponse, error) { + req, err := client.listSitePushSettingsCreateRequest(ctx, resourceGroupName, name, options) + if err != nil { + return WebAppsListSitePushSettingsResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsListSitePushSettingsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsListSitePushSettingsResponse{}, client.listSitePushSettingsHandleError(resp) + } + return client.listSitePushSettingsHandleResponse(resp) +} + +// listSitePushSettingsCreateRequest creates the ListSitePushSettings request. +func (client *WebAppsClient) listSitePushSettingsCreateRequest(ctx context.Context, resourceGroupName string, name string, options *WebAppsListSitePushSettingsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/pushsettings/list" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listSitePushSettingsHandleResponse handles the ListSitePushSettings response. +func (client *WebAppsClient) listSitePushSettingsHandleResponse(resp *http.Response) (WebAppsListSitePushSettingsResponse, error) { + result := WebAppsListSitePushSettingsResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.PushSettings); err != nil { + return WebAppsListSitePushSettingsResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listSitePushSettingsHandleError handles the ListSitePushSettings error response. +func (client *WebAppsClient) listSitePushSettingsHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListSitePushSettingsSlot - Description for Gets the Push settings associated with web app. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) ListSitePushSettingsSlot(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsListSitePushSettingsSlotOptions) (WebAppsListSitePushSettingsSlotResponse, error) { + req, err := client.listSitePushSettingsSlotCreateRequest(ctx, resourceGroupName, name, slot, options) + if err != nil { + return WebAppsListSitePushSettingsSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsListSitePushSettingsSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsListSitePushSettingsSlotResponse{}, client.listSitePushSettingsSlotHandleError(resp) + } + return client.listSitePushSettingsSlotHandleResponse(resp) +} + +// listSitePushSettingsSlotCreateRequest creates the ListSitePushSettingsSlot request. +func (client *WebAppsClient) listSitePushSettingsSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsListSitePushSettingsSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/pushsettings/list" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listSitePushSettingsSlotHandleResponse handles the ListSitePushSettingsSlot response. +func (client *WebAppsClient) listSitePushSettingsSlotHandleResponse(resp *http.Response) (WebAppsListSitePushSettingsSlotResponse, error) { + result := WebAppsListSitePushSettingsSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.PushSettings); err != nil { + return WebAppsListSitePushSettingsSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listSitePushSettingsSlotHandleError handles the ListSitePushSettingsSlot error response. +func (client *WebAppsClient) listSitePushSettingsSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListSlotConfigurationNames - Description for Gets the names of app settings and connection strings that stick to the slot (not swapped). +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) ListSlotConfigurationNames(ctx context.Context, resourceGroupName string, name string, options *WebAppsListSlotConfigurationNamesOptions) (WebAppsListSlotConfigurationNamesResponse, error) { + req, err := client.listSlotConfigurationNamesCreateRequest(ctx, resourceGroupName, name, options) + if err != nil { + return WebAppsListSlotConfigurationNamesResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsListSlotConfigurationNamesResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsListSlotConfigurationNamesResponse{}, client.listSlotConfigurationNamesHandleError(resp) + } + return client.listSlotConfigurationNamesHandleResponse(resp) +} + +// listSlotConfigurationNamesCreateRequest creates the ListSlotConfigurationNames request. +func (client *WebAppsClient) listSlotConfigurationNamesCreateRequest(ctx context.Context, resourceGroupName string, name string, options *WebAppsListSlotConfigurationNamesOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/slotConfigNames" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listSlotConfigurationNamesHandleResponse handles the ListSlotConfigurationNames response. +func (client *WebAppsClient) listSlotConfigurationNamesHandleResponse(resp *http.Response) (WebAppsListSlotConfigurationNamesResponse, error) { + result := WebAppsListSlotConfigurationNamesResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.SlotConfigNamesResource); err != nil { + return WebAppsListSlotConfigurationNamesResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listSlotConfigurationNamesHandleError handles the ListSlotConfigurationNames error response. +func (client *WebAppsClient) listSlotConfigurationNamesHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListSlotDifferencesFromProduction - Description for Get the difference in configuration settings between two web app slots. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) ListSlotDifferencesFromProduction(resourceGroupName string, name string, slotSwapEntity CsmSlotEntity, options *WebAppsListSlotDifferencesFromProductionOptions) *WebAppsListSlotDifferencesFromProductionPager { + return &WebAppsListSlotDifferencesFromProductionPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listSlotDifferencesFromProductionCreateRequest(ctx, resourceGroupName, name, slotSwapEntity, options) + }, + advancer: func(ctx context.Context, resp WebAppsListSlotDifferencesFromProductionResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.SlotDifferenceCollection.NextLink) + }, + } +} + +// listSlotDifferencesFromProductionCreateRequest creates the ListSlotDifferencesFromProduction request. +func (client *WebAppsClient) listSlotDifferencesFromProductionCreateRequest(ctx context.Context, resourceGroupName string, name string, slotSwapEntity CsmSlotEntity, options *WebAppsListSlotDifferencesFromProductionOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slotsdiffs" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, slotSwapEntity) +} + +// listSlotDifferencesFromProductionHandleResponse handles the ListSlotDifferencesFromProduction response. +func (client *WebAppsClient) listSlotDifferencesFromProductionHandleResponse(resp *http.Response) (WebAppsListSlotDifferencesFromProductionResponse, error) { + result := WebAppsListSlotDifferencesFromProductionResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.SlotDifferenceCollection); err != nil { + return WebAppsListSlotDifferencesFromProductionResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listSlotDifferencesFromProductionHandleError handles the ListSlotDifferencesFromProduction error response. +func (client *WebAppsClient) listSlotDifferencesFromProductionHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListSlotDifferencesSlot - Description for Get the difference in configuration settings between two web app slots. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) ListSlotDifferencesSlot(resourceGroupName string, name string, slot string, slotSwapEntity CsmSlotEntity, options *WebAppsListSlotDifferencesSlotOptions) *WebAppsListSlotDifferencesSlotPager { + return &WebAppsListSlotDifferencesSlotPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listSlotDifferencesSlotCreateRequest(ctx, resourceGroupName, name, slot, slotSwapEntity, options) + }, + advancer: func(ctx context.Context, resp WebAppsListSlotDifferencesSlotResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.SlotDifferenceCollection.NextLink) + }, + } +} + +// listSlotDifferencesSlotCreateRequest creates the ListSlotDifferencesSlot request. +func (client *WebAppsClient) listSlotDifferencesSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, slot string, slotSwapEntity CsmSlotEntity, options *WebAppsListSlotDifferencesSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/slotsdiffs" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, slotSwapEntity) +} + +// listSlotDifferencesSlotHandleResponse handles the ListSlotDifferencesSlot response. +func (client *WebAppsClient) listSlotDifferencesSlotHandleResponse(resp *http.Response) (WebAppsListSlotDifferencesSlotResponse, error) { + result := WebAppsListSlotDifferencesSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.SlotDifferenceCollection); err != nil { + return WebAppsListSlotDifferencesSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listSlotDifferencesSlotHandleError handles the ListSlotDifferencesSlot error response. +func (client *WebAppsClient) listSlotDifferencesSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListSlots - Description for Gets an app's deployment slots. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) ListSlots(resourceGroupName string, name string, options *WebAppsListSlotsOptions) *WebAppsListSlotsPager { + return &WebAppsListSlotsPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listSlotsCreateRequest(ctx, resourceGroupName, name, options) + }, + advancer: func(ctx context.Context, resp WebAppsListSlotsResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.WebAppCollection.NextLink) + }, + } +} + +// listSlotsCreateRequest creates the ListSlots request. +func (client *WebAppsClient) listSlotsCreateRequest(ctx context.Context, resourceGroupName string, name string, options *WebAppsListSlotsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listSlotsHandleResponse handles the ListSlots response. +func (client *WebAppsClient) listSlotsHandleResponse(resp *http.Response) (WebAppsListSlotsResponse, error) { + result := WebAppsListSlotsResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.WebAppCollection); err != nil { + return WebAppsListSlotsResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listSlotsHandleError handles the ListSlots error response. +func (client *WebAppsClient) listSlotsHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListSnapshots - Description for Returns all Snapshots to the user. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) ListSnapshots(resourceGroupName string, name string, options *WebAppsListSnapshotsOptions) *WebAppsListSnapshotsPager { + return &WebAppsListSnapshotsPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listSnapshotsCreateRequest(ctx, resourceGroupName, name, options) + }, + advancer: func(ctx context.Context, resp WebAppsListSnapshotsResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.SnapshotCollection.NextLink) + }, + } +} + +// listSnapshotsCreateRequest creates the ListSnapshots request. +func (client *WebAppsClient) listSnapshotsCreateRequest(ctx context.Context, resourceGroupName string, name string, options *WebAppsListSnapshotsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/snapshots" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listSnapshotsHandleResponse handles the ListSnapshots response. +func (client *WebAppsClient) listSnapshotsHandleResponse(resp *http.Response) (WebAppsListSnapshotsResponse, error) { + result := WebAppsListSnapshotsResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.SnapshotCollection); err != nil { + return WebAppsListSnapshotsResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listSnapshotsHandleError handles the ListSnapshots error response. +func (client *WebAppsClient) listSnapshotsHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListSnapshotsFromDRSecondary - Description for Returns all Snapshots to the user from DRSecondary endpoint. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) ListSnapshotsFromDRSecondary(resourceGroupName string, name string, options *WebAppsListSnapshotsFromDRSecondaryOptions) *WebAppsListSnapshotsFromDRSecondaryPager { + return &WebAppsListSnapshotsFromDRSecondaryPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listSnapshotsFromDRSecondaryCreateRequest(ctx, resourceGroupName, name, options) + }, + advancer: func(ctx context.Context, resp WebAppsListSnapshotsFromDRSecondaryResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.SnapshotCollection.NextLink) + }, + } +} + +// listSnapshotsFromDRSecondaryCreateRequest creates the ListSnapshotsFromDRSecondary request. +func (client *WebAppsClient) listSnapshotsFromDRSecondaryCreateRequest(ctx context.Context, resourceGroupName string, name string, options *WebAppsListSnapshotsFromDRSecondaryOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/snapshotsdr" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listSnapshotsFromDRSecondaryHandleResponse handles the ListSnapshotsFromDRSecondary response. +func (client *WebAppsClient) listSnapshotsFromDRSecondaryHandleResponse(resp *http.Response) (WebAppsListSnapshotsFromDRSecondaryResponse, error) { + result := WebAppsListSnapshotsFromDRSecondaryResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.SnapshotCollection); err != nil { + return WebAppsListSnapshotsFromDRSecondaryResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listSnapshotsFromDRSecondaryHandleError handles the ListSnapshotsFromDRSecondary error response. +func (client *WebAppsClient) listSnapshotsFromDRSecondaryHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListSnapshotsFromDRSecondarySlot - Description for Returns all Snapshots to the user from DRSecondary endpoint. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) ListSnapshotsFromDRSecondarySlot(resourceGroupName string, name string, slot string, options *WebAppsListSnapshotsFromDRSecondarySlotOptions) *WebAppsListSnapshotsFromDRSecondarySlotPager { + return &WebAppsListSnapshotsFromDRSecondarySlotPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listSnapshotsFromDRSecondarySlotCreateRequest(ctx, resourceGroupName, name, slot, options) + }, + advancer: func(ctx context.Context, resp WebAppsListSnapshotsFromDRSecondarySlotResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.SnapshotCollection.NextLink) + }, + } +} + +// listSnapshotsFromDRSecondarySlotCreateRequest creates the ListSnapshotsFromDRSecondarySlot request. +func (client *WebAppsClient) listSnapshotsFromDRSecondarySlotCreateRequest(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsListSnapshotsFromDRSecondarySlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/snapshotsdr" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listSnapshotsFromDRSecondarySlotHandleResponse handles the ListSnapshotsFromDRSecondarySlot response. +func (client *WebAppsClient) listSnapshotsFromDRSecondarySlotHandleResponse(resp *http.Response) (WebAppsListSnapshotsFromDRSecondarySlotResponse, error) { + result := WebAppsListSnapshotsFromDRSecondarySlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.SnapshotCollection); err != nil { + return WebAppsListSnapshotsFromDRSecondarySlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listSnapshotsFromDRSecondarySlotHandleError handles the ListSnapshotsFromDRSecondarySlot error response. +func (client *WebAppsClient) listSnapshotsFromDRSecondarySlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListSnapshotsSlot - Description for Returns all Snapshots to the user. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) ListSnapshotsSlot(resourceGroupName string, name string, slot string, options *WebAppsListSnapshotsSlotOptions) *WebAppsListSnapshotsSlotPager { + return &WebAppsListSnapshotsSlotPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listSnapshotsSlotCreateRequest(ctx, resourceGroupName, name, slot, options) + }, + advancer: func(ctx context.Context, resp WebAppsListSnapshotsSlotResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.SnapshotCollection.NextLink) + }, + } +} + +// listSnapshotsSlotCreateRequest creates the ListSnapshotsSlot request. +func (client *WebAppsClient) listSnapshotsSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsListSnapshotsSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/snapshots" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listSnapshotsSlotHandleResponse handles the ListSnapshotsSlot response. +func (client *WebAppsClient) listSnapshotsSlotHandleResponse(resp *http.Response) (WebAppsListSnapshotsSlotResponse, error) { + result := WebAppsListSnapshotsSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.SnapshotCollection); err != nil { + return WebAppsListSnapshotsSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listSnapshotsSlotHandleError handles the ListSnapshotsSlot error response. +func (client *WebAppsClient) listSnapshotsSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListSyncFunctionTriggers - Description for This is to allow calling via powershell and ARM template. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) ListSyncFunctionTriggers(ctx context.Context, resourceGroupName string, name string, options *WebAppsListSyncFunctionTriggersOptions) (WebAppsListSyncFunctionTriggersResponse, error) { + req, err := client.listSyncFunctionTriggersCreateRequest(ctx, resourceGroupName, name, options) + if err != nil { + return WebAppsListSyncFunctionTriggersResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsListSyncFunctionTriggersResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsListSyncFunctionTriggersResponse{}, client.listSyncFunctionTriggersHandleError(resp) + } + return client.listSyncFunctionTriggersHandleResponse(resp) +} + +// listSyncFunctionTriggersCreateRequest creates the ListSyncFunctionTriggers request. +func (client *WebAppsClient) listSyncFunctionTriggersCreateRequest(ctx context.Context, resourceGroupName string, name string, options *WebAppsListSyncFunctionTriggersOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/listsyncfunctiontriggerstatus" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listSyncFunctionTriggersHandleResponse handles the ListSyncFunctionTriggers response. +func (client *WebAppsClient) listSyncFunctionTriggersHandleResponse(resp *http.Response) (WebAppsListSyncFunctionTriggersResponse, error) { + result := WebAppsListSyncFunctionTriggersResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.FunctionSecrets); err != nil { + return WebAppsListSyncFunctionTriggersResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listSyncFunctionTriggersHandleError handles the ListSyncFunctionTriggers error response. +func (client *WebAppsClient) listSyncFunctionTriggersHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListSyncFunctionTriggersSlot - Description for This is to allow calling via powershell and ARM template. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) ListSyncFunctionTriggersSlot(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsListSyncFunctionTriggersSlotOptions) (WebAppsListSyncFunctionTriggersSlotResponse, error) { + req, err := client.listSyncFunctionTriggersSlotCreateRequest(ctx, resourceGroupName, name, slot, options) + if err != nil { + return WebAppsListSyncFunctionTriggersSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsListSyncFunctionTriggersSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsListSyncFunctionTriggersSlotResponse{}, client.listSyncFunctionTriggersSlotHandleError(resp) + } + return client.listSyncFunctionTriggersSlotHandleResponse(resp) +} + +// listSyncFunctionTriggersSlotCreateRequest creates the ListSyncFunctionTriggersSlot request. +func (client *WebAppsClient) listSyncFunctionTriggersSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsListSyncFunctionTriggersSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/listsyncfunctiontriggerstatus" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listSyncFunctionTriggersSlotHandleResponse handles the ListSyncFunctionTriggersSlot response. +func (client *WebAppsClient) listSyncFunctionTriggersSlotHandleResponse(resp *http.Response) (WebAppsListSyncFunctionTriggersSlotResponse, error) { + result := WebAppsListSyncFunctionTriggersSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.FunctionSecrets); err != nil { + return WebAppsListSyncFunctionTriggersSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listSyncFunctionTriggersSlotHandleError handles the ListSyncFunctionTriggersSlot error response. +func (client *WebAppsClient) listSyncFunctionTriggersSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListSyncStatus - Description for This is to allow calling via powershell and ARM template. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) ListSyncStatus(ctx context.Context, resourceGroupName string, name string, options *WebAppsListSyncStatusOptions) (WebAppsListSyncStatusResponse, error) { + req, err := client.listSyncStatusCreateRequest(ctx, resourceGroupName, name, options) + if err != nil { + return WebAppsListSyncStatusResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsListSyncStatusResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusNoContent) { + return WebAppsListSyncStatusResponse{}, client.listSyncStatusHandleError(resp) + } + return WebAppsListSyncStatusResponse{RawResponse: resp}, nil +} + +// listSyncStatusCreateRequest creates the ListSyncStatus request. +func (client *WebAppsClient) listSyncStatusCreateRequest(ctx context.Context, resourceGroupName string, name string, options *WebAppsListSyncStatusOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/host/default/listsyncstatus" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listSyncStatusHandleError handles the ListSyncStatus error response. +func (client *WebAppsClient) listSyncStatusHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListSyncStatusSlot - Description for This is to allow calling via powershell and ARM template. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) ListSyncStatusSlot(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsListSyncStatusSlotOptions) (WebAppsListSyncStatusSlotResponse, error) { + req, err := client.listSyncStatusSlotCreateRequest(ctx, resourceGroupName, name, slot, options) + if err != nil { + return WebAppsListSyncStatusSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsListSyncStatusSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusNoContent) { + return WebAppsListSyncStatusSlotResponse{}, client.listSyncStatusSlotHandleError(resp) + } + return WebAppsListSyncStatusSlotResponse{RawResponse: resp}, nil +} + +// listSyncStatusSlotCreateRequest creates the ListSyncStatusSlot request. +func (client *WebAppsClient) listSyncStatusSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsListSyncStatusSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/host/default/listsyncstatus" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listSyncStatusSlotHandleError handles the ListSyncStatusSlot error response. +func (client *WebAppsClient) listSyncStatusSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListTriggeredWebJobHistory - Description for List a triggered web job's history for an app, or a deployment slot. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) ListTriggeredWebJobHistory(resourceGroupName string, name string, webJobName string, options *WebAppsListTriggeredWebJobHistoryOptions) *WebAppsListTriggeredWebJobHistoryPager { + return &WebAppsListTriggeredWebJobHistoryPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listTriggeredWebJobHistoryCreateRequest(ctx, resourceGroupName, name, webJobName, options) + }, + advancer: func(ctx context.Context, resp WebAppsListTriggeredWebJobHistoryResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.TriggeredJobHistoryCollection.NextLink) + }, + } +} + +// listTriggeredWebJobHistoryCreateRequest creates the ListTriggeredWebJobHistory request. +func (client *WebAppsClient) listTriggeredWebJobHistoryCreateRequest(ctx context.Context, resourceGroupName string, name string, webJobName string, options *WebAppsListTriggeredWebJobHistoryOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/triggeredwebjobs/{webJobName}/history" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if webJobName == "" { + return nil, errors.New("parameter webJobName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{webJobName}", url.PathEscape(webJobName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listTriggeredWebJobHistoryHandleResponse handles the ListTriggeredWebJobHistory response. +func (client *WebAppsClient) listTriggeredWebJobHistoryHandleResponse(resp *http.Response) (WebAppsListTriggeredWebJobHistoryResponse, error) { + result := WebAppsListTriggeredWebJobHistoryResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.TriggeredJobHistoryCollection); err != nil { + return WebAppsListTriggeredWebJobHistoryResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listTriggeredWebJobHistoryHandleError handles the ListTriggeredWebJobHistory error response. +func (client *WebAppsClient) listTriggeredWebJobHistoryHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + switch resp.StatusCode { + case http.StatusNotFound: + if len(body) == 0 { + return runtime.NewResponseError(errors.New(resp.Status), resp) + } + return runtime.NewResponseError(errors.New(string(body)), resp) + default: + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) + } +} + +// ListTriggeredWebJobHistorySlot - Description for List a triggered web job's history for an app, or a deployment slot. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) ListTriggeredWebJobHistorySlot(resourceGroupName string, name string, webJobName string, slot string, options *WebAppsListTriggeredWebJobHistorySlotOptions) *WebAppsListTriggeredWebJobHistorySlotPager { + return &WebAppsListTriggeredWebJobHistorySlotPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listTriggeredWebJobHistorySlotCreateRequest(ctx, resourceGroupName, name, webJobName, slot, options) + }, + advancer: func(ctx context.Context, resp WebAppsListTriggeredWebJobHistorySlotResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.TriggeredJobHistoryCollection.NextLink) + }, + } +} + +// listTriggeredWebJobHistorySlotCreateRequest creates the ListTriggeredWebJobHistorySlot request. +func (client *WebAppsClient) listTriggeredWebJobHistorySlotCreateRequest(ctx context.Context, resourceGroupName string, name string, webJobName string, slot string, options *WebAppsListTriggeredWebJobHistorySlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs/{webJobName}/history" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if webJobName == "" { + return nil, errors.New("parameter webJobName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{webJobName}", url.PathEscape(webJobName)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listTriggeredWebJobHistorySlotHandleResponse handles the ListTriggeredWebJobHistorySlot response. +func (client *WebAppsClient) listTriggeredWebJobHistorySlotHandleResponse(resp *http.Response) (WebAppsListTriggeredWebJobHistorySlotResponse, error) { + result := WebAppsListTriggeredWebJobHistorySlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.TriggeredJobHistoryCollection); err != nil { + return WebAppsListTriggeredWebJobHistorySlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listTriggeredWebJobHistorySlotHandleError handles the ListTriggeredWebJobHistorySlot error response. +func (client *WebAppsClient) listTriggeredWebJobHistorySlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + switch resp.StatusCode { + case http.StatusNotFound: + if len(body) == 0 { + return runtime.NewResponseError(errors.New(resp.Status), resp) + } + return runtime.NewResponseError(errors.New(string(body)), resp) + default: + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) + } +} + +// ListTriggeredWebJobs - Description for List triggered web jobs for an app, or a deployment slot. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) ListTriggeredWebJobs(resourceGroupName string, name string, options *WebAppsListTriggeredWebJobsOptions) *WebAppsListTriggeredWebJobsPager { + return &WebAppsListTriggeredWebJobsPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listTriggeredWebJobsCreateRequest(ctx, resourceGroupName, name, options) + }, + advancer: func(ctx context.Context, resp WebAppsListTriggeredWebJobsResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.TriggeredWebJobCollection.NextLink) + }, + } +} + +// listTriggeredWebJobsCreateRequest creates the ListTriggeredWebJobs request. +func (client *WebAppsClient) listTriggeredWebJobsCreateRequest(ctx context.Context, resourceGroupName string, name string, options *WebAppsListTriggeredWebJobsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/triggeredwebjobs" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listTriggeredWebJobsHandleResponse handles the ListTriggeredWebJobs response. +func (client *WebAppsClient) listTriggeredWebJobsHandleResponse(resp *http.Response) (WebAppsListTriggeredWebJobsResponse, error) { + result := WebAppsListTriggeredWebJobsResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.TriggeredWebJobCollection); err != nil { + return WebAppsListTriggeredWebJobsResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listTriggeredWebJobsHandleError handles the ListTriggeredWebJobs error response. +func (client *WebAppsClient) listTriggeredWebJobsHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListTriggeredWebJobsSlot - Description for List triggered web jobs for an app, or a deployment slot. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) ListTriggeredWebJobsSlot(resourceGroupName string, name string, slot string, options *WebAppsListTriggeredWebJobsSlotOptions) *WebAppsListTriggeredWebJobsSlotPager { + return &WebAppsListTriggeredWebJobsSlotPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listTriggeredWebJobsSlotCreateRequest(ctx, resourceGroupName, name, slot, options) + }, + advancer: func(ctx context.Context, resp WebAppsListTriggeredWebJobsSlotResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.TriggeredWebJobCollection.NextLink) + }, + } +} + +// listTriggeredWebJobsSlotCreateRequest creates the ListTriggeredWebJobsSlot request. +func (client *WebAppsClient) listTriggeredWebJobsSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsListTriggeredWebJobsSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listTriggeredWebJobsSlotHandleResponse handles the ListTriggeredWebJobsSlot response. +func (client *WebAppsClient) listTriggeredWebJobsSlotHandleResponse(resp *http.Response) (WebAppsListTriggeredWebJobsSlotResponse, error) { + result := WebAppsListTriggeredWebJobsSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.TriggeredWebJobCollection); err != nil { + return WebAppsListTriggeredWebJobsSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listTriggeredWebJobsSlotHandleError handles the ListTriggeredWebJobsSlot error response. +func (client *WebAppsClient) listTriggeredWebJobsSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListUsages - Description for Gets the quota usage information of an app (or deployment slot, if specified). +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) ListUsages(resourceGroupName string, name string, options *WebAppsListUsagesOptions) *WebAppsListUsagesPager { + return &WebAppsListUsagesPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listUsagesCreateRequest(ctx, resourceGroupName, name, options) + }, + advancer: func(ctx context.Context, resp WebAppsListUsagesResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.CsmUsageQuotaCollection.NextLink) + }, + } +} + +// listUsagesCreateRequest creates the ListUsages request. +func (client *WebAppsClient) listUsagesCreateRequest(ctx context.Context, resourceGroupName string, name string, options *WebAppsListUsagesOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/usages" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + unencodedParams := []string{req.Raw().URL.RawQuery} + if options != nil && options.Filter != nil { + unencodedParams = append(unencodedParams, "$filter="+*options.Filter) + } + req.Raw().URL.RawQuery = strings.Join(unencodedParams, "&") + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listUsagesHandleResponse handles the ListUsages response. +func (client *WebAppsClient) listUsagesHandleResponse(resp *http.Response) (WebAppsListUsagesResponse, error) { + result := WebAppsListUsagesResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.CsmUsageQuotaCollection); err != nil { + return WebAppsListUsagesResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listUsagesHandleError handles the ListUsages error response. +func (client *WebAppsClient) listUsagesHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListUsagesSlot - Description for Gets the quota usage information of an app (or deployment slot, if specified). +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) ListUsagesSlot(resourceGroupName string, name string, slot string, options *WebAppsListUsagesSlotOptions) *WebAppsListUsagesSlotPager { + return &WebAppsListUsagesSlotPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listUsagesSlotCreateRequest(ctx, resourceGroupName, name, slot, options) + }, + advancer: func(ctx context.Context, resp WebAppsListUsagesSlotResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.CsmUsageQuotaCollection.NextLink) + }, + } +} + +// listUsagesSlotCreateRequest creates the ListUsagesSlot request. +func (client *WebAppsClient) listUsagesSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsListUsagesSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/usages" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + unencodedParams := []string{req.Raw().URL.RawQuery} + if options != nil && options.Filter != nil { + unencodedParams = append(unencodedParams, "$filter="+*options.Filter) + } + req.Raw().URL.RawQuery = strings.Join(unencodedParams, "&") + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listUsagesSlotHandleResponse handles the ListUsagesSlot response. +func (client *WebAppsClient) listUsagesSlotHandleResponse(resp *http.Response) (WebAppsListUsagesSlotResponse, error) { + result := WebAppsListUsagesSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.CsmUsageQuotaCollection); err != nil { + return WebAppsListUsagesSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listUsagesSlotHandleError handles the ListUsagesSlot error response. +func (client *WebAppsClient) listUsagesSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListVnetConnections - Description for Gets the virtual networks the app (or deployment slot) is connected to. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) ListVnetConnections(ctx context.Context, resourceGroupName string, name string, options *WebAppsListVnetConnectionsOptions) (WebAppsListVnetConnectionsResponse, error) { + req, err := client.listVnetConnectionsCreateRequest(ctx, resourceGroupName, name, options) + if err != nil { + return WebAppsListVnetConnectionsResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsListVnetConnectionsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsListVnetConnectionsResponse{}, client.listVnetConnectionsHandleError(resp) + } + return client.listVnetConnectionsHandleResponse(resp) +} + +// listVnetConnectionsCreateRequest creates the ListVnetConnections request. +func (client *WebAppsClient) listVnetConnectionsCreateRequest(ctx context.Context, resourceGroupName string, name string, options *WebAppsListVnetConnectionsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listVnetConnectionsHandleResponse handles the ListVnetConnections response. +func (client *WebAppsClient) listVnetConnectionsHandleResponse(resp *http.Response) (WebAppsListVnetConnectionsResponse, error) { + result := WebAppsListVnetConnectionsResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.VnetInfoResourceArray); err != nil { + return WebAppsListVnetConnectionsResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listVnetConnectionsHandleError handles the ListVnetConnections error response. +func (client *WebAppsClient) listVnetConnectionsHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListVnetConnectionsSlot - Description for Gets the virtual networks the app (or deployment slot) is connected to. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) ListVnetConnectionsSlot(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsListVnetConnectionsSlotOptions) (WebAppsListVnetConnectionsSlotResponse, error) { + req, err := client.listVnetConnectionsSlotCreateRequest(ctx, resourceGroupName, name, slot, options) + if err != nil { + return WebAppsListVnetConnectionsSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsListVnetConnectionsSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsListVnetConnectionsSlotResponse{}, client.listVnetConnectionsSlotHandleError(resp) + } + return client.listVnetConnectionsSlotHandleResponse(resp) +} + +// listVnetConnectionsSlotCreateRequest creates the ListVnetConnectionsSlot request. +func (client *WebAppsClient) listVnetConnectionsSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsListVnetConnectionsSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listVnetConnectionsSlotHandleResponse handles the ListVnetConnectionsSlot response. +func (client *WebAppsClient) listVnetConnectionsSlotHandleResponse(resp *http.Response) (WebAppsListVnetConnectionsSlotResponse, error) { + result := WebAppsListVnetConnectionsSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.VnetInfoResourceArray); err != nil { + return WebAppsListVnetConnectionsSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listVnetConnectionsSlotHandleError handles the ListVnetConnectionsSlot error response. +func (client *WebAppsClient) listVnetConnectionsSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListWebJobs - Description for List webjobs for an app, or a deployment slot. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) ListWebJobs(resourceGroupName string, name string, options *WebAppsListWebJobsOptions) *WebAppsListWebJobsPager { + return &WebAppsListWebJobsPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listWebJobsCreateRequest(ctx, resourceGroupName, name, options) + }, + advancer: func(ctx context.Context, resp WebAppsListWebJobsResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.WebJobCollection.NextLink) + }, + } +} + +// listWebJobsCreateRequest creates the ListWebJobs request. +func (client *WebAppsClient) listWebJobsCreateRequest(ctx context.Context, resourceGroupName string, name string, options *WebAppsListWebJobsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/webjobs" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listWebJobsHandleResponse handles the ListWebJobs response. +func (client *WebAppsClient) listWebJobsHandleResponse(resp *http.Response) (WebAppsListWebJobsResponse, error) { + result := WebAppsListWebJobsResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.WebJobCollection); err != nil { + return WebAppsListWebJobsResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listWebJobsHandleError handles the ListWebJobs error response. +func (client *WebAppsClient) listWebJobsHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListWebJobsSlot - Description for List webjobs for an app, or a deployment slot. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) ListWebJobsSlot(resourceGroupName string, name string, slot string, options *WebAppsListWebJobsSlotOptions) *WebAppsListWebJobsSlotPager { + return &WebAppsListWebJobsSlotPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listWebJobsSlotCreateRequest(ctx, resourceGroupName, name, slot, options) + }, + advancer: func(ctx context.Context, resp WebAppsListWebJobsSlotResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.WebJobCollection.NextLink) + }, + } +} + +// listWebJobsSlotCreateRequest creates the ListWebJobsSlot request. +func (client *WebAppsClient) listWebJobsSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsListWebJobsSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/webjobs" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listWebJobsSlotHandleResponse handles the ListWebJobsSlot response. +func (client *WebAppsClient) listWebJobsSlotHandleResponse(resp *http.Response) (WebAppsListWebJobsSlotResponse, error) { + result := WebAppsListWebJobsSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.WebJobCollection); err != nil { + return WebAppsListWebJobsSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listWebJobsSlotHandleError handles the ListWebJobsSlot error response. +func (client *WebAppsClient) listWebJobsSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// BeginMigrateMySQL - Description for Migrates a local (in-app) MySql database to a remote MySql database. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) BeginMigrateMySQL(ctx context.Context, resourceGroupName string, name string, migrationRequestEnvelope MigrateMySQLRequest, options *WebAppsBeginMigrateMySQLOptions) (WebAppsMigrateMySQLPollerResponse, error) { + resp, err := client.migrateMySQL(ctx, resourceGroupName, name, migrationRequestEnvelope, options) + if err != nil { + return WebAppsMigrateMySQLPollerResponse{}, err + } + result := WebAppsMigrateMySQLPollerResponse{ + RawResponse: resp, + } + pt, err := armruntime.NewPoller("WebAppsClient.MigrateMySQL", "", resp, client.pl, client.migrateMySQLHandleError) + if err != nil { + return WebAppsMigrateMySQLPollerResponse{}, err + } + result.Poller = &WebAppsMigrateMySQLPoller{ + pt: pt, + } + return result, nil +} + +// MigrateMySQL - Description for Migrates a local (in-app) MySql database to a remote MySql database. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) migrateMySQL(ctx context.Context, resourceGroupName string, name string, migrationRequestEnvelope MigrateMySQLRequest, options *WebAppsBeginMigrateMySQLOptions) (*http.Response, error) { + req, err := client.migrateMySQLCreateRequest(ctx, resourceGroupName, name, migrationRequestEnvelope, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return nil, client.migrateMySQLHandleError(resp) + } + return resp, nil +} + +// migrateMySQLCreateRequest creates the MigrateMySQL request. +func (client *WebAppsClient) migrateMySQLCreateRequest(ctx context.Context, resourceGroupName string, name string, migrationRequestEnvelope MigrateMySQLRequest, options *WebAppsBeginMigrateMySQLOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/migratemysql" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, migrationRequestEnvelope) +} + +// migrateMySQLHandleError handles the MigrateMySQL error response. +func (client *WebAppsClient) migrateMySQLHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// BeginMigrateStorage - Description for Restores a web app. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) BeginMigrateStorage(ctx context.Context, subscriptionName string, resourceGroupName string, name string, migrationOptions StorageMigrationOptions, options *WebAppsBeginMigrateStorageOptions) (WebAppsMigrateStoragePollerResponse, error) { + resp, err := client.migrateStorage(ctx, subscriptionName, resourceGroupName, name, migrationOptions, options) + if err != nil { + return WebAppsMigrateStoragePollerResponse{}, err + } + result := WebAppsMigrateStoragePollerResponse{ + RawResponse: resp, + } + pt, err := armruntime.NewPoller("WebAppsClient.MigrateStorage", "", resp, client.pl, client.migrateStorageHandleError) + if err != nil { + return WebAppsMigrateStoragePollerResponse{}, err + } + result.Poller = &WebAppsMigrateStoragePoller{ + pt: pt, + } + return result, nil +} + +// MigrateStorage - Description for Restores a web app. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) migrateStorage(ctx context.Context, subscriptionName string, resourceGroupName string, name string, migrationOptions StorageMigrationOptions, options *WebAppsBeginMigrateStorageOptions) (*http.Response, error) { + req, err := client.migrateStorageCreateRequest(ctx, subscriptionName, resourceGroupName, name, migrationOptions, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return nil, client.migrateStorageHandleError(resp) + } + return resp, nil +} + +// migrateStorageCreateRequest creates the MigrateStorage request. +func (client *WebAppsClient) migrateStorageCreateRequest(ctx context.Context, subscriptionName string, resourceGroupName string, name string, migrationOptions StorageMigrationOptions, options *WebAppsBeginMigrateStorageOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/migrate" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("subscriptionName", subscriptionName) + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, migrationOptions) +} + +// migrateStorageHandleError handles the MigrateStorage error response. +func (client *WebAppsClient) migrateStorageHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// PutPrivateAccessVnet - Description for Sets data around private site access enablement and authorized Virtual Networks that can access the site. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) PutPrivateAccessVnet(ctx context.Context, resourceGroupName string, name string, access PrivateAccess, options *WebAppsPutPrivateAccessVnetOptions) (WebAppsPutPrivateAccessVnetResponse, error) { + req, err := client.putPrivateAccessVnetCreateRequest(ctx, resourceGroupName, name, access, options) + if err != nil { + return WebAppsPutPrivateAccessVnetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsPutPrivateAccessVnetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsPutPrivateAccessVnetResponse{}, client.putPrivateAccessVnetHandleError(resp) + } + return client.putPrivateAccessVnetHandleResponse(resp) +} + +// putPrivateAccessVnetCreateRequest creates the PutPrivateAccessVnet request. +func (client *WebAppsClient) putPrivateAccessVnetCreateRequest(ctx context.Context, resourceGroupName string, name string, access PrivateAccess, options *WebAppsPutPrivateAccessVnetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateAccess/virtualNetworks" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, access) +} + +// putPrivateAccessVnetHandleResponse handles the PutPrivateAccessVnet response. +func (client *WebAppsClient) putPrivateAccessVnetHandleResponse(resp *http.Response) (WebAppsPutPrivateAccessVnetResponse, error) { + result := WebAppsPutPrivateAccessVnetResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.PrivateAccess); err != nil { + return WebAppsPutPrivateAccessVnetResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// putPrivateAccessVnetHandleError handles the PutPrivateAccessVnet error response. +func (client *WebAppsClient) putPrivateAccessVnetHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// PutPrivateAccessVnetSlot - Description for Sets data around private site access enablement and authorized Virtual Networks that can access the site. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) PutPrivateAccessVnetSlot(ctx context.Context, resourceGroupName string, name string, slot string, access PrivateAccess, options *WebAppsPutPrivateAccessVnetSlotOptions) (WebAppsPutPrivateAccessVnetSlotResponse, error) { + req, err := client.putPrivateAccessVnetSlotCreateRequest(ctx, resourceGroupName, name, slot, access, options) + if err != nil { + return WebAppsPutPrivateAccessVnetSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsPutPrivateAccessVnetSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsPutPrivateAccessVnetSlotResponse{}, client.putPrivateAccessVnetSlotHandleError(resp) + } + return client.putPrivateAccessVnetSlotHandleResponse(resp) +} + +// putPrivateAccessVnetSlotCreateRequest creates the PutPrivateAccessVnetSlot request. +func (client *WebAppsClient) putPrivateAccessVnetSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, slot string, access PrivateAccess, options *WebAppsPutPrivateAccessVnetSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/privateAccess/virtualNetworks" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, access) +} + +// putPrivateAccessVnetSlotHandleResponse handles the PutPrivateAccessVnetSlot response. +func (client *WebAppsClient) putPrivateAccessVnetSlotHandleResponse(resp *http.Response) (WebAppsPutPrivateAccessVnetSlotResponse, error) { + result := WebAppsPutPrivateAccessVnetSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.PrivateAccess); err != nil { + return WebAppsPutPrivateAccessVnetSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// putPrivateAccessVnetSlotHandleError handles the PutPrivateAccessVnetSlot error response. +func (client *WebAppsClient) putPrivateAccessVnetSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// RecoverSiteConfigurationSnapshot - Description for Reverts the configuration of an app to a previous snapshot. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) RecoverSiteConfigurationSnapshot(ctx context.Context, resourceGroupName string, name string, snapshotID string, options *WebAppsRecoverSiteConfigurationSnapshotOptions) (WebAppsRecoverSiteConfigurationSnapshotResponse, error) { + req, err := client.recoverSiteConfigurationSnapshotCreateRequest(ctx, resourceGroupName, name, snapshotID, options) + if err != nil { + return WebAppsRecoverSiteConfigurationSnapshotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsRecoverSiteConfigurationSnapshotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusNoContent) { + return WebAppsRecoverSiteConfigurationSnapshotResponse{}, client.recoverSiteConfigurationSnapshotHandleError(resp) + } + return WebAppsRecoverSiteConfigurationSnapshotResponse{RawResponse: resp}, nil +} + +// recoverSiteConfigurationSnapshotCreateRequest creates the RecoverSiteConfigurationSnapshot request. +func (client *WebAppsClient) recoverSiteConfigurationSnapshotCreateRequest(ctx context.Context, resourceGroupName string, name string, snapshotID string, options *WebAppsRecoverSiteConfigurationSnapshotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web/snapshots/{snapshotId}/recover" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if snapshotID == "" { + return nil, errors.New("parameter snapshotID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{snapshotId}", url.PathEscape(snapshotID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// recoverSiteConfigurationSnapshotHandleError handles the RecoverSiteConfigurationSnapshot error response. +func (client *WebAppsClient) recoverSiteConfigurationSnapshotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// RecoverSiteConfigurationSnapshotSlot - Description for Reverts the configuration of an app to a previous snapshot. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) RecoverSiteConfigurationSnapshotSlot(ctx context.Context, resourceGroupName string, name string, snapshotID string, slot string, options *WebAppsRecoverSiteConfigurationSnapshotSlotOptions) (WebAppsRecoverSiteConfigurationSnapshotSlotResponse, error) { + req, err := client.recoverSiteConfigurationSnapshotSlotCreateRequest(ctx, resourceGroupName, name, snapshotID, slot, options) + if err != nil { + return WebAppsRecoverSiteConfigurationSnapshotSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsRecoverSiteConfigurationSnapshotSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusNoContent) { + return WebAppsRecoverSiteConfigurationSnapshotSlotResponse{}, client.recoverSiteConfigurationSnapshotSlotHandleError(resp) + } + return WebAppsRecoverSiteConfigurationSnapshotSlotResponse{RawResponse: resp}, nil +} + +// recoverSiteConfigurationSnapshotSlotCreateRequest creates the RecoverSiteConfigurationSnapshotSlot request. +func (client *WebAppsClient) recoverSiteConfigurationSnapshotSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, snapshotID string, slot string, options *WebAppsRecoverSiteConfigurationSnapshotSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web/snapshots/{snapshotId}/recover" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if snapshotID == "" { + return nil, errors.New("parameter snapshotID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{snapshotId}", url.PathEscape(snapshotID)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// recoverSiteConfigurationSnapshotSlotHandleError handles the RecoverSiteConfigurationSnapshotSlot error response. +func (client *WebAppsClient) recoverSiteConfigurationSnapshotSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ResetProductionSlotConfig - Description for Resets the configuration settings of the current slot if they were previously modified by calling the API +// with POST. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) ResetProductionSlotConfig(ctx context.Context, resourceGroupName string, name string, options *WebAppsResetProductionSlotConfigOptions) (WebAppsResetProductionSlotConfigResponse, error) { + req, err := client.resetProductionSlotConfigCreateRequest(ctx, resourceGroupName, name, options) + if err != nil { + return WebAppsResetProductionSlotConfigResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsResetProductionSlotConfigResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsResetProductionSlotConfigResponse{}, client.resetProductionSlotConfigHandleError(resp) + } + return WebAppsResetProductionSlotConfigResponse{RawResponse: resp}, nil +} + +// resetProductionSlotConfigCreateRequest creates the ResetProductionSlotConfig request. +func (client *WebAppsClient) resetProductionSlotConfigCreateRequest(ctx context.Context, resourceGroupName string, name string, options *WebAppsResetProductionSlotConfigOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/resetSlotConfig" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// resetProductionSlotConfigHandleError handles the ResetProductionSlotConfig error response. +func (client *WebAppsClient) resetProductionSlotConfigHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ResetSlotConfigurationSlot - Description for Resets the configuration settings of the current slot if they were previously modified by calling the API +// with POST. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) ResetSlotConfigurationSlot(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsResetSlotConfigurationSlotOptions) (WebAppsResetSlotConfigurationSlotResponse, error) { + req, err := client.resetSlotConfigurationSlotCreateRequest(ctx, resourceGroupName, name, slot, options) + if err != nil { + return WebAppsResetSlotConfigurationSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsResetSlotConfigurationSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsResetSlotConfigurationSlotResponse{}, client.resetSlotConfigurationSlotHandleError(resp) + } + return WebAppsResetSlotConfigurationSlotResponse{RawResponse: resp}, nil +} + +// resetSlotConfigurationSlotCreateRequest creates the ResetSlotConfigurationSlot request. +func (client *WebAppsClient) resetSlotConfigurationSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsResetSlotConfigurationSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/resetSlotConfig" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// resetSlotConfigurationSlotHandleError handles the ResetSlotConfigurationSlot error response. +func (client *WebAppsClient) resetSlotConfigurationSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// Restart - Description for Restarts an app (or deployment slot, if specified). +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) Restart(ctx context.Context, resourceGroupName string, name string, options *WebAppsRestartOptions) (WebAppsRestartResponse, error) { + req, err := client.restartCreateRequest(ctx, resourceGroupName, name, options) + if err != nil { + return WebAppsRestartResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsRestartResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsRestartResponse{}, client.restartHandleError(resp) + } + return WebAppsRestartResponse{RawResponse: resp}, nil +} + +// restartCreateRequest creates the Restart request. +func (client *WebAppsClient) restartCreateRequest(ctx context.Context, resourceGroupName string, name string, options *WebAppsRestartOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/restart" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + if options != nil && options.SoftRestart != nil { + reqQP.Set("softRestart", strconv.FormatBool(*options.SoftRestart)) + } + if options != nil && options.Synchronous != nil { + reqQP.Set("synchronous", strconv.FormatBool(*options.Synchronous)) + } + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// restartHandleError handles the Restart error response. +func (client *WebAppsClient) restartHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// RestartSlot - Description for Restarts an app (or deployment slot, if specified). +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) RestartSlot(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsRestartSlotOptions) (WebAppsRestartSlotResponse, error) { + req, err := client.restartSlotCreateRequest(ctx, resourceGroupName, name, slot, options) + if err != nil { + return WebAppsRestartSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsRestartSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsRestartSlotResponse{}, client.restartSlotHandleError(resp) + } + return WebAppsRestartSlotResponse{RawResponse: resp}, nil +} + +// restartSlotCreateRequest creates the RestartSlot request. +func (client *WebAppsClient) restartSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsRestartSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/restart" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + if options != nil && options.SoftRestart != nil { + reqQP.Set("softRestart", strconv.FormatBool(*options.SoftRestart)) + } + if options != nil && options.Synchronous != nil { + reqQP.Set("synchronous", strconv.FormatBool(*options.Synchronous)) + } + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// restartSlotHandleError handles the RestartSlot error response. +func (client *WebAppsClient) restartSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// BeginRestore - Description for Restores a specific backup to another app (or deployment slot, if specified). +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) BeginRestore(ctx context.Context, resourceGroupName string, name string, backupID string, request RestoreRequest, options *WebAppsBeginRestoreOptions) (WebAppsRestorePollerResponse, error) { + resp, err := client.restore(ctx, resourceGroupName, name, backupID, request, options) + if err != nil { + return WebAppsRestorePollerResponse{}, err + } + result := WebAppsRestorePollerResponse{ + RawResponse: resp, + } + pt, err := armruntime.NewPoller("WebAppsClient.Restore", "", resp, client.pl, client.restoreHandleError) + if err != nil { + return WebAppsRestorePollerResponse{}, err + } + result.Poller = &WebAppsRestorePoller{ + pt: pt, + } + return result, nil +} + +// Restore - Description for Restores a specific backup to another app (or deployment slot, if specified). +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) restore(ctx context.Context, resourceGroupName string, name string, backupID string, request RestoreRequest, options *WebAppsBeginRestoreOptions) (*http.Response, error) { + req, err := client.restoreCreateRequest(ctx, resourceGroupName, name, backupID, request, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, client.restoreHandleError(resp) + } + return resp, nil +} + +// restoreCreateRequest creates the Restore request. +func (client *WebAppsClient) restoreCreateRequest(ctx context.Context, resourceGroupName string, name string, backupID string, request RestoreRequest, options *WebAppsBeginRestoreOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/backups/{backupId}/restore" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if backupID == "" { + return nil, errors.New("parameter backupID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{backupId}", url.PathEscape(backupID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, request) +} + +// restoreHandleError handles the Restore error response. +func (client *WebAppsClient) restoreHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// BeginRestoreFromBackupBlob - Description for Restores an app from a backup blob in Azure Storage. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) BeginRestoreFromBackupBlob(ctx context.Context, resourceGroupName string, name string, request RestoreRequest, options *WebAppsBeginRestoreFromBackupBlobOptions) (WebAppsRestoreFromBackupBlobPollerResponse, error) { + resp, err := client.restoreFromBackupBlob(ctx, resourceGroupName, name, request, options) + if err != nil { + return WebAppsRestoreFromBackupBlobPollerResponse{}, err + } + result := WebAppsRestoreFromBackupBlobPollerResponse{ + RawResponse: resp, + } + pt, err := armruntime.NewPoller("WebAppsClient.RestoreFromBackupBlob", "", resp, client.pl, client.restoreFromBackupBlobHandleError) + if err != nil { + return WebAppsRestoreFromBackupBlobPollerResponse{}, err + } + result.Poller = &WebAppsRestoreFromBackupBlobPoller{ + pt: pt, + } + return result, nil +} + +// RestoreFromBackupBlob - Description for Restores an app from a backup blob in Azure Storage. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) restoreFromBackupBlob(ctx context.Context, resourceGroupName string, name string, request RestoreRequest, options *WebAppsBeginRestoreFromBackupBlobOptions) (*http.Response, error) { + req, err := client.restoreFromBackupBlobCreateRequest(ctx, resourceGroupName, name, request, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, client.restoreFromBackupBlobHandleError(resp) + } + return resp, nil +} + +// restoreFromBackupBlobCreateRequest creates the RestoreFromBackupBlob request. +func (client *WebAppsClient) restoreFromBackupBlobCreateRequest(ctx context.Context, resourceGroupName string, name string, request RestoreRequest, options *WebAppsBeginRestoreFromBackupBlobOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/restoreFromBackupBlob" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, request) +} + +// restoreFromBackupBlobHandleError handles the RestoreFromBackupBlob error response. +func (client *WebAppsClient) restoreFromBackupBlobHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// BeginRestoreFromBackupBlobSlot - Description for Restores an app from a backup blob in Azure Storage. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) BeginRestoreFromBackupBlobSlot(ctx context.Context, resourceGroupName string, name string, slot string, request RestoreRequest, options *WebAppsBeginRestoreFromBackupBlobSlotOptions) (WebAppsRestoreFromBackupBlobSlotPollerResponse, error) { + resp, err := client.restoreFromBackupBlobSlot(ctx, resourceGroupName, name, slot, request, options) + if err != nil { + return WebAppsRestoreFromBackupBlobSlotPollerResponse{}, err + } + result := WebAppsRestoreFromBackupBlobSlotPollerResponse{ + RawResponse: resp, + } + pt, err := armruntime.NewPoller("WebAppsClient.RestoreFromBackupBlobSlot", "", resp, client.pl, client.restoreFromBackupBlobSlotHandleError) + if err != nil { + return WebAppsRestoreFromBackupBlobSlotPollerResponse{}, err + } + result.Poller = &WebAppsRestoreFromBackupBlobSlotPoller{ + pt: pt, + } + return result, nil +} + +// RestoreFromBackupBlobSlot - Description for Restores an app from a backup blob in Azure Storage. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) restoreFromBackupBlobSlot(ctx context.Context, resourceGroupName string, name string, slot string, request RestoreRequest, options *WebAppsBeginRestoreFromBackupBlobSlotOptions) (*http.Response, error) { + req, err := client.restoreFromBackupBlobSlotCreateRequest(ctx, resourceGroupName, name, slot, request, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, client.restoreFromBackupBlobSlotHandleError(resp) + } + return resp, nil +} + +// restoreFromBackupBlobSlotCreateRequest creates the RestoreFromBackupBlobSlot request. +func (client *WebAppsClient) restoreFromBackupBlobSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, slot string, request RestoreRequest, options *WebAppsBeginRestoreFromBackupBlobSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/restoreFromBackupBlob" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, request) +} + +// restoreFromBackupBlobSlotHandleError handles the RestoreFromBackupBlobSlot error response. +func (client *WebAppsClient) restoreFromBackupBlobSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// BeginRestoreFromDeletedApp - Description for Restores a deleted web app to this web app. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) BeginRestoreFromDeletedApp(ctx context.Context, resourceGroupName string, name string, restoreRequest DeletedAppRestoreRequest, options *WebAppsBeginRestoreFromDeletedAppOptions) (WebAppsRestoreFromDeletedAppPollerResponse, error) { + resp, err := client.restoreFromDeletedApp(ctx, resourceGroupName, name, restoreRequest, options) + if err != nil { + return WebAppsRestoreFromDeletedAppPollerResponse{}, err + } + result := WebAppsRestoreFromDeletedAppPollerResponse{ + RawResponse: resp, + } + pt, err := armruntime.NewPoller("WebAppsClient.RestoreFromDeletedApp", "", resp, client.pl, client.restoreFromDeletedAppHandleError) + if err != nil { + return WebAppsRestoreFromDeletedAppPollerResponse{}, err + } + result.Poller = &WebAppsRestoreFromDeletedAppPoller{ + pt: pt, + } + return result, nil +} + +// RestoreFromDeletedApp - Description for Restores a deleted web app to this web app. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) restoreFromDeletedApp(ctx context.Context, resourceGroupName string, name string, restoreRequest DeletedAppRestoreRequest, options *WebAppsBeginRestoreFromDeletedAppOptions) (*http.Response, error) { + req, err := client.restoreFromDeletedAppCreateRequest(ctx, resourceGroupName, name, restoreRequest, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, client.restoreFromDeletedAppHandleError(resp) + } + return resp, nil +} + +// restoreFromDeletedAppCreateRequest creates the RestoreFromDeletedApp request. +func (client *WebAppsClient) restoreFromDeletedAppCreateRequest(ctx context.Context, resourceGroupName string, name string, restoreRequest DeletedAppRestoreRequest, options *WebAppsBeginRestoreFromDeletedAppOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/restoreFromDeletedApp" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, restoreRequest) +} + +// restoreFromDeletedAppHandleError handles the RestoreFromDeletedApp error response. +func (client *WebAppsClient) restoreFromDeletedAppHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// BeginRestoreFromDeletedAppSlot - Description for Restores a deleted web app to this web app. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) BeginRestoreFromDeletedAppSlot(ctx context.Context, resourceGroupName string, name string, slot string, restoreRequest DeletedAppRestoreRequest, options *WebAppsBeginRestoreFromDeletedAppSlotOptions) (WebAppsRestoreFromDeletedAppSlotPollerResponse, error) { + resp, err := client.restoreFromDeletedAppSlot(ctx, resourceGroupName, name, slot, restoreRequest, options) + if err != nil { + return WebAppsRestoreFromDeletedAppSlotPollerResponse{}, err + } + result := WebAppsRestoreFromDeletedAppSlotPollerResponse{ + RawResponse: resp, + } + pt, err := armruntime.NewPoller("WebAppsClient.RestoreFromDeletedAppSlot", "", resp, client.pl, client.restoreFromDeletedAppSlotHandleError) + if err != nil { + return WebAppsRestoreFromDeletedAppSlotPollerResponse{}, err + } + result.Poller = &WebAppsRestoreFromDeletedAppSlotPoller{ + pt: pt, + } + return result, nil +} + +// RestoreFromDeletedAppSlot - Description for Restores a deleted web app to this web app. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) restoreFromDeletedAppSlot(ctx context.Context, resourceGroupName string, name string, slot string, restoreRequest DeletedAppRestoreRequest, options *WebAppsBeginRestoreFromDeletedAppSlotOptions) (*http.Response, error) { + req, err := client.restoreFromDeletedAppSlotCreateRequest(ctx, resourceGroupName, name, slot, restoreRequest, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, client.restoreFromDeletedAppSlotHandleError(resp) + } + return resp, nil +} + +// restoreFromDeletedAppSlotCreateRequest creates the RestoreFromDeletedAppSlot request. +func (client *WebAppsClient) restoreFromDeletedAppSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, slot string, restoreRequest DeletedAppRestoreRequest, options *WebAppsBeginRestoreFromDeletedAppSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/restoreFromDeletedApp" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, restoreRequest) +} + +// restoreFromDeletedAppSlotHandleError handles the RestoreFromDeletedAppSlot error response. +func (client *WebAppsClient) restoreFromDeletedAppSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// BeginRestoreSlot - Description for Restores a specific backup to another app (or deployment slot, if specified). +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) BeginRestoreSlot(ctx context.Context, resourceGroupName string, name string, backupID string, slot string, request RestoreRequest, options *WebAppsBeginRestoreSlotOptions) (WebAppsRestoreSlotPollerResponse, error) { + resp, err := client.restoreSlot(ctx, resourceGroupName, name, backupID, slot, request, options) + if err != nil { + return WebAppsRestoreSlotPollerResponse{}, err + } + result := WebAppsRestoreSlotPollerResponse{ + RawResponse: resp, + } + pt, err := armruntime.NewPoller("WebAppsClient.RestoreSlot", "", resp, client.pl, client.restoreSlotHandleError) + if err != nil { + return WebAppsRestoreSlotPollerResponse{}, err + } + result.Poller = &WebAppsRestoreSlotPoller{ + pt: pt, + } + return result, nil +} + +// RestoreSlot - Description for Restores a specific backup to another app (or deployment slot, if specified). +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) restoreSlot(ctx context.Context, resourceGroupName string, name string, backupID string, slot string, request RestoreRequest, options *WebAppsBeginRestoreSlotOptions) (*http.Response, error) { + req, err := client.restoreSlotCreateRequest(ctx, resourceGroupName, name, backupID, slot, request, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, client.restoreSlotHandleError(resp) + } + return resp, nil +} + +// restoreSlotCreateRequest creates the RestoreSlot request. +func (client *WebAppsClient) restoreSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, backupID string, slot string, request RestoreRequest, options *WebAppsBeginRestoreSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups/{backupId}/restore" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if backupID == "" { + return nil, errors.New("parameter backupID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{backupId}", url.PathEscape(backupID)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, request) +} + +// restoreSlotHandleError handles the RestoreSlot error response. +func (client *WebAppsClient) restoreSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// BeginRestoreSnapshot - Description for Restores a web app from a snapshot. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) BeginRestoreSnapshot(ctx context.Context, resourceGroupName string, name string, restoreRequest SnapshotRestoreRequest, options *WebAppsBeginRestoreSnapshotOptions) (WebAppsRestoreSnapshotPollerResponse, error) { + resp, err := client.restoreSnapshot(ctx, resourceGroupName, name, restoreRequest, options) + if err != nil { + return WebAppsRestoreSnapshotPollerResponse{}, err + } + result := WebAppsRestoreSnapshotPollerResponse{ + RawResponse: resp, + } + pt, err := armruntime.NewPoller("WebAppsClient.RestoreSnapshot", "", resp, client.pl, client.restoreSnapshotHandleError) + if err != nil { + return WebAppsRestoreSnapshotPollerResponse{}, err + } + result.Poller = &WebAppsRestoreSnapshotPoller{ + pt: pt, + } + return result, nil +} + +// RestoreSnapshot - Description for Restores a web app from a snapshot. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) restoreSnapshot(ctx context.Context, resourceGroupName string, name string, restoreRequest SnapshotRestoreRequest, options *WebAppsBeginRestoreSnapshotOptions) (*http.Response, error) { + req, err := client.restoreSnapshotCreateRequest(ctx, resourceGroupName, name, restoreRequest, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, client.restoreSnapshotHandleError(resp) + } + return resp, nil +} + +// restoreSnapshotCreateRequest creates the RestoreSnapshot request. +func (client *WebAppsClient) restoreSnapshotCreateRequest(ctx context.Context, resourceGroupName string, name string, restoreRequest SnapshotRestoreRequest, options *WebAppsBeginRestoreSnapshotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/restoreSnapshot" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, restoreRequest) +} + +// restoreSnapshotHandleError handles the RestoreSnapshot error response. +func (client *WebAppsClient) restoreSnapshotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// BeginRestoreSnapshotSlot - Description for Restores a web app from a snapshot. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) BeginRestoreSnapshotSlot(ctx context.Context, resourceGroupName string, name string, slot string, restoreRequest SnapshotRestoreRequest, options *WebAppsBeginRestoreSnapshotSlotOptions) (WebAppsRestoreSnapshotSlotPollerResponse, error) { + resp, err := client.restoreSnapshotSlot(ctx, resourceGroupName, name, slot, restoreRequest, options) + if err != nil { + return WebAppsRestoreSnapshotSlotPollerResponse{}, err + } + result := WebAppsRestoreSnapshotSlotPollerResponse{ + RawResponse: resp, + } + pt, err := armruntime.NewPoller("WebAppsClient.RestoreSnapshotSlot", "", resp, client.pl, client.restoreSnapshotSlotHandleError) + if err != nil { + return WebAppsRestoreSnapshotSlotPollerResponse{}, err + } + result.Poller = &WebAppsRestoreSnapshotSlotPoller{ + pt: pt, + } + return result, nil +} + +// RestoreSnapshotSlot - Description for Restores a web app from a snapshot. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) restoreSnapshotSlot(ctx context.Context, resourceGroupName string, name string, slot string, restoreRequest SnapshotRestoreRequest, options *WebAppsBeginRestoreSnapshotSlotOptions) (*http.Response, error) { + req, err := client.restoreSnapshotSlotCreateRequest(ctx, resourceGroupName, name, slot, restoreRequest, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, client.restoreSnapshotSlotHandleError(resp) + } + return resp, nil +} + +// restoreSnapshotSlotCreateRequest creates the RestoreSnapshotSlot request. +func (client *WebAppsClient) restoreSnapshotSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, slot string, restoreRequest SnapshotRestoreRequest, options *WebAppsBeginRestoreSnapshotSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/restoreSnapshot" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, restoreRequest) +} + +// restoreSnapshotSlotHandleError handles the RestoreSnapshotSlot error response. +func (client *WebAppsClient) restoreSnapshotSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// RunTriggeredWebJob - Description for Run a triggered web job for an app, or a deployment slot. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) RunTriggeredWebJob(ctx context.Context, resourceGroupName string, name string, webJobName string, options *WebAppsRunTriggeredWebJobOptions) (WebAppsRunTriggeredWebJobResponse, error) { + req, err := client.runTriggeredWebJobCreateRequest(ctx, resourceGroupName, name, webJobName, options) + if err != nil { + return WebAppsRunTriggeredWebJobResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsRunTriggeredWebJobResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsRunTriggeredWebJobResponse{}, client.runTriggeredWebJobHandleError(resp) + } + return WebAppsRunTriggeredWebJobResponse{RawResponse: resp}, nil +} + +// runTriggeredWebJobCreateRequest creates the RunTriggeredWebJob request. +func (client *WebAppsClient) runTriggeredWebJobCreateRequest(ctx context.Context, resourceGroupName string, name string, webJobName string, options *WebAppsRunTriggeredWebJobOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/triggeredwebjobs/{webJobName}/run" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if webJobName == "" { + return nil, errors.New("parameter webJobName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{webJobName}", url.PathEscape(webJobName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// runTriggeredWebJobHandleError handles the RunTriggeredWebJob error response. +func (client *WebAppsClient) runTriggeredWebJobHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + switch resp.StatusCode { + case http.StatusNotFound: + if len(body) == 0 { + return runtime.NewResponseError(errors.New(resp.Status), resp) + } + return runtime.NewResponseError(errors.New(string(body)), resp) + default: + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) + } +} + +// RunTriggeredWebJobSlot - Description for Run a triggered web job for an app, or a deployment slot. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) RunTriggeredWebJobSlot(ctx context.Context, resourceGroupName string, name string, webJobName string, slot string, options *WebAppsRunTriggeredWebJobSlotOptions) (WebAppsRunTriggeredWebJobSlotResponse, error) { + req, err := client.runTriggeredWebJobSlotCreateRequest(ctx, resourceGroupName, name, webJobName, slot, options) + if err != nil { + return WebAppsRunTriggeredWebJobSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsRunTriggeredWebJobSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsRunTriggeredWebJobSlotResponse{}, client.runTriggeredWebJobSlotHandleError(resp) + } + return WebAppsRunTriggeredWebJobSlotResponse{RawResponse: resp}, nil +} + +// runTriggeredWebJobSlotCreateRequest creates the RunTriggeredWebJobSlot request. +func (client *WebAppsClient) runTriggeredWebJobSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, webJobName string, slot string, options *WebAppsRunTriggeredWebJobSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs/{webJobName}/run" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if webJobName == "" { + return nil, errors.New("parameter webJobName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{webJobName}", url.PathEscape(webJobName)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// runTriggeredWebJobSlotHandleError handles the RunTriggeredWebJobSlot error response. +func (client *WebAppsClient) runTriggeredWebJobSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + switch resp.StatusCode { + case http.StatusNotFound: + if len(body) == 0 { + return runtime.NewResponseError(errors.New(resp.Status), resp) + } + return runtime.NewResponseError(errors.New(string(body)), resp) + default: + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) + } +} + +// Start - Description for Starts an app (or deployment slot, if specified). +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) Start(ctx context.Context, resourceGroupName string, name string, options *WebAppsStartOptions) (WebAppsStartResponse, error) { + req, err := client.startCreateRequest(ctx, resourceGroupName, name, options) + if err != nil { + return WebAppsStartResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsStartResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsStartResponse{}, client.startHandleError(resp) + } + return WebAppsStartResponse{RawResponse: resp}, nil +} + +// startCreateRequest creates the Start request. +func (client *WebAppsClient) startCreateRequest(ctx context.Context, resourceGroupName string, name string, options *WebAppsStartOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/start" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// startHandleError handles the Start error response. +func (client *WebAppsClient) startHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// StartContinuousWebJob - Description for Start a continuous web job for an app, or a deployment slot. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) StartContinuousWebJob(ctx context.Context, resourceGroupName string, name string, webJobName string, options *WebAppsStartContinuousWebJobOptions) (WebAppsStartContinuousWebJobResponse, error) { + req, err := client.startContinuousWebJobCreateRequest(ctx, resourceGroupName, name, webJobName, options) + if err != nil { + return WebAppsStartContinuousWebJobResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsStartContinuousWebJobResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsStartContinuousWebJobResponse{}, client.startContinuousWebJobHandleError(resp) + } + return WebAppsStartContinuousWebJobResponse{RawResponse: resp}, nil +} + +// startContinuousWebJobCreateRequest creates the StartContinuousWebJob request. +func (client *WebAppsClient) startContinuousWebJobCreateRequest(ctx context.Context, resourceGroupName string, name string, webJobName string, options *WebAppsStartContinuousWebJobOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/continuouswebjobs/{webJobName}/start" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if webJobName == "" { + return nil, errors.New("parameter webJobName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{webJobName}", url.PathEscape(webJobName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// startContinuousWebJobHandleError handles the StartContinuousWebJob error response. +func (client *WebAppsClient) startContinuousWebJobHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + switch resp.StatusCode { + case http.StatusNotFound: + if len(body) == 0 { + return runtime.NewResponseError(errors.New(resp.Status), resp) + } + return runtime.NewResponseError(errors.New(string(body)), resp) + default: + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) + } +} + +// StartContinuousWebJobSlot - Description for Start a continuous web job for an app, or a deployment slot. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) StartContinuousWebJobSlot(ctx context.Context, resourceGroupName string, name string, webJobName string, slot string, options *WebAppsStartContinuousWebJobSlotOptions) (WebAppsStartContinuousWebJobSlotResponse, error) { + req, err := client.startContinuousWebJobSlotCreateRequest(ctx, resourceGroupName, name, webJobName, slot, options) + if err != nil { + return WebAppsStartContinuousWebJobSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsStartContinuousWebJobSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsStartContinuousWebJobSlotResponse{}, client.startContinuousWebJobSlotHandleError(resp) + } + return WebAppsStartContinuousWebJobSlotResponse{RawResponse: resp}, nil +} + +// startContinuousWebJobSlotCreateRequest creates the StartContinuousWebJobSlot request. +func (client *WebAppsClient) startContinuousWebJobSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, webJobName string, slot string, options *WebAppsStartContinuousWebJobSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/continuouswebjobs/{webJobName}/start" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if webJobName == "" { + return nil, errors.New("parameter webJobName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{webJobName}", url.PathEscape(webJobName)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// startContinuousWebJobSlotHandleError handles the StartContinuousWebJobSlot error response. +func (client *WebAppsClient) startContinuousWebJobSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + switch resp.StatusCode { + case http.StatusNotFound: + if len(body) == 0 { + return runtime.NewResponseError(errors.New(resp.Status), resp) + } + return runtime.NewResponseError(errors.New(string(body)), resp) + default: + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) + } +} + +// BeginStartNetworkTrace - Description for Start capturing network packets for the site. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) BeginStartNetworkTrace(ctx context.Context, resourceGroupName string, name string, options *WebAppsBeginStartNetworkTraceOptions) (WebAppsStartNetworkTracePollerResponse, error) { + resp, err := client.startNetworkTrace(ctx, resourceGroupName, name, options) + if err != nil { + return WebAppsStartNetworkTracePollerResponse{}, err + } + result := WebAppsStartNetworkTracePollerResponse{ + RawResponse: resp, + } + pt, err := armruntime.NewPoller("WebAppsClient.StartNetworkTrace", "", resp, client.pl, client.startNetworkTraceHandleError) + if err != nil { + return WebAppsStartNetworkTracePollerResponse{}, err + } + result.Poller = &WebAppsStartNetworkTracePoller{ + pt: pt, + } + return result, nil +} + +// StartNetworkTrace - Description for Start capturing network packets for the site. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) startNetworkTrace(ctx context.Context, resourceGroupName string, name string, options *WebAppsBeginStartNetworkTraceOptions) (*http.Response, error) { + req, err := client.startNetworkTraceCreateRequest(ctx, resourceGroupName, name, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, client.startNetworkTraceHandleError(resp) + } + return resp, nil +} + +// startNetworkTraceCreateRequest creates the StartNetworkTrace request. +func (client *WebAppsClient) startNetworkTraceCreateRequest(ctx context.Context, resourceGroupName string, name string, options *WebAppsBeginStartNetworkTraceOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/startNetworkTrace" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + if options != nil && options.DurationInSeconds != nil { + reqQP.Set("durationInSeconds", strconv.FormatInt(int64(*options.DurationInSeconds), 10)) + } + if options != nil && options.MaxFrameLength != nil { + reqQP.Set("maxFrameLength", strconv.FormatInt(int64(*options.MaxFrameLength), 10)) + } + if options != nil && options.SasURL != nil { + reqQP.Set("sasUrl", *options.SasURL) + } + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// startNetworkTraceHandleError handles the StartNetworkTrace error response. +func (client *WebAppsClient) startNetworkTraceHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// BeginStartNetworkTraceSlot - Description for Start capturing network packets for the site. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) BeginStartNetworkTraceSlot(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsBeginStartNetworkTraceSlotOptions) (WebAppsStartNetworkTraceSlotPollerResponse, error) { + resp, err := client.startNetworkTraceSlot(ctx, resourceGroupName, name, slot, options) + if err != nil { + return WebAppsStartNetworkTraceSlotPollerResponse{}, err + } + result := WebAppsStartNetworkTraceSlotPollerResponse{ + RawResponse: resp, + } + pt, err := armruntime.NewPoller("WebAppsClient.StartNetworkTraceSlot", "", resp, client.pl, client.startNetworkTraceSlotHandleError) + if err != nil { + return WebAppsStartNetworkTraceSlotPollerResponse{}, err + } + result.Poller = &WebAppsStartNetworkTraceSlotPoller{ + pt: pt, + } + return result, nil +} + +// StartNetworkTraceSlot - Description for Start capturing network packets for the site. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) startNetworkTraceSlot(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsBeginStartNetworkTraceSlotOptions) (*http.Response, error) { + req, err := client.startNetworkTraceSlotCreateRequest(ctx, resourceGroupName, name, slot, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, client.startNetworkTraceSlotHandleError(resp) + } + return resp, nil +} + +// startNetworkTraceSlotCreateRequest creates the StartNetworkTraceSlot request. +func (client *WebAppsClient) startNetworkTraceSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsBeginStartNetworkTraceSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/startNetworkTrace" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + if options != nil && options.DurationInSeconds != nil { + reqQP.Set("durationInSeconds", strconv.FormatInt(int64(*options.DurationInSeconds), 10)) + } + if options != nil && options.MaxFrameLength != nil { + reqQP.Set("maxFrameLength", strconv.FormatInt(int64(*options.MaxFrameLength), 10)) + } + if options != nil && options.SasURL != nil { + reqQP.Set("sasUrl", *options.SasURL) + } + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// startNetworkTraceSlotHandleError handles the StartNetworkTraceSlot error response. +func (client *WebAppsClient) startNetworkTraceSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// StartSlot - Description for Starts an app (or deployment slot, if specified). +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) StartSlot(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsStartSlotOptions) (WebAppsStartSlotResponse, error) { + req, err := client.startSlotCreateRequest(ctx, resourceGroupName, name, slot, options) + if err != nil { + return WebAppsStartSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsStartSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsStartSlotResponse{}, client.startSlotHandleError(resp) + } + return WebAppsStartSlotResponse{RawResponse: resp}, nil +} + +// startSlotCreateRequest creates the StartSlot request. +func (client *WebAppsClient) startSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsStartSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/start" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// startSlotHandleError handles the StartSlot error response. +func (client *WebAppsClient) startSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// StartWebSiteNetworkTrace - Description for Start capturing network packets for the site (To be deprecated). +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) StartWebSiteNetworkTrace(ctx context.Context, resourceGroupName string, name string, options *WebAppsStartWebSiteNetworkTraceOptions) (WebAppsStartWebSiteNetworkTraceResponse, error) { + req, err := client.startWebSiteNetworkTraceCreateRequest(ctx, resourceGroupName, name, options) + if err != nil { + return WebAppsStartWebSiteNetworkTraceResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsStartWebSiteNetworkTraceResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsStartWebSiteNetworkTraceResponse{}, client.startWebSiteNetworkTraceHandleError(resp) + } + return client.startWebSiteNetworkTraceHandleResponse(resp) +} + +// startWebSiteNetworkTraceCreateRequest creates the StartWebSiteNetworkTrace request. +func (client *WebAppsClient) startWebSiteNetworkTraceCreateRequest(ctx context.Context, resourceGroupName string, name string, options *WebAppsStartWebSiteNetworkTraceOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTrace/start" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + if options != nil && options.DurationInSeconds != nil { + reqQP.Set("durationInSeconds", strconv.FormatInt(int64(*options.DurationInSeconds), 10)) + } + if options != nil && options.MaxFrameLength != nil { + reqQP.Set("maxFrameLength", strconv.FormatInt(int64(*options.MaxFrameLength), 10)) + } + if options != nil && options.SasURL != nil { + reqQP.Set("sasUrl", *options.SasURL) + } + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// startWebSiteNetworkTraceHandleResponse handles the StartWebSiteNetworkTrace response. +func (client *WebAppsClient) startWebSiteNetworkTraceHandleResponse(resp *http.Response) (WebAppsStartWebSiteNetworkTraceResponse, error) { + result := WebAppsStartWebSiteNetworkTraceResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.Value); err != nil { + return WebAppsStartWebSiteNetworkTraceResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// startWebSiteNetworkTraceHandleError handles the StartWebSiteNetworkTrace error response. +func (client *WebAppsClient) startWebSiteNetworkTraceHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// BeginStartWebSiteNetworkTraceOperation - Description for Start capturing network packets for the site. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) BeginStartWebSiteNetworkTraceOperation(ctx context.Context, resourceGroupName string, name string, options *WebAppsBeginStartWebSiteNetworkTraceOperationOptions) (WebAppsStartWebSiteNetworkTraceOperationPollerResponse, error) { + resp, err := client.startWebSiteNetworkTraceOperation(ctx, resourceGroupName, name, options) + if err != nil { + return WebAppsStartWebSiteNetworkTraceOperationPollerResponse{}, err + } + result := WebAppsStartWebSiteNetworkTraceOperationPollerResponse{ + RawResponse: resp, + } + pt, err := armruntime.NewPoller("WebAppsClient.StartWebSiteNetworkTraceOperation", "", resp, client.pl, client.startWebSiteNetworkTraceOperationHandleError) + if err != nil { + return WebAppsStartWebSiteNetworkTraceOperationPollerResponse{}, err + } + result.Poller = &WebAppsStartWebSiteNetworkTraceOperationPoller{ + pt: pt, + } + return result, nil +} + +// StartWebSiteNetworkTraceOperation - Description for Start capturing network packets for the site. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) startWebSiteNetworkTraceOperation(ctx context.Context, resourceGroupName string, name string, options *WebAppsBeginStartWebSiteNetworkTraceOperationOptions) (*http.Response, error) { + req, err := client.startWebSiteNetworkTraceOperationCreateRequest(ctx, resourceGroupName, name, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, client.startWebSiteNetworkTraceOperationHandleError(resp) + } + return resp, nil +} + +// startWebSiteNetworkTraceOperationCreateRequest creates the StartWebSiteNetworkTraceOperation request. +func (client *WebAppsClient) startWebSiteNetworkTraceOperationCreateRequest(ctx context.Context, resourceGroupName string, name string, options *WebAppsBeginStartWebSiteNetworkTraceOperationOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTrace/startOperation" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + if options != nil && options.DurationInSeconds != nil { + reqQP.Set("durationInSeconds", strconv.FormatInt(int64(*options.DurationInSeconds), 10)) + } + if options != nil && options.MaxFrameLength != nil { + reqQP.Set("maxFrameLength", strconv.FormatInt(int64(*options.MaxFrameLength), 10)) + } + if options != nil && options.SasURL != nil { + reqQP.Set("sasUrl", *options.SasURL) + } + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// startWebSiteNetworkTraceOperationHandleError handles the StartWebSiteNetworkTraceOperation error response. +func (client *WebAppsClient) startWebSiteNetworkTraceOperationHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// BeginStartWebSiteNetworkTraceOperationSlot - Description for Start capturing network packets for the site. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) BeginStartWebSiteNetworkTraceOperationSlot(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsBeginStartWebSiteNetworkTraceOperationSlotOptions) (WebAppsStartWebSiteNetworkTraceOperationSlotPollerResponse, error) { + resp, err := client.startWebSiteNetworkTraceOperationSlot(ctx, resourceGroupName, name, slot, options) + if err != nil { + return WebAppsStartWebSiteNetworkTraceOperationSlotPollerResponse{}, err + } + result := WebAppsStartWebSiteNetworkTraceOperationSlotPollerResponse{ + RawResponse: resp, + } + pt, err := armruntime.NewPoller("WebAppsClient.StartWebSiteNetworkTraceOperationSlot", "", resp, client.pl, client.startWebSiteNetworkTraceOperationSlotHandleError) + if err != nil { + return WebAppsStartWebSiteNetworkTraceOperationSlotPollerResponse{}, err + } + result.Poller = &WebAppsStartWebSiteNetworkTraceOperationSlotPoller{ + pt: pt, + } + return result, nil +} + +// StartWebSiteNetworkTraceOperationSlot - Description for Start capturing network packets for the site. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) startWebSiteNetworkTraceOperationSlot(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsBeginStartWebSiteNetworkTraceOperationSlotOptions) (*http.Response, error) { + req, err := client.startWebSiteNetworkTraceOperationSlotCreateRequest(ctx, resourceGroupName, name, slot, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, client.startWebSiteNetworkTraceOperationSlotHandleError(resp) + } + return resp, nil +} + +// startWebSiteNetworkTraceOperationSlotCreateRequest creates the StartWebSiteNetworkTraceOperationSlot request. +func (client *WebAppsClient) startWebSiteNetworkTraceOperationSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsBeginStartWebSiteNetworkTraceOperationSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTrace/startOperation" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + if options != nil && options.DurationInSeconds != nil { + reqQP.Set("durationInSeconds", strconv.FormatInt(int64(*options.DurationInSeconds), 10)) + } + if options != nil && options.MaxFrameLength != nil { + reqQP.Set("maxFrameLength", strconv.FormatInt(int64(*options.MaxFrameLength), 10)) + } + if options != nil && options.SasURL != nil { + reqQP.Set("sasUrl", *options.SasURL) + } + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// startWebSiteNetworkTraceOperationSlotHandleError handles the StartWebSiteNetworkTraceOperationSlot error response. +func (client *WebAppsClient) startWebSiteNetworkTraceOperationSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// StartWebSiteNetworkTraceSlot - Description for Start capturing network packets for the site (To be deprecated). +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) StartWebSiteNetworkTraceSlot(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsStartWebSiteNetworkTraceSlotOptions) (WebAppsStartWebSiteNetworkTraceSlotResponse, error) { + req, err := client.startWebSiteNetworkTraceSlotCreateRequest(ctx, resourceGroupName, name, slot, options) + if err != nil { + return WebAppsStartWebSiteNetworkTraceSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsStartWebSiteNetworkTraceSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsStartWebSiteNetworkTraceSlotResponse{}, client.startWebSiteNetworkTraceSlotHandleError(resp) + } + return client.startWebSiteNetworkTraceSlotHandleResponse(resp) +} + +// startWebSiteNetworkTraceSlotCreateRequest creates the StartWebSiteNetworkTraceSlot request. +func (client *WebAppsClient) startWebSiteNetworkTraceSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsStartWebSiteNetworkTraceSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTrace/start" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + if options != nil && options.DurationInSeconds != nil { + reqQP.Set("durationInSeconds", strconv.FormatInt(int64(*options.DurationInSeconds), 10)) + } + if options != nil && options.MaxFrameLength != nil { + reqQP.Set("maxFrameLength", strconv.FormatInt(int64(*options.MaxFrameLength), 10)) + } + if options != nil && options.SasURL != nil { + reqQP.Set("sasUrl", *options.SasURL) + } + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// startWebSiteNetworkTraceSlotHandleResponse handles the StartWebSiteNetworkTraceSlot response. +func (client *WebAppsClient) startWebSiteNetworkTraceSlotHandleResponse(resp *http.Response) (WebAppsStartWebSiteNetworkTraceSlotResponse, error) { + result := WebAppsStartWebSiteNetworkTraceSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.Value); err != nil { + return WebAppsStartWebSiteNetworkTraceSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// startWebSiteNetworkTraceSlotHandleError handles the StartWebSiteNetworkTraceSlot error response. +func (client *WebAppsClient) startWebSiteNetworkTraceSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// Stop - Description for Stops an app (or deployment slot, if specified). +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) Stop(ctx context.Context, resourceGroupName string, name string, options *WebAppsStopOptions) (WebAppsStopResponse, error) { + req, err := client.stopCreateRequest(ctx, resourceGroupName, name, options) + if err != nil { + return WebAppsStopResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsStopResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsStopResponse{}, client.stopHandleError(resp) + } + return WebAppsStopResponse{RawResponse: resp}, nil +} + +// stopCreateRequest creates the Stop request. +func (client *WebAppsClient) stopCreateRequest(ctx context.Context, resourceGroupName string, name string, options *WebAppsStopOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/stop" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// stopHandleError handles the Stop error response. +func (client *WebAppsClient) stopHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// StopContinuousWebJob - Description for Stop a continuous web job for an app, or a deployment slot. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) StopContinuousWebJob(ctx context.Context, resourceGroupName string, name string, webJobName string, options *WebAppsStopContinuousWebJobOptions) (WebAppsStopContinuousWebJobResponse, error) { + req, err := client.stopContinuousWebJobCreateRequest(ctx, resourceGroupName, name, webJobName, options) + if err != nil { + return WebAppsStopContinuousWebJobResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsStopContinuousWebJobResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsStopContinuousWebJobResponse{}, client.stopContinuousWebJobHandleError(resp) + } + return WebAppsStopContinuousWebJobResponse{RawResponse: resp}, nil +} + +// stopContinuousWebJobCreateRequest creates the StopContinuousWebJob request. +func (client *WebAppsClient) stopContinuousWebJobCreateRequest(ctx context.Context, resourceGroupName string, name string, webJobName string, options *WebAppsStopContinuousWebJobOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/continuouswebjobs/{webJobName}/stop" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if webJobName == "" { + return nil, errors.New("parameter webJobName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{webJobName}", url.PathEscape(webJobName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// stopContinuousWebJobHandleError handles the StopContinuousWebJob error response. +func (client *WebAppsClient) stopContinuousWebJobHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + switch resp.StatusCode { + case http.StatusNotFound: + if len(body) == 0 { + return runtime.NewResponseError(errors.New(resp.Status), resp) + } + return runtime.NewResponseError(errors.New(string(body)), resp) + default: + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) + } +} + +// StopContinuousWebJobSlot - Description for Stop a continuous web job for an app, or a deployment slot. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) StopContinuousWebJobSlot(ctx context.Context, resourceGroupName string, name string, webJobName string, slot string, options *WebAppsStopContinuousWebJobSlotOptions) (WebAppsStopContinuousWebJobSlotResponse, error) { + req, err := client.stopContinuousWebJobSlotCreateRequest(ctx, resourceGroupName, name, webJobName, slot, options) + if err != nil { + return WebAppsStopContinuousWebJobSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsStopContinuousWebJobSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsStopContinuousWebJobSlotResponse{}, client.stopContinuousWebJobSlotHandleError(resp) + } + return WebAppsStopContinuousWebJobSlotResponse{RawResponse: resp}, nil +} + +// stopContinuousWebJobSlotCreateRequest creates the StopContinuousWebJobSlot request. +func (client *WebAppsClient) stopContinuousWebJobSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, webJobName string, slot string, options *WebAppsStopContinuousWebJobSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/continuouswebjobs/{webJobName}/stop" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if webJobName == "" { + return nil, errors.New("parameter webJobName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{webJobName}", url.PathEscape(webJobName)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// stopContinuousWebJobSlotHandleError handles the StopContinuousWebJobSlot error response. +func (client *WebAppsClient) stopContinuousWebJobSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + switch resp.StatusCode { + case http.StatusNotFound: + if len(body) == 0 { + return runtime.NewResponseError(errors.New(resp.Status), resp) + } + return runtime.NewResponseError(errors.New(string(body)), resp) + default: + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) + } +} + +// StopNetworkTrace - Description for Stop ongoing capturing network packets for the site. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) StopNetworkTrace(ctx context.Context, resourceGroupName string, name string, options *WebAppsStopNetworkTraceOptions) (WebAppsStopNetworkTraceResponse, error) { + req, err := client.stopNetworkTraceCreateRequest(ctx, resourceGroupName, name, options) + if err != nil { + return WebAppsStopNetworkTraceResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsStopNetworkTraceResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { + return WebAppsStopNetworkTraceResponse{}, client.stopNetworkTraceHandleError(resp) + } + return WebAppsStopNetworkTraceResponse{RawResponse: resp}, nil +} + +// stopNetworkTraceCreateRequest creates the StopNetworkTrace request. +func (client *WebAppsClient) stopNetworkTraceCreateRequest(ctx context.Context, resourceGroupName string, name string, options *WebAppsStopNetworkTraceOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/stopNetworkTrace" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// stopNetworkTraceHandleError handles the StopNetworkTrace error response. +func (client *WebAppsClient) stopNetworkTraceHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// StopNetworkTraceSlot - Description for Stop ongoing capturing network packets for the site. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) StopNetworkTraceSlot(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsStopNetworkTraceSlotOptions) (WebAppsStopNetworkTraceSlotResponse, error) { + req, err := client.stopNetworkTraceSlotCreateRequest(ctx, resourceGroupName, name, slot, options) + if err != nil { + return WebAppsStopNetworkTraceSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsStopNetworkTraceSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { + return WebAppsStopNetworkTraceSlotResponse{}, client.stopNetworkTraceSlotHandleError(resp) + } + return WebAppsStopNetworkTraceSlotResponse{RawResponse: resp}, nil +} + +// stopNetworkTraceSlotCreateRequest creates the StopNetworkTraceSlot request. +func (client *WebAppsClient) stopNetworkTraceSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsStopNetworkTraceSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/stopNetworkTrace" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// stopNetworkTraceSlotHandleError handles the StopNetworkTraceSlot error response. +func (client *WebAppsClient) stopNetworkTraceSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// StopSlot - Description for Stops an app (or deployment slot, if specified). +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) StopSlot(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsStopSlotOptions) (WebAppsStopSlotResponse, error) { + req, err := client.stopSlotCreateRequest(ctx, resourceGroupName, name, slot, options) + if err != nil { + return WebAppsStopSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsStopSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsStopSlotResponse{}, client.stopSlotHandleError(resp) + } + return WebAppsStopSlotResponse{RawResponse: resp}, nil +} + +// stopSlotCreateRequest creates the StopSlot request. +func (client *WebAppsClient) stopSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsStopSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/stop" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// stopSlotHandleError handles the StopSlot error response. +func (client *WebAppsClient) stopSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// StopWebSiteNetworkTrace - Description for Stop ongoing capturing network packets for the site. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) StopWebSiteNetworkTrace(ctx context.Context, resourceGroupName string, name string, options *WebAppsStopWebSiteNetworkTraceOptions) (WebAppsStopWebSiteNetworkTraceResponse, error) { + req, err := client.stopWebSiteNetworkTraceCreateRequest(ctx, resourceGroupName, name, options) + if err != nil { + return WebAppsStopWebSiteNetworkTraceResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsStopWebSiteNetworkTraceResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { + return WebAppsStopWebSiteNetworkTraceResponse{}, client.stopWebSiteNetworkTraceHandleError(resp) + } + return WebAppsStopWebSiteNetworkTraceResponse{RawResponse: resp}, nil +} + +// stopWebSiteNetworkTraceCreateRequest creates the StopWebSiteNetworkTrace request. +func (client *WebAppsClient) stopWebSiteNetworkTraceCreateRequest(ctx context.Context, resourceGroupName string, name string, options *WebAppsStopWebSiteNetworkTraceOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTrace/stop" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// stopWebSiteNetworkTraceHandleError handles the StopWebSiteNetworkTrace error response. +func (client *WebAppsClient) stopWebSiteNetworkTraceHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// StopWebSiteNetworkTraceSlot - Description for Stop ongoing capturing network packets for the site. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) StopWebSiteNetworkTraceSlot(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsStopWebSiteNetworkTraceSlotOptions) (WebAppsStopWebSiteNetworkTraceSlotResponse, error) { + req, err := client.stopWebSiteNetworkTraceSlotCreateRequest(ctx, resourceGroupName, name, slot, options) + if err != nil { + return WebAppsStopWebSiteNetworkTraceSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsStopWebSiteNetworkTraceSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { + return WebAppsStopWebSiteNetworkTraceSlotResponse{}, client.stopWebSiteNetworkTraceSlotHandleError(resp) + } + return WebAppsStopWebSiteNetworkTraceSlotResponse{RawResponse: resp}, nil +} + +// stopWebSiteNetworkTraceSlotCreateRequest creates the StopWebSiteNetworkTraceSlot request. +func (client *WebAppsClient) stopWebSiteNetworkTraceSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsStopWebSiteNetworkTraceSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTrace/stop" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// stopWebSiteNetworkTraceSlotHandleError handles the StopWebSiteNetworkTraceSlot error response. +func (client *WebAppsClient) stopWebSiteNetworkTraceSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// BeginSwapSlot - Description for Swaps two deployment slots of an app. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) BeginSwapSlot(ctx context.Context, resourceGroupName string, name string, slot string, slotSwapEntity CsmSlotEntity, options *WebAppsBeginSwapSlotOptions) (WebAppsSwapSlotPollerResponse, error) { + resp, err := client.swapSlot(ctx, resourceGroupName, name, slot, slotSwapEntity, options) + if err != nil { + return WebAppsSwapSlotPollerResponse{}, err + } + result := WebAppsSwapSlotPollerResponse{ + RawResponse: resp, + } + pt, err := armruntime.NewPoller("WebAppsClient.SwapSlot", "", resp, client.pl, client.swapSlotHandleError) + if err != nil { + return WebAppsSwapSlotPollerResponse{}, err + } + result.Poller = &WebAppsSwapSlotPoller{ + pt: pt, + } + return result, nil +} + +// SwapSlot - Description for Swaps two deployment slots of an app. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) swapSlot(ctx context.Context, resourceGroupName string, name string, slot string, slotSwapEntity CsmSlotEntity, options *WebAppsBeginSwapSlotOptions) (*http.Response, error) { + req, err := client.swapSlotCreateRequest(ctx, resourceGroupName, name, slot, slotSwapEntity, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, client.swapSlotHandleError(resp) + } + return resp, nil +} + +// swapSlotCreateRequest creates the SwapSlot request. +func (client *WebAppsClient) swapSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, slot string, slotSwapEntity CsmSlotEntity, options *WebAppsBeginSwapSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/slotsswap" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, slotSwapEntity) +} + +// swapSlotHandleError handles the SwapSlot error response. +func (client *WebAppsClient) swapSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// BeginSwapSlotWithProduction - Description for Swaps two deployment slots of an app. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) BeginSwapSlotWithProduction(ctx context.Context, resourceGroupName string, name string, slotSwapEntity CsmSlotEntity, options *WebAppsBeginSwapSlotWithProductionOptions) (WebAppsSwapSlotWithProductionPollerResponse, error) { + resp, err := client.swapSlotWithProduction(ctx, resourceGroupName, name, slotSwapEntity, options) + if err != nil { + return WebAppsSwapSlotWithProductionPollerResponse{}, err + } + result := WebAppsSwapSlotWithProductionPollerResponse{ + RawResponse: resp, + } + pt, err := armruntime.NewPoller("WebAppsClient.SwapSlotWithProduction", "", resp, client.pl, client.swapSlotWithProductionHandleError) + if err != nil { + return WebAppsSwapSlotWithProductionPollerResponse{}, err + } + result.Poller = &WebAppsSwapSlotWithProductionPoller{ + pt: pt, + } + return result, nil +} + +// SwapSlotWithProduction - Description for Swaps two deployment slots of an app. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) swapSlotWithProduction(ctx context.Context, resourceGroupName string, name string, slotSwapEntity CsmSlotEntity, options *WebAppsBeginSwapSlotWithProductionOptions) (*http.Response, error) { + req, err := client.swapSlotWithProductionCreateRequest(ctx, resourceGroupName, name, slotSwapEntity, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, client.swapSlotWithProductionHandleError(resp) + } + return resp, nil +} + +// swapSlotWithProductionCreateRequest creates the SwapSlotWithProduction request. +func (client *WebAppsClient) swapSlotWithProductionCreateRequest(ctx context.Context, resourceGroupName string, name string, slotSwapEntity CsmSlotEntity, options *WebAppsBeginSwapSlotWithProductionOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slotsswap" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, slotSwapEntity) +} + +// swapSlotWithProductionHandleError handles the SwapSlotWithProduction error response. +func (client *WebAppsClient) swapSlotWithProductionHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// SyncFunctionTriggers - Description for Syncs function trigger metadata to the management database +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) SyncFunctionTriggers(ctx context.Context, resourceGroupName string, name string, options *WebAppsSyncFunctionTriggersOptions) (WebAppsSyncFunctionTriggersResponse, error) { + req, err := client.syncFunctionTriggersCreateRequest(ctx, resourceGroupName, name, options) + if err != nil { + return WebAppsSyncFunctionTriggersResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsSyncFunctionTriggersResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusNoContent) { + return WebAppsSyncFunctionTriggersResponse{}, client.syncFunctionTriggersHandleError(resp) + } + return WebAppsSyncFunctionTriggersResponse{RawResponse: resp}, nil +} + +// syncFunctionTriggersCreateRequest creates the SyncFunctionTriggers request. +func (client *WebAppsClient) syncFunctionTriggersCreateRequest(ctx context.Context, resourceGroupName string, name string, options *WebAppsSyncFunctionTriggersOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/syncfunctiontriggers" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// syncFunctionTriggersHandleError handles the SyncFunctionTriggers error response. +func (client *WebAppsClient) syncFunctionTriggersHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// SyncFunctionTriggersSlot - Description for Syncs function trigger metadata to the management database +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) SyncFunctionTriggersSlot(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsSyncFunctionTriggersSlotOptions) (WebAppsSyncFunctionTriggersSlotResponse, error) { + req, err := client.syncFunctionTriggersSlotCreateRequest(ctx, resourceGroupName, name, slot, options) + if err != nil { + return WebAppsSyncFunctionTriggersSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsSyncFunctionTriggersSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusNoContent) { + return WebAppsSyncFunctionTriggersSlotResponse{}, client.syncFunctionTriggersSlotHandleError(resp) + } + return WebAppsSyncFunctionTriggersSlotResponse{RawResponse: resp}, nil +} + +// syncFunctionTriggersSlotCreateRequest creates the SyncFunctionTriggersSlot request. +func (client *WebAppsClient) syncFunctionTriggersSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsSyncFunctionTriggersSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/syncfunctiontriggers" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// syncFunctionTriggersSlotHandleError handles the SyncFunctionTriggersSlot error response. +func (client *WebAppsClient) syncFunctionTriggersSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// SyncFunctions - Description for Syncs function trigger metadata to the management database +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) SyncFunctions(ctx context.Context, resourceGroupName string, name string, options *WebAppsSyncFunctionsOptions) (WebAppsSyncFunctionsResponse, error) { + req, err := client.syncFunctionsCreateRequest(ctx, resourceGroupName, name, options) + if err != nil { + return WebAppsSyncFunctionsResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsSyncFunctionsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusNoContent) { + return WebAppsSyncFunctionsResponse{}, client.syncFunctionsHandleError(resp) + } + return WebAppsSyncFunctionsResponse{RawResponse: resp}, nil +} + +// syncFunctionsCreateRequest creates the SyncFunctions request. +func (client *WebAppsClient) syncFunctionsCreateRequest(ctx context.Context, resourceGroupName string, name string, options *WebAppsSyncFunctionsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/host/default/sync" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// syncFunctionsHandleError handles the SyncFunctions error response. +func (client *WebAppsClient) syncFunctionsHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// SyncFunctionsSlot - Description for Syncs function trigger metadata to the management database +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) SyncFunctionsSlot(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsSyncFunctionsSlotOptions) (WebAppsSyncFunctionsSlotResponse, error) { + req, err := client.syncFunctionsSlotCreateRequest(ctx, resourceGroupName, name, slot, options) + if err != nil { + return WebAppsSyncFunctionsSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsSyncFunctionsSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusNoContent) { + return WebAppsSyncFunctionsSlotResponse{}, client.syncFunctionsSlotHandleError(resp) + } + return WebAppsSyncFunctionsSlotResponse{RawResponse: resp}, nil +} + +// syncFunctionsSlotCreateRequest creates the SyncFunctionsSlot request. +func (client *WebAppsClient) syncFunctionsSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsSyncFunctionsSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/host/default/sync" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// syncFunctionsSlotHandleError handles the SyncFunctionsSlot error response. +func (client *WebAppsClient) syncFunctionsSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// SyncRepository - Description for Sync web app repository. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) SyncRepository(ctx context.Context, resourceGroupName string, name string, options *WebAppsSyncRepositoryOptions) (WebAppsSyncRepositoryResponse, error) { + req, err := client.syncRepositoryCreateRequest(ctx, resourceGroupName, name, options) + if err != nil { + return WebAppsSyncRepositoryResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsSyncRepositoryResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsSyncRepositoryResponse{}, client.syncRepositoryHandleError(resp) + } + return WebAppsSyncRepositoryResponse{RawResponse: resp}, nil +} + +// syncRepositoryCreateRequest creates the SyncRepository request. +func (client *WebAppsClient) syncRepositoryCreateRequest(ctx context.Context, resourceGroupName string, name string, options *WebAppsSyncRepositoryOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/sync" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// syncRepositoryHandleError handles the SyncRepository error response. +func (client *WebAppsClient) syncRepositoryHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// SyncRepositorySlot - Description for Sync web app repository. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) SyncRepositorySlot(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsSyncRepositorySlotOptions) (WebAppsSyncRepositorySlotResponse, error) { + req, err := client.syncRepositorySlotCreateRequest(ctx, resourceGroupName, name, slot, options) + if err != nil { + return WebAppsSyncRepositorySlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsSyncRepositorySlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsSyncRepositorySlotResponse{}, client.syncRepositorySlotHandleError(resp) + } + return WebAppsSyncRepositorySlotResponse{RawResponse: resp}, nil +} + +// syncRepositorySlotCreateRequest creates the SyncRepositorySlot request. +func (client *WebAppsClient) syncRepositorySlotCreateRequest(ctx context.Context, resourceGroupName string, name string, slot string, options *WebAppsSyncRepositorySlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/sync" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// syncRepositorySlotHandleError handles the SyncRepositorySlot error response. +func (client *WebAppsClient) syncRepositorySlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// Update - Description for Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) Update(ctx context.Context, resourceGroupName string, name string, siteEnvelope SitePatchResource, options *WebAppsUpdateOptions) (WebAppsUpdateResponse, error) { + req, err := client.updateCreateRequest(ctx, resourceGroupName, name, siteEnvelope, options) + if err != nil { + return WebAppsUpdateResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsUpdateResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return WebAppsUpdateResponse{}, client.updateHandleError(resp) + } + return client.updateHandleResponse(resp) +} + +// updateCreateRequest creates the Update request. +func (client *WebAppsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, name string, siteEnvelope SitePatchResource, options *WebAppsUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, siteEnvelope) +} + +// updateHandleResponse handles the Update response. +func (client *WebAppsClient) updateHandleResponse(resp *http.Response) (WebAppsUpdateResponse, error) { + result := WebAppsUpdateResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.Site); err != nil { + return WebAppsUpdateResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// updateHandleError handles the Update error response. +func (client *WebAppsClient) updateHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// UpdateApplicationSettings - Description for Replaces the application settings of an app. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) UpdateApplicationSettings(ctx context.Context, resourceGroupName string, name string, appSettings StringDictionary, options *WebAppsUpdateApplicationSettingsOptions) (WebAppsUpdateApplicationSettingsResponse, error) { + req, err := client.updateApplicationSettingsCreateRequest(ctx, resourceGroupName, name, appSettings, options) + if err != nil { + return WebAppsUpdateApplicationSettingsResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsUpdateApplicationSettingsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsUpdateApplicationSettingsResponse{}, client.updateApplicationSettingsHandleError(resp) + } + return client.updateApplicationSettingsHandleResponse(resp) +} + +// updateApplicationSettingsCreateRequest creates the UpdateApplicationSettings request. +func (client *WebAppsClient) updateApplicationSettingsCreateRequest(ctx context.Context, resourceGroupName string, name string, appSettings StringDictionary, options *WebAppsUpdateApplicationSettingsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/appsettings" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, appSettings) +} + +// updateApplicationSettingsHandleResponse handles the UpdateApplicationSettings response. +func (client *WebAppsClient) updateApplicationSettingsHandleResponse(resp *http.Response) (WebAppsUpdateApplicationSettingsResponse, error) { + result := WebAppsUpdateApplicationSettingsResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.StringDictionary); err != nil { + return WebAppsUpdateApplicationSettingsResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// updateApplicationSettingsHandleError handles the UpdateApplicationSettings error response. +func (client *WebAppsClient) updateApplicationSettingsHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// UpdateApplicationSettingsSlot - Description for Replaces the application settings of an app. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) UpdateApplicationSettingsSlot(ctx context.Context, resourceGroupName string, name string, slot string, appSettings StringDictionary, options *WebAppsUpdateApplicationSettingsSlotOptions) (WebAppsUpdateApplicationSettingsSlotResponse, error) { + req, err := client.updateApplicationSettingsSlotCreateRequest(ctx, resourceGroupName, name, slot, appSettings, options) + if err != nil { + return WebAppsUpdateApplicationSettingsSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsUpdateApplicationSettingsSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsUpdateApplicationSettingsSlotResponse{}, client.updateApplicationSettingsSlotHandleError(resp) + } + return client.updateApplicationSettingsSlotHandleResponse(resp) +} + +// updateApplicationSettingsSlotCreateRequest creates the UpdateApplicationSettingsSlot request. +func (client *WebAppsClient) updateApplicationSettingsSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, slot string, appSettings StringDictionary, options *WebAppsUpdateApplicationSettingsSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/appsettings" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, appSettings) +} + +// updateApplicationSettingsSlotHandleResponse handles the UpdateApplicationSettingsSlot response. +func (client *WebAppsClient) updateApplicationSettingsSlotHandleResponse(resp *http.Response) (WebAppsUpdateApplicationSettingsSlotResponse, error) { + result := WebAppsUpdateApplicationSettingsSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.StringDictionary); err != nil { + return WebAppsUpdateApplicationSettingsSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// updateApplicationSettingsSlotHandleError handles the UpdateApplicationSettingsSlot error response. +func (client *WebAppsClient) updateApplicationSettingsSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// UpdateAuthSettings - Description for Updates the Authentication / Authorization settings associated with web app. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) UpdateAuthSettings(ctx context.Context, resourceGroupName string, name string, siteAuthSettings SiteAuthSettings, options *WebAppsUpdateAuthSettingsOptions) (WebAppsUpdateAuthSettingsResponse, error) { + req, err := client.updateAuthSettingsCreateRequest(ctx, resourceGroupName, name, siteAuthSettings, options) + if err != nil { + return WebAppsUpdateAuthSettingsResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsUpdateAuthSettingsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsUpdateAuthSettingsResponse{}, client.updateAuthSettingsHandleError(resp) + } + return client.updateAuthSettingsHandleResponse(resp) +} + +// updateAuthSettingsCreateRequest creates the UpdateAuthSettings request. +func (client *WebAppsClient) updateAuthSettingsCreateRequest(ctx context.Context, resourceGroupName string, name string, siteAuthSettings SiteAuthSettings, options *WebAppsUpdateAuthSettingsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/authsettings" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, siteAuthSettings) +} + +// updateAuthSettingsHandleResponse handles the UpdateAuthSettings response. +func (client *WebAppsClient) updateAuthSettingsHandleResponse(resp *http.Response) (WebAppsUpdateAuthSettingsResponse, error) { + result := WebAppsUpdateAuthSettingsResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.SiteAuthSettings); err != nil { + return WebAppsUpdateAuthSettingsResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// updateAuthSettingsHandleError handles the UpdateAuthSettings error response. +func (client *WebAppsClient) updateAuthSettingsHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// UpdateAuthSettingsSlot - Description for Updates the Authentication / Authorization settings associated with web app. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) UpdateAuthSettingsSlot(ctx context.Context, resourceGroupName string, name string, slot string, siteAuthSettings SiteAuthSettings, options *WebAppsUpdateAuthSettingsSlotOptions) (WebAppsUpdateAuthSettingsSlotResponse, error) { + req, err := client.updateAuthSettingsSlotCreateRequest(ctx, resourceGroupName, name, slot, siteAuthSettings, options) + if err != nil { + return WebAppsUpdateAuthSettingsSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsUpdateAuthSettingsSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsUpdateAuthSettingsSlotResponse{}, client.updateAuthSettingsSlotHandleError(resp) + } + return client.updateAuthSettingsSlotHandleResponse(resp) +} + +// updateAuthSettingsSlotCreateRequest creates the UpdateAuthSettingsSlot request. +func (client *WebAppsClient) updateAuthSettingsSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, slot string, siteAuthSettings SiteAuthSettings, options *WebAppsUpdateAuthSettingsSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/authsettings" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, siteAuthSettings) +} + +// updateAuthSettingsSlotHandleResponse handles the UpdateAuthSettingsSlot response. +func (client *WebAppsClient) updateAuthSettingsSlotHandleResponse(resp *http.Response) (WebAppsUpdateAuthSettingsSlotResponse, error) { + result := WebAppsUpdateAuthSettingsSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.SiteAuthSettings); err != nil { + return WebAppsUpdateAuthSettingsSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// updateAuthSettingsSlotHandleError handles the UpdateAuthSettingsSlot error response. +func (client *WebAppsClient) updateAuthSettingsSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// UpdateAuthSettingsV2 - Description for Updates site's Authentication / Authorization settings for apps via the V2 format +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) UpdateAuthSettingsV2(ctx context.Context, resourceGroupName string, name string, siteAuthSettingsV2 SiteAuthSettingsV2, options *WebAppsUpdateAuthSettingsV2Options) (WebAppsUpdateAuthSettingsV2Response, error) { + req, err := client.updateAuthSettingsV2CreateRequest(ctx, resourceGroupName, name, siteAuthSettingsV2, options) + if err != nil { + return WebAppsUpdateAuthSettingsV2Response{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsUpdateAuthSettingsV2Response{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsUpdateAuthSettingsV2Response{}, client.updateAuthSettingsV2HandleError(resp) + } + return client.updateAuthSettingsV2HandleResponse(resp) +} + +// updateAuthSettingsV2CreateRequest creates the UpdateAuthSettingsV2 request. +func (client *WebAppsClient) updateAuthSettingsV2CreateRequest(ctx context.Context, resourceGroupName string, name string, siteAuthSettingsV2 SiteAuthSettingsV2, options *WebAppsUpdateAuthSettingsV2Options) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/authsettingsV2" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, siteAuthSettingsV2) +} + +// updateAuthSettingsV2HandleResponse handles the UpdateAuthSettingsV2 response. +func (client *WebAppsClient) updateAuthSettingsV2HandleResponse(resp *http.Response) (WebAppsUpdateAuthSettingsV2Response, error) { + result := WebAppsUpdateAuthSettingsV2Response{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.SiteAuthSettingsV2); err != nil { + return WebAppsUpdateAuthSettingsV2Response{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// updateAuthSettingsV2HandleError handles the UpdateAuthSettingsV2 error response. +func (client *WebAppsClient) updateAuthSettingsV2HandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// UpdateAuthSettingsV2Slot - Description for Updates site's Authentication / Authorization settings for apps via the V2 format +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) UpdateAuthSettingsV2Slot(ctx context.Context, resourceGroupName string, name string, slot string, siteAuthSettingsV2 SiteAuthSettingsV2, options *WebAppsUpdateAuthSettingsV2SlotOptions) (WebAppsUpdateAuthSettingsV2SlotResponse, error) { + req, err := client.updateAuthSettingsV2SlotCreateRequest(ctx, resourceGroupName, name, slot, siteAuthSettingsV2, options) + if err != nil { + return WebAppsUpdateAuthSettingsV2SlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsUpdateAuthSettingsV2SlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsUpdateAuthSettingsV2SlotResponse{}, client.updateAuthSettingsV2SlotHandleError(resp) + } + return client.updateAuthSettingsV2SlotHandleResponse(resp) +} + +// updateAuthSettingsV2SlotCreateRequest creates the UpdateAuthSettingsV2Slot request. +func (client *WebAppsClient) updateAuthSettingsV2SlotCreateRequest(ctx context.Context, resourceGroupName string, name string, slot string, siteAuthSettingsV2 SiteAuthSettingsV2, options *WebAppsUpdateAuthSettingsV2SlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/authsettingsV2" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, siteAuthSettingsV2) +} + +// updateAuthSettingsV2SlotHandleResponse handles the UpdateAuthSettingsV2Slot response. +func (client *WebAppsClient) updateAuthSettingsV2SlotHandleResponse(resp *http.Response) (WebAppsUpdateAuthSettingsV2SlotResponse, error) { + result := WebAppsUpdateAuthSettingsV2SlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.SiteAuthSettingsV2); err != nil { + return WebAppsUpdateAuthSettingsV2SlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// updateAuthSettingsV2SlotHandleError handles the UpdateAuthSettingsV2Slot error response. +func (client *WebAppsClient) updateAuthSettingsV2SlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// UpdateAzureStorageAccounts - Description for Updates the Azure storage account configurations of an app. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) UpdateAzureStorageAccounts(ctx context.Context, resourceGroupName string, name string, azureStorageAccounts AzureStoragePropertyDictionaryResource, options *WebAppsUpdateAzureStorageAccountsOptions) (WebAppsUpdateAzureStorageAccountsResponse, error) { + req, err := client.updateAzureStorageAccountsCreateRequest(ctx, resourceGroupName, name, azureStorageAccounts, options) + if err != nil { + return WebAppsUpdateAzureStorageAccountsResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsUpdateAzureStorageAccountsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsUpdateAzureStorageAccountsResponse{}, client.updateAzureStorageAccountsHandleError(resp) + } + return client.updateAzureStorageAccountsHandleResponse(resp) +} + +// updateAzureStorageAccountsCreateRequest creates the UpdateAzureStorageAccounts request. +func (client *WebAppsClient) updateAzureStorageAccountsCreateRequest(ctx context.Context, resourceGroupName string, name string, azureStorageAccounts AzureStoragePropertyDictionaryResource, options *WebAppsUpdateAzureStorageAccountsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/azurestorageaccounts" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, azureStorageAccounts) +} + +// updateAzureStorageAccountsHandleResponse handles the UpdateAzureStorageAccounts response. +func (client *WebAppsClient) updateAzureStorageAccountsHandleResponse(resp *http.Response) (WebAppsUpdateAzureStorageAccountsResponse, error) { + result := WebAppsUpdateAzureStorageAccountsResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.AzureStoragePropertyDictionaryResource); err != nil { + return WebAppsUpdateAzureStorageAccountsResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// updateAzureStorageAccountsHandleError handles the UpdateAzureStorageAccounts error response. +func (client *WebAppsClient) updateAzureStorageAccountsHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// UpdateAzureStorageAccountsSlot - Description for Updates the Azure storage account configurations of an app. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) UpdateAzureStorageAccountsSlot(ctx context.Context, resourceGroupName string, name string, slot string, azureStorageAccounts AzureStoragePropertyDictionaryResource, options *WebAppsUpdateAzureStorageAccountsSlotOptions) (WebAppsUpdateAzureStorageAccountsSlotResponse, error) { + req, err := client.updateAzureStorageAccountsSlotCreateRequest(ctx, resourceGroupName, name, slot, azureStorageAccounts, options) + if err != nil { + return WebAppsUpdateAzureStorageAccountsSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsUpdateAzureStorageAccountsSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsUpdateAzureStorageAccountsSlotResponse{}, client.updateAzureStorageAccountsSlotHandleError(resp) + } + return client.updateAzureStorageAccountsSlotHandleResponse(resp) +} + +// updateAzureStorageAccountsSlotCreateRequest creates the UpdateAzureStorageAccountsSlot request. +func (client *WebAppsClient) updateAzureStorageAccountsSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, slot string, azureStorageAccounts AzureStoragePropertyDictionaryResource, options *WebAppsUpdateAzureStorageAccountsSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/azurestorageaccounts" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, azureStorageAccounts) +} + +// updateAzureStorageAccountsSlotHandleResponse handles the UpdateAzureStorageAccountsSlot response. +func (client *WebAppsClient) updateAzureStorageAccountsSlotHandleResponse(resp *http.Response) (WebAppsUpdateAzureStorageAccountsSlotResponse, error) { + result := WebAppsUpdateAzureStorageAccountsSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.AzureStoragePropertyDictionaryResource); err != nil { + return WebAppsUpdateAzureStorageAccountsSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// updateAzureStorageAccountsSlotHandleError handles the UpdateAzureStorageAccountsSlot error response. +func (client *WebAppsClient) updateAzureStorageAccountsSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// UpdateBackupConfiguration - Description for Updates the backup configuration of an app. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) UpdateBackupConfiguration(ctx context.Context, resourceGroupName string, name string, request BackupRequest, options *WebAppsUpdateBackupConfigurationOptions) (WebAppsUpdateBackupConfigurationResponse, error) { + req, err := client.updateBackupConfigurationCreateRequest(ctx, resourceGroupName, name, request, options) + if err != nil { + return WebAppsUpdateBackupConfigurationResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsUpdateBackupConfigurationResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsUpdateBackupConfigurationResponse{}, client.updateBackupConfigurationHandleError(resp) + } + return client.updateBackupConfigurationHandleResponse(resp) +} + +// updateBackupConfigurationCreateRequest creates the UpdateBackupConfiguration request. +func (client *WebAppsClient) updateBackupConfigurationCreateRequest(ctx context.Context, resourceGroupName string, name string, request BackupRequest, options *WebAppsUpdateBackupConfigurationOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/backup" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, request) +} + +// updateBackupConfigurationHandleResponse handles the UpdateBackupConfiguration response. +func (client *WebAppsClient) updateBackupConfigurationHandleResponse(resp *http.Response) (WebAppsUpdateBackupConfigurationResponse, error) { + result := WebAppsUpdateBackupConfigurationResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.BackupRequest); err != nil { + return WebAppsUpdateBackupConfigurationResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// updateBackupConfigurationHandleError handles the UpdateBackupConfiguration error response. +func (client *WebAppsClient) updateBackupConfigurationHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// UpdateBackupConfigurationSlot - Description for Updates the backup configuration of an app. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) UpdateBackupConfigurationSlot(ctx context.Context, resourceGroupName string, name string, slot string, request BackupRequest, options *WebAppsUpdateBackupConfigurationSlotOptions) (WebAppsUpdateBackupConfigurationSlotResponse, error) { + req, err := client.updateBackupConfigurationSlotCreateRequest(ctx, resourceGroupName, name, slot, request, options) + if err != nil { + return WebAppsUpdateBackupConfigurationSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsUpdateBackupConfigurationSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsUpdateBackupConfigurationSlotResponse{}, client.updateBackupConfigurationSlotHandleError(resp) + } + return client.updateBackupConfigurationSlotHandleResponse(resp) +} + +// updateBackupConfigurationSlotCreateRequest creates the UpdateBackupConfigurationSlot request. +func (client *WebAppsClient) updateBackupConfigurationSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, slot string, request BackupRequest, options *WebAppsUpdateBackupConfigurationSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/backup" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, request) +} + +// updateBackupConfigurationSlotHandleResponse handles the UpdateBackupConfigurationSlot response. +func (client *WebAppsClient) updateBackupConfigurationSlotHandleResponse(resp *http.Response) (WebAppsUpdateBackupConfigurationSlotResponse, error) { + result := WebAppsUpdateBackupConfigurationSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.BackupRequest); err != nil { + return WebAppsUpdateBackupConfigurationSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// updateBackupConfigurationSlotHandleError handles the UpdateBackupConfigurationSlot error response. +func (client *WebAppsClient) updateBackupConfigurationSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// UpdateConfiguration - Description for Updates the configuration of an app. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) UpdateConfiguration(ctx context.Context, resourceGroupName string, name string, siteConfig SiteConfigResource, options *WebAppsUpdateConfigurationOptions) (WebAppsUpdateConfigurationResponse, error) { + req, err := client.updateConfigurationCreateRequest(ctx, resourceGroupName, name, siteConfig, options) + if err != nil { + return WebAppsUpdateConfigurationResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsUpdateConfigurationResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsUpdateConfigurationResponse{}, client.updateConfigurationHandleError(resp) + } + return client.updateConfigurationHandleResponse(resp) +} + +// updateConfigurationCreateRequest creates the UpdateConfiguration request. +func (client *WebAppsClient) updateConfigurationCreateRequest(ctx context.Context, resourceGroupName string, name string, siteConfig SiteConfigResource, options *WebAppsUpdateConfigurationOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, siteConfig) +} + +// updateConfigurationHandleResponse handles the UpdateConfiguration response. +func (client *WebAppsClient) updateConfigurationHandleResponse(resp *http.Response) (WebAppsUpdateConfigurationResponse, error) { + result := WebAppsUpdateConfigurationResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.SiteConfigResource); err != nil { + return WebAppsUpdateConfigurationResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// updateConfigurationHandleError handles the UpdateConfiguration error response. +func (client *WebAppsClient) updateConfigurationHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// UpdateConfigurationSlot - Description for Updates the configuration of an app. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) UpdateConfigurationSlot(ctx context.Context, resourceGroupName string, name string, slot string, siteConfig SiteConfigResource, options *WebAppsUpdateConfigurationSlotOptions) (WebAppsUpdateConfigurationSlotResponse, error) { + req, err := client.updateConfigurationSlotCreateRequest(ctx, resourceGroupName, name, slot, siteConfig, options) + if err != nil { + return WebAppsUpdateConfigurationSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsUpdateConfigurationSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsUpdateConfigurationSlotResponse{}, client.updateConfigurationSlotHandleError(resp) + } + return client.updateConfigurationSlotHandleResponse(resp) +} + +// updateConfigurationSlotCreateRequest creates the UpdateConfigurationSlot request. +func (client *WebAppsClient) updateConfigurationSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, slot string, siteConfig SiteConfigResource, options *WebAppsUpdateConfigurationSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, siteConfig) +} + +// updateConfigurationSlotHandleResponse handles the UpdateConfigurationSlot response. +func (client *WebAppsClient) updateConfigurationSlotHandleResponse(resp *http.Response) (WebAppsUpdateConfigurationSlotResponse, error) { + result := WebAppsUpdateConfigurationSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.SiteConfigResource); err != nil { + return WebAppsUpdateConfigurationSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// updateConfigurationSlotHandleError handles the UpdateConfigurationSlot error response. +func (client *WebAppsClient) updateConfigurationSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// UpdateConnectionStrings - Description for Replaces the connection strings of an app. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) UpdateConnectionStrings(ctx context.Context, resourceGroupName string, name string, connectionStrings ConnectionStringDictionary, options *WebAppsUpdateConnectionStringsOptions) (WebAppsUpdateConnectionStringsResponse, error) { + req, err := client.updateConnectionStringsCreateRequest(ctx, resourceGroupName, name, connectionStrings, options) + if err != nil { + return WebAppsUpdateConnectionStringsResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsUpdateConnectionStringsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsUpdateConnectionStringsResponse{}, client.updateConnectionStringsHandleError(resp) + } + return client.updateConnectionStringsHandleResponse(resp) +} + +// updateConnectionStringsCreateRequest creates the UpdateConnectionStrings request. +func (client *WebAppsClient) updateConnectionStringsCreateRequest(ctx context.Context, resourceGroupName string, name string, connectionStrings ConnectionStringDictionary, options *WebAppsUpdateConnectionStringsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/connectionstrings" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, connectionStrings) +} + +// updateConnectionStringsHandleResponse handles the UpdateConnectionStrings response. +func (client *WebAppsClient) updateConnectionStringsHandleResponse(resp *http.Response) (WebAppsUpdateConnectionStringsResponse, error) { + result := WebAppsUpdateConnectionStringsResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.ConnectionStringDictionary); err != nil { + return WebAppsUpdateConnectionStringsResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// updateConnectionStringsHandleError handles the UpdateConnectionStrings error response. +func (client *WebAppsClient) updateConnectionStringsHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// UpdateConnectionStringsSlot - Description for Replaces the connection strings of an app. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) UpdateConnectionStringsSlot(ctx context.Context, resourceGroupName string, name string, slot string, connectionStrings ConnectionStringDictionary, options *WebAppsUpdateConnectionStringsSlotOptions) (WebAppsUpdateConnectionStringsSlotResponse, error) { + req, err := client.updateConnectionStringsSlotCreateRequest(ctx, resourceGroupName, name, slot, connectionStrings, options) + if err != nil { + return WebAppsUpdateConnectionStringsSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsUpdateConnectionStringsSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsUpdateConnectionStringsSlotResponse{}, client.updateConnectionStringsSlotHandleError(resp) + } + return client.updateConnectionStringsSlotHandleResponse(resp) +} + +// updateConnectionStringsSlotCreateRequest creates the UpdateConnectionStringsSlot request. +func (client *WebAppsClient) updateConnectionStringsSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, slot string, connectionStrings ConnectionStringDictionary, options *WebAppsUpdateConnectionStringsSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/connectionstrings" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, connectionStrings) +} + +// updateConnectionStringsSlotHandleResponse handles the UpdateConnectionStringsSlot response. +func (client *WebAppsClient) updateConnectionStringsSlotHandleResponse(resp *http.Response) (WebAppsUpdateConnectionStringsSlotResponse, error) { + result := WebAppsUpdateConnectionStringsSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.ConnectionStringDictionary); err != nil { + return WebAppsUpdateConnectionStringsSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// updateConnectionStringsSlotHandleError handles the UpdateConnectionStringsSlot error response. +func (client *WebAppsClient) updateConnectionStringsSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// UpdateDiagnosticLogsConfig - Description for Updates the logging configuration of an app. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) UpdateDiagnosticLogsConfig(ctx context.Context, resourceGroupName string, name string, siteLogsConfig SiteLogsConfig, options *WebAppsUpdateDiagnosticLogsConfigOptions) (WebAppsUpdateDiagnosticLogsConfigResponse, error) { + req, err := client.updateDiagnosticLogsConfigCreateRequest(ctx, resourceGroupName, name, siteLogsConfig, options) + if err != nil { + return WebAppsUpdateDiagnosticLogsConfigResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsUpdateDiagnosticLogsConfigResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsUpdateDiagnosticLogsConfigResponse{}, client.updateDiagnosticLogsConfigHandleError(resp) + } + return client.updateDiagnosticLogsConfigHandleResponse(resp) +} + +// updateDiagnosticLogsConfigCreateRequest creates the UpdateDiagnosticLogsConfig request. +func (client *WebAppsClient) updateDiagnosticLogsConfigCreateRequest(ctx context.Context, resourceGroupName string, name string, siteLogsConfig SiteLogsConfig, options *WebAppsUpdateDiagnosticLogsConfigOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/logs" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, siteLogsConfig) +} + +// updateDiagnosticLogsConfigHandleResponse handles the UpdateDiagnosticLogsConfig response. +func (client *WebAppsClient) updateDiagnosticLogsConfigHandleResponse(resp *http.Response) (WebAppsUpdateDiagnosticLogsConfigResponse, error) { + result := WebAppsUpdateDiagnosticLogsConfigResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.SiteLogsConfig); err != nil { + return WebAppsUpdateDiagnosticLogsConfigResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// updateDiagnosticLogsConfigHandleError handles the UpdateDiagnosticLogsConfig error response. +func (client *WebAppsClient) updateDiagnosticLogsConfigHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// UpdateDiagnosticLogsConfigSlot - Description for Updates the logging configuration of an app. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) UpdateDiagnosticLogsConfigSlot(ctx context.Context, resourceGroupName string, name string, slot string, siteLogsConfig SiteLogsConfig, options *WebAppsUpdateDiagnosticLogsConfigSlotOptions) (WebAppsUpdateDiagnosticLogsConfigSlotResponse, error) { + req, err := client.updateDiagnosticLogsConfigSlotCreateRequest(ctx, resourceGroupName, name, slot, siteLogsConfig, options) + if err != nil { + return WebAppsUpdateDiagnosticLogsConfigSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsUpdateDiagnosticLogsConfigSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsUpdateDiagnosticLogsConfigSlotResponse{}, client.updateDiagnosticLogsConfigSlotHandleError(resp) + } + return client.updateDiagnosticLogsConfigSlotHandleResponse(resp) +} + +// updateDiagnosticLogsConfigSlotCreateRequest creates the UpdateDiagnosticLogsConfigSlot request. +func (client *WebAppsClient) updateDiagnosticLogsConfigSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, slot string, siteLogsConfig SiteLogsConfig, options *WebAppsUpdateDiagnosticLogsConfigSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/logs" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, siteLogsConfig) +} + +// updateDiagnosticLogsConfigSlotHandleResponse handles the UpdateDiagnosticLogsConfigSlot response. +func (client *WebAppsClient) updateDiagnosticLogsConfigSlotHandleResponse(resp *http.Response) (WebAppsUpdateDiagnosticLogsConfigSlotResponse, error) { + result := WebAppsUpdateDiagnosticLogsConfigSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.SiteLogsConfig); err != nil { + return WebAppsUpdateDiagnosticLogsConfigSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// updateDiagnosticLogsConfigSlotHandleError handles the UpdateDiagnosticLogsConfigSlot error response. +func (client *WebAppsClient) updateDiagnosticLogsConfigSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// UpdateDomainOwnershipIdentifier - Description for Creates a domain ownership identifier for web app, or updates an existing ownership identifier. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) UpdateDomainOwnershipIdentifier(ctx context.Context, resourceGroupName string, name string, domainOwnershipIdentifierName string, domainOwnershipIdentifier Identifier, options *WebAppsUpdateDomainOwnershipIdentifierOptions) (WebAppsUpdateDomainOwnershipIdentifierResponse, error) { + req, err := client.updateDomainOwnershipIdentifierCreateRequest(ctx, resourceGroupName, name, domainOwnershipIdentifierName, domainOwnershipIdentifier, options) + if err != nil { + return WebAppsUpdateDomainOwnershipIdentifierResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsUpdateDomainOwnershipIdentifierResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsUpdateDomainOwnershipIdentifierResponse{}, client.updateDomainOwnershipIdentifierHandleError(resp) + } + return client.updateDomainOwnershipIdentifierHandleResponse(resp) +} + +// updateDomainOwnershipIdentifierCreateRequest creates the UpdateDomainOwnershipIdentifier request. +func (client *WebAppsClient) updateDomainOwnershipIdentifierCreateRequest(ctx context.Context, resourceGroupName string, name string, domainOwnershipIdentifierName string, domainOwnershipIdentifier Identifier, options *WebAppsUpdateDomainOwnershipIdentifierOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if domainOwnershipIdentifierName == "" { + return nil, errors.New("parameter domainOwnershipIdentifierName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{domainOwnershipIdentifierName}", url.PathEscape(domainOwnershipIdentifierName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, domainOwnershipIdentifier) +} + +// updateDomainOwnershipIdentifierHandleResponse handles the UpdateDomainOwnershipIdentifier response. +func (client *WebAppsClient) updateDomainOwnershipIdentifierHandleResponse(resp *http.Response) (WebAppsUpdateDomainOwnershipIdentifierResponse, error) { + result := WebAppsUpdateDomainOwnershipIdentifierResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.Identifier); err != nil { + return WebAppsUpdateDomainOwnershipIdentifierResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// updateDomainOwnershipIdentifierHandleError handles the UpdateDomainOwnershipIdentifier error response. +func (client *WebAppsClient) updateDomainOwnershipIdentifierHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// UpdateDomainOwnershipIdentifierSlot - Description for Creates a domain ownership identifier for web app, or updates an existing ownership identifier. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) UpdateDomainOwnershipIdentifierSlot(ctx context.Context, resourceGroupName string, name string, domainOwnershipIdentifierName string, slot string, domainOwnershipIdentifier Identifier, options *WebAppsUpdateDomainOwnershipIdentifierSlotOptions) (WebAppsUpdateDomainOwnershipIdentifierSlotResponse, error) { + req, err := client.updateDomainOwnershipIdentifierSlotCreateRequest(ctx, resourceGroupName, name, domainOwnershipIdentifierName, slot, domainOwnershipIdentifier, options) + if err != nil { + return WebAppsUpdateDomainOwnershipIdentifierSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsUpdateDomainOwnershipIdentifierSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsUpdateDomainOwnershipIdentifierSlotResponse{}, client.updateDomainOwnershipIdentifierSlotHandleError(resp) + } + return client.updateDomainOwnershipIdentifierSlotHandleResponse(resp) +} + +// updateDomainOwnershipIdentifierSlotCreateRequest creates the UpdateDomainOwnershipIdentifierSlot request. +func (client *WebAppsClient) updateDomainOwnershipIdentifierSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, domainOwnershipIdentifierName string, slot string, domainOwnershipIdentifier Identifier, options *WebAppsUpdateDomainOwnershipIdentifierSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if domainOwnershipIdentifierName == "" { + return nil, errors.New("parameter domainOwnershipIdentifierName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{domainOwnershipIdentifierName}", url.PathEscape(domainOwnershipIdentifierName)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, domainOwnershipIdentifier) +} + +// updateDomainOwnershipIdentifierSlotHandleResponse handles the UpdateDomainOwnershipIdentifierSlot response. +func (client *WebAppsClient) updateDomainOwnershipIdentifierSlotHandleResponse(resp *http.Response) (WebAppsUpdateDomainOwnershipIdentifierSlotResponse, error) { + result := WebAppsUpdateDomainOwnershipIdentifierSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.Identifier); err != nil { + return WebAppsUpdateDomainOwnershipIdentifierSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// updateDomainOwnershipIdentifierSlotHandleError handles the UpdateDomainOwnershipIdentifierSlot error response. +func (client *WebAppsClient) updateDomainOwnershipIdentifierSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// UpdateFtpAllowed - Description for Updates whether FTP is allowed on the site or not. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) UpdateFtpAllowed(ctx context.Context, resourceGroupName string, name string, csmPublishingAccessPoliciesEntity CsmPublishingCredentialsPoliciesEntity, options *WebAppsUpdateFtpAllowedOptions) (WebAppsUpdateFtpAllowedResponse, error) { + req, err := client.updateFtpAllowedCreateRequest(ctx, resourceGroupName, name, csmPublishingAccessPoliciesEntity, options) + if err != nil { + return WebAppsUpdateFtpAllowedResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsUpdateFtpAllowedResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsUpdateFtpAllowedResponse{}, client.updateFtpAllowedHandleError(resp) + } + return client.updateFtpAllowedHandleResponse(resp) +} + +// updateFtpAllowedCreateRequest creates the UpdateFtpAllowed request. +func (client *WebAppsClient) updateFtpAllowedCreateRequest(ctx context.Context, resourceGroupName string, name string, csmPublishingAccessPoliciesEntity CsmPublishingCredentialsPoliciesEntity, options *WebAppsUpdateFtpAllowedOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/basicPublishingCredentialsPolicies/ftp" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, csmPublishingAccessPoliciesEntity) +} + +// updateFtpAllowedHandleResponse handles the UpdateFtpAllowed response. +func (client *WebAppsClient) updateFtpAllowedHandleResponse(resp *http.Response) (WebAppsUpdateFtpAllowedResponse, error) { + result := WebAppsUpdateFtpAllowedResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.CsmPublishingCredentialsPoliciesEntity); err != nil { + return WebAppsUpdateFtpAllowedResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// updateFtpAllowedHandleError handles the UpdateFtpAllowed error response. +func (client *WebAppsClient) updateFtpAllowedHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// UpdateFtpAllowedSlot - Description for Updates whether FTP is allowed on the site or not. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) UpdateFtpAllowedSlot(ctx context.Context, resourceGroupName string, name string, slot string, csmPublishingAccessPoliciesEntity CsmPublishingCredentialsPoliciesEntity, options *WebAppsUpdateFtpAllowedSlotOptions) (WebAppsUpdateFtpAllowedSlotResponse, error) { + req, err := client.updateFtpAllowedSlotCreateRequest(ctx, resourceGroupName, name, slot, csmPublishingAccessPoliciesEntity, options) + if err != nil { + return WebAppsUpdateFtpAllowedSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsUpdateFtpAllowedSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsUpdateFtpAllowedSlotResponse{}, client.updateFtpAllowedSlotHandleError(resp) + } + return client.updateFtpAllowedSlotHandleResponse(resp) +} + +// updateFtpAllowedSlotCreateRequest creates the UpdateFtpAllowedSlot request. +func (client *WebAppsClient) updateFtpAllowedSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, slot string, csmPublishingAccessPoliciesEntity CsmPublishingCredentialsPoliciesEntity, options *WebAppsUpdateFtpAllowedSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/basicPublishingCredentialsPolicies/ftp" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, csmPublishingAccessPoliciesEntity) +} + +// updateFtpAllowedSlotHandleResponse handles the UpdateFtpAllowedSlot response. +func (client *WebAppsClient) updateFtpAllowedSlotHandleResponse(resp *http.Response) (WebAppsUpdateFtpAllowedSlotResponse, error) { + result := WebAppsUpdateFtpAllowedSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.CsmPublishingCredentialsPoliciesEntity); err != nil { + return WebAppsUpdateFtpAllowedSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// updateFtpAllowedSlotHandleError handles the UpdateFtpAllowedSlot error response. +func (client *WebAppsClient) updateFtpAllowedSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// UpdateHybridConnection - Description for Creates a new Hybrid Connection using a Service Bus relay. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) UpdateHybridConnection(ctx context.Context, resourceGroupName string, name string, namespaceName string, relayName string, connectionEnvelope HybridConnection, options *WebAppsUpdateHybridConnectionOptions) (WebAppsUpdateHybridConnectionResponse, error) { + req, err := client.updateHybridConnectionCreateRequest(ctx, resourceGroupName, name, namespaceName, relayName, connectionEnvelope, options) + if err != nil { + return WebAppsUpdateHybridConnectionResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsUpdateHybridConnectionResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsUpdateHybridConnectionResponse{}, client.updateHybridConnectionHandleError(resp) + } + return client.updateHybridConnectionHandleResponse(resp) +} + +// updateHybridConnectionCreateRequest creates the UpdateHybridConnection request. +func (client *WebAppsClient) updateHybridConnectionCreateRequest(ctx context.Context, resourceGroupName string, name string, namespaceName string, relayName string, connectionEnvelope HybridConnection, options *WebAppsUpdateHybridConnectionOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if namespaceName == "" { + return nil, errors.New("parameter namespaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{namespaceName}", url.PathEscape(namespaceName)) + if relayName == "" { + return nil, errors.New("parameter relayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{relayName}", url.PathEscape(relayName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, connectionEnvelope) +} + +// updateHybridConnectionHandleResponse handles the UpdateHybridConnection response. +func (client *WebAppsClient) updateHybridConnectionHandleResponse(resp *http.Response) (WebAppsUpdateHybridConnectionResponse, error) { + result := WebAppsUpdateHybridConnectionResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.HybridConnection); err != nil { + return WebAppsUpdateHybridConnectionResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// updateHybridConnectionHandleError handles the UpdateHybridConnection error response. +func (client *WebAppsClient) updateHybridConnectionHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// UpdateHybridConnectionSlot - Description for Creates a new Hybrid Connection using a Service Bus relay. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) UpdateHybridConnectionSlot(ctx context.Context, resourceGroupName string, name string, namespaceName string, relayName string, slot string, connectionEnvelope HybridConnection, options *WebAppsUpdateHybridConnectionSlotOptions) (WebAppsUpdateHybridConnectionSlotResponse, error) { + req, err := client.updateHybridConnectionSlotCreateRequest(ctx, resourceGroupName, name, namespaceName, relayName, slot, connectionEnvelope, options) + if err != nil { + return WebAppsUpdateHybridConnectionSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsUpdateHybridConnectionSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsUpdateHybridConnectionSlotResponse{}, client.updateHybridConnectionSlotHandleError(resp) + } + return client.updateHybridConnectionSlotHandleResponse(resp) +} + +// updateHybridConnectionSlotCreateRequest creates the UpdateHybridConnectionSlot request. +func (client *WebAppsClient) updateHybridConnectionSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, namespaceName string, relayName string, slot string, connectionEnvelope HybridConnection, options *WebAppsUpdateHybridConnectionSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if namespaceName == "" { + return nil, errors.New("parameter namespaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{namespaceName}", url.PathEscape(namespaceName)) + if relayName == "" { + return nil, errors.New("parameter relayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{relayName}", url.PathEscape(relayName)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, connectionEnvelope) +} + +// updateHybridConnectionSlotHandleResponse handles the UpdateHybridConnectionSlot response. +func (client *WebAppsClient) updateHybridConnectionSlotHandleResponse(resp *http.Response) (WebAppsUpdateHybridConnectionSlotResponse, error) { + result := WebAppsUpdateHybridConnectionSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.HybridConnection); err != nil { + return WebAppsUpdateHybridConnectionSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// updateHybridConnectionSlotHandleError handles the UpdateHybridConnectionSlot error response. +func (client *WebAppsClient) updateHybridConnectionSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// UpdateMetadata - Description for Replaces the metadata of an app. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) UpdateMetadata(ctx context.Context, resourceGroupName string, name string, metadata StringDictionary, options *WebAppsUpdateMetadataOptions) (WebAppsUpdateMetadataResponse, error) { + req, err := client.updateMetadataCreateRequest(ctx, resourceGroupName, name, metadata, options) + if err != nil { + return WebAppsUpdateMetadataResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsUpdateMetadataResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsUpdateMetadataResponse{}, client.updateMetadataHandleError(resp) + } + return client.updateMetadataHandleResponse(resp) +} + +// updateMetadataCreateRequest creates the UpdateMetadata request. +func (client *WebAppsClient) updateMetadataCreateRequest(ctx context.Context, resourceGroupName string, name string, metadata StringDictionary, options *WebAppsUpdateMetadataOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/metadata" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, metadata) +} + +// updateMetadataHandleResponse handles the UpdateMetadata response. +func (client *WebAppsClient) updateMetadataHandleResponse(resp *http.Response) (WebAppsUpdateMetadataResponse, error) { + result := WebAppsUpdateMetadataResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.StringDictionary); err != nil { + return WebAppsUpdateMetadataResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// updateMetadataHandleError handles the UpdateMetadata error response. +func (client *WebAppsClient) updateMetadataHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// UpdateMetadataSlot - Description for Replaces the metadata of an app. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) UpdateMetadataSlot(ctx context.Context, resourceGroupName string, name string, slot string, metadata StringDictionary, options *WebAppsUpdateMetadataSlotOptions) (WebAppsUpdateMetadataSlotResponse, error) { + req, err := client.updateMetadataSlotCreateRequest(ctx, resourceGroupName, name, slot, metadata, options) + if err != nil { + return WebAppsUpdateMetadataSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsUpdateMetadataSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsUpdateMetadataSlotResponse{}, client.updateMetadataSlotHandleError(resp) + } + return client.updateMetadataSlotHandleResponse(resp) +} + +// updateMetadataSlotCreateRequest creates the UpdateMetadataSlot request. +func (client *WebAppsClient) updateMetadataSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, slot string, metadata StringDictionary, options *WebAppsUpdateMetadataSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/metadata" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, metadata) +} + +// updateMetadataSlotHandleResponse handles the UpdateMetadataSlot response. +func (client *WebAppsClient) updateMetadataSlotHandleResponse(resp *http.Response) (WebAppsUpdateMetadataSlotResponse, error) { + result := WebAppsUpdateMetadataSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.StringDictionary); err != nil { + return WebAppsUpdateMetadataSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// updateMetadataSlotHandleError handles the UpdateMetadataSlot error response. +func (client *WebAppsClient) updateMetadataSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// UpdatePremierAddOn - Description for Updates a named add-on of an app. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) UpdatePremierAddOn(ctx context.Context, resourceGroupName string, name string, premierAddOnName string, premierAddOn PremierAddOnPatchResource, options *WebAppsUpdatePremierAddOnOptions) (WebAppsUpdatePremierAddOnResponse, error) { + req, err := client.updatePremierAddOnCreateRequest(ctx, resourceGroupName, name, premierAddOnName, premierAddOn, options) + if err != nil { + return WebAppsUpdatePremierAddOnResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsUpdatePremierAddOnResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsUpdatePremierAddOnResponse{}, client.updatePremierAddOnHandleError(resp) + } + return client.updatePremierAddOnHandleResponse(resp) +} + +// updatePremierAddOnCreateRequest creates the UpdatePremierAddOn request. +func (client *WebAppsClient) updatePremierAddOnCreateRequest(ctx context.Context, resourceGroupName string, name string, premierAddOnName string, premierAddOn PremierAddOnPatchResource, options *WebAppsUpdatePremierAddOnOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/premieraddons/{premierAddOnName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if premierAddOnName == "" { + return nil, errors.New("parameter premierAddOnName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{premierAddOnName}", url.PathEscape(premierAddOnName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, premierAddOn) +} + +// updatePremierAddOnHandleResponse handles the UpdatePremierAddOn response. +func (client *WebAppsClient) updatePremierAddOnHandleResponse(resp *http.Response) (WebAppsUpdatePremierAddOnResponse, error) { + result := WebAppsUpdatePremierAddOnResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.PremierAddOn); err != nil { + return WebAppsUpdatePremierAddOnResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// updatePremierAddOnHandleError handles the UpdatePremierAddOn error response. +func (client *WebAppsClient) updatePremierAddOnHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// UpdatePremierAddOnSlot - Description for Updates a named add-on of an app. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) UpdatePremierAddOnSlot(ctx context.Context, resourceGroupName string, name string, premierAddOnName string, slot string, premierAddOn PremierAddOnPatchResource, options *WebAppsUpdatePremierAddOnSlotOptions) (WebAppsUpdatePremierAddOnSlotResponse, error) { + req, err := client.updatePremierAddOnSlotCreateRequest(ctx, resourceGroupName, name, premierAddOnName, slot, premierAddOn, options) + if err != nil { + return WebAppsUpdatePremierAddOnSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsUpdatePremierAddOnSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsUpdatePremierAddOnSlotResponse{}, client.updatePremierAddOnSlotHandleError(resp) + } + return client.updatePremierAddOnSlotHandleResponse(resp) +} + +// updatePremierAddOnSlotCreateRequest creates the UpdatePremierAddOnSlot request. +func (client *WebAppsClient) updatePremierAddOnSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, premierAddOnName string, slot string, premierAddOn PremierAddOnPatchResource, options *WebAppsUpdatePremierAddOnSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/premieraddons/{premierAddOnName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if premierAddOnName == "" { + return nil, errors.New("parameter premierAddOnName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{premierAddOnName}", url.PathEscape(premierAddOnName)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, premierAddOn) +} + +// updatePremierAddOnSlotHandleResponse handles the UpdatePremierAddOnSlot response. +func (client *WebAppsClient) updatePremierAddOnSlotHandleResponse(resp *http.Response) (WebAppsUpdatePremierAddOnSlotResponse, error) { + result := WebAppsUpdatePremierAddOnSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.PremierAddOn); err != nil { + return WebAppsUpdatePremierAddOnSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// updatePremierAddOnSlotHandleError handles the UpdatePremierAddOnSlot error response. +func (client *WebAppsClient) updatePremierAddOnSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// UpdateRelayServiceConnection - Description for Creates a new hybrid connection configuration (PUT), or updates an existing one (PATCH). +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) UpdateRelayServiceConnection(ctx context.Context, resourceGroupName string, name string, entityName string, connectionEnvelope RelayServiceConnectionEntity, options *WebAppsUpdateRelayServiceConnectionOptions) (WebAppsUpdateRelayServiceConnectionResponse, error) { + req, err := client.updateRelayServiceConnectionCreateRequest(ctx, resourceGroupName, name, entityName, connectionEnvelope, options) + if err != nil { + return WebAppsUpdateRelayServiceConnectionResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsUpdateRelayServiceConnectionResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsUpdateRelayServiceConnectionResponse{}, client.updateRelayServiceConnectionHandleError(resp) + } + return client.updateRelayServiceConnectionHandleResponse(resp) +} + +// updateRelayServiceConnectionCreateRequest creates the UpdateRelayServiceConnection request. +func (client *WebAppsClient) updateRelayServiceConnectionCreateRequest(ctx context.Context, resourceGroupName string, name string, entityName string, connectionEnvelope RelayServiceConnectionEntity, options *WebAppsUpdateRelayServiceConnectionOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection/{entityName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if entityName == "" { + return nil, errors.New("parameter entityName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{entityName}", url.PathEscape(entityName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, connectionEnvelope) +} + +// updateRelayServiceConnectionHandleResponse handles the UpdateRelayServiceConnection response. +func (client *WebAppsClient) updateRelayServiceConnectionHandleResponse(resp *http.Response) (WebAppsUpdateRelayServiceConnectionResponse, error) { + result := WebAppsUpdateRelayServiceConnectionResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.RelayServiceConnectionEntity); err != nil { + return WebAppsUpdateRelayServiceConnectionResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// updateRelayServiceConnectionHandleError handles the UpdateRelayServiceConnection error response. +func (client *WebAppsClient) updateRelayServiceConnectionHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// UpdateRelayServiceConnectionSlot - Description for Creates a new hybrid connection configuration (PUT), or updates an existing one (PATCH). +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) UpdateRelayServiceConnectionSlot(ctx context.Context, resourceGroupName string, name string, entityName string, slot string, connectionEnvelope RelayServiceConnectionEntity, options *WebAppsUpdateRelayServiceConnectionSlotOptions) (WebAppsUpdateRelayServiceConnectionSlotResponse, error) { + req, err := client.updateRelayServiceConnectionSlotCreateRequest(ctx, resourceGroupName, name, entityName, slot, connectionEnvelope, options) + if err != nil { + return WebAppsUpdateRelayServiceConnectionSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsUpdateRelayServiceConnectionSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsUpdateRelayServiceConnectionSlotResponse{}, client.updateRelayServiceConnectionSlotHandleError(resp) + } + return client.updateRelayServiceConnectionSlotHandleResponse(resp) +} + +// updateRelayServiceConnectionSlotCreateRequest creates the UpdateRelayServiceConnectionSlot request. +func (client *WebAppsClient) updateRelayServiceConnectionSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, entityName string, slot string, connectionEnvelope RelayServiceConnectionEntity, options *WebAppsUpdateRelayServiceConnectionSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridconnection/{entityName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if entityName == "" { + return nil, errors.New("parameter entityName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{entityName}", url.PathEscape(entityName)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, connectionEnvelope) +} + +// updateRelayServiceConnectionSlotHandleResponse handles the UpdateRelayServiceConnectionSlot response. +func (client *WebAppsClient) updateRelayServiceConnectionSlotHandleResponse(resp *http.Response) (WebAppsUpdateRelayServiceConnectionSlotResponse, error) { + result := WebAppsUpdateRelayServiceConnectionSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.RelayServiceConnectionEntity); err != nil { + return WebAppsUpdateRelayServiceConnectionSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// updateRelayServiceConnectionSlotHandleError handles the UpdateRelayServiceConnectionSlot error response. +func (client *WebAppsClient) updateRelayServiceConnectionSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// UpdateScmAllowed - Description for Updates whether user publishing credentials are allowed on the site or not. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) UpdateScmAllowed(ctx context.Context, resourceGroupName string, name string, csmPublishingAccessPoliciesEntity CsmPublishingCredentialsPoliciesEntity, options *WebAppsUpdateScmAllowedOptions) (WebAppsUpdateScmAllowedResponse, error) { + req, err := client.updateScmAllowedCreateRequest(ctx, resourceGroupName, name, csmPublishingAccessPoliciesEntity, options) + if err != nil { + return WebAppsUpdateScmAllowedResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsUpdateScmAllowedResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsUpdateScmAllowedResponse{}, client.updateScmAllowedHandleError(resp) + } + return client.updateScmAllowedHandleResponse(resp) +} + +// updateScmAllowedCreateRequest creates the UpdateScmAllowed request. +func (client *WebAppsClient) updateScmAllowedCreateRequest(ctx context.Context, resourceGroupName string, name string, csmPublishingAccessPoliciesEntity CsmPublishingCredentialsPoliciesEntity, options *WebAppsUpdateScmAllowedOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/basicPublishingCredentialsPolicies/scm" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, csmPublishingAccessPoliciesEntity) +} + +// updateScmAllowedHandleResponse handles the UpdateScmAllowed response. +func (client *WebAppsClient) updateScmAllowedHandleResponse(resp *http.Response) (WebAppsUpdateScmAllowedResponse, error) { + result := WebAppsUpdateScmAllowedResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.CsmPublishingCredentialsPoliciesEntity); err != nil { + return WebAppsUpdateScmAllowedResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// updateScmAllowedHandleError handles the UpdateScmAllowed error response. +func (client *WebAppsClient) updateScmAllowedHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// UpdateScmAllowedSlot - Description for Updates whether user publishing credentials are allowed on the site or not. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) UpdateScmAllowedSlot(ctx context.Context, resourceGroupName string, name string, slot string, csmPublishingAccessPoliciesEntity CsmPublishingCredentialsPoliciesEntity, options *WebAppsUpdateScmAllowedSlotOptions) (WebAppsUpdateScmAllowedSlotResponse, error) { + req, err := client.updateScmAllowedSlotCreateRequest(ctx, resourceGroupName, name, slot, csmPublishingAccessPoliciesEntity, options) + if err != nil { + return WebAppsUpdateScmAllowedSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsUpdateScmAllowedSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsUpdateScmAllowedSlotResponse{}, client.updateScmAllowedSlotHandleError(resp) + } + return client.updateScmAllowedSlotHandleResponse(resp) +} + +// updateScmAllowedSlotCreateRequest creates the UpdateScmAllowedSlot request. +func (client *WebAppsClient) updateScmAllowedSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, slot string, csmPublishingAccessPoliciesEntity CsmPublishingCredentialsPoliciesEntity, options *WebAppsUpdateScmAllowedSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/basicPublishingCredentialsPolicies/scm" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, csmPublishingAccessPoliciesEntity) +} + +// updateScmAllowedSlotHandleResponse handles the UpdateScmAllowedSlot response. +func (client *WebAppsClient) updateScmAllowedSlotHandleResponse(resp *http.Response) (WebAppsUpdateScmAllowedSlotResponse, error) { + result := WebAppsUpdateScmAllowedSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.CsmPublishingCredentialsPoliciesEntity); err != nil { + return WebAppsUpdateScmAllowedSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// updateScmAllowedSlotHandleError handles the UpdateScmAllowedSlot error response. +func (client *WebAppsClient) updateScmAllowedSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// UpdateSitePushSettings - Description for Updates the Push settings associated with web app. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) UpdateSitePushSettings(ctx context.Context, resourceGroupName string, name string, pushSettings PushSettings, options *WebAppsUpdateSitePushSettingsOptions) (WebAppsUpdateSitePushSettingsResponse, error) { + req, err := client.updateSitePushSettingsCreateRequest(ctx, resourceGroupName, name, pushSettings, options) + if err != nil { + return WebAppsUpdateSitePushSettingsResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsUpdateSitePushSettingsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsUpdateSitePushSettingsResponse{}, client.updateSitePushSettingsHandleError(resp) + } + return client.updateSitePushSettingsHandleResponse(resp) +} + +// updateSitePushSettingsCreateRequest creates the UpdateSitePushSettings request. +func (client *WebAppsClient) updateSitePushSettingsCreateRequest(ctx context.Context, resourceGroupName string, name string, pushSettings PushSettings, options *WebAppsUpdateSitePushSettingsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/pushsettings" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, pushSettings) +} + +// updateSitePushSettingsHandleResponse handles the UpdateSitePushSettings response. +func (client *WebAppsClient) updateSitePushSettingsHandleResponse(resp *http.Response) (WebAppsUpdateSitePushSettingsResponse, error) { + result := WebAppsUpdateSitePushSettingsResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.PushSettings); err != nil { + return WebAppsUpdateSitePushSettingsResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// updateSitePushSettingsHandleError handles the UpdateSitePushSettings error response. +func (client *WebAppsClient) updateSitePushSettingsHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// UpdateSitePushSettingsSlot - Description for Updates the Push settings associated with web app. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) UpdateSitePushSettingsSlot(ctx context.Context, resourceGroupName string, name string, slot string, pushSettings PushSettings, options *WebAppsUpdateSitePushSettingsSlotOptions) (WebAppsUpdateSitePushSettingsSlotResponse, error) { + req, err := client.updateSitePushSettingsSlotCreateRequest(ctx, resourceGroupName, name, slot, pushSettings, options) + if err != nil { + return WebAppsUpdateSitePushSettingsSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsUpdateSitePushSettingsSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsUpdateSitePushSettingsSlotResponse{}, client.updateSitePushSettingsSlotHandleError(resp) + } + return client.updateSitePushSettingsSlotHandleResponse(resp) +} + +// updateSitePushSettingsSlotCreateRequest creates the UpdateSitePushSettingsSlot request. +func (client *WebAppsClient) updateSitePushSettingsSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, slot string, pushSettings PushSettings, options *WebAppsUpdateSitePushSettingsSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/pushsettings" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, pushSettings) +} + +// updateSitePushSettingsSlotHandleResponse handles the UpdateSitePushSettingsSlot response. +func (client *WebAppsClient) updateSitePushSettingsSlotHandleResponse(resp *http.Response) (WebAppsUpdateSitePushSettingsSlotResponse, error) { + result := WebAppsUpdateSitePushSettingsSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.PushSettings); err != nil { + return WebAppsUpdateSitePushSettingsSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// updateSitePushSettingsSlotHandleError handles the UpdateSitePushSettingsSlot error response. +func (client *WebAppsClient) updateSitePushSettingsSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// UpdateSlot - Description for Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) UpdateSlot(ctx context.Context, resourceGroupName string, name string, slot string, siteEnvelope SitePatchResource, options *WebAppsUpdateSlotOptions) (WebAppsUpdateSlotResponse, error) { + req, err := client.updateSlotCreateRequest(ctx, resourceGroupName, name, slot, siteEnvelope, options) + if err != nil { + return WebAppsUpdateSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsUpdateSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return WebAppsUpdateSlotResponse{}, client.updateSlotHandleError(resp) + } + return client.updateSlotHandleResponse(resp) +} + +// updateSlotCreateRequest creates the UpdateSlot request. +func (client *WebAppsClient) updateSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, slot string, siteEnvelope SitePatchResource, options *WebAppsUpdateSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, siteEnvelope) +} + +// updateSlotHandleResponse handles the UpdateSlot response. +func (client *WebAppsClient) updateSlotHandleResponse(resp *http.Response) (WebAppsUpdateSlotResponse, error) { + result := WebAppsUpdateSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.Site); err != nil { + return WebAppsUpdateSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// updateSlotHandleError handles the UpdateSlot error response. +func (client *WebAppsClient) updateSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// UpdateSlotConfigurationNames - Description for Updates the names of application settings and connection string that remain with the slot during swap +// operation. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) UpdateSlotConfigurationNames(ctx context.Context, resourceGroupName string, name string, slotConfigNames SlotConfigNamesResource, options *WebAppsUpdateSlotConfigurationNamesOptions) (WebAppsUpdateSlotConfigurationNamesResponse, error) { + req, err := client.updateSlotConfigurationNamesCreateRequest(ctx, resourceGroupName, name, slotConfigNames, options) + if err != nil { + return WebAppsUpdateSlotConfigurationNamesResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsUpdateSlotConfigurationNamesResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsUpdateSlotConfigurationNamesResponse{}, client.updateSlotConfigurationNamesHandleError(resp) + } + return client.updateSlotConfigurationNamesHandleResponse(resp) +} + +// updateSlotConfigurationNamesCreateRequest creates the UpdateSlotConfigurationNames request. +func (client *WebAppsClient) updateSlotConfigurationNamesCreateRequest(ctx context.Context, resourceGroupName string, name string, slotConfigNames SlotConfigNamesResource, options *WebAppsUpdateSlotConfigurationNamesOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/slotConfigNames" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, slotConfigNames) +} + +// updateSlotConfigurationNamesHandleResponse handles the UpdateSlotConfigurationNames response. +func (client *WebAppsClient) updateSlotConfigurationNamesHandleResponse(resp *http.Response) (WebAppsUpdateSlotConfigurationNamesResponse, error) { + result := WebAppsUpdateSlotConfigurationNamesResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.SlotConfigNamesResource); err != nil { + return WebAppsUpdateSlotConfigurationNamesResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// updateSlotConfigurationNamesHandleError handles the UpdateSlotConfigurationNames error response. +func (client *WebAppsClient) updateSlotConfigurationNamesHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// UpdateSourceControl - Description for Updates the source control configuration of an app. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) UpdateSourceControl(ctx context.Context, resourceGroupName string, name string, siteSourceControl SiteSourceControl, options *WebAppsUpdateSourceControlOptions) (WebAppsUpdateSourceControlResponse, error) { + req, err := client.updateSourceControlCreateRequest(ctx, resourceGroupName, name, siteSourceControl, options) + if err != nil { + return WebAppsUpdateSourceControlResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsUpdateSourceControlResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { + return WebAppsUpdateSourceControlResponse{}, client.updateSourceControlHandleError(resp) + } + return client.updateSourceControlHandleResponse(resp) +} + +// updateSourceControlCreateRequest creates the UpdateSourceControl request. +func (client *WebAppsClient) updateSourceControlCreateRequest(ctx context.Context, resourceGroupName string, name string, siteSourceControl SiteSourceControl, options *WebAppsUpdateSourceControlOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/sourcecontrols/web" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, siteSourceControl) +} + +// updateSourceControlHandleResponse handles the UpdateSourceControl response. +func (client *WebAppsClient) updateSourceControlHandleResponse(resp *http.Response) (WebAppsUpdateSourceControlResponse, error) { + result := WebAppsUpdateSourceControlResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.SiteSourceControl); err != nil { + return WebAppsUpdateSourceControlResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// updateSourceControlHandleError handles the UpdateSourceControl error response. +func (client *WebAppsClient) updateSourceControlHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// UpdateSourceControlSlot - Description for Updates the source control configuration of an app. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) UpdateSourceControlSlot(ctx context.Context, resourceGroupName string, name string, slot string, siteSourceControl SiteSourceControl, options *WebAppsUpdateSourceControlSlotOptions) (WebAppsUpdateSourceControlSlotResponse, error) { + req, err := client.updateSourceControlSlotCreateRequest(ctx, resourceGroupName, name, slot, siteSourceControl, options) + if err != nil { + return WebAppsUpdateSourceControlSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsUpdateSourceControlSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { + return WebAppsUpdateSourceControlSlotResponse{}, client.updateSourceControlSlotHandleError(resp) + } + return client.updateSourceControlSlotHandleResponse(resp) +} + +// updateSourceControlSlotCreateRequest creates the UpdateSourceControlSlot request. +func (client *WebAppsClient) updateSourceControlSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, slot string, siteSourceControl SiteSourceControl, options *WebAppsUpdateSourceControlSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/sourcecontrols/web" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, siteSourceControl) +} + +// updateSourceControlSlotHandleResponse handles the UpdateSourceControlSlot response. +func (client *WebAppsClient) updateSourceControlSlotHandleResponse(resp *http.Response) (WebAppsUpdateSourceControlSlotResponse, error) { + result := WebAppsUpdateSourceControlSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.SiteSourceControl); err != nil { + return WebAppsUpdateSourceControlSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// updateSourceControlSlotHandleError handles the UpdateSourceControlSlot error response. +func (client *WebAppsClient) updateSourceControlSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// UpdateSwiftVirtualNetworkConnectionWithCheck - Description for Integrates this Web App with a Virtual Network. This requires that 1) "swiftSupported" +// is true when doing a GET against this resource, and 2) that the target Subnet has already been +// delegated, and is not in use by another App Service Plan other than the one this App is in. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) UpdateSwiftVirtualNetworkConnectionWithCheck(ctx context.Context, resourceGroupName string, name string, connectionEnvelope SwiftVirtualNetwork, options *WebAppsUpdateSwiftVirtualNetworkConnectionWithCheckOptions) (WebAppsUpdateSwiftVirtualNetworkConnectionWithCheckResponse, error) { + req, err := client.updateSwiftVirtualNetworkConnectionWithCheckCreateRequest(ctx, resourceGroupName, name, connectionEnvelope, options) + if err != nil { + return WebAppsUpdateSwiftVirtualNetworkConnectionWithCheckResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsUpdateSwiftVirtualNetworkConnectionWithCheckResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsUpdateSwiftVirtualNetworkConnectionWithCheckResponse{}, client.updateSwiftVirtualNetworkConnectionWithCheckHandleError(resp) + } + return client.updateSwiftVirtualNetworkConnectionWithCheckHandleResponse(resp) +} + +// updateSwiftVirtualNetworkConnectionWithCheckCreateRequest creates the UpdateSwiftVirtualNetworkConnectionWithCheck request. +func (client *WebAppsClient) updateSwiftVirtualNetworkConnectionWithCheckCreateRequest(ctx context.Context, resourceGroupName string, name string, connectionEnvelope SwiftVirtualNetwork, options *WebAppsUpdateSwiftVirtualNetworkConnectionWithCheckOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkConfig/virtualNetwork" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, connectionEnvelope) +} + +// updateSwiftVirtualNetworkConnectionWithCheckHandleResponse handles the UpdateSwiftVirtualNetworkConnectionWithCheck response. +func (client *WebAppsClient) updateSwiftVirtualNetworkConnectionWithCheckHandleResponse(resp *http.Response) (WebAppsUpdateSwiftVirtualNetworkConnectionWithCheckResponse, error) { + result := WebAppsUpdateSwiftVirtualNetworkConnectionWithCheckResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.SwiftVirtualNetwork); err != nil { + return WebAppsUpdateSwiftVirtualNetworkConnectionWithCheckResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// updateSwiftVirtualNetworkConnectionWithCheckHandleError handles the UpdateSwiftVirtualNetworkConnectionWithCheck error response. +func (client *WebAppsClient) updateSwiftVirtualNetworkConnectionWithCheckHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// UpdateSwiftVirtualNetworkConnectionWithCheckSlot - Description for Integrates this Web App with a Virtual Network. This requires that 1) "swiftSupported" +// is true when doing a GET against this resource, and 2) that the target Subnet has already been +// delegated, and is not in use by another App Service Plan other than the one this App is in. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) UpdateSwiftVirtualNetworkConnectionWithCheckSlot(ctx context.Context, resourceGroupName string, name string, slot string, connectionEnvelope SwiftVirtualNetwork, options *WebAppsUpdateSwiftVirtualNetworkConnectionWithCheckSlotOptions) (WebAppsUpdateSwiftVirtualNetworkConnectionWithCheckSlotResponse, error) { + req, err := client.updateSwiftVirtualNetworkConnectionWithCheckSlotCreateRequest(ctx, resourceGroupName, name, slot, connectionEnvelope, options) + if err != nil { + return WebAppsUpdateSwiftVirtualNetworkConnectionWithCheckSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsUpdateSwiftVirtualNetworkConnectionWithCheckSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsUpdateSwiftVirtualNetworkConnectionWithCheckSlotResponse{}, client.updateSwiftVirtualNetworkConnectionWithCheckSlotHandleError(resp) + } + return client.updateSwiftVirtualNetworkConnectionWithCheckSlotHandleResponse(resp) +} + +// updateSwiftVirtualNetworkConnectionWithCheckSlotCreateRequest creates the UpdateSwiftVirtualNetworkConnectionWithCheckSlot request. +func (client *WebAppsClient) updateSwiftVirtualNetworkConnectionWithCheckSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, slot string, connectionEnvelope SwiftVirtualNetwork, options *WebAppsUpdateSwiftVirtualNetworkConnectionWithCheckSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkConfig/virtualNetwork" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, connectionEnvelope) +} + +// updateSwiftVirtualNetworkConnectionWithCheckSlotHandleResponse handles the UpdateSwiftVirtualNetworkConnectionWithCheckSlot response. +func (client *WebAppsClient) updateSwiftVirtualNetworkConnectionWithCheckSlotHandleResponse(resp *http.Response) (WebAppsUpdateSwiftVirtualNetworkConnectionWithCheckSlotResponse, error) { + result := WebAppsUpdateSwiftVirtualNetworkConnectionWithCheckSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.SwiftVirtualNetwork); err != nil { + return WebAppsUpdateSwiftVirtualNetworkConnectionWithCheckSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// updateSwiftVirtualNetworkConnectionWithCheckSlotHandleError handles the UpdateSwiftVirtualNetworkConnectionWithCheckSlot error response. +func (client *WebAppsClient) updateSwiftVirtualNetworkConnectionWithCheckSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// UpdateVnetConnection - Description for Adds a Virtual Network connection to an app or slot (PUT) or updates the connection properties (PATCH). +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) UpdateVnetConnection(ctx context.Context, resourceGroupName string, name string, vnetName string, connectionEnvelope VnetInfoResource, options *WebAppsUpdateVnetConnectionOptions) (WebAppsUpdateVnetConnectionResponse, error) { + req, err := client.updateVnetConnectionCreateRequest(ctx, resourceGroupName, name, vnetName, connectionEnvelope, options) + if err != nil { + return WebAppsUpdateVnetConnectionResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsUpdateVnetConnectionResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsUpdateVnetConnectionResponse{}, client.updateVnetConnectionHandleError(resp) + } + return client.updateVnetConnectionHandleResponse(resp) +} + +// updateVnetConnectionCreateRequest creates the UpdateVnetConnection request. +func (client *WebAppsClient) updateVnetConnectionCreateRequest(ctx context.Context, resourceGroupName string, name string, vnetName string, connectionEnvelope VnetInfoResource, options *WebAppsUpdateVnetConnectionOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if vnetName == "" { + return nil, errors.New("parameter vnetName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{vnetName}", url.PathEscape(vnetName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, connectionEnvelope) +} + +// updateVnetConnectionHandleResponse handles the UpdateVnetConnection response. +func (client *WebAppsClient) updateVnetConnectionHandleResponse(resp *http.Response) (WebAppsUpdateVnetConnectionResponse, error) { + result := WebAppsUpdateVnetConnectionResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.VnetInfoResource); err != nil { + return WebAppsUpdateVnetConnectionResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// updateVnetConnectionHandleError handles the UpdateVnetConnection error response. +func (client *WebAppsClient) updateVnetConnectionHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// UpdateVnetConnectionGateway - Description for Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) UpdateVnetConnectionGateway(ctx context.Context, resourceGroupName string, name string, vnetName string, gatewayName string, connectionEnvelope VnetGateway, options *WebAppsUpdateVnetConnectionGatewayOptions) (WebAppsUpdateVnetConnectionGatewayResponse, error) { + req, err := client.updateVnetConnectionGatewayCreateRequest(ctx, resourceGroupName, name, vnetName, gatewayName, connectionEnvelope, options) + if err != nil { + return WebAppsUpdateVnetConnectionGatewayResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsUpdateVnetConnectionGatewayResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsUpdateVnetConnectionGatewayResponse{}, client.updateVnetConnectionGatewayHandleError(resp) + } + return client.updateVnetConnectionGatewayHandleResponse(resp) +} + +// updateVnetConnectionGatewayCreateRequest creates the UpdateVnetConnectionGateway request. +func (client *WebAppsClient) updateVnetConnectionGatewayCreateRequest(ctx context.Context, resourceGroupName string, name string, vnetName string, gatewayName string, connectionEnvelope VnetGateway, options *WebAppsUpdateVnetConnectionGatewayOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if vnetName == "" { + return nil, errors.New("parameter vnetName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{vnetName}", url.PathEscape(vnetName)) + if gatewayName == "" { + return nil, errors.New("parameter gatewayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{gatewayName}", url.PathEscape(gatewayName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, connectionEnvelope) +} + +// updateVnetConnectionGatewayHandleResponse handles the UpdateVnetConnectionGateway response. +func (client *WebAppsClient) updateVnetConnectionGatewayHandleResponse(resp *http.Response) (WebAppsUpdateVnetConnectionGatewayResponse, error) { + result := WebAppsUpdateVnetConnectionGatewayResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.VnetGateway); err != nil { + return WebAppsUpdateVnetConnectionGatewayResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// updateVnetConnectionGatewayHandleError handles the UpdateVnetConnectionGateway error response. +func (client *WebAppsClient) updateVnetConnectionGatewayHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// UpdateVnetConnectionGatewaySlot - Description for Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) UpdateVnetConnectionGatewaySlot(ctx context.Context, resourceGroupName string, name string, vnetName string, gatewayName string, slot string, connectionEnvelope VnetGateway, options *WebAppsUpdateVnetConnectionGatewaySlotOptions) (WebAppsUpdateVnetConnectionGatewaySlotResponse, error) { + req, err := client.updateVnetConnectionGatewaySlotCreateRequest(ctx, resourceGroupName, name, vnetName, gatewayName, slot, connectionEnvelope, options) + if err != nil { + return WebAppsUpdateVnetConnectionGatewaySlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsUpdateVnetConnectionGatewaySlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsUpdateVnetConnectionGatewaySlotResponse{}, client.updateVnetConnectionGatewaySlotHandleError(resp) + } + return client.updateVnetConnectionGatewaySlotHandleResponse(resp) +} + +// updateVnetConnectionGatewaySlotCreateRequest creates the UpdateVnetConnectionGatewaySlot request. +func (client *WebAppsClient) updateVnetConnectionGatewaySlotCreateRequest(ctx context.Context, resourceGroupName string, name string, vnetName string, gatewayName string, slot string, connectionEnvelope VnetGateway, options *WebAppsUpdateVnetConnectionGatewaySlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if vnetName == "" { + return nil, errors.New("parameter vnetName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{vnetName}", url.PathEscape(vnetName)) + if gatewayName == "" { + return nil, errors.New("parameter gatewayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{gatewayName}", url.PathEscape(gatewayName)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, connectionEnvelope) +} + +// updateVnetConnectionGatewaySlotHandleResponse handles the UpdateVnetConnectionGatewaySlot response. +func (client *WebAppsClient) updateVnetConnectionGatewaySlotHandleResponse(resp *http.Response) (WebAppsUpdateVnetConnectionGatewaySlotResponse, error) { + result := WebAppsUpdateVnetConnectionGatewaySlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.VnetGateway); err != nil { + return WebAppsUpdateVnetConnectionGatewaySlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// updateVnetConnectionGatewaySlotHandleError handles the UpdateVnetConnectionGatewaySlot error response. +func (client *WebAppsClient) updateVnetConnectionGatewaySlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// UpdateVnetConnectionSlot - Description for Adds a Virtual Network connection to an app or slot (PUT) or updates the connection properties (PATCH). +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebAppsClient) UpdateVnetConnectionSlot(ctx context.Context, resourceGroupName string, name string, vnetName string, slot string, connectionEnvelope VnetInfoResource, options *WebAppsUpdateVnetConnectionSlotOptions) (WebAppsUpdateVnetConnectionSlotResponse, error) { + req, err := client.updateVnetConnectionSlotCreateRequest(ctx, resourceGroupName, name, vnetName, slot, connectionEnvelope, options) + if err != nil { + return WebAppsUpdateVnetConnectionSlotResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebAppsUpdateVnetConnectionSlotResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebAppsUpdateVnetConnectionSlotResponse{}, client.updateVnetConnectionSlotHandleError(resp) + } + return client.updateVnetConnectionSlotHandleResponse(resp) +} + +// updateVnetConnectionSlotCreateRequest creates the UpdateVnetConnectionSlot request. +func (client *WebAppsClient) updateVnetConnectionSlotCreateRequest(ctx context.Context, resourceGroupName string, name string, vnetName string, slot string, connectionEnvelope VnetInfoResource, options *WebAppsUpdateVnetConnectionSlotOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if name == "" { + return nil, errors.New("parameter name cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) + if vnetName == "" { + return nil, errors.New("parameter vnetName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{vnetName}", url.PathEscape(vnetName)) + if slot == "" { + return nil, errors.New("parameter slot cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{slot}", url.PathEscape(slot)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, connectionEnvelope) +} + +// updateVnetConnectionSlotHandleResponse handles the UpdateVnetConnectionSlot response. +func (client *WebAppsClient) updateVnetConnectionSlotHandleResponse(resp *http.Response) (WebAppsUpdateVnetConnectionSlotResponse, error) { + result := WebAppsUpdateVnetConnectionSlotResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.VnetInfoResource); err != nil { + return WebAppsUpdateVnetConnectionSlotResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// updateVnetConnectionSlotHandleError handles the UpdateVnetConnectionSlot error response. +func (client *WebAppsClient) updateVnetConnectionSlotHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} diff --git a/sdk/resourcemanager/appservice/armappservice/zz_generated_websitemanagementclient_client.go b/sdk/resourcemanager/appservice/armappservice/zz_generated_websitemanagementclient_client.go new file mode 100644 index 000000000000..2e7f5d99d8b4 --- /dev/null +++ b/sdk/resourcemanager/appservice/armappservice/zz_generated_websitemanagementclient_client.go @@ -0,0 +1,942 @@ +//go:build go1.16 +// +build go1.16 + +// 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. + +package armappservice + +import ( + "context" + "errors" + "fmt" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strconv" + "strings" +) + +// WebSiteManagementClient contains the methods for the WebSiteManagementClient group. +// Don't use this type directly, use NewWebSiteManagementClient() instead. +type WebSiteManagementClient struct { + ep string + pl runtime.Pipeline + subscriptionID string +} + +// NewWebSiteManagementClient creates a new instance of WebSiteManagementClient with the specified values. +func NewWebSiteManagementClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *WebSiteManagementClient { + cp := arm.ClientOptions{} + if options != nil { + cp = *options + } + if len(cp.Host) == 0 { + cp.Host = arm.AzurePublicCloud + } + return &WebSiteManagementClient{subscriptionID: subscriptionID, ep: string(cp.Host), pl: armruntime.NewPipeline(module, version, credential, &cp)} +} + +// CheckNameAvailability - Description for Check if a resource name is available. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebSiteManagementClient) CheckNameAvailability(ctx context.Context, request ResourceNameAvailabilityRequest, options *WebSiteManagementClientCheckNameAvailabilityOptions) (WebSiteManagementClientCheckNameAvailabilityResponse, error) { + req, err := client.checkNameAvailabilityCreateRequest(ctx, request, options) + if err != nil { + return WebSiteManagementClientCheckNameAvailabilityResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebSiteManagementClientCheckNameAvailabilityResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebSiteManagementClientCheckNameAvailabilityResponse{}, client.checkNameAvailabilityHandleError(resp) + } + return client.checkNameAvailabilityHandleResponse(resp) +} + +// checkNameAvailabilityCreateRequest creates the CheckNameAvailability request. +func (client *WebSiteManagementClient) checkNameAvailabilityCreateRequest(ctx context.Context, request ResourceNameAvailabilityRequest, options *WebSiteManagementClientCheckNameAvailabilityOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Web/checknameavailability" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, request) +} + +// checkNameAvailabilityHandleResponse handles the CheckNameAvailability response. +func (client *WebSiteManagementClient) checkNameAvailabilityHandleResponse(resp *http.Response) (WebSiteManagementClientCheckNameAvailabilityResponse, error) { + result := WebSiteManagementClientCheckNameAvailabilityResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.ResourceNameAvailability); err != nil { + return WebSiteManagementClientCheckNameAvailabilityResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// checkNameAvailabilityHandleError handles the CheckNameAvailability error response. +func (client *WebSiteManagementClient) checkNameAvailabilityHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetPublishingUser - Description for Gets publishing user +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebSiteManagementClient) GetPublishingUser(ctx context.Context, options *WebSiteManagementClientGetPublishingUserOptions) (WebSiteManagementClientGetPublishingUserResponse, error) { + req, err := client.getPublishingUserCreateRequest(ctx, options) + if err != nil { + return WebSiteManagementClientGetPublishingUserResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebSiteManagementClientGetPublishingUserResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebSiteManagementClientGetPublishingUserResponse{}, client.getPublishingUserHandleError(resp) + } + return client.getPublishingUserHandleResponse(resp) +} + +// getPublishingUserCreateRequest creates the GetPublishingUser request. +func (client *WebSiteManagementClient) getPublishingUserCreateRequest(ctx context.Context, options *WebSiteManagementClientGetPublishingUserOptions) (*policy.Request, error) { + urlPath := "/providers/Microsoft.Web/publishingUsers/web" + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getPublishingUserHandleResponse handles the GetPublishingUser response. +func (client *WebSiteManagementClient) getPublishingUserHandleResponse(resp *http.Response) (WebSiteManagementClientGetPublishingUserResponse, error) { + result := WebSiteManagementClientGetPublishingUserResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.User); err != nil { + return WebSiteManagementClientGetPublishingUserResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getPublishingUserHandleError handles the GetPublishingUser error response. +func (client *WebSiteManagementClient) getPublishingUserHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetSourceControl - Description for Gets source control token +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebSiteManagementClient) GetSourceControl(ctx context.Context, sourceControlType string, options *WebSiteManagementClientGetSourceControlOptions) (WebSiteManagementClientGetSourceControlResponse, error) { + req, err := client.getSourceControlCreateRequest(ctx, sourceControlType, options) + if err != nil { + return WebSiteManagementClientGetSourceControlResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebSiteManagementClientGetSourceControlResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebSiteManagementClientGetSourceControlResponse{}, client.getSourceControlHandleError(resp) + } + return client.getSourceControlHandleResponse(resp) +} + +// getSourceControlCreateRequest creates the GetSourceControl request. +func (client *WebSiteManagementClient) getSourceControlCreateRequest(ctx context.Context, sourceControlType string, options *WebSiteManagementClientGetSourceControlOptions) (*policy.Request, error) { + urlPath := "/providers/Microsoft.Web/sourcecontrols/{sourceControlType}" + if sourceControlType == "" { + return nil, errors.New("parameter sourceControlType cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{sourceControlType}", url.PathEscape(sourceControlType)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getSourceControlHandleResponse handles the GetSourceControl response. +func (client *WebSiteManagementClient) getSourceControlHandleResponse(resp *http.Response) (WebSiteManagementClientGetSourceControlResponse, error) { + result := WebSiteManagementClientGetSourceControlResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.SourceControl); err != nil { + return WebSiteManagementClientGetSourceControlResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getSourceControlHandleError handles the GetSourceControl error response. +func (client *WebSiteManagementClient) getSourceControlHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// GetSubscriptionDeploymentLocations - Description for Gets list of available geo regions plus ministamps +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebSiteManagementClient) GetSubscriptionDeploymentLocations(ctx context.Context, options *WebSiteManagementClientGetSubscriptionDeploymentLocationsOptions) (WebSiteManagementClientGetSubscriptionDeploymentLocationsResponse, error) { + req, err := client.getSubscriptionDeploymentLocationsCreateRequest(ctx, options) + if err != nil { + return WebSiteManagementClientGetSubscriptionDeploymentLocationsResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebSiteManagementClientGetSubscriptionDeploymentLocationsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebSiteManagementClientGetSubscriptionDeploymentLocationsResponse{}, client.getSubscriptionDeploymentLocationsHandleError(resp) + } + return client.getSubscriptionDeploymentLocationsHandleResponse(resp) +} + +// getSubscriptionDeploymentLocationsCreateRequest creates the GetSubscriptionDeploymentLocations request. +func (client *WebSiteManagementClient) getSubscriptionDeploymentLocationsCreateRequest(ctx context.Context, options *WebSiteManagementClientGetSubscriptionDeploymentLocationsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Web/deploymentLocations" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// getSubscriptionDeploymentLocationsHandleResponse handles the GetSubscriptionDeploymentLocations response. +func (client *WebSiteManagementClient) getSubscriptionDeploymentLocationsHandleResponse(resp *http.Response) (WebSiteManagementClientGetSubscriptionDeploymentLocationsResponse, error) { + result := WebSiteManagementClientGetSubscriptionDeploymentLocationsResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.DeploymentLocations); err != nil { + return WebSiteManagementClientGetSubscriptionDeploymentLocationsResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// getSubscriptionDeploymentLocationsHandleError handles the GetSubscriptionDeploymentLocations error response. +func (client *WebSiteManagementClient) getSubscriptionDeploymentLocationsHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListBillingMeters - Description for Gets a list of meters for a given location. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebSiteManagementClient) ListBillingMeters(options *WebSiteManagementClientListBillingMetersOptions) *WebSiteManagementClientListBillingMetersPager { + return &WebSiteManagementClientListBillingMetersPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listBillingMetersCreateRequest(ctx, options) + }, + advancer: func(ctx context.Context, resp WebSiteManagementClientListBillingMetersResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.BillingMeterCollection.NextLink) + }, + } +} + +// listBillingMetersCreateRequest creates the ListBillingMeters request. +func (client *WebSiteManagementClient) listBillingMetersCreateRequest(ctx context.Context, options *WebSiteManagementClientListBillingMetersOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Web/billingMeters" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + if options != nil && options.BillingLocation != nil { + reqQP.Set("billingLocation", *options.BillingLocation) + } + if options != nil && options.OSType != nil { + reqQP.Set("osType", *options.OSType) + } + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listBillingMetersHandleResponse handles the ListBillingMeters response. +func (client *WebSiteManagementClient) listBillingMetersHandleResponse(resp *http.Response) (WebSiteManagementClientListBillingMetersResponse, error) { + result := WebSiteManagementClientListBillingMetersResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.BillingMeterCollection); err != nil { + return WebSiteManagementClientListBillingMetersResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listBillingMetersHandleError handles the ListBillingMeters error response. +func (client *WebSiteManagementClient) listBillingMetersHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListGeoRegions - Description for Get a list of available geographical regions. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebSiteManagementClient) ListGeoRegions(options *WebSiteManagementClientListGeoRegionsOptions) *WebSiteManagementClientListGeoRegionsPager { + return &WebSiteManagementClientListGeoRegionsPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listGeoRegionsCreateRequest(ctx, options) + }, + advancer: func(ctx context.Context, resp WebSiteManagementClientListGeoRegionsResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.GeoRegionCollection.NextLink) + }, + } +} + +// listGeoRegionsCreateRequest creates the ListGeoRegions request. +func (client *WebSiteManagementClient) listGeoRegionsCreateRequest(ctx context.Context, options *WebSiteManagementClientListGeoRegionsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Web/geoRegions" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + if options != nil && options.SKU != nil { + reqQP.Set("sku", string(*options.SKU)) + } + if options != nil && options.LinuxWorkersEnabled != nil { + reqQP.Set("linuxWorkersEnabled", strconv.FormatBool(*options.LinuxWorkersEnabled)) + } + if options != nil && options.XenonWorkersEnabled != nil { + reqQP.Set("xenonWorkersEnabled", strconv.FormatBool(*options.XenonWorkersEnabled)) + } + if options != nil && options.LinuxDynamicWorkersEnabled != nil { + reqQP.Set("linuxDynamicWorkersEnabled", strconv.FormatBool(*options.LinuxDynamicWorkersEnabled)) + } + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listGeoRegionsHandleResponse handles the ListGeoRegions response. +func (client *WebSiteManagementClient) listGeoRegionsHandleResponse(resp *http.Response) (WebSiteManagementClientListGeoRegionsResponse, error) { + result := WebSiteManagementClientListGeoRegionsResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.GeoRegionCollection); err != nil { + return WebSiteManagementClientListGeoRegionsResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listGeoRegionsHandleError handles the ListGeoRegions error response. +func (client *WebSiteManagementClient) listGeoRegionsHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListPremierAddOnOffers - Description for List all premier add-on offers. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebSiteManagementClient) ListPremierAddOnOffers(options *WebSiteManagementClientListPremierAddOnOffersOptions) *WebSiteManagementClientListPremierAddOnOffersPager { + return &WebSiteManagementClientListPremierAddOnOffersPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listPremierAddOnOffersCreateRequest(ctx, options) + }, + advancer: func(ctx context.Context, resp WebSiteManagementClientListPremierAddOnOffersResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.PremierAddOnOfferCollection.NextLink) + }, + } +} + +// listPremierAddOnOffersCreateRequest creates the ListPremierAddOnOffers request. +func (client *WebSiteManagementClient) listPremierAddOnOffersCreateRequest(ctx context.Context, options *WebSiteManagementClientListPremierAddOnOffersOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Web/premieraddonoffers" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listPremierAddOnOffersHandleResponse handles the ListPremierAddOnOffers response. +func (client *WebSiteManagementClient) listPremierAddOnOffersHandleResponse(resp *http.Response) (WebSiteManagementClientListPremierAddOnOffersResponse, error) { + result := WebSiteManagementClientListPremierAddOnOffersResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.PremierAddOnOfferCollection); err != nil { + return WebSiteManagementClientListPremierAddOnOffersResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listPremierAddOnOffersHandleError handles the ListPremierAddOnOffers error response. +func (client *WebSiteManagementClient) listPremierAddOnOffersHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListSKUs - Description for List all SKUs. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebSiteManagementClient) ListSKUs(ctx context.Context, options *WebSiteManagementClientListSKUsOptions) (WebSiteManagementClientListSKUsResponse, error) { + req, err := client.listSKUsCreateRequest(ctx, options) + if err != nil { + return WebSiteManagementClientListSKUsResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebSiteManagementClientListSKUsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebSiteManagementClientListSKUsResponse{}, client.listSKUsHandleError(resp) + } + return client.listSKUsHandleResponse(resp) +} + +// listSKUsCreateRequest creates the ListSKUs request. +func (client *WebSiteManagementClient) listSKUsCreateRequest(ctx context.Context, options *WebSiteManagementClientListSKUsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Web/skus" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listSKUsHandleResponse handles the ListSKUs response. +func (client *WebSiteManagementClient) listSKUsHandleResponse(resp *http.Response) (WebSiteManagementClientListSKUsResponse, error) { + result := WebSiteManagementClientListSKUsResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.SKUInfos); err != nil { + return WebSiteManagementClientListSKUsResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listSKUsHandleError handles the ListSKUs error response. +func (client *WebSiteManagementClient) listSKUsHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListSiteIdentifiersAssignedToHostName - Description for List all apps that are assigned to a hostname. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebSiteManagementClient) ListSiteIdentifiersAssignedToHostName(nameIdentifier NameIdentifier, options *WebSiteManagementClientListSiteIdentifiersAssignedToHostNameOptions) *WebSiteManagementClientListSiteIdentifiersAssignedToHostNamePager { + return &WebSiteManagementClientListSiteIdentifiersAssignedToHostNamePager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listSiteIdentifiersAssignedToHostNameCreateRequest(ctx, nameIdentifier, options) + }, + advancer: func(ctx context.Context, resp WebSiteManagementClientListSiteIdentifiersAssignedToHostNameResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.IdentifierCollection.NextLink) + }, + } +} + +// listSiteIdentifiersAssignedToHostNameCreateRequest creates the ListSiteIdentifiersAssignedToHostName request. +func (client *WebSiteManagementClient) listSiteIdentifiersAssignedToHostNameCreateRequest(ctx context.Context, nameIdentifier NameIdentifier, options *WebSiteManagementClientListSiteIdentifiersAssignedToHostNameOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Web/listSitesAssignedToHostName" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, nameIdentifier) +} + +// listSiteIdentifiersAssignedToHostNameHandleResponse handles the ListSiteIdentifiersAssignedToHostName response. +func (client *WebSiteManagementClient) listSiteIdentifiersAssignedToHostNameHandleResponse(resp *http.Response) (WebSiteManagementClientListSiteIdentifiersAssignedToHostNameResponse, error) { + result := WebSiteManagementClientListSiteIdentifiersAssignedToHostNameResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.IdentifierCollection); err != nil { + return WebSiteManagementClientListSiteIdentifiersAssignedToHostNameResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listSiteIdentifiersAssignedToHostNameHandleError handles the ListSiteIdentifiersAssignedToHostName error response. +func (client *WebSiteManagementClient) listSiteIdentifiersAssignedToHostNameHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ListSourceControls - Description for Gets the source controls available for Azure websites. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebSiteManagementClient) ListSourceControls(options *WebSiteManagementClientListSourceControlsOptions) *WebSiteManagementClientListSourceControlsPager { + return &WebSiteManagementClientListSourceControlsPager{ + client: client, + requester: func(ctx context.Context) (*policy.Request, error) { + return client.listSourceControlsCreateRequest(ctx, options) + }, + advancer: func(ctx context.Context, resp WebSiteManagementClientListSourceControlsResponse) (*policy.Request, error) { + return runtime.NewRequest(ctx, http.MethodGet, *resp.SourceControlCollection.NextLink) + }, + } +} + +// listSourceControlsCreateRequest creates the ListSourceControls request. +func (client *WebSiteManagementClient) listSourceControlsCreateRequest(ctx context.Context, options *WebSiteManagementClientListSourceControlsOptions) (*policy.Request, error) { + urlPath := "/providers/Microsoft.Web/sourcecontrols" + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, nil +} + +// listSourceControlsHandleResponse handles the ListSourceControls response. +func (client *WebSiteManagementClient) listSourceControlsHandleResponse(resp *http.Response) (WebSiteManagementClientListSourceControlsResponse, error) { + result := WebSiteManagementClientListSourceControlsResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.SourceControlCollection); err != nil { + return WebSiteManagementClientListSourceControlsResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// listSourceControlsHandleError handles the ListSourceControls error response. +func (client *WebSiteManagementClient) listSourceControlsHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// Move - Description for Move resources between resource groups. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebSiteManagementClient) Move(ctx context.Context, resourceGroupName string, moveResourceEnvelope CsmMoveResourceEnvelope, options *WebSiteManagementClientMoveOptions) (WebSiteManagementClientMoveResponse, error) { + req, err := client.moveCreateRequest(ctx, resourceGroupName, moveResourceEnvelope, options) + if err != nil { + return WebSiteManagementClientMoveResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebSiteManagementClientMoveResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusNoContent) { + return WebSiteManagementClientMoveResponse{}, client.moveHandleError(resp) + } + return WebSiteManagementClientMoveResponse{RawResponse: resp}, nil +} + +// moveCreateRequest creates the Move request. +func (client *WebSiteManagementClient) moveCreateRequest(ctx context.Context, resourceGroupName string, moveResourceEnvelope CsmMoveResourceEnvelope, options *WebSiteManagementClientMoveOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/moveResources" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, moveResourceEnvelope) +} + +// moveHandleError handles the Move error response. +func (client *WebSiteManagementClient) moveHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// UpdatePublishingUser - Description for Updates publishing user +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebSiteManagementClient) UpdatePublishingUser(ctx context.Context, userDetails User, options *WebSiteManagementClientUpdatePublishingUserOptions) (WebSiteManagementClientUpdatePublishingUserResponse, error) { + req, err := client.updatePublishingUserCreateRequest(ctx, userDetails, options) + if err != nil { + return WebSiteManagementClientUpdatePublishingUserResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebSiteManagementClientUpdatePublishingUserResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebSiteManagementClientUpdatePublishingUserResponse{}, client.updatePublishingUserHandleError(resp) + } + return client.updatePublishingUserHandleResponse(resp) +} + +// updatePublishingUserCreateRequest creates the UpdatePublishingUser request. +func (client *WebSiteManagementClient) updatePublishingUserCreateRequest(ctx context.Context, userDetails User, options *WebSiteManagementClientUpdatePublishingUserOptions) (*policy.Request, error) { + urlPath := "/providers/Microsoft.Web/publishingUsers/web" + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, userDetails) +} + +// updatePublishingUserHandleResponse handles the UpdatePublishingUser response. +func (client *WebSiteManagementClient) updatePublishingUserHandleResponse(resp *http.Response) (WebSiteManagementClientUpdatePublishingUserResponse, error) { + result := WebSiteManagementClientUpdatePublishingUserResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.User); err != nil { + return WebSiteManagementClientUpdatePublishingUserResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// updatePublishingUserHandleError handles the UpdatePublishingUser error response. +func (client *WebSiteManagementClient) updatePublishingUserHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// UpdateSourceControl - Description for Updates source control token +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebSiteManagementClient) UpdateSourceControl(ctx context.Context, sourceControlType string, requestMessage SourceControl, options *WebSiteManagementClientUpdateSourceControlOptions) (WebSiteManagementClientUpdateSourceControlResponse, error) { + req, err := client.updateSourceControlCreateRequest(ctx, sourceControlType, requestMessage, options) + if err != nil { + return WebSiteManagementClientUpdateSourceControlResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebSiteManagementClientUpdateSourceControlResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebSiteManagementClientUpdateSourceControlResponse{}, client.updateSourceControlHandleError(resp) + } + return client.updateSourceControlHandleResponse(resp) +} + +// updateSourceControlCreateRequest creates the UpdateSourceControl request. +func (client *WebSiteManagementClient) updateSourceControlCreateRequest(ctx context.Context, sourceControlType string, requestMessage SourceControl, options *WebSiteManagementClientUpdateSourceControlOptions) (*policy.Request, error) { + urlPath := "/providers/Microsoft.Web/sourcecontrols/{sourceControlType}" + if sourceControlType == "" { + return nil, errors.New("parameter sourceControlType cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{sourceControlType}", url.PathEscape(sourceControlType)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, requestMessage) +} + +// updateSourceControlHandleResponse handles the UpdateSourceControl response. +func (client *WebSiteManagementClient) updateSourceControlHandleResponse(resp *http.Response) (WebSiteManagementClientUpdateSourceControlResponse, error) { + result := WebSiteManagementClientUpdateSourceControlResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.SourceControl); err != nil { + return WebSiteManagementClientUpdateSourceControlResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// updateSourceControlHandleError handles the UpdateSourceControl error response. +func (client *WebSiteManagementClient) updateSourceControlHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// Validate - Description for Validate if a resource can be created. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebSiteManagementClient) Validate(ctx context.Context, resourceGroupName string, validateRequest ValidateRequest, options *WebSiteManagementClientValidateOptions) (WebSiteManagementClientValidateResponse, error) { + req, err := client.validateCreateRequest(ctx, resourceGroupName, validateRequest, options) + if err != nil { + return WebSiteManagementClientValidateResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebSiteManagementClientValidateResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebSiteManagementClientValidateResponse{}, client.validateHandleError(resp) + } + return client.validateHandleResponse(resp) +} + +// validateCreateRequest creates the Validate request. +func (client *WebSiteManagementClient) validateCreateRequest(ctx context.Context, resourceGroupName string, validateRequest ValidateRequest, options *WebSiteManagementClientValidateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/validate" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, validateRequest) +} + +// validateHandleResponse handles the Validate response. +func (client *WebSiteManagementClient) validateHandleResponse(resp *http.Response) (WebSiteManagementClientValidateResponse, error) { + result := WebSiteManagementClientValidateResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.ValidateResponse); err != nil { + return WebSiteManagementClientValidateResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// validateHandleError handles the Validate error response. +func (client *WebSiteManagementClient) validateHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// ValidateMove - Description for Validate whether a resource can be moved. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebSiteManagementClient) ValidateMove(ctx context.Context, resourceGroupName string, moveResourceEnvelope CsmMoveResourceEnvelope, options *WebSiteManagementClientValidateMoveOptions) (WebSiteManagementClientValidateMoveResponse, error) { + req, err := client.validateMoveCreateRequest(ctx, resourceGroupName, moveResourceEnvelope, options) + if err != nil { + return WebSiteManagementClientValidateMoveResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebSiteManagementClientValidateMoveResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusNoContent) { + return WebSiteManagementClientValidateMoveResponse{}, client.validateMoveHandleError(resp) + } + return WebSiteManagementClientValidateMoveResponse{RawResponse: resp}, nil +} + +// validateMoveCreateRequest creates the ValidateMove request. +func (client *WebSiteManagementClient) validateMoveCreateRequest(ctx context.Context, resourceGroupName string, moveResourceEnvelope CsmMoveResourceEnvelope, options *WebSiteManagementClientValidateMoveOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/validateMoveResources" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, moveResourceEnvelope) +} + +// validateMoveHandleError handles the ValidateMove error response. +func (client *WebSiteManagementClient) validateMoveHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +} + +// VerifyHostingEnvironmentVnet - Description for Verifies if this VNET is compatible with an App Service Environment by analyzing the Network Security +// Group rules. +// If the operation fails it returns the *DefaultErrorResponse error type. +func (client *WebSiteManagementClient) VerifyHostingEnvironmentVnet(ctx context.Context, parameters VnetParameters, options *WebSiteManagementClientVerifyHostingEnvironmentVnetOptions) (WebSiteManagementClientVerifyHostingEnvironmentVnetResponse, error) { + req, err := client.verifyHostingEnvironmentVnetCreateRequest(ctx, parameters, options) + if err != nil { + return WebSiteManagementClientVerifyHostingEnvironmentVnetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WebSiteManagementClientVerifyHostingEnvironmentVnetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WebSiteManagementClientVerifyHostingEnvironmentVnetResponse{}, client.verifyHostingEnvironmentVnetHandleError(resp) + } + return client.verifyHostingEnvironmentVnetHandleResponse(resp) +} + +// verifyHostingEnvironmentVnetCreateRequest creates the VerifyHostingEnvironmentVnet request. +func (client *WebSiteManagementClient) verifyHostingEnvironmentVnetCreateRequest(ctx context.Context, parameters VnetParameters, options *WebSiteManagementClientVerifyHostingEnvironmentVnetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Web/verifyHostingEnvironmentVnet" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-02-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, parameters) +} + +// verifyHostingEnvironmentVnetHandleResponse handles the VerifyHostingEnvironmentVnet response. +func (client *WebSiteManagementClient) verifyHostingEnvironmentVnetHandleResponse(resp *http.Response) (WebSiteManagementClientVerifyHostingEnvironmentVnetResponse, error) { + result := WebSiteManagementClientVerifyHostingEnvironmentVnetResponse{RawResponse: resp} + if err := runtime.UnmarshalAsJSON(resp, &result.VnetValidationFailureDetails); err != nil { + return WebSiteManagementClientVerifyHostingEnvironmentVnetResponse{}, runtime.NewResponseError(err, resp) + } + return result, nil +} + +// verifyHostingEnvironmentVnetHandleError handles the VerifyHostingEnvironmentVnet error response. +func (client *WebSiteManagementClient) verifyHostingEnvironmentVnetHandleError(resp *http.Response) error { + body, err := runtime.Payload(resp) + if err != nil { + return runtime.NewResponseError(err, resp) + } + errType := DefaultErrorResponse{raw: string(body)} + if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { + return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) + } + return runtime.NewResponseError(&errType, resp) +}