1package containerregistry
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/azure"
24	"github.com/Azure/go-autorest/autorest/date"
25	"github.com/Azure/go-autorest/autorest/to"
26	"net/http"
27)
28
29// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
30// PasswordName enumerates the values for password name.
31type PasswordName string
32
33const (
34	// Password ...
35	Password PasswordName = "password"
36	// Password2 ...
37	Password2 PasswordName = "password2"
38)
39
40// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
41// PossiblePasswordNameValues returns an array of possible values for the PasswordName const type.
42func PossiblePasswordNameValues() []PasswordName {
43	return []PasswordName{Password, Password2}
44}
45
46// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
47// ProvisioningState enumerates the values for provisioning state.
48type ProvisioningState string
49
50const (
51	// Canceled ...
52	Canceled ProvisioningState = "Canceled"
53	// Creating ...
54	Creating ProvisioningState = "Creating"
55	// Deleting ...
56	Deleting ProvisioningState = "Deleting"
57	// Failed ...
58	Failed ProvisioningState = "Failed"
59	// Succeeded ...
60	Succeeded ProvisioningState = "Succeeded"
61	// Updating ...
62	Updating ProvisioningState = "Updating"
63)
64
65// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
66// PossibleProvisioningStateValues returns an array of possible values for the ProvisioningState const type.
67func PossibleProvisioningStateValues() []ProvisioningState {
68	return []ProvisioningState{Canceled, Creating, Deleting, Failed, Succeeded, Updating}
69}
70
71// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
72// RegistryUsageUnit enumerates the values for registry usage unit.
73type RegistryUsageUnit string
74
75const (
76	// Bytes ...
77	Bytes RegistryUsageUnit = "Bytes"
78	// Count ...
79	Count RegistryUsageUnit = "Count"
80)
81
82// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
83// PossibleRegistryUsageUnitValues returns an array of possible values for the RegistryUsageUnit const type.
84func PossibleRegistryUsageUnitValues() []RegistryUsageUnit {
85	return []RegistryUsageUnit{Bytes, Count}
86}
87
88// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
89// SkuName enumerates the values for sku name.
90type SkuName string
91
92const (
93	// Basic ...
94	Basic SkuName = "Basic"
95	// ManagedBasic ...
96	ManagedBasic SkuName = "Managed_Basic"
97	// ManagedPremium ...
98	ManagedPremium SkuName = "Managed_Premium"
99	// ManagedStandard ...
100	ManagedStandard SkuName = "Managed_Standard"
101)
102
103// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
104// PossibleSkuNameValues returns an array of possible values for the SkuName const type.
105func PossibleSkuNameValues() []SkuName {
106	return []SkuName{Basic, ManagedBasic, ManagedPremium, ManagedStandard}
107}
108
109// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
110// SkuTier enumerates the values for sku tier.
111type SkuTier string
112
113const (
114	// SkuTierBasic ...
115	SkuTierBasic SkuTier = "Basic"
116	// SkuTierManaged ...
117	SkuTierManaged SkuTier = "Managed"
118)
119
120// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
121// PossibleSkuTierValues returns an array of possible values for the SkuTier const type.
122func PossibleSkuTierValues() []SkuTier {
123	return []SkuTier{SkuTierBasic, SkuTierManaged}
124}
125
126// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
127// WebhookAction enumerates the values for webhook action.
128type WebhookAction string
129
130const (
131	// Delete ...
132	Delete WebhookAction = "delete"
133	// Push ...
134	Push WebhookAction = "push"
135)
136
137// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
138// PossibleWebhookActionValues returns an array of possible values for the WebhookAction const type.
139func PossibleWebhookActionValues() []WebhookAction {
140	return []WebhookAction{Delete, Push}
141}
142
143// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
144// WebhookStatus enumerates the values for webhook status.
145type WebhookStatus string
146
147const (
148	// Disabled ...
149	Disabled WebhookStatus = "disabled"
150	// Enabled ...
151	Enabled WebhookStatus = "enabled"
152)
153
154// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
155// PossibleWebhookStatusValues returns an array of possible values for the WebhookStatus const type.
156func PossibleWebhookStatusValues() []WebhookStatus {
157	return []WebhookStatus{Disabled, Enabled}
158}
159
160// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
161// Actor the agent that initiated the event. For most situations, this could be from the authorization context of
162// the request.
163type Actor struct {
164	// Name - The subject or username associated with the request context that generated the event.
165	Name *string `json:"name,omitempty"`
166}
167
168// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
169// CallbackConfig the configuration of service URI and custom headers for the webhook.
170type CallbackConfig struct {
171	autorest.Response `json:"-"`
172	// ServiceURI - The service URI for the webhook to post notifications.
173	ServiceURI *string `json:"serviceUri,omitempty"`
174	// CustomHeaders - Custom headers that will be added to the webhook notifications.
175	CustomHeaders map[string]*string `json:"customHeaders"`
176}
177
178// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
179// MarshalJSON is the custom marshaler for CallbackConfig.
180func (cc CallbackConfig) MarshalJSON() ([]byte, error) {
181	objectMap := make(map[string]interface{})
182	if cc.ServiceURI != nil {
183		objectMap["serviceUri"] = cc.ServiceURI
184	}
185	if cc.CustomHeaders != nil {
186		objectMap["customHeaders"] = cc.CustomHeaders
187	}
188	return json.Marshal(objectMap)
189}
190
191// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
192// Event the event for a webhook.
193type Event struct {
194	// EventRequestMessage - The event request message sent to the service URI.
195	EventRequestMessage *EventRequestMessage `json:"eventRequestMessage,omitempty"`
196	// EventResponseMessage - The event response message received from the service URI.
197	EventResponseMessage *EventResponseMessage `json:"eventResponseMessage,omitempty"`
198	// ID - The event ID.
199	ID *string `json:"id,omitempty"`
200}
201
202// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
203// EventContent the content of the event request message.
204type EventContent struct {
205	// ID - The event ID.
206	ID *string `json:"id,omitempty"`
207	// Timestamp - The time at which the event occurred.
208	Timestamp *date.Time `json:"timestamp,omitempty"`
209	// Action - The action that encompasses the provided event.
210	Action *string `json:"action,omitempty"`
211	// Target - The target of the event.
212	Target *Target `json:"target,omitempty"`
213	// Request - The request that generated the event.
214	Request *Request `json:"request,omitempty"`
215	// Actor - The agent that initiated the event. For most situations, this could be from the authorization context of the request.
216	Actor *Actor `json:"actor,omitempty"`
217	// Source - The registry node that generated the event. Put differently, while the actor initiates the event, the source generates it.
218	Source *Source `json:"source,omitempty"`
219}
220
221// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
222// EventInfo the basic information of an event.
223type EventInfo struct {
224	autorest.Response `json:"-"`
225	// ID - The event ID.
226	ID *string `json:"id,omitempty"`
227}
228
229// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
230// EventListResult the result of a request to list events for a webhook.
231type EventListResult struct {
232	autorest.Response `json:"-"`
233	// Value - The list of events. Since this list may be incomplete, the nextLink field should be used to request the next list of events.
234	Value *[]Event `json:"value,omitempty"`
235	// NextLink - The URI that can be used to request the next list of events.
236	NextLink *string `json:"nextLink,omitempty"`
237}
238
239// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
240// EventListResultIterator provides access to a complete listing of Event values.
241type EventListResultIterator struct {
242	i    int
243	page EventListResultPage
244}
245
246// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
247// Next advances to the next value.  If there was an error making
248// the request the iterator does not advance and the error is returned.
249func (iter *EventListResultIterator) Next() error {
250	iter.i++
251	if iter.i < len(iter.page.Values()) {
252		return nil
253	}
254	err := iter.page.Next()
255	if err != nil {
256		iter.i--
257		return err
258	}
259	iter.i = 0
260	return nil
261}
262
263// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
264// NotDone returns true if the enumeration should be started or is not yet complete.
265func (iter EventListResultIterator) NotDone() bool {
266	return iter.page.NotDone() && iter.i < len(iter.page.Values())
267}
268
269// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
270// Response returns the raw server response from the last page request.
271func (iter EventListResultIterator) Response() EventListResult {
272	return iter.page.Response()
273}
274
275// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
276// Value returns the current value or a zero-initialized value if the
277// iterator has advanced beyond the end of the collection.
278func (iter EventListResultIterator) Value() Event {
279	if !iter.page.NotDone() {
280		return Event{}
281	}
282	return iter.page.Values()[iter.i]
283}
284
285// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
286// IsEmpty returns true if the ListResult contains no values.
287func (elr EventListResult) IsEmpty() bool {
288	return elr.Value == nil || len(*elr.Value) == 0
289}
290
291// eventListResultPreparer prepares a request to retrieve the next set of results.
292// It returns nil if no more results exist.
293func (elr EventListResult) eventListResultPreparer() (*http.Request, error) {
294	if elr.NextLink == nil || len(to.String(elr.NextLink)) < 1 {
295		return nil, nil
296	}
297	return autorest.Prepare(&http.Request{},
298		autorest.AsJSON(),
299		autorest.AsGet(),
300		autorest.WithBaseURL(to.String(elr.NextLink)))
301}
302
303// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
304// EventListResultPage contains a page of Event values.
305type EventListResultPage struct {
306	fn  func(EventListResult) (EventListResult, error)
307	elr EventListResult
308}
309
310// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
311// Next advances to the next page of values.  If there was an error making
312// the request the page does not advance and the error is returned.
313func (page *EventListResultPage) Next() error {
314	next, err := page.fn(page.elr)
315	if err != nil {
316		return err
317	}
318	page.elr = next
319	return nil
320}
321
322// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
323// NotDone returns true if the page enumeration should be started or is not yet complete.
324func (page EventListResultPage) NotDone() bool {
325	return !page.elr.IsEmpty()
326}
327
328// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
329// Response returns the raw server response from the last page request.
330func (page EventListResultPage) Response() EventListResult {
331	return page.elr
332}
333
334// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
335// Values returns the slice of values for the current page or nil if there are no values.
336func (page EventListResultPage) Values() []Event {
337	if page.elr.IsEmpty() {
338		return nil
339	}
340	return *page.elr.Value
341}
342
343// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
344// EventRequestMessage the event request message sent to the service URI.
345type EventRequestMessage struct {
346	// Content - The content of the event request message.
347	Content *EventContent `json:"content,omitempty"`
348	// Headers - The headers of the event request message.
349	Headers map[string]*string `json:"headers"`
350	// Method - The HTTP method used to send the event request message.
351	Method *string `json:"method,omitempty"`
352	// RequestURI - The URI used to send the event request message.
353	RequestURI *string `json:"requestUri,omitempty"`
354	// Version - The HTTP message version.
355	Version *string `json:"version,omitempty"`
356}
357
358// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
359// MarshalJSON is the custom marshaler for EventRequestMessage.
360func (erm EventRequestMessage) MarshalJSON() ([]byte, error) {
361	objectMap := make(map[string]interface{})
362	if erm.Content != nil {
363		objectMap["content"] = erm.Content
364	}
365	if erm.Headers != nil {
366		objectMap["headers"] = erm.Headers
367	}
368	if erm.Method != nil {
369		objectMap["method"] = erm.Method
370	}
371	if erm.RequestURI != nil {
372		objectMap["requestUri"] = erm.RequestURI
373	}
374	if erm.Version != nil {
375		objectMap["version"] = erm.Version
376	}
377	return json.Marshal(objectMap)
378}
379
380// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
381// EventResponseMessage the event response message received from the service URI.
382type EventResponseMessage struct {
383	// Content - The content of the event response message.
384	Content *string `json:"content,omitempty"`
385	// Headers - The headers of the event response message.
386	Headers map[string]*string `json:"headers"`
387	// ReasonPhrase - The reason phrase of the event response message.
388	ReasonPhrase *string `json:"reasonPhrase,omitempty"`
389	// StatusCode - The status code of the event response message.
390	StatusCode *string `json:"statusCode,omitempty"`
391	// Version - The HTTP message version.
392	Version *string `json:"version,omitempty"`
393}
394
395// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
396// MarshalJSON is the custom marshaler for EventResponseMessage.
397func (erm EventResponseMessage) MarshalJSON() ([]byte, error) {
398	objectMap := make(map[string]interface{})
399	if erm.Content != nil {
400		objectMap["content"] = erm.Content
401	}
402	if erm.Headers != nil {
403		objectMap["headers"] = erm.Headers
404	}
405	if erm.ReasonPhrase != nil {
406		objectMap["reasonPhrase"] = erm.ReasonPhrase
407	}
408	if erm.StatusCode != nil {
409		objectMap["statusCode"] = erm.StatusCode
410	}
411	if erm.Version != nil {
412		objectMap["version"] = erm.Version
413	}
414	return json.Marshal(objectMap)
415}
416
417// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
418// OperationDefinition the definition of a container registry operation.
419type OperationDefinition struct {
420	// Name - Operation name: {provider}/{resource}/{operation}.
421	Name *string `json:"name,omitempty"`
422	// Display - The display information for the container registry operation.
423	Display *OperationDisplayDefinition `json:"display,omitempty"`
424}
425
426// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
427// OperationDisplayDefinition the display information for a container registry operation.
428type OperationDisplayDefinition struct {
429	// Provider - The resource provider name: Microsoft.ContainerRegistry.
430	Provider *string `json:"provider,omitempty"`
431	// Resource - The resource on which the operation is performed.
432	Resource *string `json:"resource,omitempty"`
433	// Operation - The operation that users can perform.
434	Operation *string `json:"operation,omitempty"`
435	// Description - The description for the operation.
436	Description *string `json:"description,omitempty"`
437}
438
439// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
440// OperationListResult the result of a request to list container registry operations.
441type OperationListResult struct {
442	autorest.Response `json:"-"`
443	// Value - The list of container registry operations. Since this list may be incomplete, the nextLink field should be used to request the next list of operations.
444	Value *[]OperationDefinition `json:"value,omitempty"`
445	// NextLink - The URI that can be used to request the next list of container registry operations.
446	NextLink *string `json:"nextLink,omitempty"`
447}
448
449// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
450// OperationListResultIterator provides access to a complete listing of OperationDefinition values.
451type OperationListResultIterator struct {
452	i    int
453	page OperationListResultPage
454}
455
456// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
457// Next advances to the next value.  If there was an error making
458// the request the iterator does not advance and the error is returned.
459func (iter *OperationListResultIterator) Next() error {
460	iter.i++
461	if iter.i < len(iter.page.Values()) {
462		return nil
463	}
464	err := iter.page.Next()
465	if err != nil {
466		iter.i--
467		return err
468	}
469	iter.i = 0
470	return nil
471}
472
473// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
474// NotDone returns true if the enumeration should be started or is not yet complete.
475func (iter OperationListResultIterator) NotDone() bool {
476	return iter.page.NotDone() && iter.i < len(iter.page.Values())
477}
478
479// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
480// Response returns the raw server response from the last page request.
481func (iter OperationListResultIterator) Response() OperationListResult {
482	return iter.page.Response()
483}
484
485// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
486// Value returns the current value or a zero-initialized value if the
487// iterator has advanced beyond the end of the collection.
488func (iter OperationListResultIterator) Value() OperationDefinition {
489	if !iter.page.NotDone() {
490		return OperationDefinition{}
491	}
492	return iter.page.Values()[iter.i]
493}
494
495// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
496// IsEmpty returns true if the ListResult contains no values.
497func (olr OperationListResult) IsEmpty() bool {
498	return olr.Value == nil || len(*olr.Value) == 0
499}
500
501// operationListResultPreparer prepares a request to retrieve the next set of results.
502// It returns nil if no more results exist.
503func (olr OperationListResult) operationListResultPreparer() (*http.Request, error) {
504	if olr.NextLink == nil || len(to.String(olr.NextLink)) < 1 {
505		return nil, nil
506	}
507	return autorest.Prepare(&http.Request{},
508		autorest.AsJSON(),
509		autorest.AsGet(),
510		autorest.WithBaseURL(to.String(olr.NextLink)))
511}
512
513// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
514// OperationListResultPage contains a page of OperationDefinition values.
515type OperationListResultPage struct {
516	fn  func(OperationListResult) (OperationListResult, error)
517	olr OperationListResult
518}
519
520// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
521// Next advances to the next page of values.  If there was an error making
522// the request the page does not advance and the error is returned.
523func (page *OperationListResultPage) Next() error {
524	next, err := page.fn(page.olr)
525	if err != nil {
526		return err
527	}
528	page.olr = next
529	return nil
530}
531
532// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
533// NotDone returns true if the page enumeration should be started or is not yet complete.
534func (page OperationListResultPage) NotDone() bool {
535	return !page.olr.IsEmpty()
536}
537
538// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
539// Response returns the raw server response from the last page request.
540func (page OperationListResultPage) Response() OperationListResult {
541	return page.olr
542}
543
544// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
545// Values returns the slice of values for the current page or nil if there are no values.
546func (page OperationListResultPage) Values() []OperationDefinition {
547	if page.olr.IsEmpty() {
548		return nil
549	}
550	return *page.olr.Value
551}
552
553// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
554// RegenerateCredentialParameters the parameters used to regenerate the login credential.
555type RegenerateCredentialParameters struct {
556	// Name - Specifies name of the password which should be regenerated -- password or password2. Possible values include: 'Password', 'Password2'
557	Name PasswordName `json:"name,omitempty"`
558}
559
560// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
561// RegistriesCreateFuture an abstraction for monitoring and retrieving the results of a long-running operation.
562type RegistriesCreateFuture struct {
563	azure.Future
564	req *http.Request
565}
566
567// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
568// Result returns the result of the asynchronous operation.
569// If the operation has not completed it will return an error.
570func (future RegistriesCreateFuture) Result(client RegistriesClient) (r Registry, err error) {
571	var done bool
572	done, err = future.Done(client)
573	if err != nil {
574		err = autorest.NewErrorWithError(err, "containerregistry.RegistriesCreateFuture", "Result", future.Response(), "Polling failure")
575		return
576	}
577	if !done {
578		return r, azure.NewAsyncOpIncompleteError("containerregistry.RegistriesCreateFuture")
579	}
580	if future.PollingMethod() == azure.PollingLocation {
581		r, err = client.CreateResponder(future.Response())
582		if err != nil {
583			err = autorest.NewErrorWithError(err, "containerregistry.RegistriesCreateFuture", "Result", future.Response(), "Failure responding to request")
584		}
585		return
586	}
587	var req *http.Request
588	var resp *http.Response
589	if future.PollingURL() != "" {
590		req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil)
591		if err != nil {
592			return
593		}
594	} else {
595		req = autorest.ChangeToGet(future.req)
596	}
597	resp, err = autorest.SendWithSender(client, req,
598		autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
599	if err != nil {
600		err = autorest.NewErrorWithError(err, "containerregistry.RegistriesCreateFuture", "Result", resp, "Failure sending request")
601		return
602	}
603	r, err = client.CreateResponder(resp)
604	if err != nil {
605		err = autorest.NewErrorWithError(err, "containerregistry.RegistriesCreateFuture", "Result", resp, "Failure responding to request")
606	}
607	return
608}
609
610// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
611// RegistriesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation.
612type RegistriesDeleteFuture struct {
613	azure.Future
614	req *http.Request
615}
616
617// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
618// Result returns the result of the asynchronous operation.
619// If the operation has not completed it will return an error.
620func (future RegistriesDeleteFuture) Result(client RegistriesClient) (ar autorest.Response, err error) {
621	var done bool
622	done, err = future.Done(client)
623	if err != nil {
624		err = autorest.NewErrorWithError(err, "containerregistry.RegistriesDeleteFuture", "Result", future.Response(), "Polling failure")
625		return
626	}
627	if !done {
628		return ar, azure.NewAsyncOpIncompleteError("containerregistry.RegistriesDeleteFuture")
629	}
630	if future.PollingMethod() == azure.PollingLocation {
631		ar, err = client.DeleteResponder(future.Response())
632		if err != nil {
633			err = autorest.NewErrorWithError(err, "containerregistry.RegistriesDeleteFuture", "Result", future.Response(), "Failure responding to request")
634		}
635		return
636	}
637	var req *http.Request
638	var resp *http.Response
639	if future.PollingURL() != "" {
640		req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil)
641		if err != nil {
642			return
643		}
644	} else {
645		req = autorest.ChangeToGet(future.req)
646	}
647	resp, err = autorest.SendWithSender(client, req,
648		autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
649	if err != nil {
650		err = autorest.NewErrorWithError(err, "containerregistry.RegistriesDeleteFuture", "Result", resp, "Failure sending request")
651		return
652	}
653	ar, err = client.DeleteResponder(resp)
654	if err != nil {
655		err = autorest.NewErrorWithError(err, "containerregistry.RegistriesDeleteFuture", "Result", resp, "Failure responding to request")
656	}
657	return
658}
659
660// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
661// RegistriesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation.
662type RegistriesUpdateFuture struct {
663	azure.Future
664	req *http.Request
665}
666
667// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
668// Result returns the result of the asynchronous operation.
669// If the operation has not completed it will return an error.
670func (future RegistriesUpdateFuture) Result(client RegistriesClient) (r Registry, err error) {
671	var done bool
672	done, err = future.Done(client)
673	if err != nil {
674		err = autorest.NewErrorWithError(err, "containerregistry.RegistriesUpdateFuture", "Result", future.Response(), "Polling failure")
675		return
676	}
677	if !done {
678		return r, azure.NewAsyncOpIncompleteError("containerregistry.RegistriesUpdateFuture")
679	}
680	if future.PollingMethod() == azure.PollingLocation {
681		r, err = client.UpdateResponder(future.Response())
682		if err != nil {
683			err = autorest.NewErrorWithError(err, "containerregistry.RegistriesUpdateFuture", "Result", future.Response(), "Failure responding to request")
684		}
685		return
686	}
687	var req *http.Request
688	var resp *http.Response
689	if future.PollingURL() != "" {
690		req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil)
691		if err != nil {
692			return
693		}
694	} else {
695		req = autorest.ChangeToGet(future.req)
696	}
697	resp, err = autorest.SendWithSender(client, req,
698		autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
699	if err != nil {
700		err = autorest.NewErrorWithError(err, "containerregistry.RegistriesUpdateFuture", "Result", resp, "Failure sending request")
701		return
702	}
703	r, err = client.UpdateResponder(resp)
704	if err != nil {
705		err = autorest.NewErrorWithError(err, "containerregistry.RegistriesUpdateFuture", "Result", resp, "Failure responding to request")
706	}
707	return
708}
709
710// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
711// Registry an object that represents a container registry.
712type Registry struct {
713	autorest.Response `json:"-"`
714	// Sku - The SKU of the container registry.
715	Sku *Sku `json:"sku,omitempty"`
716	// RegistryProperties - The properties of the container registry.
717	*RegistryProperties `json:"properties,omitempty"`
718	// ID - The resource ID.
719	ID *string `json:"id,omitempty"`
720	// Name - The name of the resource.
721	Name *string `json:"name,omitempty"`
722	// Type - The type of the resource.
723	Type *string `json:"type,omitempty"`
724	// Location - The location of the resource. This cannot be changed after the resource is created.
725	Location *string `json:"location,omitempty"`
726	// Tags - The tags of the resource.
727	Tags map[string]*string `json:"tags"`
728}
729
730// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
731// MarshalJSON is the custom marshaler for Registry.
732func (r Registry) MarshalJSON() ([]byte, error) {
733	objectMap := make(map[string]interface{})
734	if r.Sku != nil {
735		objectMap["sku"] = r.Sku
736	}
737	if r.RegistryProperties != nil {
738		objectMap["properties"] = r.RegistryProperties
739	}
740	if r.ID != nil {
741		objectMap["id"] = r.ID
742	}
743	if r.Name != nil {
744		objectMap["name"] = r.Name
745	}
746	if r.Type != nil {
747		objectMap["type"] = r.Type
748	}
749	if r.Location != nil {
750		objectMap["location"] = r.Location
751	}
752	if r.Tags != nil {
753		objectMap["tags"] = r.Tags
754	}
755	return json.Marshal(objectMap)
756}
757
758// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
759// UnmarshalJSON is the custom unmarshaler for Registry struct.
760func (r *Registry) UnmarshalJSON(body []byte) error {
761	var m map[string]*json.RawMessage
762	err := json.Unmarshal(body, &m)
763	if err != nil {
764		return err
765	}
766	for k, v := range m {
767		switch k {
768		case "sku":
769			if v != nil {
770				var sku Sku
771				err = json.Unmarshal(*v, &sku)
772				if err != nil {
773					return err
774				}
775				r.Sku = &sku
776			}
777		case "properties":
778			if v != nil {
779				var registryProperties RegistryProperties
780				err = json.Unmarshal(*v, &registryProperties)
781				if err != nil {
782					return err
783				}
784				r.RegistryProperties = &registryProperties
785			}
786		case "id":
787			if v != nil {
788				var ID string
789				err = json.Unmarshal(*v, &ID)
790				if err != nil {
791					return err
792				}
793				r.ID = &ID
794			}
795		case "name":
796			if v != nil {
797				var name string
798				err = json.Unmarshal(*v, &name)
799				if err != nil {
800					return err
801				}
802				r.Name = &name
803			}
804		case "type":
805			if v != nil {
806				var typeVar string
807				err = json.Unmarshal(*v, &typeVar)
808				if err != nil {
809					return err
810				}
811				r.Type = &typeVar
812			}
813		case "location":
814			if v != nil {
815				var location string
816				err = json.Unmarshal(*v, &location)
817				if err != nil {
818					return err
819				}
820				r.Location = &location
821			}
822		case "tags":
823			if v != nil {
824				var tags map[string]*string
825				err = json.Unmarshal(*v, &tags)
826				if err != nil {
827					return err
828				}
829				r.Tags = tags
830			}
831		}
832	}
833
834	return nil
835}
836
837// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
838// RegistryListCredentialsResult the response from the ListCredentials operation.
839type RegistryListCredentialsResult struct {
840	autorest.Response `json:"-"`
841	// Username - The username for a container registry.
842	Username *string `json:"username,omitempty"`
843	// Passwords - The list of passwords for a container registry.
844	Passwords *[]RegistryPassword `json:"passwords,omitempty"`
845}
846
847// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
848// RegistryListResult the result of a request to list container registries.
849type RegistryListResult struct {
850	autorest.Response `json:"-"`
851	// Value - The list of container registries. Since this list may be incomplete, the nextLink field should be used to request the next list of container registries.
852	Value *[]Registry `json:"value,omitempty"`
853	// NextLink - The URI that can be used to request the next list of container registries.
854	NextLink *string `json:"nextLink,omitempty"`
855}
856
857// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
858// RegistryListResultIterator provides access to a complete listing of Registry values.
859type RegistryListResultIterator struct {
860	i    int
861	page RegistryListResultPage
862}
863
864// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
865// Next advances to the next value.  If there was an error making
866// the request the iterator does not advance and the error is returned.
867func (iter *RegistryListResultIterator) Next() error {
868	iter.i++
869	if iter.i < len(iter.page.Values()) {
870		return nil
871	}
872	err := iter.page.Next()
873	if err != nil {
874		iter.i--
875		return err
876	}
877	iter.i = 0
878	return nil
879}
880
881// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
882// NotDone returns true if the enumeration should be started or is not yet complete.
883func (iter RegistryListResultIterator) NotDone() bool {
884	return iter.page.NotDone() && iter.i < len(iter.page.Values())
885}
886
887// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
888// Response returns the raw server response from the last page request.
889func (iter RegistryListResultIterator) Response() RegistryListResult {
890	return iter.page.Response()
891}
892
893// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
894// Value returns the current value or a zero-initialized value if the
895// iterator has advanced beyond the end of the collection.
896func (iter RegistryListResultIterator) Value() Registry {
897	if !iter.page.NotDone() {
898		return Registry{}
899	}
900	return iter.page.Values()[iter.i]
901}
902
903// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
904// IsEmpty returns true if the ListResult contains no values.
905func (rlr RegistryListResult) IsEmpty() bool {
906	return rlr.Value == nil || len(*rlr.Value) == 0
907}
908
909// registryListResultPreparer prepares a request to retrieve the next set of results.
910// It returns nil if no more results exist.
911func (rlr RegistryListResult) registryListResultPreparer() (*http.Request, error) {
912	if rlr.NextLink == nil || len(to.String(rlr.NextLink)) < 1 {
913		return nil, nil
914	}
915	return autorest.Prepare(&http.Request{},
916		autorest.AsJSON(),
917		autorest.AsGet(),
918		autorest.WithBaseURL(to.String(rlr.NextLink)))
919}
920
921// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
922// RegistryListResultPage contains a page of Registry values.
923type RegistryListResultPage struct {
924	fn  func(RegistryListResult) (RegistryListResult, error)
925	rlr RegistryListResult
926}
927
928// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
929// Next advances to the next page of values.  If there was an error making
930// the request the page does not advance and the error is returned.
931func (page *RegistryListResultPage) Next() error {
932	next, err := page.fn(page.rlr)
933	if err != nil {
934		return err
935	}
936	page.rlr = next
937	return nil
938}
939
940// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
941// NotDone returns true if the page enumeration should be started or is not yet complete.
942func (page RegistryListResultPage) NotDone() bool {
943	return !page.rlr.IsEmpty()
944}
945
946// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
947// Response returns the raw server response from the last page request.
948func (page RegistryListResultPage) Response() RegistryListResult {
949	return page.rlr
950}
951
952// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
953// Values returns the slice of values for the current page or nil if there are no values.
954func (page RegistryListResultPage) Values() []Registry {
955	if page.rlr.IsEmpty() {
956		return nil
957	}
958	return *page.rlr.Value
959}
960
961// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
962// RegistryNameCheckRequest a request to check whether a container registry name is available.
963type RegistryNameCheckRequest struct {
964	// Name - The name of the container registry.
965	Name *string `json:"name,omitempty"`
966	// Type - The resource type of the container registry. This field must be set to 'Microsoft.ContainerRegistry/registries'.
967	Type *string `json:"type,omitempty"`
968}
969
970// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
971// RegistryNameStatus the result of a request to check the availability of a container registry name.
972type RegistryNameStatus struct {
973	autorest.Response `json:"-"`
974	// NameAvailable - The value that indicates whether the name is available.
975	NameAvailable *bool `json:"nameAvailable,omitempty"`
976	// Reason - If any, the reason that the name is not available.
977	Reason *string `json:"reason,omitempty"`
978	// Message - If any, the error message that provides more detail for the reason that the name is not available.
979	Message *string `json:"message,omitempty"`
980}
981
982// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
983// RegistryPassword the login password for the container registry.
984type RegistryPassword struct {
985	// Name - The password name. Possible values include: 'Password', 'Password2'
986	Name PasswordName `json:"name,omitempty"`
987	// Value - The password value.
988	Value *string `json:"value,omitempty"`
989}
990
991// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
992// RegistryProperties the properties of a container registry.
993type RegistryProperties struct {
994	// LoginServer - The URL that can be used to log into the container registry.
995	LoginServer *string `json:"loginServer,omitempty"`
996	// CreationDate - The creation date of the container registry in ISO8601 format.
997	CreationDate *date.Time `json:"creationDate,omitempty"`
998	// ProvisioningState - The provisioning state of the container registry at the time the operation was called. Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', 'Canceled'
999	ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
1000	// Status - The status of the container registry at the time the operation was called.
1001	Status *Status `json:"status,omitempty"`
1002	// AdminUserEnabled - The value that indicates whether the admin user is enabled.
1003	AdminUserEnabled *bool `json:"adminUserEnabled,omitempty"`
1004	// StorageAccount - The properties of the storage account for the container registry. Only applicable to Basic SKU.
1005	StorageAccount *StorageAccountProperties `json:"storageAccount,omitempty"`
1006}
1007
1008// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
1009// RegistryPropertiesUpdateParameters the parameters for updating the properties of a container registry.
1010type RegistryPropertiesUpdateParameters struct {
1011	// AdminUserEnabled - The value that indicates whether the admin user is enabled.
1012	AdminUserEnabled *bool `json:"adminUserEnabled,omitempty"`
1013	// StorageAccount - The parameters of a storage account for the container registry. Only applicable to Basic SKU. If specified, the storage account must be in the same physical location as the container registry.
1014	StorageAccount *StorageAccountProperties `json:"storageAccount,omitempty"`
1015}
1016
1017// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
1018// RegistryUpdateParameters the parameters for updating a container registry.
1019type RegistryUpdateParameters struct {
1020	// Tags - The tags for the container registry.
1021	Tags map[string]*string `json:"tags"`
1022	// Sku - The SKU of the container registry.
1023	Sku *Sku `json:"sku,omitempty"`
1024	// RegistryPropertiesUpdateParameters - The properties that the container registry will be updated with.
1025	*RegistryPropertiesUpdateParameters `json:"properties,omitempty"`
1026}
1027
1028// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
1029// MarshalJSON is the custom marshaler for RegistryUpdateParameters.
1030func (rup RegistryUpdateParameters) MarshalJSON() ([]byte, error) {
1031	objectMap := make(map[string]interface{})
1032	if rup.Tags != nil {
1033		objectMap["tags"] = rup.Tags
1034	}
1035	if rup.Sku != nil {
1036		objectMap["sku"] = rup.Sku
1037	}
1038	if rup.RegistryPropertiesUpdateParameters != nil {
1039		objectMap["properties"] = rup.RegistryPropertiesUpdateParameters
1040	}
1041	return json.Marshal(objectMap)
1042}
1043
1044// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
1045// UnmarshalJSON is the custom unmarshaler for RegistryUpdateParameters struct.
1046func (rup *RegistryUpdateParameters) UnmarshalJSON(body []byte) error {
1047	var m map[string]*json.RawMessage
1048	err := json.Unmarshal(body, &m)
1049	if err != nil {
1050		return err
1051	}
1052	for k, v := range m {
1053		switch k {
1054		case "tags":
1055			if v != nil {
1056				var tags map[string]*string
1057				err = json.Unmarshal(*v, &tags)
1058				if err != nil {
1059					return err
1060				}
1061				rup.Tags = tags
1062			}
1063		case "sku":
1064			if v != nil {
1065				var sku Sku
1066				err = json.Unmarshal(*v, &sku)
1067				if err != nil {
1068					return err
1069				}
1070				rup.Sku = &sku
1071			}
1072		case "properties":
1073			if v != nil {
1074				var registryPropertiesUpdateParameters RegistryPropertiesUpdateParameters
1075				err = json.Unmarshal(*v, &registryPropertiesUpdateParameters)
1076				if err != nil {
1077					return err
1078				}
1079				rup.RegistryPropertiesUpdateParameters = &registryPropertiesUpdateParameters
1080			}
1081		}
1082	}
1083
1084	return nil
1085}
1086
1087// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
1088// RegistryUsage the quota usage for a container registry.
1089type RegistryUsage struct {
1090	// Name - The name of the usage.
1091	Name *string `json:"name,omitempty"`
1092	// Limit - The limit of the usage.
1093	Limit *int64 `json:"limit,omitempty"`
1094	// CurrentValue - The current value of the usage.
1095	CurrentValue *int64 `json:"currentValue,omitempty"`
1096	// Unit - The unit of measurement. Possible values include: 'Count', 'Bytes'
1097	Unit RegistryUsageUnit `json:"unit,omitempty"`
1098}
1099
1100// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
1101// RegistryUsageListResult the result of a request to get container registry quota usages.
1102type RegistryUsageListResult struct {
1103	autorest.Response `json:"-"`
1104	// Value - The list of container registry quota usages.
1105	Value *[]RegistryUsage `json:"value,omitempty"`
1106}
1107
1108// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
1109// Replication an object that represents a replication for a container registry.
1110type Replication struct {
1111	autorest.Response `json:"-"`
1112	// ReplicationProperties - The properties of the replication.
1113	*ReplicationProperties `json:"properties,omitempty"`
1114	// ID - The resource ID.
1115	ID *string `json:"id,omitempty"`
1116	// Name - The name of the resource.
1117	Name *string `json:"name,omitempty"`
1118	// Type - The type of the resource.
1119	Type *string `json:"type,omitempty"`
1120	// Location - The location of the resource. This cannot be changed after the resource is created.
1121	Location *string `json:"location,omitempty"`
1122	// Tags - The tags of the resource.
1123	Tags map[string]*string `json:"tags"`
1124}
1125
1126// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
1127// MarshalJSON is the custom marshaler for Replication.
1128func (r Replication) MarshalJSON() ([]byte, error) {
1129	objectMap := make(map[string]interface{})
1130	if r.ReplicationProperties != nil {
1131		objectMap["properties"] = r.ReplicationProperties
1132	}
1133	if r.ID != nil {
1134		objectMap["id"] = r.ID
1135	}
1136	if r.Name != nil {
1137		objectMap["name"] = r.Name
1138	}
1139	if r.Type != nil {
1140		objectMap["type"] = r.Type
1141	}
1142	if r.Location != nil {
1143		objectMap["location"] = r.Location
1144	}
1145	if r.Tags != nil {
1146		objectMap["tags"] = r.Tags
1147	}
1148	return json.Marshal(objectMap)
1149}
1150
1151// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
1152// UnmarshalJSON is the custom unmarshaler for Replication struct.
1153func (r *Replication) UnmarshalJSON(body []byte) error {
1154	var m map[string]*json.RawMessage
1155	err := json.Unmarshal(body, &m)
1156	if err != nil {
1157		return err
1158	}
1159	for k, v := range m {
1160		switch k {
1161		case "properties":
1162			if v != nil {
1163				var replicationProperties ReplicationProperties
1164				err = json.Unmarshal(*v, &replicationProperties)
1165				if err != nil {
1166					return err
1167				}
1168				r.ReplicationProperties = &replicationProperties
1169			}
1170		case "id":
1171			if v != nil {
1172				var ID string
1173				err = json.Unmarshal(*v, &ID)
1174				if err != nil {
1175					return err
1176				}
1177				r.ID = &ID
1178			}
1179		case "name":
1180			if v != nil {
1181				var name string
1182				err = json.Unmarshal(*v, &name)
1183				if err != nil {
1184					return err
1185				}
1186				r.Name = &name
1187			}
1188		case "type":
1189			if v != nil {
1190				var typeVar string
1191				err = json.Unmarshal(*v, &typeVar)
1192				if err != nil {
1193					return err
1194				}
1195				r.Type = &typeVar
1196			}
1197		case "location":
1198			if v != nil {
1199				var location string
1200				err = json.Unmarshal(*v, &location)
1201				if err != nil {
1202					return err
1203				}
1204				r.Location = &location
1205			}
1206		case "tags":
1207			if v != nil {
1208				var tags map[string]*string
1209				err = json.Unmarshal(*v, &tags)
1210				if err != nil {
1211					return err
1212				}
1213				r.Tags = tags
1214			}
1215		}
1216	}
1217
1218	return nil
1219}
1220
1221// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
1222// ReplicationListResult the result of a request to list replications for a container registry.
1223type ReplicationListResult struct {
1224	autorest.Response `json:"-"`
1225	// Value - The list of replications. Since this list may be incomplete, the nextLink field should be used to request the next list of replications.
1226	Value *[]Replication `json:"value,omitempty"`
1227	// NextLink - The URI that can be used to request the next list of replications.
1228	NextLink *string `json:"nextLink,omitempty"`
1229}
1230
1231// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
1232// ReplicationListResultIterator provides access to a complete listing of Replication values.
1233type ReplicationListResultIterator struct {
1234	i    int
1235	page ReplicationListResultPage
1236}
1237
1238// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
1239// Next advances to the next value.  If there was an error making
1240// the request the iterator does not advance and the error is returned.
1241func (iter *ReplicationListResultIterator) Next() error {
1242	iter.i++
1243	if iter.i < len(iter.page.Values()) {
1244		return nil
1245	}
1246	err := iter.page.Next()
1247	if err != nil {
1248		iter.i--
1249		return err
1250	}
1251	iter.i = 0
1252	return nil
1253}
1254
1255// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
1256// NotDone returns true if the enumeration should be started or is not yet complete.
1257func (iter ReplicationListResultIterator) NotDone() bool {
1258	return iter.page.NotDone() && iter.i < len(iter.page.Values())
1259}
1260
1261// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
1262// Response returns the raw server response from the last page request.
1263func (iter ReplicationListResultIterator) Response() ReplicationListResult {
1264	return iter.page.Response()
1265}
1266
1267// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
1268// Value returns the current value or a zero-initialized value if the
1269// iterator has advanced beyond the end of the collection.
1270func (iter ReplicationListResultIterator) Value() Replication {
1271	if !iter.page.NotDone() {
1272		return Replication{}
1273	}
1274	return iter.page.Values()[iter.i]
1275}
1276
1277// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
1278// IsEmpty returns true if the ListResult contains no values.
1279func (rlr ReplicationListResult) IsEmpty() bool {
1280	return rlr.Value == nil || len(*rlr.Value) == 0
1281}
1282
1283// replicationListResultPreparer prepares a request to retrieve the next set of results.
1284// It returns nil if no more results exist.
1285func (rlr ReplicationListResult) replicationListResultPreparer() (*http.Request, error) {
1286	if rlr.NextLink == nil || len(to.String(rlr.NextLink)) < 1 {
1287		return nil, nil
1288	}
1289	return autorest.Prepare(&http.Request{},
1290		autorest.AsJSON(),
1291		autorest.AsGet(),
1292		autorest.WithBaseURL(to.String(rlr.NextLink)))
1293}
1294
1295// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
1296// ReplicationListResultPage contains a page of Replication values.
1297type ReplicationListResultPage struct {
1298	fn  func(ReplicationListResult) (ReplicationListResult, error)
1299	rlr ReplicationListResult
1300}
1301
1302// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
1303// Next advances to the next page of values.  If there was an error making
1304// the request the page does not advance and the error is returned.
1305func (page *ReplicationListResultPage) Next() error {
1306	next, err := page.fn(page.rlr)
1307	if err != nil {
1308		return err
1309	}
1310	page.rlr = next
1311	return nil
1312}
1313
1314// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
1315// NotDone returns true if the page enumeration should be started or is not yet complete.
1316func (page ReplicationListResultPage) NotDone() bool {
1317	return !page.rlr.IsEmpty()
1318}
1319
1320// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
1321// Response returns the raw server response from the last page request.
1322func (page ReplicationListResultPage) Response() ReplicationListResult {
1323	return page.rlr
1324}
1325
1326// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
1327// Values returns the slice of values for the current page or nil if there are no values.
1328func (page ReplicationListResultPage) Values() []Replication {
1329	if page.rlr.IsEmpty() {
1330		return nil
1331	}
1332	return *page.rlr.Value
1333}
1334
1335// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
1336// ReplicationProperties the properties of a replication.
1337type ReplicationProperties struct {
1338	// ProvisioningState - The provisioning state of the replication at the time the operation was called. Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', 'Canceled'
1339	ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
1340	// Status - The status of the replication at the time the operation was called.
1341	Status *Status `json:"status,omitempty"`
1342}
1343
1344// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
1345// ReplicationsCreateFuture an abstraction for monitoring and retrieving the results of a long-running operation.
1346type ReplicationsCreateFuture struct {
1347	azure.Future
1348	req *http.Request
1349}
1350
1351// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
1352// Result returns the result of the asynchronous operation.
1353// If the operation has not completed it will return an error.
1354func (future ReplicationsCreateFuture) Result(client ReplicationsClient) (r Replication, err error) {
1355	var done bool
1356	done, err = future.Done(client)
1357	if err != nil {
1358		err = autorest.NewErrorWithError(err, "containerregistry.ReplicationsCreateFuture", "Result", future.Response(), "Polling failure")
1359		return
1360	}
1361	if !done {
1362		return r, azure.NewAsyncOpIncompleteError("containerregistry.ReplicationsCreateFuture")
1363	}
1364	if future.PollingMethod() == azure.PollingLocation {
1365		r, err = client.CreateResponder(future.Response())
1366		if err != nil {
1367			err = autorest.NewErrorWithError(err, "containerregistry.ReplicationsCreateFuture", "Result", future.Response(), "Failure responding to request")
1368		}
1369		return
1370	}
1371	var req *http.Request
1372	var resp *http.Response
1373	if future.PollingURL() != "" {
1374		req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil)
1375		if err != nil {
1376			return
1377		}
1378	} else {
1379		req = autorest.ChangeToGet(future.req)
1380	}
1381	resp, err = autorest.SendWithSender(client, req,
1382		autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
1383	if err != nil {
1384		err = autorest.NewErrorWithError(err, "containerregistry.ReplicationsCreateFuture", "Result", resp, "Failure sending request")
1385		return
1386	}
1387	r, err = client.CreateResponder(resp)
1388	if err != nil {
1389		err = autorest.NewErrorWithError(err, "containerregistry.ReplicationsCreateFuture", "Result", resp, "Failure responding to request")
1390	}
1391	return
1392}
1393
1394// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
1395// ReplicationsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation.
1396type ReplicationsDeleteFuture struct {
1397	azure.Future
1398	req *http.Request
1399}
1400
1401// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
1402// Result returns the result of the asynchronous operation.
1403// If the operation has not completed it will return an error.
1404func (future ReplicationsDeleteFuture) Result(client ReplicationsClient) (ar autorest.Response, err error) {
1405	var done bool
1406	done, err = future.Done(client)
1407	if err != nil {
1408		err = autorest.NewErrorWithError(err, "containerregistry.ReplicationsDeleteFuture", "Result", future.Response(), "Polling failure")
1409		return
1410	}
1411	if !done {
1412		return ar, azure.NewAsyncOpIncompleteError("containerregistry.ReplicationsDeleteFuture")
1413	}
1414	if future.PollingMethod() == azure.PollingLocation {
1415		ar, err = client.DeleteResponder(future.Response())
1416		if err != nil {
1417			err = autorest.NewErrorWithError(err, "containerregistry.ReplicationsDeleteFuture", "Result", future.Response(), "Failure responding to request")
1418		}
1419		return
1420	}
1421	var req *http.Request
1422	var resp *http.Response
1423	if future.PollingURL() != "" {
1424		req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil)
1425		if err != nil {
1426			return
1427		}
1428	} else {
1429		req = autorest.ChangeToGet(future.req)
1430	}
1431	resp, err = autorest.SendWithSender(client, req,
1432		autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
1433	if err != nil {
1434		err = autorest.NewErrorWithError(err, "containerregistry.ReplicationsDeleteFuture", "Result", resp, "Failure sending request")
1435		return
1436	}
1437	ar, err = client.DeleteResponder(resp)
1438	if err != nil {
1439		err = autorest.NewErrorWithError(err, "containerregistry.ReplicationsDeleteFuture", "Result", resp, "Failure responding to request")
1440	}
1441	return
1442}
1443
1444// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
1445// ReplicationsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation.
1446type ReplicationsUpdateFuture struct {
1447	azure.Future
1448	req *http.Request
1449}
1450
1451// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
1452// Result returns the result of the asynchronous operation.
1453// If the operation has not completed it will return an error.
1454func (future ReplicationsUpdateFuture) Result(client ReplicationsClient) (r Replication, err error) {
1455	var done bool
1456	done, err = future.Done(client)
1457	if err != nil {
1458		err = autorest.NewErrorWithError(err, "containerregistry.ReplicationsUpdateFuture", "Result", future.Response(), "Polling failure")
1459		return
1460	}
1461	if !done {
1462		return r, azure.NewAsyncOpIncompleteError("containerregistry.ReplicationsUpdateFuture")
1463	}
1464	if future.PollingMethod() == azure.PollingLocation {
1465		r, err = client.UpdateResponder(future.Response())
1466		if err != nil {
1467			err = autorest.NewErrorWithError(err, "containerregistry.ReplicationsUpdateFuture", "Result", future.Response(), "Failure responding to request")
1468		}
1469		return
1470	}
1471	var req *http.Request
1472	var resp *http.Response
1473	if future.PollingURL() != "" {
1474		req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil)
1475		if err != nil {
1476			return
1477		}
1478	} else {
1479		req = autorest.ChangeToGet(future.req)
1480	}
1481	resp, err = autorest.SendWithSender(client, req,
1482		autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
1483	if err != nil {
1484		err = autorest.NewErrorWithError(err, "containerregistry.ReplicationsUpdateFuture", "Result", resp, "Failure sending request")
1485		return
1486	}
1487	r, err = client.UpdateResponder(resp)
1488	if err != nil {
1489		err = autorest.NewErrorWithError(err, "containerregistry.ReplicationsUpdateFuture", "Result", resp, "Failure responding to request")
1490	}
1491	return
1492}
1493
1494// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
1495// ReplicationUpdateParameters the parameters for updating a replication.
1496type ReplicationUpdateParameters struct {
1497	// Tags - The tags for the replication.
1498	Tags map[string]*string `json:"tags"`
1499}
1500
1501// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
1502// MarshalJSON is the custom marshaler for ReplicationUpdateParameters.
1503func (rup ReplicationUpdateParameters) MarshalJSON() ([]byte, error) {
1504	objectMap := make(map[string]interface{})
1505	if rup.Tags != nil {
1506		objectMap["tags"] = rup.Tags
1507	}
1508	return json.Marshal(objectMap)
1509}
1510
1511// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
1512// Request the request that generated the event.
1513type Request struct {
1514	// ID - The ID of the request that initiated the event.
1515	ID *string `json:"id,omitempty"`
1516	// Addr - The IP or hostname and possibly port of the client connection that initiated the event. This is the RemoteAddr from the standard http request.
1517	Addr *string `json:"addr,omitempty"`
1518	// Host - The externally accessible hostname of the registry instance, as specified by the http host header on incoming requests.
1519	Host *string `json:"host,omitempty"`
1520	// Method - The request method that generated the event.
1521	Method *string `json:"method,omitempty"`
1522	// Useragent - The user agent header of the request.
1523	Useragent *string `json:"useragent,omitempty"`
1524}
1525
1526// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
1527// Resource an Azure resource.
1528type Resource struct {
1529	// ID - The resource ID.
1530	ID *string `json:"id,omitempty"`
1531	// Name - The name of the resource.
1532	Name *string `json:"name,omitempty"`
1533	// Type - The type of the resource.
1534	Type *string `json:"type,omitempty"`
1535	// Location - The location of the resource. This cannot be changed after the resource is created.
1536	Location *string `json:"location,omitempty"`
1537	// Tags - The tags of the resource.
1538	Tags map[string]*string `json:"tags"`
1539}
1540
1541// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
1542// MarshalJSON is the custom marshaler for Resource.
1543func (r Resource) MarshalJSON() ([]byte, error) {
1544	objectMap := make(map[string]interface{})
1545	if r.ID != nil {
1546		objectMap["id"] = r.ID
1547	}
1548	if r.Name != nil {
1549		objectMap["name"] = r.Name
1550	}
1551	if r.Type != nil {
1552		objectMap["type"] = r.Type
1553	}
1554	if r.Location != nil {
1555		objectMap["location"] = r.Location
1556	}
1557	if r.Tags != nil {
1558		objectMap["tags"] = r.Tags
1559	}
1560	return json.Marshal(objectMap)
1561}
1562
1563// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
1564// Sku the SKU of a container registry.
1565type Sku struct {
1566	// Name - The SKU name of the container registry. Required for registry creation. Possible values include: 'Basic', 'ManagedBasic', 'ManagedStandard', 'ManagedPremium'
1567	Name SkuName `json:"name,omitempty"`
1568	// Tier - The SKU tier based on the SKU name. Possible values include: 'SkuTierBasic', 'SkuTierManaged'
1569	Tier SkuTier `json:"tier,omitempty"`
1570}
1571
1572// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
1573// Source the registry node that generated the event. Put differently, while the actor initiates the event, the
1574// source generates it.
1575type Source struct {
1576	// Addr - The IP or hostname and the port of the registry node that generated the event. Generally, this will be resolved by os.Hostname() along with the running port.
1577	Addr *string `json:"addr,omitempty"`
1578	// InstanceID - The running instance of an application. Changes after each restart.
1579	InstanceID *string `json:"instanceID,omitempty"`
1580}
1581
1582// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
1583// Status the status of an Azure resource at the time the operation was called.
1584type Status struct {
1585	// DisplayStatus - The short label for the status.
1586	DisplayStatus *string `json:"displayStatus,omitempty"`
1587	// Message - The detailed message for the status, including alerts and error messages.
1588	Message *string `json:"message,omitempty"`
1589	// Timestamp - The timestamp when the status was changed to the current value.
1590	Timestamp *date.Time `json:"timestamp,omitempty"`
1591}
1592
1593// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
1594// StorageAccountProperties the properties of a storage account for a container registry. Only applicable to Basic
1595// SKU.
1596type StorageAccountProperties struct {
1597	// ID - The resource ID of the storage account.
1598	ID *string `json:"id,omitempty"`
1599}
1600
1601// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
1602// Target the target of the event.
1603type Target struct {
1604	// MediaType - The MIME type of the referenced object.
1605	MediaType *string `json:"mediaType,omitempty"`
1606	// Size - The number of bytes of the content. Same as Length field.
1607	Size *int64 `json:"size,omitempty"`
1608	// Digest - The digest of the content, as defined by the Registry V2 HTTP API Specificiation.
1609	Digest *string `json:"digest,omitempty"`
1610	// Length - The number of bytes of the content. Same as Size field.
1611	Length *int64 `json:"length,omitempty"`
1612	// Repository - The repository name.
1613	Repository *string `json:"repository,omitempty"`
1614	// URL - The direct URL to the content.
1615	URL *string `json:"url,omitempty"`
1616	// Tag - The tag name.
1617	Tag *string `json:"tag,omitempty"`
1618}
1619
1620// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
1621// Webhook an object that represents a webhook for a container registry.
1622type Webhook struct {
1623	autorest.Response `json:"-"`
1624	// WebhookProperties - The properties of the webhook.
1625	*WebhookProperties `json:"properties,omitempty"`
1626	// ID - The resource ID.
1627	ID *string `json:"id,omitempty"`
1628	// Name - The name of the resource.
1629	Name *string `json:"name,omitempty"`
1630	// Type - The type of the resource.
1631	Type *string `json:"type,omitempty"`
1632	// Location - The location of the resource. This cannot be changed after the resource is created.
1633	Location *string `json:"location,omitempty"`
1634	// Tags - The tags of the resource.
1635	Tags map[string]*string `json:"tags"`
1636}
1637
1638// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
1639// MarshalJSON is the custom marshaler for Webhook.
1640func (w Webhook) MarshalJSON() ([]byte, error) {
1641	objectMap := make(map[string]interface{})
1642	if w.WebhookProperties != nil {
1643		objectMap["properties"] = w.WebhookProperties
1644	}
1645	if w.ID != nil {
1646		objectMap["id"] = w.ID
1647	}
1648	if w.Name != nil {
1649		objectMap["name"] = w.Name
1650	}
1651	if w.Type != nil {
1652		objectMap["type"] = w.Type
1653	}
1654	if w.Location != nil {
1655		objectMap["location"] = w.Location
1656	}
1657	if w.Tags != nil {
1658		objectMap["tags"] = w.Tags
1659	}
1660	return json.Marshal(objectMap)
1661}
1662
1663// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
1664// UnmarshalJSON is the custom unmarshaler for Webhook struct.
1665func (w *Webhook) UnmarshalJSON(body []byte) error {
1666	var m map[string]*json.RawMessage
1667	err := json.Unmarshal(body, &m)
1668	if err != nil {
1669		return err
1670	}
1671	for k, v := range m {
1672		switch k {
1673		case "properties":
1674			if v != nil {
1675				var webhookProperties WebhookProperties
1676				err = json.Unmarshal(*v, &webhookProperties)
1677				if err != nil {
1678					return err
1679				}
1680				w.WebhookProperties = &webhookProperties
1681			}
1682		case "id":
1683			if v != nil {
1684				var ID string
1685				err = json.Unmarshal(*v, &ID)
1686				if err != nil {
1687					return err
1688				}
1689				w.ID = &ID
1690			}
1691		case "name":
1692			if v != nil {
1693				var name string
1694				err = json.Unmarshal(*v, &name)
1695				if err != nil {
1696					return err
1697				}
1698				w.Name = &name
1699			}
1700		case "type":
1701			if v != nil {
1702				var typeVar string
1703				err = json.Unmarshal(*v, &typeVar)
1704				if err != nil {
1705					return err
1706				}
1707				w.Type = &typeVar
1708			}
1709		case "location":
1710			if v != nil {
1711				var location string
1712				err = json.Unmarshal(*v, &location)
1713				if err != nil {
1714					return err
1715				}
1716				w.Location = &location
1717			}
1718		case "tags":
1719			if v != nil {
1720				var tags map[string]*string
1721				err = json.Unmarshal(*v, &tags)
1722				if err != nil {
1723					return err
1724				}
1725				w.Tags = tags
1726			}
1727		}
1728	}
1729
1730	return nil
1731}
1732
1733// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
1734// WebhookCreateParameters the parameters for creating a webhook.
1735type WebhookCreateParameters struct {
1736	// Tags - The tags for the webhook.
1737	Tags map[string]*string `json:"tags"`
1738	// Location - The location of the webhook. This cannot be changed after the resource is created.
1739	Location *string `json:"location,omitempty"`
1740	// WebhookPropertiesCreateParameters - The properties that the webhook will be created with.
1741	*WebhookPropertiesCreateParameters `json:"properties,omitempty"`
1742}
1743
1744// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
1745// MarshalJSON is the custom marshaler for WebhookCreateParameters.
1746func (wcp WebhookCreateParameters) MarshalJSON() ([]byte, error) {
1747	objectMap := make(map[string]interface{})
1748	if wcp.Tags != nil {
1749		objectMap["tags"] = wcp.Tags
1750	}
1751	if wcp.Location != nil {
1752		objectMap["location"] = wcp.Location
1753	}
1754	if wcp.WebhookPropertiesCreateParameters != nil {
1755		objectMap["properties"] = wcp.WebhookPropertiesCreateParameters
1756	}
1757	return json.Marshal(objectMap)
1758}
1759
1760// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
1761// UnmarshalJSON is the custom unmarshaler for WebhookCreateParameters struct.
1762func (wcp *WebhookCreateParameters) UnmarshalJSON(body []byte) error {
1763	var m map[string]*json.RawMessage
1764	err := json.Unmarshal(body, &m)
1765	if err != nil {
1766		return err
1767	}
1768	for k, v := range m {
1769		switch k {
1770		case "tags":
1771			if v != nil {
1772				var tags map[string]*string
1773				err = json.Unmarshal(*v, &tags)
1774				if err != nil {
1775					return err
1776				}
1777				wcp.Tags = tags
1778			}
1779		case "location":
1780			if v != nil {
1781				var location string
1782				err = json.Unmarshal(*v, &location)
1783				if err != nil {
1784					return err
1785				}
1786				wcp.Location = &location
1787			}
1788		case "properties":
1789			if v != nil {
1790				var webhookPropertiesCreateParameters WebhookPropertiesCreateParameters
1791				err = json.Unmarshal(*v, &webhookPropertiesCreateParameters)
1792				if err != nil {
1793					return err
1794				}
1795				wcp.WebhookPropertiesCreateParameters = &webhookPropertiesCreateParameters
1796			}
1797		}
1798	}
1799
1800	return nil
1801}
1802
1803// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
1804// WebhookListResult the result of a request to list webhooks for a container registry.
1805type WebhookListResult struct {
1806	autorest.Response `json:"-"`
1807	// Value - The list of webhooks. Since this list may be incomplete, the nextLink field should be used to request the next list of webhooks.
1808	Value *[]Webhook `json:"value,omitempty"`
1809	// NextLink - The URI that can be used to request the next list of webhooks.
1810	NextLink *string `json:"nextLink,omitempty"`
1811}
1812
1813// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
1814// WebhookListResultIterator provides access to a complete listing of Webhook values.
1815type WebhookListResultIterator struct {
1816	i    int
1817	page WebhookListResultPage
1818}
1819
1820// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
1821// Next advances to the next value.  If there was an error making
1822// the request the iterator does not advance and the error is returned.
1823func (iter *WebhookListResultIterator) Next() error {
1824	iter.i++
1825	if iter.i < len(iter.page.Values()) {
1826		return nil
1827	}
1828	err := iter.page.Next()
1829	if err != nil {
1830		iter.i--
1831		return err
1832	}
1833	iter.i = 0
1834	return nil
1835}
1836
1837// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
1838// NotDone returns true if the enumeration should be started or is not yet complete.
1839func (iter WebhookListResultIterator) NotDone() bool {
1840	return iter.page.NotDone() && iter.i < len(iter.page.Values())
1841}
1842
1843// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
1844// Response returns the raw server response from the last page request.
1845func (iter WebhookListResultIterator) Response() WebhookListResult {
1846	return iter.page.Response()
1847}
1848
1849// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
1850// Value returns the current value or a zero-initialized value if the
1851// iterator has advanced beyond the end of the collection.
1852func (iter WebhookListResultIterator) Value() Webhook {
1853	if !iter.page.NotDone() {
1854		return Webhook{}
1855	}
1856	return iter.page.Values()[iter.i]
1857}
1858
1859// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
1860// IsEmpty returns true if the ListResult contains no values.
1861func (wlr WebhookListResult) IsEmpty() bool {
1862	return wlr.Value == nil || len(*wlr.Value) == 0
1863}
1864
1865// webhookListResultPreparer prepares a request to retrieve the next set of results.
1866// It returns nil if no more results exist.
1867func (wlr WebhookListResult) webhookListResultPreparer() (*http.Request, error) {
1868	if wlr.NextLink == nil || len(to.String(wlr.NextLink)) < 1 {
1869		return nil, nil
1870	}
1871	return autorest.Prepare(&http.Request{},
1872		autorest.AsJSON(),
1873		autorest.AsGet(),
1874		autorest.WithBaseURL(to.String(wlr.NextLink)))
1875}
1876
1877// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
1878// WebhookListResultPage contains a page of Webhook values.
1879type WebhookListResultPage struct {
1880	fn  func(WebhookListResult) (WebhookListResult, error)
1881	wlr WebhookListResult
1882}
1883
1884// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
1885// Next advances to the next page of values.  If there was an error making
1886// the request the page does not advance and the error is returned.
1887func (page *WebhookListResultPage) Next() error {
1888	next, err := page.fn(page.wlr)
1889	if err != nil {
1890		return err
1891	}
1892	page.wlr = next
1893	return nil
1894}
1895
1896// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
1897// NotDone returns true if the page enumeration should be started or is not yet complete.
1898func (page WebhookListResultPage) NotDone() bool {
1899	return !page.wlr.IsEmpty()
1900}
1901
1902// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
1903// Response returns the raw server response from the last page request.
1904func (page WebhookListResultPage) Response() WebhookListResult {
1905	return page.wlr
1906}
1907
1908// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
1909// Values returns the slice of values for the current page or nil if there are no values.
1910func (page WebhookListResultPage) Values() []Webhook {
1911	if page.wlr.IsEmpty() {
1912		return nil
1913	}
1914	return *page.wlr.Value
1915}
1916
1917// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
1918// WebhookProperties the properties of a webhook.
1919type WebhookProperties struct {
1920	// Status - The status of the webhook at the time the operation was called. Possible values include: 'Enabled', 'Disabled'
1921	Status WebhookStatus `json:"status,omitempty"`
1922	// Scope - The scope of repositories where the event can be triggered. For example, 'foo:*' means events for all tags under repository 'foo'. 'foo:bar' means events for 'foo:bar' only. 'foo' is equivalent to 'foo:latest'. Empty means all events.
1923	Scope *string `json:"scope,omitempty"`
1924	// Actions - The list of actions that trigger the webhook to post notifications.
1925	Actions *[]WebhookAction `json:"actions,omitempty"`
1926	// ProvisioningState - The provisioning state of the webhook at the time the operation was called. Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', 'Canceled'
1927	ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
1928}
1929
1930// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
1931// WebhookPropertiesCreateParameters the parameters for creating the properties of a webhook.
1932type WebhookPropertiesCreateParameters struct {
1933	// ServiceURI - The service URI for the webhook to post notifications.
1934	ServiceURI *string `json:"serviceUri,omitempty"`
1935	// CustomHeaders - Custom headers that will be added to the webhook notifications.
1936	CustomHeaders map[string]*string `json:"customHeaders"`
1937	// Status - The status of the webhook at the time the operation was called. Possible values include: 'Enabled', 'Disabled'
1938	Status WebhookStatus `json:"status,omitempty"`
1939	// Scope - The scope of repositories where the event can be triggered. For example, 'foo:*' means events for all tags under repository 'foo'. 'foo:bar' means events for 'foo:bar' only. 'foo' is equivalent to 'foo:latest'. Empty means all events.
1940	Scope *string `json:"scope,omitempty"`
1941	// Actions - The list of actions that trigger the webhook to post notifications.
1942	Actions *[]WebhookAction `json:"actions,omitempty"`
1943}
1944
1945// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
1946// MarshalJSON is the custom marshaler for WebhookPropertiesCreateParameters.
1947func (wpcp WebhookPropertiesCreateParameters) MarshalJSON() ([]byte, error) {
1948	objectMap := make(map[string]interface{})
1949	if wpcp.ServiceURI != nil {
1950		objectMap["serviceUri"] = wpcp.ServiceURI
1951	}
1952	if wpcp.CustomHeaders != nil {
1953		objectMap["customHeaders"] = wpcp.CustomHeaders
1954	}
1955	if wpcp.Status != "" {
1956		objectMap["status"] = wpcp.Status
1957	}
1958	if wpcp.Scope != nil {
1959		objectMap["scope"] = wpcp.Scope
1960	}
1961	if wpcp.Actions != nil {
1962		objectMap["actions"] = wpcp.Actions
1963	}
1964	return json.Marshal(objectMap)
1965}
1966
1967// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
1968// WebhookPropertiesUpdateParameters the parameters for updating the properties of a webhook.
1969type WebhookPropertiesUpdateParameters struct {
1970	// ServiceURI - The service URI for the webhook to post notifications.
1971	ServiceURI *string `json:"serviceUri,omitempty"`
1972	// CustomHeaders - Custom headers that will be added to the webhook notifications.
1973	CustomHeaders map[string]*string `json:"customHeaders"`
1974	// Status - The status of the webhook at the time the operation was called. Possible values include: 'Enabled', 'Disabled'
1975	Status WebhookStatus `json:"status,omitempty"`
1976	// Scope - The scope of repositories where the event can be triggered. For example, 'foo:*' means events for all tags under repository 'foo'. 'foo:bar' means events for 'foo:bar' only. 'foo' is equivalent to 'foo:latest'. Empty means all events.
1977	Scope *string `json:"scope,omitempty"`
1978	// Actions - The list of actions that trigger the webhook to post notifications.
1979	Actions *[]WebhookAction `json:"actions,omitempty"`
1980}
1981
1982// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
1983// MarshalJSON is the custom marshaler for WebhookPropertiesUpdateParameters.
1984func (wpup WebhookPropertiesUpdateParameters) MarshalJSON() ([]byte, error) {
1985	objectMap := make(map[string]interface{})
1986	if wpup.ServiceURI != nil {
1987		objectMap["serviceUri"] = wpup.ServiceURI
1988	}
1989	if wpup.CustomHeaders != nil {
1990		objectMap["customHeaders"] = wpup.CustomHeaders
1991	}
1992	if wpup.Status != "" {
1993		objectMap["status"] = wpup.Status
1994	}
1995	if wpup.Scope != nil {
1996		objectMap["scope"] = wpup.Scope
1997	}
1998	if wpup.Actions != nil {
1999		objectMap["actions"] = wpup.Actions
2000	}
2001	return json.Marshal(objectMap)
2002}
2003
2004// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
2005// WebhooksCreateFuture an abstraction for monitoring and retrieving the results of a long-running operation.
2006type WebhooksCreateFuture struct {
2007	azure.Future
2008	req *http.Request
2009}
2010
2011// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
2012// Result returns the result of the asynchronous operation.
2013// If the operation has not completed it will return an error.
2014func (future WebhooksCreateFuture) Result(client WebhooksClient) (w Webhook, err error) {
2015	var done bool
2016	done, err = future.Done(client)
2017	if err != nil {
2018		err = autorest.NewErrorWithError(err, "containerregistry.WebhooksCreateFuture", "Result", future.Response(), "Polling failure")
2019		return
2020	}
2021	if !done {
2022		return w, azure.NewAsyncOpIncompleteError("containerregistry.WebhooksCreateFuture")
2023	}
2024	if future.PollingMethod() == azure.PollingLocation {
2025		w, err = client.CreateResponder(future.Response())
2026		if err != nil {
2027			err = autorest.NewErrorWithError(err, "containerregistry.WebhooksCreateFuture", "Result", future.Response(), "Failure responding to request")
2028		}
2029		return
2030	}
2031	var req *http.Request
2032	var resp *http.Response
2033	if future.PollingURL() != "" {
2034		req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil)
2035		if err != nil {
2036			return
2037		}
2038	} else {
2039		req = autorest.ChangeToGet(future.req)
2040	}
2041	resp, err = autorest.SendWithSender(client, req,
2042		autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
2043	if err != nil {
2044		err = autorest.NewErrorWithError(err, "containerregistry.WebhooksCreateFuture", "Result", resp, "Failure sending request")
2045		return
2046	}
2047	w, err = client.CreateResponder(resp)
2048	if err != nil {
2049		err = autorest.NewErrorWithError(err, "containerregistry.WebhooksCreateFuture", "Result", resp, "Failure responding to request")
2050	}
2051	return
2052}
2053
2054// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
2055// WebhooksDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation.
2056type WebhooksDeleteFuture struct {
2057	azure.Future
2058	req *http.Request
2059}
2060
2061// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
2062// Result returns the result of the asynchronous operation.
2063// If the operation has not completed it will return an error.
2064func (future WebhooksDeleteFuture) Result(client WebhooksClient) (ar autorest.Response, err error) {
2065	var done bool
2066	done, err = future.Done(client)
2067	if err != nil {
2068		err = autorest.NewErrorWithError(err, "containerregistry.WebhooksDeleteFuture", "Result", future.Response(), "Polling failure")
2069		return
2070	}
2071	if !done {
2072		return ar, azure.NewAsyncOpIncompleteError("containerregistry.WebhooksDeleteFuture")
2073	}
2074	if future.PollingMethod() == azure.PollingLocation {
2075		ar, err = client.DeleteResponder(future.Response())
2076		if err != nil {
2077			err = autorest.NewErrorWithError(err, "containerregistry.WebhooksDeleteFuture", "Result", future.Response(), "Failure responding to request")
2078		}
2079		return
2080	}
2081	var req *http.Request
2082	var resp *http.Response
2083	if future.PollingURL() != "" {
2084		req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil)
2085		if err != nil {
2086			return
2087		}
2088	} else {
2089		req = autorest.ChangeToGet(future.req)
2090	}
2091	resp, err = autorest.SendWithSender(client, req,
2092		autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
2093	if err != nil {
2094		err = autorest.NewErrorWithError(err, "containerregistry.WebhooksDeleteFuture", "Result", resp, "Failure sending request")
2095		return
2096	}
2097	ar, err = client.DeleteResponder(resp)
2098	if err != nil {
2099		err = autorest.NewErrorWithError(err, "containerregistry.WebhooksDeleteFuture", "Result", resp, "Failure responding to request")
2100	}
2101	return
2102}
2103
2104// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
2105// WebhooksUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation.
2106type WebhooksUpdateFuture struct {
2107	azure.Future
2108	req *http.Request
2109}
2110
2111// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
2112// Result returns the result of the asynchronous operation.
2113// If the operation has not completed it will return an error.
2114func (future WebhooksUpdateFuture) Result(client WebhooksClient) (w Webhook, err error) {
2115	var done bool
2116	done, err = future.Done(client)
2117	if err != nil {
2118		err = autorest.NewErrorWithError(err, "containerregistry.WebhooksUpdateFuture", "Result", future.Response(), "Polling failure")
2119		return
2120	}
2121	if !done {
2122		return w, azure.NewAsyncOpIncompleteError("containerregistry.WebhooksUpdateFuture")
2123	}
2124	if future.PollingMethod() == azure.PollingLocation {
2125		w, err = client.UpdateResponder(future.Response())
2126		if err != nil {
2127			err = autorest.NewErrorWithError(err, "containerregistry.WebhooksUpdateFuture", "Result", future.Response(), "Failure responding to request")
2128		}
2129		return
2130	}
2131	var req *http.Request
2132	var resp *http.Response
2133	if future.PollingURL() != "" {
2134		req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil)
2135		if err != nil {
2136			return
2137		}
2138	} else {
2139		req = autorest.ChangeToGet(future.req)
2140	}
2141	resp, err = autorest.SendWithSender(client, req,
2142		autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
2143	if err != nil {
2144		err = autorest.NewErrorWithError(err, "containerregistry.WebhooksUpdateFuture", "Result", resp, "Failure sending request")
2145		return
2146	}
2147	w, err = client.UpdateResponder(resp)
2148	if err != nil {
2149		err = autorest.NewErrorWithError(err, "containerregistry.WebhooksUpdateFuture", "Result", resp, "Failure responding to request")
2150	}
2151	return
2152}
2153
2154// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
2155// WebhookUpdateParameters the parameters for updating a webhook.
2156type WebhookUpdateParameters struct {
2157	// Tags - The tags for the webhook.
2158	Tags map[string]*string `json:"tags"`
2159	// WebhookPropertiesUpdateParameters - The properties that the webhook will be updated with.
2160	*WebhookPropertiesUpdateParameters `json:"properties,omitempty"`
2161}
2162
2163// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
2164// MarshalJSON is the custom marshaler for WebhookUpdateParameters.
2165func (wup WebhookUpdateParameters) MarshalJSON() ([]byte, error) {
2166	objectMap := make(map[string]interface{})
2167	if wup.Tags != nil {
2168		objectMap["tags"] = wup.Tags
2169	}
2170	if wup.WebhookPropertiesUpdateParameters != nil {
2171		objectMap["properties"] = wup.WebhookPropertiesUpdateParameters
2172	}
2173	return json.Marshal(objectMap)
2174}
2175
2176// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2017-06-01-preview/containerregistry instead.
2177// UnmarshalJSON is the custom unmarshaler for WebhookUpdateParameters struct.
2178func (wup *WebhookUpdateParameters) UnmarshalJSON(body []byte) error {
2179	var m map[string]*json.RawMessage
2180	err := json.Unmarshal(body, &m)
2181	if err != nil {
2182		return err
2183	}
2184	for k, v := range m {
2185		switch k {
2186		case "tags":
2187			if v != nil {
2188				var tags map[string]*string
2189				err = json.Unmarshal(*v, &tags)
2190				if err != nil {
2191					return err
2192				}
2193				wup.Tags = tags
2194			}
2195		case "properties":
2196			if v != nil {
2197				var webhookPropertiesUpdateParameters WebhookPropertiesUpdateParameters
2198				err = json.Unmarshal(*v, &webhookPropertiesUpdateParameters)
2199				if err != nil {
2200					return err
2201				}
2202				wup.WebhookPropertiesUpdateParameters = &webhookPropertiesUpdateParameters
2203			}
2204		}
2205	}
2206
2207	return nil
2208}
2209