diff --git a/services/resources/mgmt/2019-09-01/policy/assignments.go b/services/resources/mgmt/2019-09-01/policy/assignments.go index 7621a9edf6f4..ccf183b11346 100644 --- a/services/resources/mgmt/2019-09-01/policy/assignments.go +++ b/services/resources/mgmt/2019-09-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()) @@ -712,6 +708,9 @@ func (client AssignmentsClient) ListForManagementGroup(ctx context.Context, mana if err != nil { err = autorest.NewErrorWithError(err, "policy.AssignmentsClient", "ListForManagementGroup", resp, "Failure responding to request") } + if result.alr.hasNextLink() && result.alr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -747,7 +746,6 @@ func (client AssignmentsClient) ListForManagementGroupSender(req *http.Request) func (client AssignmentsClient) ListForManagementGroupResponder(resp *http.Response) (result AssignmentListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -857,6 +855,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 } @@ -899,7 +900,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()) @@ -994,6 +994,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 } @@ -1032,7 +1035,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-09-01/policy/definitions.go b/services/resources/mgmt/2019-09-01/policy/definitions.go index febd295f2e6d..869a2920c3cf 100644 --- a/services/resources/mgmt/2019-09-01/policy/definitions.go +++ b/services/resources/mgmt/2019-09-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-09-01/policy/enums.go b/services/resources/mgmt/2019-09-01/policy/enums.go new file mode 100644 index 000000000000..42acd31a3b29 --- /dev/null +++ b/services/resources/mgmt/2019-09-01/policy/enums.go @@ -0,0 +1,93 @@ +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} +} + +// ParameterType enumerates the values for parameter type. +type ParameterType string + +const ( + // Array ... + Array ParameterType = "Array" + // Boolean ... + Boolean ParameterType = "Boolean" + // DateTime ... + DateTime ParameterType = "DateTime" + // Float ... + Float ParameterType = "Float" + // Integer ... + Integer ParameterType = "Integer" + // Object ... + Object ParameterType = "Object" + // String ... + String ParameterType = "String" +) + +// PossibleParameterTypeValues returns an array of possible values for the ParameterType const type. +func PossibleParameterTypeValues() []ParameterType { + return []ParameterType{Array, Boolean, DateTime, Float, Integer, Object, String} +} + +// ResourceIdentityType enumerates the values for resource identity type. +type ResourceIdentityType string + +const ( + // None Indicates that no identity is associated with the resource or that the existing identity should be + // removed. + None ResourceIdentityType = "None" + // SystemAssigned Indicates that a system assigned identity is associated with the resource. + 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" + // Static ... + Static Type = "Static" +) + +// PossibleTypeValues returns an array of possible values for the Type const type. +func PossibleTypeValues() []Type { + return []Type{BuiltIn, Custom, NotSpecified, Static} +} diff --git a/services/resources/mgmt/2019-09-01/policy/models.go b/services/resources/mgmt/2019-09-01/policy/models.go index 826df3d63647..9806e85b7b55 100644 --- a/services/resources/mgmt/2019-09-01/policy/models.go +++ b/services/resources/mgmt/2019-09-01/policy/models.go @@ -29,81 +29,6 @@ import ( // The package's fully qualified name. const fqdn = "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2019-09-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} -} - -// ParameterType enumerates the values for parameter type. -type ParameterType string - -const ( - // Array ... - Array ParameterType = "Array" - // Boolean ... - Boolean ParameterType = "Boolean" - // DateTime ... - DateTime ParameterType = "DateTime" - // Float ... - Float ParameterType = "Float" - // Integer ... - Integer ParameterType = "Integer" - // Object ... - Object ParameterType = "Object" - // String ... - String ParameterType = "String" -) - -// PossibleParameterTypeValues returns an array of possible values for the ParameterType const type. -func PossibleParameterTypeValues() []ParameterType { - return []ParameterType{Array, Boolean, DateTime, Float, Integer, Object, String} -} - -// ResourceIdentityType enumerates the values for resource identity type. -type ResourceIdentityType string - -const ( - // None Indicates that no identity is associated with the resource or that the existing identity should be - // removed. - None ResourceIdentityType = "None" - // SystemAssigned Indicates that a system assigned identity is associated with the resource. - 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" - // Static ... - Static Type = "Static" -) - -// PossibleTypeValues returns an array of possible values for the Type const type. -func PossibleTypeValues() []Type { - return []Type{BuiltIn, Custom, NotSpecified, Static} -} - // Assignment the policy assignment. type Assignment struct { autorest.Response `json:"-"` @@ -296,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), @@ -327,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 } @@ -584,10 +519,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), @@ -615,11 +555,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 } @@ -760,6 +705,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) +} + // ParameterDefinitionsValue the definition of a parameter that can be provided to the policy. type ParameterDefinitionsValue struct { // Type - The data type of the parameter. Possible values include: 'String', 'Array', 'Object', 'Boolean', 'Integer', 'Float', 'DateTime' @@ -998,10 +952,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), @@ -1029,11 +988,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-09-01/policy/setdefinitions.go b/services/resources/mgmt/2019-09-01/policy/setdefinitions.go index 71b4a2fa17fa..3504f11c4074 100644 --- a/services/resources/mgmt/2019-09-01/policy/setdefinitions.go +++ b/services/resources/mgmt/2019-09-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-09-01/policy/version.go b/services/resources/mgmt/2019-09-01/policy/version.go index abcb254ae768..bddb0ca3fd46 100644 --- a/services/resources/mgmt/2019-09-01/policy/version.go +++ b/services/resources/mgmt/2019-09-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-09-01" + return "Azure-SDK-For-Go/" + Version() + " policy/2019-09-01" } // Version returns the semantic version (see http://semver.org) of the client.