~nskaggs/+junk/xenial-test

« back to all changes in this revision

Viewing changes to src/github.com/Azure/azure-sdk-for-go/arm/web/serverfarms.go

  • Committer: Nicholas Skaggs
  • Date: 2016-10-24 20:56:05 UTC
  • Revision ID: nicholas.skaggs@canonical.com-20161024205605-z8lta0uvuhtxwzwl
Initi with beta15

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
package web
 
2
 
 
3
// Copyright (c) Microsoft and contributors.  All rights reserved.
 
4
//
 
5
// Licensed under the Apache License, Version 2.0 (the "License");
 
6
// you may not use this file except in compliance with the License.
 
7
// You may obtain a copy of the License at
 
8
// http://www.apache.org/licenses/LICENSE-2.0
 
9
//
 
10
// Unless required by applicable law or agreed to in writing, software
 
11
// distributed under the License is distributed on an "AS IS" BASIS,
 
12
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 
13
//
 
14
// See the License for the specific language governing permissions and
 
15
// limitations under the License.
 
16
//
 
17
// Code generated by Microsoft (R) AutoRest Code Generator 0.12.0.0
 
18
// Changes may cause incorrect behavior and will be lost if the code is
 
19
// regenerated.
 
20
 
 
21
import (
 
22
        "github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest"
 
23
        "net/http"
 
24
        "net/url"
 
25
)
 
26
 
 
27
// ServerFarmsClient is the use these APIs to manage Azure Websites resources
 
28
// through the Azure Resource Manager. All task operations conform to the
 
29
// HTTP/1.1 protocol specification and each operation returns an
 
30
// x-ms-request-id header that can be used to obtain information about the
 
31
// request. You must make sure that requests made to these resources are
 
32
// secure. For more information, see <a
 
33
// href="https://msdn.microsoft.com/en-us/library/azure/dn790557.aspx">Authenticating
 
34
// Azure Resource Manager requests.</a>
 
35
type ServerFarmsClient struct {
 
36
        ManagementClient
 
37
}
 
38
 
 
39
// NewServerFarmsClient creates an instance of the ServerFarmsClient client.
 
40
func NewServerFarmsClient(subscriptionID string) ServerFarmsClient {
 
41
        return NewServerFarmsClientWithBaseURI(DefaultBaseURI, subscriptionID)
 
42
}
 
43
 
 
44
// NewServerFarmsClientWithBaseURI creates an instance of the
 
45
// ServerFarmsClient client.
 
46
func NewServerFarmsClientWithBaseURI(baseURI string, subscriptionID string) ServerFarmsClient {
 
47
        return ServerFarmsClient{NewWithBaseURI(baseURI, subscriptionID)}
 
48
}
 
49
 
 
50
// CreateOrUpdateServerFarm sends the create or update server farm request.
 
51
//
 
52
// resourceGroupName is name of resource group name is name of App Service
 
53
// Plan serverFarmEnvelope is details of App Service Plan allowPendingState
 
54
// is oBSOLETE: If true, allow pending state for App Service Plan
 
55
func (client ServerFarmsClient) CreateOrUpdateServerFarm(resourceGroupName string, name string, serverFarmEnvelope ServerFarmWithRichSku, allowPendingState *bool) (result ServerFarmWithRichSku, ae error) {
 
56
        req, err := client.CreateOrUpdateServerFarmPreparer(resourceGroupName, name, serverFarmEnvelope, allowPendingState)
 
57
        if err != nil {
 
58
                return result, autorest.NewErrorWithError(err, "web/ServerFarmsClient", "CreateOrUpdateServerFarm", "Failure preparing request")
 
59
        }
 
60
 
 
61
        resp, err := client.CreateOrUpdateServerFarmSender(req)
 
62
        if err != nil {
 
63
                result.Response = autorest.Response{Response: resp}
 
64
                return result, autorest.NewErrorWithError(err, "web/ServerFarmsClient", "CreateOrUpdateServerFarm", "Failure sending request")
 
65
        }
 
66
 
 
67
        result, err = client.CreateOrUpdateServerFarmResponder(resp)
 
68
        if err != nil {
 
69
                ae = autorest.NewErrorWithError(err, "web/ServerFarmsClient", "CreateOrUpdateServerFarm", "Failure responding to request")
 
70
        }
 
71
 
 
72
        return
 
73
}
 
74
 
 
75
// CreateOrUpdateServerFarmPreparer prepares the CreateOrUpdateServerFarm request.
 
76
func (client ServerFarmsClient) CreateOrUpdateServerFarmPreparer(resourceGroupName string, name string, serverFarmEnvelope ServerFarmWithRichSku, allowPendingState *bool) (*http.Request, error) {
 
77
        pathParameters := map[string]interface{}{
 
78
                "name":              url.QueryEscape(name),
 
79
                "resourceGroupName": url.QueryEscape(resourceGroupName),
 
80
                "subscriptionId":    url.QueryEscape(client.SubscriptionID),
 
81
        }
 
82
 
 
83
        queryParameters := map[string]interface{}{
 
84
                "api-version": APIVersion,
 
85
        }
 
86
        if allowPendingState != nil {
 
87
                queryParameters["allowPendingState"] = allowPendingState
 
88
        }
 
89
 
 
90
        return autorest.Prepare(&http.Request{},
 
91
                autorest.AsJSON(),
 
92
                autorest.AsPut(),
 
93
                autorest.WithBaseURL(client.BaseURI),
 
94
                autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}"),
 
95
                autorest.WithJSON(serverFarmEnvelope),
 
96
                autorest.WithPathParameters(pathParameters),
 
97
                autorest.WithQueryParameters(queryParameters))
 
98
}
 
99
 
 
100
// CreateOrUpdateServerFarmSender sends the CreateOrUpdateServerFarm request. The method will close the
 
101
// http.Response Body if it receives an error.
 
102
func (client ServerFarmsClient) CreateOrUpdateServerFarmSender(req *http.Request) (*http.Response, error) {
 
103
        return client.Send(req, http.StatusOK, http.StatusAccepted)
 
104
}
 
105
 
 
106
// CreateOrUpdateServerFarmResponder handles the response to the CreateOrUpdateServerFarm request. The method always
 
107
// closes the http.Response Body.
 
108
func (client ServerFarmsClient) CreateOrUpdateServerFarmResponder(resp *http.Response) (result ServerFarmWithRichSku, err error) {
 
109
        err = autorest.Respond(
 
110
                resp,
 
111
                client.ByInspecting(),
 
112
                autorest.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
 
113
                autorest.ByUnmarshallingJSON(&result),
 
114
                autorest.ByClosing())
 
115
        result.Response = autorest.Response{Response: resp}
 
116
        return
 
117
}
 
118
 
 
119
// CreateOrUpdateVnetRoute sends the create or update vnet route request.
 
120
//
 
121
// resourceGroupName is name of resource group name is name of App Service
 
122
// Plan vnetName is name of virtual network routeName is name of the virtual
 
123
// network route route is the route object
 
124
func (client ServerFarmsClient) CreateOrUpdateVnetRoute(resourceGroupName string, name string, vnetName string, routeName string, route VnetRoute) (result VnetRoute, ae error) {
 
125
        req, err := client.CreateOrUpdateVnetRoutePreparer(resourceGroupName, name, vnetName, routeName, route)
 
126
        if err != nil {
 
127
                return result, autorest.NewErrorWithError(err, "web/ServerFarmsClient", "CreateOrUpdateVnetRoute", "Failure preparing request")
 
128
        }
 
129
 
 
130
        resp, err := client.CreateOrUpdateVnetRouteSender(req)
 
131
        if err != nil {
 
132
                result.Response = autorest.Response{Response: resp}
 
133
                return result, autorest.NewErrorWithError(err, "web/ServerFarmsClient", "CreateOrUpdateVnetRoute", "Failure sending request")
 
134
        }
 
135
 
 
136
        result, err = client.CreateOrUpdateVnetRouteResponder(resp)
 
137
        if err != nil {
 
138
                ae = autorest.NewErrorWithError(err, "web/ServerFarmsClient", "CreateOrUpdateVnetRoute", "Failure responding to request")
 
139
        }
 
140
 
 
141
        return
 
142
}
 
143
 
 
144
// CreateOrUpdateVnetRoutePreparer prepares the CreateOrUpdateVnetRoute request.
 
145
func (client ServerFarmsClient) CreateOrUpdateVnetRoutePreparer(resourceGroupName string, name string, vnetName string, routeName string, route VnetRoute) (*http.Request, error) {
 
146
        pathParameters := map[string]interface{}{
 
147
                "name":              url.QueryEscape(name),
 
148
                "resourceGroupName": url.QueryEscape(resourceGroupName),
 
149
                "routeName":         url.QueryEscape(routeName),
 
150
                "subscriptionId":    url.QueryEscape(client.SubscriptionID),
 
151
                "vnetName":          url.QueryEscape(vnetName),
 
152
        }
 
153
 
 
154
        queryParameters := map[string]interface{}{
 
155
                "api-version": APIVersion,
 
156
        }
 
157
 
 
158
        return autorest.Prepare(&http.Request{},
 
159
                autorest.AsJSON(),
 
160
                autorest.AsPut(),
 
161
                autorest.WithBaseURL(client.BaseURI),
 
162
                autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/routes/{routeName}"),
 
163
                autorest.WithJSON(route),
 
164
                autorest.WithPathParameters(pathParameters),
 
165
                autorest.WithQueryParameters(queryParameters))
 
166
}
 
