1package graphrbac
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.
18// Changes may cause incorrect behavior and will be lost if the code is regenerated.
19
20import (
21	"context"
22	"github.com/Azure/go-autorest/autorest"
23	"github.com/Azure/go-autorest/autorest/azure"
24	"github.com/Azure/go-autorest/autorest/to"
25	"github.com/Azure/go-autorest/autorest/validation"
26	"github.com/Azure/go-autorest/tracing"
27	"net/http"
28)
29
30// UsersClient is the the Graph RBAC Management Client
31type UsersClient struct {
32	BaseClient
33}
34
35// NewUsersClient creates an instance of the UsersClient client.
36func NewUsersClient(tenantID string) UsersClient {
37	return NewUsersClientWithBaseURI(DefaultBaseURI, tenantID)
38}
39
40// NewUsersClientWithBaseURI creates an instance of the UsersClient client using a custom endpoint.  Use this when
41// interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack).
42func NewUsersClientWithBaseURI(baseURI string, tenantID string) UsersClient {
43	return UsersClient{NewWithBaseURI(baseURI, tenantID)}
44}
45
46// Create create a new user.
47// Parameters:
48// parameters - parameters to create a user.
49func (client UsersClient) Create(ctx context.Context, parameters UserCreateParameters) (result User, err error) {
50	if tracing.IsEnabled() {
51		ctx = tracing.StartSpan(ctx, fqdn+"/UsersClient.Create")
52		defer func() {
53			sc := -1
54			if result.Response.Response != nil {
55				sc = result.Response.Response.StatusCode
56			}
57			tracing.EndSpan(ctx, sc, err)
58		}()
59	}
60	if err := validation.Validate([]validation.Validation{
61		{TargetValue: parameters,
62			Constraints: []validation.Constraint{{Target: "parameters.AccountEnabled", Name: validation.Null, Rule: true, Chain: nil},
63				{Target: "parameters.DisplayName", Name: validation.Null, Rule: true, Chain: nil},
64				{Target: "parameters.PasswordProfile", Name: validation.Null, Rule: true,
65					Chain: []validation.Constraint{{Target: "parameters.PasswordProfile.Password", Name: validation.Null, Rule: true, Chain: nil}}},
66				{Target: "parameters.UserPrincipalName", Name: validation.Null, Rule: true, Chain: nil},
67				{Target: "parameters.MailNickname", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
68		return result, validation.NewError("graphrbac.UsersClient", "Create", err.Error())
69	}
70
71	req, err := client.CreatePreparer(ctx, parameters)
72	if err != nil {
73		err = autorest.NewErrorWithError(err, "graphrbac.UsersClient", "Create", nil, "Failure preparing request")
74		return
75	}
76
77	resp, err := client.CreateSender(req)
78	if err != nil {
79		result.Response = autorest.Response{Response: resp}
80		err = autorest.NewErrorWithError(err, "graphrbac.UsersClient", "Create", resp, "Failure sending request")
81		return
82	}
83
84	result, err = client.CreateResponder(resp)
85	if err != nil {
86		err = autorest.NewErrorWithError(err, "graphrbac.UsersClient", "Create", resp, "Failure responding to request")
87	}
88
89	return
90}
91
92// CreatePreparer prepares the Create request.
93func (client UsersClient) CreatePreparer(ctx context.Context, parameters UserCreateParameters) (*http.Request, error) {
94	pathParameters := map[string]interface{}{
95		"tenantID": autorest.Encode("path", client.TenantID),
96	}
97
98	const APIVersion = "1.6"
99	queryParameters := map[string]interface{}{
100		"api-version": APIVersion,
101	}
102
103	preparer := autorest.CreatePreparer(
104		autorest.AsContentType("application/json; charset=utf-8"),
105		autorest.AsPost(),
106		autorest.WithBaseURL(client.BaseURI),
107		autorest.WithPathParameters("/{tenantID}/users", pathParameters),
108		autorest.WithJSON(parameters),
109		autorest.WithQueryParameters(queryParameters))
110	return preparer.Prepare((&http.Request{}).WithContext(ctx))
111}
112
113// CreateSender sends the Create request. The method will close the
114// http.Response Body if it receives an error.
115func (client UsersClient) CreateSender(req *http.Request) (*http.Response, error) {
116	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
117}
118
119// CreateResponder handles the response to the Create request. The method always
120// closes the http.Response Body.
121func (client UsersClient) CreateResponder(resp *http.Response) (result User, err error) {
122	err = autorest.Respond(
123		resp,
124		client.ByInspecting(),
125		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
126		autorest.ByUnmarshallingJSON(&result),
127		autorest.ByClosing())
128	result.Response = autorest.Response{Response: resp}
129	return
130}
131
132// Delete delete a user.
133// Parameters:
134// upnOrObjectID - the object ID or principal name of the user to delete.
135func (client UsersClient) Delete(ctx context.Context, upnOrObjectID string) (result autorest.Response, err error) {
136	if tracing.IsEnabled() {
137		ctx = tracing.StartSpan(ctx, fqdn+"/UsersClient.Delete")
138		defer func() {
139			sc := -1
140			if result.Response != nil {
141				sc = result.Response.StatusCode
142			}
143			tracing.EndSpan(ctx, sc, err)
144		}()
145	}
146	req, err := client.DeletePreparer(ctx, upnOrObjectID)
147	if err != nil {
148		err = autorest.NewErrorWithError(err, "graphrbac.UsersClient", "Delete", nil, "Failure preparing request")
149		return
150	}
151
152	resp, err := client.DeleteSender(req)
153	if err != nil {
154		result.Response = resp
155		err = autorest.NewErrorWithError(err, "graphrbac.UsersClient", "Delete", resp, "Failure sending request")
156		return
157	}
158
159	result, err = client.DeleteResponder(resp)
160	if err != nil {
161		err = autorest.NewErrorWithError(err, "graphrbac.UsersClient", "Delete", resp, "Failure responding to request")
162	}
163
164	return
165}
166
167// DeletePreparer prepares the Delete request.
168func (client UsersClient) DeletePreparer(ctx context.Context, upnOrObjectID string) (*http.Request, error) {
169	pathParameters := map[string]interface{}{
170		"tenantID":      autorest.Encode("path", client.TenantID),
171		"upnOrObjectId": autorest.Encode("path", upnOrObjectID),
172	}
173
174	const APIVersion = "1.6"
175	queryParameters := map[string]interface{}{
176		"api-version": APIVersion,
177	}
178
179	preparer := autorest.CreatePreparer(
180		autorest.AsDelete(),
181		autorest.WithBaseURL(client.BaseURI),
182		autorest.WithPathParameters("/{tenantID}/users/{upnOrObjectId}", pathParameters),
183		autorest.WithQueryParameters(queryParameters))
184	return preparer.Prepare((&http.Request{}).WithContext(ctx))
185}
186
187// DeleteSender sends the Delete request. The method will close the
188// http.Response Body if it receives an error.
189func (client UsersClient) DeleteSender(req *http.Request) (*http.Response, error) {
190	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
191}
192
193// DeleteResponder handles the response to the Delete request. The method always
194// closes the http.Response Body.
195func (client UsersClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
196	err = autorest.Respond(
197		resp,
198		client.ByInspecting(),
199		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
200		autorest.ByClosing())
201	result.Response = resp
202	return
203}
204
205// Get gets user information from the directory.
206// Parameters:
207// upnOrObjectID - the object ID or principal name of the user for which to get information.
208func (client UsersClient) Get(ctx context.Context, upnOrObjectID string) (result User, err error) {
209	if tracing.IsEnabled() {
210		ctx = tracing.StartSpan(ctx, fqdn+"/UsersClient.Get")
211		defer func() {
212			sc := -1
213			if result.Response.Response != nil {
214				sc = result.Response.Response.StatusCode
215			}
216			tracing.EndSpan(ctx, sc, err)
217		}()
218	}
219	req, err := client.GetPreparer(ctx, upnOrObjectID)
220	if err != nil {
221		err = autorest.NewErrorWithError(err, "graphrbac.UsersClient", "Get", nil, "Failure preparing request")
222		return
223	}
224
225	resp, err := client.GetSender(req)
226	if err != nil {
227		result.Response = autorest.Response{Response: resp}
228		err = autorest.NewErrorWithError(err, "graphrbac.UsersClient", "Get", resp, "Failure sending request")
229		return
230	}
231
232	result, err = client.GetResponder(resp)
233	if err != nil {
234		err = autorest.NewErrorWithError(err, "graphrbac.UsersClient", "Get", resp, "Failure responding to request")
235	}
236
237	return
238}
239
240// GetPreparer prepares the Get request.
241func (client UsersClient) GetPreparer(ctx context.Context, upnOrObjectID string) (*http.Request, error) {
242	pathParameters := map[string]interface{}{
243		"tenantID":      autorest.Encode("path", client.TenantID),
244		"upnOrObjectId": autorest.Encode("path", upnOrObjectID),
245	}
246
247	const APIVersion = "1.6"
248	queryParameters := map[string]interface{}{
249		"api-version": APIVersion,
250	}
251
252	preparer := autorest.CreatePreparer(
253		autorest.AsGet(),
254		autorest.WithBaseURL(client.BaseURI),
255		autorest.WithPathParameters("/{tenantID}/users/{upnOrObjectId}", pathParameters),
256		autorest.WithQueryParameters(queryParameters))
257	return preparer.Prepare((&http.Request{}).WithContext(ctx))
258}
259
260// GetSender sends the Get request. The method will close the
261// http.Response Body if it receives an error.
262func (client UsersClient) GetSender(req *http.Request) (*http.Response, error) {
263	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
264}
265
266// GetResponder handles the response to the Get request. The method always
267// closes the http.Response Body.
268func (client UsersClient) GetResponder(resp *http.Response) (result User, err error) {
269	err = autorest.Respond(
270		resp,
271		client.ByInspecting(),
272		azure.WithErrorUnlessStatusCode(http.StatusOK),
273		autorest.ByUnmarshallingJSON(&result),
274		autorest.ByClosing())
275	result.Response = autorest.Response{Response: resp}
276	return
277}
278
279// GetMemberGroups gets a collection that contains the object IDs of the groups of which the user is a member.
280// Parameters:
281// objectID - the object ID of the user for which to get group membership.
282// parameters - user filtering parameters.
283func (client UsersClient) GetMemberGroups(ctx context.Context, objectID string, parameters UserGetMemberGroupsParameters) (result UserGetMemberGroupsResult, err error) {
284	if tracing.IsEnabled() {
285		ctx = tracing.StartSpan(ctx, fqdn+"/UsersClient.GetMemberGroups")
286		defer func() {
287			sc := -1
288			if result.Response.Response != nil {
289				sc = result.Response.Response.StatusCode
290			}
291			tracing.EndSpan(ctx, sc, err)
292		}()
293	}
294	if err := validation.Validate([]validation.Validation{
295		{TargetValue: parameters,
296			Constraints: []validation.Constraint{{Target: "parameters.SecurityEnabledOnly", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
297		return result, validation.NewError("graphrbac.UsersClient", "GetMemberGroups", err.Error())
298	}
299
300	req, err := client.GetMemberGroupsPreparer(ctx, objectID, parameters)
301	if err != nil {
302		err = autorest.NewErrorWithError(err, "graphrbac.UsersClient", "GetMemberGroups", nil, "Failure preparing request")
303		return
304	}
305
306	resp, err := client.GetMemberGroupsSender(req)
307	if err != nil {
308		result.Response = autorest.Response{Response: resp}
309		err = autorest.NewErrorWithError(err, "graphrbac.UsersClient", "GetMemberGroups", resp, "Failure sending request")
310		return
311	}
312
313	result, err = client.GetMemberGroupsResponder(resp)
314	if err != nil {
315		err = autorest.NewErrorWithError(err, "graphrbac.UsersClient", "GetMemberGroups", resp, "Failure responding to request")
316	}
317
318	return
319}
320
321// GetMemberGroupsPreparer prepares the GetMemberGroups request.
322func (client UsersClient) GetMemberGroupsPreparer(ctx context.Context, objectID string, parameters UserGetMemberGroupsParameters) (*http.Request, error) {
323	pathParameters := map[string]interface{}{
324		"objectId": autorest.Encode("path", objectID),
325		"tenantID": autorest.Encode("path", client.TenantID),
326	}
327
328	const APIVersion = "1.6"
329	queryParameters := map[string]interface{}{
330		"api-version": APIVersion,
331	}
332
333	preparer := autorest.CreatePreparer(
334		autorest.AsContentType("application/json; charset=utf-8"),
335		autorest.AsPost(),
336		autorest.WithBaseURL(client.BaseURI),
337		autorest.WithPathParameters("/{tenantID}/users/{objectId}/getMemberGroups", pathParameters),
338		autorest.WithJSON(parameters),
339		autorest.WithQueryParameters(queryParameters))
340	return preparer.Prepare((&http.Request{}).WithContext(ctx))
341}
342
343// GetMemberGroupsSender sends the GetMemberGroups request. The method will close the
344// http.Response Body if it receives an error.
345func (client UsersClient) GetMemberGroupsSender(req *http.Request) (*http.Response, error) {
346	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
347}
348
349// GetMemberGroupsResponder handles the response to the GetMemberGroups request. The method always
350// closes the http.Response Body.
351func (client UsersClient) GetMemberGroupsResponder(resp *http.Response) (result UserGetMemberGroupsResult, err error) {
352	err = autorest.Respond(
353		resp,
354		client.ByInspecting(),
355		azure.WithErrorUnlessStatusCode(http.StatusOK),
356		autorest.ByUnmarshallingJSON(&result),
357		autorest.ByClosing())
358	result.Response = autorest.Response{Response: resp}
359	return
360}
361
362// List gets list of users for the current tenant.
363// Parameters:
364// filter - the filter to apply to the operation.
365// expand - the expand value for the operation result.
366func (client UsersClient) List(ctx context.Context, filter string, expand string) (result UserListResultPage, err error) {
367	if tracing.IsEnabled() {
368		ctx = tracing.StartSpan(ctx, fqdn+"/UsersClient.List")
369		defer func() {
370			sc := -1
371			if result.ulr.Response.Response != nil {
372				sc = result.ulr.Response.Response.StatusCode
373			}
374			tracing.EndSpan(ctx, sc, err)
375		}()
376	}
377	result.fn = func(ctx context.Context, lastResult UserListResult) (UserListResult, error) {
378		if lastResult.OdataNextLink == nil || len(to.String(lastResult.OdataNextLink)) < 1 {
379			return UserListResult{}, nil
380		}
381		return client.ListNext(ctx, *lastResult.OdataNextLink)
382	}
383	req, err := client.ListPreparer(ctx, filter, expand)
384	if err != nil {
385		err = autorest.NewErrorWithError(err, "graphrbac.UsersClient", "List", nil, "Failure preparing request")
386		return
387	}
388
389	resp, err := client.ListSender(req)
390	if err != nil {
391		result.ulr.Response = autorest.Response{Response: resp}
392		err = autorest.NewErrorWithError(err, "graphrbac.UsersClient", "List", resp, "Failure sending request")
393		return
394	}
395
396	result.ulr, err = client.ListResponder(resp)
397	if err != nil {
398		err = autorest.NewErrorWithError(err, "graphrbac.UsersClient", "List", resp, "Failure responding to request")
399	}
400
401	return
402}
403
404// ListPreparer prepares the List request.
405func (client UsersClient) ListPreparer(ctx context.Context, filter string, expand string) (*http.Request, error) {
406	pathParameters := map[string]interface{}{
407		"tenantID": autorest.Encode("path", client.TenantID),
408	}
409
410	const APIVersion = "1.6"
411	queryParameters := map[string]interface{}{
412		"api-version": APIVersion,
413	}
414	if len(filter) > 0 {
415		queryParameters["$filter"] = autorest.Encode("query", filter)
416	}
417	if len(expand) > 0 {
418		queryParameters["$expand"] = autorest.Encode("query", expand)
419	}
420
421	preparer := autorest.CreatePreparer(
422		autorest.AsGet(),
423		autorest.WithBaseURL(client.BaseURI),
424		autorest.WithPathParameters("/{tenantID}/users", pathParameters),
425		autorest.WithQueryParameters(queryParameters))
426	return preparer.Prepare((&http.Request{}).WithContext(ctx))
427}
428
429// ListSender sends the List request. The method will close the
430// http.Response Body if it receives an error.
431func (client UsersClient) ListSender(req *http.Request) (*http.Response, error) {
432	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
433}
434
435// ListResponder handles the response to the List request. The method always
436// closes the http.Response Body.
437func (client UsersClient) ListResponder(resp *http.Response) (result UserListResult, err error) {
438	err = autorest.Respond(
439		resp,
440		client.ByInspecting(),
441		azure.WithErrorUnlessStatusCode(http.StatusOK),
442		autorest.ByUnmarshallingJSON(&result),
443		autorest.ByClosing())
444	result.Response = autorest.Response{Response: resp}
445	return
446}
447
448// ListComplete enumerates all values, automatically crossing page boundaries as required.
449func (client UsersClient) ListComplete(ctx context.Context, filter string, expand string) (result UserListResultIterator, err error) {
450	if tracing.IsEnabled() {
451		ctx = tracing.StartSpan(ctx, fqdn+"/UsersClient.List")
452		defer func() {
453			sc := -1
454			if result.Response().Response.Response != nil {
455				sc = result.page.Response().Response.Response.StatusCode
456			}
457			tracing.EndSpan(ctx, sc, err)
458		}()
459	}
460	result.page, err = client.List(ctx, filter, expand)
461	return
462}
463
464// ListNext gets a list of users for the current tenant.
465// Parameters:
466// nextLink - next link for the list operation.
467func (client UsersClient) ListNext(ctx context.Context, nextLink string) (result UserListResult, err error) {
468	if tracing.IsEnabled() {
469		ctx = tracing.StartSpan(ctx, fqdn+"/UsersClient.ListNext")
470		defer func() {
471			sc := -1
472			if result.Response.Response != nil {
473				sc = result.Response.Response.StatusCode
474			}
475			tracing.EndSpan(ctx, sc, err)
476		}()
477	}
478	req, err := client.ListNextPreparer(ctx, nextLink)
479	if err != nil {
480		err = autorest.NewErrorWithError(err, "graphrbac.UsersClient", "ListNext", nil, "Failure preparing request")
481		return
482	}
483
484	resp, err := client.ListNextSender(req)
485	if err != nil {
486		result.Response = autorest.Response{Response: resp}
487		err = autorest.NewErrorWithError(err, "graphrbac.UsersClient", "ListNext", resp, "Failure sending request")
488		return
489	}
490
491	result, err = client.ListNextResponder(resp)
492	if err != nil {
493		err = autorest.NewErrorWithError(err, "graphrbac.UsersClient", "ListNext", resp, "Failure responding to request")
494	}
495
496	return
497}
498
499// ListNextPreparer prepares the ListNext request.
500func (client UsersClient) ListNextPreparer(ctx context.Context, nextLink string) (*http.Request, error) {
501	pathParameters := map[string]interface{}{
502		"nextLink": nextLink,
503		"tenantID": autorest.Encode("path", client.TenantID),
504	}
505
506	const APIVersion = "1.6"
507	queryParameters := map[string]interface{}{
508		"api-version": APIVersion,
509	}
510
511	preparer := autorest.CreatePreparer(
512		autorest.AsGet(),
513		autorest.WithBaseURL(client.BaseURI),
514		autorest.WithPathParameters("/{tenantID}/{nextLink}", pathParameters),
515		autorest.WithQueryParameters(queryParameters))
516	return preparer.Prepare((&http.Request{}).WithContext(ctx))
517}
518
519// ListNextSender sends the ListNext request. The method will close the
520// http.Response Body if it receives an error.
521func (client UsersClient) ListNextSender(req *http.Request) (*http.Response, error) {
522	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
523}
524
525// ListNextResponder handles the response to the ListNext request. The method always
526// closes the http.Response Body.
527func (client UsersClient) ListNextResponder(resp *http.Response) (result UserListResult, err error) {
528	err = autorest.Respond(
529		resp,
530		client.ByInspecting(),
531		azure.WithErrorUnlessStatusCode(http.StatusOK),
532		autorest.ByUnmarshallingJSON(&result),
533		autorest.ByClosing())
534	result.Response = autorest.Response{Response: resp}
535	return
536}
537
538// Update updates a user.
539// Parameters:
540// upnOrObjectID - the object ID or principal name of the user to update.
541// parameters - parameters to update an existing user.
542func (client UsersClient) Update(ctx context.Context, upnOrObjectID string, parameters UserUpdateParameters) (result autorest.Response, err error) {
543	if tracing.IsEnabled() {
544		ctx = tracing.StartSpan(ctx, fqdn+"/UsersClient.Update")
545		defer func() {
546			sc := -1
547			if result.Response != nil {
548				sc = result.Response.StatusCode
549			}
550			tracing.EndSpan(ctx, sc, err)
551		}()
552	}
553	req, err := client.UpdatePreparer(ctx, upnOrObjectID, parameters)
554	if err != nil {
555		err = autorest.NewErrorWithError(err, "graphrbac.UsersClient", "Update", nil, "Failure preparing request")
556		return
557	}
558
559	resp, err := client.UpdateSender(req)
560	if err != nil {
561		result.Response = resp
562		err = autorest.NewErrorWithError(err, "graphrbac.UsersClient", "Update", resp, "Failure sending request")
563		return
564	}
565
566	result, err = client.UpdateResponder(resp)
567	if err != nil {
568		err = autorest.NewErrorWithError(err, "graphrbac.UsersClient", "Update", resp, "Failure responding to request")
569	}
570
571	return
572}
573
574// UpdatePreparer prepares the Update request.
575func (client UsersClient) UpdatePreparer(ctx context.Context, upnOrObjectID string, parameters UserUpdateParameters) (*http.Request, error) {
576	pathParameters := map[string]interface{}{
577		"tenantID":      autorest.Encode("path", client.TenantID),
578		"upnOrObjectId": autorest.Encode("path", upnOrObjectID),
579	}
580
581	const APIVersion = "1.6"
582	queryParameters := map[string]interface{}{
583		"api-version": APIVersion,
584	}
585
586	preparer := autorest.CreatePreparer(
587		autorest.AsContentType("application/json; charset=utf-8"),
588		autorest.AsPatch(),
589		autorest.WithBaseURL(client.BaseURI),
590		autorest.WithPathParameters("/{tenantID}/users/{upnOrObjectId}", pathParameters),
591		autorest.WithJSON(parameters),
592		autorest.WithQueryParameters(queryParameters))
593	return preparer.Prepare((&http.Request{}).WithContext(ctx))
594}
595
596// UpdateSender sends the Update request. The method will close the
597// http.Response Body if it receives an error.
598func (client UsersClient) UpdateSender(req *http.Request) (*http.Response, error) {
599	return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
600}
601
602// UpdateResponder handles the response to the Update request. The method always
603// closes the http.Response Body.
604func (client UsersClient) UpdateResponder(resp *http.Response) (result autorest.Response, err error) {
605	err = autorest.Respond(
606		resp,
607		client.ByInspecting(),
608		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
609		autorest.ByClosing())
610	result.Response = resp
611	return
612}
613