3
// Copyright (c) Microsoft and contributors. All rights reserved.
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
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.
14
// See the License for the specific language governing permissions and
15
// limitations under the License.
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
22
"github.com/Azure/azure-sdk-for-go/Godeps/_workspace/src/github.com/Azure/go-autorest/autorest"
27
// ProviderClient 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 ProviderClient struct {
39
// NewProviderClient creates an instance of the ProviderClient client.
40
func NewProviderClient(subscriptionID string) ProviderClient {
41
return NewProviderClientWithBaseURI(DefaultBaseURI, subscriptionID)
44
// NewProviderClientWithBaseURI creates an instance of the ProviderClient
46
func NewProviderClientWithBaseURI(baseURI string, subscriptionID string) ProviderClient {
47
return ProviderClient{NewWithBaseURI(baseURI, subscriptionID)}
50
// GetPublishingUser sends the get publishing user request.
51
func (client ProviderClient) GetPublishingUser() (result User, ae error) {
52
req, err := client.GetPublishingUserPreparer()
54
return result, autorest.NewErrorWithError(err, "web/ProviderClient", "GetPublishingUser", "Failure preparing request")
57
resp, err := client.GetPublishingUserSender(req)
59
result.Response = autorest.Response{Response: resp}
60
return result, autorest.NewErrorWithError(err, "web/ProviderClient", "GetPublishingUser", "Failure sending request")
63
result, err = client.GetPublishingUserResponder(resp)
65
ae = autorest.NewErrorWithError(err, "web/ProviderClient", "GetPublishingUser", "Failure responding to request")
71
// GetPublishingUserPreparer prepares the GetPublishingUser request.
72
func (client ProviderClient) GetPublishingUserPreparer() (*http.Request, error) {
73
queryParameters := map[string]interface{}{
74
"api-version": APIVersion,
77
return autorest.Prepare(&http.Request{},
80
autorest.WithBaseURL(client.BaseURI),
81
autorest.WithPath("/providers/Microsoft.Web/publishingUsers/web"),
82
autorest.WithQueryParameters(queryParameters))
85
// GetPublishingUserSender sends the GetPublishingUser request. The method will close the
86
// http.Response Body if it receives an error.
87
func (client ProviderClient) GetPublishingUserSender(req *http.Request) (*http.Response, error) {
88
return client.Send(req, http.StatusOK)
91
// GetPublishingUserResponder handles the response to the GetPublishingUser request. The method always
92
// closes the http.Response Body.
93
func (client ProviderClient) GetPublishingUserResponder(resp *http.Response) (result User, err error) {
94
err = autorest.Respond(
96
client.ByInspecting(),
97
autorest.WithErrorUnlessStatusCode(http.StatusOK),
98
autorest.ByUnmarshallingJSON(&result),
100
result.Response = autorest.Response{Response: resp}
104
// GetSourceControl sends the get source control request.
106
// sourceControlType is type of source control
107
func (client ProviderClient) GetSourceControl(sourceControlType string) (result SourceControl, ae error) {
108
req, err := client.GetSourceControlPreparer(sourceControlType)
110
return result, autorest.NewErrorWithError(err, "web/ProviderClient", "GetSourceControl", "Failure preparing request")
113
resp, err := client.GetSourceControlSender(req)
115
result.Response = autorest.Response{Response: resp}
116
return result, autorest.NewErrorWithError(err, "web/ProviderClient", "GetSourceControl", "Failure sending request")
119
result, err = client.GetSourceControlResponder(resp)
121
ae = autorest.NewErrorWithError(err, "web/ProviderClient", "GetSourceControl", "Failure responding to request")
127
// GetSourceControlPreparer prepares the GetSourceControl request.
128
func (client ProviderClient) GetSourceControlPreparer(sourceControlType string) (*http.Request, error) {
129
pathParameters := map[string]interface{}{
130
"sourceControlType": url.QueryEscape(sourceControlType),
133
queryParameters := map[string]interface{}{
134
"api-version": APIVersion,
137
return autorest.Prepare(&http.Request{},
140
autorest.WithBaseURL(client.BaseURI),
141
autorest.WithPath("/providers/Microsoft.Web/sourcecontrols/{sourceControlType}"),
142
autorest.WithPathParameters(pathParameters),
143
autorest.WithQueryParameters(queryParameters))
146
// GetSourceControlSender sends the GetSourceControl request. The method will close the
147
// http.Response Body if it receives an error.
148
func (client ProviderClient) GetSourceControlSender(req *http.Request) (*http.Response, error) {
149
return client.Send(req, http.StatusOK)
152
// GetSourceControlResponder handles the response to the GetSourceControl request. The method always
153
// closes the http.Response Body.
154
func (client ProviderClient) GetSourceControlResponder(resp *http.Response) (result SourceControl, err error) {
155
err = autorest.Respond(
157
client.ByInspecting(),
158
autorest.WithErrorUnlessStatusCode(http.StatusOK),
159
autorest.ByUnmarshallingJSON(&result),
160
autorest.ByClosing())
161
result.Response = autorest.Response{Response: resp}
165
// GetSourceControls sends the get source controls request.
166
func (client ProviderClient) GetSourceControls() (result SourceControlCollection, ae error) {
167
req, err := client.GetSourceControlsPreparer()
169
return result, autorest.NewErrorWithError(err, "web/ProviderClient", "GetSourceControls", "Failure preparing request")
172
resp, err := client.GetSourceControlsSender(req)
174
result.Response = autorest.Response{Response: resp}
175
return result, autorest.NewErrorWithError(err, "web/ProviderClient", "GetSourceControls", "Failure sending request")
178
result, err = client.GetSourceControlsResponder(resp)
180
ae = autorest.NewErrorWithError(err, "web/ProviderClient", "GetSourceControls", "Failure responding to request")
186
// GetSourceControlsPreparer prepares the GetSourceControls request.
187
func (client ProviderClient) GetSourceControlsPreparer() (*http.Request, error) {
188
queryParameters := map[string]interface{}{
189
"api-version": APIVersion,
192
return autorest.Prepare(&http.Request{},
195
autorest.WithBaseURL(client.BaseURI),
196
autorest.WithPath("/providers/Microsoft.Web/sourcecontrols"),
197
autorest.WithQueryParameters(queryParameters))
200
// GetSourceControlsSender sends the GetSourceControls request. The method will close the
201
// http.Response Body if it receives an error.
202
func (client ProviderClient) GetSourceControlsSender(req *http.Request) (*http.Response, error) {
203
return client.Send(req, http.StatusOK)
206
// GetSourceControlsResponder handles the response to the GetSourceControls request. The method always
207
// closes the http.Response Body.
208
func (client ProviderClient) GetSourceControlsResponder(resp *http.Response) (result SourceControlCollection, err error) {
209
err = autorest.Respond(
211
client.ByInspecting(),
212
autorest.WithErrorUnlessStatusCode(http.StatusOK),
213
autorest.ByUnmarshallingJSON(&result),
214
autorest.ByClosing())
215
result.Response = autorest.Response{Response: resp}
219
// UpdatePublishingUser sends the update publishing user request.
221
// requestMessage is details of publishing user
222
func (client ProviderClient) UpdatePublishingUser(requestMessage User) (result User, ae error) {
223
req, err := client.UpdatePublishingUserPreparer(requestMessage)
225
return result, autorest.NewErrorWithError(err, "web/ProviderClient", "UpdatePublishingUser", "Failure preparing request")
228
resp, err := client.UpdatePublishingUserSender(req)
230
result.Response = autorest.Response{Response: resp}
231
return result, autorest.NewErrorWithError(err, "web/ProviderClient", "UpdatePublishingUser", "Failure sending request")
234
result, err = client.UpdatePublishingUserResponder(resp)
236
ae = autorest.NewErrorWithError(err, "web/ProviderClient", "UpdatePublishingUser", "Failure responding to request")
242
// UpdatePublishingUserPreparer prepares the UpdatePublishingUser request.
243
func (client ProviderClient) UpdatePublishingUserPreparer(requestMessage User) (*http.Request, error) {
244
queryParameters := map[string]interface{}{
245
"api-version": APIVersion,
248
return autorest.Prepare(&http.Request{},
251
autorest.WithBaseURL(client.BaseURI),
252
autorest.WithPath("/providers/Microsoft.Web/publishingUsers/web"),
253
autorest.WithJSON(requestMessage),
254
autorest.WithQueryParameters(queryParameters))
257
// UpdatePublishingUserSender sends the UpdatePublishingUser request. The method will close the
258
// http.Response Body if it receives an error.
259
func (client ProviderClient) UpdatePublishingUserSender(req *http.Request) (*http.Response, error) {
260
return client.Send(req, http.StatusOK)
263
// UpdatePublishingUserResponder handles the response to the UpdatePublishingUser request. The method always
264
// closes the http.Response Body.
265
func (client ProviderClient) UpdatePublishingUserResponder(resp *http.Response) (result User, err error) {
266
err = autorest.Respond(
268
client.ByInspecting(),
269
autorest.WithErrorUnlessStatusCode(http.StatusOK),
270
autorest.ByUnmarshallingJSON(&result),
271
autorest.ByClosing())
272
result.Response = autorest.Response{Response: resp}
276
// UpdateSourceControl sends the update source control request.
278
// sourceControlType is type of source control requestMessage is source
279
// control token information
280
func (client ProviderClient) UpdateSourceControl(sourceControlType string, requestMessage SourceControl) (result SourceControl, ae error) {
281
req, err := client.UpdateSourceControlPreparer(sourceControlType, requestMessage)
283
return result, autorest.NewErrorWithError(err, "web/ProviderClient", "UpdateSourceControl", "Failure preparing request")
286
resp, err := client.UpdateSourceControlSender(req)
288
result.Response = autorest.Response{Response: resp}
289
return result, autorest.NewErrorWithError(err, "web/ProviderClient", "UpdateSourceControl", "Failure sending request")
292
result, err = client.UpdateSourceControlResponder(resp)
294
ae = autorest.NewErrorWithError(err, "web/ProviderClient", "UpdateSourceControl", "Failure responding to request")
300
// UpdateSourceControlPreparer prepares the UpdateSourceControl request.
301
func (client ProviderClient) UpdateSourceControlPreparer(sourceControlType string, requestMessage SourceControl) (*http.Request, error) {
302
pathParameters := map[string]interface{}{
303
"sourceControlType": url.QueryEscape(sourceControlType),
306
queryParameters := map[string]interface{}{
307
"api-version": APIVersion,
310
return autorest.Prepare(&http.Request{},
313
autorest.WithBaseURL(client.BaseURI),
314
autorest.WithPath("/providers/Microsoft.Web/sourcecontrols/{sourceControlType}"),
315
autorest.WithJSON(requestMessage),
316
autorest.WithPathParameters(pathParameters),
317
autorest.WithQueryParameters(queryParameters))
320
// UpdateSourceControlSender sends the UpdateSourceControl request. The method will close the
321
// http.Response Body if it receives an error.
322
func (client ProviderClient) UpdateSourceControlSender(req *http.Request) (*http.Response, error) {
323
return client.Send(req, http.StatusOK)
326
// UpdateSourceControlResponder handles the response to the UpdateSourceControl request. The method always
327
// closes the http.Response Body.
328
func (client ProviderClient) UpdateSourceControlResponder(resp *http.Response) (result SourceControl, err error) {
329
err = autorest.Respond(
331
client.ByInspecting(),
332
autorest.WithErrorUnlessStatusCode(http.StatusOK),
333
autorest.ByUnmarshallingJSON(&result),
334
autorest.ByClosing())
335
result.Response = autorest.Response{Response: resp}