167
 
 
168
// CreateOrUpdateVnetRouteSender sends the CreateOrUpdateVnetRoute request. The method will close the
 
169
// http.Response Body if it receives an error.
 
170
func (client ServerFarmsClient) CreateOrUpdateVnetRouteSender(req *http.Request) (*http.Response, error) {
 
171
        return client.Send(req, http.StatusOK, http.StatusBadRequest, http.StatusNotFound)
 
172
}
 
173
 
 
174
// CreateOrUpdateVnetRouteResponder handles the response to the CreateOrUpdateVnetRoute request. The method always
 
175
// closes the http.Response Body.
 
176
func (client ServerFarmsClient) CreateOrUpdateVnetRouteResponder(resp *http.Response) (result VnetRoute, err error) {
 
177
        err = autorest.Respond(
 
178
                resp,
 
179
                client.ByInspecting(),
 
180
                autorest.WithErrorUnlessStatusCode(http.StatusOK, http.StatusBadRequest, http.StatusNotFound),
 
181
                autorest.ByUnmarshallingJSON(&result),
 
182
                autorest.ByClosing())
 
183
        result.Response = autorest.Response{Response: resp}
 
184
        return
 
185
}
 
186
 
 
187
// DeleteServerFarm sends the delete server farm request.
 
188
//
 
189
// resourceGroupName is name of resource group name is name of App Service
 
190
// Plan
 
191
func (client ServerFarmsClient) DeleteServerFarm(resourceGroupName string, name string) (result ObjectSet, ae error) {
 
192
        req, err := client.DeleteServerFarmPreparer(resourceGroupName, name)
 
193
        if err != nil {
 
194
                return result, autorest.NewErrorWithError(err, "web/ServerFarmsClient", "DeleteServerFarm", "Failure preparing request")
 
195
        }
 
196
 
 
197
        resp, err := client.DeleteServerFarmSender(req)
 
198
        if err != nil {
 
199
                result.Response = autorest.Response{Response: resp}
 
200
                return result, autorest.NewErrorWithError(err, "web/ServerFarmsClient", "DeleteServerFarm", "Failure sending request")
 
201
        }
 
202
 
 
203
        result, err = client.DeleteServerFarmResponder(resp)
 
204
        if err != nil {
 
205
                ae = autorest.NewErrorWithError(err, "web/ServerFarmsClient", "DeleteServerFarm", "Failure responding to request")
 
206
        }
 
207
 
 
208
        return
 
209
}
 
210
 
 
211
// DeleteServerFarmPreparer prepares the DeleteServerFarm request.
 
212
func (client ServerFarmsClient) DeleteServerFarmPreparer(resourceGroupName string, name string) (*http.Request, error) {
 
213
        pathParameters := map[string]interface{}{
 
214
                "name":              url.QueryEscape(name),
 
215
                "resourceGroupName": url.QueryEscape(resourceGroupName),
 
216
                "subscriptionId":    url.QueryEscape(client.SubscriptionID),
 
217
        }
 
218
 
 
219
        queryParameters := map[string]interface{}{
 
220
                "api-version": APIVersion,
 
221
        }
 
222
 
 
223
        return autorest.Prepare(&http.Request{},
 
224
                autorest.AsJSON(),
 
225
                autorest.AsDelete(),
 
226
                autorest.WithBaseURL(client.BaseURI),
 
227
                autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}"),
 
228
                autorest.WithPathParameters(pathParameters),
 
229
                autorest.WithQueryParameters(queryParameters))
 
230
}
 
231
 
 
232
// DeleteServerFarmSender sends the DeleteServerFarm request. The method will close the
 
233
// http.Response Body if it receives an error.
 
234
func (client ServerFarmsClient) DeleteServerFarmSender(req *http.Request) (*http.Response, error) {
 
235
        return client.Send(req, http.StatusOK)
 
236
}
 
237
 
 
238
// DeleteServerFarmResponder handles the response to the DeleteServerFarm request. The method always
 
239
// closes the http.Response Body.
 
240
func (client ServerFarmsClient) DeleteServerFarmResponder(resp *http.Response) (result ObjectSet, err error) {
 
241
        err = autorest.Respond(
 
242
                resp,
 
243
                client.ByInspecting(),
 
244
                autorest.WithErrorUnlessStatusCode(http.StatusOK),
 
245
                autorest.ByUnmarshallingJSON(&result.Value),
 
246
                autorest.ByClosing())
 
247
        result.Response = autorest.Response{Response: resp}
 
248
        return
 
249
}
 
250
 
 
251
// DeleteVnetRoute sends the delete vnet route request.
 
252
//
 
253
// resourceGroupName is name of resource group name is name of App Service
 
254
// Plan vnetName is name of virtual network routeName is name of the virtual
 
255
// network route
 
256
func (client ServerFarmsClient) DeleteVnetRoute(resourceGroupName string, name string, vnetName string, routeName string) (result ObjectSet, ae error) {
 
257
        req, err := client.DeleteVnetRoutePreparer(resourceGroupName, name, vnetName, routeName)
 
258
        if err != nil {
 
259
                return result, autorest.NewErrorWithError(err, "web/ServerFarmsClient", "DeleteVnetRoute", "Failure preparing request")
 
260
        }
 
261
 
 
262
        resp, err := client.DeleteVnetRouteSender(req)
 
263
        if err != nil {
 
264
                result.Response = autorest.Response{Response: resp}
 
265
                return result, autorest.NewErrorWithError(err, "web/ServerFarmsClient", "DeleteVnetRoute", "Failure sending request")
 
266
        }
 
267
 
 
268
        result, err = client.DeleteVnetRouteResponder(resp)
 
269
        if err != nil {
 
270
                ae = autorest.NewErrorWithError(err, "web/ServerFarmsClient", "DeleteVnetRoute", "Failure responding to request")
 
271
        }
 
272
 
 
273
        return
 
274
}
 
275
 
 
276
// DeleteVnetRoutePreparer prepares the DeleteVnetRoute request.
 
277
func (client ServerFarmsClient) DeleteVnetRoutePreparer(resourceGroupName string, name string, vnetName string, routeName string) (*http.Request, error) {
 
278
        pathParameters := map[string]interface{}{
 
279
                "name":              url.QueryEscape(name),
 
280
                "resourceGroupName": url.QueryEscape(resourceGroupName),
 
281
                "routeName":         url.QueryEscape(routeName),
 
282
                "subscriptionId":    url.QueryEscape(client.SubscriptionID),
 
283
                "vnetName":          url.QueryEscape(vnetName),
 
284
        }
 
285
 
 
286
        queryParameters := map[string]interface{}{
 
287
                "api-version": APIVersion,
 
288
        }
 
289
 
 
290
        return autorest.Prepare(&http.Request{},
 
291
                autorest.AsJSON(),
 
292
                autorest.AsDelete(),
 
293
                autorest.WithBaseURL(client.BaseURI),
 
294
                autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/routes/{routeName}"),
 
295
                autorest.WithPathParameters(pathParameters),
 
296
                autorest.WithQueryParameters(queryParameters))
 
297
}
 
298
 
 
299
// DeleteVnetRouteSender sends the DeleteVnetRoute request. The method will close the
 
300
// http.Response Body if it receives an error.
 
301
func (client ServerFarmsClient) DeleteVnetRouteSender(req *http.Request) (*http.Response, error) {
 
302
        return client.Send(req, http.StatusOK, http.StatusNotFound)
 
303
}
 
304
 
 
305
// DeleteVnetRouteResponder handles the response to the DeleteVnetRoute request. The method always
 
306
// closes the http.Response Body.
 
307
func (client ServerFarmsClient) DeleteVnetRouteResponder(resp *http.Response) (result ObjectSet, err error) {
 
308
        err = autorest.Respond(
 
309
                resp,
 
310
                client.ByInspecting(),
 
311
                autorest.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound),
 
312
                autorest.ByUnmarshallingJSON(&result.Value),
 
313
                autorest.ByClosing())
 
314
        result.Response = autorest.Response{Response: resp}
 
315
        return
 
316
}
 
317
 
 
318
// GetRouteForVnet sends the get route for vnet request.
 
319
//
 
320
// resourceGroupName is name of resource group name is name of App Service
 
321
// Plan vnetName is name of virtual network routeName is name of the virtual
 
322
// network route
 
323
func (client ServerFarmsClient) GetRouteForVnet(resourceGroupName string, name string, vnetName string, routeName string) (result VnetRouteList, ae error) {
 
324
        req, err := client.GetRouteForVnetPreparer(resourceGroupName, name, vnetName, routeName)
 
325
        if err != nil {
 
326
                return result, autorest.NewErrorWithError(err, "web/ServerFarmsClient", "GetRouteForVnet", "Failure preparing request")
 
327
        }
 
328
 
 
329
        resp, err := client.GetRouteForVnetSender(req)
 
330
        if err != nil {
 
331
                result.Response = autorest.Response{Response: resp}
 
332
                return result, autorest.NewErrorWithError(err, "web/ServerFarmsClient", "GetRouteForVnet", "Failure sending request")
 
333
        }
 
334
 
 
335
        result, err = client.GetRouteForVnetResponder(resp)
 
336
        if err != nil {
 
337
                ae = autorest.NewErrorWithError(err, "web/ServerFarmsClient", "GetRouteForVnet", "Failure responding to request")
 
338
        }
 
339
 
 
340
        return
 
341
}
 
