diff --git a/services/resources/mgmt/2019-06-01/policy/assignments.go b/services/resources/mgmt/2019-06-01/policy/assignments.go index d1497e4c7ee3..e8f72db93d31 100644 --- a/services/resources/mgmt/2019-06-01/policy/assignments.go +++ b/services/resources/mgmt/2019-06-01/policy/assignments.go @@ -129,7 +129,6 @@ func (client AssignmentsClient) CreateSender(req *http.Request) (*http.Response, func (client AssignmentsClient) CreateResponder(resp *http.Response) (result Assignment, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -223,7 +222,6 @@ func (client AssignmentsClient) CreateByIDSender(req *http.Request) (*http.Respo func (client AssignmentsClient) CreateByIDResponder(resp *http.Response) (result Assignment, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -304,7 +302,6 @@ func (client AssignmentsClient) DeleteSender(req *http.Request) (*http.Response, func (client AssignmentsClient) DeleteResponder(resp *http.Response) (result Assignment, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -384,7 +381,6 @@ func (client AssignmentsClient) DeleteByIDSender(req *http.Request) (*http.Respo func (client AssignmentsClient) DeleteByIDResponder(resp *http.Response) (result Assignment, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -463,7 +459,6 @@ func (client AssignmentsClient) GetSender(req *http.Request) (*http.Response, er func (client AssignmentsClient) GetResponder(resp *http.Response) (result Assignment, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -542,7 +537,6 @@ func (client AssignmentsClient) GetByIDSender(req *http.Request) (*http.Response func (client AssignmentsClient) GetByIDResponder(resp *http.Response) (result Assignment, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -590,6 +584,9 @@ func (client AssignmentsClient) List(ctx context.Context, filter string) (result if err != nil { err = autorest.NewErrorWithError(err, "policy.AssignmentsClient", "List", resp, "Failure responding to request") } + if result.alr.hasNextLink() && result.alr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -627,7 +624,6 @@ func (client AssignmentsClient) ListSender(req *http.Request) (*http.Response, e func (client AssignmentsClient) ListResponder(resp *http.Response) (result AssignmentListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -737,6 +733,9 @@ func (client AssignmentsClient) ListForResource(ctx context.Context, resourceGro if err != nil { err = autorest.NewErrorWithError(err, "policy.AssignmentsClient", "ListForResource", resp, "Failure responding to request") } + if result.alr.hasNextLink() && result.alr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -779,7 +778,6 @@ func (client AssignmentsClient) ListForResourceSender(req *http.Request) (*http. func (client AssignmentsClient) ListForResourceResponder(resp *http.Response) (result AssignmentListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -874,6 +872,9 @@ func (client AssignmentsClient) ListForResourceGroup(ctx context.Context, resour if err != nil { err = autorest.NewErrorWithError(err, "policy.AssignmentsClient", "ListForResourceGroup", resp, "Failure responding to request") } + if result.alr.hasNextLink() && result.alr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -912,7 +913,6 @@ func (client AssignmentsClient) ListForResourceGroupSender(req *http.Request) (* func (client AssignmentsClient) ListForResourceGroupResponder(resp *http.Response) (result AssignmentListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/services/resources/mgmt/2019-06-01/policy/definitions.go b/services/resources/mgmt/2019-06-01/policy/definitions.go index b05403be6ff8..d3c9dc1ca4b8 100644 --- a/services/resources/mgmt/2019-06-01/policy/definitions.go +++ b/services/resources/mgmt/2019-06-01/policy/definitions.go @@ -114,7 +114,6 @@ func (client DefinitionsClient) CreateOrUpdateSender(req *http.Request) (*http.R func (client DefinitionsClient) CreateOrUpdateResponder(resp *http.Response) (result Definition, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -196,7 +195,6 @@ func (client DefinitionsClient) CreateOrUpdateAtManagementGroupSender(req *http. func (client DefinitionsClient) CreateOrUpdateAtManagementGroupResponder(resp *http.Response) (result Definition, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -270,7 +268,6 @@ func (client DefinitionsClient) DeleteSender(req *http.Request) (*http.Response, func (client DefinitionsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -345,7 +342,6 @@ func (client DefinitionsClient) DeleteAtManagementGroupSender(req *http.Request) func (client DefinitionsClient) DeleteAtManagementGroupResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -418,7 +414,6 @@ func (client DefinitionsClient) GetSender(req *http.Request) (*http.Response, er func (client DefinitionsClient) GetResponder(resp *http.Response) (result Definition, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -494,7 +489,6 @@ func (client DefinitionsClient) GetAtManagementGroupSender(req *http.Request) (* func (client DefinitionsClient) GetAtManagementGroupResponder(resp *http.Response) (result Definition, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -567,7 +561,6 @@ func (client DefinitionsClient) GetBuiltInSender(req *http.Request) (*http.Respo func (client DefinitionsClient) GetBuiltInResponder(resp *http.Response) (result Definition, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -605,6 +598,9 @@ func (client DefinitionsClient) List(ctx context.Context) (result DefinitionList if err != nil { err = autorest.NewErrorWithError(err, "policy.DefinitionsClient", "List", resp, "Failure responding to request") } + if result.dlr.hasNextLink() && result.dlr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -639,7 +635,6 @@ func (client DefinitionsClient) ListSender(req *http.Request) (*http.Response, e func (client DefinitionsClient) ListResponder(resp *http.Response) (result DefinitionListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -714,6 +709,9 @@ func (client DefinitionsClient) ListBuiltIn(ctx context.Context) (result Definit if err != nil { err = autorest.NewErrorWithError(err, "policy.DefinitionsClient", "ListBuiltIn", resp, "Failure responding to request") } + if result.dlr.hasNextLink() && result.dlr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -744,7 +742,6 @@ func (client DefinitionsClient) ListBuiltInSender(req *http.Request) (*http.Resp func (client DefinitionsClient) ListBuiltInResponder(resp *http.Response) (result DefinitionListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -821,6 +818,9 @@ func (client DefinitionsClient) ListByManagementGroup(ctx context.Context, manag if err != nil { err = autorest.NewErrorWithError(err, "policy.DefinitionsClient", "ListByManagementGroup", resp, "Failure responding to request") } + if result.dlr.hasNextLink() && result.dlr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -855,7 +855,6 @@ func (client DefinitionsClient) ListByManagementGroupSender(req *http.Request) ( func (client DefinitionsClient) ListByManagementGroupResponder(resp *http.Response) (result DefinitionListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/services/resources/mgmt/2019-06-01/policy/enums.go b/services/resources/mgmt/2019-06-01/policy/enums.go new file mode 100644 index 000000000000..e7e2c296aa96 --- /dev/null +++ b/services/resources/mgmt/2019-06-01/policy/enums.go @@ -0,0 +1,65 @@ +package policy + +// 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. + +// EnforcementMode enumerates the values for enforcement mode. +type EnforcementMode string + +const ( + // Default The policy effect is enforced during resource creation or update. + Default EnforcementMode = "Default" + // DoNotEnforce The policy effect is not enforced during resource creation or update. + DoNotEnforce EnforcementMode = "DoNotEnforce" +) + +// PossibleEnforcementModeValues returns an array of possible values for the EnforcementMode const type. +func PossibleEnforcementModeValues() []EnforcementMode { + return []EnforcementMode{Default, DoNotEnforce} +} + +// ResourceIdentityType enumerates the values for resource identity type. +type ResourceIdentityType string + +const ( + // None ... + None ResourceIdentityType = "None" + // SystemAssigned ... + SystemAssigned ResourceIdentityType = "SystemAssigned" +) + +// PossibleResourceIdentityTypeValues returns an array of possible values for the ResourceIdentityType const type. +func PossibleResourceIdentityTypeValues() []ResourceIdentityType { + return []ResourceIdentityType{None, SystemAssigned} +} + +// Type enumerates the values for type. +type Type string + +const ( + // BuiltIn ... + BuiltIn Type = "BuiltIn" + // Custom ... + Custom Type = "Custom" + // NotSpecified ... + NotSpecified Type = "NotSpecified" +) + +// PossibleTypeValues returns an array of possible values for the Type const type. +func PossibleTypeValues() []Type { + return []Type{BuiltIn, Custom, NotSpecified} +} diff --git a/services/resources/mgmt/2019-06-01/policy/models.go b/services/resources/mgmt/2019-06-01/policy/models.go index d5cd8cd809e1..f67f0964359b 100644 --- a/services/resources/mgmt/2019-06-01/policy/models.go +++ b/services/resources/mgmt/2019-06-01/policy/models.go @@ -29,53 +29,6 @@ import ( // The package's fully qualified name. const fqdn = "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2019-06-01/policy" -// EnforcementMode enumerates the values for enforcement mode. -type EnforcementMode string - -const ( - // Default The policy effect is enforced during resource creation or update. - Default EnforcementMode = "Default" - // DoNotEnforce The policy effect is not enforced during resource creation or update. - DoNotEnforce EnforcementMode = "DoNotEnforce" -) - -// PossibleEnforcementModeValues returns an array of possible values for the EnforcementMode const type. -func PossibleEnforcementModeValues() []EnforcementMode { - return []EnforcementMode{Default, DoNotEnforce} -} - -// ResourceIdentityType enumerates the values for resource identity type. -type ResourceIdentityType string - -const ( - // None ... - None ResourceIdentityType = "None" - // SystemAssigned ... - SystemAssigned ResourceIdentityType = "SystemAssigned" -) - -// PossibleResourceIdentityTypeValues returns an array of possible values for the ResourceIdentityType const type. -func PossibleResourceIdentityTypeValues() []ResourceIdentityType { - return []ResourceIdentityType{None, SystemAssigned} -} - -// Type enumerates the values for type. -type Type string - -const ( - // BuiltIn ... - BuiltIn Type = "BuiltIn" - // Custom ... - Custom Type = "Custom" - // NotSpecified ... - NotSpecified Type = "NotSpecified" -) - -// PossibleTypeValues returns an array of possible values for the Type const type. -func PossibleTypeValues() []Type { - return []Type{BuiltIn, Custom, NotSpecified} -} - // Assignment the policy assignment. type Assignment struct { autorest.Response `json:"-"` @@ -268,10 +221,15 @@ func (alr AssignmentListResult) IsEmpty() bool { return alr.Value == nil || len(*alr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (alr AssignmentListResult) hasNextLink() bool { + return alr.NextLink != nil && len(*alr.NextLink) != 0 +} + // assignmentListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (alr AssignmentListResult) assignmentListResultPreparer(ctx context.Context) (*http.Request, error) { - if alr.NextLink == nil || len(to.String(alr.NextLink)) < 1 { + if !alr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -299,11 +257,16 @@ func (page *AssignmentListResultPage) NextWithContext(ctx context.Context) (err tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.alr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.alr) + if err != nil { + return err + } + page.alr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.alr = next return nil } @@ -507,10 +470,15 @@ func (dlr DefinitionListResult) IsEmpty() bool { return dlr.Value == nil || len(*dlr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (dlr DefinitionListResult) hasNextLink() bool { + return dlr.NextLink != nil && len(*dlr.NextLink) != 0 +} + // definitionListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (dlr DefinitionListResult) definitionListResultPreparer(ctx context.Context) (*http.Request, error) { - if dlr.NextLink == nil || len(to.String(dlr.NextLink)) < 1 { + if !dlr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -538,11 +506,16 @@ func (page *DefinitionListResultPage) NextWithContext(ctx context.Context) (err tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.dlr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.dlr) + if err != nil { + return err + } + page.dlr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.dlr = next return nil } @@ -602,8 +575,8 @@ type DefinitionReference struct { Parameters interface{} `json:"parameters,omitempty"` } -// ErrorResponse error response indicates Azure Resource Manager is not able to process the incoming -// request. The reason is provided in the error message. +// ErrorResponse error response indicates Azure Resource Manager is not able to process the incoming request. +// The reason is provided in the error message. type ErrorResponse struct { // HTTPStatus - Http status code. HTTPStatus *string `json:"httpStatus,omitempty"` @@ -623,6 +596,15 @@ type Identity struct { Type ResourceIdentityType `json:"type,omitempty"` } +// MarshalJSON is the custom marshaler for Identity. +func (i Identity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if i.Type != "" { + objectMap["type"] = i.Type + } + return json.Marshal(objectMap) +} + // SetDefinition the policy set definition. type SetDefinition struct { autorest.Response `json:"-"` @@ -773,10 +755,15 @@ func (sdlr SetDefinitionListResult) IsEmpty() bool { return sdlr.Value == nil || len(*sdlr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (sdlr SetDefinitionListResult) hasNextLink() bool { + return sdlr.NextLink != nil && len(*sdlr.NextLink) != 0 +} + // setDefinitionListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (sdlr SetDefinitionListResult) setDefinitionListResultPreparer(ctx context.Context) (*http.Request, error) { - if sdlr.NextLink == nil || len(to.String(sdlr.NextLink)) < 1 { + if !sdlr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -804,11 +791,16 @@ func (page *SetDefinitionListResultPage) NextWithContext(ctx context.Context) (e tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.sdlr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.sdlr) + if err != nil { + return err + } + page.sdlr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.sdlr = next return nil } diff --git a/services/resources/mgmt/2019-06-01/policy/setdefinitions.go b/services/resources/mgmt/2019-06-01/policy/setdefinitions.go index 2032227a932b..e8ed6044063e 100644 --- a/services/resources/mgmt/2019-06-01/policy/setdefinitions.go +++ b/services/resources/mgmt/2019-06-01/policy/setdefinitions.go @@ -123,7 +123,6 @@ func (client SetDefinitionsClient) CreateOrUpdateSender(req *http.Request) (*htt func (client SetDefinitionsClient) CreateOrUpdateResponder(resp *http.Response) (result SetDefinition, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -212,7 +211,6 @@ func (client SetDefinitionsClient) CreateOrUpdateAtManagementGroupSender(req *ht func (client SetDefinitionsClient) CreateOrUpdateAtManagementGroupResponder(resp *http.Response) (result SetDefinition, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -286,7 +284,6 @@ func (client SetDefinitionsClient) DeleteSender(req *http.Request) (*http.Respon func (client SetDefinitionsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -361,7 +358,6 @@ func (client SetDefinitionsClient) DeleteAtManagementGroupSender(req *http.Reque func (client SetDefinitionsClient) DeleteAtManagementGroupResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -434,7 +430,6 @@ func (client SetDefinitionsClient) GetSender(req *http.Request) (*http.Response, func (client SetDefinitionsClient) GetResponder(resp *http.Response) (result SetDefinition, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -510,7 +505,6 @@ func (client SetDefinitionsClient) GetAtManagementGroupSender(req *http.Request) func (client SetDefinitionsClient) GetAtManagementGroupResponder(resp *http.Response) (result SetDefinition, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -583,7 +577,6 @@ func (client SetDefinitionsClient) GetBuiltInSender(req *http.Request) (*http.Re func (client SetDefinitionsClient) GetBuiltInResponder(resp *http.Response) (result SetDefinition, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -621,6 +614,9 @@ func (client SetDefinitionsClient) List(ctx context.Context) (result SetDefiniti if err != nil { err = autorest.NewErrorWithError(err, "policy.SetDefinitionsClient", "List", resp, "Failure responding to request") } + if result.sdlr.hasNextLink() && result.sdlr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -655,7 +651,6 @@ func (client SetDefinitionsClient) ListSender(req *http.Request) (*http.Response func (client SetDefinitionsClient) ListResponder(resp *http.Response) (result SetDefinitionListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -730,6 +725,9 @@ func (client SetDefinitionsClient) ListBuiltIn(ctx context.Context) (result SetD if err != nil { err = autorest.NewErrorWithError(err, "policy.SetDefinitionsClient", "ListBuiltIn", resp, "Failure responding to request") } + if result.sdlr.hasNextLink() && result.sdlr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -760,7 +758,6 @@ func (client SetDefinitionsClient) ListBuiltInSender(req *http.Request) (*http.R func (client SetDefinitionsClient) ListBuiltInResponder(resp *http.Response) (result SetDefinitionListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -838,6 +835,9 @@ func (client SetDefinitionsClient) ListByManagementGroup(ctx context.Context, ma if err != nil { err = autorest.NewErrorWithError(err, "policy.SetDefinitionsClient", "ListByManagementGroup", resp, "Failure responding to request") } + if result.sdlr.hasNextLink() && result.sdlr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -872,7 +872,6 @@ func (client SetDefinitionsClient) ListByManagementGroupSender(req *http.Request func (client SetDefinitionsClient) ListByManagementGroupResponder(resp *http.Response) (result SetDefinitionListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/services/resources/mgmt/2019-06-01/policy/version.go b/services/resources/mgmt/2019-06-01/policy/version.go index 10032e3ed295..d4895983ab83 100644 --- a/services/resources/mgmt/2019-06-01/policy/version.go +++ b/services/resources/mgmt/2019-06-01/policy/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 + " policy/2019-06-01" + return "Azure-SDK-For-Go/" + Version() + " policy/2019-06-01" } // Version returns the semantic version (see http://semver.org) of the client.