From aded90c837808e82c98b483bb061030f476bc520 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Tue, 5 Mar 2019 02:38:12 +0000 Subject: [PATCH] Generated from 13b235cccbe934e60dba491a2a49edcae9c7f275 Fix Hosting Environment Network Dependencies pagination --- profiles/latest/web/mgmt/web/models.go | 20 +- profiles/preview/web/mgmt/web/models.go | 20 +- .../2018-02-01/web/appserviceenvironments.go | 104 +++++- services/web/mgmt/2018-02-01/web/models.go | 306 +++++++++++++++++- .../mgmt/2018-02-01/web/webapi/interfaces.go | 4 +- 5 files changed, 422 insertions(+), 32 deletions(-) diff --git a/profiles/latest/web/mgmt/web/models.go b/profiles/latest/web/mgmt/web/models.go index a7221988266a..1b6a79758ade 100644 --- a/profiles/latest/web/mgmt/web/models.go +++ b/profiles/latest/web/mgmt/web/models.go @@ -911,6 +911,9 @@ type IdentifierCollectionIterator = original.IdentifierCollectionIterator type IdentifierCollectionPage = original.IdentifierCollectionPage type IdentifierProperties = original.IdentifierProperties type InboundEnvironmentEndpoint = original.InboundEnvironmentEndpoint +type InboundEnvironmentEndpointCollection = original.InboundEnvironmentEndpointCollection +type InboundEnvironmentEndpointCollectionIterator = original.InboundEnvironmentEndpointCollectionIterator +type InboundEnvironmentEndpointCollectionPage = original.InboundEnvironmentEndpointCollectionPage type Job = original.Job type JobCollection = original.JobCollection type JobCollectionIterator = original.JobCollectionIterator @@ -920,10 +923,8 @@ type ListCapability = original.ListCapability type ListCertificateEmail = original.ListCertificateEmail type ListCertificateOrderAction = original.ListCertificateOrderAction type ListHostingEnvironmentDiagnostics = original.ListHostingEnvironmentDiagnostics -type ListInboundEnvironmentEndpoint = original.ListInboundEnvironmentEndpoint type ListNetworkTrace = original.ListNetworkTrace type ListOperation = original.ListOperation -type ListOutboundEnvironmentEndpoint = original.ListOutboundEnvironmentEndpoint type ListVnetInfo = original.ListVnetInfo type ListVnetRoute = original.ListVnetRoute type LocalizableString = original.LocalizableString @@ -957,6 +958,9 @@ type NetworkFeaturesProperties = original.NetworkFeaturesProperties type NetworkTrace = original.NetworkTrace type Operation = original.Operation type OutboundEnvironmentEndpoint = original.OutboundEnvironmentEndpoint +type OutboundEnvironmentEndpointCollection = original.OutboundEnvironmentEndpointCollection +type OutboundEnvironmentEndpointCollectionIterator = original.OutboundEnvironmentEndpointCollectionIterator +type OutboundEnvironmentEndpointCollectionPage = original.OutboundEnvironmentEndpointCollectionPage type PerfMonCounterCollection = original.PerfMonCounterCollection type PerfMonCounterCollectionIterator = original.PerfMonCounterCollectionIterator type PerfMonCounterCollectionPage = original.PerfMonCounterCollectionPage @@ -1404,6 +1408,12 @@ func NewIdentifierCollectionIterator(page IdentifierCollectionPage) IdentifierCo func NewIdentifierCollectionPage(getNextPage func(context.Context, IdentifierCollection) (IdentifierCollection, error)) IdentifierCollectionPage { return original.NewIdentifierCollectionPage(getNextPage) } +func NewInboundEnvironmentEndpointCollectionIterator(page InboundEnvironmentEndpointCollectionPage) InboundEnvironmentEndpointCollectionIterator { + return original.NewInboundEnvironmentEndpointCollectionIterator(page) +} +func NewInboundEnvironmentEndpointCollectionPage(getNextPage func(context.Context, InboundEnvironmentEndpointCollection) (InboundEnvironmentEndpointCollection, error)) InboundEnvironmentEndpointCollectionPage { + return original.NewInboundEnvironmentEndpointCollectionPage(getNextPage) +} func NewJobCollectionIterator(page JobCollectionPage) JobCollectionIterator { return original.NewJobCollectionIterator(page) } @@ -1416,6 +1426,12 @@ func NewNameIdentifierCollectionIterator(page NameIdentifierCollectionPage) Name func NewNameIdentifierCollectionPage(getNextPage func(context.Context, NameIdentifierCollection) (NameIdentifierCollection, error)) NameIdentifierCollectionPage { return original.NewNameIdentifierCollectionPage(getNextPage) } +func NewOutboundEnvironmentEndpointCollectionIterator(page OutboundEnvironmentEndpointCollectionPage) OutboundEnvironmentEndpointCollectionIterator { + return original.NewOutboundEnvironmentEndpointCollectionIterator(page) +} +func NewOutboundEnvironmentEndpointCollectionPage(getNextPage func(context.Context, OutboundEnvironmentEndpointCollection) (OutboundEnvironmentEndpointCollection, error)) OutboundEnvironmentEndpointCollectionPage { + return original.NewOutboundEnvironmentEndpointCollectionPage(getNextPage) +} func NewPerfMonCounterCollectionIterator(page PerfMonCounterCollectionPage) PerfMonCounterCollectionIterator { return original.NewPerfMonCounterCollectionIterator(page) } diff --git a/profiles/preview/web/mgmt/web/models.go b/profiles/preview/web/mgmt/web/models.go index 8b9574d16897..71b0388bc04e 100644 --- a/profiles/preview/web/mgmt/web/models.go +++ b/profiles/preview/web/mgmt/web/models.go @@ -911,6 +911,9 @@ type IdentifierCollectionIterator = original.IdentifierCollectionIterator type IdentifierCollectionPage = original.IdentifierCollectionPage type IdentifierProperties = original.IdentifierProperties type InboundEnvironmentEndpoint = original.InboundEnvironmentEndpoint +type InboundEnvironmentEndpointCollection = original.InboundEnvironmentEndpointCollection +type InboundEnvironmentEndpointCollectionIterator = original.InboundEnvironmentEndpointCollectionIterator +type InboundEnvironmentEndpointCollectionPage = original.InboundEnvironmentEndpointCollectionPage type Job = original.Job type JobCollection = original.JobCollection type JobCollectionIterator = original.JobCollectionIterator @@ -920,10 +923,8 @@ type ListCapability = original.ListCapability type ListCertificateEmail = original.ListCertificateEmail type ListCertificateOrderAction = original.ListCertificateOrderAction type ListHostingEnvironmentDiagnostics = original.ListHostingEnvironmentDiagnostics -type ListInboundEnvironmentEndpoint = original.ListInboundEnvironmentEndpoint type ListNetworkTrace = original.ListNetworkTrace type ListOperation = original.ListOperation -type ListOutboundEnvironmentEndpoint = original.ListOutboundEnvironmentEndpoint type ListVnetInfo = original.ListVnetInfo type ListVnetRoute = original.ListVnetRoute type LocalizableString = original.LocalizableString @@ -957,6 +958,9 @@ type NetworkFeaturesProperties = original.NetworkFeaturesProperties type NetworkTrace = original.NetworkTrace type Operation = original.Operation type OutboundEnvironmentEndpoint = original.OutboundEnvironmentEndpoint +type OutboundEnvironmentEndpointCollection = original.OutboundEnvironmentEndpointCollection +type OutboundEnvironmentEndpointCollectionIterator = original.OutboundEnvironmentEndpointCollectionIterator +type OutboundEnvironmentEndpointCollectionPage = original.OutboundEnvironmentEndpointCollectionPage type PerfMonCounterCollection = original.PerfMonCounterCollection type PerfMonCounterCollectionIterator = original.PerfMonCounterCollectionIterator type PerfMonCounterCollectionPage = original.PerfMonCounterCollectionPage @@ -1404,6 +1408,12 @@ func NewIdentifierCollectionIterator(page IdentifierCollectionPage) IdentifierCo func NewIdentifierCollectionPage(getNextPage func(context.Context, IdentifierCollection) (IdentifierCollection, error)) IdentifierCollectionPage { return original.NewIdentifierCollectionPage(getNextPage) } +func NewInboundEnvironmentEndpointCollectionIterator(page InboundEnvironmentEndpointCollectionPage) InboundEnvironmentEndpointCollectionIterator { + return original.NewInboundEnvironmentEndpointCollectionIterator(page) +} +func NewInboundEnvironmentEndpointCollectionPage(getNextPage func(context.Context, InboundEnvironmentEndpointCollection) (InboundEnvironmentEndpointCollection, error)) InboundEnvironmentEndpointCollectionPage { + return original.NewInboundEnvironmentEndpointCollectionPage(getNextPage) +} func NewJobCollectionIterator(page JobCollectionPage) JobCollectionIterator { return original.NewJobCollectionIterator(page) } @@ -1416,6 +1426,12 @@ func NewNameIdentifierCollectionIterator(page NameIdentifierCollectionPage) Name func NewNameIdentifierCollectionPage(getNextPage func(context.Context, NameIdentifierCollection) (NameIdentifierCollection, error)) NameIdentifierCollectionPage { return original.NewNameIdentifierCollectionPage(getNextPage) } +func NewOutboundEnvironmentEndpointCollectionIterator(page OutboundEnvironmentEndpointCollectionPage) OutboundEnvironmentEndpointCollectionIterator { + return original.NewOutboundEnvironmentEndpointCollectionIterator(page) +} +func NewOutboundEnvironmentEndpointCollectionPage(getNextPage func(context.Context, OutboundEnvironmentEndpointCollection) (OutboundEnvironmentEndpointCollection, error)) OutboundEnvironmentEndpointCollectionPage { + return original.NewOutboundEnvironmentEndpointCollectionPage(getNextPage) +} func NewPerfMonCounterCollectionIterator(page PerfMonCounterCollectionPage) PerfMonCounterCollectionIterator { return original.NewPerfMonCounterCollectionIterator(page) } diff --git a/services/web/mgmt/2018-02-01/web/appserviceenvironments.go b/services/web/mgmt/2018-02-01/web/appserviceenvironments.go index bd876c788a0b..5afa46726662 100644 --- a/services/web/mgmt/2018-02-01/web/appserviceenvironments.go +++ b/services/web/mgmt/2018-02-01/web/appserviceenvironments.go @@ -710,13 +710,13 @@ func (client AppServiceEnvironmentsClient) GetDiagnosticsItemResponder(resp *htt // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the App Service Environment. -func (client AppServiceEnvironmentsClient) GetInboundNetworkDependenciesEndpoints(ctx context.Context, resourceGroupName string, name string) (result ListInboundEnvironmentEndpoint, err error) { +func (client AppServiceEnvironmentsClient) GetInboundNetworkDependenciesEndpoints(ctx context.Context, resourceGroupName string, name string) (result InboundEnvironmentEndpointCollectionPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceEnvironmentsClient.GetInboundNetworkDependenciesEndpoints") defer func() { sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode + if result.ieec.Response.Response != nil { + sc = result.ieec.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -729,6 +729,7 @@ func (client AppServiceEnvironmentsClient) GetInboundNetworkDependenciesEndpoint return result, validation.NewError("web.AppServiceEnvironmentsClient", "GetInboundNetworkDependenciesEndpoints", err.Error()) } + result.fn = client.getInboundNetworkDependenciesEndpointsNextResults req, err := client.GetInboundNetworkDependenciesEndpointsPreparer(ctx, resourceGroupName, name) if err != nil { err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "GetInboundNetworkDependenciesEndpoints", nil, "Failure preparing request") @@ -737,12 +738,12 @@ func (client AppServiceEnvironmentsClient) GetInboundNetworkDependenciesEndpoint resp, err := client.GetInboundNetworkDependenciesEndpointsSender(req) if err != nil { - result.Response = autorest.Response{Response: resp} + result.ieec.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "GetInboundNetworkDependenciesEndpoints", resp, "Failure sending request") return } - result, err = client.GetInboundNetworkDependenciesEndpointsResponder(resp) + result.ieec, err = client.GetInboundNetworkDependenciesEndpointsResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "GetInboundNetworkDependenciesEndpoints", resp, "Failure responding to request") } @@ -780,17 +781,54 @@ func (client AppServiceEnvironmentsClient) GetInboundNetworkDependenciesEndpoint // GetInboundNetworkDependenciesEndpointsResponder handles the response to the GetInboundNetworkDependenciesEndpoints request. The method always // closes the http.Response Body. -func (client AppServiceEnvironmentsClient) GetInboundNetworkDependenciesEndpointsResponder(resp *http.Response) (result ListInboundEnvironmentEndpoint, err error) { +func (client AppServiceEnvironmentsClient) GetInboundNetworkDependenciesEndpointsResponder(resp *http.Response) (result InboundEnvironmentEndpointCollection, err error) { err = autorest.Respond( resp, client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } +// getInboundNetworkDependenciesEndpointsNextResults retrieves the next set of results, if any. +func (client AppServiceEnvironmentsClient) getInboundNetworkDependenciesEndpointsNextResults(ctx context.Context, lastResults InboundEnvironmentEndpointCollection) (result InboundEnvironmentEndpointCollection, err error) { + req, err := lastResults.inboundEnvironmentEndpointCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "getInboundNetworkDependenciesEndpointsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.GetInboundNetworkDependenciesEndpointsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "getInboundNetworkDependenciesEndpointsNextResults", resp, "Failure sending next results request") + } + result, err = client.GetInboundNetworkDependenciesEndpointsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "getInboundNetworkDependenciesEndpointsNextResults", resp, "Failure responding to next results request") + } + return +} + +// GetInboundNetworkDependenciesEndpointsComplete enumerates all values, automatically crossing page boundaries as required. +func (client AppServiceEnvironmentsClient) GetInboundNetworkDependenciesEndpointsComplete(ctx context.Context, resourceGroupName string, name string) (result InboundEnvironmentEndpointCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceEnvironmentsClient.GetInboundNetworkDependenciesEndpoints") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.GetInboundNetworkDependenciesEndpoints(ctx, resourceGroupName, name) + return +} + // GetMultiRolePool get properties of a multi-role pool. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. @@ -881,13 +919,13 @@ func (client AppServiceEnvironmentsClient) GetMultiRolePoolResponder(resp *http. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. // name - name of the App Service Environment. -func (client AppServiceEnvironmentsClient) GetOutboundNetworkDependenciesEndpoints(ctx context.Context, resourceGroupName string, name string) (result ListOutboundEnvironmentEndpoint, err error) { +func (client AppServiceEnvironmentsClient) GetOutboundNetworkDependenciesEndpoints(ctx context.Context, resourceGroupName string, name string) (result OutboundEnvironmentEndpointCollectionPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceEnvironmentsClient.GetOutboundNetworkDependenciesEndpoints") defer func() { sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode + if result.oeec.Response.Response != nil { + sc = result.oeec.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -900,6 +938,7 @@ func (client AppServiceEnvironmentsClient) GetOutboundNetworkDependenciesEndpoin return result, validation.NewError("web.AppServiceEnvironmentsClient", "GetOutboundNetworkDependenciesEndpoints", err.Error()) } + result.fn = client.getOutboundNetworkDependenciesEndpointsNextResults req, err := client.GetOutboundNetworkDependenciesEndpointsPreparer(ctx, resourceGroupName, name) if err != nil { err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "GetOutboundNetworkDependenciesEndpoints", nil, "Failure preparing request") @@ -908,12 +947,12 @@ func (client AppServiceEnvironmentsClient) GetOutboundNetworkDependenciesEndpoin resp, err := client.GetOutboundNetworkDependenciesEndpointsSender(req) if err != nil { - result.Response = autorest.Response{Response: resp} + result.oeec.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "GetOutboundNetworkDependenciesEndpoints", resp, "Failure sending request") return } - result, err = client.GetOutboundNetworkDependenciesEndpointsResponder(resp) + result.oeec, err = client.GetOutboundNetworkDependenciesEndpointsResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "GetOutboundNetworkDependenciesEndpoints", resp, "Failure responding to request") } @@ -951,17 +990,54 @@ func (client AppServiceEnvironmentsClient) GetOutboundNetworkDependenciesEndpoin // GetOutboundNetworkDependenciesEndpointsResponder handles the response to the GetOutboundNetworkDependenciesEndpoints request. The method always // closes the http.Response Body. -func (client AppServiceEnvironmentsClient) GetOutboundNetworkDependenciesEndpointsResponder(resp *http.Response) (result ListOutboundEnvironmentEndpoint, err error) { +func (client AppServiceEnvironmentsClient) GetOutboundNetworkDependenciesEndpointsResponder(resp *http.Response) (result OutboundEnvironmentEndpointCollection, err error) { err = autorest.Respond( resp, client.ByInspecting(), azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } +// getOutboundNetworkDependenciesEndpointsNextResults retrieves the next set of results, if any. +func (client AppServiceEnvironmentsClient) getOutboundNetworkDependenciesEndpointsNextResults(ctx context.Context, lastResults OutboundEnvironmentEndpointCollection) (result OutboundEnvironmentEndpointCollection, err error) { + req, err := lastResults.outboundEnvironmentEndpointCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "getOutboundNetworkDependenciesEndpointsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.GetOutboundNetworkDependenciesEndpointsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "getOutboundNetworkDependenciesEndpointsNextResults", resp, "Failure sending next results request") + } + result, err = client.GetOutboundNetworkDependenciesEndpointsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "getOutboundNetworkDependenciesEndpointsNextResults", resp, "Failure responding to next results request") + } + return +} + +// GetOutboundNetworkDependenciesEndpointsComplete enumerates all values, automatically crossing page boundaries as required. +func (client AppServiceEnvironmentsClient) GetOutboundNetworkDependenciesEndpointsComplete(ctx context.Context, resourceGroupName string, name string) (result OutboundEnvironmentEndpointCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceEnvironmentsClient.GetOutboundNetworkDependenciesEndpoints") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.GetOutboundNetworkDependenciesEndpoints(ctx, resourceGroupName, name) + return +} + // GetWorkerPool get properties of a worker pool. // Parameters: // resourceGroupName - name of the resource group to which the resource belongs. diff --git a/services/web/mgmt/2018-02-01/web/models.go b/services/web/mgmt/2018-02-01/web/models.go index 419c43da1364..42749a2319b4 100644 --- a/services/web/mgmt/2018-02-01/web/models.go +++ b/services/web/mgmt/2018-02-01/web/models.go @@ -11906,6 +11906,153 @@ type InboundEnvironmentEndpoint struct { Ports *[]string `json:"ports,omitempty"` } +// InboundEnvironmentEndpointCollection collection of Inbound Environment Endpoints +type InboundEnvironmentEndpointCollection struct { + autorest.Response `json:"-"` + // Value - Collection of resources. + Value *[]InboundEnvironmentEndpoint `json:"value,omitempty"` + // NextLink - Link to next page of resources. + NextLink *string `json:"nextLink,omitempty"` +} + +// InboundEnvironmentEndpointCollectionIterator provides access to a complete listing of +// InboundEnvironmentEndpoint values. +type InboundEnvironmentEndpointCollectionIterator struct { + i int + page InboundEnvironmentEndpointCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *InboundEnvironmentEndpointCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/InboundEnvironmentEndpointCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *InboundEnvironmentEndpointCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter InboundEnvironmentEndpointCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter InboundEnvironmentEndpointCollectionIterator) Response() InboundEnvironmentEndpointCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter InboundEnvironmentEndpointCollectionIterator) Value() InboundEnvironmentEndpoint { + if !iter.page.NotDone() { + return InboundEnvironmentEndpoint{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the InboundEnvironmentEndpointCollectionIterator type. +func NewInboundEnvironmentEndpointCollectionIterator(page InboundEnvironmentEndpointCollectionPage) InboundEnvironmentEndpointCollectionIterator { + return InboundEnvironmentEndpointCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (ieec InboundEnvironmentEndpointCollection) IsEmpty() bool { + return ieec.Value == nil || len(*ieec.Value) == 0 +} + +// inboundEnvironmentEndpointCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (ieec InboundEnvironmentEndpointCollection) inboundEnvironmentEndpointCollectionPreparer(ctx context.Context) (*http.Request, error) { + if ieec.NextLink == nil || len(to.String(ieec.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(ieec.NextLink))) +} + +// InboundEnvironmentEndpointCollectionPage contains a page of InboundEnvironmentEndpoint values. +type InboundEnvironmentEndpointCollectionPage struct { + fn func(context.Context, InboundEnvironmentEndpointCollection) (InboundEnvironmentEndpointCollection, error) + ieec InboundEnvironmentEndpointCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *InboundEnvironmentEndpointCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/InboundEnvironmentEndpointCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.ieec) + if err != nil { + return err + } + page.ieec = next + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *InboundEnvironmentEndpointCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page InboundEnvironmentEndpointCollectionPage) NotDone() bool { + return !page.ieec.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page InboundEnvironmentEndpointCollectionPage) Response() InboundEnvironmentEndpointCollection { + return page.ieec +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page InboundEnvironmentEndpointCollectionPage) Values() []InboundEnvironmentEndpoint { + if page.ieec.IsEmpty() { + return nil + } + return *page.ieec.Value +} + +// Creates a new instance of the InboundEnvironmentEndpointCollectionPage type. +func NewInboundEnvironmentEndpointCollectionPage(getNextPage func(context.Context, InboundEnvironmentEndpointCollection) (InboundEnvironmentEndpointCollection, error)) InboundEnvironmentEndpointCollectionPage { + return InboundEnvironmentEndpointCollectionPage{fn: getNextPage} +} + // IPSecurityRestriction IP security restriction on an app. type IPSecurityRestriction struct { // IPAddress - IP address the security restriction is valid for. @@ -12244,12 +12391,6 @@ type ListHostingEnvironmentDiagnostics struct { Value *[]HostingEnvironmentDiagnostics `json:"value,omitempty"` } -// ListInboundEnvironmentEndpoint ... -type ListInboundEnvironmentEndpoint struct { - autorest.Response `json:"-"` - Value *[]InboundEnvironmentEndpoint `json:"value,omitempty"` -} - // ListNetworkTrace ... type ListNetworkTrace struct { autorest.Response `json:"-"` @@ -12262,12 +12403,6 @@ type ListOperation struct { Value *[]Operation `json:"value,omitempty"` } -// ListOutboundEnvironmentEndpoint ... -type ListOutboundEnvironmentEndpoint struct { - autorest.Response `json:"-"` - Value *[]OutboundEnvironmentEndpoint `json:"value,omitempty"` -} - // ListVnetInfo ... type ListVnetInfo struct { autorest.Response `json:"-"` @@ -13370,6 +13505,153 @@ type OutboundEnvironmentEndpoint struct { Endpoints *[]EndpointDependency `json:"endpoints,omitempty"` } +// OutboundEnvironmentEndpointCollection collection of Outbound Environment Endpoints +type OutboundEnvironmentEndpointCollection struct { + autorest.Response `json:"-"` + // Value - Collection of resources. + Value *[]OutboundEnvironmentEndpoint `json:"value,omitempty"` + // NextLink - Link to next page of resources. + NextLink *string `json:"nextLink,omitempty"` +} + +// OutboundEnvironmentEndpointCollectionIterator provides access to a complete listing of +// OutboundEnvironmentEndpoint values. +type OutboundEnvironmentEndpointCollectionIterator struct { + i int + page OutboundEnvironmentEndpointCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *OutboundEnvironmentEndpointCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OutboundEnvironmentEndpointCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *OutboundEnvironmentEndpointCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter OutboundEnvironmentEndpointCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter OutboundEnvironmentEndpointCollectionIterator) Response() OutboundEnvironmentEndpointCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter OutboundEnvironmentEndpointCollectionIterator) Value() OutboundEnvironmentEndpoint { + if !iter.page.NotDone() { + return OutboundEnvironmentEndpoint{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the OutboundEnvironmentEndpointCollectionIterator type. +func NewOutboundEnvironmentEndpointCollectionIterator(page OutboundEnvironmentEndpointCollectionPage) OutboundEnvironmentEndpointCollectionIterator { + return OutboundEnvironmentEndpointCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (oeec OutboundEnvironmentEndpointCollection) IsEmpty() bool { + return oeec.Value == nil || len(*oeec.Value) == 0 +} + +// outboundEnvironmentEndpointCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (oeec OutboundEnvironmentEndpointCollection) outboundEnvironmentEndpointCollectionPreparer(ctx context.Context) (*http.Request, error) { + if oeec.NextLink == nil || len(to.String(oeec.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(oeec.NextLink))) +} + +// OutboundEnvironmentEndpointCollectionPage contains a page of OutboundEnvironmentEndpoint values. +type OutboundEnvironmentEndpointCollectionPage struct { + fn func(context.Context, OutboundEnvironmentEndpointCollection) (OutboundEnvironmentEndpointCollection, error) + oeec OutboundEnvironmentEndpointCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *OutboundEnvironmentEndpointCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OutboundEnvironmentEndpointCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.oeec) + if err != nil { + return err + } + page.oeec = next + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *OutboundEnvironmentEndpointCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page OutboundEnvironmentEndpointCollectionPage) NotDone() bool { + return !page.oeec.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page OutboundEnvironmentEndpointCollectionPage) Response() OutboundEnvironmentEndpointCollection { + return page.oeec +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page OutboundEnvironmentEndpointCollectionPage) Values() []OutboundEnvironmentEndpoint { + if page.oeec.IsEmpty() { + return nil + } + return *page.oeec.Value +} + +// Creates a new instance of the OutboundEnvironmentEndpointCollectionPage type. +func NewOutboundEnvironmentEndpointCollectionPage(getNextPage func(context.Context, OutboundEnvironmentEndpointCollection) (OutboundEnvironmentEndpointCollection, error)) OutboundEnvironmentEndpointCollectionPage { + return OutboundEnvironmentEndpointCollectionPage{fn: getNextPage} +} + // PerfMonCounterCollection collection of performance monitor counters. type PerfMonCounterCollection struct { autorest.Response `json:"-"` diff --git a/services/web/mgmt/2018-02-01/web/webapi/interfaces.go b/services/web/mgmt/2018-02-01/web/webapi/interfaces.go index 4286cbad75ec..ce20c093071c 100644 --- a/services/web/mgmt/2018-02-01/web/webapi/interfaces.go +++ b/services/web/mgmt/2018-02-01/web/webapi/interfaces.go @@ -558,9 +558,9 @@ type AppServiceEnvironmentsClientAPI interface { Delete(ctx context.Context, resourceGroupName string, name string, forceDelete *bool) (result web.AppServiceEnvironmentsDeleteFuture, err error) Get(ctx context.Context, resourceGroupName string, name string) (result web.AppServiceEnvironmentResource, err error) GetDiagnosticsItem(ctx context.Context, resourceGroupName string, name string, diagnosticsName string) (result web.HostingEnvironmentDiagnostics, err error) - GetInboundNetworkDependenciesEndpoints(ctx context.Context, resourceGroupName string, name string) (result web.ListInboundEnvironmentEndpoint, err error) + GetInboundNetworkDependenciesEndpoints(ctx context.Context, resourceGroupName string, name string) (result web.InboundEnvironmentEndpointCollectionPage, err error) GetMultiRolePool(ctx context.Context, resourceGroupName string, name string) (result web.WorkerPoolResource, err error) - GetOutboundNetworkDependenciesEndpoints(ctx context.Context, resourceGroupName string, name string) (result web.ListOutboundEnvironmentEndpoint, err error) + GetOutboundNetworkDependenciesEndpoints(ctx context.Context, resourceGroupName string, name string) (result web.OutboundEnvironmentEndpointCollectionPage, err error) GetWorkerPool(ctx context.Context, resourceGroupName string, name string, workerPoolName string) (result web.WorkerPoolResource, err error) List(ctx context.Context) (result web.AppServiceEnvironmentCollectionPage, err error) ListAppServicePlans(ctx context.Context, resourceGroupName string, name string) (result web.AppServicePlanCollectionPage, err error)