diff --git a/services/resources/mgmt/2015-11-01/resources/deploymentoperations.go b/services/resources/mgmt/2015-11-01/resources/deploymentoperations.go index e9f1845cd7d1..a91abc55d93f 100644 --- a/services/resources/mgmt/2015-11-01/resources/deploymentoperations.go +++ b/services/resources/mgmt/2015-11-01/resources/deploymentoperations.go @@ -121,7 +121,6 @@ func (client DeploymentOperationsClient) GetSender(req *http.Request) (*http.Res func (client DeploymentOperationsClient) GetResponder(resp *http.Response) (result DeploymentOperation, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -171,6 +170,9 @@ func (client DeploymentOperationsClient) List(ctx context.Context, resourceGroup if err != nil { err = autorest.NewErrorWithError(err, "resources.DeploymentOperationsClient", "List", resp, "Failure responding to request") } + if result.dolr.hasNextLink() && result.dolr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -210,7 +212,6 @@ func (client DeploymentOperationsClient) ListSender(req *http.Request) (*http.Re func (client DeploymentOperationsClient) ListResponder(resp *http.Response) (result DeploymentOperationsListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/services/resources/mgmt/2015-11-01/resources/deployments.go b/services/resources/mgmt/2015-11-01/resources/deployments.go index 48615bb888d2..6b58becafd33 100644 --- a/services/resources/mgmt/2015-11-01/resources/deployments.go +++ b/services/resources/mgmt/2015-11-01/resources/deployments.go @@ -105,7 +105,6 @@ func (client DeploymentsClient) CalculateTemplateHashSender(req *http.Request) ( func (client DeploymentsClient) CalculateTemplateHashResponder(resp *http.Response) (result TemplateHashResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -189,7 +188,6 @@ func (client DeploymentsClient) CancelSender(req *http.Request) (*http.Response, func (client DeploymentsClient) CancelResponder(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 @@ -272,7 +270,6 @@ func (client DeploymentsClient) CheckExistenceSender(req *http.Request) (*http.R func (client DeploymentsClient) CheckExistenceResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent, http.StatusNotFound), autorest.ByClosing()) result.Response = resp @@ -365,7 +362,6 @@ func (client DeploymentsClient) CreateOrUpdateSender(req *http.Request) (future func (client DeploymentsClient) CreateOrUpdateResponder(resp *http.Response) (result DeploymentExtended, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -450,7 +446,6 @@ func (client DeploymentsClient) DeleteSender(req *http.Request) (future Deployme func (client DeploymentsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -533,7 +528,6 @@ func (client DeploymentsClient) GetSender(req *http.Request) (*http.Response, er func (client DeploymentsClient) GetResponder(resp *http.Response) (result DeploymentExtended, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -583,6 +577,9 @@ func (client DeploymentsClient) List(ctx context.Context, resourceGroupName stri if err != nil { err = autorest.NewErrorWithError(err, "resources.DeploymentsClient", "List", resp, "Failure responding to request") } + if result.dlr.hasNextLink() && result.dlr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -624,7 +621,6 @@ func (client DeploymentsClient) ListSender(req *http.Request) (*http.Response, e func (client DeploymentsClient) ListResponder(resp *http.Response) (result DeploymentListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -755,7 +751,6 @@ func (client DeploymentsClient) ValidateSender(req *http.Request) (*http.Respons func (client DeploymentsClient) ValidateResponder(resp *http.Response) (result DeploymentValidateResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusBadRequest), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/services/resources/mgmt/2015-11-01/resources/enums.go b/services/resources/mgmt/2015-11-01/resources/enums.go new file mode 100644 index 000000000000..26c99b4a44d3 --- /dev/null +++ b/services/resources/mgmt/2015-11-01/resources/enums.go @@ -0,0 +1,33 @@ +package resources + +// 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. + +// DeploymentMode enumerates the values for deployment mode. +type DeploymentMode string + +const ( + // Complete ... + Complete DeploymentMode = "Complete" + // Incremental ... + Incremental DeploymentMode = "Incremental" +) + +// PossibleDeploymentModeValues returns an array of possible values for the DeploymentMode const type. +func PossibleDeploymentModeValues() []DeploymentMode { + return []DeploymentMode{Complete, Incremental} +} diff --git a/services/resources/mgmt/2015-11-01/resources/groups.go b/services/resources/mgmt/2015-11-01/resources/groups.go index 8b64fb211825..eb8bb14c3283 100644 --- a/services/resources/mgmt/2015-11-01/resources/groups.go +++ b/services/resources/mgmt/2015-11-01/resources/groups.go @@ -116,7 +116,6 @@ func (client GroupsClient) CheckExistenceSender(req *http.Request) (*http.Respon func (client GroupsClient) CheckExistenceResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent, http.StatusNotFound), autorest.ByClosing()) result.Response = resp @@ -203,7 +202,6 @@ func (client GroupsClient) CreateOrUpdateSender(req *http.Request) (*http.Respon func (client GroupsClient) CreateOrUpdateResponder(resp *http.Response) (result Group, 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 GroupsClient) DeleteSender(req *http.Request) (future GroupsDeleteF func (client GroupsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByClosing()) result.Response = resp @@ -367,7 +364,6 @@ func (client GroupsClient) GetSender(req *http.Request) (*http.Response, error) func (client GroupsClient) GetResponder(resp *http.Response) (result Group, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -408,6 +404,9 @@ func (client GroupsClient) List(ctx context.Context, filter string, top *int32) if err != nil { err = autorest.NewErrorWithError(err, "resources.GroupsClient", "List", resp, "Failure responding to request") } + if result.glr.hasNextLink() && result.glr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -448,7 +447,6 @@ func (client GroupsClient) ListSender(req *http.Request) (*http.Response, error) func (client GroupsClient) ListResponder(resp *http.Response) (result GroupListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -537,6 +535,9 @@ func (client GroupsClient) ListResources(ctx context.Context, resourceGroupName if err != nil { err = autorest.NewErrorWithError(err, "resources.GroupsClient", "ListResources", resp, "Failure responding to request") } + if result.lr.hasNextLink() && result.lr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -581,7 +582,6 @@ func (client GroupsClient) ListResourcesSender(req *http.Request) (*http.Respons func (client GroupsClient) ListResourcesResponder(resp *http.Response) (result ListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -706,7 +706,6 @@ func (client GroupsClient) PatchSender(req *http.Request) (*http.Response, error func (client GroupsClient) PatchResponder(resp *http.Response) (result Group, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/services/resources/mgmt/2015-11-01/resources/models.go b/services/resources/mgmt/2015-11-01/resources/models.go index e20f84058de5..8f1d5cf32ca4 100644 --- a/services/resources/mgmt/2015-11-01/resources/models.go +++ b/services/resources/mgmt/2015-11-01/resources/models.go @@ -31,21 +31,6 @@ import ( // The package's fully qualified name. const fqdn = "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2015-11-01/resources" -// DeploymentMode enumerates the values for deployment mode. -type DeploymentMode string - -const ( - // Complete ... - Complete DeploymentMode = "Complete" - // Incremental ... - Incremental DeploymentMode = "Incremental" -) - -// PossibleDeploymentModeValues returns an array of possible values for the DeploymentMode const type. -func PossibleDeploymentModeValues() []DeploymentMode { - return []DeploymentMode{Complete, Incremental} -} - // BasicDependency deployment dependency information. type BasicDependency struct { // ID - Gets or sets the ID of the dependency. @@ -90,6 +75,18 @@ type DeploymentExtended struct { Properties *DeploymentPropertiesExtended `json:"properties,omitempty"` } +// MarshalJSON is the custom marshaler for DeploymentExtended. +func (de DeploymentExtended) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if de.Name != nil { + objectMap["name"] = de.Name + } + if de.Properties != nil { + objectMap["properties"] = de.Properties + } + return json.Marshal(objectMap) +} + // DeploymentExtendedFilter deployment filter. type DeploymentExtendedFilter struct { // ProvisioningState - Gets or sets the provisioning state. @@ -173,10 +170,15 @@ func (dlr DeploymentListResult) IsEmpty() bool { return dlr.Value == nil || len(*dlr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (dlr DeploymentListResult) hasNextLink() bool { + return dlr.NextLink != nil && len(*dlr.NextLink) != 0 +} + // deploymentListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (dlr DeploymentListResult) deploymentListResultPreparer(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), @@ -204,11 +206,16 @@ func (page *DeploymentListResultPage) 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 } @@ -276,8 +283,7 @@ type DeploymentOperationsListResult struct { NextLink *string `json:"nextLink,omitempty"` } -// DeploymentOperationsListResultIterator provides access to a complete listing of DeploymentOperation -// values. +// DeploymentOperationsListResultIterator provides access to a complete listing of DeploymentOperation values. type DeploymentOperationsListResultIterator struct { i int page DeploymentOperationsListResultPage @@ -345,10 +351,15 @@ func (dolr DeploymentOperationsListResult) IsEmpty() bool { return dolr.Value == nil || len(*dolr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (dolr DeploymentOperationsListResult) hasNextLink() bool { + return dolr.NextLink != nil && len(*dolr.NextLink) != 0 +} + // deploymentOperationsListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (dolr DeploymentOperationsListResult) deploymentOperationsListResultPreparer(ctx context.Context) (*http.Request, error) { - if dolr.NextLink == nil || len(to.String(dolr.NextLink)) < 1 { + if !dolr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -376,11 +387,16 @@ func (page *DeploymentOperationsListResultPage) NextWithContext(ctx context.Cont tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.dolr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.dolr) + if err != nil { + return err + } + page.dolr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.dolr = next return nil } @@ -454,8 +470,8 @@ type DeploymentPropertiesExtended struct { Mode DeploymentMode `json:"mode,omitempty"` } -// DeploymentsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. +// DeploymentsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. type DeploymentsCreateOrUpdateFuture struct { azure.Future } @@ -743,10 +759,15 @@ func (glr GroupListResult) IsEmpty() bool { return glr.Value == nil || len(*glr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (glr GroupListResult) hasNextLink() bool { + return glr.NextLink != nil && len(*glr.NextLink) != 0 +} + // groupListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (glr GroupListResult) groupListResultPreparer(ctx context.Context) (*http.Request, error) { - if glr.NextLink == nil || len(to.String(glr.NextLink)) < 1 { + if !glr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -774,11 +795,16 @@ func (page *GroupListResultPage) NextWithContext(ctx context.Context) (err error tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.glr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.glr) + if err != nil { + return err + } + page.glr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.glr = next return nil } @@ -917,10 +943,15 @@ func (lr ListResult) IsEmpty() bool { return lr.Value == nil || len(*lr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (lr ListResult) hasNextLink() bool { + return lr.NextLink != nil && len(*lr.NextLink) != 0 +} + // listResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (lr ListResult) listResultPreparer(ctx context.Context) (*http.Request, error) { - if lr.NextLink == nil || len(to.String(lr.NextLink)) < 1 { + if !lr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -948,11 +979,16 @@ func (page *ListResultPage) NextWithContext(ctx context.Context) (err error) { tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.lr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.lr) + if err != nil { + return err + } + page.lr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.lr = next return nil } @@ -1016,8 +1052,7 @@ type MoveInfo struct { TargetResourceGroup *string `json:"targetResourceGroup,omitempty"` } -// MoveResourcesFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. +// MoveResourcesFuture an abstraction for monitoring and retrieving the results of a long-running operation. type MoveResourcesFuture struct { azure.Future } @@ -1068,6 +1103,15 @@ type PolicyAssignment struct { Name *string `json:"name,omitempty"` } +// MarshalJSON is the custom marshaler for PolicyAssignment. +func (pa PolicyAssignment) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pa.Properties != nil { + objectMap["properties"] = pa.Properties + } + return json.Marshal(objectMap) +} + // PolicyAssignmentListResult policy assignment list operation result. type PolicyAssignmentListResult struct { autorest.Response `json:"-"` @@ -1145,10 +1189,15 @@ func (palr PolicyAssignmentListResult) IsEmpty() bool { return palr.Value == nil || len(*palr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (palr PolicyAssignmentListResult) hasNextLink() bool { + return palr.NextLink != nil && len(*palr.NextLink) != 0 +} + // policyAssignmentListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (palr PolicyAssignmentListResult) policyAssignmentListResultPreparer(ctx context.Context) (*http.Request, error) { - if palr.NextLink == nil || len(to.String(palr.NextLink)) < 1 { + if !palr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -1176,11 +1225,16 @@ func (page *PolicyAssignmentListResultPage) NextWithContext(ctx context.Context) tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.palr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.palr) + if err != nil { + return err + } + page.palr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.palr = next return nil } @@ -1333,10 +1387,15 @@ func (plr ProviderListResult) IsEmpty() bool { return plr.Value == nil || len(*plr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (plr ProviderListResult) hasNextLink() bool { + return plr.NextLink != nil && len(*plr.NextLink) != 0 +} + // providerListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (plr ProviderListResult) providerListResultPreparer(ctx context.Context) (*http.Request, error) { - if plr.NextLink == nil || len(to.String(plr.NextLink)) < 1 { + if !plr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -1364,11 +1423,16 @@ func (page *ProviderListResultPage) NextWithContext(ctx context.Context) (err er tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.plr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.plr) + if err != nil { + return err + } + page.plr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.plr = next return nil } @@ -1488,10 +1552,15 @@ func (podlr ProviderOperationDetailListResult) IsEmpty() bool { return podlr.Value == nil || len(*podlr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (podlr ProviderOperationDetailListResult) hasNextLink() bool { + return podlr.NextLink != nil && len(*podlr.NextLink) != 0 +} + // providerOperationDetailListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (podlr ProviderOperationDetailListResult) providerOperationDetailListResultPreparer(ctx context.Context) (*http.Request, error) { - if podlr.NextLink == nil || len(to.String(podlr.NextLink)) < 1 { + if !podlr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -1519,11 +1588,16 @@ func (page *ProviderOperationDetailListResultPage) NextWithContext(ctx context.C tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.podlr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.podlr) + if err != nil { + return err + } + page.podlr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.podlr = next return nil } @@ -1654,6 +1728,21 @@ type TagDetails struct { Values *[]TagValue `json:"values,omitempty"` } +// MarshalJSON is the custom marshaler for TagDetails. +func (td TagDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if td.TagName != nil { + objectMap["tagName"] = td.TagName + } + if td.Count != nil { + objectMap["count"] = td.Count + } + if td.Values != nil { + objectMap["values"] = td.Values + } + return json.Marshal(objectMap) +} + // TagsListResult list of subscription tags. type TagsListResult struct { autorest.Response `json:"-"` @@ -1731,10 +1820,15 @@ func (tlr TagsListResult) IsEmpty() bool { return tlr.Value == nil || len(*tlr.Value) == 0 } +// hasNextLink returns true if the NextLink is not empty. +func (tlr TagsListResult) hasNextLink() bool { + return tlr.NextLink != nil && len(*tlr.NextLink) != 0 +} + // tagsListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (tlr TagsListResult) tagsListResultPreparer(ctx context.Context) (*http.Request, error) { - if tlr.NextLink == nil || len(to.String(tlr.NextLink)) < 1 { + if !tlr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), @@ -1762,11 +1856,16 @@ func (page *TagsListResultPage) NextWithContext(ctx context.Context) (err error) tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.tlr) - if err != nil { - return err + for { + next, err := page.fn(ctx, page.tlr) + if err != nil { + return err + } + page.tlr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - page.tlr = next return nil } @@ -1811,6 +1910,18 @@ type TagValue struct { Count *TagCount `json:"count,omitempty"` } +// MarshalJSON is the custom marshaler for TagValue. +func (tv TagValue) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if tv.TagValue != nil { + objectMap["tagValue"] = tv.TagValue + } + if tv.Count != nil { + objectMap["count"] = tv.Count + } + return json.Marshal(objectMap) +} + // TargetResource target resource. type TargetResource struct { // ID - Gets or sets the ID of the resource. diff --git a/services/resources/mgmt/2015-11-01/resources/policyassignments.go b/services/resources/mgmt/2015-11-01/resources/policyassignments.go index 7d8d6f5a2a7d..400b7ce715b5 100644 --- a/services/resources/mgmt/2015-11-01/resources/policyassignments.go +++ b/services/resources/mgmt/2015-11-01/resources/policyassignments.go @@ -114,7 +114,6 @@ func (client PolicyAssignmentsClient) CreateSender(req *http.Request) (*http.Res func (client PolicyAssignmentsClient) CreateResponder(resp *http.Response) (result PolicyAssignment, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -191,7 +190,6 @@ func (client PolicyAssignmentsClient) CreateByIDSender(req *http.Request) (*http func (client PolicyAssignmentsClient) CreateByIDResponder(resp *http.Response) (result PolicyAssignment, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -260,7 +258,6 @@ func (client PolicyAssignmentsClient) DeleteSender(req *http.Request) (*http.Res func (client PolicyAssignmentsClient) DeleteResponder(resp *http.Response) (result PolicyAssignment, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -333,7 +330,6 @@ func (client PolicyAssignmentsClient) DeleteByIDSender(req *http.Request) (*http func (client PolicyAssignmentsClient) DeleteByIDResponder(resp *http.Response) (result PolicyAssignment, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -408,7 +404,6 @@ func (client PolicyAssignmentsClient) GetSender(req *http.Request) (*http.Respon func (client PolicyAssignmentsClient) GetResponder(resp *http.Response) (result PolicyAssignment, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -481,7 +476,6 @@ func (client PolicyAssignmentsClient) GetByIDSender(req *http.Request) (*http.Re func (client PolicyAssignmentsClient) GetByIDResponder(resp *http.Response) (result PolicyAssignment, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -521,6 +515,9 @@ func (client PolicyAssignmentsClient) List(ctx context.Context, filter string) ( if err != nil { err = autorest.NewErrorWithError(err, "resources.PolicyAssignmentsClient", "List", resp, "Failure responding to request") } + if result.palr.hasNextLink() && result.palr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -558,7 +555,6 @@ func (client PolicyAssignmentsClient) ListSender(req *http.Request) (*http.Respo func (client PolicyAssignmentsClient) ListResponder(resp *http.Response) (result PolicyAssignmentListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -648,6 +644,9 @@ func (client PolicyAssignmentsClient) ListForResource(ctx context.Context, resou if err != nil { err = autorest.NewErrorWithError(err, "resources.PolicyAssignmentsClient", "ListForResource", resp, "Failure responding to request") } + if result.palr.hasNextLink() && result.palr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -690,7 +689,6 @@ func (client PolicyAssignmentsClient) ListForResourceSender(req *http.Request) ( func (client PolicyAssignmentsClient) ListForResourceResponder(resp *http.Response) (result PolicyAssignmentListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -776,6 +774,9 @@ func (client PolicyAssignmentsClient) ListForResourceGroup(ctx context.Context, if err != nil { err = autorest.NewErrorWithError(err, "resources.PolicyAssignmentsClient", "ListForResourceGroup", resp, "Failure responding to request") } + if result.palr.hasNextLink() && result.palr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -814,7 +815,6 @@ func (client PolicyAssignmentsClient) ListForResourceGroupSender(req *http.Reque func (client PolicyAssignmentsClient) ListForResourceGroupResponder(resp *http.Response) (result PolicyAssignmentListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -892,6 +892,9 @@ func (client PolicyAssignmentsClient) ListForScope(ctx context.Context, scope st if err != nil { err = autorest.NewErrorWithError(err, "resources.PolicyAssignmentsClient", "ListForScope", resp, "Failure responding to request") } + if result.palr.hasNextLink() && result.palr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -929,7 +932,6 @@ func (client PolicyAssignmentsClient) ListForScopeSender(req *http.Request) (*ht func (client PolicyAssignmentsClient) ListForScopeResponder(resp *http.Response) (result PolicyAssignmentListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/services/resources/mgmt/2015-11-01/resources/policydefinitions.go b/services/resources/mgmt/2015-11-01/resources/policydefinitions.go index 3cce10c58b20..fe5372d37639 100644 --- a/services/resources/mgmt/2015-11-01/resources/policydefinitions.go +++ b/services/resources/mgmt/2015-11-01/resources/policydefinitions.go @@ -111,7 +111,6 @@ func (client PolicyDefinitionsClient) CreateOrUpdateSender(req *http.Request) (* func (client PolicyDefinitionsClient) CreateOrUpdateResponder(resp *http.Response) (result PolicyDefinition, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -185,7 +184,6 @@ func (client PolicyDefinitionsClient) DeleteSender(req *http.Request) (*http.Res func (client PolicyDefinitionsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByClosing()) result.Response = resp @@ -258,7 +256,6 @@ func (client PolicyDefinitionsClient) GetSender(req *http.Request) (*http.Respon func (client PolicyDefinitionsClient) GetResponder(resp *http.Response) (result PolicyDefinition, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/services/resources/mgmt/2015-11-01/resources/provideroperationdetails.go b/services/resources/mgmt/2015-11-01/resources/provideroperationdetails.go index 164bfa4bde30..db3aefea12d8 100644 --- a/services/resources/mgmt/2015-11-01/resources/provideroperationdetails.go +++ b/services/resources/mgmt/2015-11-01/resources/provideroperationdetails.go @@ -74,6 +74,9 @@ func (client ProviderOperationDetailsClient) List(ctx context.Context, resourceP if err != nil { err = autorest.NewErrorWithError(err, "resources.ProviderOperationDetailsClient", "List", resp, "Failure responding to request") } + if result.podlr.hasNextLink() && result.podlr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -107,7 +110,6 @@ func (client ProviderOperationDetailsClient) ListSender(req *http.Request) (*htt func (client ProviderOperationDetailsClient) ListResponder(resp *http.Response) (result ProviderOperationDetailListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/services/resources/mgmt/2015-11-01/resources/providers.go b/services/resources/mgmt/2015-11-01/resources/providers.go index dbb499343b54..cc11b4a42dab 100644 --- a/services/resources/mgmt/2015-11-01/resources/providers.go +++ b/services/resources/mgmt/2015-11-01/resources/providers.go @@ -107,7 +107,6 @@ func (client ProvidersClient) GetSender(req *http.Request) (*http.Response, erro func (client ProvidersClient) GetResponder(resp *http.Response) (result Provider, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -147,6 +146,9 @@ func (client ProvidersClient) List(ctx context.Context, top *int32) (result Prov if err != nil { err = autorest.NewErrorWithError(err, "resources.ProvidersClient", "List", resp, "Failure responding to request") } + if result.plr.hasNextLink() && result.plr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -184,7 +186,6 @@ func (client ProvidersClient) ListSender(req *http.Request) (*http.Response, err func (client ProvidersClient) ListResponder(resp *http.Response) (result ProviderListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -295,7 +296,6 @@ func (client ProvidersClient) RegisterSender(req *http.Request) (*http.Response, func (client ProvidersClient) RegisterResponder(resp *http.Response) (result Provider, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -369,7 +369,6 @@ func (client ProvidersClient) UnregisterSender(req *http.Request) (*http.Respons func (client ProvidersClient) UnregisterResponder(resp *http.Response) (result Provider, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/services/resources/mgmt/2015-11-01/resources/resources.go b/services/resources/mgmt/2015-11-01/resources/resources.go index e627a4d7b1fd..98e341abb4ed 100644 --- a/services/resources/mgmt/2015-11-01/resources/resources.go +++ b/services/resources/mgmt/2015-11-01/resources/resources.go @@ -123,7 +123,6 @@ func (client Client) CheckExistenceSender(req *http.Request) (*http.Response, er func (client Client) CheckExistenceResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent, http.StatusNotFound), autorest.ByClosing()) result.Response = resp @@ -214,7 +213,6 @@ func (client Client) CreateOrUpdateSender(req *http.Request) (*http.Response, er func (client Client) CreateOrUpdateResponder(resp *http.Response) (result GenericResource, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -303,7 +301,6 @@ func (client Client) DeleteSender(req *http.Request) (*http.Response, error) { func (client Client) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -391,7 +388,6 @@ func (client Client) GetSender(req *http.Request) (*http.Response, error) { func (client Client) GetResponder(resp *http.Response) (result GenericResource, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -434,6 +430,9 @@ func (client Client) List(ctx context.Context, filter string, expand string, top if err != nil { err = autorest.NewErrorWithError(err, "resources.Client", "List", resp, "Failure responding to request") } + if result.lr.hasNextLink() && result.lr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -477,7 +476,6 @@ func (client Client) ListSender(req *http.Request) (*http.Response, error) { func (client Client) ListResponder(resp *http.Response) (result ListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -600,7 +598,6 @@ func (client Client) MoveResourcesSender(req *http.Request) (future MoveResource func (client Client) MoveResourcesResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp @@ -692,7 +689,6 @@ func (client Client) UpdateSender(req *http.Request) (future UpdateFuture, err e func (client Client) UpdateResponder(resp *http.Response) (result GenericResource, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/services/resources/mgmt/2015-11-01/resources/tags.go b/services/resources/mgmt/2015-11-01/resources/tags.go index 2a21cc284190..72c25077e2e6 100644 --- a/services/resources/mgmt/2015-11-01/resources/tags.go +++ b/services/resources/mgmt/2015-11-01/resources/tags.go @@ -107,7 +107,6 @@ func (client TagsClient) CreateOrUpdateSender(req *http.Request) (*http.Response func (client TagsClient) CreateOrUpdateResponder(resp *http.Response) (result TagDetails, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -183,7 +182,6 @@ func (client TagsClient) CreateOrUpdateValueSender(req *http.Request) (*http.Res func (client TagsClient) CreateOrUpdateValueResponder(resp *http.Response) (result TagValue, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) @@ -257,7 +255,6 @@ func (client TagsClient) DeleteSender(req *http.Request) (*http.Response, error) func (client TagsClient) 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 @@ -332,7 +329,6 @@ func (client TagsClient) DeleteValueSender(req *http.Request) (*http.Response, e func (client TagsClient) DeleteValueResponder(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 @@ -369,6 +365,9 @@ func (client TagsClient) List(ctx context.Context) (result TagsListResultPage, e if err != nil { err = autorest.NewErrorWithError(err, "resources.TagsClient", "List", resp, "Failure responding to request") } + if result.tlr.hasNextLink() && result.tlr.IsEmpty() { + err = result.NextWithContext(ctx) + } return } @@ -403,7 +402,6 @@ func (client TagsClient) ListSender(req *http.Request) (*http.Response, error) { func (client TagsClient) ListResponder(resp *http.Response) (result TagsListResult, err error) { err = autorest.Respond( resp, - client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) diff --git a/services/resources/mgmt/2015-11-01/resources/version.go b/services/resources/mgmt/2015-11-01/resources/version.go index 98d29c6bd539..a3bc8589b3e6 100644 --- a/services/resources/mgmt/2015-11-01/resources/version.go +++ b/services/resources/mgmt/2015-11-01/resources/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 + " resources/2015-11-01" + return "Azure-SDK-For-Go/" + Version() + " resources/2015-11-01" } // Version returns the semantic version (see http://semver.org) of the client.