~nskaggs/+junk/xenial-test

« back to all changes in this revision

Viewing changes to src/github.com/Azure/azure-sdk-for-go/arm/web/managedhostingenvironments.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
// ManagedHostingEnvironmentsClient is the use these APIs to manage Azure
 
28
// Websites resources through the Azure Resource Manager. All task operations
 
29
// conform to the HTTP/1.1 protocol specification and each operation returns
 
30
// an 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 ManagedHostingEnvironmentsClient struct {
 
36
        ManagementClient
 
37
}
 
38
 
 
39
// NewManagedHostingEnvironmentsClient creates an instance of the
 
40
// ManagedHostingEnvironmentsClient client.
 
41
func NewManagedHostingEnvironmentsClient(subscriptionID string) ManagedHostingEnvironmentsClient {
 
42
        return NewManagedHostingEnvironmentsClientWithBaseURI(DefaultBaseURI, subscriptionID)
 
43
}
 
44
 
 
45
// NewManagedHostingEnvironmentsClientWithBaseURI creates an instance of the
 
46
// ManagedHostingEnvironmentsClient client.
 
47
func NewManagedHostingEnvironmentsClientWithBaseURI(baseURI string, subscriptionID string) ManagedHostingEnvironmentsClient {
 
48
        return ManagedHostingEnvironmentsClient{NewWithBaseURI(baseURI, subscriptionID)}
 
49
}
 
50
 
 
51
// CreateOrUpdateManagedHostingEnvironment sends the create or update managed
 
52
// hosting environment request.
 
53
//
 
54
// resourceGroupName is name of resource group name is name of managed hosting
 
55
// environment managedHostingEnvironmentEnvelope is properties of managed
 
56
// hosting environment
 
57
func (client ManagedHostingEnvironmentsClient) CreateOrUpdateManagedHostingEnvironment(resourceGroupName string, name string, managedHostingEnvironmentEnvelope HostingEnvironment) (result HostingEnvironment, ae error) {
 
58
        req, err := client.CreateOrUpdateManagedHostingEnvironmentPreparer(resourceGroupName, name, managedHostingEnvironmentEnvelope)
 
59
        if err != nil {
 
60
                return result, autorest.NewErrorWithError(err, "web/ManagedHostingEnvironmentsClient", "CreateOrUpdateManagedHostingEnvironment", "Failure preparing request")
 
61
        }
 
62
 
 
63
        resp, err := client.CreateOrUpdateManagedHostingEnvironmentSender(req)
 
64
        if err != nil {
 
65
                result.Response = autorest.Response{Response: resp}
 
66
                return result, autorest.NewErrorWithError(err, "web/ManagedHostingEnvironmentsClient", "CreateOrUpdateManagedHostingEnvironment", "Failure sending request")
 
67
        }
 
68
 
 
69
        result, err = client.CreateOrUpdateManagedHostingEnvironmentResponder(resp)
 
70
        if err != nil {
 
71
                ae = autorest.NewErrorWithError(err, "web/ManagedHostingEnvironmentsClient", "CreateOrUpdateManagedHostingEnvironment", "Failure responding to request")
 
72
        }
 
73
 
 
74
        return
 
75
}
 
76
 
 
77
// CreateOrUpdateManagedHostingEnvironmentPreparer prepares the CreateOrUpdateManagedHostingEnvironment request.
 
78
func (client ManagedHostingEnvironmentsClient) CreateOrUpdateManagedHostingEnvironmentPreparer(resourceGroupName string, name string, managedHostingEnvironmentEnvelope HostingEnvironment) (*http.Request, error) {
 
79
        pathParameters := map[string]interface{}{
 
80
                "name":              url.QueryEscape(name),
 
81
                "resourceGroupName": url.QueryEscape(resourceGroupName),
 
82
                "subscriptionId":    url.QueryEscape(client.SubscriptionID),
 
83
        }
 
84
 
 
85
        queryParameters := map[string]interface{}{
 
86
                "api-version": APIVersion,
 
87
        }
 
88
 
 
89
        return autorest.Prepare(&http.Request{},
 
90
                autorest.AsJSON(),
 
91
                autorest.AsPut(),
 
92
                autorest.WithBaseURL(client.BaseURI),
 
93
                autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/managedHostingEnvironments/{name}"),
 
94
                autorest.WithJSON(managedHostingEnvironmentEnvelope),
 
95
                autorest.WithPathParameters(pathParameters),
 
96
                autorest.WithQueryParameters(queryParameters))
 
97
}
 
98
 
 
99
// CreateOrUpdateManagedHostingEnvironmentSender sends the CreateOrUpdateManagedHostingEnvironment request. The method will close the
 
