diff --git a/services/web/mgmt/2016-09-01/web/models.go b/services/web/mgmt/2016-09-01/web/models.go
index 1abd09b565d3..8f3c0f22febf 100644
--- a/services/web/mgmt/2016-09-01/web/models.go
+++ b/services/web/mgmt/2016-09-01/web/models.go
@@ -9693,12 +9693,6 @@ type ListOperation struct {
Value *[]Operation `json:"value,omitempty"`
}
-// ListRecommendation ...
-type ListRecommendation struct {
- autorest.Response `json:"-"`
- Value *[]Recommendation `json:"value,omitempty"`
-}
-
// ListVnetInfo ...
type ListVnetInfo struct {
autorest.Response `json:"-"`
@@ -12169,6 +12163,182 @@ type ReadCloser struct {
// Recommendation represents a recommendation result generated by the recommendation engine.
type Recommendation struct {
+ // RecommendationProperties - Recommendation resource specific properties
+ *RecommendationProperties `json:"properties,omitempty"`
+ // ID - Resource Id.
+ ID *string `json:"id,omitempty"`
+ // Name - Resource Name.
+ Name *string `json:"name,omitempty"`
+ // Kind - Kind of resource.
+ Kind *string `json:"kind,omitempty"`
+ // Type - Resource type.
+ Type *string `json:"type,omitempty"`
+}
+
+// UnmarshalJSON is the custom unmarshaler for Recommendation struct.
+func (r *Recommendation) 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 recommendationProperties RecommendationProperties
+ err = json.Unmarshal(*v, &recommendationProperties)
+ if err != nil {
+ return err
+ }
+ r.RecommendationProperties = &recommendationProperties
+ }
+ case "id":
+ if v != nil {
+ var ID string
+ err = json.Unmarshal(*v, &ID)
+ if err != nil {
+ return err
+ }
+ r.ID = &ID
+ }
+ case "name":
+ if v != nil {
+ var name string
+ err = json.Unmarshal(*v, &name)
+ if err != nil {
+ return err
+ }
+ r.Name = &name
+ }
+ case "kind":
+ if v != nil {
+ var kind string
+ err = json.Unmarshal(*v, &kind)
+ if err != nil {
+ return err
+ }
+ r.Kind = &kind
+ }
+ case "type":
+ if v != nil {
+ var typeVar string
+ err = json.Unmarshal(*v, &typeVar)
+ if err != nil {
+ return err
+ }
+ r.Type = &typeVar
+ }
+ }
+ }
+
+ return nil
+}
+
+// RecommendationCollection collection of recommendations.
+type RecommendationCollection struct {
+ autorest.Response `json:"-"`
+ // Value - Collection of resources.
+ Value *[]Recommendation `json:"value,omitempty"`
+ // NextLink - Link to next page of resources.
+ NextLink *string `json:"nextLink,omitempty"`
+}
+
+// RecommendationCollectionIterator provides access to a complete listing of Recommendation values.
+type RecommendationCollectionIterator struct {
+ i int
+ page RecommendationCollectionPage
+}
+
+// Next 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 *RecommendationCollectionIterator) Next() error {
+ iter.i++
+ if iter.i < len(iter.page.Values()) {
+ return nil
+ }
+ err := iter.page.Next()
+ if err != nil {
+ iter.i--
+ return err
+ }
+ iter.i = 0
+ return nil
+}
+
+// NotDone returns true if the enumeration should be started or is not yet complete.
+func (iter RecommendationCollectionIterator) 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 RecommendationCollectionIterator) Response() RecommendationCollection {
+ 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 RecommendationCollectionIterator) Value() Recommendation {
+ if !iter.page.NotDone() {
+ return Recommendation{}
+ }
+ return iter.page.Values()[iter.i]
+}
+
+// IsEmpty returns true if the ListResult contains no values.
+func (rc RecommendationCollection) IsEmpty() bool {
+ return rc.Value == nil || len(*rc.Value) == 0
+}
+
+// recommendationCollectionPreparer prepares a request to retrieve the next set of results.
+// It returns nil if no more results exist.
+func (rc RecommendationCollection) recommendationCollectionPreparer() (*http.Request, error) {
+ if rc.NextLink == nil || len(to.String(rc.NextLink)) < 1 {
+ return nil, nil
+ }
+ return autorest.Prepare(&http.Request{},
+ autorest.AsJSON(),
+ autorest.AsGet(),
+ autorest.WithBaseURL(to.String(rc.NextLink)))
+}
+
+// RecommendationCollectionPage contains a page of Recommendation values.
+type RecommendationCollectionPage struct {
+ fn func(RecommendationCollection) (RecommendationCollection, error)
+ rc RecommendationCollection
+}
+
+// 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.
+func (page *RecommendationCollectionPage) Next() error {
+ next, err := page.fn(page.rc)
+ if err != nil {
+ return err
+ }
+ page.rc = next
+ return nil
+}
+
+// NotDone returns true if the page enumeration should be started or is not yet complete.
+func (page RecommendationCollectionPage) NotDone() bool {
+ return !page.rc.IsEmpty()
+}
+
+// Response returns the raw server response from the last page request.
+func (page RecommendationCollectionPage) Response() RecommendationCollection {
+ return page.rc
+}
+
+// Values returns the slice of values for the current page or nil if there are no values.
+func (page RecommendationCollectionPage) Values() []Recommendation {
+ if page.rc.IsEmpty() {
+ return nil
+ }
+ return *page.rc.Value
+}
+
+// RecommendationProperties recommendation resource specific properties
+type RecommendationProperties struct {
// CreationTime - Timestamp when this instance was created.
CreationTime *date.Time `json:"creationTime,omitempty"`
// RecommendationID - A GUID value that each recommendation object is associated with.
@@ -12216,6 +12386,80 @@ type Recommendation struct {
// RecommendationRule represents a recommendation rule that the recommendation engine can perform.
type RecommendationRule struct {
autorest.Response `json:"-"`
+ // RecommendationRuleProperties - RecommendationRule resource specific properties
+ *RecommendationRuleProperties `json:"properties,omitempty"`
+ // ID - Resource Id.
+ ID *string `json:"id,omitempty"`
+ // Name - Resource Name.
+ Name *string `json:"name,omitempty"`
+ // Kind - Kind of resource.
+ Kind *string `json:"kind,omitempty"`
+ // Type - Resource type.
+ Type *string `json:"type,omitempty"`
+}
+
+// UnmarshalJSON is the custom unmarshaler for RecommendationRule struct.
+func (rr *RecommendationRule) 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 recommendationRuleProperties RecommendationRuleProperties
+ err = json.Unmarshal(*v, &recommendationRuleProperties)
+ if err != nil {
+ return err
+ }
+ rr.RecommendationRuleProperties = &recommendationRuleProperties
+ }
+ case "id":
+ if v != nil {
+ var ID string
+ err = json.Unmarshal(*v, &ID)
+ if err != nil {
+ return err
+ }
+ rr.ID = &ID
+ }
+ case "name":
+ if v != nil {
+ var name string
+ err = json.Unmarshal(*v, &name)
+ if err != nil {
+ return err
+ }
+ rr.Name = &name
+ }
+ case "kind":
+ if v != nil {
+ var kind string
+ err = json.Unmarshal(*v, &kind)
+ if err != nil {
+ return err
+ }
+ rr.Kind = &kind
+ }
+ case "type":
+ if v != nil {
+ var typeVar string
+ err = json.Unmarshal(*v, &typeVar)
+ if err != nil {
+ return err
+ }
+ rr.Type = &typeVar
+ }
+ }
+ }
+
+ return nil
+}
+
+// RecommendationRuleProperties recommendationRule resource specific properties
+type RecommendationRuleProperties struct {
// Name - Unique name of the rule.
Name *string `json:"name,omitempty"`
// DisplayName - UI friendly name of the rule.
diff --git a/services/web/mgmt/2016-09-01/web/recommendations.go b/services/web/mgmt/2016-09-01/web/recommendations.go
index f7a29a096df6..eda8421f6d0a 100644
--- a/services/web/mgmt/2016-09-01/web/recommendations.go
+++ b/services/web/mgmt/2016-09-01/web/recommendations.go
@@ -113,12 +113,153 @@ func (client RecommendationsClient) DisableAllForWebAppResponder(resp *http.Resp
return
}
+// DisableRecommendationForSite disables the specific rule for a web site permanently.
+//
+// resourceGroupName is name of the resource group to which the resource belongs. siteName is site name name is
+// rule name
+func (client RecommendationsClient) DisableRecommendationForSite(ctx context.Context, resourceGroupName string, siteName string, name string) (result autorest.Response, err error) {
+ if err := validation.Validate([]validation.Validation{
+ {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("web.RecommendationsClient", "DisableRecommendationForSite", err.Error())
+ }
+
+ req, err := client.DisableRecommendationForSitePreparer(ctx, resourceGroupName, siteName, name)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "web.RecommendationsClient", "DisableRecommendationForSite", nil, "Failure preparing request")
+ return
+ }
+
+ resp, err := client.DisableRecommendationForSiteSender(req)
+ if err != nil {
+ result.Response = resp
+ err = autorest.NewErrorWithError(err, "web.RecommendationsClient", "DisableRecommendationForSite", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.DisableRecommendationForSiteResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "web.RecommendationsClient", "DisableRecommendationForSite", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// DisableRecommendationForSitePreparer prepares the DisableRecommendationForSite request.
+func (client RecommendationsClient) DisableRecommendationForSitePreparer(ctx context.Context, resourceGroupName string, siteName string, name string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "name": autorest.Encode("path", name),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "siteName": autorest.Encode("path", siteName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2016-03-01"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsPost(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/recommendations/{name}/disable", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// DisableRecommendationForSiteSender sends the DisableRecommendationForSite request. The method will close the
+// http.Response Body if it receives an error.
+func (client RecommendationsClient) DisableRecommendationForSiteSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req,
+ azure.DoRetryWithRegistration(client.Client))
+}
+
+// DisableRecommendationForSiteResponder handles the response to the DisableRecommendationForSite request. The method always
+// closes the http.Response Body.
+func (client RecommendationsClient) DisableRecommendationForSiteResponder(resp *http.Response) (result autorest.Response, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByClosing())
+ result.Response = resp
+ return
+}
+
+// DisableRecommendationForSubscription disables the specified rule so it will not apply to a subscription in the
+// future.
+//
+// name is rule name
+func (client RecommendationsClient) DisableRecommendationForSubscription(ctx context.Context, name string) (result autorest.Response, err error) {
+ req, err := client.DisableRecommendationForSubscriptionPreparer(ctx, name)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "web.RecommendationsClient", "DisableRecommendationForSubscription", nil, "Failure preparing request")
+ return
+ }
+
+ resp, err := client.DisableRecommendationForSubscriptionSender(req)
+ if err != nil {
+ result.Response = resp
+ err = autorest.NewErrorWithError(err, "web.RecommendationsClient", "DisableRecommendationForSubscription", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.DisableRecommendationForSubscriptionResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "web.RecommendationsClient", "DisableRecommendationForSubscription", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// DisableRecommendationForSubscriptionPreparer prepares the DisableRecommendationForSubscription request.
+func (client RecommendationsClient) DisableRecommendationForSubscriptionPreparer(ctx context.Context, name string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "name": autorest.Encode("path", name),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2016-03-01"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsPost(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Web/recommendations/{name}/disable", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// DisableRecommendationForSubscriptionSender sends the DisableRecommendationForSubscription request. The method will close the
+// http.Response Body if it receives an error.
+func (client RecommendationsClient) DisableRecommendationForSubscriptionSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req,
+ azure.DoRetryWithRegistration(client.Client))
+}
+
+// DisableRecommendationForSubscriptionResponder handles the response to the DisableRecommendationForSubscription request. The method always
+// closes the http.Response Body.
+func (client RecommendationsClient) DisableRecommendationForSubscriptionResponder(resp *http.Response) (result autorest.Response, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByClosing())
+ result.Response = resp
+ return
+}
+
// GetRuleDetailsByWebApp get a recommendation rule for an app.
//
// resourceGroupName is name of the resource group to which the resource belongs. siteName is name of the app. name
// is name of the recommendation. updateSeen is specify true to update the last-seen timestamp of the
-// recommendation object.
-func (client RecommendationsClient) GetRuleDetailsByWebApp(ctx context.Context, resourceGroupName string, siteName string, name string, updateSeen *bool) (result RecommendationRule, err error) {
+// recommendation object. recommendationID is the GUID of the recommedation object if you query an expired one. You
+// don't need to specify it to query an active entry.
+func (client RecommendationsClient) GetRuleDetailsByWebApp(ctx context.Context, resourceGroupName string, siteName string, name string, updateSeen *bool, recommendationID string) (result RecommendationRule, err error) {
if err := validation.Validate([]validation.Validation{
{TargetValue: resourceGroupName,
Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
@@ -127,7 +268,7 @@ func (client RecommendationsClient) GetRuleDetailsByWebApp(ctx context.Context,
return result, validation.NewError("web.RecommendationsClient", "GetRuleDetailsByWebApp", err.Error())
}
- req, err := client.GetRuleDetailsByWebAppPreparer(ctx, resourceGroupName, siteName, name, updateSeen)
+ req, err := client.GetRuleDetailsByWebAppPreparer(ctx, resourceGroupName, siteName, name, updateSeen, recommendationID)
if err != nil {
err = autorest.NewErrorWithError(err, "web.RecommendationsClient", "GetRuleDetailsByWebApp", nil, "Failure preparing request")
return
@@ -149,7 +290,7 @@ func (client RecommendationsClient) GetRuleDetailsByWebApp(ctx context.Context,
}
// GetRuleDetailsByWebAppPreparer prepares the GetRuleDetailsByWebApp request.
-func (client RecommendationsClient) GetRuleDetailsByWebAppPreparer(ctx context.Context, resourceGroupName string, siteName string, name string, updateSeen *bool) (*http.Request, error) {
+func (client RecommendationsClient) GetRuleDetailsByWebAppPreparer(ctx context.Context, resourceGroupName string, siteName string, name string, updateSeen *bool, recommendationID string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"name": autorest.Encode("path", name),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
@@ -164,6 +305,9 @@ func (client RecommendationsClient) GetRuleDetailsByWebAppPreparer(ctx context.C
if updateSeen != nil {
queryParameters["updateSeen"] = autorest.Encode("query", *updateSeen)
}
+ if len(recommendationID) > 0 {
+ queryParameters["recommendationId"] = autorest.Encode("query", recommendationID)
+ }
preparer := autorest.CreatePreparer(
autorest.AsGet(),
@@ -199,7 +343,8 @@ func (client RecommendationsClient) GetRuleDetailsByWebAppResponder(resp *http.R
// false, which returns all recommendations. filter is filter is specified by using OData syntax.
// Example: $filter=channels eq 'Api' or channel eq 'Notification' and startTime eq '2014-01-01T00:00:00Z' and
// endTime eq '2014-12-31T23:59:59Z' and timeGrain eq duration'[PT1H|PT1M|P1D]
-func (client RecommendationsClient) List(ctx context.Context, featured *bool, filter string) (result ListRecommendation, err error) {
+func (client RecommendationsClient) List(ctx context.Context, featured *bool, filter string) (result RecommendationCollectionPage, err error) {
+ result.fn = client.listNextResults
req, err := client.ListPreparer(ctx, featured, filter)
if err != nil {
err = autorest.NewErrorWithError(err, "web.RecommendationsClient", "List", nil, "Failure preparing request")
@@ -208,12 +353,12 @@ func (client RecommendationsClient) List(ctx context.Context, featured *bool, fi
resp, err := client.ListSender(req)
if err != nil {
- result.Response = autorest.Response{Response: resp}
+ result.rc.Response = autorest.Response{Response: resp}
err = autorest.NewErrorWithError(err, "web.RecommendationsClient", "List", resp, "Failure sending request")
return
}
- result, err = client.ListResponder(resp)
+ result.rc, err = client.ListResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "web.RecommendationsClient", "List", resp, "Failure responding to request")
}
@@ -255,24 +400,51 @@ func (client RecommendationsClient) ListSender(req *http.Request) (*http.Respons
// ListResponder handles the response to the List request. The method always
// closes the http.Response Body.
-func (client RecommendationsClient) ListResponder(resp *http.Response) (result ListRecommendation, err error) {
+func (client RecommendationsClient) ListResponder(resp *http.Response) (result RecommendationCollection, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result.Value),
+ autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
+// listNextResults retrieves the next set of results, if any.
+func (client RecommendationsClient) listNextResults(lastResults RecommendationCollection) (result RecommendationCollection, err error) {
+ req, err := lastResults.recommendationCollectionPreparer()
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "web.RecommendationsClient", "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, "web.RecommendationsClient", "listNextResults", resp, "Failure sending next results request")
+ }
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "web.RecommendationsClient", "listNextResults", resp, "Failure responding to next results request")
+ }
+ return
+}
+
+// ListComplete enumerates all values, automatically crossing page boundaries as required.
+func (client RecommendationsClient) ListComplete(ctx context.Context, featured *bool, filter string) (result RecommendationCollectionIterator, err error) {
+ result.page, err = client.List(ctx, featured, filter)
+ return
+}
+
// ListHistoryForWebApp get past recommendations for an app, optionally specified by the time range.
//
// resourceGroupName is name of the resource group to which the resource belongs. siteName is name of the app.
// filter is filter is specified by using OData syntax. Example: $filter=channels eq 'Api' or channel eq
// 'Notification' and startTime eq '2014-01-01T00:00:00Z' and endTime eq '2014-12-31T23:59:59Z' and timeGrain eq
// duration'[PT1H|PT1M|P1D]
-func (client RecommendationsClient) ListHistoryForWebApp(ctx context.Context, resourceGroupName string, siteName string, filter string) (result ListRecommendation, err error) {
+func (client RecommendationsClient) ListHistoryForWebApp(ctx context.Context, resourceGroupName string, siteName string, filter string) (result RecommendationCollectionPage, err error) {
if err := validation.Validate([]validation.Validation{
{TargetValue: resourceGroupName,
Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
@@ -281,6 +453,7 @@ func (client RecommendationsClient) ListHistoryForWebApp(ctx context.Context, re
return result, validation.NewError("web.RecommendationsClient", "ListHistoryForWebApp", err.Error())
}
+ result.fn = client.listHistoryForWebAppNextResults
req, err := client.ListHistoryForWebAppPreparer(ctx, resourceGroupName, siteName, filter)
if err != nil {
err = autorest.NewErrorWithError(err, "web.RecommendationsClient", "ListHistoryForWebApp", nil, "Failure preparing request")
@@ -289,12 +462,12 @@ func (client RecommendationsClient) ListHistoryForWebApp(ctx context.Context, re
resp, err := client.ListHistoryForWebAppSender(req)
if err != nil {
- result.Response = autorest.Response{Response: resp}
+ result.rc.Response = autorest.Response{Response: resp}
err = autorest.NewErrorWithError(err, "web.RecommendationsClient", "ListHistoryForWebApp", resp, "Failure sending request")
return
}
- result, err = client.ListHistoryForWebAppResponder(resp)
+ result.rc, err = client.ListHistoryForWebAppResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "web.RecommendationsClient", "ListHistoryForWebApp", resp, "Failure responding to request")
}
@@ -335,24 +508,51 @@ func (client RecommendationsClient) ListHistoryForWebAppSender(req *http.Request
// ListHistoryForWebAppResponder handles the response to the ListHistoryForWebApp request. The method always
// closes the http.Response Body.
-func (client RecommendationsClient) ListHistoryForWebAppResponder(resp *http.Response) (result ListRecommendation, err error) {
+func (client RecommendationsClient) ListHistoryForWebAppResponder(resp *http.Response) (result RecommendationCollection, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result.Value),
+ autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
+// listHistoryForWebAppNextResults retrieves the next set of results, if any.
+func (client RecommendationsClient) listHistoryForWebAppNextResults(lastResults RecommendationCollection) (result RecommendationCollection, err error) {
+ req, err := lastResults.recommendationCollectionPreparer()
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "web.RecommendationsClient", "listHistoryForWebAppNextResults", nil, "Failure preparing next results request")
+ }
+ if req == nil {
+ return
+ }
+ resp, err := client.ListHistoryForWebAppSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "web.RecommendationsClient", "listHistoryForWebAppNextResults", resp, "Failure sending next results request")
+ }
+ result, err = client.ListHistoryForWebAppResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "web.RecommendationsClient", "listHistoryForWebAppNextResults", resp, "Failure responding to next results request")
+ }
+ return
+}
+
+// ListHistoryForWebAppComplete enumerates all values, automatically crossing page boundaries as required.
+func (client RecommendationsClient) ListHistoryForWebAppComplete(ctx context.Context, resourceGroupName string, siteName string, filter string) (result RecommendationCollectionIterator, err error) {
+ result.page, err = client.ListHistoryForWebApp(ctx, resourceGroupName, siteName, filter)
+ return
+}
+
// ListRecommendedRulesForWebApp get all recommendations for an app.
//
// resourceGroupName is name of the resource group to which the resource belongs. siteName is name of the app.
// featured is specify true to return only the most critical recommendations. The default is
// false, which returns all recommendations. filter is return only channels specified in the filter.
// Filter is specified by using OData syntax. Example: $filter=channels eq 'Api' or channel eq 'Notification'
-func (client RecommendationsClient) ListRecommendedRulesForWebApp(ctx context.Context, resourceGroupName string, siteName string, featured *bool, filter string) (result ListRecommendation, err error) {
+func (client RecommendationsClient) ListRecommendedRulesForWebApp(ctx context.Context, resourceGroupName string, siteName string, featured *bool, filter string) (result RecommendationCollectionPage, err error) {
if err := validation.Validate([]validation.Validation{
{TargetValue: resourceGroupName,
Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
@@ -361,6 +561,7 @@ func (client RecommendationsClient) ListRecommendedRulesForWebApp(ctx context.Co
return result, validation.NewError("web.RecommendationsClient", "ListRecommendedRulesForWebApp", err.Error())
}
+ result.fn = client.listRecommendedRulesForWebAppNextResults
req, err := client.ListRecommendedRulesForWebAppPreparer(ctx, resourceGroupName, siteName, featured, filter)
if err != nil {
err = autorest.NewErrorWithError(err, "web.RecommendationsClient", "ListRecommendedRulesForWebApp", nil, "Failure preparing request")
@@ -369,12 +570,12 @@ func (client RecommendationsClient) ListRecommendedRulesForWebApp(ctx context.Co
resp, err := client.ListRecommendedRulesForWebAppSender(req)
if err != nil {
- result.Response = autorest.Response{Response: resp}
+ result.rc.Response = autorest.Response{Response: resp}
err = autorest.NewErrorWithError(err, "web.RecommendationsClient", "ListRecommendedRulesForWebApp", resp, "Failure sending request")
return
}
- result, err = client.ListRecommendedRulesForWebAppResponder(resp)
+ result.rc, err = client.ListRecommendedRulesForWebAppResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "web.RecommendationsClient", "ListRecommendedRulesForWebApp", resp, "Failure responding to request")
}
@@ -418,17 +619,44 @@ func (client RecommendationsClient) ListRecommendedRulesForWebAppSender(req *htt
// ListRecommendedRulesForWebAppResponder handles the response to the ListRecommendedRulesForWebApp request. The method always
// closes the http.Response Body.
-func (client RecommendationsClient) ListRecommendedRulesForWebAppResponder(resp *http.Response) (result ListRecommendation, err error) {
+func (client RecommendationsClient) ListRecommendedRulesForWebAppResponder(resp *http.Response) (result RecommendationCollection, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result.Value),
+ autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
+// listRecommendedRulesForWebAppNextResults retrieves the next set of results, if any.
+func (client RecommendationsClient) listRecommendedRulesForWebAppNextResults(lastResults RecommendationCollection) (result RecommendationCollection, err error) {
+ req, err := lastResults.recommendationCollectionPreparer()
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "web.RecommendationsClient", "listRecommendedRulesForWebAppNextResults", nil, "Failure preparing next results request")
+ }
+ if req == nil {
+ return
+ }
+ resp, err := client.ListRecommendedRulesForWebAppSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "web.RecommendationsClient", "listRecommendedRulesForWebAppNextResults", resp, "Failure sending next results request")
+ }
+ result, err = client.ListRecommendedRulesForWebAppResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "web.RecommendationsClient", "listRecommendedRulesForWebAppNextResults", resp, "Failure responding to next results request")
+ }
+ return
+}
+
+// ListRecommendedRulesForWebAppComplete enumerates all values, automatically crossing page boundaries as required.
+func (client RecommendationsClient) ListRecommendedRulesForWebAppComplete(ctx context.Context, resourceGroupName string, siteName string, featured *bool, filter string) (result RecommendationCollectionIterator, err error) {
+ result.page, err = client.ListRecommendedRulesForWebApp(ctx, resourceGroupName, siteName, featured, filter)
+ return
+}
+
// ResetAllFilters reset all recommendation opt-out settings for a subscription.
func (client RecommendationsClient) ResetAllFilters(ctx context.Context) (result autorest.Response, err error) {
req, err := client.ResetAllFiltersPreparer(ctx)