342
 
 
343
// GetRouteForVnetPreparer prepares the GetRouteForVnet request.
 
344
func (client ServerFarmsClient) GetRouteForVnetPreparer(resourceGroupName string, name string, vnetName string, routeName string) (*http.Request, error) {
 
345
        pathParameters := map[string]interface{}{
 
346
                "name":              url.QueryEscape(name),
 
347
                "resourceGroupName": url.QueryEscape(resourceGroupName),
 
348
                "routeName":         url.QueryEscape(routeName),
 
349
                "subscriptionId":    url.QueryEscape(client.SubscriptionID),
 
350
                "vnetName":          url.QueryEscape(vnetName),
 
351
        }
 
352
 
 
353
        queryParameters := map[string]interface{}{
 
354
                "api-version": APIVersion,
 
355
        }
 
356
 
 
357
        return autorest.Prepare(&http.Request{},
 
358
                autorest.AsJSON(),
 
359
                autorest.AsGet(),
 
360
                autorest.WithBaseURL(client.BaseURI),
 
361
                autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/routes/{routeName}"),
 
362
                autorest.WithPathParameters(pathParameters),
 
363
                autorest.WithQueryParameters(queryParameters))
 
364
}
 
365
 
 
366
// GetRouteForVnetSender sends the GetRouteForVnet request. The method will close the
 
367
// http.Response Body if it receives an error.
 
368
func (client ServerFarmsClient) GetRouteForVnetSender(req *http.Request) (*http.Response, error) {
 
369
        return client.Send(req, http.StatusOK, http.StatusNotFound)
 
370
}
 
371
 
 
372
// GetRouteForVnetResponder handles the response to the GetRouteForVnet request. The method always
 
373
// closes the http.Response Body.
 
374
func (client ServerFarmsClient) GetRouteForVnetResponder(resp *http.Response) (result VnetRouteList, err error) {
 
375
        err = autorest.Respond(
 
376
                resp,
 
377
                client.ByInspecting(),
 
378
                autorest.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound),
 
379
                autorest.ByUnmarshallingJSON(&result.Value),
 
380
                autorest.ByClosing())
 
381
        result.Response = autorest.Response{Response: resp}
 
382
        return
 
383
}
 
384
 
 
385
// GetRoutesForVnet sends the get routes for vnet request.
 
386
//
 
387
// resourceGroupName is name of resource group name is name of App Service
 
388
// Plan vnetName is name of virtual network
 
389
func (client ServerFarmsClient) GetRoutesForVnet(resourceGroupName string, name string, vnetName string) (result VnetRouteList, ae error) {
 
390
        req, err := client.GetRoutesForVnetPreparer(resourceGroupName, name, vnetName)
 
391
        if err != nil {
 
392
                return result, autorest.NewErrorWithError(err, "web/ServerFarmsClient", "GetRoutesForVnet", "Failure preparing request")
 
393
        }
 
394
 
 
395
        resp, err := client.GetRoutesForVnetSender(req)
 
396
        if err != nil {
 
397
                result.Response = autorest.Response{Response: resp}
 
398
                return result, autorest.NewErrorWithError(err, "web/ServerFarmsClient", "GetRoutesForVnet", "Failure sending request")
 
399
        }
 
400
 
 
401
        result, err = client.GetRoutesForVnetResponder(resp)
 
402
        if err != nil {
 
403
                ae = autorest.NewErrorWithError(err, "web/ServerFarmsClient", "GetRoutesForVnet", "Failure responding to request")
 
404
        }
 
405
 
 
406
        return
 
407
}
 
408
 
 
409
// GetRoutesForVnetPreparer prepares the GetRoutesForVnet request.
 
410
func (client ServerFarmsClient) GetRoutesForVnetPreparer(resourceGroupName string, name string, vnetName string) (*http.Request, error) {
 
411
        pathParameters := map[string]interface{}{
 
412
                "name":              url.QueryEscape(name),
 
413
                "resourceGroupName": url.QueryEscape(resourceGroupName),
 
414
                "subscriptionId":    url.QueryEscape(client.SubscriptionID),
 
415
                "vnetName":          url.QueryEscape(vnetName),
 
416
        }
 
417
 
 
418
        queryParameters := map[string]interface{}{
 
419
                "api-version": APIVersion,
 
420
        }
 
421
 
 
422
        return autorest.Prepare(&http.Request{},
 
423
                autorest.AsJSON(),
 
424
                autorest.AsGet(),
 
425
                autorest.WithBaseURL(client.BaseURI),
 
426
                autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/routes"),
 
427
                autorest.WithPathParameters(pathParameters),
 
428
                autorest.WithQueryParameters(queryParameters))
 
429
}
 
430
 
 
431
// GetRoutesForVnetSender sends the GetRoutesForVnet request. The method will close the
 
432
// http.Response Body if it receives an error.
 
433
func (client ServerFarmsClient) GetRoutesForVnetSender(req *http.Request) (*http.Response, error) {
 
434
        return client.Send(req, http.StatusOK)
 
435
}
 
436
 
 
437
// GetRoutesForVnetResponder handles the response to the GetRoutesForVnet request. The method always
 
438
// closes the http.Response Body.
 
439
func (client ServerFarmsClient) GetRoutesForVnetResponder(resp *http.Response) (result VnetRouteList, err error) {
 
440
        err = autorest.Respond(
 
441
                resp,
 
442
                client.ByInspecting(),
 
443
                autorest.WithErrorUnlessStatusCode(http.StatusOK),
 
444
                autorest.ByUnmarshallingJSON(&result.Value),
 
445
                autorest.ByClosing())
 
446
        result.Response = autorest.Response{Response: resp}
 
447
        return
 
448
}
 
449
 
 
450
// GetServerFarm sends the get server farm request.
 
451
//
 
452
// resourceGroupName is name of resource group name is name of App Service
 
453
// Plan
 
454
func (client ServerFarmsClient) GetServerFarm(resourceGroupName string, name string) (result ServerFarmWithRichSku, ae error) {
 
455
        req, err := client.GetServerFarmPreparer(resourceGroupName, name)
 
456
        if err != nil {
 
457
                return result, autorest.NewErrorWithError(err, "web/ServerFarmsClient", "GetServerFarm", "Failure preparing request")
 
458
        }
 
459
 
 
460
        resp, err := client.GetServerFarmSender(req)
 
461
        if err != nil {
 
462
                result.Response = autorest.Response{Response: resp}
 
463
                return result, autorest.NewErrorWithError(err, "web/ServerFarmsClient", "GetServerFarm", "Failure sending request")
 
464
        }
 
465
 
 
466
        result, err = client.GetServerFarmResponder(resp)
 
467
        if err != nil {
 
468
                ae = autorest.NewErrorWithError(err, "web/ServerFarmsClient", "GetServerFarm", "Failure responding to request")
 
469
        }
 
470
 
 
471
        return
 
472
}
 
473
 
 
474
// GetServerFarmPreparer prepares the GetServerFarm request.
 
475
func (client ServerFarmsClient) GetServerFarmPreparer(resourceGroupName string, name string) (*http.Request, error) {
 
476
        pathParameters := map[string]interface{}{
 
477
                "name":              url.QueryEscape(name),
 
478
                "resourceGroupName": url.QueryEscape(resourceGroupName),
 
479
                "subscriptionId":    url.QueryEscape(client.SubscriptionID),
 
480
        }
 
481
 
 
482
        queryParameters := map[string]interface{}{
 
483
                "api-version": APIVersion,
 
484
        }
 
485
 
 
486
        return autorest.Prepare(&http.Request{},
 
487
                autorest.AsJSON(),
 
488
                autorest.AsGet(),
 
489
                autorest.WithBaseURL(client.BaseURI),
 
490
                autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}"),
 
491
                autorest.WithPathParameters(pathParameters),
 
492
                autorest.WithQueryParameters(queryParameters))
 
493
}
 
494
 
 
495
// GetServerFarmSender sends the GetServerFarm request. The method will close the
 
496
// http.Response Body if it receives an error.
 
497
func (client ServerFarmsClient) GetServerFarmSender(req *http.Request) (*http.Response, error) {
 
498
        return client.Send(req, http.StatusOK)
 
499
}
 
500
 
 
501
// GetServerFarmResponder handles the response to the GetServerFarm request. The method always
 
502
// closes the http.Response Body.
 
503
func (client ServerFarmsClient) GetServerFarmResponder(resp *http.Response) (result ServerFarmWithRichSku, err error) {
 
504
        err = autorest.Respond(
 
505
                resp,
 
506
                client.ByInspecting(),
 
507
                autorest.WithErrorUnlessStatusCode(http.StatusOK),
 
508
                autorest.ByUnmarshallingJSON(&result),
 
509
                autorest.ByClosing())
 
510
        result.Response = autorest.Response{Response: resp}
 
511
        return
 
512
}
 