100
// http.Response Body if it receives an error.
 
101
func (client ManagedHostingEnvironmentsClient) CreateOrUpdateManagedHostingEnvironmentSender(req *http.Request) (*http.Response, error) {
 
102
        return client.Send(req, http.StatusOK, http.StatusAccepted, http.StatusBadRequest, http.StatusNotFound, http.StatusConflict)
 
103
}
 
104
 
 
105
// CreateOrUpdateManagedHostingEnvironmentResponder handles the response to the CreateOrUpdateManagedHostingEnvironment request. The method always
 
106
// closes the http.Response Body.
 
107
func (client ManagedHostingEnvironmentsClient) CreateOrUpdateManagedHostingEnvironmentResponder(resp *http.Response) (result HostingEnvironment, err error) {
 
108
        err = autorest.Respond(
 
109
                resp,
 
110
                client.ByInspecting(),
 
111
                autorest.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusBadRequest, http.StatusNotFound, http.StatusConflict),
 
112
                autorest.ByUnmarshallingJSON(&result),
 
113
                autorest.ByClosing())
 
114
        result.Response = autorest.Response{Response: resp}
 
115
        return
 
116
}
 
117
 
 
118
// DeleteManagedHostingEnvironment sends the delete managed hosting
 
119
// environment request.
 
120
//
 
121
// resourceGroupName is name of resource group name is name of managed hosting
 
122
// environment forceDelete is delete even if the managed hosting environment
 
123
// contains resources
 
124
func (client ManagedHostingEnvironmentsClient) DeleteManagedHostingEnvironment(resourceGroupName string, name string, forceDelete *bool) (result ObjectSet, ae error) {
 
125
        req, err := client.DeleteManagedHostingEnvironmentPreparer(resourceGroupName, name, forceDelete)
 
126
        if err != nil {
 
127
                return result, autorest.NewErrorWithError(err, "web/ManagedHostingEnvironmentsClient", "DeleteManagedHostingEnvironment", "Failure preparing request")
 
128
        }
 
129
 
 
130
        resp, err := client.DeleteManagedHostingEnvironmentSender(req)
 
131
        if err != nil {
 
132
                result.Response = autorest.Response{Response: resp}
 
133
                return result, autorest.NewErrorWithError(err, "web/ManagedHostingEnvironmentsClient", "DeleteManagedHostingEnvironment", "Failure sending request")
 
134
        }
 
135
 
 
136
        result, err = client.DeleteManagedHostingEnvironmentResponder(resp)
 
137
        if err != nil {
 
138
                ae = autorest.NewErrorWithError(err, "web/ManagedHostingEnvironmentsClient", "DeleteManagedHostingEnvironment", "Failure responding to request")
 
139
        }
 
140
 
 
141
        return
 
142
}
 
143
 
 
144
// DeleteManagedHostingEnvironmentPreparer prepares the DeleteManagedHostingEnvironment request.
 
145
func (client ManagedHostingEnvironmentsClient) DeleteManagedHostingEnvironmentPreparer(resourceGroupName string, name string, forceDelete *bool) (*http.Request, error) {
 
146
        pathParameters := map[string]interface{}{
 
147
                "name":              url.QueryEscape(name),
 
148
                "resourceGroupName": url.QueryEscape(resourceGroupName),
 
149
                "subscriptionId":    url.QueryEscape(client.SubscriptionID),
 
150
        }
 
151
 
 
152
        queryParameters := map[string]interface{}{
 
153
                "api-version": APIVersion,
 
154
        }
 
155
        if forceDelete != nil {
 
156
                queryParameters["forceDelete"] = forceDelete
 
157
        }
 
158
 
 
159
        return autorest.Prepare(&http.Request{},
 
160
                autorest.AsJSON(),
 
161
                autorest.AsDelete(),
 
162
                autorest.WithBaseURL(client.BaseURI),
 
163
                autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/managedHostingEnvironments/{name}"),
 
164
                autorest.WithPathParameters(pathParameters),
 
165
                autorest.WithQueryParameters(queryParameters))
 
166
}
 
167
 
 
168
// DeleteManagedHostingEnvironmentSender sends the DeleteManagedHostingEnvironment request. The method will close the
 
169
// http.Response Body if it receives an error.
 
170
func (client ManagedHostingEnvironmentsClient) DeleteManagedHostingEnvironmentSender(req *http.Request) (*http.Response, error) {
 
171
        return client.Send(req, http.StatusOK, http.StatusAccepted, http.StatusBadRequest, http.StatusNotFound, http.StatusConflict)
 
172
}
 
173
 
 
174
// DeleteManagedHostingEnvironmentResponder handles the response to the DeleteManagedHostingEnvironment request. The method always
 
