1package authorization
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	"encoding/json"
22	"github.com/Azure/go-autorest/autorest"
23	"github.com/Azure/go-autorest/autorest/to"
24	"net/http"
25)
26
27// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/authorization/mgmt/2017-10-01-preview/authorization instead.
28// ClassicAdministrator classic Administrators
29type ClassicAdministrator struct {
30	// ID - The ID of the administrator.
31	ID *string `json:"id,omitempty"`
32	// Name - The name of the administrator.
33	Name *string `json:"name,omitempty"`
34	// Type - The type of the administrator.
35	Type *string `json:"type,omitempty"`
36	// ClassicAdministratorProperties - Properties for the classic administrator.
37	*ClassicAdministratorProperties `json:"properties,omitempty"`
38}
39
40// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/authorization/mgmt/2017-10-01-preview/authorization instead.
41// MarshalJSON is the custom marshaler for ClassicAdministrator.
42func (ca ClassicAdministrator) MarshalJSON() ([]byte, error) {
43	objectMap := make(map[string]interface{})
44	if ca.ID != nil {
45		objectMap["id"] = ca.ID
46	}
47	if ca.Name != nil {
48		objectMap["name"] = ca.Name
49	}
50	if ca.Type != nil {
51		objectMap["type"] = ca.Type
52	}
53	if ca.ClassicAdministratorProperties != nil {
54		objectMap["properties"] = ca.ClassicAdministratorProperties
55	}
56	return json.Marshal(objectMap)
57}
58
59// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/authorization/mgmt/2017-10-01-preview/authorization instead.
60// UnmarshalJSON is the custom unmarshaler for ClassicAdministrator struct.
61func (ca *ClassicAdministrator) UnmarshalJSON(body []byte) error {
62	var m map[string]*json.RawMessage
63	err := json.Unmarshal(body, &m)
64	if err != nil {
65		return err
66	}
67	for k, v := range m {
68		switch k {
69		case "id":
70			if v != nil {
71				var ID string
72				err = json.Unmarshal(*v, &ID)
73				if err != nil {
74					return err
75				}
76				ca.ID = &ID
77			}
78		case "name":
79			if v != nil {
80				var name string
81				err = json.Unmarshal(*v, &name)
82				if err != nil {
83					return err
84				}
85				ca.Name = &name
86			}
87		case "type":
88			if v != nil {
89				var typeVar string
90				err = json.Unmarshal(*v, &typeVar)
91				if err != nil {
92					return err
93				}
94				ca.Type = &typeVar
95			}
96		case "properties":
97			if v != nil {
98				var classicAdministratorProperties ClassicAdministratorProperties
99				err = json.Unmarshal(*v, &classicAdministratorProperties)
100				if err != nil {
101					return err
102				}
103				ca.ClassicAdministratorProperties = &classicAdministratorProperties
104			}
105		}
106	}
107
108	return nil
109}
110
111// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/authorization/mgmt/2017-10-01-preview/authorization instead.
112// ClassicAdministratorListResult classicAdministrator list result information.
113type ClassicAdministratorListResult struct {
114	autorest.Response `json:"-"`
115	// Value - An array of administrators.
116	Value *[]ClassicAdministrator `json:"value,omitempty"`
117	// NextLink - The URL to use for getting the next set of results.
118	NextLink *string `json:"nextLink,omitempty"`
119}
120
121// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/authorization/mgmt/2017-10-01-preview/authorization instead.
122// ClassicAdministratorListResultIterator provides access to a complete listing of ClassicAdministrator values.
123type ClassicAdministratorListResultIterator struct {
124	i    int
125	page ClassicAdministratorListResultPage
126}
127
128// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/authorization/mgmt/2017-10-01-preview/authorization instead.
129// Next advances to the next value.  If there was an error making
130// the request the iterator does not advance and the error is returned.
131func (iter *ClassicAdministratorListResultIterator) Next() error {
132	iter.i++
133	if iter.i < len(iter.page.Values()) {
134		return nil
135	}
136	err := iter.page.Next()
137	if err != nil {
138		iter.i--
139		return err
140	}
141	iter.i = 0
142	return nil
143}
144
145// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/authorization/mgmt/2017-10-01-preview/authorization instead.
146// NotDone returns true if the enumeration should be started or is not yet complete.
147func (iter ClassicAdministratorListResultIterator) NotDone() bool {
148	return iter.page.NotDone() && iter.i < len(iter.page.Values())
149}
150
151// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/authorization/mgmt/2017-10-01-preview/authorization instead.
152// Response returns the raw server response from the last page request.
153func (iter ClassicAdministratorListResultIterator) Response() ClassicAdministratorListResult {
154	return iter.page.Response()
155}
156
157// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/authorization/mgmt/2017-10-01-preview/authorization instead.
158// Value returns the current value or a zero-initialized value if the
159// iterator has advanced beyond the end of the collection.
160func (iter ClassicAdministratorListResultIterator) Value() ClassicAdministrator {
161	if !iter.page.NotDone() {
162		return ClassicAdministrator{}
163	}
164	return iter.page.Values()[iter.i]
165}
166
167// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/authorization/mgmt/2017-10-01-preview/authorization instead.
168// IsEmpty returns true if the ListResult contains no values.
169func (calr ClassicAdministratorListResult) IsEmpty() bool {
170	return calr.Value == nil || len(*calr.Value) == 0
171}
172
173// classicAdministratorListResultPreparer prepares a request to retrieve the next set of results.
174// It returns nil if no more results exist.
175func (calr ClassicAdministratorListResult) classicAdministratorListResultPreparer() (*http.Request, error) {
176	if calr.NextLink == nil || len(to.String(calr.NextLink)) < 1 {
177		return nil, nil
178	}
179	return autorest.Prepare(&http.Request{},
180		autorest.AsJSON(),
181		autorest.AsGet(),
182		autorest.WithBaseURL(to.String(calr.NextLink)))
183}
184
185// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/authorization/mgmt/2017-10-01-preview/authorization instead.
186// ClassicAdministratorListResultPage contains a page of ClassicAdministrator values.
187type ClassicAdministratorListResultPage struct {
188	fn   func(ClassicAdministratorListResult) (ClassicAdministratorListResult, error)
189	calr ClassicAdministratorListResult
190}
191
192// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/authorization/mgmt/2017-10-01-preview/authorization instead.
193// Next advances to the next page of values.  If there was an error making
194// the request the page does not advance and the error is returned.
195func (page *ClassicAdministratorListResultPage) Next() error {
196	next, err := page.fn(page.calr)
197	if err != nil {
198		return err
199	}
200	page.calr = next
201	return nil
202}
203
204// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/authorization/mgmt/2017-10-01-preview/authorization instead.
205// NotDone returns true if the page enumeration should be started or is not yet complete.
206func (page ClassicAdministratorListResultPage) NotDone() bool {
207	return !page.calr.IsEmpty()
208}
209
210// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/authorization/mgmt/2017-10-01-preview/authorization instead.
211// Response returns the raw server response from the last page request.
212func (page ClassicAdministratorListResultPage) Response() ClassicAdministratorListResult {
213	return page.calr
214}
215
216// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/authorization/mgmt/2017-10-01-preview/authorization instead.
217// Values returns the slice of values for the current page or nil if there are no values.
218func (page ClassicAdministratorListResultPage) Values() []ClassicAdministrator {
219	if page.calr.IsEmpty() {
220		return nil
221	}
222	return *page.calr.Value
223}
224
225// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/authorization/mgmt/2017-10-01-preview/authorization instead.
226// ClassicAdministratorProperties classic Administrator properties.
227type ClassicAdministratorProperties struct {
228	// EmailAddress - The email address of the administrator.
229	EmailAddress *string `json:"emailAddress,omitempty"`
230	// Role - The role of the administrator.
231	Role *string `json:"role,omitempty"`
232}
233
234// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/authorization/mgmt/2017-10-01-preview/authorization instead.
235// Permission role definition permissions.
236type Permission struct {
237	// Actions - Allowed actions.
238	Actions *[]string `json:"actions,omitempty"`
239	// NotActions - Denied actions.
240	NotActions *[]string `json:"notActions,omitempty"`
241}
242
243// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/authorization/mgmt/2017-10-01-preview/authorization instead.
244// PermissionGetResult permissions information.
245type PermissionGetResult struct {
246	autorest.Response `json:"-"`
247	// Value - An array of permissions.
248	Value *[]Permission `json:"value,omitempty"`
249	// NextLink - The URL to use for getting the next set of results.
250	NextLink *string `json:"nextLink,omitempty"`
251}
252
253// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/authorization/mgmt/2017-10-01-preview/authorization instead.
254// PermissionGetResultIterator provides access to a complete listing of Permission values.
255type PermissionGetResultIterator struct {
256	i    int
257	page PermissionGetResultPage
258}
259
260// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/authorization/mgmt/2017-10-01-preview/authorization instead.
261// Next advances to the next value.  If there was an error making
262// the request the iterator does not advance and the error is returned.
263func (iter *PermissionGetResultIterator) Next() error {
264	iter.i++
265	if iter.i < len(iter.page.Values()) {
266		return nil
267	}
268	err := iter.page.Next()
269	if err != nil {
270		iter.i--
271		return err
272	}
273	iter.i = 0
274	return nil
275}
276
277// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/authorization/mgmt/2017-10-01-preview/authorization instead.
278// NotDone returns true if the enumeration should be started or is not yet complete.
279func (iter PermissionGetResultIterator) NotDone() bool {
280	return iter.page.NotDone() && iter.i < len(iter.page.Values())
281}
282
283// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/authorization/mgmt/2017-10-01-preview/authorization instead.
284// Response returns the raw server response from the last page request.
285func (iter PermissionGetResultIterator) Response() PermissionGetResult {
286	return iter.page.Response()
287}
288
289// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/authorization/mgmt/2017-10-01-preview/authorization instead.
290// Value returns the current value or a zero-initialized value if the
291// iterator has advanced beyond the end of the collection.
292func (iter PermissionGetResultIterator) Value() Permission {
293	if !iter.page.NotDone() {
294		return Permission{}
295	}
296	return iter.page.Values()[iter.i]
297}
298
299// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/authorization/mgmt/2017-10-01-preview/authorization instead.
300// IsEmpty returns true if the ListResult contains no values.
301func (pgr PermissionGetResult) IsEmpty() bool {
302	return pgr.Value == nil || len(*pgr.Value) == 0
303}
304
305// permissionGetResultPreparer prepares a request to retrieve the next set of results.
306// It returns nil if no more results exist.
307func (pgr PermissionGetResult) permissionGetResultPreparer() (*http.Request, error) {
308	if pgr.NextLink == nil || len(to.String(pgr.NextLink)) < 1 {
309		return nil, nil
310	}
311	return autorest.Prepare(&http.Request{},
312		autorest.AsJSON(),
313		autorest.AsGet(),
314		autorest.WithBaseURL(to.String(pgr.NextLink)))
315}
316
317// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/authorization/mgmt/2017-10-01-preview/authorization instead.
318// PermissionGetResultPage contains a page of Permission values.
319type PermissionGetResultPage struct {
320	fn  func(PermissionGetResult) (PermissionGetResult, error)
321	pgr PermissionGetResult
322}
323
324// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/authorization/mgmt/2017-10-01-preview/authorization instead.
325// Next advances to the next page of values.  If there was an error making
326// the request the page does not advance and the error is returned.
327func (page *PermissionGetResultPage) Next() error {
328	next, err := page.fn(page.pgr)
329	if err != nil {
330		return err
331	}
332	page.pgr = next
333	return nil
334}
335
336// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/authorization/mgmt/2017-10-01-preview/authorization instead.
337// NotDone returns true if the page enumeration should be started or is not yet complete.
338func (page PermissionGetResultPage) NotDone() bool {
339	return !page.pgr.IsEmpty()
340}
341
342// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/authorization/mgmt/2017-10-01-preview/authorization instead.
343// Response returns the raw server response from the last page request.
344func (page PermissionGetResultPage) Response() PermissionGetResult {
345	return page.pgr
346}
347
348// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/authorization/mgmt/2017-10-01-preview/authorization instead.
349// Values returns the slice of values for the current page or nil if there are no values.
350func (page PermissionGetResultPage) Values() []Permission {
351	if page.pgr.IsEmpty() {
352		return nil
353	}
354	return *page.pgr.Value
355}
356
357// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/authorization/mgmt/2017-10-01-preview/authorization instead.
358// ProviderOperation operation
359type ProviderOperation struct {
360	// Name - The operation name.
361	Name *string `json:"name,omitempty"`
362	// DisplayName - The operation display name.
363	DisplayName *string `json:"displayName,omitempty"`
364	// Description - The operation description.
365	Description *string `json:"description,omitempty"`
366	// Origin - The operation origin.
367	Origin *string `json:"origin,omitempty"`
368	// Properties - The operation properties.
369	Properties interface{} `json:"properties,omitempty"`
370}
371
372// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/authorization/mgmt/2017-10-01-preview/authorization instead.
373// ProviderOperationsMetadata provider Operations metadata
374type ProviderOperationsMetadata struct {
375	autorest.Response `json:"-"`
376	// ID - The provider id.
377	ID *string `json:"id,omitempty"`
378	// Name - The provider name.
379	Name *string `json:"name,omitempty"`
380	// Type - The provider type.
381	Type *string `json:"type,omitempty"`
382	// DisplayName - The provider display name.
383	DisplayName *string `json:"displayName,omitempty"`
384	// ResourceTypes - The provider resource types
385	ResourceTypes *[]ResourceType `json:"resourceTypes,omitempty"`
386	// Operations - The provider operations.
387	Operations *[]ProviderOperation `json:"operations,omitempty"`
388}
389
390// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/authorization/mgmt/2017-10-01-preview/authorization instead.
391// ProviderOperationsMetadataListResult provider operations metadata list
392type ProviderOperationsMetadataListResult struct {
393	autorest.Response `json:"-"`
394	// Value - The list of providers.
395	Value *[]ProviderOperationsMetadata `json:"value,omitempty"`
396	// NextLink - The URL to use for getting the next set of results.
397	NextLink *string `json:"nextLink,omitempty"`
398}
399
400// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/authorization/mgmt/2017-10-01-preview/authorization instead.
401// ProviderOperationsMetadataListResultIterator provides access to a complete listing of ProviderOperationsMetadata
402// values.
403type ProviderOperationsMetadataListResultIterator struct {
404	i    int
405	page ProviderOperationsMetadataListResultPage
406}
407
408// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/authorization/mgmt/2017-10-01-preview/authorization instead.
409// Next advances to the next value.  If there was an error making
410// the request the iterator does not advance and the error is returned.
411func (iter *ProviderOperationsMetadataListResultIterator) Next() error {
412	iter.i++
413	if iter.i < len(iter.page.Values()) {
414		return nil
415	}
416	err := iter.page.Next()
417	if err != nil {
418		iter.i--
419		return err
420	}
421	iter.i = 0
422	return nil
423}
424
425// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/authorization/mgmt/2017-10-01-preview/authorization instead.
426// NotDone returns true if the enumeration should be started or is not yet complete.
427func (iter ProviderOperationsMetadataListResultIterator) NotDone() bool {
428	return iter.page.NotDone() && iter.i < len(iter.page.Values())
429}
430
431// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/authorization/mgmt/2017-10-01-preview/authorization instead.
432// Response returns the raw server response from the last page request.
433func (iter ProviderOperationsMetadataListResultIterator) Response() ProviderOperationsMetadataListResult {
434	return iter.page.Response()
435}
436
437// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/authorization/mgmt/2017-10-01-preview/authorization instead.
438// Value returns the current value or a zero-initialized value if the
439// iterator has advanced beyond the end of the collection.
440func (iter ProviderOperationsMetadataListResultIterator) Value() ProviderOperationsMetadata {
441	if !iter.page.NotDone() {
442		return ProviderOperationsMetadata{}
443	}
444	return iter.page.Values()[iter.i]
445}
446
447// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/authorization/mgmt/2017-10-01-preview/authorization instead.
448// IsEmpty returns true if the ListResult contains no values.
449func (pomlr ProviderOperationsMetadataListResult) IsEmpty() bool {
450	return pomlr.Value == nil || len(*pomlr.Value) == 0
451}
452
453// providerOperationsMetadataListResultPreparer prepares a request to retrieve the next set of results.
454// It returns nil if no more results exist.
455func (pomlr ProviderOperationsMetadataListResult) providerOperationsMetadataListResultPreparer() (*http.Request, error) {
456	if pomlr.NextLink == nil || len(to.String(pomlr.NextLink)) < 1 {
457		return nil, nil
458	}
459	return autorest.Prepare(&http.Request{},
460		autorest.AsJSON(),
461		autorest.AsGet(),
462		autorest.WithBaseURL(to.String(pomlr.NextLink)))
463}
464
465// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/authorization/mgmt/2017-10-01-preview/authorization instead.
466// ProviderOperationsMetadataListResultPage contains a page of ProviderOperationsMetadata values.
467type ProviderOperationsMetadataListResultPage struct {
468	fn    func(ProviderOperationsMetadataListResult) (ProviderOperationsMetadataListResult, error)
469	pomlr ProviderOperationsMetadataListResult
470}
471
472// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/authorization/mgmt/2017-10-01-preview/authorization instead.
473// Next advances to the next page of values.  If there was an error making
474// the request the page does not advance and the error is returned.
475func (page *ProviderOperationsMetadataListResultPage) Next() error {
476	next, err := page.fn(page.pomlr)
477	if err != nil {
478		return err
479	}
480	page.pomlr = next
481	return nil
482}
483
484// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/authorization/mgmt/2017-10-01-preview/authorization instead.
485// NotDone returns true if the page enumeration should be started or is not yet complete.
486func (page ProviderOperationsMetadataListResultPage) NotDone() bool {
487	return !page.pomlr.IsEmpty()
488}
489
490// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/authorization/mgmt/2017-10-01-preview/authorization instead.
491// Response returns the raw server response from the last page request.
492func (page ProviderOperationsMetadataListResultPage) Response() ProviderOperationsMetadataListResult {
493	return page.pomlr
494}
495
496// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/authorization/mgmt/2017-10-01-preview/authorization instead.
497// Values returns the slice of values for the current page or nil if there are no values.
498func (page ProviderOperationsMetadataListResultPage) Values() []ProviderOperationsMetadata {
499	if page.pomlr.IsEmpty() {
500		return nil
501	}
502	return *page.pomlr.Value
503}
504
505// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/authorization/mgmt/2017-10-01-preview/authorization instead.
506// ResourceType resource Type
507type ResourceType struct {
508	// Name - The resource type name.
509	Name *string `json:"name,omitempty"`
510	// DisplayName - The resource type display name.
511	DisplayName *string `json:"displayName,omitempty"`
512	// Operations - The resource type operations.
513	Operations *[]ProviderOperation `json:"operations,omitempty"`
514}
515
516// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/authorization/mgmt/2017-10-01-preview/authorization instead.
517// RoleAssignment role Assignments
518type RoleAssignment struct {
519	autorest.Response `json:"-"`
520	// ID - The role assignment ID.
521	ID *string `json:"id,omitempty"`
522	// Name - The role assignment name.
523	Name *string `json:"name,omitempty"`
524	// Type - The role assignment type.
525	Type *string `json:"type,omitempty"`
526	// RoleAssignmentPropertiesWithScope - Role assignment properties.
527	*RoleAssignmentPropertiesWithScope `json:"properties,omitempty"`
528}
529
530// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/authorization/mgmt/2017-10-01-preview/authorization instead.
531// MarshalJSON is the custom marshaler for RoleAssignment.
532func (ra RoleAssignment) MarshalJSON() ([]byte, error) {
533	objectMap := make(map[string]interface{})
534	if ra.ID != nil {
535		objectMap["id"] = ra.ID
536	}
537	if ra.Name != nil {
538		objectMap["name"] = ra.Name
539	}
540	if ra.Type != nil {
541		objectMap["type"] = ra.Type
542	}
543	if ra.RoleAssignmentPropertiesWithScope != nil {
544		objectMap["properties"] = ra.RoleAssignmentPropertiesWithScope
545	}
546	return json.Marshal(objectMap)
547}
548
549// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/authorization/mgmt/2017-10-01-preview/authorization instead.
550// UnmarshalJSON is the custom unmarshaler for RoleAssignment struct.
551func (ra *RoleAssignment) UnmarshalJSON(body []byte) error {
552	var m map[string]*json.RawMessage
553	err := json.Unmarshal(body, &m)
554	if err != nil {
555		return err
556	}
557	for k, v := range m {
558		switch k {
559		case "id":
560			if v != nil {
561				var ID string
562				err = json.Unmarshal(*v, &ID)
563				if err != nil {
564					return err
565				}
566				ra.ID = &ID
567			}
568		case "name":
569			if v != nil {
570				var name string
571				err = json.Unmarshal(*v, &name)
572				if err != nil {
573					return err
574				}
575				ra.Name = &name
576			}
577		case "type":
578			if v != nil {
579				var typeVar string
580				err = json.Unmarshal(*v, &typeVar)
581				if err != nil {
582					return err
583				}
584				ra.Type = &typeVar
585			}
586		case "properties":
587			if v != nil {
588				var roleAssignmentPropertiesWithScope RoleAssignmentPropertiesWithScope
589				err = json.Unmarshal(*v, &roleAssignmentPropertiesWithScope)
590				if err != nil {
591					return err
592				}
593				ra.RoleAssignmentPropertiesWithScope = &roleAssignmentPropertiesWithScope
594			}
595		}
596	}
597
598	return nil
599}
600
601// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/authorization/mgmt/2017-10-01-preview/authorization instead.
602// RoleAssignmentCreateParameters role assignment create parameters.
603type RoleAssignmentCreateParameters struct {
604	// RoleAssignmentProperties - Role assignment properties.
605	*RoleAssignmentProperties `json:"properties,omitempty"`
606}
607
608// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/authorization/mgmt/2017-10-01-preview/authorization instead.
609// MarshalJSON is the custom marshaler for RoleAssignmentCreateParameters.
610func (racp RoleAssignmentCreateParameters) MarshalJSON() ([]byte, error) {
611	objectMap := make(map[string]interface{})
612	if racp.RoleAssignmentProperties != nil {
613		objectMap["properties"] = racp.RoleAssignmentProperties
614	}
615	return json.Marshal(objectMap)
616}
617
618// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/authorization/mgmt/2017-10-01-preview/authorization instead.
619// UnmarshalJSON is the custom unmarshaler for RoleAssignmentCreateParameters struct.
620func (racp *RoleAssignmentCreateParameters) UnmarshalJSON(body []byte) error {
621	var m map[string]*json.RawMessage
622	err := json.Unmarshal(body, &m)
623	if err != nil {
624		return err
625	}
626	for k, v := range m {
627		switch k {
628		case "properties":
629			if v != nil {
630				var roleAssignmentProperties RoleAssignmentProperties
631				err = json.Unmarshal(*v, &roleAssignmentProperties)
632				if err != nil {
633					return err
634				}
635				racp.RoleAssignmentProperties = &roleAssignmentProperties
636			}
637		}
638	}
639
640	return nil
641}
642
643// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/authorization/mgmt/2017-10-01-preview/authorization instead.
644// RoleAssignmentFilter role Assignments filter
645type RoleAssignmentFilter struct {
646	// PrincipalID - Returns role assignment of the specific principal.
647	PrincipalID *string `json:"principalId,omitempty"`
648	// CanDelegate - The Delegation flag for the roleassignment
649	CanDelegate *bool `json:"canDelegate,omitempty"`
650}
651
652// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/authorization/mgmt/2017-10-01-preview/authorization instead.
653// RoleAssignmentListResult role assignment list operation result.
654type RoleAssignmentListResult struct {
655	autorest.Response `json:"-"`
656	// Value - Role assignment list.
657	Value *[]RoleAssignment `json:"value,omitempty"`
658	// NextLink - The URL to use for getting the next set of results.
659	NextLink *string `json:"nextLink,omitempty"`
660}
661
662// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/authorization/mgmt/2017-10-01-preview/authorization instead.
663// RoleAssignmentListResultIterator provides access to a complete listing of RoleAssignment values.
664type RoleAssignmentListResultIterator struct {
665	i    int
666	page RoleAssignmentListResultPage
667}
668
669// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/authorization/mgmt/2017-10-01-preview/authorization instead.
670// Next advances to the next value.  If there was an error making
671// the request the iterator does not advance and the error is returned.
672func (iter *RoleAssignmentListResultIterator) Next() error {
673	iter.i++
674	if iter.i < len(iter.page.Values()) {
675		return nil
676	}
677	err := iter.page.Next()
678	if err != nil {
679		iter.i--
680		return err
681	}
682	iter.i = 0
683	return nil
684}
685
686// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/authorization/mgmt/2017-10-01-preview/authorization instead.
687// NotDone returns true if the enumeration should be started or is not yet complete.
688func (iter RoleAssignmentListResultIterator) NotDone() bool {
689	return iter.page.NotDone() && iter.i < len(iter.page.Values())
690}
691
692// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/authorization/mgmt/2017-10-01-preview/authorization instead.
693// Response returns the raw server response from the last page request.
694func (iter RoleAssignmentListResultIterator) Response() RoleAssignmentListResult {
695	return iter.page.Response()
696}
697
698// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/authorization/mgmt/2017-10-01-preview/authorization instead.
699// Value returns the current value or a zero-initialized value if the
700// iterator has advanced beyond the end of the collection.
701func (iter RoleAssignmentListResultIterator) Value() RoleAssignment {
702	if !iter.page.NotDone() {
703		return RoleAssignment{}
704	}
705	return iter.page.Values()[iter.i]
706}
707
708// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/authorization/mgmt/2017-10-01-preview/authorization instead.
709// IsEmpty returns true if the ListResult contains no values.
710func (ralr RoleAssignmentListResult) IsEmpty() bool {
711	return ralr.Value == nil || len(*ralr.Value) == 0
712}
713
714// roleAssignmentListResultPreparer prepares a request to retrieve the next set of results.
715// It returns nil if no more results exist.
716func (ralr RoleAssignmentListResult) roleAssignmentListResultPreparer() (*http.Request, error) {
717	if ralr.NextLink == nil || len(to.String(ralr.NextLink)) < 1 {
718		return nil, nil
719	}
720	return autorest.Prepare(&http.Request{},
721		autorest.AsJSON(),
722		autorest.AsGet(),
723		autorest.WithBaseURL(to.String(ralr.NextLink)))
724}
725
726// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/authorization/mgmt/2017-10-01-preview/authorization instead.
727// RoleAssignmentListResultPage contains a page of RoleAssignment values.
728type RoleAssignmentListResultPage struct {
729	fn   func(RoleAssignmentListResult) (RoleAssignmentListResult, error)
730	ralr RoleAssignmentListResult
731}
732
733// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/authorization/mgmt/2017-10-01-preview/authorization instead.
734// Next advances to the next page of values.  If there was an error making
735// the request the page does not advance and the error is returned.
736func (page *RoleAssignmentListResultPage) Next() error {
737	next, err := page.fn(page.ralr)
738	if err != nil {
739		return err
740	}
741	page.ralr = next
742	return nil
743}
744
745// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/authorization/mgmt/2017-10-01-preview/authorization instead.
746// NotDone returns true if the page enumeration should be started or is not yet complete.
747func (page RoleAssignmentListResultPage) NotDone() bool {
748	return !page.ralr.IsEmpty()
749}
750
751// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/authorization/mgmt/2017-10-01-preview/authorization instead.
752// Response returns the raw server response from the last page request.
753func (page RoleAssignmentListResultPage) Response() RoleAssignmentListResult {
754	return page.ralr
755}
756
757// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/authorization/mgmt/2017-10-01-preview/authorization instead.
758// Values returns the slice of values for the current page or nil if there are no values.
759func (page RoleAssignmentListResultPage) Values() []RoleAssignment {
760	if page.ralr.IsEmpty() {
761		return nil
762	}
763	return *page.ralr.Value
764}
765
766// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/authorization/mgmt/2017-10-01-preview/authorization instead.
767// RoleAssignmentProperties role assignment properties.
768type RoleAssignmentProperties struct {
769	// RoleDefinitionID - The role definition ID used in the role assignment.
770	RoleDefinitionID *string `json:"roleDefinitionId,omitempty"`
771	// PrincipalID - The principal ID assigned to the role. This maps to the ID inside the Active Directory. It can point to a user, service principal, or security group.
772	PrincipalID *string `json:"principalId,omitempty"`
773	// CanDelegate - The delgation flag used for creating a role assignment
774	CanDelegate *bool `json:"canDelegate,omitempty"`
775}
776
777// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/authorization/mgmt/2017-10-01-preview/authorization instead.
778// RoleAssignmentPropertiesWithScope role assignment properties with scope.
779type RoleAssignmentPropertiesWithScope struct {
780	// Scope - The role assignment scope.
781	Scope *string `json:"scope,omitempty"`
782	// RoleDefinitionID - The role definition ID.
783	RoleDefinitionID *string `json:"roleDefinitionId,omitempty"`
784	// PrincipalID - The principal ID.
785	PrincipalID *string `json:"principalId,omitempty"`
786	// CanDelegate - The Delegation flag for the roleassignment
787	CanDelegate *bool `json:"canDelegate,omitempty"`
788}
789
790// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/authorization/mgmt/2017-10-01-preview/authorization instead.
791// RoleDefinition role definition.
792type RoleDefinition struct {
793	autorest.Response `json:"-"`
794	// ID - The role definition ID.
795	ID *string `json:"id,omitempty"`
796	// Name - The role definition name.
797	Name *string `json:"name,omitempty"`
798	// Type - The role definition type.
799	Type *string `json:"type,omitempty"`
800	// RoleDefinitionProperties - Role definition properties.
801	*RoleDefinitionProperties `json:"properties,omitempty"`
802}
803
804// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/authorization/mgmt/2017-10-01-preview/authorization instead.
805// MarshalJSON is the custom marshaler for RoleDefinition.
806func (rd RoleDefinition) MarshalJSON() ([]byte, error) {
807	objectMap := make(map[string]interface{})
808	if rd.ID != nil {
809		objectMap["id"] = rd.ID
810	}
811	if rd.Name != nil {
812		objectMap["name"] = rd.Name
813	}
814	if rd.Type != nil {
815		objectMap["type"] = rd.Type
816	}
817	if rd.RoleDefinitionProperties != nil {
818		objectMap["properties"] = rd.RoleDefinitionProperties
819	}
820	return json.Marshal(objectMap)
821}
822
823// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/authorization/mgmt/2017-10-01-preview/authorization instead.
824// UnmarshalJSON is the custom unmarshaler for RoleDefinition struct.
825func (rd *RoleDefinition) UnmarshalJSON(body []byte) error {
826	var m map[string]*json.RawMessage
827	err := json.Unmarshal(body, &m)
828	if err != nil {
829		return err
830	}
831	for k, v := range m {
832		switch k {
833		case "id":
834			if v != nil {
835				var ID string
836				err = json.Unmarshal(*v, &ID)
837				if err != nil {
838					return err
839				}
840				rd.ID = &ID
841			}
842		case "name":
843			if v != nil {
844				var name string
845				err = json.Unmarshal(*v, &name)
846				if err != nil {
847					return err
848				}
849				rd.Name = &name
850			}
851		case "type":
852			if v != nil {
853				var typeVar string
854				err = json.Unmarshal(*v, &typeVar)
855				if err != nil {
856					return err
857				}
858				rd.Type = &typeVar
859			}
860		case "properties":
861			if v != nil {
862				var roleDefinitionProperties RoleDefinitionProperties
863				err = json.Unmarshal(*v, &roleDefinitionProperties)
864				if err != nil {
865					return err
866				}
867				rd.RoleDefinitionProperties = &roleDefinitionProperties
868			}
869		}
870	}
871
872	return nil
873}
874
875// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/authorization/mgmt/2017-10-01-preview/authorization instead.
876// RoleDefinitionFilter role Definitions filter
877type RoleDefinitionFilter struct {
878	// RoleName - Returns role definition with the specific name.
879	RoleName *string `json:"roleName,omitempty"`
880}
881
882// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/authorization/mgmt/2017-10-01-preview/authorization instead.
883// RoleDefinitionListResult role definition list operation result.
884type RoleDefinitionListResult struct {
885	autorest.Response `json:"-"`
886	// Value - Role definition list.
887	Value *[]RoleDefinition `json:"value,omitempty"`
888	// NextLink - The URL to use for getting the next set of results.
889	NextLink *string `json:"nextLink,omitempty"`
890}
891
892// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/authorization/mgmt/2017-10-01-preview/authorization instead.
893// RoleDefinitionListResultIterator provides access to a complete listing of RoleDefinition values.
894type RoleDefinitionListResultIterator struct {
895	i    int
896	page RoleDefinitionListResultPage
897}
898
899// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/authorization/mgmt/2017-10-01-preview/authorization instead.
900// Next advances to the next value.  If there was an error making
901// the request the iterator does not advance and the error is returned.
902func (iter *RoleDefinitionListResultIterator) Next() error {
903	iter.i++
904	if iter.i < len(iter.page.Values()) {
905		return nil
906	}
907	err := iter.page.Next()
908	if err != nil {
909		iter.i--
910		return err
911	}
912	iter.i = 0
913	return nil
914}
915
916// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/authorization/mgmt/2017-10-01-preview/authorization instead.
917// NotDone returns true if the enumeration should be started or is not yet complete.
918func (iter RoleDefinitionListResultIterator) NotDone() bool {
919	return iter.page.NotDone() && iter.i < len(iter.page.Values())
920}
921
922// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/authorization/mgmt/2017-10-01-preview/authorization instead.
923// Response returns the raw server response from the last page request.
924func (iter RoleDefinitionListResultIterator) Response() RoleDefinitionListResult {
925	return iter.page.Response()
926}
927
928// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/authorization/mgmt/2017-10-01-preview/authorization instead.
929// Value returns the current value or a zero-initialized value if the
930// iterator has advanced beyond the end of the collection.
931func (iter RoleDefinitionListResultIterator) Value() RoleDefinition {
932	if !iter.page.NotDone() {
933		return RoleDefinition{}
934	}
935	return iter.page.Values()[iter.i]
936}
937
938// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/authorization/mgmt/2017-10-01-preview/authorization instead.
939// IsEmpty returns true if the ListResult contains no values.
940func (rdlr RoleDefinitionListResult) IsEmpty() bool {
941	return rdlr.Value == nil || len(*rdlr.Value) == 0
942}
943
944// roleDefinitionListResultPreparer prepares a request to retrieve the next set of results.
945// It returns nil if no more results exist.
946func (rdlr RoleDefinitionListResult) roleDefinitionListResultPreparer() (*http.Request, error) {
947	if rdlr.NextLink == nil || len(to.String(rdlr.NextLink)) < 1 {
948		return nil, nil
949	}
950	return autorest.Prepare(&http.Request{},
951		autorest.AsJSON(),
952		autorest.AsGet(),
953		autorest.WithBaseURL(to.String(rdlr.NextLink)))
954}
955
956// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/authorization/mgmt/2017-10-01-preview/authorization instead.
957// RoleDefinitionListResultPage contains a page of RoleDefinition values.
958type RoleDefinitionListResultPage struct {
959	fn   func(RoleDefinitionListResult) (RoleDefinitionListResult, error)
960	rdlr RoleDefinitionListResult
961}
962
963// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/authorization/mgmt/2017-10-01-preview/authorization instead.
964// Next advances to the next page of values.  If there was an error making
965// the request the page does not advance and the error is returned.
966func (page *RoleDefinitionListResultPage) Next() error {
967	next, err := page.fn(page.rdlr)
968	if err != nil {
969		return err
970	}
971	page.rdlr = next
972	return nil
973}
974
975// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/authorization/mgmt/2017-10-01-preview/authorization instead.
976// NotDone returns true if the page enumeration should be started or is not yet complete.
977func (page RoleDefinitionListResultPage) NotDone() bool {
978	return !page.rdlr.IsEmpty()
979}
980
981// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/authorization/mgmt/2017-10-01-preview/authorization instead.
982// Response returns the raw server response from the last page request.
983func (page RoleDefinitionListResultPage) Response() RoleDefinitionListResult {
984	return page.rdlr
985}
986
987// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/authorization/mgmt/2017-10-01-preview/authorization instead.
988// Values returns the slice of values for the current page or nil if there are no values.
989func (page RoleDefinitionListResultPage) Values() []RoleDefinition {
990	if page.rdlr.IsEmpty() {
991		return nil
992	}
993	return *page.rdlr.Value
994}
995
996// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/authorization/mgmt/2017-10-01-preview/authorization instead.
997// RoleDefinitionProperties role definition properties.
998type RoleDefinitionProperties struct {
999	// RoleName - The role name.
1000	RoleName *string `json:"roleName,omitempty"`
1001	// Description - The role definition description.
1002	Description *string `json:"description,omitempty"`
1003	// RoleType - The role type.
1004	RoleType *string `json:"type,omitempty"`
1005	// Permissions - Role definition permissions.
1006	Permissions *[]Permission `json:"permissions,omitempty"`
1007	// AssignableScopes - Role definition assignable scopes.
1008	AssignableScopes *[]string `json:"assignableScopes,omitempty"`
1009}
1010