513
 
 
514
// GetServerFarmMetricDefintions sends the get server farm metric defintions
 
515
// request.
 
516
//
 
517
// resourceGroupName is name of resource group name is name of App Service
 
518
// Plan
 
519
func (client ServerFarmsClient) GetServerFarmMetricDefintions(resourceGroupName string, name string) (result MetricDefinitionCollection, ae error) {
 
520
        req, err := client.GetServerFarmMetricDefintionsPreparer(resourceGroupName, name)
 
521
        if err != nil {
 
522
                return result, autorest.NewErrorWithError(err, "web/ServerFarmsClient", "GetServerFarmMetricDefintions", "Failure preparing request")
 
523
        }
 
524
 
 
525
        resp, err := client.GetServerFarmMetricDefintionsSender(req)
 
526
        if err != nil {
 
527
                result.Response = autorest.Response{Response: resp}
 
528
                return result, autorest.NewErrorWithError(err, "web/ServerFarmsClient", "GetServerFarmMetricDefintions", "Failure sending request")
 
529
        }
 
530
 
 
531
        result, err = client.GetServerFarmMetricDefintionsResponder(resp)
 
532
        if err != nil {
 
533
                ae = autorest.NewErrorWithError(err, "web/ServerFarmsClient", "GetServerFarmMetricDefintions", "Failure responding to request")
 
534
        }
 
535
 
 
536
        return
 
537
}
 
538
 
 
539
// GetServerFarmMetricDefintionsPreparer prepares the GetServerFarmMetricDefintions request.
 
540
func (client ServerFarmsClient) GetServerFarmMetricDefintionsPreparer(resourceGroupName string, name string) (*http.Request, error) {
 
541
        pathParameters := map[string]interface{}{
 
542
                "name":              url.QueryEscape(name),
 
543
                "resourceGroupName": url.QueryEscape(resourceGroupName),
 
544
                "subscriptionId":    url.QueryEscape(client.SubscriptionID),
 
545
        }
 
546
 
 
547
        queryParameters := map[string]interface{}{
 
548
                "api-version": APIVersion,
 
549
        }
 
550
 
 
551
        return autorest.Prepare(&http.Request{},
 
552
                autorest.AsJSON(),
 
553
                autorest.AsGet(),
 
554
                autorest.WithBaseURL(client.BaseURI),
 
555
                autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/metricdefinitions"),
 
556
                autorest.WithPathParameters(pathParameters),
 
557
                autorest.WithQueryParameters(queryParameters))
 
558
}
 
559
 
 
560
// GetServerFarmMetricDefintionsSender sends the GetServerFarmMetricDefintions request. The method will close the
 
561
// http.Response Body if it receives an error.
 
562
func (client ServerFarmsClient) GetServerFarmMetricDefintionsSender(req *http.Request) (*http.Response, error) {
 
563
        return client.Send(req, http.StatusOK)
 
564
}
 
565
 
 
566
// GetServerFarmMetricDefintionsResponder handles the response to the GetServerFarmMetricDefintions request. The method always
 
567
// closes the http.Response Body.
 
568
func (client ServerFarmsClient) GetServerFarmMetricDefintionsResponder(resp *http.Response) (result MetricDefinitionCollection, err error) {
 
569
        err = autorest.Respond(
 
570
                resp,
 
571
                client.ByInspecting(),
 
572
                autorest.WithErrorUnlessStatusCode(http.StatusOK),
 
573
                autorest.ByUnmarshallingJSON(&result),
 
574
                autorest.ByClosing())
 
575
        result.Response = autorest.Response{Response: resp}
 
576
        return
 
577
}
 
578
 
 
579
// GetServerFarmMetrics sends the get server farm metrics request.
 
580
//
 
581
// resourceGroupName is name of resource group name is name of App Service
 
582
// Plan details is if true, metrics are broken down per App Service Plan
 
583
// instance filter is return only usages/metrics specified in the filter.
 
584
// Filter conforms to odata syntax. Example: $filter=(name.value eq 'Metric1'
 
585
// or name.value eq 'Metric2') and startTime eq '2014-01-01T00:00:00Z' and
 
586
// endTime eq '2014-12-31T23:59:59Z' and timeGrain eq
 
587
// duration'[Hour|Minute|Day]'.
 
588
func (client ServerFarmsClient) GetServerFarmMetrics(resourceGroupName string, name string, details *bool, filter string) (result ResourceMetricCollection, ae error) {
 
589
        req, err := client.GetServerFarmMetricsPreparer(resourceGroupName, name, details, filter)
 
590
        if err != nil {
 
591
                return result, autorest.NewErrorWithError(err, "web/ServerFarmsClient", "GetServerFarmMetrics", "Failure preparing request")
 
592
        }
 
593
 
 
594
        resp, err := client.GetServerFarmMetricsSender(req)
 
595
        if err != nil {
 
596
                result.Response = autorest.Response{Response: resp}
 
597
                return result, autorest.NewErrorWithError(err, "web/ServerFarmsClient", "GetServerFarmMetrics", "Failure sending request")
 
598
        }
 
599
 
 
600
        result, err = client.GetServerFarmMetricsResponder(resp)
 
601
        if err != nil {
 
602
                ae = autorest.NewErrorWithError(err, "web/ServerFarmsClient", "GetServerFarmMetrics", "Failure responding to request")
 
603
        }
 
604
 
 
605
        return
 
606
}
 
607
 
 
608
// GetServerFarmMetricsPreparer prepares the GetServerFarmMetrics request.
 
609
func (client ServerFarmsClient) GetServerFarmMetricsPreparer(resourceGroupName string, name string, details *bool, filter string) (*http.Request, error) {
 
610
        pathParameters := map[string]interface{}{
 
611
                "name":              url.QueryEscape(name),
 
612
                "resourceGroupName": url.QueryEscape(resourceGroupName),
 
613
                "subscriptionId":    url.QueryEscape(client.SubscriptionID),
 
614
        }
 
615
 
 
616
        queryParameters := map[string]interface{}{
 
617
                "api-version": APIVersion,
 
618
        }
 
619
        if details != nil {
 
620
                queryParameters["details"] = details
 
621
        }
 
622
        if len(filter) > 0 {
 
623
                queryParameters["$filter"] = filter
 
624
        }
 
625
 
 
626
        return autorest.Prepare(&http.Request{},
 
627
                autorest.AsJSON(),
 
628
                autorest.AsGet(),
 
629
                autorest.WithBaseURL(client.BaseURI),
 
630
                autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/metrics"),
 
631
                autorest.WithPathParameters(pathParameters),
 
632
                autorest.WithQueryParameters(queryParameters))
 
633
}
 
634
 
 
635
// GetServerFarmMetricsSender sends the GetServerFarmMetrics request. The method will close the
 
636
// http.Response Body if it receives an error.
 
637
func (client ServerFarmsClient) GetServerFarmMetricsSender(req *http.Request) (*http.Response, error) {
 
638
        return client.Send(req, http.StatusOK)
 
639
}
 
640
 
 
641
// GetServerFarmMetricsResponder handles the response to the GetServerFarmMetrics request. The method always
 
642
// closes the http.Response Body.
 
643
func (client ServerFarmsClient) GetServerFarmMetricsResponder(resp *http.Response) (result ResourceMetricCollection, err error) {
 
644
        err = autorest.Respond(
 
645
                resp,
 
646
                client.ByInspecting(),
 
647
                autorest.WithErrorUnlessStatusCode(http.StatusOK),
 
648
                autorest.ByUnmarshallingJSON(&result),
 
649
                autorest.ByClosing())
 
650
        result.Response = autorest.Response{Response: resp}
 
651
        return
 
652
}
 
653
 
 
654
// GetServerFarmOperation sends the get server farm operation request.
 
655
//
 
656
// resourceGroupName is name of resource group name is name of server farm
 
657
// operationID is id of Server farm operation"&gt;
 
658
func (client ServerFarmsClient) GetServerFarmOperation(resourceGroupName string, name string, operationID string) (result ServerFarmWithRichSku, ae error) {
 
659
        req, err := client.GetServerFarmOperationPreparer(resourceGroupName, name, operationID)
 
660
        if err != nil {
 
661
                return result, autorest.NewErrorWithError(err, "web/ServerFarmsClient", "GetServerFarmOperation", "Failure preparing request")
 
662
        }
 
663
 
 
664
        resp, err := client.GetServerFarmOperationSender(req)
 
665
        if err != nil {
 
666
                result.Response = autorest.Response{Response: resp}
 
667
                return result, autorest.NewErrorWithError(err, "web/ServerFarmsClient", "GetServerFarmOperation", "Failure sending request")
 
668
        }
 
669
 
 
670
        result, err = client.GetServerFarmOperationResponder(resp)
 
671
        if err != nil {
 
672
                ae = autorest.NewErrorWithError(err, "web/ServerFarmsClient", "GetServerFarmOperation", "Failure responding to request")
 
673
        }
 
674
 
 
675
        return
 
676
}
 
677
 
 
678
// GetServerFarmOperationPreparer prepares the GetServerFarmOperation request.
 