175
// closes the http.Response Body.
 
176
func (client ManagedHostingEnvironmentsClient) DeleteManagedHostingEnvironmentResponder(resp *http.Response) (result ObjectSet, err error) {
 
177
        err = autorest.Respond(
 
178
                resp,
 
179
                client.ByInspecting(),
 
180
                autorest.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusBadRequest, http.StatusNotFound, http.StatusConflict),
 
181
                autorest.ByUnmarshallingJSON(&result.Value),
 
182
                autorest.ByClosing())
 
183
        result.Response = autorest.Response{Response: resp}
 
184
        return
 
185
}
 
186
 
 
187
// GetManagedHostingEnvironment sends the get managed hosting environment
 
188
// request.
 
189
//
 
190
// resourceGroupName is name of resource group name is name of managed hosting
 
191
// environment
 
192
func (client ManagedHostingEnvironmentsClient) GetManagedHostingEnvironment(resourceGroupName string, name string) (result ManagedHostingEnvironment, ae error) {
 
193
        req, err := client.GetManagedHostingEnvironmentPreparer(resourceGroupName, name)
 
194
        if err != nil {
 
195
                return result, autorest.NewErrorWithError(err, "web/ManagedHostingEnvironmentsClient", "GetManagedHostingEnvironment", "Failure preparing request")
 
196
        }
 
197
 
 
198
        resp, err := client.GetManagedHostingEnvironmentSender(req)
 
199
        if err != nil {
 
200
                result.Response = autorest.Response{Response: resp}
 
201
                return result, autorest.NewErrorWithError(err, "web/ManagedHostingEnvironmentsClient", "GetManagedHostingEnvironment", "Failure sending request")
 
202
        }
 
203
 
 
204
        result, err = client.GetManagedHostingEnvironmentResponder(resp)
 
205
        if err != nil {
 
206
                ae = autorest.NewErrorWithError(err, "web/ManagedHostingEnvironmentsClient", "GetManagedHostingEnvironment", "Failure responding to request")
 
207
        }
 
208
 
 
209
        return
 
210
}
 
211
 
 
212
// GetManagedHostingEnvironmentPreparer prepares the GetManagedHostingEnvironment request.
 
213
func (client ManagedHostingEnvironmentsClient) GetManagedHostingEnvironmentPreparer(resourceGroupName string, name string) (*http.Request, error) {
 
214
        pathParameters := map[string]interface{}{
 
215
                "name":              url.QueryEscape(name),
 
216
                "resourceGroupName": url.QueryEscape(resourceGroupName),
 
217
                "subscriptionId":    url.QueryEscape(client.SubscriptionID),
 
218
        }
 
219
 
 
220
        queryParameters := map[string]interface{}{
 
221
                "api-version": APIVersion,
 
222
        }
 
223
 
 
224
        return autorest.Prepare(&http.Request{},
 
225
                autorest.AsJSON(),
 
226
                autorest.AsGet(),
 
227
                autorest.WithBaseURL(client.BaseURI),
 
228
                autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/managedHostingEnvironments/{name}"),
 
229
                autorest.WithPathParameters(pathParameters),
 
230
                autorest.WithQueryParameters(queryParameters))
 
231
}
 
232
 
 
233
// GetManagedHostingEnvironmentSender sends the GetManagedHostingEnvironment request. The method will close the
 
234
// http.Response Body if it receives an error.
 
235
func (client ManagedHostingEnvironmentsClient) GetManagedHostingEnvironmentSender(req *http.Request) (*http.Response, error) {
 
236
        return client.Send(req, http.StatusOK)
 
237
}
 
238
 
 
239
// GetManagedHostingEnvironmentResponder handles the response to the GetManagedHostingEnvironment request. The method always
 
240
// closes the http.Response Body.
 
241
func (client ManagedHostingEnvironmentsClient) GetManagedHostingEnvironmentResponder(resp *http.Response) (result ManagedHostingEnvironment, err error) {
 
242
        err = autorest.Respond(
 
243
                resp,
 
244
                client.ByInspecting(),
 
245
                autorest.WithErrorUnlessStatusCode(http.StatusOK),
 
246
                autorest.ByUnmarshallingJSON(&result),
 
247
                autorest.ByClosing())
 
248
        result.Response = autorest.Response{Response: resp}
 
249
        return
 
250
}
 
251
 
 
252
// GetManagedHostingEnvironmentOperation sends the get managed hosting
 
253
// environment operation request.
 
254
//
 
255
// resourceGroupName is name of resource group name is name of managed hosting
 
256
// environment operationID is operation identifier GUID
 
