From d5b786a709eab30fe308987146abb56503823369 Mon Sep 17 00:00:00 2001 From: tombuildsstuff Date: Wed, 17 Apr 2019 07:55:37 +0200 Subject: [PATCH] downgrading the security sdk --- azurerm/config.go | 2 +- .../resource_arm_security_center_contact.go | 2 +- ...rm_security_center_subscription_pricing.go | 8 +- ...curity_center_subscription_pricing_test.go | 2 +- .../resource_arm_security_center_workspace.go | 4 +- .../security/advancedthreatprotection.go | 0 .../mgmt/{v2.0 => v1.0}/security/alerts.go | 16 +- .../security/allowedconnections.go | 0 .../security/autoprovisioningsettings.go | 0 .../mgmt/{v2.0 => v1.0}/security/client.go | 0 .../{v2.0 => v1.0}/security/compliances.go | 0 .../mgmt/{v2.0 => v1.0}/security/contacts.go | 0 .../security/discoveredsecuritysolutions.go | 0 .../security/externalsecuritysolutions.go | 0 .../security/informationprotectionpolicies.go | 0 .../security/jitnetworkaccesspolicies.go | 0 .../mgmt/{v2.0 => v1.0}/security/locations.go | 0 .../mgmt/{v2.0 => v1.0}/security/models.go | 159 ++++- .../{v2.0 => v1.0}/security/operations.go | 0 .../security/mgmt/v1.0/security/pricings.go | 627 ++++++++++++++++++ .../mgmt/{v2.0 => v1.0}/security/settings.go | 0 .../mgmt/{v2.0 => v1.0}/security/tasks.go | 0 .../mgmt/{v2.0 => v1.0}/security/topology.go | 0 .../mgmt/{v2.0 => v1.0}/security/version.go | 2 +- .../security/workspacesettings.go | 0 .../security/mgmt/v2.0/security/pricings.go | 285 -------- vendor/modules.txt | 2 +- 27 files changed, 794 insertions(+), 315 deletions(-) rename vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/{v2.0 => v1.0}/security/advancedthreatprotection.go (100%) rename vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/{v2.0 => v1.0}/security/alerts.go (99%) rename vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/{v2.0 => v1.0}/security/allowedconnections.go (100%) rename vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/{v2.0 => v1.0}/security/autoprovisioningsettings.go (100%) rename vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/{v2.0 => v1.0}/security/client.go (100%) rename vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/{v2.0 => v1.0}/security/compliances.go (100%) rename vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/{v2.0 => v1.0}/security/contacts.go (100%) rename vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/{v2.0 => v1.0}/security/discoveredsecuritysolutions.go (100%) rename vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/{v2.0 => v1.0}/security/externalsecuritysolutions.go (100%) rename vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/{v2.0 => v1.0}/security/informationprotectionpolicies.go (100%) rename vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/{v2.0 => v1.0}/security/jitnetworkaccesspolicies.go (100%) rename vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/{v2.0 => v1.0}/security/locations.go (100%) rename vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/{v2.0 => v1.0}/security/models.go (97%) rename vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/{v2.0 => v1.0}/security/operations.go (100%) create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v1.0/security/pricings.go rename vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/{v2.0 => v1.0}/security/settings.go (100%) rename vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/{v2.0 => v1.0}/security/tasks.go (100%) rename vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/{v2.0 => v1.0}/security/topology.go (100%) rename vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/{v2.0 => v1.0}/security/version.go (94%) rename vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/{v2.0 => v1.0}/security/workspacesettings.go (100%) delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v2.0/security/pricings.go diff --git a/azurerm/config.go b/azurerm/config.go index 1843ef9b2733..1bc844d04f9c 100644 --- a/azurerm/config.go +++ b/azurerm/config.go @@ -49,7 +49,7 @@ import ( "github.com/Azure/azure-sdk-for-go/services/preview/operationalinsights/mgmt/2015-11-01-preview/operationalinsights" "github.com/Azure/azure-sdk-for-go/services/preview/operationsmanagement/mgmt/2015-11-01-preview/operationsmanagement" "github.com/Azure/azure-sdk-for-go/services/preview/resources/mgmt/2018-03-01-preview/managementgroups" - "github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v2.0/security" + "github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v1.0/security" "github.com/Azure/azure-sdk-for-go/services/preview/signalr/mgmt/2018-03-01-preview/signalr" "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2015-05-01-preview/sql" MsSql "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2017-10-01-preview/sql" diff --git a/azurerm/resource_arm_security_center_contact.go b/azurerm/resource_arm_security_center_contact.go index 0cf82e76fab3..f5e29fc266dc 100644 --- a/azurerm/resource_arm_security_center_contact.go +++ b/azurerm/resource_arm_security_center_contact.go @@ -6,7 +6,7 @@ import ( "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/tf" - "github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v2.0/security" + "github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v1.0/security" "github.com/hashicorp/terraform/helper/schema" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/validate" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" diff --git a/azurerm/resource_arm_security_center_subscription_pricing.go b/azurerm/resource_arm_security_center_subscription_pricing.go index 86a229635285..55ff2f7bb6e1 100644 --- a/azurerm/resource_arm_security_center_subscription_pricing.go +++ b/azurerm/resource_arm_security_center_subscription_pricing.go @@ -4,7 +4,7 @@ import ( "fmt" "log" - "github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v2.0/security" + "github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v1.0/security" "github.com/hashicorp/terraform/helper/schema" "github.com/hashicorp/terraform/helper/validation" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" @@ -53,11 +53,11 @@ func resourceArmSecurityCenterSubscriptionPricingUpdate(d *schema.ResourceData, }, } - if _, err := client.Update(ctx, name, pricing); err != nil { + if _, err := client.UpdateSubscriptionPricing(ctx, name, pricing); err != nil { return fmt.Errorf("Error creating/updating Security Center Subscription pricing: %+v", err) } - resp, err := client.Get(ctx, name) + resp, err := client.GetSubscriptionPricing(ctx, name) if err != nil { return fmt.Errorf("Error reading Security Center Subscription pricing: %+v", err) } @@ -74,7 +74,7 @@ func resourceArmSecurityCenterSubscriptionPricingRead(d *schema.ResourceData, me client := meta.(*ArmClient).securityCenterPricingClient ctx := meta.(*ArmClient).StopContext - resp, err := client.Get(ctx, securityCenterSubscriptionPricingName) + resp, err := client.GetSubscriptionPricing(ctx, securityCenterSubscriptionPricingName) if err != nil { if utils.ResponseWasNotFound(resp.Response) { log.Printf("[DEBUG] Security Center Subscription was not found: %v", err) diff --git a/azurerm/resource_arm_security_center_subscription_pricing_test.go b/azurerm/resource_arm_security_center_subscription_pricing_test.go index 74628cd80458..38a9235b83e9 100644 --- a/azurerm/resource_arm_security_center_subscription_pricing_test.go +++ b/azurerm/resource_arm_security_center_subscription_pricing_test.go @@ -56,7 +56,7 @@ func testCheckAzureRMSecurityCenterSubscriptionPricingExists(resourceName string pricingName := rs.Primary.Attributes["pricings"] - resp, err := client.Get(ctx, pricingName) + resp, err := client.GetSubscriptionPricing(ctx, pricingName) if err != nil { if utils.ResponseWasNotFound(resp.Response) { return fmt.Errorf("Security Center Subscription Pricing %q was not found: %+v", pricingName, err) diff --git a/azurerm/resource_arm_security_center_workspace.go b/azurerm/resource_arm_security_center_workspace.go index 4b5c55e8bfc4..de88a22546db 100644 --- a/azurerm/resource_arm_security_center_workspace.go +++ b/azurerm/resource_arm_security_center_workspace.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v2.0/security" + "github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v1.0/security" "github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/helper/schema" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" @@ -67,7 +67,7 @@ func resourceArmSecurityCenterWorkspaceCreateUpdate(d *schema.ResourceData, meta //get pricing tier, workspace can only be configured when tier is not Free. //API does not error, it just doesn't set the workspace scope - price, err := priceClient.Get(ctx, securityCenterSubscriptionPricingName) + price, err := priceClient.GetSubscriptionPricing(ctx, securityCenterSubscriptionPricingName) if err != nil { return fmt.Errorf("Error reading Security Center Subscription pricing: %+v", err) } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v2.0/security/advancedthreatprotection.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v1.0/security/advancedthreatprotection.go similarity index 100% rename from vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v2.0/security/advancedthreatprotection.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v1.0/security/advancedthreatprotection.go diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v2.0/security/alerts.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v1.0/security/alerts.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v2.0/security/alerts.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v1.0/security/alerts.go index 6713dbfeccf9..81dcc08f63a0 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v2.0/security/alerts.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v1.0/security/alerts.go @@ -97,7 +97,7 @@ func (client AlertsClient) GetResourceGroupLevelAlertsPreparer(ctx context.Conte "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-01-01" + const APIVersion = "2015-06-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -179,7 +179,7 @@ func (client AlertsClient) GetSubscriptionLevelAlertPreparer(ctx context.Context "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-01-01" + const APIVersion = "2015-06-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -262,7 +262,7 @@ func (client AlertsClient) ListPreparer(ctx context.Context, filter string, sele "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-01-01" + const APIVersion = "2015-06-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -398,7 +398,7 @@ func (client AlertsClient) ListByResourceGroupPreparer(ctx context.Context, reso "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-01-01" + const APIVersion = "2015-06-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -536,7 +536,7 @@ func (client AlertsClient) ListResourceGroupLevelAlertsByRegionPreparer(ctx cont "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-01-01" + const APIVersion = "2015-06-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -667,7 +667,7 @@ func (client AlertsClient) ListSubscriptionLevelAlertsByRegionPreparer(ctx conte "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-01-01" + const APIVersion = "2015-06-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -804,7 +804,7 @@ func (client AlertsClient) UpdateResourceGroupLevelAlertStatePreparer(ctx contex "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-01-01" + const APIVersion = "2015-06-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -887,7 +887,7 @@ func (client AlertsClient) UpdateSubscriptionLevelAlertStatePreparer(ctx context "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-01-01" + const APIVersion = "2015-06-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v2.0/security/allowedconnections.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v1.0/security/allowedconnections.go similarity index 100% rename from vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v2.0/security/allowedconnections.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v1.0/security/allowedconnections.go diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v2.0/security/autoprovisioningsettings.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v1.0/security/autoprovisioningsettings.go similarity index 100% rename from vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v2.0/security/autoprovisioningsettings.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v1.0/security/autoprovisioningsettings.go diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v2.0/security/client.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v1.0/security/client.go similarity index 100% rename from vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v2.0/security/client.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v1.0/security/client.go diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v2.0/security/compliances.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v1.0/security/compliances.go similarity index 100% rename from vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v2.0/security/compliances.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v1.0/security/compliances.go diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v2.0/security/contacts.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v1.0/security/contacts.go similarity index 100% rename from vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v2.0/security/contacts.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v1.0/security/contacts.go diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v2.0/security/discoveredsecuritysolutions.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v1.0/security/discoveredsecuritysolutions.go similarity index 100% rename from vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v2.0/security/discoveredsecuritysolutions.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v1.0/security/discoveredsecuritysolutions.go diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v2.0/security/externalsecuritysolutions.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v1.0/security/externalsecuritysolutions.go similarity index 100% rename from vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v2.0/security/externalsecuritysolutions.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v1.0/security/externalsecuritysolutions.go diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v2.0/security/informationprotectionpolicies.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v1.0/security/informationprotectionpolicies.go similarity index 100% rename from vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v2.0/security/informationprotectionpolicies.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v1.0/security/informationprotectionpolicies.go diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v2.0/security/jitnetworkaccesspolicies.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v1.0/security/jitnetworkaccesspolicies.go similarity index 100% rename from vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v2.0/security/jitnetworkaccesspolicies.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v1.0/security/jitnetworkaccesspolicies.go diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v2.0/security/locations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v1.0/security/locations.go similarity index 100% rename from vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v2.0/security/locations.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v1.0/security/locations.go diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v2.0/security/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v1.0/security/models.go similarity index 97% rename from vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v2.0/security/models.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v1.0/security/models.go index 885cc3123c2c..53ad84f7a5ef 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v2.0/security/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v1.0/security/models.go @@ -29,7 +29,7 @@ import ( ) // The package's fully qualified name. -const fqdn = "github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v2.0/security" +const fqdn = "github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v1.0/security" // AadConnectivityState enumerates the values for aad connectivity state. type AadConnectivityState string @@ -201,17 +201,17 @@ type ReportedSeverity string const ( // High ... High ReportedSeverity = "High" - // Informational ... - Informational ReportedSeverity = "Informational" + // Information ... + Information ReportedSeverity = "Information" // Low ... Low ReportedSeverity = "Low" - // Medium ... - Medium ReportedSeverity = "Medium" + // Silent ... + Silent ReportedSeverity = "Silent" ) // PossibleReportedSeverityValues returns an array of possible values for the ReportedSeverity const type. func PossibleReportedSeverityValues() []ReportedSeverity { - return []ReportedSeverity{High, Informational, Low, Medium} + return []ReportedSeverity{High, Information, Low, Silent} } // SettingKind enumerates the values for setting kind. @@ -739,7 +739,7 @@ type AlertProperties struct { RemediationSteps *string `json:"remediationSteps,omitempty"` // ActionTaken - The action that was taken as a response to the alert (Active, Blocked etc.) ActionTaken *string `json:"actionTaken,omitempty"` - // ReportedSeverity - Estimated severity of this alert. Possible values include: 'Informational', 'Low', 'Medium', 'High' + // ReportedSeverity - Estimated severity of this alert. Possible values include: 'Silent', 'Information', 'Low', 'High' ReportedSeverity ReportedSeverity `json:"reportedSeverity,omitempty"` // CompromisedEntity - The entity that the incident happened on CompromisedEntity *string `json:"compromisedEntity,omitempty"` @@ -4027,14 +4027,151 @@ type PricingList struct { autorest.Response `json:"-"` // Value - List of pricing configurations Value *[]Pricing `json:"value,omitempty"` + // NextLink - The URI to fetch the next page. + NextLink *string `json:"nextLink,omitempty"` +} + +// PricingListIterator provides access to a complete listing of Pricing values. +type PricingListIterator struct { + i int + page PricingListPage +} + +// 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 *PricingListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PricingListIterator.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 *PricingListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter PricingListIterator) 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 PricingListIterator) Response() PricingList { + 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 PricingListIterator) Value() Pricing { + if !iter.page.NotDone() { + return Pricing{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the PricingListIterator type. +func NewPricingListIterator(page PricingListPage) PricingListIterator { + return PricingListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (pl PricingList) IsEmpty() bool { + return pl.Value == nil || len(*pl.Value) == 0 +} + +// pricingListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (pl PricingList) pricingListPreparer(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(pl.NextLink))) +} + +// PricingListPage contains a page of Pricing values. +type PricingListPage struct { + fn func(context.Context, PricingList) (PricingList, error) + pl PricingList +} + +// 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 *PricingListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PricingListPage.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.pl) + if err != nil { + return err + } + 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 *PricingListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page PricingListPage) NotDone() bool { + return !page.pl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page PricingListPage) Response() PricingList { + return page.pl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page PricingListPage) Values() []Pricing { + if page.pl.IsEmpty() { + return nil + } + return *page.pl.Value +} + +// Creates a new instance of the PricingListPage type. +func NewPricingListPage(getNextPage func(context.Context, PricingList) (PricingList, error)) PricingListPage { + return PricingListPage{fn: getNextPage} } -// PricingProperties pricing properties for the relevant scope +// PricingProperties pricing data type PricingProperties struct { - // PricingTier - The pricing tier value. Possible values include: 'Free', 'Standard' + // PricingTier - Pricing tier type. Possible values include: 'Free', 'Standard' PricingTier PricingTier `json:"pricingTier,omitempty"` - // FreeTrialRemainingTime - The duration left for the subscriptions free trial period - in ISO 8601 format (e.g. P3Y6M4DT12H30M5S). - FreeTrialRemainingTime *string `json:"freeTrialRemainingTime,omitempty"` } // Resource describes an Azure resource. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v2.0/security/operations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v1.0/security/operations.go similarity index 100% rename from vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v2.0/security/operations.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v1.0/security/operations.go diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v1.0/security/pricings.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v1.0/security/pricings.go new file mode 100644 index 000000000000..e4149dda58e6 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v1.0/security/pricings.go @@ -0,0 +1,627 @@ +package security + +// 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" +) + +// PricingsClient is the API spec for Microsoft.Security (Azure Security Center) resource provider +type PricingsClient struct { + BaseClient +} + +// NewPricingsClient creates an instance of the PricingsClient client. +func NewPricingsClient(subscriptionID string, ascLocation string) PricingsClient { + return NewPricingsClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +} + +// NewPricingsClientWithBaseURI creates an instance of the PricingsClient client. +func NewPricingsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) PricingsClient { + return PricingsClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +} + +// CreateOrUpdateResourceGroupPricing security pricing configuration in the resource group +// Parameters: +// resourceGroupName - the name of the resource group within the user's subscription. The name is case +// insensitive. +// pricingName - name of the pricing configuration +// pricing - pricing object +func (client PricingsClient) CreateOrUpdateResourceGroupPricing(ctx context.Context, resourceGroupName string, pricingName string, pricing Pricing) (result Pricing, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PricingsClient.CreateOrUpdateResourceGroupPricing") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("security.PricingsClient", "CreateOrUpdateResourceGroupPricing", err.Error()) + } + + req, err := client.CreateOrUpdateResourceGroupPricingPreparer(ctx, resourceGroupName, pricingName, pricing) + if err != nil { + err = autorest.NewErrorWithError(err, "security.PricingsClient", "CreateOrUpdateResourceGroupPricing", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateResourceGroupPricingSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.PricingsClient", "CreateOrUpdateResourceGroupPricing", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResourceGroupPricingResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.PricingsClient", "CreateOrUpdateResourceGroupPricing", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdateResourceGroupPricingPreparer prepares the CreateOrUpdateResourceGroupPricing request. +func (client PricingsClient) CreateOrUpdateResourceGroupPricingPreparer(ctx context.Context, resourceGroupName string, pricingName string, pricing Pricing) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "pricingName": autorest.Encode("path", pricingName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-08-01-preview" + 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.Security/pricings/{pricingName}", pathParameters), + autorest.WithJSON(pricing), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateResourceGroupPricingSender sends the CreateOrUpdateResourceGroupPricing request. The method will close the +// http.Response Body if it receives an error. +func (client PricingsClient) CreateOrUpdateResourceGroupPricingSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResourceGroupPricingResponder handles the response to the CreateOrUpdateResourceGroupPricing request. The method always +// closes the http.Response Body. +func (client PricingsClient) CreateOrUpdateResourceGroupPricingResponder(resp *http.Response) (result Pricing, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetResourceGroupPricing security pricing configuration in the resource group +// Parameters: +// resourceGroupName - the name of the resource group within the user's subscription. The name is case +// insensitive. +// pricingName - name of the pricing configuration +func (client PricingsClient) GetResourceGroupPricing(ctx context.Context, resourceGroupName string, pricingName string) (result Pricing, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PricingsClient.GetResourceGroupPricing") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("security.PricingsClient", "GetResourceGroupPricing", err.Error()) + } + + req, err := client.GetResourceGroupPricingPreparer(ctx, resourceGroupName, pricingName) + if err != nil { + err = autorest.NewErrorWithError(err, "security.PricingsClient", "GetResourceGroupPricing", nil, "Failure preparing request") + return + } + + resp, err := client.GetResourceGroupPricingSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.PricingsClient", "GetResourceGroupPricing", resp, "Failure sending request") + return + } + + result, err = client.GetResourceGroupPricingResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.PricingsClient", "GetResourceGroupPricing", resp, "Failure responding to request") + } + + return +} + +// GetResourceGroupPricingPreparer prepares the GetResourceGroupPricing request. +func (client PricingsClient) GetResourceGroupPricingPreparer(ctx context.Context, resourceGroupName string, pricingName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "pricingName": autorest.Encode("path", pricingName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-08-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/pricings/{pricingName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetResourceGroupPricingSender sends the GetResourceGroupPricing request. The method will close the +// http.Response Body if it receives an error. +func (client PricingsClient) GetResourceGroupPricingSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResourceGroupPricingResponder handles the response to the GetResourceGroupPricing request. The method always +// closes the http.Response Body. +func (client PricingsClient) GetResourceGroupPricingResponder(resp *http.Response) (result Pricing, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetSubscriptionPricing security pricing configuration in the subscriptionSecurity pricing configuration in the +// subscription +// Parameters: +// pricingName - name of the pricing configuration +func (client PricingsClient) GetSubscriptionPricing(ctx context.Context, pricingName string) (result Pricing, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PricingsClient.GetSubscriptionPricing") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("security.PricingsClient", "GetSubscriptionPricing", err.Error()) + } + + req, err := client.GetSubscriptionPricingPreparer(ctx, pricingName) + if err != nil { + err = autorest.NewErrorWithError(err, "security.PricingsClient", "GetSubscriptionPricing", nil, "Failure preparing request") + return + } + + resp, err := client.GetSubscriptionPricingSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.PricingsClient", "GetSubscriptionPricing", resp, "Failure sending request") + return + } + + result, err = client.GetSubscriptionPricingResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.PricingsClient", "GetSubscriptionPricing", resp, "Failure responding to request") + } + + return +} + +// GetSubscriptionPricingPreparer prepares the GetSubscriptionPricing request. +func (client PricingsClient) GetSubscriptionPricingPreparer(ctx context.Context, pricingName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "pricingName": autorest.Encode("path", pricingName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-08-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Security/pricings/{pricingName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSubscriptionPricingSender sends the GetSubscriptionPricing request. The method will close the +// http.Response Body if it receives an error. +func (client PricingsClient) GetSubscriptionPricingSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetSubscriptionPricingResponder handles the response to the GetSubscriptionPricing request. The method always +// closes the http.Response Body. +func (client PricingsClient) GetSubscriptionPricingResponder(resp *http.Response) (result Pricing, 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 security pricing configurations in the subscription +func (client PricingsClient) List(ctx context.Context) (result PricingListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PricingsClient.List") + 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: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("security.PricingsClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "security.PricingsClient", "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, "security.PricingsClient", "List", resp, "Failure sending request") + return + } + + result.pl, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.PricingsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client PricingsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-08-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Security/pricings", 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 PricingsClient) ListSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client PricingsClient) ListResponder(resp *http.Response) (result PricingList, 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 PricingsClient) listNextResults(ctx context.Context, lastResults PricingList) (result PricingList, err error) { + req, err := lastResults.pricingListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "security.PricingsClient", "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, "security.PricingsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.PricingsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client PricingsClient) ListComplete(ctx context.Context) (result PricingListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PricingsClient.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 security pricing configurations in the resource group +// Parameters: +// resourceGroupName - the name of the resource group within the user's subscription. The name is case +// insensitive. +func (client PricingsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result PricingListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PricingsClient.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: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("security.PricingsClient", "ListByResourceGroup", err.Error()) + } + + result.fn = client.listByResourceGroupNextResults + req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "security.PricingsClient", "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, "security.PricingsClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result.pl, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.PricingsClient", "ListByResourceGroup", resp, "Failure responding to request") + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client PricingsClient) 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 = "2017-08-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/pricings", 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 PricingsClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always +// closes the http.Response Body. +func (client PricingsClient) ListByResourceGroupResponder(resp *http.Response) (result PricingList, 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 PricingsClient) listByResourceGroupNextResults(ctx context.Context, lastResults PricingList) (result PricingList, err error) { + req, err := lastResults.pricingListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "security.PricingsClient", "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, "security.PricingsClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.PricingsClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client PricingsClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result PricingListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PricingsClient.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 +} + +// UpdateSubscriptionPricing security pricing configuration in the subscription +// Parameters: +// pricingName - name of the pricing configuration +// pricing - pricing object +func (client PricingsClient) UpdateSubscriptionPricing(ctx context.Context, pricingName string, pricing Pricing) (result Pricing, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PricingsClient.UpdateSubscriptionPricing") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("security.PricingsClient", "UpdateSubscriptionPricing", err.Error()) + } + + req, err := client.UpdateSubscriptionPricingPreparer(ctx, pricingName, pricing) + if err != nil { + err = autorest.NewErrorWithError(err, "security.PricingsClient", "UpdateSubscriptionPricing", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSubscriptionPricingSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.PricingsClient", "UpdateSubscriptionPricing", resp, "Failure sending request") + return + } + + result, err = client.UpdateSubscriptionPricingResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.PricingsClient", "UpdateSubscriptionPricing", resp, "Failure responding to request") + } + + return +} + +// UpdateSubscriptionPricingPreparer prepares the UpdateSubscriptionPricing request. +func (client PricingsClient) UpdateSubscriptionPricingPreparer(ctx context.Context, pricingName string, pricing Pricing) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "pricingName": autorest.Encode("path", pricingName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-08-01-preview" + 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}/providers/Microsoft.Security/pricings/{pricingName}", pathParameters), + autorest.WithJSON(pricing), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSubscriptionPricingSender sends the UpdateSubscriptionPricing request. The method will close the +// http.Response Body if it receives an error. +func (client PricingsClient) UpdateSubscriptionPricingSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateSubscriptionPricingResponder handles the response to the UpdateSubscriptionPricing request. The method always +// closes the http.Response Body. +func (client PricingsClient) UpdateSubscriptionPricingResponder(resp *http.Response) (result Pricing, 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/preview/security/mgmt/v2.0/security/settings.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v1.0/security/settings.go similarity index 100% rename from vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v2.0/security/settings.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v1.0/security/settings.go diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v2.0/security/tasks.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v1.0/security/tasks.go similarity index 100% rename from vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v2.0/security/tasks.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v1.0/security/tasks.go diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v2.0/security/topology.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v1.0/security/topology.go similarity index 100% rename from vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v2.0/security/topology.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v1.0/security/topology.go diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v2.0/security/version.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v1.0/security/version.go similarity index 94% rename from vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v2.0/security/version.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v1.0/security/version.go index 95435f54dd8b..700532fb79c7 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v2.0/security/version.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v1.0/security/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 + " security/v2.0" + return "Azure-SDK-For-Go/" + version.Number + " security/v1.0" } // Version returns the semantic version (see http://semver.org) of the client. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v2.0/security/workspacesettings.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v1.0/security/workspacesettings.go similarity index 100% rename from vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v2.0/security/workspacesettings.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v1.0/security/workspacesettings.go diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v2.0/security/pricings.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v2.0/security/pricings.go deleted file mode 100644 index ceb3b3291c14..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v2.0/security/pricings.go +++ /dev/null @@ -1,285 +0,0 @@ -package security - -// 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" -) - -// PricingsClient is the API spec for Microsoft.Security (Azure Security Center) resource provider -type PricingsClient struct { - BaseClient -} - -// NewPricingsClient creates an instance of the PricingsClient client. -func NewPricingsClient(subscriptionID string, ascLocation string) PricingsClient { - return NewPricingsClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) -} - -// NewPricingsClientWithBaseURI creates an instance of the PricingsClient client. -func NewPricingsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) PricingsClient { - return PricingsClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} -} - -// Get security pricing configuration in the subscription -// Parameters: -// pricingName - name of the pricing configuration -func (client PricingsClient) Get(ctx context.Context, pricingName string) (result Pricing, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PricingsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("security.PricingsClient", "Get", err.Error()) - } - - req, err := client.GetPreparer(ctx, pricingName) - if err != nil { - err = autorest.NewErrorWithError(err, "security.PricingsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "security.PricingsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "security.PricingsClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client PricingsClient) GetPreparer(ctx context.Context, pricingName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "pricingName": autorest.Encode("path", pricingName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Security/pricings/{pricingName}", 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 PricingsClient) GetSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client PricingsClient) GetResponder(resp *http.Response) (result Pricing, 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 security pricing configurations in the subscription -func (client PricingsClient) List(ctx context.Context) (result PricingList, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PricingsClient.List") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("security.PricingsClient", "List", err.Error()) - } - - req, err := client.ListPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "security.PricingsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "security.PricingsClient", "List", resp, "Failure sending request") - return - } - - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "security.PricingsClient", "List", resp, "Failure responding to request") - } - - return -} - -// ListPreparer prepares the List request. -func (client PricingsClient) ListPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-06-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Security/pricings", 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 PricingsClient) ListSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client PricingsClient) ListResponder(resp *http.Response) (result PricingList, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Update security pricing configuration in the subscription -// Parameters: -// pricingName - name of the pricing configuration -// pricing - pricing object -func (client PricingsClient) Update(ctx context.Context, pricingName string, pricing Pricing) (result Pricing, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PricingsClient.Update") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: client.SubscriptionID, - Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("security.PricingsClient", "Update", err.Error()) - } - - req, err := client.UpdatePreparer(ctx, pricingName, pricing) - if err != nil { - err = autorest.NewErrorWithError(err, "security.PricingsClient", "Update", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "security.PricingsClient", "Update", resp, "Failure sending request") - return - } - - result, err = client.UpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "security.PricingsClient", "Update", resp, "Failure responding to request") - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client PricingsClient) UpdatePreparer(ctx context.Context, pricingName string, pricing Pricing) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "pricingName": autorest.Encode("path", pricingName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-06-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}/providers/Microsoft.Security/pricings/{pricingName}", pathParameters), - autorest.WithJSON(pricing), - 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 PricingsClient) UpdateSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - azure.DoRetryWithRegistration(client.Client)) -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client PricingsClient) UpdateResponder(resp *http.Response) (result Pricing, 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/modules.txt b/vendor/modules.txt index 5b6c303fe76d..13556d95bf7a 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -41,7 +41,7 @@ github.com/Azure/azure-sdk-for-go/services/preview/msi/mgmt/2015-08-31-preview/m github.com/Azure/azure-sdk-for-go/services/preview/operationalinsights/mgmt/2015-11-01-preview/operationalinsights github.com/Azure/azure-sdk-for-go/services/preview/operationsmanagement/mgmt/2015-11-01-preview/operationsmanagement github.com/Azure/azure-sdk-for-go/services/preview/resources/mgmt/2018-03-01-preview/managementgroups -github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v2.0/security +github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v1.0/security github.com/Azure/azure-sdk-for-go/services/preview/signalr/mgmt/2018-03-01-preview/signalr github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2015-05-01-preview/sql github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2017-10-01-preview/sql