679
func (client ServerFarmsClient) GetServerFarmOperationPreparer(resourceGroupName string, name string, operationID string) (*http.Request, error) {
 
680
        pathParameters := map[string]interface{}{
 
681
                "name":              url.QueryEscape(name),
 
682
                "operationId":       url.QueryEscape(operationID),
 
683
                "resourceGroupName": url.QueryEscape(resourceGroupName),
 
684
                "subscriptionId":    url.QueryEscape(client.SubscriptionID),
 
685
        }
 
686
 
 
687
        queryParameters := map[string]interface{}{
 
688
                "api-version": APIVersion,
 
689
        }
 
690
 
 
691
        return autorest.Prepare(&http.Request{},
 
692
                autorest.AsJSON(),
 
693
                autorest.AsGet(),
 
694
                autorest.WithBaseURL(client.BaseURI),
 
695
                autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/operationresults/{operationId}"),
 
696
                autorest.WithPathParameters(pathParameters),
 
697
                autorest.WithQueryParameters(queryParameters))
 
698
}
 
699
 
 
700
// GetServerFarmOperationSender sends the GetServerFarmOperation request. The method will close the
 
701
// http.Response Body if it receives an error.
 
702
func (client ServerFarmsClient) GetServerFarmOperationSender(req *http.Request) (*http.Response, error) {
 
703
        return client.Send(req, http.StatusOK)
 
704
}
 
705
 
 
706
// GetServerFarmOperationResponder handles the response to the GetServerFarmOperation request. The method always
 
707
// closes the http.Response Body.
 
708
func (client ServerFarmsClient) GetServerFarmOperationResponder(resp *http.Response) (result ServerFarmWithRichSku, err error) {
 
709
        err = autorest.Respond(
 
710
                resp,
 
711
                client.ByInspecting(),
 
712
                autorest.WithErrorUnlessStatusCode(http.StatusOK),
 
713
                autorest.ByUnmarshallingJSON(&result),
 
714
                autorest.ByClosing())
 
715
        result.Response = autorest.Response{Response: resp}
 
716
        return
 
717
}
 
718
 
 
719
// GetServerFarms sends the get server farms request.
 
720
//
 
721
// resourceGroupName is name of resource group
 
722
func (client ServerFarmsClient) GetServerFarms(resourceGroupName string) (result ServerFarmCollection, ae error) {
 
723
        req, err := client.GetServerFarmsPreparer(resourceGroupName)
 
724
        if err != nil {
 
725
                return result, autorest.NewErrorWithError(err, "web/ServerFarmsClient", "GetServerFarms", "Failure preparing request")
 
726
        }
 
727
 
 
728
        resp, err := client.GetServerFarmsSender(req)
 
729
        if err != nil {
 
730
                result.Response = autorest.Response{Response: resp}
 
731
                return result, autorest.NewErrorWithError(err, "web/ServerFarmsClient", "GetServerFarms", "Failure sending request")
 
732
        }
 
733
 
 
734
        result, err = client.GetServerFarmsResponder(resp)
 
735
        if err != nil {
 
736
                ae = autorest.NewErrorWithError(err, "web/ServerFarmsClient", "GetServerFarms", "Failure responding to request")
 
737
        }
 
738
 
 
739
        return
 
740
}
 
741
 
 
742
// GetServerFarmsPreparer prepares the GetServerFarms request.
 
743
func (client ServerFarmsClient) GetServerFarmsPreparer(resourceGroupName string) (*http.Request, error) {
 
744
        pathParameters := map[string]interface{}{
 
745
                "resourceGroupName": url.QueryEscape(resourceGroupName),
 
746
                "subscriptionId":    url.QueryEscape(client.SubscriptionID),
 
747
        }
 
748
 
 
749
        queryParameters := map[string]interface{}{
 
750
                "api-version": APIVersion,
 
751
        }
 
752
 
 
753
        return autorest.Prepare(&http.Request{},
 
754
                autorest.AsJSON(),
 
755
                autorest.AsGet(),
 
756
                autorest.WithBaseURL(client.BaseURI),
 
757
                autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms"),
 
758
                autorest.WithPathParameters(pathParameters),
 
759
                autorest.WithQueryParameters(queryParameters))
 
760
}
 
761
 
 
762
// GetServerFarmsSender sends the GetServerFarms request. The method will close the
 
763
// http.Response Body if it receives an error.
 
764
func (client ServerFarmsClient) GetServerFarmsSender(req *http.Request) (*http.Response, error) {
 
765
        return client.Send(req, http.StatusOK)
 
766
}
 
767
 
 
768
// GetServerFarmsResponder handles the response to the GetServerFarms request. The method always
 
769
// closes the http.Response Body.
 
770
func (client ServerFarmsClient) GetServerFarmsResponder(resp *http.Response) (result ServerFarmCollection, err error) {
 
771
        err = autorest.Respond(
 
772
                resp,
 
773
                client.ByInspecting(),
 
774
                autorest.WithErrorUnlessStatusCode(http.StatusOK),
 
775
                autorest.ByUnmarshallingJSON(&result),
 
776
                autorest.ByClosing())
 
777
        result.Response = autorest.Response{Response: resp}
 
778
        return
 
779
}
 
780
 
 
781
// GetServerFarmSites sends the get server farm sites request.
 
782
//
 
783
// resourceGroupName is name of resource group name is name of App Service
 
784
// Plan skipToken is skip to of web apps in a list. If specified, the
 
785
// resulting list will contain web apps starting from (including) the
 
786
// skipToken. Else, the resulting list contains web apps from the start of
 
787
// the list filter is supported filter: $filter=state eq running. Returns
 
788
// only web apps that are currently running top is list page size. If
 
789
// specified, results are paged.
 
790
func (client ServerFarmsClient) GetServerFarmSites(resourceGroupName string, name string, skipToken string, filter string, top string) (result SiteCollection, ae error) {
 
791
        req, err := client.GetServerFarmSitesPreparer(resourceGroupName, name, skipToken, filter, top)
 
792
        if err != nil {
 
793
                return result, autorest.NewErrorWithError(err, "web/ServerFarmsClient", "GetServerFarmSites", "Failure preparing request")
 
794
        }
 
795
 
 
796
        resp, err := client.GetServerFarmSitesSender(req)
 
797
        if err != nil {
 
798
                result.Response = autorest.Response{Response: resp}
 
799
                return result, autorest.NewErrorWithError(err, "web/ServerFarmsClient", "GetServerFarmSites", "Failure sending request")
 
800
        }
 
801
 
 
802
        result, err = client.GetServerFarmSitesResponder(resp)
 
803
        if err != nil {
 
804
                ae = autorest.NewErrorWithError(err, "web/ServerFarmsClient", "GetServerFarmSites", "Failure responding to request")
 
805
        }
 
806
 
 
807
        return
 
808
}
 
809
 
 
810
// GetServerFarmSitesPreparer prepares the GetServerFarmSites request.
 
811
func (client ServerFarmsClient) GetServerFarmSitesPreparer(resourceGroupName string, name string, skipToken string, filter string, top string) (*http.Request, error) {
 
812
        pathParameters := map[string]interface{}{
 
813
                "name":              url.QueryEscape(name),
 
814
                "resourceGroupName": url.QueryEscape(resourceGroupName),
 
815
                "subscriptionId":    url.QueryEscape(client.SubscriptionID),
 
816
        }
 
817
 
 
818
        queryParameters := map[string]interface{}{
 
819
                "api-version": APIVersion,
 
820
        }
 
821
        if len(skipToken) > 0 {
 
822
                queryParameters["$skipToken"] = skipToken
 
823
        }
 
824
        if len(filter) > 0 {
 
825
                queryParameters["$filter"] = filter
 
826
        }
 
827
        if len(top) > 0 {
 
828
                queryParameters["$top"] = top
 
829
        }
 
830
 
 
831
        return autorest.Prepare(&http.Request{},
 
832
                autorest.AsJSON(),
 
833
                autorest.AsGet(),
 
834
                autorest.WithBaseURL(client.BaseURI),
 
835
                autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/sites"),
 
836
                autorest.WithPathParameters(pathParameters),
 
837
                autorest.WithQueryParameters(queryParameters))
 
838
}
 
839
 
 
840
// GetServerFarmSitesSender sends the GetServerFarmSites request. The method will close the
 
841
// http.Response Body if it receives an error.
 
842
func (client ServerFarmsClient) GetServerFarmSitesSender(req *http.Request) (*http.Response, error) {
 
843
        return client.Send(req, http.StatusOK)
 
844
}
 
845
 
 
846
// GetServerFarmSitesResponder handles the response to the GetServerFarmSites request. The method always
 
847
// closes the http.Response Body.
 
848
func (client ServerFarmsClient) GetServerFarmSitesResponder(resp *http.Response) (result SiteCollection, err error) {
 
849
        err = autorest.Respond(
 
850
                resp,
 
851
                client.ByInspecting(),
 
852
                autorest.WithErrorUnlessStatusCode(http.StatusOK),
 
853
                autorest.ByUnmarshallingJSON(&result),
 
854
                autorest.ByClosing())
 
855
        result.Response = autorest.Response{Response: resp}
 
856
        return
 
857
}
 
858
 
 
859
// GetServerFarmSitesNextResults retrieves the next set of results, if any.
 