257
func (client ManagedHostingEnvironmentsClient) GetManagedHostingEnvironmentOperation(resourceGroupName string, name string, operationID string) (result ObjectSet, ae error) {
 
258
        req, err := client.GetManagedHostingEnvironmentOperationPreparer(resourceGroupName, name, operationID)
 
259
        if err != nil {
 
260
                return result, autorest.NewErrorWithError(err, "web/ManagedHostingEnvironmentsClient", "GetManagedHostingEnvironmentOperation", "Failure preparing request")
 
261
        }
 
262
 
 
263
        resp, err := client.GetManagedHostingEnvironmentOperationSender(req)
 
264
        if err != nil {
 
265
                result.Response = autorest.Response{Response: resp}
 
266
                return result, autorest.NewErrorWithError(err, "web/ManagedHostingEnvironmentsClient", "GetManagedHostingEnvironmentOperation", "Failure sending request")
 
267
        }
 
268
 
 
269
        result, err = client.GetManagedHostingEnvironmentOperationResponder(resp)
 
270
        if err != nil {
 
271
                ae = autorest.NewErrorWithError(err, "web/ManagedHostingEnvironmentsClient", "GetManagedHostingEnvironmentOperation", "Failure responding to request")
 
272
        }
 
273
 
 
274
        return
 
275
}
 
276
 
 
277
// GetManagedHostingEnvironmentOperationPreparer prepares the GetManagedHostingEnvironmentOperation request.
 
278
func (client ManagedHostingEnvironmentsClient) GetManagedHostingEnvironmentOperationPreparer(resourceGroupName string, name string, operationID string) (*http.Request, error) {
 
279
        pathParameters := map[string]interface{}{
 
280
                "name":              url.QueryEscape(name),
 
281
                "operationId":       url.QueryEscape(operationID),
 
282
                "resourceGroupName": url.QueryEscape(resourceGroupName),
 
283
                "subscriptionId":    url.QueryEscape(client.SubscriptionID),
 
284
        }
 
285
 
 
286
        queryParameters := map[string]interface{}{
 
287
                "api-version": APIVersion,
 
288
        }
 
289
 
 
290
        return autorest.Prepare(&http.Request{},
 
291
                autorest.AsJSON(),
 
292
                autorest.AsGet(),
 
293
                autorest.WithBaseURL(client.BaseURI),
 
294
                autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/managedHostingEnvironments/{name}/operations/{operationId}"),
 
295
                autorest.WithPathParameters(pathParameters),
 
296
                autorest.WithQueryParameters(queryParameters))
 
297
}
 
298
 
 
299
// GetManagedHostingEnvironmentOperationSender sends the GetManagedHostingEnvironmentOperation request. The method will close the
 
300
// http.Response Body if it receives an error.
 
301
func (client ManagedHostingEnvironmentsClient) GetManagedHostingEnvironmentOperationSender(req *http.Request) (*http.Response, error) {
 
302
        return client.Send(req, http.StatusOK, http.StatusAccepted, http.StatusNotFound, http.StatusInternalServerError)
 
303
}
 
304
 
 
305
// GetManagedHostingEnvironmentOperationResponder handles the response to the GetManagedHostingEnvironmentOperation request. The method always
 
306
// closes the http.Response Body.
 
307
func (client ManagedHostingEnvironmentsClient) GetManagedHostingEnvironmentOperationResponder(resp *http.Response) (result ObjectSet, err error) {
 
308
        err = autorest.Respond(
 
309
                resp,
 
310
                client.ByInspecting(),
 
311
                autorest.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNotFound, http.StatusInternalServerError),
 
312
                autorest.ByUnmarshallingJSON(&result.Value),
 
313
                autorest.ByClosing())
 
314
        result.Response = autorest.Response{Response: resp}
 
315
        return
 
316
}
 
317
 
 
318
// GetManagedHostingEnvironments sends the get managed hosting environments
 
319
// request.
 
320
//
 
321
// resourceGroupName is name of resource group
 
322
func (client ManagedHostingEnvironmentsClient) GetManagedHostingEnvironments(resourceGroupName string) (result HostingEnvironmentCollection, ae error) {
 
323
        req, err := client.GetManagedHostingEnvironmentsPreparer(resourceGroupName)
 
324
        if err != nil {
 
325
                return result, autorest.NewErrorWithError(err, "web/ManagedHostingEnvironmentsClient", "GetManagedHostingEnvironments", "Failure preparing request")
 
326
        }
 
327
 
 
328
        resp, err := client.GetManagedHostingEnvironmentsSender(req)
 
329
        if err != nil {
 
330
                result.Response = autorest.Response{Response: resp}
 
331
                return result, autorest.NewErrorWithError(err, "web/ManagedHostingEnvironmentsClient", "GetManagedHostingEnvironments", "Failure sending request")
 
332
        }
 
333
 
 
334
        result, err = client.GetManagedHostingEnvironmentsResponder(resp)
 
335
        if err != nil {
 
336
                ae = autorest.NewErrorWithError(err, "web/ManagedHostingEnvironmentsClient", "GetManagedHostingEnvironments", "Failure responding to request")
 
337
        }
 
338
 
 
339
        return
 
340
}
 
