diff --git a/azurerm/internal/services/frontdoor/client/client.go b/azurerm/internal/services/frontdoor/client/client.go index ccceed78b006..b55a7defa1bf 100644 --- a/azurerm/internal/services/frontdoor/client/client.go +++ b/azurerm/internal/services/frontdoor/client/client.go @@ -1,7 +1,7 @@ package client import ( - "github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2019-04-01/frontdoor" + "github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2019-11-01/frontdoor" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/common" ) diff --git a/azurerm/internal/services/frontdoor/helper.go b/azurerm/internal/services/frontdoor/helper.go index 8dc1e23e2493..ba647771590d 100644 --- a/azurerm/internal/services/frontdoor/helper.go +++ b/azurerm/internal/services/frontdoor/helper.go @@ -4,7 +4,7 @@ import ( "fmt" "strings" - "github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2019-04-01/frontdoor" + "github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2019-11-01/frontdoor" ) func VerifyBackendPoolExists(backendPoolName string, backendPools []interface{}) error { diff --git a/azurerm/internal/services/frontdoor/resource_arm_front_door.go b/azurerm/internal/services/frontdoor/resource_arm_front_door.go index 3e382e256d59..3bccc29a445b 100644 --- a/azurerm/internal/services/frontdoor/resource_arm_front_door.go +++ b/azurerm/internal/services/frontdoor/resource_arm_front_door.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2019-04-01/frontdoor" + "github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2019-11-01/frontdoor" "github.com/hashicorp/go-azure-helpers/response" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" @@ -832,8 +832,11 @@ func expandArmFrontDoorFrontendEndpoint(input []interface{}, frontDoorPath strin func expandArmFrontDoorCustomHTTPSConfiguration(input []interface{}) *frontdoor.CustomHTTPSConfiguration { if len(input) == 0 { + // https://github.com/Azure/azure-sdk-for-go/issues/6882 + defaultProtocolType := "ServerNameIndication" + defaultHttpsConfiguration := frontdoor.CustomHTTPSConfiguration{ - ProtocolType: frontdoor.ServerNameIndication, + ProtocolType: &defaultProtocolType, CertificateSource: frontdoor.CertificateSourceFrontDoor, CertificateSourceParameters: &frontdoor.CertificateSourceParameters{ CertificateType: frontdoor.Dedicated, @@ -1435,8 +1438,11 @@ func flattenArmFrontDoorFrontendEndpointsSubResources(input *[]frontdoor.SubReso } func makeCustomHttpsConfiguration(customHttpsConfiguration map[string]interface{}) frontdoor.CustomHTTPSConfiguration { + // https://github.com/Azure/azure-sdk-for-go/issues/6882 + defaultProtocolType := "ServerNameIndication" + customHTTPSConfigurationUpdate := frontdoor.CustomHTTPSConfiguration{ - ProtocolType: frontdoor.ServerNameIndication, + ProtocolType: &defaultProtocolType, } if customHttpsConfiguration["certificate_source"].(string) == "AzureKeyVault" { diff --git a/azurerm/internal/services/frontdoor/resource_arm_front_door_firewall_policy.go b/azurerm/internal/services/frontdoor/resource_arm_front_door_firewall_policy.go index d5530e36938f..bce0af254659 100644 --- a/azurerm/internal/services/frontdoor/resource_arm_front_door_firewall_policy.go +++ b/azurerm/internal/services/frontdoor/resource_arm_front_door_firewall_policy.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2019-04-01/frontdoor" + "github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2019-11-01/frontdoor" "github.com/hashicorp/go-azure-helpers/response" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" @@ -180,18 +180,18 @@ func resourceArmFrontDoorFirewallPolicy() *schema.Resource { Type: schema.TypeString, Required: true, ValidateFunc: validation.StringInSlice([]string{ - string(frontdoor.Any), - string(frontdoor.BeginsWith), - string(frontdoor.Contains), - string(frontdoor.EndsWith), - string(frontdoor.Equal), - string(frontdoor.GeoMatch), - string(frontdoor.GreaterThan), - string(frontdoor.GreaterThanOrEqual), - string(frontdoor.IPMatch), - string(frontdoor.LessThan), - string(frontdoor.LessThanOrEqual), - string(frontdoor.RegEx), + string(frontdoor.OperatorAny), + string(frontdoor.OperatorBeginsWith), + string(frontdoor.OperatorContains), + string(frontdoor.OperatorEndsWith), + string(frontdoor.OperatorEqual), + string(frontdoor.OperatorGeoMatch), + string(frontdoor.OperatorGreaterThan), + string(frontdoor.OperatorGreaterThanOrEqual), + string(frontdoor.OperatorIPMatch), + string(frontdoor.OperatorLessThan), + string(frontdoor.OperatorLessThanOrEqual), + string(frontdoor.OperatorRegEx), }, false), }, diff --git a/azurerm/internal/services/frontdoor/tests/resource_arm_front_door_firewall_policy_test.go b/azurerm/internal/services/frontdoor/tests/resource_arm_front_door_firewall_policy_test.go index 06aa6d9c9442..4ab716b99448 100644 --- a/azurerm/internal/services/frontdoor/tests/resource_arm_front_door_firewall_policy_test.go +++ b/azurerm/internal/services/frontdoor/tests/resource_arm_front_door_firewall_policy_test.go @@ -243,7 +243,7 @@ custom_rule { return fmt.Sprintf(` resource "azurerm_resource_group" "test" { name = "testAccRG-%d" - location = "%s" + location = "%[2]s" } resource "azurerm_frontdoor_firewall_policy" "test" { @@ -272,7 +272,7 @@ resource "azurerm_frontdoor_firewall_policy" "test" { } } - %s + %[3]s managed_rule { type = "DefaultRuleSet" diff --git a/go.mod b/go.mod index dfb77e1251ee..fb65ece34121 100644 --- a/go.mod +++ b/go.mod @@ -1,7 +1,7 @@ module github.com/terraform-providers/terraform-provider-azurerm require ( - github.com/Azure/azure-sdk-for-go v38.0.0+incompatible + github.com/Azure/azure-sdk-for-go v38.1.0+incompatible github.com/Azure/go-autorest/autorest v0.9.3 github.com/Azure/go-autorest/autorest/date v0.2.0 github.com/apparentlymart/go-dump v0.0.0-20190214190832-042adf3cf4a0 // indirect diff --git a/go.sum b/go.sum index a58ba9900ae0..b61735646ebc 100644 --- a/go.sum +++ b/go.sum @@ -13,8 +13,8 @@ contrib.go.opencensus.io/exporter/ocagent v0.5.0/go.mod h1:ImxhfLRpxoYiSq891pBrL github.com/Azure/azure-sdk-for-go v21.3.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= github.com/Azure/azure-sdk-for-go v32.5.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= github.com/Azure/azure-sdk-for-go v35.0.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= -github.com/Azure/azure-sdk-for-go v38.0.0+incompatible h1:3D2O4g8AwDwyWkM1HpMFVux/ccQJmGJHXsE004Wsu1Q= -github.com/Azure/azure-sdk-for-go v38.0.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= +github.com/Azure/azure-sdk-for-go v38.1.0+incompatible h1:5AawcyRJqShKENbdf2ZWJsdOnr+dEt6bz91YStCUmT4= +github.com/Azure/azure-sdk-for-go v38.1.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= github.com/Azure/go-autorest v10.15.4+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= github.com/Azure/go-autorest v13.0.0+incompatible h1:56c11ykhsFSPNNQuS73Ri8h/ezqVhr2h6t9LJIEKVO0= github.com/Azure/go-autorest v13.0.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= diff --git a/vendor/github.com/Azure/azure-sdk-for-go/profiles/2017-03-09/resources/mgmt/resources/models.go b/vendor/github.com/Azure/azure-sdk-for-go/profiles/2017-03-09/resources/mgmt/resources/models.go index 94a1a8b8e728..9666bbaaddb8 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/profiles/2017-03-09/resources/mgmt/resources/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/profiles/2017-03-09/resources/mgmt/resources/models.go @@ -1,6 +1,6 @@ // +build go1.9 -// Copyright 2019 Microsoft Corporation +// Copyright 2020 Microsoft Corporation // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2019-04-01/frontdoor/client.go b/vendor/github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2019-11-01/frontdoor/client.go similarity index 97% rename from vendor/github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2019-04-01/frontdoor/client.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2019-11-01/frontdoor/client.go index 31795304aa33..91f605afddb9 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2019-04-01/frontdoor/client.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2019-11-01/frontdoor/client.go @@ -46,7 +46,8 @@ func New(subscriptionID string) BaseClient { return NewWithBaseURI(DefaultBaseURI, subscriptionID) } -// NewWithBaseURI creates an instance of the BaseClient client. +// NewWithBaseURI creates an instance of the BaseClient client using a custom endpoint. Use this when interacting with +// an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { return BaseClient{ Client: autorest.NewClientWithUserAgent(UserAgent()), @@ -98,7 +99,7 @@ func (client BaseClient) CheckFrontDoorNameAvailability(ctx context.Context, che // CheckFrontDoorNameAvailabilityPreparer prepares the CheckFrontDoorNameAvailability request. func (client BaseClient) CheckFrontDoorNameAvailabilityPreparer(ctx context.Context, checkFrontDoorNameAvailabilityInput CheckNameAvailabilityInput) (*http.Request, error) { - const APIVersion = "2019-04-01" + const APIVersion = "2019-05-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -180,7 +181,7 @@ func (client BaseClient) CheckFrontDoorNameAvailabilityWithSubscriptionPreparer( "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-04-01" + const APIVersion = "2019-05-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2019-04-01/frontdoor/endpoints.go b/vendor/github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2019-11-01/frontdoor/endpoints.go similarity index 96% rename from vendor/github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2019-04-01/frontdoor/endpoints.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2019-11-01/frontdoor/endpoints.go index 935523490056..edb66c36b708 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2019-04-01/frontdoor/endpoints.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2019-11-01/frontdoor/endpoints.go @@ -36,7 +36,8 @@ func NewEndpointsClient(subscriptionID string) EndpointsClient { return NewEndpointsClientWithBaseURI(DefaultBaseURI, subscriptionID) } -// NewEndpointsClientWithBaseURI creates an instance of the EndpointsClient client. +// NewEndpointsClientWithBaseURI creates an instance of the EndpointsClient client using a custom endpoint. Use this +// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). func NewEndpointsClientWithBaseURI(baseURI string, subscriptionID string) EndpointsClient { return EndpointsClient{NewWithBaseURI(baseURI, subscriptionID)} } @@ -96,7 +97,7 @@ func (client EndpointsClient) PurgeContentPreparer(ctx context.Context, resource "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-04-01" + const APIVersion = "2019-05-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2019-11-01/frontdoor/experiments.go b/vendor/github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2019-11-01/frontdoor/experiments.go new file mode 100644 index 000000000000..baa977a3bfc1 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2019-11-01/frontdoor/experiments.go @@ -0,0 +1,537 @@ +package frontdoor + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ExperimentsClient is the frontDoor Client +type ExperimentsClient struct { + BaseClient +} + +// NewExperimentsClient creates an instance of the ExperimentsClient client. +func NewExperimentsClient(subscriptionID string) ExperimentsClient { + return NewExperimentsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewExperimentsClientWithBaseURI creates an instance of the ExperimentsClient client using a custom endpoint. Use +// this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewExperimentsClientWithBaseURI(baseURI string, subscriptionID string) ExperimentsClient { + return ExperimentsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate sends the create or update request. +// Parameters: +// resourceGroupName - name of the Resource group within the Azure subscription. +// profileName - the Profile identifier associated with the Tenant and Partner +// experimentName - the Experiment identifier associated with the Experiment +// parameters - the Experiment resource +func (client ExperimentsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, profileName string, experimentName string, parameters Experiment) (result ExperimentsCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ExperimentsClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}, + {TargetValue: profileName, + Constraints: []validation.Constraint{{Target: "profileName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}, + {TargetValue: experimentName, + Constraints: []validation.Constraint{{Target: "experimentName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("frontdoor.ExperimentsClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, profileName, experimentName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.ExperimentsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.ExperimentsClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client ExperimentsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, profileName string, experimentName string, parameters Experiment) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "experimentName": autorest.Encode("path", experimentName), + "profileName": autorest.Encode("path", profileName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/NetworkExperimentProfiles/{profileName}/Experiments/{experimentName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client ExperimentsClient) CreateOrUpdateSender(req *http.Request) (future ExperimentsCreateOrUpdateFuture, err error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, sd...) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client ExperimentsClient) CreateOrUpdateResponder(resp *http.Response) (result Experiment, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete sends the delete request. +// Parameters: +// resourceGroupName - name of the Resource group within the Azure subscription. +// profileName - the Profile identifier associated with the Tenant and Partner +// experimentName - the Experiment identifier associated with the Experiment +func (client ExperimentsClient) Delete(ctx context.Context, resourceGroupName string, profileName string, experimentName string) (result ExperimentsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ExperimentsClient.Delete") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}, + {TargetValue: profileName, + Constraints: []validation.Constraint{{Target: "profileName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}, + {TargetValue: experimentName, + Constraints: []validation.Constraint{{Target: "experimentName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("frontdoor.ExperimentsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, profileName, experimentName) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.ExperimentsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.ExperimentsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ExperimentsClient) DeletePreparer(ctx context.Context, resourceGroupName string, profileName string, experimentName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "experimentName": autorest.Encode("path", experimentName), + "profileName": autorest.Encode("path", profileName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/NetworkExperimentProfiles/{profileName}/Experiments/{experimentName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ExperimentsClient) DeleteSender(req *http.Request) (future ExperimentsDeleteFuture, err error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, sd...) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ExperimentsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get sends the get request. +// Parameters: +// resourceGroupName - name of the Resource group within the Azure subscription. +// profileName - the Profile identifier associated with the Tenant and Partner +// experimentName - the Experiment identifier associated with the Experiment +func (client ExperimentsClient) Get(ctx context.Context, resourceGroupName string, profileName string, experimentName string) (result Experiment, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ExperimentsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}, + {TargetValue: profileName, + Constraints: []validation.Constraint{{Target: "profileName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}, + {TargetValue: experimentName, + Constraints: []validation.Constraint{{Target: "experimentName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("frontdoor.ExperimentsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, profileName, experimentName) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.ExperimentsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "frontdoor.ExperimentsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.ExperimentsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client ExperimentsClient) GetPreparer(ctx context.Context, resourceGroupName string, profileName string, experimentName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "experimentName": autorest.Encode("path", experimentName), + "profileName": autorest.Encode("path", profileName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/NetworkExperimentProfiles/{profileName}/Experiments/{experimentName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ExperimentsClient) GetSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ExperimentsClient) GetResponder(resp *http.Response) (result Experiment, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByProfile sends the list by profile request. +// Parameters: +// resourceGroupName - name of the Resource group within the Azure subscription. +// profileName - the Profile identifier associated with the Tenant and Partner +func (client ExperimentsClient) ListByProfile(ctx context.Context, resourceGroupName string, profileName string) (result ExperimentListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ExperimentsClient.ListByProfile") + defer func() { + sc := -1 + if result.el.Response.Response != nil { + sc = result.el.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}, + {TargetValue: profileName, + Constraints: []validation.Constraint{{Target: "profileName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("frontdoor.ExperimentsClient", "ListByProfile", err.Error()) + } + + result.fn = client.listByProfileNextResults + req, err := client.ListByProfilePreparer(ctx, resourceGroupName, profileName) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.ExperimentsClient", "ListByProfile", nil, "Failure preparing request") + return + } + + resp, err := client.ListByProfileSender(req) + if err != nil { + result.el.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "frontdoor.ExperimentsClient", "ListByProfile", resp, "Failure sending request") + return + } + + result.el, err = client.ListByProfileResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.ExperimentsClient", "ListByProfile", resp, "Failure responding to request") + } + + return +} + +// ListByProfilePreparer prepares the ListByProfile request. +func (client ExperimentsClient) ListByProfilePreparer(ctx context.Context, resourceGroupName string, profileName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "profileName": autorest.Encode("path", profileName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/NetworkExperimentProfiles/{profileName}/Experiments", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByProfileSender sends the ListByProfile request. The method will close the +// http.Response Body if it receives an error. +func (client ExperimentsClient) ListByProfileSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListByProfileResponder handles the response to the ListByProfile request. The method always +// closes the http.Response Body. +func (client ExperimentsClient) ListByProfileResponder(resp *http.Response) (result ExperimentList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByProfileNextResults retrieves the next set of results, if any. +func (client ExperimentsClient) listByProfileNextResults(ctx context.Context, lastResults ExperimentList) (result ExperimentList, err error) { + req, err := lastResults.experimentListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "frontdoor.ExperimentsClient", "listByProfileNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByProfileSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "frontdoor.ExperimentsClient", "listByProfileNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByProfileResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.ExperimentsClient", "listByProfileNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByProfileComplete enumerates all values, automatically crossing page boundaries as required. +func (client ExperimentsClient) ListByProfileComplete(ctx context.Context, resourceGroupName string, profileName string) (result ExperimentListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ExperimentsClient.ListByProfile") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByProfile(ctx, resourceGroupName, profileName) + return +} + +// Update updates an Experiment +// Parameters: +// resourceGroupName - name of the Resource group within the Azure subscription. +// profileName - the Profile identifier associated with the Tenant and Partner +// experimentName - the Experiment identifier associated with the Experiment +// parameters - the Experiment Update Model +func (client ExperimentsClient) Update(ctx context.Context, resourceGroupName string, profileName string, experimentName string, parameters ExperimentUpdateModel) (result ExperimentsUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ExperimentsClient.Update") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}, + {TargetValue: profileName, + Constraints: []validation.Constraint{{Target: "profileName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}, + {TargetValue: experimentName, + Constraints: []validation.Constraint{{Target: "experimentName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("frontdoor.ExperimentsClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, profileName, experimentName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.ExperimentsClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.ExperimentsClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client ExperimentsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, profileName string, experimentName string, parameters ExperimentUpdateModel) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "experimentName": autorest.Encode("path", experimentName), + "profileName": autorest.Encode("path", profileName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/NetworkExperimentProfiles/{profileName}/Experiments/{experimentName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client ExperimentsClient) UpdateSender(req *http.Request) (future ExperimentsUpdateFuture, err error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, sd...) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client ExperimentsClient) UpdateResponder(resp *http.Response) (result Experiment, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2019-04-01/frontdoor/frontdoors.go b/vendor/github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2019-11-01/frontdoor/frontdoors.go similarity index 98% rename from vendor/github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2019-04-01/frontdoor/frontdoors.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2019-11-01/frontdoor/frontdoors.go index 6c1133caf17e..8c62d42cfafe 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2019-04-01/frontdoor/frontdoors.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2019-11-01/frontdoor/frontdoors.go @@ -36,7 +36,8 @@ func NewFrontDoorsClient(subscriptionID string) FrontDoorsClient { return NewFrontDoorsClientWithBaseURI(DefaultBaseURI, subscriptionID) } -// NewFrontDoorsClientWithBaseURI creates an instance of the FrontDoorsClient client. +// NewFrontDoorsClientWithBaseURI creates an instance of the FrontDoorsClient client using a custom endpoint. Use this +// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). func NewFrontDoorsClientWithBaseURI(baseURI string, subscriptionID string) FrontDoorsClient { return FrontDoorsClient{NewWithBaseURI(baseURI, subscriptionID)} } @@ -92,7 +93,7 @@ func (client FrontDoorsClient) CreateOrUpdatePreparer(ctx context.Context, resou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-04-01" + const APIVersion = "2019-05-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -183,7 +184,7 @@ func (client FrontDoorsClient) DeletePreparer(ctx context.Context, resourceGroup "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-04-01" + const APIVersion = "2019-05-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -277,7 +278,7 @@ func (client FrontDoorsClient) GetPreparer(ctx context.Context, resourceGroupNam "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-04-01" + const APIVersion = "2019-05-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -350,7 +351,7 @@ func (client FrontDoorsClient) ListPreparer(ctx context.Context) (*http.Request, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-04-01" + const APIVersion = "2019-05-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -471,7 +472,7 @@ func (client FrontDoorsClient) ListByResourceGroupPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-04-01" + const APIVersion = "2019-05-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -601,7 +602,7 @@ func (client FrontDoorsClient) ValidateCustomDomainPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-04-01" + const APIVersion = "2019-05-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2019-04-01/frontdoor/frontendendpoints.go b/vendor/github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2019-11-01/frontdoor/frontendendpoints.go similarity index 97% rename from vendor/github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2019-04-01/frontdoor/frontendendpoints.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2019-11-01/frontdoor/frontendendpoints.go index c05303c37ea4..f1e0d59f0b8a 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2019-04-01/frontdoor/frontendendpoints.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2019-11-01/frontdoor/frontendendpoints.go @@ -36,7 +36,9 @@ func NewFrontendEndpointsClient(subscriptionID string) FrontendEndpointsClient { return NewFrontendEndpointsClientWithBaseURI(DefaultBaseURI, subscriptionID) } -// NewFrontendEndpointsClientWithBaseURI creates an instance of the FrontendEndpointsClient client. +// NewFrontendEndpointsClientWithBaseURI creates an instance of the FrontendEndpointsClient client using a custom +// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure +// stack). func NewFrontendEndpointsClientWithBaseURI(baseURI string, subscriptionID string) FrontendEndpointsClient { return FrontendEndpointsClient{NewWithBaseURI(baseURI, subscriptionID)} } @@ -97,7 +99,7 @@ func (client FrontendEndpointsClient) DisableHTTPSPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-04-01" + const APIVersion = "2019-05-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -164,7 +166,9 @@ func (client FrontendEndpointsClient) EnableHTTPS(ctx context.Context, resourceG {TargetValue: frontendEndpointName, Constraints: []validation.Constraint{{Target: "frontendEndpointName", Name: validation.MaxLength, Rule: 255, Chain: nil}, {Target: "frontendEndpointName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "frontendEndpointName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$`, Chain: nil}}}}); err != nil { + {Target: "frontendEndpointName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$`, Chain: nil}}}, + {TargetValue: customHTTPSConfiguration, + Constraints: []validation.Constraint{{Target: "customHTTPSConfiguration.ProtocolType", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { return result, validation.NewError("frontdoor.FrontendEndpointsClient", "EnableHTTPS", err.Error()) } @@ -192,7 +196,7 @@ func (client FrontendEndpointsClient) EnableHTTPSPreparer(ctx context.Context, r "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-04-01" + const APIVersion = "2019-05-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -294,7 +298,7 @@ func (client FrontendEndpointsClient) GetPreparer(ctx context.Context, resourceG "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-04-01" + const APIVersion = "2019-05-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -384,7 +388,7 @@ func (client FrontendEndpointsClient) ListByFrontDoorPreparer(ctx context.Contex "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-04-01" + const APIVersion = "2019-05-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2019-04-01/frontdoor/managedrulesets.go b/vendor/github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2019-11-01/frontdoor/managedrulesets.go similarity index 96% rename from vendor/github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2019-04-01/frontdoor/managedrulesets.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2019-11-01/frontdoor/managedrulesets.go index 131f3c52f5ef..637e557fd374 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2019-04-01/frontdoor/managedrulesets.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2019-11-01/frontdoor/managedrulesets.go @@ -35,7 +35,8 @@ func NewManagedRuleSetsClient(subscriptionID string) ManagedRuleSetsClient { return NewManagedRuleSetsClientWithBaseURI(DefaultBaseURI, subscriptionID) } -// NewManagedRuleSetsClientWithBaseURI creates an instance of the ManagedRuleSetsClient client. +// NewManagedRuleSetsClientWithBaseURI creates an instance of the ManagedRuleSetsClient client using a custom endpoint. +// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). func NewManagedRuleSetsClientWithBaseURI(baseURI string, subscriptionID string) ManagedRuleSetsClient { return ManagedRuleSetsClient{NewWithBaseURI(baseURI, subscriptionID)} } @@ -80,7 +81,7 @@ func (client ManagedRuleSetsClient) ListPreparer(ctx context.Context) (*http.Req "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-10-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2019-04-01/frontdoor/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2019-11-01/frontdoor/models.go similarity index 66% rename from vendor/github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2019-04-01/frontdoor/models.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2019-11-01/frontdoor/models.go index 75a2835240ef..8003b5aa9343 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2019-04-01/frontdoor/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2019-11-01/frontdoor/models.go @@ -22,13 +22,14 @@ import ( "encoding/json" "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/date" "github.com/Azure/go-autorest/autorest/to" "github.com/Azure/go-autorest/tracing" "net/http" ) // The package's fully qualified name. -const fqdn = "github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2019-04-01/frontdoor" +const fqdn = "github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2019-11-01/frontdoor" // ActionType enumerates the values for action type. type ActionType string @@ -49,6 +50,21 @@ func PossibleActionTypeValues() []ActionType { return []ActionType{Allow, Block, Log, Redirect} } +// AggregationInterval enumerates the values for aggregation interval. +type AggregationInterval string + +const ( + // Daily ... + Daily AggregationInterval = "Daily" + // Hourly ... + Hourly AggregationInterval = "Hourly" +) + +// PossibleAggregationIntervalValues returns an array of possible values for the AggregationInterval const type. +func PossibleAggregationIntervalValues() []AggregationInterval { + return []AggregationInterval{Daily, Hourly} +} + // Availability enumerates the values for availability. type Availability string @@ -204,6 +220,25 @@ func PossibleEnabledStateValues() []EnabledState { return []EnabledState{EnabledStateDisabled, EnabledStateEnabled} } +// EndpointType enumerates the values for endpoint type. +type EndpointType string + +const ( + // AFD ... + AFD EndpointType = "AFD" + // ATM ... + ATM EndpointType = "ATM" + // AzureRegion ... + AzureRegion EndpointType = "AzureRegion" + // CDN ... + CDN EndpointType = "CDN" +) + +// PossibleEndpointTypeValues returns an array of possible values for the EndpointType const type. +func PossibleEndpointTypeValues() []EndpointType { + return []EndpointType{AFD, ATM, AzureRegion, CDN} +} + // EnforceCertificateNameCheckEnabledState enumerates the values for enforce certificate name check enabled // state. type EnforceCertificateNameCheckEnabledState string @@ -237,6 +272,53 @@ func PossibleForwardingProtocolValues() []ForwardingProtocol { return []ForwardingProtocol{HTTPOnly, HTTPSOnly, MatchRequest} } +// HealthProbeEnabled enumerates the values for health probe enabled. +type HealthProbeEnabled string + +const ( + // HealthProbeEnabledDisabled ... + HealthProbeEnabledDisabled HealthProbeEnabled = "Disabled" + // HealthProbeEnabledEnabled ... + HealthProbeEnabledEnabled HealthProbeEnabled = "Enabled" +) + +// PossibleHealthProbeEnabledValues returns an array of possible values for the HealthProbeEnabled const type. +func PossibleHealthProbeEnabledValues() []HealthProbeEnabled { + return []HealthProbeEnabled{HealthProbeEnabledDisabled, HealthProbeEnabledEnabled} +} + +// HealthProbeMethod enumerates the values for health probe method. +type HealthProbeMethod string + +const ( + // GET ... + GET HealthProbeMethod = "GET" + // HEAD ... + HEAD HealthProbeMethod = "HEAD" +) + +// PossibleHealthProbeMethodValues returns an array of possible values for the HealthProbeMethod const type. +func PossibleHealthProbeMethodValues() []HealthProbeMethod { + return []HealthProbeMethod{GET, HEAD} +} + +// LatencyScorecardAggregationInterval enumerates the values for latency scorecard aggregation interval. +type LatencyScorecardAggregationInterval string + +const ( + // LatencyScorecardAggregationIntervalDaily ... + LatencyScorecardAggregationIntervalDaily LatencyScorecardAggregationInterval = "Daily" + // LatencyScorecardAggregationIntervalMonthly ... + LatencyScorecardAggregationIntervalMonthly LatencyScorecardAggregationInterval = "Monthly" + // LatencyScorecardAggregationIntervalWeekly ... + LatencyScorecardAggregationIntervalWeekly LatencyScorecardAggregationInterval = "Weekly" +) + +// PossibleLatencyScorecardAggregationIntervalValues returns an array of possible values for the LatencyScorecardAggregationInterval const type. +func PossibleLatencyScorecardAggregationIntervalValues() []LatencyScorecardAggregationInterval { + return []LatencyScorecardAggregationInterval{LatencyScorecardAggregationIntervalDaily, LatencyScorecardAggregationIntervalMonthly, LatencyScorecardAggregationIntervalWeekly} +} + // ManagedRuleEnabledState enumerates the values for managed rule enabled state. type ManagedRuleEnabledState string @@ -252,6 +334,47 @@ func PossibleManagedRuleEnabledStateValues() []ManagedRuleEnabledState { return []ManagedRuleEnabledState{ManagedRuleEnabledStateDisabled, ManagedRuleEnabledStateEnabled} } +// ManagedRuleExclusionMatchVariable enumerates the values for managed rule exclusion match variable. +type ManagedRuleExclusionMatchVariable string + +const ( + // QueryStringArgNames ... + QueryStringArgNames ManagedRuleExclusionMatchVariable = "QueryStringArgNames" + // RequestBodyPostArgNames ... + RequestBodyPostArgNames ManagedRuleExclusionMatchVariable = "RequestBodyPostArgNames" + // RequestCookieNames ... + RequestCookieNames ManagedRuleExclusionMatchVariable = "RequestCookieNames" + // RequestHeaderNames ... + RequestHeaderNames ManagedRuleExclusionMatchVariable = "RequestHeaderNames" +) + +// PossibleManagedRuleExclusionMatchVariableValues returns an array of possible values for the ManagedRuleExclusionMatchVariable const type. +func PossibleManagedRuleExclusionMatchVariableValues() []ManagedRuleExclusionMatchVariable { + return []ManagedRuleExclusionMatchVariable{QueryStringArgNames, RequestBodyPostArgNames, RequestCookieNames, RequestHeaderNames} +} + +// ManagedRuleExclusionSelectorMatchOperator enumerates the values for managed rule exclusion selector match +// operator. +type ManagedRuleExclusionSelectorMatchOperator string + +const ( + // Contains ... + Contains ManagedRuleExclusionSelectorMatchOperator = "Contains" + // EndsWith ... + EndsWith ManagedRuleExclusionSelectorMatchOperator = "EndsWith" + // Equals ... + Equals ManagedRuleExclusionSelectorMatchOperator = "Equals" + // EqualsAny ... + EqualsAny ManagedRuleExclusionSelectorMatchOperator = "EqualsAny" + // StartsWith ... + StartsWith ManagedRuleExclusionSelectorMatchOperator = "StartsWith" +) + +// PossibleManagedRuleExclusionSelectorMatchOperatorValues returns an array of possible values for the ManagedRuleExclusionSelectorMatchOperator const type. +func PossibleManagedRuleExclusionSelectorMatchOperatorValues() []ManagedRuleExclusionSelectorMatchOperator { + return []ManagedRuleExclusionSelectorMatchOperator{Contains, EndsWith, Equals, EqualsAny, StartsWith} +} + // MatchVariable enumerates the values for match variable. type MatchVariable string @@ -281,6 +404,44 @@ func PossibleMatchVariableValues() []MatchVariable { return []MatchVariable{Cookies, PostArgs, QueryString, RemoteAddr, RequestBody, RequestHeader, RequestMethod, RequestURI, SocketAddr} } +// MinimumTLSVersion enumerates the values for minimum tls version. +type MinimumTLSVersion string + +const ( + // OneFullStopTwo ... + OneFullStopTwo MinimumTLSVersion = "1.2" + // OneFullStopZero ... + OneFullStopZero MinimumTLSVersion = "1.0" +) + +// PossibleMinimumTLSVersionValues returns an array of possible values for the MinimumTLSVersion const type. +func PossibleMinimumTLSVersionValues() []MinimumTLSVersion { + return []MinimumTLSVersion{OneFullStopTwo, OneFullStopZero} +} + +// NetworkExperimentResourceState enumerates the values for network experiment resource state. +type NetworkExperimentResourceState string + +const ( + // NetworkExperimentResourceStateCreating ... + NetworkExperimentResourceStateCreating NetworkExperimentResourceState = "Creating" + // NetworkExperimentResourceStateDeleting ... + NetworkExperimentResourceStateDeleting NetworkExperimentResourceState = "Deleting" + // NetworkExperimentResourceStateDisabled ... + NetworkExperimentResourceStateDisabled NetworkExperimentResourceState = "Disabled" + // NetworkExperimentResourceStateDisabling ... + NetworkExperimentResourceStateDisabling NetworkExperimentResourceState = "Disabling" + // NetworkExperimentResourceStateEnabled ... + NetworkExperimentResourceStateEnabled NetworkExperimentResourceState = "Enabled" + // NetworkExperimentResourceStateEnabling ... + NetworkExperimentResourceStateEnabling NetworkExperimentResourceState = "Enabling" +) + +// PossibleNetworkExperimentResourceStateValues returns an array of possible values for the NetworkExperimentResourceState const type. +func PossibleNetworkExperimentResourceStateValues() []NetworkExperimentResourceState { + return []NetworkExperimentResourceState{NetworkExperimentResourceStateCreating, NetworkExperimentResourceStateDeleting, NetworkExperimentResourceStateDisabled, NetworkExperimentResourceStateDisabling, NetworkExperimentResourceStateEnabled, NetworkExperimentResourceStateEnabling} +} + // NetworkOperationStatus enumerates the values for network operation status. type NetworkOperationStatus string @@ -319,35 +480,35 @@ func PossibleOdataTypeValues() []OdataType { type Operator string const ( - // Any ... - Any Operator = "Any" - // BeginsWith ... - BeginsWith Operator = "BeginsWith" - // Contains ... - Contains Operator = "Contains" - // EndsWith ... - EndsWith Operator = "EndsWith" - // Equal ... - Equal Operator = "Equal" - // GeoMatch ... - GeoMatch Operator = "GeoMatch" - // GreaterThan ... - GreaterThan Operator = "GreaterThan" - // GreaterThanOrEqual ... - GreaterThanOrEqual Operator = "GreaterThanOrEqual" - // IPMatch ... - IPMatch Operator = "IPMatch" - // LessThan ... - LessThan Operator = "LessThan" - // LessThanOrEqual ... - LessThanOrEqual Operator = "LessThanOrEqual" - // RegEx ... - RegEx Operator = "RegEx" + // OperatorAny ... + OperatorAny Operator = "Any" + // OperatorBeginsWith ... + OperatorBeginsWith Operator = "BeginsWith" + // OperatorContains ... + OperatorContains Operator = "Contains" + // OperatorEndsWith ... + OperatorEndsWith Operator = "EndsWith" + // OperatorEqual ... + OperatorEqual Operator = "Equal" + // OperatorGeoMatch ... + OperatorGeoMatch Operator = "GeoMatch" + // OperatorGreaterThan ... + OperatorGreaterThan Operator = "GreaterThan" + // OperatorGreaterThanOrEqual ... + OperatorGreaterThanOrEqual Operator = "GreaterThanOrEqual" + // OperatorIPMatch ... + OperatorIPMatch Operator = "IPMatch" + // OperatorLessThan ... + OperatorLessThan Operator = "LessThan" + // OperatorLessThanOrEqual ... + OperatorLessThanOrEqual Operator = "LessThanOrEqual" + // OperatorRegEx ... + OperatorRegEx Operator = "RegEx" ) // PossibleOperatorValues returns an array of possible values for the Operator const type. func PossibleOperatorValues() []Operator { - return []Operator{Any, BeginsWith, Contains, EndsWith, Equal, GeoMatch, GreaterThan, GreaterThanOrEqual, IPMatch, LessThan, LessThanOrEqual, RegEx} + return []Operator{OperatorAny, OperatorBeginsWith, OperatorContains, OperatorEndsWith, OperatorEqual, OperatorGeoMatch, OperatorGreaterThan, OperatorGreaterThanOrEqual, OperatorIPMatch, OperatorLessThan, OperatorLessThanOrEqual, OperatorRegEx} } // PolicyEnabledState enumerates the values for policy enabled state. @@ -552,17 +713,53 @@ func PossibleSessionAffinityEnabledStateValues() []SessionAffinityEnabledState { return []SessionAffinityEnabledState{SessionAffinityEnabledStateDisabled, SessionAffinityEnabledStateEnabled} } -// TLSProtocolType enumerates the values for tls protocol type. -type TLSProtocolType string +// State enumerates the values for state. +type State string + +const ( + // StateDisabled ... + StateDisabled State = "Disabled" + // StateEnabled ... + StateEnabled State = "Enabled" +) + +// PossibleStateValues returns an array of possible values for the State const type. +func PossibleStateValues() []State { + return []State{StateDisabled, StateEnabled} +} + +// TimeseriesAggregationInterval enumerates the values for timeseries aggregation interval. +type TimeseriesAggregationInterval string const ( - // ServerNameIndication ... - ServerNameIndication TLSProtocolType = "ServerNameIndication" + // TimeseriesAggregationIntervalDaily ... + TimeseriesAggregationIntervalDaily TimeseriesAggregationInterval = "Daily" + // TimeseriesAggregationIntervalHourly ... + TimeseriesAggregationIntervalHourly TimeseriesAggregationInterval = "Hourly" ) -// PossibleTLSProtocolTypeValues returns an array of possible values for the TLSProtocolType const type. -func PossibleTLSProtocolTypeValues() []TLSProtocolType { - return []TLSProtocolType{ServerNameIndication} +// PossibleTimeseriesAggregationIntervalValues returns an array of possible values for the TimeseriesAggregationInterval const type. +func PossibleTimeseriesAggregationIntervalValues() []TimeseriesAggregationInterval { + return []TimeseriesAggregationInterval{TimeseriesAggregationIntervalDaily, TimeseriesAggregationIntervalHourly} +} + +// TimeseriesType enumerates the values for timeseries type. +type TimeseriesType string + +const ( + // LatencyP50 ... + LatencyP50 TimeseriesType = "LatencyP50" + // LatencyP75 ... + LatencyP75 TimeseriesType = "LatencyP75" + // LatencyP95 ... + LatencyP95 TimeseriesType = "LatencyP95" + // MeasurementCounts ... + MeasurementCounts TimeseriesType = "MeasurementCounts" +) + +// PossibleTimeseriesTypeValues returns an array of possible values for the TimeseriesType const type. +func PossibleTimeseriesTypeValues() []TimeseriesType { + return []TimeseriesType{LatencyP50, LatencyP75, LatencyP95, MeasurementCounts} } // TransformType enumerates the values for transform type. @@ -721,6 +918,8 @@ type BackendPoolProperties struct { type BackendPoolsSettings struct { // EnforceCertificateNameCheck - Whether to enforce certificate name check on HTTPS requests to all backend pools. No effect on non-HTTPS requests. Possible values include: 'EnforceCertificateNameCheckEnabledStateEnabled', 'EnforceCertificateNameCheckEnabledStateDisabled' EnforceCertificateNameCheck EnforceCertificateNameCheckEnabledState `json:"enforceCertificateNameCheck,omitempty"` + // SendRecvTimeoutSeconds - Send and receive timeout on forwarding request to the backend. When timeout is reached, the request fails and returns. + SendRecvTimeoutSeconds *int32 `json:"sendRecvTimeoutSeconds,omitempty"` } // BackendPoolUpdateParameters a collection of backends that can be routed to. @@ -771,8 +970,10 @@ type CheckNameAvailabilityOutput struct { type CustomHTTPSConfiguration struct { // CertificateSource - Defines the source of the SSL certificate. Possible values include: 'CertificateSourceAzureKeyVault', 'CertificateSourceFrontDoor' CertificateSource CertificateSource `json:"certificateSource,omitempty"` - // ProtocolType - Defines the TLS extension protocol that is used for secure delivery. Possible values include: 'ServerNameIndication' - ProtocolType TLSProtocolType `json:"protocolType,omitempty"` + // ProtocolType - Defines the TLS extension protocol that is used for secure delivery + ProtocolType *string `json:"protocolType,omitempty"` + // MinimumTLSVersion - The minimum TLS version required from the clients to establish an SSL handshake with Front Door. Possible values include: 'OneFullStopZero', 'OneFullStopTwo' + MinimumTLSVersion MinimumTLSVersion `json:"minimumTlsVersion,omitempty"` // KeyVaultCertificateSourceParameters - KeyVault certificate source parameters (if certificateSource=AzureKeyVault) *KeyVaultCertificateSourceParameters `json:"keyVaultCertificateSourceParameters,omitempty"` // CertificateSourceParameters - Parameters required for enabling SSL with Front Door-managed certificates (if certificateSource=FrontDoor) @@ -785,9 +986,12 @@ func (chc CustomHTTPSConfiguration) MarshalJSON() ([]byte, error) { if chc.CertificateSource != "" { objectMap["certificateSource"] = chc.CertificateSource } - if chc.ProtocolType != "" { + if chc.ProtocolType != nil { objectMap["protocolType"] = chc.ProtocolType } + if chc.MinimumTLSVersion != "" { + objectMap["minimumTlsVersion"] = chc.MinimumTLSVersion + } if chc.KeyVaultCertificateSourceParameters != nil { objectMap["keyVaultCertificateSourceParameters"] = chc.KeyVaultCertificateSourceParameters } @@ -817,12 +1021,21 @@ func (chc *CustomHTTPSConfiguration) UnmarshalJSON(body []byte) error { } case "protocolType": if v != nil { - var protocolType TLSProtocolType + var protocolType string err = json.Unmarshal(*v, &protocolType) if err != nil { return err } - chc.ProtocolType = protocolType + chc.ProtocolType = &protocolType + } + case "minimumTlsVersion": + if v != nil { + var minimumTLSVersion MinimumTLSVersion + err = json.Unmarshal(*v, &minimumTLSVersion) + if err != nil { + return err + } + chc.MinimumTLSVersion = minimumTLSVersion } case "keyVaultCertificateSourceParameters": if v != nil { @@ -874,6 +1087,14 @@ type CustomRuleList struct { Rules *[]CustomRule `json:"rules,omitempty"` } +// Endpoint defines the endpoint properties +type Endpoint struct { + // Name - The name of the endpoint + Name *string `json:"name,omitempty"` + // Endpoint - The endpoint URL + Endpoint *string `json:"endpoint,omitempty"` +} + // EndpointsPurgeContentFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type EndpointsPurgeContentFuture struct { @@ -922,68 +1143,11 @@ type ErrorResponse struct { Message *string `json:"message,omitempty"` } -// ForwardingConfiguration describes Forwarding Route. -type ForwardingConfiguration struct { - // CustomForwardingPath - A custom path used to rewrite resource paths matched by this rule. Leave empty to use incoming path. - CustomForwardingPath *string `json:"customForwardingPath,omitempty"` - // ForwardingProtocol - Protocol this rule will use when forwarding traffic to backends. Possible values include: 'HTTPOnly', 'HTTPSOnly', 'MatchRequest' - ForwardingProtocol ForwardingProtocol `json:"forwardingProtocol,omitempty"` - // CacheConfiguration - The caching configuration associated with this rule. - CacheConfiguration *CacheConfiguration `json:"cacheConfiguration,omitempty"` - // BackendPool - A reference to the BackendPool which this rule routes to. - BackendPool *SubResource `json:"backendPool,omitempty"` - // OdataType - Possible values include: 'OdataTypeRouteConfiguration', 'OdataTypeMicrosoftAzureFrontDoorModelsFrontdoorForwardingConfiguration', 'OdataTypeMicrosoftAzureFrontDoorModelsFrontdoorRedirectConfiguration' - OdataType OdataType `json:"@odata.type,omitempty"` -} - -// MarshalJSON is the custom marshaler for ForwardingConfiguration. -func (fc ForwardingConfiguration) MarshalJSON() ([]byte, error) { - fc.OdataType = OdataTypeMicrosoftAzureFrontDoorModelsFrontdoorForwardingConfiguration - objectMap := make(map[string]interface{}) - if fc.CustomForwardingPath != nil { - objectMap["customForwardingPath"] = fc.CustomForwardingPath - } - if fc.ForwardingProtocol != "" { - objectMap["forwardingProtocol"] = fc.ForwardingProtocol - } - if fc.CacheConfiguration != nil { - objectMap["cacheConfiguration"] = fc.CacheConfiguration - } - if fc.BackendPool != nil { - objectMap["backendPool"] = fc.BackendPool - } - if fc.OdataType != "" { - objectMap["@odata.type"] = fc.OdataType - } - return json.Marshal(objectMap) -} - -// AsForwardingConfiguration is the BasicRouteConfiguration implementation for ForwardingConfiguration. -func (fc ForwardingConfiguration) AsForwardingConfiguration() (*ForwardingConfiguration, bool) { - return &fc, true -} - -// AsRedirectConfiguration is the BasicRouteConfiguration implementation for ForwardingConfiguration. -func (fc ForwardingConfiguration) AsRedirectConfiguration() (*RedirectConfiguration, bool) { - return nil, false -} - -// AsRouteConfiguration is the BasicRouteConfiguration implementation for ForwardingConfiguration. -func (fc ForwardingConfiguration) AsRouteConfiguration() (*RouteConfiguration, bool) { - return nil, false -} - -// AsBasicRouteConfiguration is the BasicRouteConfiguration implementation for ForwardingConfiguration. -func (fc ForwardingConfiguration) AsBasicRouteConfiguration() (BasicRouteConfiguration, bool) { - return &fc, true -} - -// FrontDoor front Door represents a collection of backend endpoints to route traffic to along with rules -// that specify how traffic is sent there. -type FrontDoor struct { +// Experiment defines the properties of an Experiment +type Experiment struct { autorest.Response `json:"-"` - // Properties - Properties of the Front Door Load Balancer - *Properties `json:"properties,omitempty"` + // ExperimentProperties - The properties of an Experiment + *ExperimentProperties `json:"properties,omitempty"` // ID - READ-ONLY; Resource ID. ID *string `json:"id,omitempty"` // Name - READ-ONLY; Resource name. @@ -996,23 +1160,23 @@ type FrontDoor struct { Tags map[string]*string `json:"tags"` } -// MarshalJSON is the custom marshaler for FrontDoor. -func (fd FrontDoor) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for Experiment. +func (e Experiment) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if fd.Properties != nil { - objectMap["properties"] = fd.Properties + if e.ExperimentProperties != nil { + objectMap["properties"] = e.ExperimentProperties } - if fd.Location != nil { - objectMap["location"] = fd.Location + if e.Location != nil { + objectMap["location"] = e.Location } - if fd.Tags != nil { - objectMap["tags"] = fd.Tags + if e.Tags != nil { + objectMap["tags"] = e.Tags } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for FrontDoor struct. -func (fd *FrontDoor) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for Experiment struct. +func (e *Experiment) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -1022,12 +1186,12 @@ func (fd *FrontDoor) UnmarshalJSON(body []byte) error { switch k { case "properties": if v != nil { - var properties Properties - err = json.Unmarshal(*v, &properties) + var experimentProperties ExperimentProperties + err = json.Unmarshal(*v, &experimentProperties) if err != nil { return err } - fd.Properties = &properties + e.ExperimentProperties = &experimentProperties } case "id": if v != nil { @@ -1036,7 +1200,7 @@ func (fd *FrontDoor) UnmarshalJSON(body []byte) error { if err != nil { return err } - fd.ID = &ID + e.ID = &ID } case "name": if v != nil { @@ -1045,7 +1209,7 @@ func (fd *FrontDoor) UnmarshalJSON(body []byte) error { if err != nil { return err } - fd.Name = &name + e.Name = &name } case "type": if v != nil { @@ -1054,7 +1218,7 @@ func (fd *FrontDoor) UnmarshalJSON(body []byte) error { if err != nil { return err } - fd.Type = &typeVar + e.Type = &typeVar } case "location": if v != nil { @@ -1063,7 +1227,7 @@ func (fd *FrontDoor) UnmarshalJSON(body []byte) error { if err != nil { return err } - fd.Location = &location + e.Location = &location } case "tags": if v != nil { @@ -1072,7 +1236,7 @@ func (fd *FrontDoor) UnmarshalJSON(body []byte) error { if err != nil { return err } - fd.Tags = tags + e.Tags = tags } } } @@ -1080,88 +1244,1478 @@ func (fd *FrontDoor) UnmarshalJSON(body []byte) error { return nil } -// FrontDoorsCreateOrUpdateFutureType an abstraction for monitoring and retrieving the results of a -// long-running operation. -type FrontDoorsCreateOrUpdateFutureType struct { - azure.Future +// ExperimentList defines a list of Experiments. It contains a list of Experiment objects and a URL link to +// get the next set of results. +type ExperimentList struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; List of Experiments within a resource group. + Value *[]Experiment `json:"value,omitempty"` + // NextLink - URL to get the next set of Experiment objects if there are any. + NextLink *string `json:"nextLink,omitempty"` } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *FrontDoorsCreateOrUpdateFutureType) Result(client FrontDoorsClient) (fd FrontDoor, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.FrontDoorsCreateOrUpdateFutureType", "Result", future.Response(), "Polling failure") - return +// ExperimentListIterator provides access to a complete listing of Experiment values. +type ExperimentListIterator struct { + i int + page ExperimentListPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ExperimentListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ExperimentListIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() } - if !done { - err = azure.NewAsyncOpIncompleteError("frontdoor.FrontDoorsCreateOrUpdateFutureType") - return + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if fd.Response.Response, err = future.GetResult(sender); err == nil && fd.Response.Response.StatusCode != http.StatusNoContent { - fd, err = client.CreateOrUpdateResponder(fd.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.FrontDoorsCreateOrUpdateFutureType", "Result", fd.Response.Response, "Failure responding to request") - } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err } - return + iter.i = 0 + return nil } -// FrontDoorsDeleteFutureType an abstraction for monitoring and retrieving the results of a long-running -// operation. -type FrontDoorsDeleteFutureType struct { - azure.Future +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ExperimentListIterator) Next() error { + return iter.NextWithContext(context.Background()) } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *FrontDoorsDeleteFutureType) Result(client FrontDoorsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.FrontDoorsDeleteFutureType", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("frontdoor.FrontDoorsDeleteFutureType") - return - } - ar.Response = future.Response() - return +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ExperimentListIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) } -// FrontendEndpoint a frontend endpoint used for routing. -type FrontendEndpoint struct { - autorest.Response `json:"-"` - // FrontendEndpointProperties - Properties of the Frontend endpoint - *FrontendEndpointProperties `json:"properties,omitempty"` - // Name - Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` +// Response returns the raw server response from the last page request. +func (iter ExperimentListIterator) Response() ExperimentList { + return iter.page.Response() } -// MarshalJSON is the custom marshaler for FrontendEndpoint. -func (fe FrontendEndpoint) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if fe.FrontendEndpointProperties != nil { - objectMap["properties"] = fe.FrontendEndpointProperties - } - if fe.Name != nil { - objectMap["name"] = fe.Name - } - if fe.ID != nil { - objectMap["id"] = fe.ID +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ExperimentListIterator) Value() Experiment { + if !iter.page.NotDone() { + return Experiment{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ExperimentListIterator type. +func NewExperimentListIterator(page ExperimentListPage) ExperimentListIterator { + return ExperimentListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (el ExperimentList) IsEmpty() bool { + return el.Value == nil || len(*el.Value) == 0 +} + +// experimentListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (el ExperimentList) experimentListPreparer(ctx context.Context) (*http.Request, error) { + if el.NextLink == nil || len(to.String(el.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(el.NextLink))) +} + +// ExperimentListPage contains a page of Experiment values. +type ExperimentListPage struct { + fn func(context.Context, ExperimentList) (ExperimentList, error) + el ExperimentList +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ExperimentListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ExperimentListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.el) + if err != nil { + return err + } + page.el = next + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *ExperimentListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ExperimentListPage) NotDone() bool { + return !page.el.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ExperimentListPage) Response() ExperimentList { + return page.el +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ExperimentListPage) Values() []Experiment { + if page.el.IsEmpty() { + return nil + } + return *page.el.Value +} + +// Creates a new instance of the ExperimentListPage type. +func NewExperimentListPage(getNextPage func(context.Context, ExperimentList) (ExperimentList, error)) ExperimentListPage { + return ExperimentListPage{fn: getNextPage} +} + +// ExperimentProperties defines the properties of an experiment +type ExperimentProperties struct { + // Description - The description of the details or intents of the Experiment + Description *string `json:"description,omitempty"` + // EndpointA - The endpoint A of an experiment + EndpointA *Endpoint `json:"endpointA,omitempty"` + // EndpointB - The endpoint B of an experiment + EndpointB *Endpoint `json:"endpointB,omitempty"` + // EnabledState - The state of the Experiment. Possible values include: 'StateEnabled', 'StateDisabled' + EnabledState State `json:"enabledState,omitempty"` + // ResourceState - Resource status. Possible values include: 'NetworkExperimentResourceStateCreating', 'NetworkExperimentResourceStateEnabling', 'NetworkExperimentResourceStateEnabled', 'NetworkExperimentResourceStateDisabling', 'NetworkExperimentResourceStateDisabled', 'NetworkExperimentResourceStateDeleting' + ResourceState NetworkExperimentResourceState `json:"resourceState,omitempty"` + // Status - READ-ONLY; The description of Experiment status from the server side + Status *string `json:"status,omitempty"` + // ScriptFileURI - READ-ONLY; The uri to the Script used in the Experiment + ScriptFileURI *string `json:"scriptFileUri,omitempty"` +} + +// ExperimentsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ExperimentsCreateOrUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ExperimentsCreateOrUpdateFuture) Result(client ExperimentsClient) (e Experiment, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.ExperimentsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("frontdoor.ExperimentsCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if e.Response.Response, err = future.GetResult(sender); err == nil && e.Response.Response.StatusCode != http.StatusNoContent { + e, err = client.CreateOrUpdateResponder(e.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.ExperimentsCreateOrUpdateFuture", "Result", e.Response.Response, "Failure responding to request") + } + } + return +} + +// ExperimentsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ExperimentsDeleteFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ExperimentsDeleteFuture) Result(client ExperimentsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.ExperimentsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("frontdoor.ExperimentsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ExperimentsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ExperimentsUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ExperimentsUpdateFuture) Result(client ExperimentsClient) (e Experiment, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.ExperimentsUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("frontdoor.ExperimentsUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if e.Response.Response, err = future.GetResult(sender); err == nil && e.Response.Response.StatusCode != http.StatusNoContent { + e, err = client.UpdateResponder(e.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.ExperimentsUpdateFuture", "Result", e.Response.Response, "Failure responding to request") + } + } + return +} + +// ExperimentUpdateModel defines modifiable attributes of an Experiment +type ExperimentUpdateModel struct { + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // ExperimentUpdateProperties - The properties of a Profile + *ExperimentUpdateProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for ExperimentUpdateModel. +func (eum ExperimentUpdateModel) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if eum.Tags != nil { + objectMap["tags"] = eum.Tags + } + if eum.ExperimentUpdateProperties != nil { + objectMap["properties"] = eum.ExperimentUpdateProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ExperimentUpdateModel struct. +func (eum *ExperimentUpdateModel) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + eum.Tags = tags + } + case "properties": + if v != nil { + var experimentUpdateProperties ExperimentUpdateProperties + err = json.Unmarshal(*v, &experimentUpdateProperties) + if err != nil { + return err + } + eum.ExperimentUpdateProperties = &experimentUpdateProperties + } + } + } + + return nil +} + +// ExperimentUpdateProperties defines the properties of an experiment +type ExperimentUpdateProperties struct { + // Description - The description of the intent or details of the Experiment + Description *string `json:"description,omitempty"` + // EnabledState - The state of the Experiment. Possible values include: 'StateEnabled', 'StateDisabled' + EnabledState State `json:"enabledState,omitempty"` +} + +// ForwardingConfiguration describes Forwarding Route. +type ForwardingConfiguration struct { + // CustomForwardingPath - A custom path used to rewrite resource paths matched by this rule. Leave empty to use incoming path. + CustomForwardingPath *string `json:"customForwardingPath,omitempty"` + // ForwardingProtocol - Protocol this rule will use when forwarding traffic to backends. Possible values include: 'HTTPOnly', 'HTTPSOnly', 'MatchRequest' + ForwardingProtocol ForwardingProtocol `json:"forwardingProtocol,omitempty"` + // CacheConfiguration - The caching configuration associated with this rule. + CacheConfiguration *CacheConfiguration `json:"cacheConfiguration,omitempty"` + // BackendPool - A reference to the BackendPool which this rule routes to. + BackendPool *SubResource `json:"backendPool,omitempty"` + // OdataType - Possible values include: 'OdataTypeRouteConfiguration', 'OdataTypeMicrosoftAzureFrontDoorModelsFrontdoorForwardingConfiguration', 'OdataTypeMicrosoftAzureFrontDoorModelsFrontdoorRedirectConfiguration' + OdataType OdataType `json:"@odata.type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ForwardingConfiguration. +func (fc ForwardingConfiguration) MarshalJSON() ([]byte, error) { + fc.OdataType = OdataTypeMicrosoftAzureFrontDoorModelsFrontdoorForwardingConfiguration + objectMap := make(map[string]interface{}) + if fc.CustomForwardingPath != nil { + objectMap["customForwardingPath"] = fc.CustomForwardingPath + } + if fc.ForwardingProtocol != "" { + objectMap["forwardingProtocol"] = fc.ForwardingProtocol + } + if fc.CacheConfiguration != nil { + objectMap["cacheConfiguration"] = fc.CacheConfiguration + } + if fc.BackendPool != nil { + objectMap["backendPool"] = fc.BackendPool + } + if fc.OdataType != "" { + objectMap["@odata.type"] = fc.OdataType + } + return json.Marshal(objectMap) +} + +// AsForwardingConfiguration is the BasicRouteConfiguration implementation for ForwardingConfiguration. +func (fc ForwardingConfiguration) AsForwardingConfiguration() (*ForwardingConfiguration, bool) { + return &fc, true +} + +// AsRedirectConfiguration is the BasicRouteConfiguration implementation for ForwardingConfiguration. +func (fc ForwardingConfiguration) AsRedirectConfiguration() (*RedirectConfiguration, bool) { + return nil, false +} + +// AsRouteConfiguration is the BasicRouteConfiguration implementation for ForwardingConfiguration. +func (fc ForwardingConfiguration) AsRouteConfiguration() (*RouteConfiguration, bool) { + return nil, false +} + +// AsBasicRouteConfiguration is the BasicRouteConfiguration implementation for ForwardingConfiguration. +func (fc ForwardingConfiguration) AsBasicRouteConfiguration() (BasicRouteConfiguration, bool) { + return &fc, true +} + +// FrontDoor front Door represents a collection of backend endpoints to route traffic to along with rules +// that specify how traffic is sent there. +type FrontDoor struct { + autorest.Response `json:"-"` + // Properties - Properties of the Front Door Load Balancer + *Properties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource ID. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for FrontDoor. +func (fd FrontDoor) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if fd.Properties != nil { + objectMap["properties"] = fd.Properties + } + if fd.Location != nil { + objectMap["location"] = fd.Location + } + if fd.Tags != nil { + objectMap["tags"] = fd.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for FrontDoor struct. +func (fd *FrontDoor) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var properties Properties + err = json.Unmarshal(*v, &properties) + if err != nil { + return err + } + fd.Properties = &properties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + fd.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + fd.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + fd.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + fd.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + fd.Tags = tags + } + } + } + + return nil +} + +// FrontDoorsCreateOrUpdateFutureType an abstraction for monitoring and retrieving the results of a +// long-running operation. +type FrontDoorsCreateOrUpdateFutureType struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *FrontDoorsCreateOrUpdateFutureType) Result(client FrontDoorsClient) (fd FrontDoor, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.FrontDoorsCreateOrUpdateFutureType", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("frontdoor.FrontDoorsCreateOrUpdateFutureType") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if fd.Response.Response, err = future.GetResult(sender); err == nil && fd.Response.Response.StatusCode != http.StatusNoContent { + fd, err = client.CreateOrUpdateResponder(fd.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.FrontDoorsCreateOrUpdateFutureType", "Result", fd.Response.Response, "Failure responding to request") + } + } + return +} + +// FrontDoorsDeleteFutureType an abstraction for monitoring and retrieving the results of a long-running +// operation. +type FrontDoorsDeleteFutureType struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *FrontDoorsDeleteFutureType) Result(client FrontDoorsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.FrontDoorsDeleteFutureType", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("frontdoor.FrontDoorsDeleteFutureType") + return + } + ar.Response = future.Response() + return +} + +// FrontendEndpoint a frontend endpoint used for routing. +type FrontendEndpoint struct { + autorest.Response `json:"-"` + // FrontendEndpointProperties - Properties of the Frontend endpoint + *FrontendEndpointProperties `json:"properties,omitempty"` + // Name - Resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` +} + +// MarshalJSON is the custom marshaler for FrontendEndpoint. +func (fe FrontendEndpoint) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if fe.FrontendEndpointProperties != nil { + objectMap["properties"] = fe.FrontendEndpointProperties + } + if fe.Name != nil { + objectMap["name"] = fe.Name + } + if fe.ID != nil { + objectMap["id"] = fe.ID + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for FrontendEndpoint struct. +func (fe *FrontendEndpoint) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var frontendEndpointProperties FrontendEndpointProperties + err = json.Unmarshal(*v, &frontendEndpointProperties) + if err != nil { + return err + } + fe.FrontendEndpointProperties = &frontendEndpointProperties + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + fe.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + fe.Type = &typeVar + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + fe.ID = &ID + } + } + } + + return nil +} + +// FrontendEndpointLink defines the Resource ID for a Frontend Endpoint. +type FrontendEndpointLink struct { + // ID - Resource ID. + ID *string `json:"id,omitempty"` +} + +// FrontendEndpointProperties the JSON object that contains the properties required to create a frontend +// endpoint. +type FrontendEndpointProperties struct { + // ResourceState - Resource status. Possible values include: 'ResourceStateCreating', 'ResourceStateEnabling', 'ResourceStateEnabled', 'ResourceStateDisabling', 'ResourceStateDisabled', 'ResourceStateDeleting' + ResourceState ResourceState `json:"resourceState,omitempty"` + // CustomHTTPSProvisioningState - READ-ONLY; Provisioning status of Custom Https of the frontendEndpoint. Possible values include: 'CustomHTTPSProvisioningStateEnabling', 'CustomHTTPSProvisioningStateEnabled', 'CustomHTTPSProvisioningStateDisabling', 'CustomHTTPSProvisioningStateDisabled', 'CustomHTTPSProvisioningStateFailed' + CustomHTTPSProvisioningState CustomHTTPSProvisioningState `json:"customHttpsProvisioningState,omitempty"` + // CustomHTTPSProvisioningSubstate - READ-ONLY; Provisioning substate shows the progress of custom HTTPS enabling/disabling process step by step. Possible values include: 'SubmittingDomainControlValidationRequest', 'PendingDomainControlValidationREquestApproval', 'DomainControlValidationRequestApproved', 'DomainControlValidationRequestRejected', 'DomainControlValidationRequestTimedOut', 'IssuingCertificate', 'DeployingCertificate', 'CertificateDeployed', 'DeletingCertificate', 'CertificateDeleted' + CustomHTTPSProvisioningSubstate CustomHTTPSProvisioningSubstate `json:"customHttpsProvisioningSubstate,omitempty"` + // CustomHTTPSConfiguration - READ-ONLY; The configuration specifying how to enable HTTPS + CustomHTTPSConfiguration *CustomHTTPSConfiguration `json:"customHttpsConfiguration,omitempty"` + // HostName - The host name of the frontendEndpoint. Must be a domain name. + HostName *string `json:"hostName,omitempty"` + // SessionAffinityEnabledState - Whether to allow session affinity on this host. Valid options are 'Enabled' or 'Disabled'. Possible values include: 'SessionAffinityEnabledStateEnabled', 'SessionAffinityEnabledStateDisabled' + SessionAffinityEnabledState SessionAffinityEnabledState `json:"sessionAffinityEnabledState,omitempty"` + // SessionAffinityTTLSeconds - UNUSED. This field will be ignored. The TTL to use in seconds for session affinity, if applicable. + SessionAffinityTTLSeconds *int32 `json:"sessionAffinityTtlSeconds,omitempty"` + // WebApplicationFirewallPolicyLink - Defines the Web Application Firewall policy for each host (if applicable) + WebApplicationFirewallPolicyLink *FrontendEndpointUpdateParametersWebApplicationFirewallPolicyLink `json:"webApplicationFirewallPolicyLink,omitempty"` +} + +// FrontendEndpointsDisableHTTPSFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type FrontendEndpointsDisableHTTPSFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *FrontendEndpointsDisableHTTPSFuture) Result(client FrontendEndpointsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.FrontendEndpointsDisableHTTPSFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("frontdoor.FrontendEndpointsDisableHTTPSFuture") + return + } + ar.Response = future.Response() + return +} + +// FrontendEndpointsEnableHTTPSFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type FrontendEndpointsEnableHTTPSFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *FrontendEndpointsEnableHTTPSFuture) Result(client FrontendEndpointsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.FrontendEndpointsEnableHTTPSFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("frontdoor.FrontendEndpointsEnableHTTPSFuture") + return + } + ar.Response = future.Response() + return +} + +// FrontendEndpointsListResult result of the request to list frontend endpoints. It contains a list of +// Frontend endpoint objects and a URL link to get the next set of results. +type FrontendEndpointsListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; List of Frontend endpoints within a Front Door. + Value *[]FrontendEndpoint `json:"value,omitempty"` + // NextLink - URL to get the next set of frontend endpoints if there are any. + NextLink *string `json:"nextLink,omitempty"` +} + +// FrontendEndpointsListResultIterator provides access to a complete listing of FrontendEndpoint values. +type FrontendEndpointsListResultIterator struct { + i int + page FrontendEndpointsListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *FrontendEndpointsListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/FrontendEndpointsListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *FrontendEndpointsListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter FrontendEndpointsListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter FrontendEndpointsListResultIterator) Response() FrontendEndpointsListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter FrontendEndpointsListResultIterator) Value() FrontendEndpoint { + if !iter.page.NotDone() { + return FrontendEndpoint{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the FrontendEndpointsListResultIterator type. +func NewFrontendEndpointsListResultIterator(page FrontendEndpointsListResultPage) FrontendEndpointsListResultIterator { + return FrontendEndpointsListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (felr FrontendEndpointsListResult) IsEmpty() bool { + return felr.Value == nil || len(*felr.Value) == 0 +} + +// frontendEndpointsListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (felr FrontendEndpointsListResult) frontendEndpointsListResultPreparer(ctx context.Context) (*http.Request, error) { + if felr.NextLink == nil || len(to.String(felr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(felr.NextLink))) +} + +// FrontendEndpointsListResultPage contains a page of FrontendEndpoint values. +type FrontendEndpointsListResultPage struct { + fn func(context.Context, FrontendEndpointsListResult) (FrontendEndpointsListResult, error) + felr FrontendEndpointsListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *FrontendEndpointsListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/FrontendEndpointsListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.felr) + if err != nil { + return err + } + page.felr = next + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *FrontendEndpointsListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page FrontendEndpointsListResultPage) NotDone() bool { + return !page.felr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page FrontendEndpointsListResultPage) Response() FrontendEndpointsListResult { + return page.felr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page FrontendEndpointsListResultPage) Values() []FrontendEndpoint { + if page.felr.IsEmpty() { + return nil + } + return *page.felr.Value +} + +// Creates a new instance of the FrontendEndpointsListResultPage type. +func NewFrontendEndpointsListResultPage(getNextPage func(context.Context, FrontendEndpointsListResult) (FrontendEndpointsListResult, error)) FrontendEndpointsListResultPage { + return FrontendEndpointsListResultPage{fn: getNextPage} +} + +// FrontendEndpointUpdateParameters frontend endpoint used in routing rule +type FrontendEndpointUpdateParameters struct { + // HostName - The host name of the frontendEndpoint. Must be a domain name. + HostName *string `json:"hostName,omitempty"` + // SessionAffinityEnabledState - Whether to allow session affinity on this host. Valid options are 'Enabled' or 'Disabled'. Possible values include: 'SessionAffinityEnabledStateEnabled', 'SessionAffinityEnabledStateDisabled' + SessionAffinityEnabledState SessionAffinityEnabledState `json:"sessionAffinityEnabledState,omitempty"` + // SessionAffinityTTLSeconds - UNUSED. This field will be ignored. The TTL to use in seconds for session affinity, if applicable. + SessionAffinityTTLSeconds *int32 `json:"sessionAffinityTtlSeconds,omitempty"` + // WebApplicationFirewallPolicyLink - Defines the Web Application Firewall policy for each host (if applicable) + WebApplicationFirewallPolicyLink *FrontendEndpointUpdateParametersWebApplicationFirewallPolicyLink `json:"webApplicationFirewallPolicyLink,omitempty"` +} + +// FrontendEndpointUpdateParametersWebApplicationFirewallPolicyLink defines the Web Application Firewall +// policy for each host (if applicable) +type FrontendEndpointUpdateParametersWebApplicationFirewallPolicyLink struct { + // ID - Resource ID. + ID *string `json:"id,omitempty"` +} + +// HealthProbeSettingsListResult result of the request to list HealthProbeSettings. It contains a list of +// HealthProbeSettings objects and a URL link to get the next set of results. +type HealthProbeSettingsListResult struct { + // Value - READ-ONLY; List of HealthProbeSettings within a Front Door. + Value *[]HealthProbeSettingsModel `json:"value,omitempty"` + // NextLink - URL to get the next set of HealthProbeSettings objects if there are any. + NextLink *string `json:"nextLink,omitempty"` +} + +// HealthProbeSettingsModel load balancing settings for a backend pool +type HealthProbeSettingsModel struct { + // HealthProbeSettingsProperties - Properties of the health probe settings + *HealthProbeSettingsProperties `json:"properties,omitempty"` + // Name - Resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` +} + +// MarshalJSON is the custom marshaler for HealthProbeSettingsModel. +func (hpsm HealthProbeSettingsModel) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if hpsm.HealthProbeSettingsProperties != nil { + objectMap["properties"] = hpsm.HealthProbeSettingsProperties + } + if hpsm.Name != nil { + objectMap["name"] = hpsm.Name + } + if hpsm.ID != nil { + objectMap["id"] = hpsm.ID + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for HealthProbeSettingsModel struct. +func (hpsm *HealthProbeSettingsModel) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var healthProbeSettingsProperties HealthProbeSettingsProperties + err = json.Unmarshal(*v, &healthProbeSettingsProperties) + if err != nil { + return err + } + hpsm.HealthProbeSettingsProperties = &healthProbeSettingsProperties + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + hpsm.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + hpsm.Type = &typeVar + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + hpsm.ID = &ID + } + } + } + + return nil +} + +// HealthProbeSettingsProperties the JSON object that contains the properties required to create a health +// probe settings. +type HealthProbeSettingsProperties struct { + // ResourceState - Resource status. Possible values include: 'ResourceStateCreating', 'ResourceStateEnabling', 'ResourceStateEnabled', 'ResourceStateDisabling', 'ResourceStateDisabled', 'ResourceStateDeleting' + ResourceState ResourceState `json:"resourceState,omitempty"` + // Path - The path to use for the health probe. Default is / + Path *string `json:"path,omitempty"` + // Protocol - Protocol scheme to use for this probe. Possible values include: 'HTTP', 'HTTPS' + Protocol Protocol `json:"protocol,omitempty"` + // IntervalInSeconds - The number of seconds between health probes. + IntervalInSeconds *int32 `json:"intervalInSeconds,omitempty"` + // HealthProbeMethod - Configures which HTTP method to use to probe the backends defined under backendPools. Possible values include: 'GET', 'HEAD' + HealthProbeMethod HealthProbeMethod `json:"healthProbeMethod,omitempty"` + // EnabledState - Whether to enable health probes to be made against backends defined under backendPools. Health probes can only be disabled if there is a single enabled backend in single enabled backend pool. Possible values include: 'HealthProbeEnabledEnabled', 'HealthProbeEnabledDisabled' + EnabledState HealthProbeEnabled `json:"enabledState,omitempty"` +} + +// HealthProbeSettingsUpdateParameters l7 health probe settings for a backend pool +type HealthProbeSettingsUpdateParameters struct { + // Path - The path to use for the health probe. Default is / + Path *string `json:"path,omitempty"` + // Protocol - Protocol scheme to use for this probe. Possible values include: 'HTTP', 'HTTPS' + Protocol Protocol `json:"protocol,omitempty"` + // IntervalInSeconds - The number of seconds between health probes. + IntervalInSeconds *int32 `json:"intervalInSeconds,omitempty"` + // HealthProbeMethod - Configures which HTTP method to use to probe the backends defined under backendPools. Possible values include: 'GET', 'HEAD' + HealthProbeMethod HealthProbeMethod `json:"healthProbeMethod,omitempty"` + // EnabledState - Whether to enable health probes to be made against backends defined under backendPools. Health probes can only be disabled if there is a single enabled backend in single enabled backend pool. Possible values include: 'HealthProbeEnabledEnabled', 'HealthProbeEnabledDisabled' + EnabledState HealthProbeEnabled `json:"enabledState,omitempty"` +} + +// KeyVaultCertificateSourceParameters parameters required for bring-your-own-certification via Key Vault +type KeyVaultCertificateSourceParameters struct { + // Vault - The Key Vault containing the SSL certificate + Vault *KeyVaultCertificateSourceParametersVault `json:"vault,omitempty"` + // SecretName - The name of the Key Vault secret representing the full certificate PFX + SecretName *string `json:"secretName,omitempty"` + // SecretVersion - The version of the Key Vault secret representing the full certificate PFX + SecretVersion *string `json:"secretVersion,omitempty"` +} + +// KeyVaultCertificateSourceParametersVault the Key Vault containing the SSL certificate +type KeyVaultCertificateSourceParametersVault struct { + // ID - Resource ID. + ID *string `json:"id,omitempty"` +} + +// LatencyMetric defines the properties of a latency metric used in the latency scorecard +type LatencyMetric struct { + // Name - READ-ONLY; The name of the Latency Metric + Name *string `json:"name,omitempty"` + // EndDateTimeUTC - READ-ONLY; The end time of the Latency Scorecard in UTC + EndDateTimeUTC *string `json:"endDateTimeUTC,omitempty"` + // AValue - READ-ONLY; The metric value of the A endpoint + AValue *float64 `json:"aValue,omitempty"` + // BValue - READ-ONLY; The metric value of the B endpoint + BValue *float64 `json:"bValue,omitempty"` + // Delta - READ-ONLY; The difference in value between endpoint A and B + Delta *float64 `json:"delta,omitempty"` + // DeltaPercent - READ-ONLY; The percent difference between endpoint A and B + DeltaPercent *float64 `json:"deltaPercent,omitempty"` + // ACLower95CI - READ-ONLY; The lower end of the 95% confidence interval for endpoint A + ACLower95CI *float64 `json:"aCLower95CI,omitempty"` + // AHUpper95CI - READ-ONLY; The upper end of the 95% confidence interval for endpoint A + AHUpper95CI *float64 `json:"aHUpper95CI,omitempty"` + // BCLower95CI - READ-ONLY; The lower end of the 95% confidence interval for endpoint B + BCLower95CI *float64 `json:"bCLower95CI,omitempty"` + // BUpper95CI - READ-ONLY; The upper end of the 95% confidence interval for endpoint B + BUpper95CI *float64 `json:"bUpper95CI,omitempty"` +} + +// LatencyScorecard defines the LatencyScorecard +type LatencyScorecard struct { + autorest.Response `json:"-"` + // LatencyScorecardProperties - The properties of a latency scorecard + *LatencyScorecardProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource ID. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for LatencyScorecard. +func (ls LatencyScorecard) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ls.LatencyScorecardProperties != nil { + objectMap["properties"] = ls.LatencyScorecardProperties + } + if ls.Location != nil { + objectMap["location"] = ls.Location + } + if ls.Tags != nil { + objectMap["tags"] = ls.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for LatencyScorecard struct. +func (ls *LatencyScorecard) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var latencyScorecardProperties LatencyScorecardProperties + err = json.Unmarshal(*v, &latencyScorecardProperties) + if err != nil { + return err + } + ls.LatencyScorecardProperties = &latencyScorecardProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ls.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ls.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ls.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + ls.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + ls.Tags = tags + } + } + } + + return nil +} + +// LatencyScorecardProperties defines a the properties of a Latency Scorecard +type LatencyScorecardProperties struct { + // ID - READ-ONLY; The unique identifier of the Latency Scorecard + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the Latency Scorecard + Name *string `json:"name,omitempty"` + // Description - READ-ONLY; The description of the Latency Scorecard + Description *string `json:"description,omitempty"` + // EndpointA - READ-ONLY; The A endpoint in the scorecard + EndpointA *string `json:"endpointA,omitempty"` + // EndpointB - READ-ONLY; The B endpoint in the scorecard + EndpointB *string `json:"endpointB,omitempty"` + // StartDateTimeUTC - READ-ONLY; The start time of the Latency Scorecard in UTC + StartDateTimeUTC *date.Time `json:"startDateTimeUTC,omitempty"` + // EndDateTimeUTC - READ-ONLY; The end time of the Latency Scorecard in UTC + EndDateTimeUTC *date.Time `json:"endDateTimeUTC,omitempty"` + // Country - READ-ONLY; The country associated with the Latency Scorecard. Values are country ISO codes as specified here- https://www.iso.org/iso-3166-country-codes.html + Country *string `json:"country,omitempty"` + // LatencyMetrics - The latency metrics of the Latency Scorecard + LatencyMetrics *[]LatencyMetric `json:"latencyMetrics,omitempty"` +} + +// ListResult result of the request to list Front Doors. It contains a list of Front Door objects and a URL +// link to get the next set of results. +type ListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; List of Front Doors within a resource group. + Value *[]FrontDoor `json:"value,omitempty"` + // NextLink - URL to get the next set of Front Door objects if there are any. + NextLink *string `json:"nextLink,omitempty"` +} + +// ListResultIterator provides access to a complete listing of FrontDoor values. +type ListResultIterator struct { + i int + page ListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ListResultIterator) Response() ListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ListResultIterator) Value() FrontDoor { + if !iter.page.NotDone() { + return FrontDoor{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ListResultIterator type. +func NewListResultIterator(page ListResultPage) ListResultIterator { + return ListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (lr ListResult) IsEmpty() bool { + return lr.Value == nil || len(*lr.Value) == 0 +} + +// listResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (lr ListResult) listResultPreparer(ctx context.Context) (*http.Request, error) { + if lr.NextLink == nil || len(to.String(lr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(lr.NextLink))) +} + +// ListResultPage contains a page of FrontDoor values. +type ListResultPage struct { + fn func(context.Context, ListResult) (ListResult, error) + lr ListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.lr) + if err != nil { + return err + } + page.lr = next + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *ListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ListResultPage) NotDone() bool { + return !page.lr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ListResultPage) Response() ListResult { + return page.lr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ListResultPage) Values() []FrontDoor { + if page.lr.IsEmpty() { + return nil + } + return *page.lr.Value +} + +// Creates a new instance of the ListResultPage type. +func NewListResultPage(getNextPage func(context.Context, ListResult) (ListResult, error)) ListResultPage { + return ListResultPage{fn: getNextPage} +} + +// LoadBalancingSettingsListResult result of the request to list load balancing settings. It contains a +// list of load balancing settings objects and a URL link to get the next set of results. +type LoadBalancingSettingsListResult struct { + // Value - READ-ONLY; List of Backend Pools within a Front Door. + Value *[]LoadBalancingSettingsModel `json:"value,omitempty"` + // NextLink - URL to get the next set of LoadBalancingSettings objects if there are any. + NextLink *string `json:"nextLink,omitempty"` +} + +// LoadBalancingSettingsModel load balancing settings for a backend pool +type LoadBalancingSettingsModel struct { + // LoadBalancingSettingsProperties - Properties of the load balancing settings + *LoadBalancingSettingsProperties `json:"properties,omitempty"` + // Name - Resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` +} + +// MarshalJSON is the custom marshaler for LoadBalancingSettingsModel. +func (lbsm LoadBalancingSettingsModel) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if lbsm.LoadBalancingSettingsProperties != nil { + objectMap["properties"] = lbsm.LoadBalancingSettingsProperties + } + if lbsm.Name != nil { + objectMap["name"] = lbsm.Name + } + if lbsm.ID != nil { + objectMap["id"] = lbsm.ID + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for LoadBalancingSettingsModel struct. +func (lbsm *LoadBalancingSettingsModel) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var loadBalancingSettingsProperties LoadBalancingSettingsProperties + err = json.Unmarshal(*v, &loadBalancingSettingsProperties) + if err != nil { + return err + } + lbsm.LoadBalancingSettingsProperties = &loadBalancingSettingsProperties + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + lbsm.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + lbsm.Type = &typeVar + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + lbsm.ID = &ID + } + } + } + + return nil +} + +// LoadBalancingSettingsProperties the JSON object that contains the properties required to create load +// balancing settings +type LoadBalancingSettingsProperties struct { + // ResourceState - Resource status. Possible values include: 'ResourceStateCreating', 'ResourceStateEnabling', 'ResourceStateEnabled', 'ResourceStateDisabling', 'ResourceStateDisabled', 'ResourceStateDeleting' + ResourceState ResourceState `json:"resourceState,omitempty"` + // SampleSize - The number of samples to consider for load balancing decisions + SampleSize *int32 `json:"sampleSize,omitempty"` + // SuccessfulSamplesRequired - The number of samples within the sample period that must succeed + SuccessfulSamplesRequired *int32 `json:"successfulSamplesRequired,omitempty"` + // AdditionalLatencyMilliseconds - The additional latency in milliseconds for probes to fall into the lowest latency bucket + AdditionalLatencyMilliseconds *int32 `json:"additionalLatencyMilliseconds,omitempty"` +} + +// LoadBalancingSettingsUpdateParameters round-Robin load balancing settings for a backend pool +type LoadBalancingSettingsUpdateParameters struct { + // SampleSize - The number of samples to consider for load balancing decisions + SampleSize *int32 `json:"sampleSize,omitempty"` + // SuccessfulSamplesRequired - The number of samples within the sample period that must succeed + SuccessfulSamplesRequired *int32 `json:"successfulSamplesRequired,omitempty"` + // AdditionalLatencyMilliseconds - The additional latency in milliseconds for probes to fall into the lowest latency bucket + AdditionalLatencyMilliseconds *int32 `json:"additionalLatencyMilliseconds,omitempty"` +} + +// ManagedRuleDefinition describes a managed rule definition. +type ManagedRuleDefinition struct { + // RuleID - READ-ONLY; Identifier for the managed rule. + RuleID *string `json:"ruleId,omitempty"` + // DefaultState - READ-ONLY; Describes the default state for the managed rule. Possible values include: 'ManagedRuleEnabledStateDisabled', 'ManagedRuleEnabledStateEnabled' + DefaultState ManagedRuleEnabledState `json:"defaultState,omitempty"` + // DefaultAction - READ-ONLY; Describes the default action to be applied when the managed rule matches. Possible values include: 'Allow', 'Block', 'Log', 'Redirect' + DefaultAction ActionType `json:"defaultAction,omitempty"` + // Description - READ-ONLY; Describes the functionality of the managed rule. + Description *string `json:"description,omitempty"` +} + +// ManagedRuleExclusion exclude variables from managed rule evaluation. +type ManagedRuleExclusion struct { + // MatchVariable - The variable type to be excluded. Possible values include: 'RequestHeaderNames', 'RequestCookieNames', 'QueryStringArgNames', 'RequestBodyPostArgNames' + MatchVariable ManagedRuleExclusionMatchVariable `json:"matchVariable,omitempty"` + // SelectorMatchOperator - Comparison operator to apply to the selector when specifying which elements in the collection this exclusion applies to. Possible values include: 'Equals', 'Contains', 'StartsWith', 'EndsWith', 'EqualsAny' + SelectorMatchOperator ManagedRuleExclusionSelectorMatchOperator `json:"selectorMatchOperator,omitempty"` + // Selector - Selector value for which elements in the collection this exclusion applies to. + Selector *string `json:"selector,omitempty"` +} + +// ManagedRuleGroupDefinition describes a managed rule group. +type ManagedRuleGroupDefinition struct { + // RuleGroupName - READ-ONLY; Name of the managed rule group. + RuleGroupName *string `json:"ruleGroupName,omitempty"` + // Description - READ-ONLY; Description of the managed rule group. + Description *string `json:"description,omitempty"` + // Rules - READ-ONLY; List of rules within the managed rule group. + Rules *[]ManagedRuleDefinition `json:"rules,omitempty"` +} + +// ManagedRuleGroupOverride defines a managed rule group override setting. +type ManagedRuleGroupOverride struct { + // RuleGroupName - Describes the managed rule group to override. + RuleGroupName *string `json:"ruleGroupName,omitempty"` + // Exclusions - Describes the exclusions that are applied to all rules in the group. + Exclusions *[]ManagedRuleExclusion `json:"exclusions,omitempty"` + // Rules - List of rules that will be disabled. If none specified, all rules in the group will be disabled. + Rules *[]ManagedRuleOverride `json:"rules,omitempty"` +} + +// ManagedRuleOverride defines a managed rule group override setting. +type ManagedRuleOverride struct { + // RuleID - Identifier for the managed rule. + RuleID *string `json:"ruleId,omitempty"` + // EnabledState - Describes if the managed rule is in enabled or disabled state. Defaults to Disabled if not specified. Possible values include: 'ManagedRuleEnabledStateDisabled', 'ManagedRuleEnabledStateEnabled' + EnabledState ManagedRuleEnabledState `json:"enabledState,omitempty"` + // Action - Describes the override action to be applied when rule matches. Possible values include: 'Allow', 'Block', 'Log', 'Redirect' + Action ActionType `json:"action,omitempty"` + // Exclusions - Describes the exclusions that are applied to this specific rule. + Exclusions *[]ManagedRuleExclusion `json:"exclusions,omitempty"` +} + +// ManagedRuleSet defines a managed rule set. +type ManagedRuleSet struct { + // RuleSetType - Defines the rule set type to use. + RuleSetType *string `json:"ruleSetType,omitempty"` + // RuleSetVersion - Defines the version of the rule set to use. + RuleSetVersion *string `json:"ruleSetVersion,omitempty"` + // Exclusions - Describes the exclusions that are applied to all rules in the set. + Exclusions *[]ManagedRuleExclusion `json:"exclusions,omitempty"` + // RuleGroupOverrides - Defines the rule group overrides to apply to the rule set. + RuleGroupOverrides *[]ManagedRuleGroupOverride `json:"ruleGroupOverrides,omitempty"` +} + +// ManagedRuleSetDefinition describes the a managed rule set definition. +type ManagedRuleSetDefinition struct { + // ManagedRuleSetDefinitionProperties - Properties for a managed rule set definition. + *ManagedRuleSetDefinitionProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource ID. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for ManagedRuleSetDefinition. +func (mrsd ManagedRuleSetDefinition) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mrsd.ManagedRuleSetDefinitionProperties != nil { + objectMap["properties"] = mrsd.ManagedRuleSetDefinitionProperties + } + if mrsd.Location != nil { + objectMap["location"] = mrsd.Location + } + if mrsd.Tags != nil { + objectMap["tags"] = mrsd.Tags } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for FrontendEndpoint struct. -func (fe *FrontendEndpoint) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for ManagedRuleSetDefinition struct. +func (mrsd *ManagedRuleSetDefinition) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -1171,12 +2725,21 @@ func (fe *FrontendEndpoint) UnmarshalJSON(body []byte) error { switch k { case "properties": if v != nil { - var frontendEndpointProperties FrontendEndpointProperties - err = json.Unmarshal(*v, &frontendEndpointProperties) + var managedRuleSetDefinitionProperties ManagedRuleSetDefinitionProperties + err = json.Unmarshal(*v, &managedRuleSetDefinitionProperties) if err != nil { return err } - fe.FrontendEndpointProperties = &frontendEndpointProperties + mrsd.ManagedRuleSetDefinitionProperties = &managedRuleSetDefinitionProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + mrsd.ID = &ID } case "name": if v != nil { @@ -1185,7 +2748,7 @@ func (fe *FrontendEndpoint) UnmarshalJSON(body []byte) error { if err != nil { return err } - fe.Name = &name + mrsd.Name = &name } case "type": if v != nil { @@ -1194,16 +2757,25 @@ func (fe *FrontendEndpoint) UnmarshalJSON(body []byte) error { if err != nil { return err } - fe.Type = &typeVar + mrsd.Type = &typeVar } - case "id": + case "location": if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) + var location string + err = json.Unmarshal(*v, &location) if err != nil { return err } - fe.ID = &ID + mrsd.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + mrsd.Tags = tags } } } @@ -1211,100 +2783,27 @@ func (fe *FrontendEndpoint) UnmarshalJSON(body []byte) error { return nil } -// FrontendEndpointLink defines the Resource ID for a Frontend Endpoint. -type FrontendEndpointLink struct { - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// FrontendEndpointProperties the JSON object that contains the properties required to create a frontend -// endpoint. -type FrontendEndpointProperties struct { - // ResourceState - Resource status. Possible values include: 'ResourceStateCreating', 'ResourceStateEnabling', 'ResourceStateEnabled', 'ResourceStateDisabling', 'ResourceStateDisabled', 'ResourceStateDeleting' - ResourceState ResourceState `json:"resourceState,omitempty"` - // CustomHTTPSProvisioningState - READ-ONLY; Provisioning status of Custom Https of the frontendEndpoint. Possible values include: 'CustomHTTPSProvisioningStateEnabling', 'CustomHTTPSProvisioningStateEnabled', 'CustomHTTPSProvisioningStateDisabling', 'CustomHTTPSProvisioningStateDisabled', 'CustomHTTPSProvisioningStateFailed' - CustomHTTPSProvisioningState CustomHTTPSProvisioningState `json:"customHttpsProvisioningState,omitempty"` - // CustomHTTPSProvisioningSubstate - READ-ONLY; Provisioning substate shows the progress of custom HTTPS enabling/disabling process step by step. Possible values include: 'SubmittingDomainControlValidationRequest', 'PendingDomainControlValidationREquestApproval', 'DomainControlValidationRequestApproved', 'DomainControlValidationRequestRejected', 'DomainControlValidationRequestTimedOut', 'IssuingCertificate', 'DeployingCertificate', 'CertificateDeployed', 'DeletingCertificate', 'CertificateDeleted' - CustomHTTPSProvisioningSubstate CustomHTTPSProvisioningSubstate `json:"customHttpsProvisioningSubstate,omitempty"` - // CustomHTTPSConfiguration - READ-ONLY; The configuration specifying how to enable HTTPS - CustomHTTPSConfiguration *CustomHTTPSConfiguration `json:"customHttpsConfiguration,omitempty"` - // HostName - The host name of the frontendEndpoint. Must be a domain name. - HostName *string `json:"hostName,omitempty"` - // SessionAffinityEnabledState - Whether to allow session affinity on this host. Valid options are 'Enabled' or 'Disabled'. Possible values include: 'SessionAffinityEnabledStateEnabled', 'SessionAffinityEnabledStateDisabled' - SessionAffinityEnabledState SessionAffinityEnabledState `json:"sessionAffinityEnabledState,omitempty"` - // SessionAffinityTTLSeconds - UNUSED. This field will be ignored. The TTL to use in seconds for session affinity, if applicable. - SessionAffinityTTLSeconds *int32 `json:"sessionAffinityTtlSeconds,omitempty"` - // WebApplicationFirewallPolicyLink - Defines the Web Application Firewall policy for each host (if applicable) - WebApplicationFirewallPolicyLink *FrontendEndpointUpdateParametersWebApplicationFirewallPolicyLink `json:"webApplicationFirewallPolicyLink,omitempty"` -} - -// FrontendEndpointsDisableHTTPSFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type FrontendEndpointsDisableHTTPSFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *FrontendEndpointsDisableHTTPSFuture) Result(client FrontendEndpointsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.FrontendEndpointsDisableHTTPSFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("frontdoor.FrontendEndpointsDisableHTTPSFuture") - return - } - ar.Response = future.Response() - return -} - -// FrontendEndpointsEnableHTTPSFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type FrontendEndpointsEnableHTTPSFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *FrontendEndpointsEnableHTTPSFuture) Result(client FrontendEndpointsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.FrontendEndpointsEnableHTTPSFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("frontdoor.FrontendEndpointsEnableHTTPSFuture") - return - } - ar.Response = future.Response() - return -} - -// FrontendEndpointsListResult result of the request to list frontend endpoints. It contains a list of -// Frontend endpoint objects and a URL link to get the next set of results. -type FrontendEndpointsListResult struct { +// ManagedRuleSetDefinitionList list of managed rule set definitions available for use in a policy. +type ManagedRuleSetDefinitionList struct { autorest.Response `json:"-"` - // Value - READ-ONLY; List of Frontend endpoints within a Front Door. - Value *[]FrontendEndpoint `json:"value,omitempty"` - // NextLink - URL to get the next set of frontend endpoints if there are any. + // Value - READ-ONLY; List of managed rule set definitions. + Value *[]ManagedRuleSetDefinition `json:"value,omitempty"` + // NextLink - URL to retrieve next set of managed rule set definitions. NextLink *string `json:"nextLink,omitempty"` } -// FrontendEndpointsListResultIterator provides access to a complete listing of FrontendEndpoint values. -type FrontendEndpointsListResultIterator struct { +// ManagedRuleSetDefinitionListIterator provides access to a complete listing of ManagedRuleSetDefinition +// values. +type ManagedRuleSetDefinitionListIterator struct { i int - page FrontendEndpointsListResultPage + page ManagedRuleSetDefinitionListPage } // NextWithContext advances to the next value. If there was an error making // the request the iterator does not advance and the error is returned. -func (iter *FrontendEndpointsListResultIterator) NextWithContext(ctx context.Context) (err error) { +func (iter *ManagedRuleSetDefinitionListIterator) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/FrontendEndpointsListResultIterator.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/ManagedRuleSetDefinitionListIterator.NextWithContext") defer func() { sc := -1 if iter.Response().Response.Response != nil { @@ -1329,62 +2828,62 @@ func (iter *FrontendEndpointsListResultIterator) NextWithContext(ctx context.Con // Next advances to the next value. If there was an error making // the request the iterator does not advance and the error is returned. // Deprecated: Use NextWithContext() instead. -func (iter *FrontendEndpointsListResultIterator) Next() error { +func (iter *ManagedRuleSetDefinitionListIterator) Next() error { return iter.NextWithContext(context.Background()) } // NotDone returns true if the enumeration should be started or is not yet complete. -func (iter FrontendEndpointsListResultIterator) NotDone() bool { +func (iter ManagedRuleSetDefinitionListIterator) NotDone() bool { return iter.page.NotDone() && iter.i < len(iter.page.Values()) } // Response returns the raw server response from the last page request. -func (iter FrontendEndpointsListResultIterator) Response() FrontendEndpointsListResult { +func (iter ManagedRuleSetDefinitionListIterator) Response() ManagedRuleSetDefinitionList { return iter.page.Response() } // Value returns the current value or a zero-initialized value if the // iterator has advanced beyond the end of the collection. -func (iter FrontendEndpointsListResultIterator) Value() FrontendEndpoint { +func (iter ManagedRuleSetDefinitionListIterator) Value() ManagedRuleSetDefinition { if !iter.page.NotDone() { - return FrontendEndpoint{} + return ManagedRuleSetDefinition{} } return iter.page.Values()[iter.i] } -// Creates a new instance of the FrontendEndpointsListResultIterator type. -func NewFrontendEndpointsListResultIterator(page FrontendEndpointsListResultPage) FrontendEndpointsListResultIterator { - return FrontendEndpointsListResultIterator{page: page} +// Creates a new instance of the ManagedRuleSetDefinitionListIterator type. +func NewManagedRuleSetDefinitionListIterator(page ManagedRuleSetDefinitionListPage) ManagedRuleSetDefinitionListIterator { + return ManagedRuleSetDefinitionListIterator{page: page} } // IsEmpty returns true if the ListResult contains no values. -func (felr FrontendEndpointsListResult) IsEmpty() bool { - return felr.Value == nil || len(*felr.Value) == 0 +func (mrsdl ManagedRuleSetDefinitionList) IsEmpty() bool { + return mrsdl.Value == nil || len(*mrsdl.Value) == 0 } -// frontendEndpointsListResultPreparer prepares a request to retrieve the next set of results. +// managedRuleSetDefinitionListPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. -func (felr FrontendEndpointsListResult) frontendEndpointsListResultPreparer(ctx context.Context) (*http.Request, error) { - if felr.NextLink == nil || len(to.String(felr.NextLink)) < 1 { +func (mrsdl ManagedRuleSetDefinitionList) managedRuleSetDefinitionListPreparer(ctx context.Context) (*http.Request, error) { + if mrsdl.NextLink == nil || len(to.String(mrsdl.NextLink)) < 1 { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), autorest.AsJSON(), autorest.AsGet(), - autorest.WithBaseURL(to.String(felr.NextLink))) + autorest.WithBaseURL(to.String(mrsdl.NextLink))) } -// FrontendEndpointsListResultPage contains a page of FrontendEndpoint values. -type FrontendEndpointsListResultPage struct { - fn func(context.Context, FrontendEndpointsListResult) (FrontendEndpointsListResult, error) - felr FrontendEndpointsListResult +// ManagedRuleSetDefinitionListPage contains a page of ManagedRuleSetDefinition values. +type ManagedRuleSetDefinitionListPage struct { + fn func(context.Context, ManagedRuleSetDefinitionList) (ManagedRuleSetDefinitionList, error) + mrsdl ManagedRuleSetDefinitionList } // NextWithContext advances to the next page of values. If there was an error making // the request the page does not advance and the error is returned. -func (page *FrontendEndpointsListResultPage) NextWithContext(ctx context.Context) (err error) { +func (page *ManagedRuleSetDefinitionListPage) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/FrontendEndpointsListResultPage.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/ManagedRuleSetDefinitionListPage.NextWithContext") defer func() { sc := -1 if page.Response().Response.Response != nil { @@ -1393,101 +2892,258 @@ func (page *FrontendEndpointsListResultPage) NextWithContext(ctx context.Context tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.felr) + next, err := page.fn(ctx, page.mrsdl) if err != nil { return err } - page.felr = next + page.mrsdl = next return nil } // Next advances to the next page of values. If there was an error making // the request the page does not advance and the error is returned. // Deprecated: Use NextWithContext() instead. -func (page *FrontendEndpointsListResultPage) Next() error { +func (page *ManagedRuleSetDefinitionListPage) Next() error { return page.NextWithContext(context.Background()) } // NotDone returns true if the page enumeration should be started or is not yet complete. -func (page FrontendEndpointsListResultPage) NotDone() bool { - return !page.felr.IsEmpty() +func (page ManagedRuleSetDefinitionListPage) NotDone() bool { + return !page.mrsdl.IsEmpty() } // Response returns the raw server response from the last page request. -func (page FrontendEndpointsListResultPage) Response() FrontendEndpointsListResult { - return page.felr +func (page ManagedRuleSetDefinitionListPage) Response() ManagedRuleSetDefinitionList { + return page.mrsdl } // Values returns the slice of values for the current page or nil if there are no values. -func (page FrontendEndpointsListResultPage) Values() []FrontendEndpoint { - if page.felr.IsEmpty() { +func (page ManagedRuleSetDefinitionListPage) Values() []ManagedRuleSetDefinition { + if page.mrsdl.IsEmpty() { return nil } - return *page.felr.Value + return *page.mrsdl.Value } -// Creates a new instance of the FrontendEndpointsListResultPage type. -func NewFrontendEndpointsListResultPage(getNextPage func(context.Context, FrontendEndpointsListResult) (FrontendEndpointsListResult, error)) FrontendEndpointsListResultPage { - return FrontendEndpointsListResultPage{fn: getNextPage} +// Creates a new instance of the ManagedRuleSetDefinitionListPage type. +func NewManagedRuleSetDefinitionListPage(getNextPage func(context.Context, ManagedRuleSetDefinitionList) (ManagedRuleSetDefinitionList, error)) ManagedRuleSetDefinitionListPage { + return ManagedRuleSetDefinitionListPage{fn: getNextPage} } -// FrontendEndpointUpdateParameters frontend endpoint used in routing rule -type FrontendEndpointUpdateParameters struct { - // HostName - The host name of the frontendEndpoint. Must be a domain name. - HostName *string `json:"hostName,omitempty"` - // SessionAffinityEnabledState - Whether to allow session affinity on this host. Valid options are 'Enabled' or 'Disabled'. Possible values include: 'SessionAffinityEnabledStateEnabled', 'SessionAffinityEnabledStateDisabled' - SessionAffinityEnabledState SessionAffinityEnabledState `json:"sessionAffinityEnabledState,omitempty"` - // SessionAffinityTTLSeconds - UNUSED. This field will be ignored. The TTL to use in seconds for session affinity, if applicable. - SessionAffinityTTLSeconds *int32 `json:"sessionAffinityTtlSeconds,omitempty"` - // WebApplicationFirewallPolicyLink - Defines the Web Application Firewall policy for each host (if applicable) - WebApplicationFirewallPolicyLink *FrontendEndpointUpdateParametersWebApplicationFirewallPolicyLink `json:"webApplicationFirewallPolicyLink,omitempty"` +// ManagedRuleSetDefinitionProperties properties for a managed rule set definition. +type ManagedRuleSetDefinitionProperties struct { + // ProvisioningState - READ-ONLY; Provisioning state of the managed rule set. + ProvisioningState *string `json:"provisioningState,omitempty"` + // RuleSetType - READ-ONLY; Type of the managed rule set. + RuleSetType *string `json:"ruleSetType,omitempty"` + // RuleSetVersion - READ-ONLY; Version of the managed rule set type. + RuleSetVersion *string `json:"ruleSetVersion,omitempty"` + // RuleGroups - READ-ONLY; Rule groups of the managed rule set. + RuleGroups *[]ManagedRuleGroupDefinition `json:"ruleGroups,omitempty"` } -// FrontendEndpointUpdateParametersWebApplicationFirewallPolicyLink defines the Web Application Firewall -// policy for each host (if applicable) -type FrontendEndpointUpdateParametersWebApplicationFirewallPolicyLink struct { - // ID - Resource ID. - ID *string `json:"id,omitempty"` +// ManagedRuleSetList defines the list of managed rule sets for the policy. +type ManagedRuleSetList struct { + // ManagedRuleSets - List of rule sets. + ManagedRuleSets *[]ManagedRuleSet `json:"managedRuleSets,omitempty"` } -// HealthProbeSettingsListResult result of the request to list HealthProbeSettings. It contains a list of -// HealthProbeSettings objects and a URL link to get the next set of results. -type HealthProbeSettingsListResult struct { - // Value - READ-ONLY; List of HealthProbeSettings within a Front Door. - Value *[]HealthProbeSettingsModel `json:"value,omitempty"` - // NextLink - URL to get the next set of HealthProbeSettings objects if there are any. - NextLink *string `json:"nextLink,omitempty"` +// MatchCondition define a match condition. +type MatchCondition struct { + // MatchVariable - Request variable to compare with. Possible values include: 'RemoteAddr', 'RequestMethod', 'QueryString', 'PostArgs', 'RequestURI', 'RequestHeader', 'RequestBody', 'Cookies', 'SocketAddr' + MatchVariable MatchVariable `json:"matchVariable,omitempty"` + // Selector - Match against a specific key from the QueryString, PostArgs, RequestHeader or Cookies variables. Default is null. + Selector *string `json:"selector,omitempty"` + // Operator - Comparison type to use for matching with the variable value. Possible values include: 'OperatorAny', 'OperatorIPMatch', 'OperatorGeoMatch', 'OperatorEqual', 'OperatorContains', 'OperatorLessThan', 'OperatorGreaterThan', 'OperatorLessThanOrEqual', 'OperatorGreaterThanOrEqual', 'OperatorBeginsWith', 'OperatorEndsWith', 'OperatorRegEx' + Operator Operator `json:"operator,omitempty"` + // NegateCondition - Describes if the result of this condition should be negated. + NegateCondition *bool `json:"negateCondition,omitempty"` + // MatchValue - List of possible match values. + MatchValue *[]string `json:"matchValue,omitempty"` + // Transforms - List of transforms. + Transforms *[]TransformType `json:"transforms,omitempty"` } -// HealthProbeSettingsModel load balancing settings for a backend pool -type HealthProbeSettingsModel struct { - // HealthProbeSettingsProperties - Properties of the health probe settings - *HealthProbeSettingsProperties `json:"properties,omitempty"` - // Name - Resource name. +// NetworkExperimentProfilesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type NetworkExperimentProfilesCreateOrUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *NetworkExperimentProfilesCreateOrUpdateFuture) Result(client NetworkExperimentProfilesClient) (p Profile, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.NetworkExperimentProfilesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("frontdoor.NetworkExperimentProfilesCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if p.Response.Response, err = future.GetResult(sender); err == nil && p.Response.Response.StatusCode != http.StatusNoContent { + p, err = client.CreateOrUpdateResponder(p.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.NetworkExperimentProfilesCreateOrUpdateFuture", "Result", p.Response.Response, "Failure responding to request") + } + } + return +} + +// NetworkExperimentProfilesDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type NetworkExperimentProfilesDeleteFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *NetworkExperimentProfilesDeleteFuture) Result(client NetworkExperimentProfilesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.NetworkExperimentProfilesDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("frontdoor.NetworkExperimentProfilesDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// NetworkExperimentProfilesUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type NetworkExperimentProfilesUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *NetworkExperimentProfilesUpdateFuture) Result(client NetworkExperimentProfilesClient) (p Profile, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.NetworkExperimentProfilesUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("frontdoor.NetworkExperimentProfilesUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if p.Response.Response, err = future.GetResult(sender); err == nil && p.Response.Response.StatusCode != http.StatusNoContent { + p, err = client.UpdateResponder(p.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.NetworkExperimentProfilesUpdateFuture", "Result", p.Response.Response, "Failure responding to request") + } + } + return +} + +// PoliciesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type PoliciesCreateOrUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *PoliciesCreateOrUpdateFuture) Result(client PoliciesClient) (wafp WebApplicationFirewallPolicy, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.PoliciesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("frontdoor.PoliciesCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if wafp.Response.Response, err = future.GetResult(sender); err == nil && wafp.Response.Response.StatusCode != http.StatusNoContent { + wafp, err = client.CreateOrUpdateResponder(wafp.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.PoliciesCreateOrUpdateFuture", "Result", wafp.Response.Response, "Failure responding to request") + } + } + return +} + +// PoliciesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type PoliciesDeleteFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *PoliciesDeleteFuture) Result(client PoliciesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.PoliciesDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("frontdoor.PoliciesDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// PolicySettings defines top-level WebApplicationFirewallPolicy configuration settings. +type PolicySettings struct { + // EnabledState - Describes if the policy is in enabled or disabled state. Defaults to Enabled if not specified. Possible values include: 'PolicyEnabledStateDisabled', 'PolicyEnabledStateEnabled' + EnabledState PolicyEnabledState `json:"enabledState,omitempty"` + // Mode - Describes if it is in detection mode or prevention mode at policy level. Possible values include: 'Prevention', 'Detection' + Mode PolicyMode `json:"mode,omitempty"` + // RedirectURL - If action type is redirect, this field represents redirect URL for the client. + RedirectURL *string `json:"redirectUrl,omitempty"` + // CustomBlockResponseStatusCode - If the action type is block, customer can override the response status code. + CustomBlockResponseStatusCode *int32 `json:"customBlockResponseStatusCode,omitempty"` + // CustomBlockResponseBody - If the action type is block, customer can override the response body. The body must be specified in base64 encoding. + CustomBlockResponseBody *string `json:"customBlockResponseBody,omitempty"` +} + +// PreconfiguredEndpoint defines the properties of a preconfigured endpoint +type PreconfiguredEndpoint struct { + // PreconfiguredEndpointProperties - The properties of a preconfiguredEndpoint + *PreconfiguredEndpointProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource ID. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name. Name *string `json:"name,omitempty"` // Type - READ-ONLY; Resource type. Type *string `json:"type,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` } -// MarshalJSON is the custom marshaler for HealthProbeSettingsModel. -func (hpsm HealthProbeSettingsModel) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for PreconfiguredEndpoint. +func (peVar PreconfiguredEndpoint) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if hpsm.HealthProbeSettingsProperties != nil { - objectMap["properties"] = hpsm.HealthProbeSettingsProperties + if peVar.PreconfiguredEndpointProperties != nil { + objectMap["properties"] = peVar.PreconfiguredEndpointProperties } - if hpsm.Name != nil { - objectMap["name"] = hpsm.Name + if peVar.Location != nil { + objectMap["location"] = peVar.Location } - if hpsm.ID != nil { - objectMap["id"] = hpsm.ID + if peVar.Tags != nil { + objectMap["tags"] = peVar.Tags } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for HealthProbeSettingsModel struct. -func (hpsm *HealthProbeSettingsModel) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for PreconfiguredEndpoint struct. +func (peVar *PreconfiguredEndpoint) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -1497,12 +3153,21 @@ func (hpsm *HealthProbeSettingsModel) UnmarshalJSON(body []byte) error { switch k { case "properties": if v != nil { - var healthProbeSettingsProperties HealthProbeSettingsProperties - err = json.Unmarshal(*v, &healthProbeSettingsProperties) + var preconfiguredEndpointProperties PreconfiguredEndpointProperties + err = json.Unmarshal(*v, &preconfiguredEndpointProperties) if err != nil { return err } - hpsm.HealthProbeSettingsProperties = &healthProbeSettingsProperties + peVar.PreconfiguredEndpointProperties = &preconfiguredEndpointProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + peVar.ID = &ID } case "name": if v != nil { @@ -1511,7 +3176,7 @@ func (hpsm *HealthProbeSettingsModel) UnmarshalJSON(body []byte) error { if err != nil { return err } - hpsm.Name = &name + peVar.Name = &name } case "type": if v != nil { @@ -1520,16 +3185,25 @@ func (hpsm *HealthProbeSettingsModel) UnmarshalJSON(body []byte) error { if err != nil { return err } - hpsm.Type = &typeVar + peVar.Type = &typeVar } - case "id": + case "location": if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + peVar.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) if err != nil { return err } - hpsm.ID = &ID + peVar.Tags = tags } } } @@ -1537,66 +3211,26 @@ func (hpsm *HealthProbeSettingsModel) UnmarshalJSON(body []byte) error { return nil } -// HealthProbeSettingsProperties the JSON object that contains the properties required to create a health -// probe settings. -type HealthProbeSettingsProperties struct { - // ResourceState - Resource status. Possible values include: 'ResourceStateCreating', 'ResourceStateEnabling', 'ResourceStateEnabled', 'ResourceStateDisabling', 'ResourceStateDisabled', 'ResourceStateDeleting' - ResourceState ResourceState `json:"resourceState,omitempty"` - // Path - The path to use for the health probe. Default is / - Path *string `json:"path,omitempty"` - // Protocol - Protocol scheme to use for this probe. Possible values include: 'HTTP', 'HTTPS' - Protocol Protocol `json:"protocol,omitempty"` - // IntervalInSeconds - The number of seconds between health probes. - IntervalInSeconds *int32 `json:"intervalInSeconds,omitempty"` -} - -// HealthProbeSettingsUpdateParameters l7 health probe settings for a backend pool -type HealthProbeSettingsUpdateParameters struct { - // Path - The path to use for the health probe. Default is / - Path *string `json:"path,omitempty"` - // Protocol - Protocol scheme to use for this probe. Possible values include: 'HTTP', 'HTTPS' - Protocol Protocol `json:"protocol,omitempty"` - // IntervalInSeconds - The number of seconds between health probes. - IntervalInSeconds *int32 `json:"intervalInSeconds,omitempty"` -} - -// KeyVaultCertificateSourceParameters parameters required for bring-your-own-certification via Key Vault -type KeyVaultCertificateSourceParameters struct { - // Vault - The Key Vault containing the SSL certificate - Vault *KeyVaultCertificateSourceParametersVault `json:"vault,omitempty"` - // SecretName - The name of the Key Vault secret representing the full certificate PFX - SecretName *string `json:"secretName,omitempty"` - // SecretVersion - The version of the Key Vault secret representing the full certificate PFX - SecretVersion *string `json:"secretVersion,omitempty"` -} - -// KeyVaultCertificateSourceParametersVault the Key Vault containing the SSL certificate -type KeyVaultCertificateSourceParametersVault struct { - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// ListResult result of the request to list Front Doors. It contains a list of Front Door objects and a URL -// link to get the next set of results. -type ListResult struct { +// PreconfiguredEndpointList defines a list of preconfigured endpoints. +type PreconfiguredEndpointList struct { autorest.Response `json:"-"` - // Value - READ-ONLY; List of Front Doors within a resource group. - Value *[]FrontDoor `json:"value,omitempty"` - // NextLink - URL to get the next set of Front Door objects if there are any. + // Value - READ-ONLY; List of PreconfiguredEndpoints supported by NetworkExperiment. + Value *[]PreconfiguredEndpoint `json:"value,omitempty"` + // NextLink - URL to get the next set of PreconfiguredEndpoints if there are any. NextLink *string `json:"nextLink,omitempty"` } -// ListResultIterator provides access to a complete listing of FrontDoor values. -type ListResultIterator struct { +// PreconfiguredEndpointListIterator provides access to a complete listing of PreconfiguredEndpoint values. +type PreconfiguredEndpointListIterator struct { i int - page ListResultPage + page PreconfiguredEndpointListPage } // NextWithContext advances to the next value. If there was an error making // the request the iterator does not advance and the error is returned. -func (iter *ListResultIterator) NextWithContext(ctx context.Context) (err error) { +func (iter *PreconfiguredEndpointListIterator) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ListResultIterator.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/PreconfiguredEndpointListIterator.NextWithContext") defer func() { sc := -1 if iter.Response().Response.Response != nil { @@ -1621,62 +3255,62 @@ func (iter *ListResultIterator) NextWithContext(ctx context.Context) (err error) // Next advances to the next value. If there was an error making // the request the iterator does not advance and the error is returned. // Deprecated: Use NextWithContext() instead. -func (iter *ListResultIterator) Next() error { +func (iter *PreconfiguredEndpointListIterator) Next() error { return iter.NextWithContext(context.Background()) } // NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ListResultIterator) NotDone() bool { +func (iter PreconfiguredEndpointListIterator) NotDone() bool { return iter.page.NotDone() && iter.i < len(iter.page.Values()) } // Response returns the raw server response from the last page request. -func (iter ListResultIterator) Response() ListResult { +func (iter PreconfiguredEndpointListIterator) Response() PreconfiguredEndpointList { return iter.page.Response() } // Value returns the current value or a zero-initialized value if the // iterator has advanced beyond the end of the collection. -func (iter ListResultIterator) Value() FrontDoor { +func (iter PreconfiguredEndpointListIterator) Value() PreconfiguredEndpoint { if !iter.page.NotDone() { - return FrontDoor{} + return PreconfiguredEndpoint{} } return iter.page.Values()[iter.i] } -// Creates a new instance of the ListResultIterator type. -func NewListResultIterator(page ListResultPage) ListResultIterator { - return ListResultIterator{page: page} +// Creates a new instance of the PreconfiguredEndpointListIterator type. +func NewPreconfiguredEndpointListIterator(page PreconfiguredEndpointListPage) PreconfiguredEndpointListIterator { + return PreconfiguredEndpointListIterator{page: page} } // IsEmpty returns true if the ListResult contains no values. -func (lr ListResult) IsEmpty() bool { - return lr.Value == nil || len(*lr.Value) == 0 +func (pel PreconfiguredEndpointList) IsEmpty() bool { + return pel.Value == nil || len(*pel.Value) == 0 } -// listResultPreparer prepares a request to retrieve the next set of results. +// preconfiguredEndpointListPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. -func (lr ListResult) listResultPreparer(ctx context.Context) (*http.Request, error) { - if lr.NextLink == nil || len(to.String(lr.NextLink)) < 1 { +func (pel PreconfiguredEndpointList) preconfiguredEndpointListPreparer(ctx context.Context) (*http.Request, error) { + if pel.NextLink == nil || len(to.String(pel.NextLink)) < 1 { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), autorest.AsJSON(), autorest.AsGet(), - autorest.WithBaseURL(to.String(lr.NextLink))) + autorest.WithBaseURL(to.String(pel.NextLink))) } -// ListResultPage contains a page of FrontDoor values. -type ListResultPage struct { - fn func(context.Context, ListResult) (ListResult, error) - lr ListResult +// PreconfiguredEndpointListPage contains a page of PreconfiguredEndpoint values. +type PreconfiguredEndpointListPage struct { + fn func(context.Context, PreconfiguredEndpointList) (PreconfiguredEndpointList, error) + pel PreconfiguredEndpointList } // NextWithContext advances to the next page of values. If there was an error making // the request the page does not advance and the error is returned. -func (page *ListResultPage) NextWithContext(ctx context.Context) (err error) { +func (page *PreconfiguredEndpointListPage) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ListResultPage.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/PreconfiguredEndpointListPage.NextWithContext") defer func() { sc := -1 if page.Response().Response.Response != nil { @@ -1685,208 +3319,63 @@ func (page *ListResultPage) NextWithContext(ctx context.Context) (err error) { tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.lr) + next, err := page.fn(ctx, page.pel) if err != nil { return err } - page.lr = next + page.pel = next return nil } // Next advances to the next page of values. If there was an error making // the request the page does not advance and the error is returned. // Deprecated: Use NextWithContext() instead. -func (page *ListResultPage) Next() error { +func (page *PreconfiguredEndpointListPage) Next() error { return page.NextWithContext(context.Background()) } // NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ListResultPage) NotDone() bool { - return !page.lr.IsEmpty() +func (page PreconfiguredEndpointListPage) NotDone() bool { + return !page.pel.IsEmpty() } // Response returns the raw server response from the last page request. -func (page ListResultPage) Response() ListResult { - return page.lr +func (page PreconfiguredEndpointListPage) Response() PreconfiguredEndpointList { + return page.pel } // Values returns the slice of values for the current page or nil if there are no values. -func (page ListResultPage) Values() []FrontDoor { - if page.lr.IsEmpty() { +func (page PreconfiguredEndpointListPage) Values() []PreconfiguredEndpoint { + if page.pel.IsEmpty() { return nil } - return *page.lr.Value -} - -// Creates a new instance of the ListResultPage type. -func NewListResultPage(getNextPage func(context.Context, ListResult) (ListResult, error)) ListResultPage { - return ListResultPage{fn: getNextPage} -} - -// LoadBalancingSettingsListResult result of the request to list load balancing settings. It contains a -// list of load balancing settings objects and a URL link to get the next set of results. -type LoadBalancingSettingsListResult struct { - // Value - READ-ONLY; List of Backend Pools within a Front Door. - Value *[]LoadBalancingSettingsModel `json:"value,omitempty"` - // NextLink - URL to get the next set of LoadBalancingSettings objects if there are any. - NextLink *string `json:"nextLink,omitempty"` -} - -// LoadBalancingSettingsModel load balancing settings for a backend pool -type LoadBalancingSettingsModel struct { - // LoadBalancingSettingsProperties - Properties of the load balancing settings - *LoadBalancingSettingsProperties `json:"properties,omitempty"` - // Name - Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for LoadBalancingSettingsModel. -func (lbsm LoadBalancingSettingsModel) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if lbsm.LoadBalancingSettingsProperties != nil { - objectMap["properties"] = lbsm.LoadBalancingSettingsProperties - } - if lbsm.Name != nil { - objectMap["name"] = lbsm.Name - } - if lbsm.ID != nil { - objectMap["id"] = lbsm.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for LoadBalancingSettingsModel struct. -func (lbsm *LoadBalancingSettingsModel) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var loadBalancingSettingsProperties LoadBalancingSettingsProperties - err = json.Unmarshal(*v, &loadBalancingSettingsProperties) - if err != nil { - return err - } - lbsm.LoadBalancingSettingsProperties = &loadBalancingSettingsProperties - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - lbsm.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - lbsm.Type = &typeVar - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - lbsm.ID = &ID - } - } - } - - return nil -} - -// LoadBalancingSettingsProperties the JSON object that contains the properties required to create load -// balancing settings -type LoadBalancingSettingsProperties struct { - // ResourceState - Resource status. Possible values include: 'ResourceStateCreating', 'ResourceStateEnabling', 'ResourceStateEnabled', 'ResourceStateDisabling', 'ResourceStateDisabled', 'ResourceStateDeleting' - ResourceState ResourceState `json:"resourceState,omitempty"` - // SampleSize - The number of samples to consider for load balancing decisions - SampleSize *int32 `json:"sampleSize,omitempty"` - // SuccessfulSamplesRequired - The number of samples within the sample period that must succeed - SuccessfulSamplesRequired *int32 `json:"successfulSamplesRequired,omitempty"` - // AdditionalLatencyMilliseconds - The additional latency in milliseconds for probes to fall into the lowest latency bucket - AdditionalLatencyMilliseconds *int32 `json:"additionalLatencyMilliseconds,omitempty"` -} - -// LoadBalancingSettingsUpdateParameters round-Robin load balancing settings for a backend pool -type LoadBalancingSettingsUpdateParameters struct { - // SampleSize - The number of samples to consider for load balancing decisions - SampleSize *int32 `json:"sampleSize,omitempty"` - // SuccessfulSamplesRequired - The number of samples within the sample period that must succeed - SuccessfulSamplesRequired *int32 `json:"successfulSamplesRequired,omitempty"` - // AdditionalLatencyMilliseconds - The additional latency in milliseconds for probes to fall into the lowest latency bucket - AdditionalLatencyMilliseconds *int32 `json:"additionalLatencyMilliseconds,omitempty"` + return *page.pel.Value } -// ManagedRuleDefinition describes a managed rule definition. -type ManagedRuleDefinition struct { - // RuleID - READ-ONLY; Identifier for the managed rule. - RuleID *string `json:"ruleId,omitempty"` - // DefaultState - READ-ONLY; Describes the default state for the managed rule. Possible values include: 'ManagedRuleEnabledStateDisabled', 'ManagedRuleEnabledStateEnabled' - DefaultState ManagedRuleEnabledState `json:"defaultState,omitempty"` - // DefaultAction - READ-ONLY; Describes the default action to be applied when the managed rule matches. Possible values include: 'Allow', 'Block', 'Log', 'Redirect' - DefaultAction ActionType `json:"defaultAction,omitempty"` - // Description - READ-ONLY; Describes the functionality of the managed rule. - Description *string `json:"description,omitempty"` +// Creates a new instance of the PreconfiguredEndpointListPage type. +func NewPreconfiguredEndpointListPage(getNextPage func(context.Context, PreconfiguredEndpointList) (PreconfiguredEndpointList, error)) PreconfiguredEndpointListPage { + return PreconfiguredEndpointListPage{fn: getNextPage} } -// ManagedRuleGroupDefinition describes a managed rule group. -type ManagedRuleGroupDefinition struct { - // RuleGroupName - READ-ONLY; Name of the managed rule group. - RuleGroupName *string `json:"ruleGroupName,omitempty"` - // Description - READ-ONLY; Description of the managed rule group. +// PreconfiguredEndpointProperties defines the properties of a preconfigured endpoint +type PreconfiguredEndpointProperties struct { + // Description - The description of the endpoint Description *string `json:"description,omitempty"` - // Rules - READ-ONLY; List of rules within the managed rule group. - Rules *[]ManagedRuleDefinition `json:"rules,omitempty"` -} - -// ManagedRuleGroupOverride defines a managed rule group override setting. -type ManagedRuleGroupOverride struct { - // RuleGroupName - Describes the managed rule group to override. - RuleGroupName *string `json:"ruleGroupName,omitempty"` - // Rules - List of rules that will be disabled. If none specified, all rules in the group will be disabled. - Rules *[]ManagedRuleOverride `json:"rules,omitempty"` -} - -// ManagedRuleOverride defines a managed rule group override setting. -type ManagedRuleOverride struct { - // RuleID - Identifier for the managed rule. - RuleID *string `json:"ruleId,omitempty"` - // EnabledState - Describes if the managed rule is in enabled or disabled state. Defaults to Disabled if not specified. Possible values include: 'ManagedRuleEnabledStateDisabled', 'ManagedRuleEnabledStateEnabled' - EnabledState ManagedRuleEnabledState `json:"enabledState,omitempty"` - // Action - Describes the override action to be applied when rule matches. Possible values include: 'Allow', 'Block', 'Log', 'Redirect' - Action ActionType `json:"action,omitempty"` -} - -// ManagedRuleSet defines a managed rule set. -type ManagedRuleSet struct { - // RuleSetType - Defines the rule set type to use. - RuleSetType *string `json:"ruleSetType,omitempty"` - // RuleSetVersion - Defines the version of the rule set to use. - RuleSetVersion *string `json:"ruleSetVersion,omitempty"` - // RuleGroupOverrides - Defines the rule group overrides to apply to the rule set. - RuleGroupOverrides *[]ManagedRuleGroupOverride `json:"ruleGroupOverrides,omitempty"` + // Endpoint - The endpoint that is preconfigured + Endpoint *string `json:"endpoint,omitempty"` + // EndpointType - The type of endpoint. Possible values include: 'AFD', 'AzureRegion', 'CDN', 'ATM' + EndpointType EndpointType `json:"endpointType,omitempty"` + // Backend - The preconfigured endpoint backend + Backend *string `json:"backend,omitempty"` } -// ManagedRuleSetDefinition describes the a managed rule set definition. -type ManagedRuleSetDefinition struct { - // ManagedRuleSetDefinitionProperties - Properties for a managed rule set definition. - *ManagedRuleSetDefinitionProperties `json:"properties,omitempty"` +// Profile defines an Network Experiment Profile and lists of Experiments +type Profile struct { + autorest.Response `json:"-"` + // ProfileProperties - The properties of a Profile + *ProfileProperties `json:"properties,omitempty"` + // Etag - Gets a unique read-only string that changes whenever the resource is updated. + Etag *string `json:"etag,omitempty"` // ID - READ-ONLY; Resource ID. ID *string `json:"id,omitempty"` // Name - READ-ONLY; Resource name. @@ -1899,23 +3388,26 @@ type ManagedRuleSetDefinition struct { Tags map[string]*string `json:"tags"` } -// MarshalJSON is the custom marshaler for ManagedRuleSetDefinition. -func (mrsd ManagedRuleSetDefinition) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for Profile. +func (p Profile) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if mrsd.ManagedRuleSetDefinitionProperties != nil { - objectMap["properties"] = mrsd.ManagedRuleSetDefinitionProperties + if p.ProfileProperties != nil { + objectMap["properties"] = p.ProfileProperties } - if mrsd.Location != nil { - objectMap["location"] = mrsd.Location + if p.Etag != nil { + objectMap["etag"] = p.Etag } - if mrsd.Tags != nil { - objectMap["tags"] = mrsd.Tags + if p.Location != nil { + objectMap["location"] = p.Location + } + if p.Tags != nil { + objectMap["tags"] = p.Tags } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for ManagedRuleSetDefinition struct. -func (mrsd *ManagedRuleSetDefinition) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for Profile struct. +func (p *Profile) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -1925,12 +3417,21 @@ func (mrsd *ManagedRuleSetDefinition) UnmarshalJSON(body []byte) error { switch k { case "properties": if v != nil { - var managedRuleSetDefinitionProperties ManagedRuleSetDefinitionProperties - err = json.Unmarshal(*v, &managedRuleSetDefinitionProperties) + var profileProperties ProfileProperties + err = json.Unmarshal(*v, &profileProperties) if err != nil { return err } - mrsd.ManagedRuleSetDefinitionProperties = &managedRuleSetDefinitionProperties + p.ProfileProperties = &profileProperties + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + p.Etag = &etag } case "id": if v != nil { @@ -1939,7 +3440,7 @@ func (mrsd *ManagedRuleSetDefinition) UnmarshalJSON(body []byte) error { if err != nil { return err } - mrsd.ID = &ID + p.ID = &ID } case "name": if v != nil { @@ -1948,7 +3449,7 @@ func (mrsd *ManagedRuleSetDefinition) UnmarshalJSON(body []byte) error { if err != nil { return err } - mrsd.Name = &name + p.Name = &name } case "type": if v != nil { @@ -1957,7 +3458,7 @@ func (mrsd *ManagedRuleSetDefinition) UnmarshalJSON(body []byte) error { if err != nil { return err } - mrsd.Type = &typeVar + p.Type = &typeVar } case "location": if v != nil { @@ -1966,7 +3467,7 @@ func (mrsd *ManagedRuleSetDefinition) UnmarshalJSON(body []byte) error { if err != nil { return err } - mrsd.Location = &location + p.Location = &location } case "tags": if v != nil { @@ -1975,7 +3476,7 @@ func (mrsd *ManagedRuleSetDefinition) UnmarshalJSON(body []byte) error { if err != nil { return err } - mrsd.Tags = tags + p.Tags = tags } } } @@ -1983,27 +3484,27 @@ func (mrsd *ManagedRuleSetDefinition) UnmarshalJSON(body []byte) error { return nil } -// ManagedRuleSetDefinitionList list of managed rule set definitions available for use in a policy. -type ManagedRuleSetDefinitionList struct { +// ProfileList defines a list of Profiles. It contains a list of Profile objects and a URL link to get the +// next set of results. +type ProfileList struct { autorest.Response `json:"-"` - // Value - READ-ONLY; List of managed rule set definitions. - Value *[]ManagedRuleSetDefinition `json:"value,omitempty"` - // NextLink - URL to retrieve next set of managed rule set definitions. + // Value - READ-ONLY; List of Profiles within a resource group. + Value *[]Profile `json:"value,omitempty"` + // NextLink - URL to get the next set of Profile objects if there are any. NextLink *string `json:"nextLink,omitempty"` } -// ManagedRuleSetDefinitionListIterator provides access to a complete listing of ManagedRuleSetDefinition -// values. -type ManagedRuleSetDefinitionListIterator struct { +// ProfileListIterator provides access to a complete listing of Profile values. +type ProfileListIterator struct { i int - page ManagedRuleSetDefinitionListPage + page ProfileListPage } // NextWithContext advances to the next value. If there was an error making // the request the iterator does not advance and the error is returned. -func (iter *ManagedRuleSetDefinitionListIterator) NextWithContext(ctx context.Context) (err error) { +func (iter *ProfileListIterator) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ManagedRuleSetDefinitionListIterator.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/ProfileListIterator.NextWithContext") defer func() { sc := -1 if iter.Response().Response.Response != nil { @@ -2028,62 +3529,62 @@ func (iter *ManagedRuleSetDefinitionListIterator) NextWithContext(ctx context.Co // Next advances to the next value. If there was an error making // the request the iterator does not advance and the error is returned. // Deprecated: Use NextWithContext() instead. -func (iter *ManagedRuleSetDefinitionListIterator) Next() error { +func (iter *ProfileListIterator) Next() error { return iter.NextWithContext(context.Background()) } // NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ManagedRuleSetDefinitionListIterator) NotDone() bool { +func (iter ProfileListIterator) NotDone() bool { return iter.page.NotDone() && iter.i < len(iter.page.Values()) } // Response returns the raw server response from the last page request. -func (iter ManagedRuleSetDefinitionListIterator) Response() ManagedRuleSetDefinitionList { +func (iter ProfileListIterator) Response() ProfileList { return iter.page.Response() } // Value returns the current value or a zero-initialized value if the // iterator has advanced beyond the end of the collection. -func (iter ManagedRuleSetDefinitionListIterator) Value() ManagedRuleSetDefinition { +func (iter ProfileListIterator) Value() Profile { if !iter.page.NotDone() { - return ManagedRuleSetDefinition{} + return Profile{} } return iter.page.Values()[iter.i] } -// Creates a new instance of the ManagedRuleSetDefinitionListIterator type. -func NewManagedRuleSetDefinitionListIterator(page ManagedRuleSetDefinitionListPage) ManagedRuleSetDefinitionListIterator { - return ManagedRuleSetDefinitionListIterator{page: page} +// Creates a new instance of the ProfileListIterator type. +func NewProfileListIterator(page ProfileListPage) ProfileListIterator { + return ProfileListIterator{page: page} } // IsEmpty returns true if the ListResult contains no values. -func (mrsdl ManagedRuleSetDefinitionList) IsEmpty() bool { - return mrsdl.Value == nil || len(*mrsdl.Value) == 0 +func (pl ProfileList) IsEmpty() bool { + return pl.Value == nil || len(*pl.Value) == 0 } -// managedRuleSetDefinitionListPreparer prepares a request to retrieve the next set of results. +// profileListPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. -func (mrsdl ManagedRuleSetDefinitionList) managedRuleSetDefinitionListPreparer(ctx context.Context) (*http.Request, error) { - if mrsdl.NextLink == nil || len(to.String(mrsdl.NextLink)) < 1 { +func (pl ProfileList) profileListPreparer(ctx context.Context) (*http.Request, error) { + if pl.NextLink == nil || len(to.String(pl.NextLink)) < 1 { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), autorest.AsJSON(), autorest.AsGet(), - autorest.WithBaseURL(to.String(mrsdl.NextLink))) + autorest.WithBaseURL(to.String(pl.NextLink))) } -// ManagedRuleSetDefinitionListPage contains a page of ManagedRuleSetDefinition values. -type ManagedRuleSetDefinitionListPage struct { - fn func(context.Context, ManagedRuleSetDefinitionList) (ManagedRuleSetDefinitionList, error) - mrsdl ManagedRuleSetDefinitionList +// ProfileListPage contains a page of Profile values. +type ProfileListPage struct { + fn func(context.Context, ProfileList) (ProfileList, error) + pl ProfileList } // NextWithContext advances to the next page of values. If there was an error making // the request the page does not advance and the error is returned. -func (page *ManagedRuleSetDefinitionListPage) NextWithContext(ctx context.Context) (err error) { +func (page *ProfileListPage) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ManagedRuleSetDefinitionListPage.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/ProfileListPage.NextWithContext") defer func() { sc := -1 if page.Response().Response.Response != nil { @@ -2092,142 +3593,109 @@ func (page *ManagedRuleSetDefinitionListPage) NextWithContext(ctx context.Contex tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.mrsdl) + next, err := page.fn(ctx, page.pl) if err != nil { return err } - page.mrsdl = next + page.pl = next return nil } // Next advances to the next page of values. If there was an error making // the request the page does not advance and the error is returned. // Deprecated: Use NextWithContext() instead. -func (page *ManagedRuleSetDefinitionListPage) Next() error { +func (page *ProfileListPage) Next() error { return page.NextWithContext(context.Background()) } // NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ManagedRuleSetDefinitionListPage) NotDone() bool { - return !page.mrsdl.IsEmpty() +func (page ProfileListPage) NotDone() bool { + return !page.pl.IsEmpty() } // Response returns the raw server response from the last page request. -func (page ManagedRuleSetDefinitionListPage) Response() ManagedRuleSetDefinitionList { - return page.mrsdl +func (page ProfileListPage) Response() ProfileList { + return page.pl } // Values returns the slice of values for the current page or nil if there are no values. -func (page ManagedRuleSetDefinitionListPage) Values() []ManagedRuleSetDefinition { - if page.mrsdl.IsEmpty() { +func (page ProfileListPage) Values() []Profile { + if page.pl.IsEmpty() { return nil } - return *page.mrsdl.Value -} - -// Creates a new instance of the ManagedRuleSetDefinitionListPage type. -func NewManagedRuleSetDefinitionListPage(getNextPage func(context.Context, ManagedRuleSetDefinitionList) (ManagedRuleSetDefinitionList, error)) ManagedRuleSetDefinitionListPage { - return ManagedRuleSetDefinitionListPage{fn: getNextPage} -} - -// ManagedRuleSetDefinitionProperties properties for a managed rule set definition. -type ManagedRuleSetDefinitionProperties struct { - // ProvisioningState - READ-ONLY; Provisioning state of the managed rule set. - ProvisioningState *string `json:"provisioningState,omitempty"` - // RuleSetType - READ-ONLY; Type of the managed rule set. - RuleSetType *string `json:"ruleSetType,omitempty"` - // RuleSetVersion - READ-ONLY; Version of the managed rule set type. - RuleSetVersion *string `json:"ruleSetVersion,omitempty"` - // RuleGroups - READ-ONLY; Rule groups of the managed rule set. - RuleGroups *[]ManagedRuleGroupDefinition `json:"ruleGroups,omitempty"` + return *page.pl.Value } -// ManagedRuleSetList defines the list of managed rule sets for the policy. -type ManagedRuleSetList struct { - // ManagedRuleSets - List of rule sets. - ManagedRuleSets *[]ManagedRuleSet `json:"managedRuleSets,omitempty"` +// Creates a new instance of the ProfileListPage type. +func NewProfileListPage(getNextPage func(context.Context, ProfileList) (ProfileList, error)) ProfileListPage { + return ProfileListPage{fn: getNextPage} } -// MatchCondition define a match condition. -type MatchCondition struct { - // MatchVariable - Request variable to compare with. Possible values include: 'RemoteAddr', 'RequestMethod', 'QueryString', 'PostArgs', 'RequestURI', 'RequestHeader', 'RequestBody', 'Cookies', 'SocketAddr' - MatchVariable MatchVariable `json:"matchVariable,omitempty"` - // Selector - Match against a specific key from the QueryString, PostArgs, RequestHeader or Cookies variables. Default is null. - Selector *string `json:"selector,omitempty"` - // Operator - Comparison type to use for matching with the variable value. Possible values include: 'Any', 'IPMatch', 'GeoMatch', 'Equal', 'Contains', 'LessThan', 'GreaterThan', 'LessThanOrEqual', 'GreaterThanOrEqual', 'BeginsWith', 'EndsWith', 'RegEx' - Operator Operator `json:"operator,omitempty"` - // NegateCondition - Describes if the result of this condition should be negated. - NegateCondition *bool `json:"negateCondition,omitempty"` - // MatchValue - List of possible match values. - MatchValue *[]string `json:"matchValue,omitempty"` - // Transforms - List of transforms. - Transforms *[]TransformType `json:"transforms,omitempty"` +// ProfileProperties defines the properties of an experiment +type ProfileProperties struct { + // ResourceState - Resource status. Possible values include: 'NetworkExperimentResourceStateCreating', 'NetworkExperimentResourceStateEnabling', 'NetworkExperimentResourceStateEnabled', 'NetworkExperimentResourceStateDisabling', 'NetworkExperimentResourceStateDisabled', 'NetworkExperimentResourceStateDeleting' + ResourceState NetworkExperimentResourceState `json:"resourceState,omitempty"` + // EnabledState - The state of the Experiment. Possible values include: 'StateEnabled', 'StateDisabled' + EnabledState State `json:"enabledState,omitempty"` } -// PoliciesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type PoliciesCreateOrUpdateFuture struct { - azure.Future +// ProfileUpdateModel defines modifiable attributes of a Profile +type ProfileUpdateModel struct { + // ProfileUpdateProperties - The properties of a Profile + *ProfileUpdateProperties `json:"properties,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *PoliciesCreateOrUpdateFuture) Result(client PoliciesClient) (wafp WebApplicationFirewallPolicy, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.PoliciesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("frontdoor.PoliciesCreateOrUpdateFuture") - return +// MarshalJSON is the custom marshaler for ProfileUpdateModel. +func (pum ProfileUpdateModel) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pum.ProfileUpdateProperties != nil { + objectMap["properties"] = pum.ProfileUpdateProperties } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if wafp.Response.Response, err = future.GetResult(sender); err == nil && wafp.Response.Response.StatusCode != http.StatusNoContent { - wafp, err = client.CreateOrUpdateResponder(wafp.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.PoliciesCreateOrUpdateFuture", "Result", wafp.Response.Response, "Failure responding to request") - } + if pum.Tags != nil { + objectMap["tags"] = pum.Tags } - return -} - -// PoliciesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type PoliciesDeleteFuture struct { - azure.Future + return json.Marshal(objectMap) } -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *PoliciesDeleteFuture) Result(client PoliciesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) +// UnmarshalJSON is the custom unmarshaler for ProfileUpdateModel struct. +func (pum *ProfileUpdateModel) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) if err != nil { - err = autorest.NewErrorWithError(err, "frontdoor.PoliciesDeleteFuture", "Result", future.Response(), "Polling failure") - return + return err } - if !done { - err = azure.NewAsyncOpIncompleteError("frontdoor.PoliciesDeleteFuture") - return + for k, v := range m { + switch k { + case "properties": + if v != nil { + var profileUpdateProperties ProfileUpdateProperties + err = json.Unmarshal(*v, &profileUpdateProperties) + if err != nil { + return err + } + pum.ProfileUpdateProperties = &profileUpdateProperties + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + pum.Tags = tags + } + } } - ar.Response = future.Response() - return + + return nil } -// PolicySettings defines top-level WebApplicationFirewallPolicy configuration settings. -type PolicySettings struct { - // EnabledState - Describes if the policy is in enabled or disabled state. Defaults to Enabled if not specified. Possible values include: 'PolicyEnabledStateDisabled', 'PolicyEnabledStateEnabled' - EnabledState PolicyEnabledState `json:"enabledState,omitempty"` - // Mode - Describes if it is in detection mode or prevention mode at policy level. Possible values include: 'Prevention', 'Detection' - Mode PolicyMode `json:"mode,omitempty"` - // RedirectURL - If action type is redirect, this field represents redirect URL for the client. - RedirectURL *string `json:"redirectUrl,omitempty"` - // CustomBlockResponseStatusCode - If the action type is block, customer can override the response status code. - CustomBlockResponseStatusCode *int32 `json:"customBlockResponseStatusCode,omitempty"` - // CustomBlockResponseBody - If the action type is block, customer can override the response body. The body must be specified in base64 encoding. - CustomBlockResponseBody *string `json:"customBlockResponseBody,omitempty"` +// ProfileUpdateProperties defines the properties of an experiment +type ProfileUpdateProperties struct { + // EnabledState - The enabled state of the Profile. Possible values include: 'StateEnabled', 'StateDisabled' + EnabledState State `json:"enabledState,omitempty"` } // Properties the JSON object that contains the properties required to create an endpoint. @@ -2704,6 +4172,133 @@ func (toVar TagsObject) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// Timeseries defines the Timeseries +type Timeseries struct { + autorest.Response `json:"-"` + // TimeseriesProperties - The properties of a Timeseries + *TimeseriesProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource ID. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for Timeseries. +func (t Timeseries) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if t.TimeseriesProperties != nil { + objectMap["properties"] = t.TimeseriesProperties + } + if t.Location != nil { + objectMap["location"] = t.Location + } + if t.Tags != nil { + objectMap["tags"] = t.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Timeseries struct. +func (t *Timeseries) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var timeseriesProperties TimeseriesProperties + err = json.Unmarshal(*v, ×eriesProperties) + if err != nil { + return err + } + t.TimeseriesProperties = ×eriesProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + t.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + t.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + t.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + t.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + t.Tags = tags + } + } + } + + return nil +} + +// TimeseriesDataPoint defines a timeseries datapoint used in a timeseries +type TimeseriesDataPoint struct { + // DateTimeUTC - The DateTime of the Timeseries data point in UTC + DateTimeUTC *string `json:"dateTimeUTC,omitempty"` + // Value - The Value of the Timeseries data point + Value *float64 `json:"value,omitempty"` +} + +// TimeseriesProperties defines the properties of a timeseries +type TimeseriesProperties struct { + // Endpoint - The endpoint associated with the Timeseries data point + Endpoint *string `json:"endpoint,omitempty"` + // StartDateTimeUTC - The start DateTime of the Timeseries in UTC + StartDateTimeUTC *string `json:"startDateTimeUTC,omitempty"` + // EndDateTimeUTC - The end DateTime of the Timeseries in UTC + EndDateTimeUTC *string `json:"endDateTimeUTC,omitempty"` + // AggregationInterval - The aggregation interval of the Timeseries. Possible values include: 'Hourly', 'Daily' + AggregationInterval AggregationInterval `json:"aggregationInterval,omitempty"` + // TimeseriesType - The type of Timeseries. Possible values include: 'MeasurementCounts', 'LatencyP50', 'LatencyP75', 'LatencyP95' + TimeseriesType TimeseriesType `json:"timeseriesType,omitempty"` + // Country - The country associated with the Timeseries. Values are country ISO codes as specified here- https://www.iso.org/iso-3166-country-codes.html + Country *string `json:"country,omitempty"` + // TimeseriesData - The set of data points for the timeseries + TimeseriesData *[]TimeseriesDataPoint `json:"timeseriesData,omitempty"` +} + // UpdateParameters the properties needed to update a Front Door type UpdateParameters struct { // FriendlyName - A friendly name for the frontDoor diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2019-11-01/frontdoor/networkexperimentprofiles.go b/vendor/github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2019-11-01/frontdoor/networkexperimentprofiles.go new file mode 100644 index 000000000000..a99a02c005a6 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2019-11-01/frontdoor/networkexperimentprofiles.go @@ -0,0 +1,628 @@ +package frontdoor + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// NetworkExperimentProfilesClient is the frontDoor Client +type NetworkExperimentProfilesClient struct { + BaseClient +} + +// NewNetworkExperimentProfilesClient creates an instance of the NetworkExperimentProfilesClient client. +func NewNetworkExperimentProfilesClient(subscriptionID string) NetworkExperimentProfilesClient { + return NewNetworkExperimentProfilesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewNetworkExperimentProfilesClientWithBaseURI creates an instance of the NetworkExperimentProfilesClient client +// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign +// clouds, Azure stack). +func NewNetworkExperimentProfilesClientWithBaseURI(baseURI string, subscriptionID string) NetworkExperimentProfilesClient { + return NetworkExperimentProfilesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate sends the create or update request. +// Parameters: +// profileName - the Profile identifier associated with the Tenant and Partner +// resourceGroupName - name of the Resource group within the Azure subscription. +// parameters - an Network Experiment Profile +func (client NetworkExperimentProfilesClient) CreateOrUpdate(ctx context.Context, profileName string, resourceGroupName string, parameters Profile) (result NetworkExperimentProfilesCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/NetworkExperimentProfilesClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: profileName, + Constraints: []validation.Constraint{{Target: "profileName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("frontdoor.NetworkExperimentProfilesClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, profileName, resourceGroupName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.NetworkExperimentProfilesClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.NetworkExperimentProfilesClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client NetworkExperimentProfilesClient) CreateOrUpdatePreparer(ctx context.Context, profileName string, resourceGroupName string, parameters Profile) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "profileName": autorest.Encode("path", profileName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/NetworkExperimentProfiles/{profileName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client NetworkExperimentProfilesClient) CreateOrUpdateSender(req *http.Request) (future NetworkExperimentProfilesCreateOrUpdateFuture, err error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, sd...) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client NetworkExperimentProfilesClient) CreateOrUpdateResponder(resp *http.Response) (result Profile, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete sends the delete request. +// Parameters: +// resourceGroupName - name of the Resource group within the Azure subscription. +// profileName - the Profile identifier associated with the Tenant and Partner +func (client NetworkExperimentProfilesClient) Delete(ctx context.Context, resourceGroupName string, profileName string) (result NetworkExperimentProfilesDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/NetworkExperimentProfilesClient.Delete") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}, + {TargetValue: profileName, + Constraints: []validation.Constraint{{Target: "profileName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("frontdoor.NetworkExperimentProfilesClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, profileName) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.NetworkExperimentProfilesClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.NetworkExperimentProfilesClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client NetworkExperimentProfilesClient) DeletePreparer(ctx context.Context, resourceGroupName string, profileName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "profileName": autorest.Encode("path", profileName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/NetworkExperimentProfiles/{profileName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client NetworkExperimentProfilesClient) DeleteSender(req *http.Request) (future NetworkExperimentProfilesDeleteFuture, err error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, sd...) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client NetworkExperimentProfilesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get sends the get request. +// Parameters: +// resourceGroupName - name of the Resource group within the Azure subscription. +// profileName - the Profile identifier associated with the Tenant and Partner +func (client NetworkExperimentProfilesClient) Get(ctx context.Context, resourceGroupName string, profileName string) (result Profile, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/NetworkExperimentProfilesClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}, + {TargetValue: profileName, + Constraints: []validation.Constraint{{Target: "profileName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("frontdoor.NetworkExperimentProfilesClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, profileName) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.NetworkExperimentProfilesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "frontdoor.NetworkExperimentProfilesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.NetworkExperimentProfilesClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client NetworkExperimentProfilesClient) GetPreparer(ctx context.Context, resourceGroupName string, profileName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "profileName": autorest.Encode("path", profileName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/NetworkExperimentProfiles/{profileName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client NetworkExperimentProfilesClient) GetSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client NetworkExperimentProfilesClient) GetResponder(resp *http.Response) (result Profile, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List sends the list request. +func (client NetworkExperimentProfilesClient) List(ctx context.Context) (result ProfileListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/NetworkExperimentProfilesClient.List") + defer func() { + sc := -1 + if result.pl.Response.Response != nil { + sc = result.pl.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.NetworkExperimentProfilesClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.pl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "frontdoor.NetworkExperimentProfilesClient", "List", resp, "Failure sending request") + return + } + + result.pl, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.NetworkExperimentProfilesClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client NetworkExperimentProfilesClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/NetworkExperimentProfiles", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client NetworkExperimentProfilesClient) ListSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client NetworkExperimentProfilesClient) ListResponder(resp *http.Response) (result ProfileList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client NetworkExperimentProfilesClient) listNextResults(ctx context.Context, lastResults ProfileList) (result ProfileList, err error) { + req, err := lastResults.profileListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "frontdoor.NetworkExperimentProfilesClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "frontdoor.NetworkExperimentProfilesClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.NetworkExperimentProfilesClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client NetworkExperimentProfilesClient) ListComplete(ctx context.Context) (result ProfileListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/NetworkExperimentProfilesClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} + +// ListByResourceGroup sends the list by resource group request. +// Parameters: +// resourceGroupName - name of the Resource group within the Azure subscription. +func (client NetworkExperimentProfilesClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result ProfileListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/NetworkExperimentProfilesClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.pl.Response.Response != nil { + sc = result.pl.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("frontdoor.NetworkExperimentProfilesClient", "ListByResourceGroup", err.Error()) + } + + result.fn = client.listByResourceGroupNextResults + req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.NetworkExperimentProfilesClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.pl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "frontdoor.NetworkExperimentProfilesClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result.pl, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.NetworkExperimentProfilesClient", "ListByResourceGroup", resp, "Failure responding to request") + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client NetworkExperimentProfilesClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/NetworkExperimentProfiles", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the +// http.Response Body if it receives an error. +func (client NetworkExperimentProfilesClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always +// closes the http.Response Body. +func (client NetworkExperimentProfilesClient) ListByResourceGroupResponder(resp *http.Response) (result ProfileList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByResourceGroupNextResults retrieves the next set of results, if any. +func (client NetworkExperimentProfilesClient) listByResourceGroupNextResults(ctx context.Context, lastResults ProfileList) (result ProfileList, err error) { + req, err := lastResults.profileListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "frontdoor.NetworkExperimentProfilesClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "frontdoor.NetworkExperimentProfilesClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.NetworkExperimentProfilesClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client NetworkExperimentProfilesClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result ProfileListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/NetworkExperimentProfilesClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) + return +} + +// Update updates an NetworkExperimentProfiles +// Parameters: +// resourceGroupName - name of the Resource group within the Azure subscription. +// profileName - the Profile identifier associated with the Tenant and Partner +// parameters - the Profile Update Model +func (client NetworkExperimentProfilesClient) Update(ctx context.Context, resourceGroupName string, profileName string, parameters ProfileUpdateModel) (result NetworkExperimentProfilesUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/NetworkExperimentProfilesClient.Update") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}, + {TargetValue: profileName, + Constraints: []validation.Constraint{{Target: "profileName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("frontdoor.NetworkExperimentProfilesClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, profileName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.NetworkExperimentProfilesClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.NetworkExperimentProfilesClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client NetworkExperimentProfilesClient) UpdatePreparer(ctx context.Context, resourceGroupName string, profileName string, parameters ProfileUpdateModel) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "profileName": autorest.Encode("path", profileName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/NetworkExperimentProfiles/{profileName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client NetworkExperimentProfilesClient) UpdateSender(req *http.Request) (future NetworkExperimentProfilesUpdateFuture, err error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, sd...) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client NetworkExperimentProfilesClient) UpdateResponder(resp *http.Response) (result Profile, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2019-04-01/frontdoor/policies.go b/vendor/github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2019-11-01/frontdoor/policies.go similarity index 98% rename from vendor/github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2019-04-01/frontdoor/policies.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2019-11-01/frontdoor/policies.go index 89c4fdb4da6d..30bc6ceaf79e 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2019-04-01/frontdoor/policies.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2019-11-01/frontdoor/policies.go @@ -36,7 +36,8 @@ func NewPoliciesClient(subscriptionID string) PoliciesClient { return NewPoliciesClientWithBaseURI(DefaultBaseURI, subscriptionID) } -// NewPoliciesClientWithBaseURI creates an instance of the PoliciesClient client. +// NewPoliciesClientWithBaseURI creates an instance of the PoliciesClient client using a custom endpoint. Use this +// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). func NewPoliciesClientWithBaseURI(baseURI string, subscriptionID string) PoliciesClient { return PoliciesClient{NewWithBaseURI(baseURI, subscriptionID)} } @@ -97,7 +98,7 @@ func (client PoliciesClient) CreateOrUpdatePreparer(ctx context.Context, resourc "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-10-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -186,7 +187,7 @@ func (client PoliciesClient) DeletePreparer(ctx context.Context, resourceGroupNa "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-10-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -278,7 +279,7 @@ func (client PoliciesClient) GetPreparer(ctx context.Context, resourceGroupName "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-10-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -362,7 +363,7 @@ func (client PoliciesClient) ListPreparer(ctx context.Context, resourceGroupName "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-03-01" + const APIVersion = "2019-10-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2019-11-01/frontdoor/preconfiguredendpoints.go b/vendor/github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2019-11-01/frontdoor/preconfiguredendpoints.go new file mode 100644 index 000000000000..4d1779ec21c1 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2019-11-01/frontdoor/preconfiguredendpoints.go @@ -0,0 +1,169 @@ +package frontdoor + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// PreconfiguredEndpointsClient is the frontDoor Client +type PreconfiguredEndpointsClient struct { + BaseClient +} + +// NewPreconfiguredEndpointsClient creates an instance of the PreconfiguredEndpointsClient client. +func NewPreconfiguredEndpointsClient(subscriptionID string) PreconfiguredEndpointsClient { + return NewPreconfiguredEndpointsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewPreconfiguredEndpointsClientWithBaseURI creates an instance of the PreconfiguredEndpointsClient client using a +// custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, +// Azure stack). +func NewPreconfiguredEndpointsClientWithBaseURI(baseURI string, subscriptionID string) PreconfiguredEndpointsClient { + return PreconfiguredEndpointsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// List sends the list request. +// Parameters: +// resourceGroupName - name of the Resource group within the Azure subscription. +// profileName - the Profile identifier associated with the Tenant and Partner +func (client PreconfiguredEndpointsClient) List(ctx context.Context, resourceGroupName string, profileName string) (result PreconfiguredEndpointListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PreconfiguredEndpointsClient.List") + defer func() { + sc := -1 + if result.pel.Response.Response != nil { + sc = result.pel.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}, + {TargetValue: profileName, + Constraints: []validation.Constraint{{Target: "profileName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("frontdoor.PreconfiguredEndpointsClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName, profileName) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.PreconfiguredEndpointsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.pel.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "frontdoor.PreconfiguredEndpointsClient", "List", resp, "Failure sending request") + return + } + + result.pel, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.PreconfiguredEndpointsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client PreconfiguredEndpointsClient) ListPreparer(ctx context.Context, resourceGroupName string, profileName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "profileName": autorest.Encode("path", profileName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/NetworkExperimentProfiles/{profileName}/PreconfiguredEndpoints", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client PreconfiguredEndpointsClient) ListSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client PreconfiguredEndpointsClient) ListResponder(resp *http.Response) (result PreconfiguredEndpointList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client PreconfiguredEndpointsClient) listNextResults(ctx context.Context, lastResults PreconfiguredEndpointList) (result PreconfiguredEndpointList, err error) { + req, err := lastResults.preconfiguredEndpointListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "frontdoor.PreconfiguredEndpointsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "frontdoor.PreconfiguredEndpointsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.PreconfiguredEndpointsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client PreconfiguredEndpointsClient) ListComplete(ctx context.Context, resourceGroupName string, profileName string) (result PreconfiguredEndpointListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PreconfiguredEndpointsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, resourceGroupName, profileName) + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2019-11-01/frontdoor/reports.go b/vendor/github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2019-11-01/frontdoor/reports.go new file mode 100644 index 000000000000..96081ac5c0b1 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2019-11-01/frontdoor/reports.go @@ -0,0 +1,254 @@ +package frontdoor + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/date" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReportsClient is the frontDoor Client +type ReportsClient struct { + BaseClient +} + +// NewReportsClient creates an instance of the ReportsClient client. +func NewReportsClient(subscriptionID string) ReportsClient { + return NewReportsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewReportsClientWithBaseURI creates an instance of the ReportsClient client using a custom endpoint. Use this when +// interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewReportsClientWithBaseURI(baseURI string, subscriptionID string) ReportsClient { + return ReportsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// GetLatencyScorecards sends the get latency scorecards request. +// Parameters: +// resourceGroupName - name of the Resource group within the Azure subscription. +// profileName - the Profile identifier associated with the Tenant and Partner +// experimentName - the Experiment identifier associated with the Experiment +// aggregationInterval - the aggregation interval of the Latency Scorecard +// endDateTimeUTC - the end DateTime of the Latency Scorecard in UTC +// country - the country associated with the Latency Scorecard. Values are country ISO codes as specified here- +// https://www.iso.org/iso-3166-country-codes.html +func (client ReportsClient) GetLatencyScorecards(ctx context.Context, resourceGroupName string, profileName string, experimentName string, aggregationInterval LatencyScorecardAggregationInterval, endDateTimeUTC string, country string) (result LatencyScorecard, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReportsClient.GetLatencyScorecards") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}, + {TargetValue: profileName, + Constraints: []validation.Constraint{{Target: "profileName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}, + {TargetValue: experimentName, + Constraints: []validation.Constraint{{Target: "experimentName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("frontdoor.ReportsClient", "GetLatencyScorecards", err.Error()) + } + + req, err := client.GetLatencyScorecardsPreparer(ctx, resourceGroupName, profileName, experimentName, aggregationInterval, endDateTimeUTC, country) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.ReportsClient", "GetLatencyScorecards", nil, "Failure preparing request") + return + } + + resp, err := client.GetLatencyScorecardsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "frontdoor.ReportsClient", "GetLatencyScorecards", resp, "Failure sending request") + return + } + + result, err = client.GetLatencyScorecardsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.ReportsClient", "GetLatencyScorecards", resp, "Failure responding to request") + } + + return +} + +// GetLatencyScorecardsPreparer prepares the GetLatencyScorecards request. +func (client ReportsClient) GetLatencyScorecardsPreparer(ctx context.Context, resourceGroupName string, profileName string, experimentName string, aggregationInterval LatencyScorecardAggregationInterval, endDateTimeUTC string, country string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "experimentName": autorest.Encode("path", experimentName), + "profileName": autorest.Encode("path", profileName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "aggregationInterval": autorest.Encode("query", aggregationInterval), + "api-version": APIVersion, + } + if len(endDateTimeUTC) > 0 { + queryParameters["endDateTimeUTC"] = autorest.Encode("query", endDateTimeUTC) + } + if len(country) > 0 { + queryParameters["country"] = autorest.Encode("query", country) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/NetworkExperimentProfiles/{profileName}/Experiments/{experimentName}/LatencyScorecard", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetLatencyScorecardsSender sends the GetLatencyScorecards request. The method will close the +// http.Response Body if it receives an error. +func (client ReportsClient) GetLatencyScorecardsSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// GetLatencyScorecardsResponder handles the response to the GetLatencyScorecards request. The method always +// closes the http.Response Body. +func (client ReportsClient) GetLatencyScorecardsResponder(resp *http.Response) (result LatencyScorecard, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetTimeseries sends the get timeseries request. +// Parameters: +// resourceGroupName - name of the Resource group within the Azure subscription. +// profileName - the Profile identifier associated with the Tenant and Partner +// experimentName - the Experiment identifier associated with the Experiment +// startDateTimeUTC - the start DateTime of the Timeseries in UTC +// endDateTimeUTC - the end DateTime of the Timeseries in UTC +// aggregationInterval - the aggregation interval of the Timeseries +// timeseriesType - the type of Timeseries +// endpoint - the specific endpoint +// country - the country associated with the Timeseries. Values are country ISO codes as specified here- +// https://www.iso.org/iso-3166-country-codes.html +func (client ReportsClient) GetTimeseries(ctx context.Context, resourceGroupName string, profileName string, experimentName string, startDateTimeUTC date.Time, endDateTimeUTC date.Time, aggregationInterval TimeseriesAggregationInterval, timeseriesType TimeseriesType, endpoint string, country string) (result Timeseries, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReportsClient.GetTimeseries") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}, + {TargetValue: profileName, + Constraints: []validation.Constraint{{Target: "profileName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}, + {TargetValue: experimentName, + Constraints: []validation.Constraint{{Target: "experimentName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("frontdoor.ReportsClient", "GetTimeseries", err.Error()) + } + + req, err := client.GetTimeseriesPreparer(ctx, resourceGroupName, profileName, experimentName, startDateTimeUTC, endDateTimeUTC, aggregationInterval, timeseriesType, endpoint, country) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.ReportsClient", "GetTimeseries", nil, "Failure preparing request") + return + } + + resp, err := client.GetTimeseriesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "frontdoor.ReportsClient", "GetTimeseries", resp, "Failure sending request") + return + } + + result, err = client.GetTimeseriesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.ReportsClient", "GetTimeseries", resp, "Failure responding to request") + } + + return +} + +// GetTimeseriesPreparer prepares the GetTimeseries request. +func (client ReportsClient) GetTimeseriesPreparer(ctx context.Context, resourceGroupName string, profileName string, experimentName string, startDateTimeUTC date.Time, endDateTimeUTC date.Time, aggregationInterval TimeseriesAggregationInterval, timeseriesType TimeseriesType, endpoint string, country string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "experimentName": autorest.Encode("path", experimentName), + "profileName": autorest.Encode("path", profileName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "aggregationInterval": autorest.Encode("query", aggregationInterval), + "api-version": APIVersion, + "endDateTimeUTC": autorest.Encode("query", endDateTimeUTC), + "startDateTimeUTC": autorest.Encode("query", startDateTimeUTC), + "timeseriesType": autorest.Encode("query", timeseriesType), + } + if len(endpoint) > 0 { + queryParameters["endpoint"] = autorest.Encode("query", endpoint) + } + if len(country) > 0 { + queryParameters["country"] = autorest.Encode("query", country) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/NetworkExperimentProfiles/{profileName}/Experiments/{experimentName}/Timeseries", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetTimeseriesSender sends the GetTimeseries request. The method will close the +// http.Response Body if it receives an error. +func (client ReportsClient) GetTimeseriesSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// GetTimeseriesResponder handles the response to the GetTimeseries request. The method always +// closes the http.Response Body. +func (client ReportsClient) GetTimeseriesResponder(resp *http.Response) (result Timeseries, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2019-04-01/frontdoor/version.go b/vendor/github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2019-11-01/frontdoor/version.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2019-04-01/frontdoor/version.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2019-11-01/frontdoor/version.go index 402567522ba3..029b01286208 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2019-04-01/frontdoor/version.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2019-11-01/frontdoor/version.go @@ -21,7 +21,7 @@ import "github.com/Azure/azure-sdk-for-go/version" // UserAgent returns the UserAgent string to use when sending http.Requests. func UserAgent() string { - return "Azure-SDK-For-Go/" + version.Number + " frontdoor/2019-04-01" + return "Azure-SDK-For-Go/" + version.Number + " frontdoor/2019-11-01" } // Version returns the semantic version (see http://semver.org) of the client. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/version/version.go b/vendor/github.com/Azure/azure-sdk-for-go/version/version.go index cde980c3ae06..2a72da3b1411 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/version/version.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/version/version.go @@ -18,4 +18,4 @@ package version // Changes may cause incorrect behavior and will be lost if the code is regenerated. // Number contains the semantic version of this SDK. -const Number = "v38.0.0" +const Number = "v38.1.0" diff --git a/vendor/modules.txt b/vendor/modules.txt index 6174ef8038e1..f3d0c4b2c367 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -6,7 +6,7 @@ cloud.google.com/go/internal/optional cloud.google.com/go/internal/trace cloud.google.com/go/internal/version cloud.google.com/go/storage -# github.com/Azure/azure-sdk-for-go v38.0.0+incompatible +# github.com/Azure/azure-sdk-for-go v38.1.0+incompatible github.com/Azure/azure-sdk-for-go/profiles/2017-03-09/resources/mgmt/resources github.com/Azure/azure-sdk-for-go/services/analysisservices/mgmt/2017-08-01/analysisservices github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement @@ -30,7 +30,7 @@ github.com/Azure/azure-sdk-for-go/services/devspaces/mgmt/2019-04-01/devspaces github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2016-05-15/dtl github.com/Azure/azure-sdk-for-go/services/dns/mgmt/2018-05-01/dns github.com/Azure/azure-sdk-for-go/services/eventhub/mgmt/2017-04-01/eventhub -github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2019-04-01/frontdoor +github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2019-11-01/frontdoor github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2019-09-16/healthcareapis github.com/Azure/azure-sdk-for-go/services/keyvault/2016-10-01/keyvault