860
func (client ServerFarmsClient) GetServerFarmSitesNextResults(lastResults SiteCollection) (result SiteCollection, ae error) {
 
861
        req, err := lastResults.SiteCollectionPreparer()
 
862
        if err != nil {
 
863
                return result, autorest.NewErrorWithError(err, "web/ServerFarmsClient", "GetServerFarmSites", "Failure preparing next results request request")
 
864
        }
 
865
        if req == nil {
 
866
                return
 
867
        }
 
868
 
 
869
        resp, err := client.GetServerFarmSitesSender(req)
 
870
        if err != nil {
 
871
                result.Response = autorest.Response{Response: resp}
 
872
                return result, autorest.NewErrorWithError(err, "web/ServerFarmsClient", "GetServerFarmSites", "Failure sending next results request request")
 
873
        }
 
874
 
 
875
        result, err = client.GetServerFarmSitesResponder(resp)
 
876
        if err != nil {
 
877
                ae = autorest.NewErrorWithError(err, "web/ServerFarmsClient", "GetServerFarmSites", "Failure responding to next results request request")
 
878
        }
 
879
 
 
880
        return
 
881
}
 
882
 
 
883
// GetServerFarmVnetGateway sends the get server farm vnet gateway request.
 
884
//
 
885
// resourceGroupName is name of resource group name is name of the App Service
 
886
// Plan vnetName is name of the virtual network gatewayName is name of the
 
887
// gateway. Only the 'primary' gateway is supported.
 
888
func (client ServerFarmsClient) GetServerFarmVnetGateway(resourceGroupName string, name string, vnetName string, gatewayName string) (result VnetGateway, ae error) {
 
889
        req, err := client.GetServerFarmVnetGatewayPreparer(resourceGroupName, name, vnetName, gatewayName)
 
890
        if err != nil {
 
891
                return result, autorest.NewErrorWithError(err, "web/ServerFarmsClient", "GetServerFarmVnetGateway", "Failure preparing request")
 
892
        }
 
893
 
 
894
        resp, err := client.GetServerFarmVnetGatewaySender(req)
 
895
        if err != nil {
 
896
                result.Response = autorest.Response{Response: resp}
 
897
                return result, autorest.NewErrorWithError(err, "web/ServerFarmsClient", "GetServerFarmVnetGateway", "Failure sending request")
 
898
        }
 
899
 
 
900
        result, err = client.GetServerFarmVnetGatewayResponder(resp)
 
901
        if err != nil {
 
902
                ae = autorest.NewErrorWithError(err, "web/ServerFarmsClient", "GetServerFarmVnetGateway", "Failure responding to request")
 
903
        }
 
904
 
 
905
        return
 
906
}
 
907
 
 
908
// GetServerFarmVnetGatewayPreparer prepares the GetServerFarmVnetGateway request.
 
909
func (client ServerFarmsClient) GetServerFarmVnetGatewayPreparer(resourceGroupName string, name string, vnetName string, gatewayName string) (*http.Request, error) {
 
910
        pathParameters := map[string]interface{}{
 
911
                "gatewayName":       url.QueryEscape(gatewayName),
 
912
                "name":              url.QueryEscape(name),
 
913
                "resourceGroupName": url.QueryEscape(resourceGroupName),
 
914
                "subscriptionId":    url.QueryEscape(client.SubscriptionID),
 
915
                "vnetName":          url.QueryEscape(vnetName),
 
916
        }
 
917
 
 
918
        queryParameters := map[string]interface{}{
 
919
                "api-version": APIVersion,
 
920
        }
 
921
 
 
922
        return autorest.Prepare(&http.Request{},
 
923
                autorest.AsJSON(),
 
924
                autorest.AsGet(),
 
925
                autorest.WithBaseURL(client.BaseURI),
 
926
                autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}"),
 
927
                autorest.WithPathParameters(pathParameters),
 
928
                autorest.WithQueryParameters(queryParameters))
 
929
}
 
930
 
 
931
// GetServerFarmVnetGatewaySender sends the GetServerFarmVnetGateway request. The method will close the
 
932
// http.Response Body if it receives an error.
 
933
func (client ServerFarmsClient) GetServerFarmVnetGatewaySender(req *http.Request) (*http.Response, error) {
 
934
        return client.Send(req, http.StatusOK)
 
935
}
 
936
 
 
937
// GetServerFarmVnetGatewayResponder handles the response to the GetServerFarmVnetGateway request. The method always
 
938
// closes the http.Response Body.
 
939
func (client ServerFarmsClient) GetServerFarmVnetGatewayResponder(resp *http.Response) (result VnetGateway, err error) {
 
940
        err = autorest.Respond(
 
941
                resp,
 
942
                client.ByInspecting(),
 
943
                autorest.WithErrorUnlessStatusCode(http.StatusOK),
 
944
                autorest.ByUnmarshallingJSON(&result),
 
945
                autorest.ByClosing())
 
946
        result.Response = autorest.Response{Response: resp}
 
947
        return
 
948
}
 
949
 
 
950
// GetVnetFromServerFarm sends the get vnet from server farm request.
 
951
//
 
952
// resourceGroupName is name of resource group name is name of App Service
 
953
// Plan vnetName is name of virtual network
 
954
func (client ServerFarmsClient) GetVnetFromServerFarm(resourceGroupName string, name string, vnetName string) (result VnetInfo, ae error) {
 
955
        req, err := client.GetVnetFromServerFarmPreparer(resourceGroupName, name, vnetName)
 
956
        if err != nil {
 
957
                return result, autorest.NewErrorWithError(err, "web/ServerFarmsClient", "GetVnetFromServerFarm", "Failure preparing request")
 
958
        }
 
959
 
 
960
        resp, err := client.GetVnetFromServerFarmSender(req)
 
961
        if err != nil {
 
962
                result.Response = autorest.Response{Response: resp}
 
963
                return result, autorest.NewErrorWithError(err, "web/ServerFarmsClient", "GetVnetFromServerFarm", "Failure sending request")
 
964
        }
 
965
 
 
966
        result, err = client.GetVnetFromServerFarmResponder(resp)
 
967
        if err != nil {
 
968
                ae = autorest.NewErrorWithError(err, "web/ServerFarmsClient", "GetVnetFromServerFarm", "Failure responding to request")
 
969
        }
 
970
 
 
971
        return
 
972
}
 
973
 
 
974
// GetVnetFromServerFarmPreparer prepares the GetVnetFromServerFarm request.
 
975
func (client ServerFarmsClient) GetVnetFromServerFarmPreparer(resourceGroupName string, name string, vnetName string) (*http.Request, error) {
 
976
        pathParameters := map[string]interface{}{
 
977
                "name":              url.QueryEscape(name),
 
978
                "resourceGroupName": url.QueryEscape(resourceGroupName),
 
979
                "subscriptionId":    url.QueryEscape(client.SubscriptionID),
 
980
                "vnetName":          url.QueryEscape(vnetName),
 
981
        }
 
982
 
 
983
        queryParameters := map[string]interface{}{
 
984
                "api-version": APIVersion,
 
985
        }
 
986
 
 
987
        return autorest.Prepare(&http.Request{},
 
988
                autorest.AsJSON(),
 
989
                autorest.AsGet(),
 
990
                autorest.WithBaseURL(client.BaseURI),
 
991
                autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}"),
 
992
                autorest.WithPathParameters(pathParameters),
 
993
                autorest.WithQueryParameters(queryParameters))
 
994
}
 
995
 
 
996
// GetVnetFromServerFarmSender sends the GetVnetFromServerFarm request. The method will close the
 
997
// http.Response Body if it receives an error.
 
998
func (client ServerFarmsClient) GetVnetFromServerFarmSender(req *http.Request) (*http.Response, error) {
 
999
        return client.Send(req, http.StatusOK, http.StatusNotFound)
 
1000
}
 
1001
 
 
1002
// GetVnetFromServerFarmResponder handles the response to the GetVnetFromServerFarm request. The method always
 
1003
// closes the http.Response Body.
 
1004
func (client ServerFarmsClient) GetVnetFromServerFarmResponder(resp *http.Response) (result VnetInfo, err error) {
 
1005
        err = autorest.Respond(
 
1006
                resp,
 
1007
                client.ByInspecting(),
 
1008
                autorest.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound),
 
1009
                autorest.ByUnmarshallingJSON(&result),
 
1010
                autorest.ByClosing())
 
1011
        result.Response = autorest.Response{Response: resp}
 
1012
        return
 
1013
}
 
1014
 
 
1015
// GetVnetsForServerFarm sends the get vnets for server farm request.
 
1016
//
 
1017
// resourceGroupName is name of resource group name is name of App Service
 
1018
// Plan
 
1019
func (client ServerFarmsClient) GetVnetsForServerFarm(resourceGroupName string, name string) (result VnetInfoList, ae error) {
 
1020
        req, err := client.GetVnetsForServerFarmPreparer(resourceGroupName, name)
 
1021
        if err != nil {
 
1022
                return result, autorest.NewErrorWithError(err, "web/ServerFarmsClient", "GetVnetsForServerFarm", "Failure preparing request")
 
1023
        }
 
1024
 
 
1025
        resp, err := client.GetVnetsForServerFarmSender(req)
 
1026
        if err != nil {
 
1027
                result.Response = autorest.Response{Response: resp}
 
1028
                return result, autorest.NewErrorWithError(err, "web/ServerFarmsClient", "GetVnetsForServerFarm", "Failure sending request")
 
1029
        }
 
1030
 
 
1031
        result, err = client.GetVnetsForServerFarmResponder(resp)
 
1032
        if err != nil {
 
1033
                ae = autorest.NewErrorWithError(err, "web/ServerFarmsClient", "GetVnetsForServerFarm", "Failure responding to request")
 
1034
        }
 
1035
 
 
1036
        return
 
1037
}
 