341
 
 
342
// GetManagedHostingEnvironmentsPreparer prepares the GetManagedHostingEnvironments request.
 
343
func (client ManagedHostingEnvironmentsClient) GetManagedHostingEnvironmentsPreparer(resourceGroupName string) (*http.Request, error) {
 
344
        pathParameters := map[string]interface{}{
 
345
                "resourceGroupName": url.QueryEscape(resourceGroupName),
 
346
                "subscriptionId":    url.QueryEscape(client.SubscriptionID),
 
347
        }
 
348
 
 
349
        queryParameters := map[string]interface{}{
 
350
                "api-version": APIVersion,
 
351
        }
 
352
 
 
353
        return autorest.Prepare(&http.Request{},
 
354
                autorest.AsJSON(),
 
355
                autorest.AsGet(),
 
356
                autorest.WithBaseURL(client.BaseURI),
 
357
                autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/managedHostingEnvironments"),
 
358
                autorest.WithPathParameters(pathParameters),
 
359
                autorest.WithQueryParameters(queryParameters))
 
360
}
 
361
 
 
362
// GetManagedHostingEnvironmentsSender sends the GetManagedHostingEnvironments request. The method will close the
 
363
// http.Response Body if it receives an error.
 
364
func (client ManagedHostingEnvironmentsClient) GetManagedHostingEnvironmentsSender(req *http.Request) (*http.Response, error) {
 
365
        return client.Send(req, http.StatusOK)
 
366
}
 
367
 
 
368
// GetManagedHostingEnvironmentsResponder handles the response to the GetManagedHostingEnvironments request. The method always
 
369
// closes the http.Response Body.
 
370
func (client ManagedHostingEnvironmentsClient) GetManagedHostingEnvironmentsResponder(resp *http.Response) (result HostingEnvironmentCollection, err error) {
 
371
        err = autorest.Respond(
 
372
                resp,
 
373
                client.ByInspecting(),
 
374
                autorest.WithErrorUnlessStatusCode(http.StatusOK),
 
375
                autorest.ByUnmarshallingJSON(&result),
 
376
                autorest.ByClosing())
 
377
        result.Response = autorest.Response{Response: resp}
 
378
        return
 
379
}
 
380
 
 
381
// GetManagedHostingEnvironmentServerFarms sends the get managed hosting
 
382
// environment server farms request.
 
383
//
 
384
// resourceGroupName is name of resource group name is name of managed hosting
 
385
// environment
 
386
func (client ManagedHostingEnvironmentsClient) GetManagedHostingEnvironmentServerFarms(resourceGroupName string, name string) (result ServerFarmCollection, ae error) {
 
387
        req, err := client.GetManagedHostingEnvironmentServerFarmsPreparer(resourceGroupName, name)
 
388
        if err != nil {
 
389
                return result, autorest.NewErrorWithError(err, "web/ManagedHostingEnvironmentsClient", "GetManagedHostingEnvironmentServerFarms", "Failure preparing request")
 
390
        }
 
391
 
 
392
        resp, err := client.GetManagedHostingEnvironmentServerFarmsSender(req)
 
393
        if err != nil {
 
394
                result.Response = autorest.Response{Response: resp}
 
395
                return result, autorest.NewErrorWithError(err, "web/ManagedHostingEnvironmentsClient", "GetManagedHostingEnvironmentServerFarms", "Failure sending request")
 
396
        }
 
397
 
 
398
        result, err = client.GetManagedHostingEnvironmentServerFarmsResponder(resp)
 
399
        if err != nil {
 
400
                ae = autorest.NewErrorWithError(err, "web/ManagedHostingEnvironmentsClient", "GetManagedHostingEnvironmentServerFarms", "Failure responding to request")
 
401
        }
 
402
 
 
403
        return
 
404
}
 
405
 
 
406
// GetManagedHostingEnvironmentServerFarmsPreparer prepares the GetManagedHostingEnvironmentServerFarms request.
 
407
func (client ManagedHostingEnvironmentsClient) GetManagedHostingEnvironmentServerFarmsPreparer(resourceGroupName string, name string) (*http.Request, error) {
 
408
        pathParameters := map[string]interface{}{
 
409
                "name":              url.QueryEscape(name),
 
410
                "resourceGroupName": url.QueryEscape(resourceGroupName),
 
411
                "subscriptionId":    url.QueryEscape(client.SubscriptionID),
 
412
        }
 
413
 
 
414
        queryParameters := map[string]interface{}{
 
415
                "api-version": APIVersion,
 
416
        }
 
417
 
 
418
        return autorest.Prepare(&http.Request{},
 
419
                autorest.AsJSON(),
 
420
                autorest.AsGet(),
 
421
                autorest.WithBaseURL(client.BaseURI),
 
422
                autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/managedHostingEnvironments/{name}/serverfarms"),
 
423
                autorest.WithPathParameters(pathParameters),
 
424
                autorest.WithQueryParameters(queryParameters))
 
425
}
 
426
 
 
427
// GetManagedHostingEnvironmentServerFarmsSender sends the GetManagedHostingEnvironmentServerFarms request. The method will close the
 
428
// http.Response Body if it receives an error.
 
429
func (client ManagedHostingEnvironmentsClient) GetManagedHostingEnvironmentServerFarmsSender(req *http.Request) (*http.Response, error) {
 
430
        return client.Send(req, http.StatusOK)
 
431
}
 
432
 
 
433
// GetManagedHostingEnvironmentServerFarmsResponder handles the response to the GetManagedHostingEnvironmentServerFarms request. The method always
 
434
// closes the http.Response Body.
 
435
func (client ManagedHostingEnvironmentsClient) GetManagedHostingEnvironmentServerFarmsResponder(resp *http.Response) (result ServerFarmCollection, err error) {
 
436
        err = autorest.Respond(
 
437
                resp,
 
438
                client.ByInspecting(),
 
439
                autorest.WithErrorUnlessStatusCode(http.StatusOK),
 
440
                autorest.ByUnmarshallingJSON(&result),
 
441
                autorest.ByClosing())
 
442
        result.Response = autorest.Response{Response: resp}
 
443
        return
 
444
}
 
445
 
 
446
// GetManagedHostingEnvironmentSites sends the get managed hosting environment
 
447
// sites request.
 
448
//
 
449
// resourceGroupName is name of resource group name is name of managed hosting
 
450
// environment propertiesToInclude is comma separated list of site properties
 
451
// to include
 
452
func (client ManagedHostingEnvironmentsClient) GetManagedHostingEnvironmentSites(resourceGroupName string, name string, propertiesToInclude string) (result SiteCollection, ae error) {
 
453
        req, err := client.GetManagedHostingEnvironmentSitesPreparer(resourceGroupName, name, propertiesToInclude)
 
454
        if err != nil {
 
455
                return result, autorest.NewErrorWithError(err, "web/ManagedHostingEnvironmentsClient", "GetManagedHostingEnvironmentSites", "Failure preparing request")
 
456
        }
 
457
 
 
458
        resp, err := client.GetManagedHostingEnvironmentSitesSender(req)
 
459
        if err != nil {
 
460
                result.Response = autorest.Response{Response: resp}
 
461
                return result, autorest.NewErrorWithError(err, "web/ManagedHostingEnvironmentsClient", "GetManagedHostingEnvironmentSites", "Failure sending request")
 
462
        }
 
463
 
 
464
        result, err = client.GetManagedHostingEnvironmentSitesResponder(resp)
 
465
        if err != nil {
 
466
                ae = autorest.NewErrorWithError(err, "web/ManagedHostingEnvironmentsClient", "GetManagedHostingEnvironmentSites", "Failure responding to request")
 
467
        }
 
468
 
 
469
        return
 
470
}
 
471
 
 
472
// GetManagedHostingEnvironmentSitesPreparer prepares the GetManagedHostingEnvironmentSites request.
 
473
func (client ManagedHostingEnvironmentsClient) GetManagedHostingEnvironmentSitesPreparer(resourceGroupName string, name string, propertiesToInclude string) (*http.Request, error) {
 
474
        pathParameters := map[string]interface{}{
 
475
                "name":              url.QueryEscape(name),
 
476
                "resourceGroupName": url.QueryEscape(resourceGroupName),
 
477
                "subscriptionId":    url.QueryEscape(client.SubscriptionID),
 
478
        }
 
479
 
 
480
        queryParameters := map[string]interface{}{
 
481
                "api-version": APIVersion,
 
482
        }
 
483
        if len(propertiesToInclude) > 0 {
 
484
                queryParameters["propertiesToInclude"] = propertiesToInclude
 
485
        }
 
486
 
 
487
        return autorest.Prepare(&http.Request{},
 
488
                autorest.AsJSON(),
 
489
                autorest.AsGet(),
 
490
                autorest.WithBaseURL(client.BaseURI),
 
491
                autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/managedHostingEnvironments/{name}/sites"),
 
492
                autorest.WithPathParameters(pathParameters),
 
493
                autorest.WithQueryParameters(queryParameters))
 
494
}
 