1038
 
 
1039
// GetVnetsForServerFarmPreparer prepares the GetVnetsForServerFarm request.
 
1040
func (client ServerFarmsClient) GetVnetsForServerFarmPreparer(resourceGroupName string, name string) (*http.Request, error) {
 
1041
        pathParameters := map[string]interface{}{
 
1042
                "name":              url.QueryEscape(name),
 
1043
                "resourceGroupName": url.QueryEscape(resourceGroupName),
 
1044
                "subscriptionId":    url.QueryEscape(client.SubscriptionID),
 
1045
        }
 
1046
 
 
1047
        queryParameters := map[string]interface{}{
 
1048
                "api-version": APIVersion,
 
1049
        }
 
1050
 
 
1051
        return autorest.Prepare(&http.Request{},
 
1052
                autorest.AsJSON(),
 
1053
                autorest.AsGet(),
 
1054
                autorest.WithBaseURL(client.BaseURI),
 
1055
                autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections"),
 
1056
                autorest.WithPathParameters(pathParameters),
 
1057
                autorest.WithQueryParameters(queryParameters))
 
1058
}
 
1059
 
 
1060
// GetVnetsForServerFarmSender sends the GetVnetsForServerFarm request. The method will close the
 
1061
// http.Response Body if it receives an error.
 
1062
func (client ServerFarmsClient) GetVnetsForServerFarmSender(req *http.Request) (*http.Response, error) {
 
1063
        return client.Send(req, http.StatusOK)
 
1064
}
 
1065
 
 
1066
// GetVnetsForServerFarmResponder handles the response to the GetVnetsForServerFarm request. The method always
 
1067
// closes the http.Response Body.
 
1068
func (client ServerFarmsClient) GetVnetsForServerFarmResponder(resp *http.Response) (result VnetInfoList, err error) {
 
1069
        err = autorest.Respond(
 
1070
                resp,
 
1071
                client.ByInspecting(),
 
1072
                autorest.WithErrorUnlessStatusCode(http.StatusOK),
 
1073
                autorest.ByUnmarshallingJSON(&result.Value),
 
1074
                autorest.ByClosing())
 
1075
        result.Response = autorest.Response{Response: resp}
 
1076
        return
 
1077
}
 
1078
 
 
1079
// RebootWorkerForServerFarm sends the reboot worker for server farm request.
 
1080
//
 
1081
// resourceGroupName is name of resource group name is name of server farm
 
1082
// workerName is name of worker machine, typically IP address
 
1083
func (client ServerFarmsClient) RebootWorkerForServerFarm(resourceGroupName string, name string, workerName string) (result ObjectSet, ae error) {
 
1084
        req, err := client.RebootWorkerForServerFarmPreparer(resourceGroupName, name, workerName)
 
1085
        if err != nil {
 
1086
                return result, autorest.NewErrorWithError(err, "web/ServerFarmsClient", "RebootWorkerForServerFarm", "Failure preparing request")
 
1087
        }
 
1088
 
 
1089
        resp, err := client.RebootWorkerForServerFarmSender(req)
 
1090
        if err != nil {
 
1091
                result.Response = autorest.Response{Response: resp}
 
1092
                return result, autorest.NewErrorWithError(err, "web/ServerFarmsClient", "RebootWorkerForServerFarm", "Failure sending request")
 
1093
        }
 
1094
 
 
1095
        result, err = client.RebootWorkerForServerFarmResponder(resp)
 
1096
        if err != nil {
 
1097
                ae = autorest.NewErrorWithError(err, "web/ServerFarmsClient", "RebootWorkerForServerFarm", "Failure responding to request")
 
1098
        }
 
1099
 
 
1100
        return
 
1101
}
 
1102
 
 
1103
// RebootWorkerForServerFarmPreparer prepares the RebootWorkerForServerFarm request.
 
1104
func (client ServerFarmsClient) RebootWorkerForServerFarmPreparer(resourceGroupName string, name string, workerName string) (*http.Request, error) {
 
1105
        pathParameters := map[string]interface{}{
 
1106
                "name":              url.QueryEscape(name),
 
1107
                "resourceGroupName": url.QueryEscape(resourceGroupName),
 
1108
                "subscriptionId":    url.QueryEscape(client.SubscriptionID),
 
1109
                "workerName":        url.QueryEscape(workerName),
 
1110
        }
 
1111
 
 
1112
        queryParameters := map[string]interface{}{
 
1113
                "api-version": APIVersion,
 
1114
        }
 
1115
 
 
1116
        return autorest.Prepare(&http.Request{},
 
1117
                autorest.AsJSON(),
 
1118
                autorest.AsPost(),
 
1119
                autorest.WithBaseURL(client.BaseURI),
 
1120
                autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/workers/{workerName}"),
 
1121
                autorest.WithPathParameters(pathParameters),
 
1122
                autorest.WithQueryParameters(queryParameters))
 
1123
}
 
1124
 
 
1125
// RebootWorkerForServerFarmSender sends the RebootWorkerForServerFarm request. The method will close the
 
1126
// http.Response Body if it receives an error.
 
1127
func (client ServerFarmsClient) RebootWorkerForServerFarmSender(req *http.Request) (*http.Response, error) {
 
1128
        return client.Send(req, http.StatusOK)
 
1129
}
 
1130
 
 
1131
// RebootWorkerForServerFarmResponder handles the response to the RebootWorkerForServerFarm request. The method always
 
1132
// closes the http.Response Body.
 
1133
func (client ServerFarmsClient) RebootWorkerForServerFarmResponder(resp *http.Response) (result ObjectSet, err error) {
 
1134
        err = autorest.Respond(
 
1135
                resp,
 
1136
                client.ByInspecting(),
 
1137
                autorest.WithErrorUnlessStatusCode(http.StatusOK),
 
1138
                autorest.ByUnmarshallingJSON(&result.Value),
 
1139
                autorest.ByClosing())
 
1140
        result.Response = autorest.Response{Response: resp}
 
1141
        return
 
1142
}
 
1143
 
 
1144
// RestartSitesForServerFarm sends the restart sites for server farm request.
 
1145
//
 
1146
// resourceGroupName is name of resource group name is name of App Service
 
1147
// Plan softRestart is soft restart applies the configuration settings and
 
1148
// restarts the apps if necessary. Hard restart always restarts and
 
1149
// reprovisions the apps
 
1150
func (client ServerFarmsClient) RestartSitesForServerFarm(resourceGroupName string, name string, softRestart *bool) (result ObjectSet, ae error) {
 
1151
        req, err := client.RestartSitesForServerFarmPreparer(resourceGroupName, name, softRestart)
 
1152
        if err != nil {
 
1153
                return result, autorest.NewErrorWithError(err, "web/ServerFarmsClient", "RestartSitesForServerFarm", "Failure preparing request")
 
1154
        }
 
1155
 
 
1156
        resp, err := client.RestartSitesForServerFarmSender(req)
 
1157
        if err != nil {
 
1158
                result.Response = autorest.Response{Response: resp}
 
1159
                return result, autorest.NewErrorWithError(err, "web/ServerFarmsClient", "RestartSitesForServerFarm", "Failure sending request")
 
1160
        }
 
1161
 
 
1162
        result, err = client.RestartSitesForServerFarmResponder(resp)
 
1163
        if err != nil {
 
1164
                ae = autorest.NewErrorWithError(err, "web/ServerFarmsClient", "RestartSitesForServerFarm", "Failure responding to request")
 
1165
        }
 
1166
 
 
1167
        return
 
1168
}
 
1169
 
 
1170
// RestartSitesForServerFarmPreparer prepares the RestartSitesForServerFarm request.
 
1171
func (client ServerFarmsClient) RestartSitesForServerFarmPreparer(resourceGroupName string, name string, softRestart *bool) (*http.Request, error) {
 
1172
        pathParameters := map[string]interface{}{
 
1173
                "name":              url.QueryEscape(name),
 
1174
                "resourceGroupName": url.QueryEscape(resourceGroupName),
 
1175
                "subscriptionId":    url.QueryEscape(client.SubscriptionID),
 
1176
        }
 
1177
 
 
1178
        queryParameters := map[string]interface{}{
 
1179
                "api-version": APIVersion,
 
1180
        }
 
1181
        if softRestart != nil {
 
1182
                queryParameters["softRestart"] = softRestart
 
1183
        }
 
1184
 
 
1185
        return autorest.Prepare(&http.Request{},
 
1186
                autorest.AsJSON(),
 
1187
                autorest.AsPost(),
 
1188
                autorest.WithBaseURL(client.BaseURI),
 
1189
                autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/restartSites"),
 
1190
                autorest.WithPathParameters(pathParameters),
 
1191
                autorest.WithQueryParameters(queryParameters))
 
1192
}
 
1193
 
 
1194
// RestartSitesForServerFarmSender sends the RestartSitesForServerFarm request. The method will close the
 