495
 
 
496
// GetManagedHostingEnvironmentSitesSender sends the GetManagedHostingEnvironmentSites request. The method will close the
 
497
// http.Response Body if it receives an error.
 
498
func (client ManagedHostingEnvironmentsClient) GetManagedHostingEnvironmentSitesSender(req *http.Request) (*http.Response, error) {
 
499
        return client.Send(req, http.StatusOK)
 
500
}
 
501
 
 
502
// GetManagedHostingEnvironmentSitesResponder handles the response to the GetManagedHostingEnvironmentSites request. The method always
 
503
// closes the http.Response Body.
 
504
func (client ManagedHostingEnvironmentsClient) GetManagedHostingEnvironmentSitesResponder(resp *http.Response) (result SiteCollection, err error) {
 
505
        err = autorest.Respond(
 
506
                resp,
 
507
                client.ByInspecting(),
 
508
                autorest.WithErrorUnlessStatusCode(http.StatusOK),
 
509
                autorest.ByUnmarshallingJSON(&result),
 
510
                autorest.ByClosing())
 
511
        result.Response = autorest.Response{Response: resp}
 
512
        return
 
513
}
 
514
 
 
515
// GetManagedHostingEnvironmentVips sends the get managed hosting environment
 
516
// vips request.
 
517
//
 
518
// resourceGroupName is name of resource group name is name of managed hosting
 
519
// environment
 
520
func (client ManagedHostingEnvironmentsClient) GetManagedHostingEnvironmentVips(resourceGroupName string, name string) (result AddressResponse, ae error) {
 
521
        req, err := client.GetManagedHostingEnvironmentVipsPreparer(resourceGroupName, name)
 
522
        if err != nil {
 
523
                return result, autorest.NewErrorWithError(err, "web/ManagedHostingEnvironmentsClient", "GetManagedHostingEnvironmentVips", "Failure preparing request")
 
524
        }
 
525
 
 
526
        resp, err := client.GetManagedHostingEnvironmentVipsSender(req)
 
527
        if err != nil {
 
528
                result.Response = autorest.Response{Response: resp}
 
529
                return result, autorest.NewErrorWithError(err, "web/ManagedHostingEnvironmentsClient", "GetManagedHostingEnvironmentVips", "Failure sending request")
 
530
        }
 
531
 
 
532
        result, err = client.GetManagedHostingEnvironmentVipsResponder(resp)
 
533
        if err != nil {
 
534
                ae = autorest.NewErrorWithError(err, "web/ManagedHostingEnvironmentsClient", "GetManagedHostingEnvironmentVips", "Failure responding to request")
 
535
        }
 
536
 
 
537
        return
 
538
}
 
539
 
 
540
// GetManagedHostingEnvironmentVipsPreparer prepares the GetManagedHostingEnvironmentVips request.
 
541
func (client ManagedHostingEnvironmentsClient) GetManagedHostingEnvironmentVipsPreparer(resourceGroupName string, name string) (*http.Request, error) {
 
542
        pathParameters := map[string]interface{}{
 
543
                "name":              url.QueryEscape(name),
 
544
                "resourceGroupName": url.QueryEscape(resourceGroupName),
 
545
                "subscriptionId":    url.QueryEscape(client.SubscriptionID),
 
546
        }
 
547
 
 
548
        queryParameters := map[string]interface{}{
 
549
                "api-version": APIVersion,
 
550
        }
 
551
 
 
552
        return autorest.Prepare(&http.Request{},
 
553
                autorest.AsJSON(),
 
554
                autorest.AsGet(),
 
555
                autorest.WithBaseURL(client.BaseURI),
 
556
                autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/managedHostingEnvironments/{name}/capacities/virtualip"),
 
557
                autorest.WithPathParameters(pathParameters),
 
558
                autorest.WithQueryParameters(queryParameters))
 
559
}
 
560
 
 
561
// GetManagedHostingEnvironmentVipsSender sends the GetManagedHostingEnvironmentVips request. The method will close the
 
562
// http.Response Body if it receives an error.
 
563
func (client ManagedHostingEnvironmentsClient) GetManagedHostingEnvironmentVipsSender(req *http.Request) (*http.Response, error) {
 
564
        return client.Send(req, http.StatusOK)
 
565
}
 
566
 
 
567
// GetManagedHostingEnvironmentVipsResponder handles the response to the GetManagedHostingEnvironmentVips request. The method always
 
568
// closes the http.Response Body.
 
569
func (client ManagedHostingEnvironmentsClient) GetManagedHostingEnvironmentVipsResponder(resp *http.Response) (result AddressResponse, err error) {
 
570
        err = autorest.Respond(
 
571
                resp,
 
572
                client.ByInspecting(),
 
573
                autorest.WithErrorUnlessStatusCode(http.StatusOK),
 
574
                autorest.ByUnmarshallingJSON(&result),
 
575
                autorest.ByClosing())
 
576
        result.Response = autorest.Response{Response: resp}
 
577
        return
 
578
}
 
579
 
 
580
// GetManagedHostingEnvironmentWebHostingPlans sends the get managed hosting
 
581
// environment web hosting plans request.
 
582
//
 
583
// resourceGroupName is name of resource group name is name of managed hosting
 
584
// environment
 
585
func (client ManagedHostingEnvironmentsClient) GetManagedHostingEnvironmentWebHostingPlans(resourceGroupName string, name string) (result ServerFarmCollection, ae error) {
 
586
        req, err := client.GetManagedHostingEnvironmentWebHostingPlansPreparer(resourceGroupName, name)
 
587
        if err != nil {
 
588
                return result, autorest.NewErrorWithError(err, "web/ManagedHostingEnvironmentsClient", "GetManagedHostingEnvironmentWebHostingPlans", "Failure preparing request")
 
589
        }
 
590
 
 
591
        resp, err := client.GetManagedHostingEnvironmentWebHostingPlansSender(req)
 
592
        if err != nil {
 
593
                result.Response = autorest.Response{Response: resp}
 
594
                return result, autorest.NewErrorWithError(err, "web/ManagedHostingEnvironmentsClient", "GetManagedHostingEnvironmentWebHostingPlans", "Failure sending request")
 
595
        }
 
596
 
 
597
        result, err = client.GetManagedHostingEnvironmentWebHostingPlansResponder(resp)
 
598
        if err != nil {
 
599
                ae = autorest.NewErrorWithError(err, "web/ManagedHostingEnvironmentsClient", "GetManagedHostingEnvironmentWebHostingPlans", "Failure responding to request")
 
600
        }
 
601
 
 
602
        return
 
603
}
 
604
 
 
605
// GetManagedHostingEnvironmentWebHostingPlansPreparer prepares the GetManagedHostingEnvironmentWebHostingPlans request.
 
606
func (client ManagedHostingEnvironmentsClient) GetManagedHostingEnvironmentWebHostingPlansPreparer(resourceGroupName string, name string) (*http.Request, error) {
 
607
        pathParameters := map[string]interface{}{
 
608
                "name":              url.QueryEscape(name),
 
609
                "resourceGroupName": url.QueryEscape(resourceGroupName),
 
610
                "subscriptionId":    url.QueryEscape(client.SubscriptionID),
 
611
        }
 
612
 
 
613
        queryParameters := map[string]interface{}{
 
614
                "api-version": APIVersion,
 
615
        }
 
616
 
 
617
        return autorest.Prepare(&http.Request{},
 
618
                autorest.AsJSON(),
 
619
                autorest.AsGet(),
 
620
                autorest.WithBaseURL(client.BaseURI),
 
621
                autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/managedHostingEnvironments/{name}/webhostingplans"),
 
622
                autorest.WithPathParameters(pathParameters),
 
623
                autorest.WithQueryParameters(queryParameters))
 
624
}
 
625
 
 
626
// GetManagedHostingEnvironmentWebHostingPlansSender sends the GetManagedHostingEnvironmentWebHostingPlans request. The method will close the
 
627
// http.Response Body if it receives an error.
 
628
func (client ManagedHostingEnvironmentsClient) GetManagedHostingEnvironmentWebHostingPlansSender(req *http.Request) (*http.Response, error) {
 
629
        return client.Send(req, http.StatusOK)
 
630
}
 
631
 
 
632
// GetManagedHostingEnvironmentWebHostingPlansResponder handles the response to the GetManagedHostingEnvironmentWebHostingPlans request. The method always
 
633
// closes the http.Response Body.
 
634
func (client ManagedHostingEnvironmentsClient) GetManagedHostingEnvironmentWebHostingPlansResponder(resp *http.Response) (result ServerFarmCollection, err error) {
 
635
        err = autorest.Respond(
 
636
                resp,
 
637
                client.ByInspecting(),
 
638
                autorest.WithErrorUnlessStatusCode(http.StatusOK),
 
639
                autorest.ByUnmarshallingJSON(&result),
 
640
                autorest.ByClosing())
 
641
        result.Response = autorest.Response{Response: resp}
 
642
        return
 
643
}