1195
// http.Response Body if it receives an error.
 
1196
func (client ServerFarmsClient) RestartSitesForServerFarmSender(req *http.Request) (*http.Response, error) {
 
1197
        return client.Send(req, http.StatusOK)
 
1198
}
 
1199
 
 
1200
// RestartSitesForServerFarmResponder handles the response to the RestartSitesForServerFarm request. The method always
 
1201
// closes the http.Response Body.
 
1202
func (client ServerFarmsClient) RestartSitesForServerFarmResponder(resp *http.Response) (result ObjectSet, err error) {
 
1203
        err = autorest.Respond(
 
1204
                resp,
 
1205
                client.ByInspecting(),
 
1206
                autorest.WithErrorUnlessStatusCode(http.StatusOK),
 
1207
                autorest.ByUnmarshallingJSON(&result.Value),
 
1208
                autorest.ByClosing())
 
1209
        result.Response = autorest.Response{Response: resp}
 
1210
        return
 
1211
}
 
1212
 
 
1213
// UpdateServerFarmVnetGateway sends the update server farm vnet gateway
 
1214
// request.
 
1215
//
 
1216
// resourceGroupName is the resource group name is the name of the App Service
 
1217
// Plan vnetName is the name of the virtual network gatewayName is the name
 
1218
// of the gateway. Only 'primary' is supported. connectionEnvelope is the
 
1219
// gateway entity.
 
1220
func (client ServerFarmsClient) UpdateServerFarmVnetGateway(resourceGroupName string, name string, vnetName string, gatewayName string, connectionEnvelope VnetGateway) (result VnetGateway, ae error) {
 
1221
        req, err := client.UpdateServerFarmVnetGatewayPreparer(resourceGroupName, name, vnetName, gatewayName, connectionEnvelope)
 
1222
        if err != nil {
 
1223
                return result, autorest.NewErrorWithError(err, "web/ServerFarmsClient", "UpdateServerFarmVnetGateway", "Failure preparing request")
 
1224
        }
 
1225
 
 
1226
        resp, err := client.UpdateServerFarmVnetGatewaySender(req)
 
1227
        if err != nil {
 
1228
                result.Response = autorest.Response{Response: resp}
 
1229
                return result, autorest.NewErrorWithError(err, "web/ServerFarmsClient", "UpdateServerFarmVnetGateway", "Failure sending request")
 
1230
        }
 
1231
 
 
1232
        result, err = client.UpdateServerFarmVnetGatewayResponder(resp)
 
1233
        if err != nil {
 
1234
                ae = autorest.NewErrorWithError(err, "web/ServerFarmsClient", "UpdateServerFarmVnetGateway", "Failure responding to request")
 
1235
        }
 
1236
 
 
1237
        return
 
1238
}
 
1239
 
 
1240
// UpdateServerFarmVnetGatewayPreparer prepares the UpdateServerFarmVnetGateway request.
 
1241
func (client ServerFarmsClient) UpdateServerFarmVnetGatewayPreparer(resourceGroupName string, name string, vnetName string, gatewayName string, connectionEnvelope VnetGateway) (*http.Request, error) {
 
1242
        pathParameters := map[string]interface{}{
 
1243
                "gatewayName":       url.QueryEscape(gatewayName),
 
1244
                "name":              url.QueryEscape(name),
 
1245
                "resourceGroupName": url.QueryEscape(resourceGroupName),
 
1246
                "subscriptionId":    url.QueryEscape(client.SubscriptionID),
 
1247
                "vnetName":          url.QueryEscape(vnetName),
 
1248
        }
 
1249
 
 
1250
        queryParameters := map[string]interface{}{
 
1251
                "api-version": APIVersion,
 
1252
        }
 
1253
 
 
1254
        return autorest.Prepare(&http.Request{},
 
1255
                autorest.AsJSON(),
 
1256
                autorest.AsPut(),
 
1257
                autorest.WithBaseURL(client.BaseURI),
 
1258
                autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}"),
 
1259
                autorest.WithJSON(connectionEnvelope),
 
1260
                autorest.WithPathParameters(pathParameters),
 
1261
                autorest.WithQueryParameters(queryParameters))
 
1262
}
 
1263
 
 
1264
// UpdateServerFarmVnetGatewaySender sends the UpdateServerFarmVnetGateway request. The method will close the
 
1265
// http.Response Body if it receives an error.
 
1266
func (client ServerFarmsClient) UpdateServerFarmVnetGatewaySender(req *http.Request) (*http.Response, error) {
 
1267
        return client.Send(req, http.StatusOK)
 
1268
}
 
1269
 
 
1270
// UpdateServerFarmVnetGatewayResponder handles the response to the UpdateServerFarmVnetGateway request. The method always
 
1271
// closes the http.Response Body.
 
1272
func (client ServerFarmsClient) UpdateServerFarmVnetGatewayResponder(resp *http.Response) (result VnetGateway, err error) {
 
1273
        err = autorest.Respond(
 
1274
                resp,
 
1275
                client.ByInspecting(),
 
1276
                autorest.WithErrorUnlessStatusCode(http.StatusOK),
 
1277
                autorest.ByUnmarshallingJSON(&result),
 
1278
                autorest.ByClosing())
 
1279
        result.Response = autorest.Response{Response: resp}
 
1280
        return
 
1281
}
 
1282
 
 
1283
// UpdateVnetRoute sends the update vnet route request.
 
1284
//
 
1285
// resourceGroupName is name of resource group name is name of App Service
 
1286
// Plan vnetName is name of virtual network routeName is name of the virtual
 
1287
// network route route is the route object
 
1288
func (client ServerFarmsClient) UpdateVnetRoute(resourceGroupName string, name string, vnetName string, routeName string, route VnetRoute) (result VnetRoute, ae error) {
 
1289
        req, err := client.UpdateVnetRoutePreparer(resourceGroupName, name, vnetName, routeName, route)
 
1290
        if err != nil {
 
1291
                return result, autorest.NewErrorWithError(err, "web/ServerFarmsClient", "UpdateVnetRoute", "Failure preparing request")
 
1292
        }
 
1293
 
 
1294
        resp, err := client.UpdateVnetRouteSender(req)
 
1295
        if err != nil {
 
1296
                result.Response = autorest.Response{Response: resp}
 
1297
                return result, autorest.NewErrorWithError(err, "web/ServerFarmsClient", "UpdateVnetRoute", "Failure sending request")
 
1298
        }
 
1299
 
 
1300
        result, err = client.UpdateVnetRouteResponder(resp)
 
1301
        if err != nil {
 
1302
                ae = autorest.NewErrorWithError(err, "web/ServerFarmsClient", "UpdateVnetRoute", "Failure responding to request")
 
1303
        }
 
1304
 
 
1305
        return
 
1306
}
 
1307
 
 
1308
// UpdateVnetRoutePreparer prepares the UpdateVnetRoute request.
 
1309
func (client ServerFarmsClient) UpdateVnetRoutePreparer(resourceGroupName string, name string, vnetName string, routeName string, route VnetRoute) (*http.Request, error) {
 
1310
        pathParameters := map[string]interface{}{
 
1311
                "name":              url.QueryEscape(name),
 
1312
                "resourceGroupName": url.QueryEscape(resourceGroupName),
 
1313
                "routeName":         url.QueryEscape(routeName),
 
1314
                "subscriptionId":    url.QueryEscape(client.SubscriptionID),
 
1315
                "vnetName":          url.QueryEscape(vnetName),
 
1316
        }
 
1317
 
 
1318
        queryParameters := map[string]interface{}{
 
1319
                "api-version": APIVersion,
 
1320
        }
 
1321
 
 
1322
        return autorest.Prepare(&http.Request{},
 
1323
                autorest.AsJSON(),
 
1324
                autorest.AsPatch(),
 
1325
                autorest.WithBaseURL(client.BaseURI),
 
1326
                autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/routes/{routeName}"),
 
1327
                autorest.WithJSON(route),
 
1328
                autorest.WithPathParameters(pathParameters),
 
1329
                autorest.WithQueryParameters(queryParameters))
 
1330
}
 
1331
 
 
1332
// UpdateVnetRouteSender sends the UpdateVnetRoute request. The method will close the
 
1333
// http.Response Body if it receives an error.
 
1334
func (client ServerFarmsClient) UpdateVnetRouteSender(req *http.Request) (*http.Response, error) {
 
1335
        return client.Send(req, http.StatusOK, http.StatusBadRequest, http.StatusNotFound)
 
1336
}
 
1337
 
 
1338
// UpdateVnetRouteResponder handles the response to the UpdateVnetRoute request. The method always
 
1339
// closes the http.Response Body.
 
1340
func (client ServerFarmsClient) UpdateVnetRouteResponder(resp *http.Response) (result VnetRoute, err error) {
 
1341
        err = autorest.Respond(
 
1342
                resp,
 
1343
                client.ByInspecting(),
 
1344
                autorest.WithErrorUnlessStatusCode(http.StatusOK, http.StatusBadRequest, http.StatusNotFound),
 
1345
                autorest.ByUnmarshallingJSON(&result),
 
1346
                autorest.ByClosing())
 
1347
        result.Response = autorest.Response{Response: resp}
 
1348
        return
 
1349
}