1package containerregistry
2
3// Copyright (c) Microsoft Corporation. All rights reserved.
4// Licensed under the MIT License. See License.txt in the project root for license information.
5//
6// Code generated by Microsoft (R) AutoRest Code Generator.
7// Changes may cause incorrect behavior and will be lost if the code is regenerated.
8
9import (
10	"context"
11	"encoding/json"
12	"github.com/Azure/go-autorest/autorest"
13	"github.com/Azure/go-autorest/autorest/azure"
14	"github.com/Azure/go-autorest/autorest/date"
15	"github.com/Azure/go-autorest/autorest/to"
16	"github.com/Azure/go-autorest/tracing"
17	"net/http"
18)
19
20// The package's fully qualified name.
21const fqdn = "github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2019-12-01-preview/containerregistry"
22
23// ActiveDirectoryObject the Active Directory Object that will be used for authenticating the token of a
24// container registry.
25type ActiveDirectoryObject struct {
26	// ObjectID - The user/group/application object ID for Active Directory Object that will be used for authenticating the token of a container registry.
27	ObjectID *string `json:"objectId,omitempty"`
28	// TenantID - The tenant ID of user/group/application object Active Directory Object that will be used for authenticating the token of a container registry.
29	TenantID *string `json:"tenantId,omitempty"`
30}
31
32// Actor the agent that initiated the event. For most situations, this could be from the authorization
33// context of the request.
34type Actor struct {
35	// Name - The subject or username associated with the request context that generated the event.
36	Name *string `json:"name,omitempty"`
37}
38
39// AgentPool the agentpool that has the ARM resource and properties.
40// The agentpool will have all information to create an agent pool.
41type AgentPool struct {
42	autorest.Response `json:"-"`
43	// AgentPoolProperties - The properties associated with the agent pool
44	*AgentPoolProperties `json:"properties,omitempty"`
45	// ID - READ-ONLY; The resource ID.
46	ID *string `json:"id,omitempty"`
47	// Name - READ-ONLY; The name of the resource.
48	Name *string `json:"name,omitempty"`
49	// Type - READ-ONLY; The type of the resource.
50	Type *string `json:"type,omitempty"`
51	// Location - The location of the resource. This cannot be changed after the resource is created.
52	Location *string `json:"location,omitempty"`
53	// Tags - The tags of the resource.
54	Tags map[string]*string `json:"tags"`
55	// SystemData - READ-ONLY; Metadata pertaining to creation and last modification of the resource.
56	SystemData *SystemData `json:"systemData,omitempty"`
57}
58
59// MarshalJSON is the custom marshaler for AgentPool.
60func (ap AgentPool) MarshalJSON() ([]byte, error) {
61	objectMap := make(map[string]interface{})
62	if ap.AgentPoolProperties != nil {
63		objectMap["properties"] = ap.AgentPoolProperties
64	}
65	if ap.Location != nil {
66		objectMap["location"] = ap.Location
67	}
68	if ap.Tags != nil {
69		objectMap["tags"] = ap.Tags
70	}
71	return json.Marshal(objectMap)
72}
73
74// UnmarshalJSON is the custom unmarshaler for AgentPool struct.
75func (ap *AgentPool) UnmarshalJSON(body []byte) error {
76	var m map[string]*json.RawMessage
77	err := json.Unmarshal(body, &m)
78	if err != nil {
79		return err
80	}
81	for k, v := range m {
82		switch k {
83		case "properties":
84			if v != nil {
85				var agentPoolProperties AgentPoolProperties
86				err = json.Unmarshal(*v, &agentPoolProperties)
87				if err != nil {
88					return err
89				}
90				ap.AgentPoolProperties = &agentPoolProperties
91			}
92		case "id":
93			if v != nil {
94				var ID string
95				err = json.Unmarshal(*v, &ID)
96				if err != nil {
97					return err
98				}
99				ap.ID = &ID
100			}
101		case "name":
102			if v != nil {
103				var name string
104				err = json.Unmarshal(*v, &name)
105				if err != nil {
106					return err
107				}
108				ap.Name = &name
109			}
110		case "type":
111			if v != nil {
112				var typeVar string
113				err = json.Unmarshal(*v, &typeVar)
114				if err != nil {
115					return err
116				}
117				ap.Type = &typeVar
118			}
119		case "location":
120			if v != nil {
121				var location string
122				err = json.Unmarshal(*v, &location)
123				if err != nil {
124					return err
125				}
126				ap.Location = &location
127			}
128		case "tags":
129			if v != nil {
130				var tags map[string]*string
131				err = json.Unmarshal(*v, &tags)
132				if err != nil {
133					return err
134				}
135				ap.Tags = tags
136			}
137		case "systemData":
138			if v != nil {
139				var systemData SystemData
140				err = json.Unmarshal(*v, &systemData)
141				if err != nil {
142					return err
143				}
144				ap.SystemData = &systemData
145			}
146		}
147	}
148
149	return nil
150}
151
152// AgentPoolListResult the collection of agent pools.
153type AgentPoolListResult struct {
154	autorest.Response `json:"-"`
155	// Value - The collection value.
156	Value *[]AgentPool `json:"value,omitempty"`
157	// NextLink - The URI that can be used to request the next set of paged results.
158	NextLink *string `json:"nextLink,omitempty"`
159}
160
161// AgentPoolListResultIterator provides access to a complete listing of AgentPool values.
162type AgentPoolListResultIterator struct {
163	i    int
164	page AgentPoolListResultPage
165}
166
167// NextWithContext advances to the next value.  If there was an error making
168// the request the iterator does not advance and the error is returned.
169func (iter *AgentPoolListResultIterator) NextWithContext(ctx context.Context) (err error) {
170	if tracing.IsEnabled() {
171		ctx = tracing.StartSpan(ctx, fqdn+"/AgentPoolListResultIterator.NextWithContext")
172		defer func() {
173			sc := -1
174			if iter.Response().Response.Response != nil {
175				sc = iter.Response().Response.Response.StatusCode
176			}
177			tracing.EndSpan(ctx, sc, err)
178		}()
179	}
180	iter.i++
181	if iter.i < len(iter.page.Values()) {
182		return nil
183	}
184	err = iter.page.NextWithContext(ctx)
185	if err != nil {
186		iter.i--
187		return err
188	}
189	iter.i = 0
190	return nil
191}
192
193// Next advances to the next value.  If there was an error making
194// the request the iterator does not advance and the error is returned.
195// Deprecated: Use NextWithContext() instead.
196func (iter *AgentPoolListResultIterator) Next() error {
197	return iter.NextWithContext(context.Background())
198}
199
200// NotDone returns true if the enumeration should be started or is not yet complete.
201func (iter AgentPoolListResultIterator) NotDone() bool {
202	return iter.page.NotDone() && iter.i < len(iter.page.Values())
203}
204
205// Response returns the raw server response from the last page request.
206func (iter AgentPoolListResultIterator) Response() AgentPoolListResult {
207	return iter.page.Response()
208}
209
210// Value returns the current value or a zero-initialized value if the
211// iterator has advanced beyond the end of the collection.
212func (iter AgentPoolListResultIterator) Value() AgentPool {
213	if !iter.page.NotDone() {
214		return AgentPool{}
215	}
216	return iter.page.Values()[iter.i]
217}
218
219// Creates a new instance of the AgentPoolListResultIterator type.
220func NewAgentPoolListResultIterator(page AgentPoolListResultPage) AgentPoolListResultIterator {
221	return AgentPoolListResultIterator{page: page}
222}
223
224// IsEmpty returns true if the ListResult contains no values.
225func (aplr AgentPoolListResult) IsEmpty() bool {
226	return aplr.Value == nil || len(*aplr.Value) == 0
227}
228
229// hasNextLink returns true if the NextLink is not empty.
230func (aplr AgentPoolListResult) hasNextLink() bool {
231	return aplr.NextLink != nil && len(*aplr.NextLink) != 0
232}
233
234// agentPoolListResultPreparer prepares a request to retrieve the next set of results.
235// It returns nil if no more results exist.
236func (aplr AgentPoolListResult) agentPoolListResultPreparer(ctx context.Context) (*http.Request, error) {
237	if !aplr.hasNextLink() {
238		return nil, nil
239	}
240	return autorest.Prepare((&http.Request{}).WithContext(ctx),
241		autorest.AsJSON(),
242		autorest.AsGet(),
243		autorest.WithBaseURL(to.String(aplr.NextLink)))
244}
245
246// AgentPoolListResultPage contains a page of AgentPool values.
247type AgentPoolListResultPage struct {
248	fn   func(context.Context, AgentPoolListResult) (AgentPoolListResult, error)
249	aplr AgentPoolListResult
250}
251
252// NextWithContext advances to the next page of values.  If there was an error making
253// the request the page does not advance and the error is returned.
254func (page *AgentPoolListResultPage) NextWithContext(ctx context.Context) (err error) {
255	if tracing.IsEnabled() {
256		ctx = tracing.StartSpan(ctx, fqdn+"/AgentPoolListResultPage.NextWithContext")
257		defer func() {
258			sc := -1
259			if page.Response().Response.Response != nil {
260				sc = page.Response().Response.Response.StatusCode
261			}
262			tracing.EndSpan(ctx, sc, err)
263		}()
264	}
265	for {
266		next, err := page.fn(ctx, page.aplr)
267		if err != nil {
268			return err
269		}
270		page.aplr = next
271		if !next.hasNextLink() || !next.IsEmpty() {
272			break
273		}
274	}
275	return nil
276}
277
278// Next advances to the next page of values.  If there was an error making
279// the request the page does not advance and the error is returned.
280// Deprecated: Use NextWithContext() instead.
281func (page *AgentPoolListResultPage) Next() error {
282	return page.NextWithContext(context.Background())
283}
284
285// NotDone returns true if the page enumeration should be started or is not yet complete.
286func (page AgentPoolListResultPage) NotDone() bool {
287	return !page.aplr.IsEmpty()
288}
289
290// Response returns the raw server response from the last page request.
291func (page AgentPoolListResultPage) Response() AgentPoolListResult {
292	return page.aplr
293}
294
295// Values returns the slice of values for the current page or nil if there are no values.
296func (page AgentPoolListResultPage) Values() []AgentPool {
297	if page.aplr.IsEmpty() {
298		return nil
299	}
300	return *page.aplr.Value
301}
302
303// Creates a new instance of the AgentPoolListResultPage type.
304func NewAgentPoolListResultPage(cur AgentPoolListResult, getNextPage func(context.Context, AgentPoolListResult) (AgentPoolListResult, error)) AgentPoolListResultPage {
305	return AgentPoolListResultPage{
306		fn:   getNextPage,
307		aplr: cur,
308	}
309}
310
311// AgentPoolProperties the properties of agent pool.
312type AgentPoolProperties struct {
313	// Count - The count of agent machine
314	Count *int32 `json:"count,omitempty"`
315	// Tier - The Tier of agent machine
316	Tier *string `json:"tier,omitempty"`
317	// Os - The OS of agent machine. Possible values include: 'Windows', 'Linux'
318	Os OS `json:"os,omitempty"`
319	// VirtualNetworkSubnetResourceID - The Virtual Network Subnet Resource Id of the agent machine
320	VirtualNetworkSubnetResourceID *string `json:"virtualNetworkSubnetResourceId,omitempty"`
321	// ProvisioningState - READ-ONLY; The provisioning state of this agent pool. Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', 'Canceled'
322	ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
323}
324
325// MarshalJSON is the custom marshaler for AgentPoolProperties.
326func (app AgentPoolProperties) MarshalJSON() ([]byte, error) {
327	objectMap := make(map[string]interface{})
328	if app.Count != nil {
329		objectMap["count"] = app.Count
330	}
331	if app.Tier != nil {
332		objectMap["tier"] = app.Tier
333	}
334	if app.Os != "" {
335		objectMap["os"] = app.Os
336	}
337	if app.VirtualNetworkSubnetResourceID != nil {
338		objectMap["virtualNetworkSubnetResourceId"] = app.VirtualNetworkSubnetResourceID
339	}
340	return json.Marshal(objectMap)
341}
342
343// AgentPoolPropertiesUpdateParameters ...
344type AgentPoolPropertiesUpdateParameters struct {
345	// Count - The count of agent machine
346	Count *int32 `json:"count,omitempty"`
347}
348
349// AgentPoolQueueStatus the QueueStatus of Agent Pool
350type AgentPoolQueueStatus struct {
351	autorest.Response `json:"-"`
352	// Count - The number of pending runs in the queue
353	Count *int32 `json:"count,omitempty"`
354}
355
356// AgentPoolsCreateFuture an abstraction for monitoring and retrieving the results of a long-running
357// operation.
358type AgentPoolsCreateFuture struct {
359	azure.FutureAPI
360	// Result returns the result of the asynchronous operation.
361	// If the operation has not completed it will return an error.
362	Result func(AgentPoolsClient) (AgentPool, error)
363}
364
365// UnmarshalJSON is the custom unmarshaller for CreateFuture.
366func (future *AgentPoolsCreateFuture) UnmarshalJSON(body []byte) error {
367	var azFuture azure.Future
368	if err := json.Unmarshal(body, &azFuture); err != nil {
369		return err
370	}
371	future.FutureAPI = &azFuture
372	future.Result = future.result
373	return nil
374}
375
376// result is the default implementation for AgentPoolsCreateFuture.Result.
377func (future *AgentPoolsCreateFuture) result(client AgentPoolsClient) (ap AgentPool, err error) {
378	var done bool
379	done, err = future.DoneWithContext(context.Background(), client)
380	if err != nil {
381		err = autorest.NewErrorWithError(err, "containerregistry.AgentPoolsCreateFuture", "Result", future.Response(), "Polling failure")
382		return
383	}
384	if !done {
385		ap.Response.Response = future.Response()
386		err = azure.NewAsyncOpIncompleteError("containerregistry.AgentPoolsCreateFuture")
387		return
388	}
389	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
390	if ap.Response.Response, err = future.GetResult(sender); err == nil && ap.Response.Response.StatusCode != http.StatusNoContent {
391		ap, err = client.CreateResponder(ap.Response.Response)
392		if err != nil {
393			err = autorest.NewErrorWithError(err, "containerregistry.AgentPoolsCreateFuture", "Result", ap.Response.Response, "Failure responding to request")
394		}
395	}
396	return
397}
398
399// AgentPoolsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
400// operation.
401type AgentPoolsDeleteFuture struct {
402	azure.FutureAPI
403	// Result returns the result of the asynchronous operation.
404	// If the operation has not completed it will return an error.
405	Result func(AgentPoolsClient) (autorest.Response, error)
406}
407
408// UnmarshalJSON is the custom unmarshaller for CreateFuture.
409func (future *AgentPoolsDeleteFuture) UnmarshalJSON(body []byte) error {
410	var azFuture azure.Future
411	if err := json.Unmarshal(body, &azFuture); err != nil {
412		return err
413	}
414	future.FutureAPI = &azFuture
415	future.Result = future.result
416	return nil
417}
418
419// result is the default implementation for AgentPoolsDeleteFuture.Result.
420func (future *AgentPoolsDeleteFuture) result(client AgentPoolsClient) (ar autorest.Response, err error) {
421	var done bool
422	done, err = future.DoneWithContext(context.Background(), client)
423	if err != nil {
424		err = autorest.NewErrorWithError(err, "containerregistry.AgentPoolsDeleteFuture", "Result", future.Response(), "Polling failure")
425		return
426	}
427	if !done {
428		ar.Response = future.Response()
429		err = azure.NewAsyncOpIncompleteError("containerregistry.AgentPoolsDeleteFuture")
430		return
431	}
432	ar.Response = future.Response()
433	return
434}
435
436// AgentPoolsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
437// operation.
438type AgentPoolsUpdateFuture struct {
439	azure.FutureAPI
440	// Result returns the result of the asynchronous operation.
441	// If the operation has not completed it will return an error.
442	Result func(AgentPoolsClient) (AgentPool, error)
443}
444
445// UnmarshalJSON is the custom unmarshaller for CreateFuture.
446func (future *AgentPoolsUpdateFuture) UnmarshalJSON(body []byte) error {
447	var azFuture azure.Future
448	if err := json.Unmarshal(body, &azFuture); err != nil {
449		return err
450	}
451	future.FutureAPI = &azFuture
452	future.Result = future.result
453	return nil
454}
455
456// result is the default implementation for AgentPoolsUpdateFuture.Result.
457func (future *AgentPoolsUpdateFuture) result(client AgentPoolsClient) (ap AgentPool, err error) {
458	var done bool
459	done, err = future.DoneWithContext(context.Background(), client)
460	if err != nil {
461		err = autorest.NewErrorWithError(err, "containerregistry.AgentPoolsUpdateFuture", "Result", future.Response(), "Polling failure")
462		return
463	}
464	if !done {
465		ap.Response.Response = future.Response()
466		err = azure.NewAsyncOpIncompleteError("containerregistry.AgentPoolsUpdateFuture")
467		return
468	}
469	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
470	if ap.Response.Response, err = future.GetResult(sender); err == nil && ap.Response.Response.StatusCode != http.StatusNoContent {
471		ap, err = client.UpdateResponder(ap.Response.Response)
472		if err != nil {
473			err = autorest.NewErrorWithError(err, "containerregistry.AgentPoolsUpdateFuture", "Result", ap.Response.Response, "Failure responding to request")
474		}
475	}
476	return
477}
478
479// AgentPoolUpdateParameters the parameters for updating an agent pool.
480type AgentPoolUpdateParameters struct {
481	// AgentPoolPropertiesUpdateParameters - The properties associated with the agent pool
482	*AgentPoolPropertiesUpdateParameters `json:"properties,omitempty"`
483	// Tags - The ARM resource tags.
484	Tags map[string]*string `json:"tags"`
485}
486
487// MarshalJSON is the custom marshaler for AgentPoolUpdateParameters.
488func (apup AgentPoolUpdateParameters) MarshalJSON() ([]byte, error) {
489	objectMap := make(map[string]interface{})
490	if apup.AgentPoolPropertiesUpdateParameters != nil {
491		objectMap["properties"] = apup.AgentPoolPropertiesUpdateParameters
492	}
493	if apup.Tags != nil {
494		objectMap["tags"] = apup.Tags
495	}
496	return json.Marshal(objectMap)
497}
498
499// UnmarshalJSON is the custom unmarshaler for AgentPoolUpdateParameters struct.
500func (apup *AgentPoolUpdateParameters) UnmarshalJSON(body []byte) error {
501	var m map[string]*json.RawMessage
502	err := json.Unmarshal(body, &m)
503	if err != nil {
504		return err
505	}
506	for k, v := range m {
507		switch k {
508		case "properties":
509			if v != nil {
510				var agentPoolPropertiesUpdateParameters AgentPoolPropertiesUpdateParameters
511				err = json.Unmarshal(*v, &agentPoolPropertiesUpdateParameters)
512				if err != nil {
513					return err
514				}
515				apup.AgentPoolPropertiesUpdateParameters = &agentPoolPropertiesUpdateParameters
516			}
517		case "tags":
518			if v != nil {
519				var tags map[string]*string
520				err = json.Unmarshal(*v, &tags)
521				if err != nil {
522					return err
523				}
524				apup.Tags = tags
525			}
526		}
527	}
528
529	return nil
530}
531
532// AgentProperties the properties that determine the run agent configuration.
533type AgentProperties struct {
534	// CPU - The CPU configuration in terms of number of cores required for the run.
535	CPU *int32 `json:"cpu,omitempty"`
536}
537
538// Argument the properties of a run argument.
539type Argument struct {
540	// Name - The name of the argument.
541	Name *string `json:"name,omitempty"`
542	// Value - The value of the argument.
543	Value *string `json:"value,omitempty"`
544	// IsSecret - Flag to indicate whether the argument represents a secret and want to be removed from build logs.
545	IsSecret *bool `json:"isSecret,omitempty"`
546}
547
548// AuthInfo the authorization properties for accessing the source code repository.
549type AuthInfo struct {
550	// TokenType - The type of Auth token. Possible values include: 'PAT', 'OAuth'
551	TokenType TokenType `json:"tokenType,omitempty"`
552	// Token - The access token used to access the source control provider.
553	Token *string `json:"token,omitempty"`
554	// RefreshToken - The refresh token used to refresh the access token.
555	RefreshToken *string `json:"refreshToken,omitempty"`
556	// Scope - The scope of the access token.
557	Scope *string `json:"scope,omitempty"`
558	// ExpiresIn - Time in seconds that the token remains valid
559	ExpiresIn *int32 `json:"expiresIn,omitempty"`
560}
561
562// AuthInfoUpdateParameters the authorization properties for accessing the source code repository.
563type AuthInfoUpdateParameters struct {
564	// TokenType - The type of Auth token. Possible values include: 'PAT', 'OAuth'
565	TokenType TokenType `json:"tokenType,omitempty"`
566	// Token - The access token used to access the source control provider.
567	Token *string `json:"token,omitempty"`
568	// RefreshToken - The refresh token used to refresh the access token.
569	RefreshToken *string `json:"refreshToken,omitempty"`
570	// Scope - The scope of the access token.
571	Scope *string `json:"scope,omitempty"`
572	// ExpiresIn - Time in seconds that the token remains valid
573	ExpiresIn *int32 `json:"expiresIn,omitempty"`
574}
575
576// BaseImageDependency properties that describe a base image dependency.
577type BaseImageDependency struct {
578	// Type - The type of the base image dependency. Possible values include: 'BuildTime', 'RunTime'
579	Type BaseImageDependencyType `json:"type,omitempty"`
580	// Registry - The registry login server.
581	Registry *string `json:"registry,omitempty"`
582	// Repository - The repository name.
583	Repository *string `json:"repository,omitempty"`
584	// Tag - The tag name.
585	Tag *string `json:"tag,omitempty"`
586	// Digest - The sha256-based digest of the image manifest.
587	Digest *string `json:"digest,omitempty"`
588}
589
590// BaseImageTrigger the trigger based on base image dependency.
591type BaseImageTrigger struct {
592	// BaseImageTriggerType - The type of the auto trigger for base image dependency updates. Possible values include: 'All', 'Runtime'
593	BaseImageTriggerType BaseImageTriggerType `json:"baseImageTriggerType,omitempty"`
594	// UpdateTriggerEndpoint - The endpoint URL for receiving update triggers.
595	UpdateTriggerEndpoint *string `json:"updateTriggerEndpoint,omitempty"`
596	// UpdateTriggerPayloadType - Type of Payload body for Base image update triggers. Possible values include: 'UpdateTriggerPayloadTypeDefault', 'UpdateTriggerPayloadTypeToken'
597	UpdateTriggerPayloadType UpdateTriggerPayloadType `json:"updateTriggerPayloadType,omitempty"`
598	// Status - The current status of trigger. Possible values include: 'TriggerStatusEnabled', 'TriggerStatusDisabled'
599	Status TriggerStatus `json:"status,omitempty"`
600	// Name - The name of the trigger.
601	Name *string `json:"name,omitempty"`
602}
603
604// BaseImageTriggerUpdateParameters the properties for updating base image dependency trigger.
605type BaseImageTriggerUpdateParameters struct {
606	// BaseImageTriggerType - The type of the auto trigger for base image dependency updates. Possible values include: 'All', 'Runtime'
607	BaseImageTriggerType BaseImageTriggerType `json:"baseImageTriggerType,omitempty"`
608	// UpdateTriggerEndpoint - The endpoint URL for receiving update triggers.
609	UpdateTriggerEndpoint *string `json:"updateTriggerEndpoint,omitempty"`
610	// UpdateTriggerPayloadType - Type of Payload body for Base image update triggers. Possible values include: 'UpdateTriggerPayloadTypeDefault', 'UpdateTriggerPayloadTypeToken'
611	UpdateTriggerPayloadType UpdateTriggerPayloadType `json:"updateTriggerPayloadType,omitempty"`
612	// Status - The current status of trigger. Possible values include: 'TriggerStatusEnabled', 'TriggerStatusDisabled'
613	Status TriggerStatus `json:"status,omitempty"`
614	// Name - The name of the trigger.
615	Name *string `json:"name,omitempty"`
616}
617
618// CallbackConfig the configuration of service URI and custom headers for the webhook.
619type CallbackConfig struct {
620	autorest.Response `json:"-"`
621	// ServiceURI - The service URI for the webhook to post notifications.
622	ServiceURI *string `json:"serviceUri,omitempty"`
623	// CustomHeaders - Custom headers that will be added to the webhook notifications.
624	CustomHeaders map[string]*string `json:"customHeaders"`
625}
626
627// MarshalJSON is the custom marshaler for CallbackConfig.
628func (cc CallbackConfig) MarshalJSON() ([]byte, error) {
629	objectMap := make(map[string]interface{})
630	if cc.ServiceURI != nil {
631		objectMap["serviceUri"] = cc.ServiceURI
632	}
633	if cc.CustomHeaders != nil {
634		objectMap["customHeaders"] = cc.CustomHeaders
635	}
636	return json.Marshal(objectMap)
637}
638
639// Credentials the parameters that describes a set of credentials that will be used when a run is invoked.
640type Credentials struct {
641	// SourceRegistry - Describes the credential parameters for accessing the source registry.
642	SourceRegistry *SourceRegistryCredentials `json:"sourceRegistry,omitempty"`
643	// CustomRegistries - Describes the credential parameters for accessing other custom registries. The key
644	// for the dictionary item will be the registry login server (myregistry.azurecr.io) and
645	// the value of the item will be the registry credentials for accessing the registry.
646	CustomRegistries map[string]*CustomRegistryCredentials `json:"customRegistries"`
647}
648
649// MarshalJSON is the custom marshaler for Credentials.
650func (c Credentials) MarshalJSON() ([]byte, error) {
651	objectMap := make(map[string]interface{})
652	if c.SourceRegistry != nil {
653		objectMap["sourceRegistry"] = c.SourceRegistry
654	}
655	if c.CustomRegistries != nil {
656		objectMap["customRegistries"] = c.CustomRegistries
657	}
658	return json.Marshal(objectMap)
659}
660
661// CustomRegistryCredentials describes the credentials that will be used to access a custom registry during
662// a run.
663type CustomRegistryCredentials struct {
664	// UserName - The username for logging into the custom registry.
665	UserName *SecretObject `json:"userName,omitempty"`
666	// Password - The password for logging into the custom registry. The password is a secret
667	// object that allows multiple ways of providing the value for it.
668	Password *SecretObject `json:"password,omitempty"`
669	// Identity - Indicates the managed identity assigned to the custom credential. If a user-assigned identity
670	// this value is the Client ID. If a system-assigned identity, the value will be `system`. In
671	// the case of a system-assigned identity, the Client ID will be determined by the runner. This
672	// identity may be used to authenticate to key vault to retrieve credentials or it may be the only
673	// source of authentication used for accessing the registry.
674	Identity *string `json:"identity,omitempty"`
675}
676
677// DockerBuildRequest the parameters for a docker quick build.
678type DockerBuildRequest struct {
679	// ImageNames - The fully qualified image names including the repository and tag.
680	ImageNames *[]string `json:"imageNames,omitempty"`
681	// IsPushEnabled - The value of this property indicates whether the image built should be pushed to the registry or not.
682	IsPushEnabled *bool `json:"isPushEnabled,omitempty"`
683	// NoCache - The value of this property indicates whether the image cache is enabled or not.
684	NoCache *bool `json:"noCache,omitempty"`
685	// DockerFilePath - The Docker file path relative to the source location.
686	DockerFilePath *string `json:"dockerFilePath,omitempty"`
687	// Target - The name of the target build stage for the docker build.
688	Target *string `json:"target,omitempty"`
689	// Arguments - The collection of override arguments to be used when executing the run.
690	Arguments *[]Argument `json:"arguments,omitempty"`
691	// Timeout - Run timeout in seconds.
692	Timeout *int32 `json:"timeout,omitempty"`
693	// Platform - The platform properties against which the run has to happen.
694	Platform *PlatformProperties `json:"platform,omitempty"`
695	// AgentConfiguration - The machine configuration of the run agent.
696	AgentConfiguration *AgentProperties `json:"agentConfiguration,omitempty"`
697	// SourceLocation - The URL(absolute or relative) of the source context. It can be an URL to a tar or git repository.
698	// If it is relative URL, the relative path should be obtained from calling listBuildSourceUploadUrl API.
699	SourceLocation *string `json:"sourceLocation,omitempty"`
700	// Credentials - The properties that describes a set of credentials that will be used when this run is invoked.
701	Credentials *Credentials `json:"credentials,omitempty"`
702	// IsArchiveEnabled - The value that indicates whether archiving is enabled for the run or not.
703	IsArchiveEnabled *bool `json:"isArchiveEnabled,omitempty"`
704	// AgentPoolName - The dedicated agent pool for the run.
705	AgentPoolName *string `json:"agentPoolName,omitempty"`
706	// LogTemplate - The template that describes the repository and tag information for run log artifact.
707	LogTemplate *string `json:"logTemplate,omitempty"`
708	// Type - Possible values include: 'TypeRunRequest', 'TypeDockerBuildRequest', 'TypeFileTaskRunRequest', 'TypeTaskRunRequest', 'TypeEncodedTaskRunRequest'
709	Type Type `json:"type,omitempty"`
710}
711
712// MarshalJSON is the custom marshaler for DockerBuildRequest.
713func (dbr DockerBuildRequest) MarshalJSON() ([]byte, error) {
714	dbr.Type = TypeDockerBuildRequest
715	objectMap := make(map[string]interface{})
716	if dbr.ImageNames != nil {
717		objectMap["imageNames"] = dbr.ImageNames
718	}
719	if dbr.IsPushEnabled != nil {
720		objectMap["isPushEnabled"] = dbr.IsPushEnabled
721	}
722	if dbr.NoCache != nil {
723		objectMap["noCache"] = dbr.NoCache
724	}
725	if dbr.DockerFilePath != nil {
726		objectMap["dockerFilePath"] = dbr.DockerFilePath
727	}
728	if dbr.Target != nil {
729		objectMap["target"] = dbr.Target
730	}
731	if dbr.Arguments != nil {
732		objectMap["arguments"] = dbr.Arguments
733	}
734	if dbr.Timeout != nil {
735		objectMap["timeout"] = dbr.Timeout
736	}
737	if dbr.Platform != nil {
738		objectMap["platform"] = dbr.Platform
739	}
740	if dbr.AgentConfiguration != nil {
741		objectMap["agentConfiguration"] = dbr.AgentConfiguration
742	}
743	if dbr.SourceLocation != nil {
744		objectMap["sourceLocation"] = dbr.SourceLocation
745	}
746	if dbr.Credentials != nil {
747		objectMap["credentials"] = dbr.Credentials
748	}
749	if dbr.IsArchiveEnabled != nil {
750		objectMap["isArchiveEnabled"] = dbr.IsArchiveEnabled
751	}
752	if dbr.AgentPoolName != nil {
753		objectMap["agentPoolName"] = dbr.AgentPoolName
754	}
755	if dbr.LogTemplate != nil {
756		objectMap["logTemplate"] = dbr.LogTemplate
757	}
758	if dbr.Type != "" {
759		objectMap["type"] = dbr.Type
760	}
761	return json.Marshal(objectMap)
762}
763
764// AsDockerBuildRequest is the BasicRunRequest implementation for DockerBuildRequest.
765func (dbr DockerBuildRequest) AsDockerBuildRequest() (*DockerBuildRequest, bool) {
766	return &dbr, true
767}
768
769// AsFileTaskRunRequest is the BasicRunRequest implementation for DockerBuildRequest.
770func (dbr DockerBuildRequest) AsFileTaskRunRequest() (*FileTaskRunRequest, bool) {
771	return nil, false
772}
773
774// AsTaskRunRequest is the BasicRunRequest implementation for DockerBuildRequest.
775func (dbr DockerBuildRequest) AsTaskRunRequest() (*TaskRunRequest, bool) {
776	return nil, false
777}
778
779// AsEncodedTaskRunRequest is the BasicRunRequest implementation for DockerBuildRequest.
780func (dbr DockerBuildRequest) AsEncodedTaskRunRequest() (*EncodedTaskRunRequest, bool) {
781	return nil, false
782}
783
784// AsRunRequest is the BasicRunRequest implementation for DockerBuildRequest.
785func (dbr DockerBuildRequest) AsRunRequest() (*RunRequest, bool) {
786	return nil, false
787}
788
789// AsBasicRunRequest is the BasicRunRequest implementation for DockerBuildRequest.
790func (dbr DockerBuildRequest) AsBasicRunRequest() (BasicRunRequest, bool) {
791	return &dbr, true
792}
793
794// DockerBuildStep the Docker build step.
795type DockerBuildStep struct {
796	// ImageNames - The fully qualified image names including the repository and tag.
797	ImageNames *[]string `json:"imageNames,omitempty"`
798	// IsPushEnabled - The value of this property indicates whether the image built should be pushed to the registry or not.
799	IsPushEnabled *bool `json:"isPushEnabled,omitempty"`
800	// NoCache - The value of this property indicates whether the image cache is enabled or not.
801	NoCache *bool `json:"noCache,omitempty"`
802	// DockerFilePath - The Docker file path relative to the source context.
803	DockerFilePath *string `json:"dockerFilePath,omitempty"`
804	// Target - The name of the target build stage for the docker build.
805	Target *string `json:"target,omitempty"`
806	// Arguments - The collection of override arguments to be used when executing this build step.
807	Arguments *[]Argument `json:"arguments,omitempty"`
808	// BaseImageDependencies - READ-ONLY; List of base image dependencies for a step.
809	BaseImageDependencies *[]BaseImageDependency `json:"baseImageDependencies,omitempty"`
810	// ContextPath - The URL(absolute or relative) of the source context for the task step.
811	ContextPath *string `json:"contextPath,omitempty"`
812	// ContextAccessToken - The token (git PAT or SAS token of storage account blob) associated with the context for a step.
813	ContextAccessToken *string `json:"contextAccessToken,omitempty"`
814	// Type - Possible values include: 'TypeTaskStepProperties', 'TypeDocker', 'TypeFileTask', 'TypeEncodedTask'
815	Type TypeBasicTaskStepProperties `json:"type,omitempty"`
816}
817
818// MarshalJSON is the custom marshaler for DockerBuildStep.
819func (dbs DockerBuildStep) MarshalJSON() ([]byte, error) {
820	dbs.Type = TypeDocker
821	objectMap := make(map[string]interface{})
822	if dbs.ImageNames != nil {
823		objectMap["imageNames"] = dbs.ImageNames
824	}
825	if dbs.IsPushEnabled != nil {
826		objectMap["isPushEnabled"] = dbs.IsPushEnabled
827	}
828	if dbs.NoCache != nil {
829		objectMap["noCache"] = dbs.NoCache
830	}
831	if dbs.DockerFilePath != nil {
832		objectMap["dockerFilePath"] = dbs.DockerFilePath
833	}
834	if dbs.Target != nil {
835		objectMap["target"] = dbs.Target
836	}
837	if dbs.Arguments != nil {
838		objectMap["arguments"] = dbs.Arguments
839	}
840	if dbs.ContextPath != nil {
841		objectMap["contextPath"] = dbs.ContextPath
842	}
843	if dbs.ContextAccessToken != nil {
844		objectMap["contextAccessToken"] = dbs.ContextAccessToken
845	}
846	if dbs.Type != "" {
847		objectMap["type"] = dbs.Type
848	}
849	return json.Marshal(objectMap)
850}
851
852// AsDockerBuildStep is the BasicTaskStepProperties implementation for DockerBuildStep.
853func (dbs DockerBuildStep) AsDockerBuildStep() (*DockerBuildStep, bool) {
854	return &dbs, true
855}
856
857// AsFileTaskStep is the BasicTaskStepProperties implementation for DockerBuildStep.
858func (dbs DockerBuildStep) AsFileTaskStep() (*FileTaskStep, bool) {
859	return nil, false
860}
861
862// AsEncodedTaskStep is the BasicTaskStepProperties implementation for DockerBuildStep.
863func (dbs DockerBuildStep) AsEncodedTaskStep() (*EncodedTaskStep, bool) {
864	return nil, false
865}
866
867// AsTaskStepProperties is the BasicTaskStepProperties implementation for DockerBuildStep.
868func (dbs DockerBuildStep) AsTaskStepProperties() (*TaskStepProperties, bool) {
869	return nil, false
870}
871
872// AsBasicTaskStepProperties is the BasicTaskStepProperties implementation for DockerBuildStep.
873func (dbs DockerBuildStep) AsBasicTaskStepProperties() (BasicTaskStepProperties, bool) {
874	return &dbs, true
875}
876
877// DockerBuildStepUpdateParameters the properties for updating a docker build step.
878type DockerBuildStepUpdateParameters struct {
879	// ImageNames - The fully qualified image names including the repository and tag.
880	ImageNames *[]string `json:"imageNames,omitempty"`
881	// IsPushEnabled - The value of this property indicates whether the image built should be pushed to the registry or not.
882	IsPushEnabled *bool `json:"isPushEnabled,omitempty"`
883	// NoCache - The value of this property indicates whether the image cache is enabled or not.
884	NoCache *bool `json:"noCache,omitempty"`
885	// DockerFilePath - The Docker file path relative to the source context.
886	DockerFilePath *string `json:"dockerFilePath,omitempty"`
887	// Arguments - The collection of override arguments to be used when executing this build step.
888	Arguments *[]Argument `json:"arguments,omitempty"`
889	// Target - The name of the target build stage for the docker build.
890	Target *string `json:"target,omitempty"`
891	// ContextPath - The URL(absolute or relative) of the source context for the task step.
892	ContextPath *string `json:"contextPath,omitempty"`
893	// ContextAccessToken - The token (git PAT or SAS token of storage account blob) associated with the context for a step.
894	ContextAccessToken *string `json:"contextAccessToken,omitempty"`
895	// Type - Possible values include: 'TypeBasicTaskStepUpdateParametersTypeTaskStepUpdateParameters', 'TypeBasicTaskStepUpdateParametersTypeDocker', 'TypeBasicTaskStepUpdateParametersTypeFileTask', 'TypeBasicTaskStepUpdateParametersTypeEncodedTask'
896	Type TypeBasicTaskStepUpdateParameters `json:"type,omitempty"`
897}
898
899// MarshalJSON is the custom marshaler for DockerBuildStepUpdateParameters.
900func (dbsup DockerBuildStepUpdateParameters) MarshalJSON() ([]byte, error) {
901	dbsup.Type = TypeBasicTaskStepUpdateParametersTypeDocker
902	objectMap := make(map[string]interface{})
903	if dbsup.ImageNames != nil {
904		objectMap["imageNames"] = dbsup.ImageNames
905	}
906	if dbsup.IsPushEnabled != nil {
907		objectMap["isPushEnabled"] = dbsup.IsPushEnabled
908	}
909	if dbsup.NoCache != nil {
910		objectMap["noCache"] = dbsup.NoCache
911	}
912	if dbsup.DockerFilePath != nil {
913		objectMap["dockerFilePath"] = dbsup.DockerFilePath
914	}
915	if dbsup.Arguments != nil {
916		objectMap["arguments"] = dbsup.Arguments
917	}
918	if dbsup.Target != nil {
919		objectMap["target"] = dbsup.Target
920	}
921	if dbsup.ContextPath != nil {
922		objectMap["contextPath"] = dbsup.ContextPath
923	}
924	if dbsup.ContextAccessToken != nil {
925		objectMap["contextAccessToken"] = dbsup.ContextAccessToken
926	}
927	if dbsup.Type != "" {
928		objectMap["type"] = dbsup.Type
929	}
930	return json.Marshal(objectMap)
931}
932
933// AsDockerBuildStepUpdateParameters is the BasicTaskStepUpdateParameters implementation for DockerBuildStepUpdateParameters.
934func (dbsup DockerBuildStepUpdateParameters) AsDockerBuildStepUpdateParameters() (*DockerBuildStepUpdateParameters, bool) {
935	return &dbsup, true
936}
937
938// AsFileTaskStepUpdateParameters is the BasicTaskStepUpdateParameters implementation for DockerBuildStepUpdateParameters.
939func (dbsup DockerBuildStepUpdateParameters) AsFileTaskStepUpdateParameters() (*FileTaskStepUpdateParameters, bool) {
940	return nil, false
941}
942
943// AsEncodedTaskStepUpdateParameters is the BasicTaskStepUpdateParameters implementation for DockerBuildStepUpdateParameters.
944func (dbsup DockerBuildStepUpdateParameters) AsEncodedTaskStepUpdateParameters() (*EncodedTaskStepUpdateParameters, bool) {
945	return nil, false
946}
947
948// AsTaskStepUpdateParameters is the BasicTaskStepUpdateParameters implementation for DockerBuildStepUpdateParameters.
949func (dbsup DockerBuildStepUpdateParameters) AsTaskStepUpdateParameters() (*TaskStepUpdateParameters, bool) {
950	return nil, false
951}
952
953// AsBasicTaskStepUpdateParameters is the BasicTaskStepUpdateParameters implementation for DockerBuildStepUpdateParameters.
954func (dbsup DockerBuildStepUpdateParameters) AsBasicTaskStepUpdateParameters() (BasicTaskStepUpdateParameters, bool) {
955	return &dbsup, true
956}
957
958// EncodedTaskRunRequest the parameters for a quick task run request.
959type EncodedTaskRunRequest struct {
960	// EncodedTaskContent - Base64 encoded value of the template/definition file content.
961	EncodedTaskContent *string `json:"encodedTaskContent,omitempty"`
962	// EncodedValuesContent - Base64 encoded value of the parameters/values file content.
963	EncodedValuesContent *string `json:"encodedValuesContent,omitempty"`
964	// Values - The collection of overridable values that can be passed when running a task.
965	Values *[]SetValue `json:"values,omitempty"`
966	// Timeout - Run timeout in seconds.
967	Timeout *int32 `json:"timeout,omitempty"`
968	// Platform - The platform properties against which the run has to happen.
969	Platform *PlatformProperties `json:"platform,omitempty"`
970	// AgentConfiguration - The machine configuration of the run agent.
971	AgentConfiguration *AgentProperties `json:"agentConfiguration,omitempty"`
972	// SourceLocation - The URL(absolute or relative) of the source context. It can be an URL to a tar or git repository.
973	// If it is relative URL, the relative path should be obtained from calling listBuildSourceUploadUrl API.
974	SourceLocation *string `json:"sourceLocation,omitempty"`
975	// Credentials - The properties that describes a set of credentials that will be used when this run is invoked.
976	Credentials *Credentials `json:"credentials,omitempty"`
977	// IsArchiveEnabled - The value that indicates whether archiving is enabled for the run or not.
978	IsArchiveEnabled *bool `json:"isArchiveEnabled,omitempty"`
979	// AgentPoolName - The dedicated agent pool for the run.
980	AgentPoolName *string `json:"agentPoolName,omitempty"`
981	// LogTemplate - The template that describes the repository and tag information for run log artifact.
982	LogTemplate *string `json:"logTemplate,omitempty"`
983	// Type - Possible values include: 'TypeRunRequest', 'TypeDockerBuildRequest', 'TypeFileTaskRunRequest', 'TypeTaskRunRequest', 'TypeEncodedTaskRunRequest'
984	Type Type `json:"type,omitempty"`
985}
986
987// MarshalJSON is the custom marshaler for EncodedTaskRunRequest.
988func (etrr EncodedTaskRunRequest) MarshalJSON() ([]byte, error) {
989	etrr.Type = TypeEncodedTaskRunRequest
990	objectMap := make(map[string]interface{})
991	if etrr.EncodedTaskContent != nil {
992		objectMap["encodedTaskContent"] = etrr.EncodedTaskContent
993	}
994	if etrr.EncodedValuesContent != nil {
995		objectMap["encodedValuesContent"] = etrr.EncodedValuesContent
996	}
997	if etrr.Values != nil {
998		objectMap["values"] = etrr.Values
999	}
1000	if etrr.Timeout != nil {
1001		objectMap["timeout"] = etrr.Timeout
1002	}
1003	if etrr.Platform != nil {
1004		objectMap["platform"] = etrr.Platform
1005	}
1006	if etrr.AgentConfiguration != nil {
1007		objectMap["agentConfiguration"] = etrr.AgentConfiguration
1008	}
1009	if etrr.SourceLocation != nil {
1010		objectMap["sourceLocation"] = etrr.SourceLocation
1011	}
1012	if etrr.Credentials != nil {
1013		objectMap["credentials"] = etrr.Credentials
1014	}
1015	if etrr.IsArchiveEnabled != nil {
1016		objectMap["isArchiveEnabled"] = etrr.IsArchiveEnabled
1017	}
1018	if etrr.AgentPoolName != nil {
1019		objectMap["agentPoolName"] = etrr.AgentPoolName
1020	}
1021	if etrr.LogTemplate != nil {
1022		objectMap["logTemplate"] = etrr.LogTemplate
1023	}
1024	if etrr.Type != "" {
1025		objectMap["type"] = etrr.Type
1026	}
1027	return json.Marshal(objectMap)
1028}
1029
1030// AsDockerBuildRequest is the BasicRunRequest implementation for EncodedTaskRunRequest.
1031func (etrr EncodedTaskRunRequest) AsDockerBuildRequest() (*DockerBuildRequest, bool) {
1032	return nil, false
1033}
1034
1035// AsFileTaskRunRequest is the BasicRunRequest implementation for EncodedTaskRunRequest.
1036func (etrr EncodedTaskRunRequest) AsFileTaskRunRequest() (*FileTaskRunRequest, bool) {
1037	return nil, false
1038}
1039
1040// AsTaskRunRequest is the BasicRunRequest implementation for EncodedTaskRunRequest.
1041func (etrr EncodedTaskRunRequest) AsTaskRunRequest() (*TaskRunRequest, bool) {
1042	return nil, false
1043}
1044
1045// AsEncodedTaskRunRequest is the BasicRunRequest implementation for EncodedTaskRunRequest.
1046func (etrr EncodedTaskRunRequest) AsEncodedTaskRunRequest() (*EncodedTaskRunRequest, bool) {
1047	return &etrr, true
1048}
1049
1050// AsRunRequest is the BasicRunRequest implementation for EncodedTaskRunRequest.
1051func (etrr EncodedTaskRunRequest) AsRunRequest() (*RunRequest, bool) {
1052	return nil, false
1053}
1054
1055// AsBasicRunRequest is the BasicRunRequest implementation for EncodedTaskRunRequest.
1056func (etrr EncodedTaskRunRequest) AsBasicRunRequest() (BasicRunRequest, bool) {
1057	return &etrr, true
1058}
1059
1060// EncodedTaskStep the properties of a encoded task step.
1061type EncodedTaskStep struct {
1062	// EncodedTaskContent - Base64 encoded value of the template/definition file content.
1063	EncodedTaskContent *string `json:"encodedTaskContent,omitempty"`
1064	// EncodedValuesContent - Base64 encoded value of the parameters/values file content.
1065	EncodedValuesContent *string `json:"encodedValuesContent,omitempty"`
1066	// Values - The collection of overridable values that can be passed when running a task.
1067	Values *[]SetValue `json:"values,omitempty"`
1068	// BaseImageDependencies - READ-ONLY; List of base image dependencies for a step.
1069	BaseImageDependencies *[]BaseImageDependency `json:"baseImageDependencies,omitempty"`
1070	// ContextPath - The URL(absolute or relative) of the source context for the task step.
1071	ContextPath *string `json:"contextPath,omitempty"`
1072	// ContextAccessToken - The token (git PAT or SAS token of storage account blob) associated with the context for a step.
1073	ContextAccessToken *string `json:"contextAccessToken,omitempty"`
1074	// Type - Possible values include: 'TypeTaskStepProperties', 'TypeDocker', 'TypeFileTask', 'TypeEncodedTask'
1075	Type TypeBasicTaskStepProperties `json:"type,omitempty"`
1076}
1077
1078// MarshalJSON is the custom marshaler for EncodedTaskStep.
1079func (ets EncodedTaskStep) MarshalJSON() ([]byte, error) {
1080	ets.Type = TypeEncodedTask
1081	objectMap := make(map[string]interface{})
1082	if ets.EncodedTaskContent != nil {
1083		objectMap["encodedTaskContent"] = ets.EncodedTaskContent
1084	}
1085	if ets.EncodedValuesContent != nil {
1086		objectMap["encodedValuesContent"] = ets.EncodedValuesContent
1087	}
1088	if ets.Values != nil {
1089		objectMap["values"] = ets.Values
1090	}
1091	if ets.ContextPath != nil {
1092		objectMap["contextPath"] = ets.ContextPath
1093	}
1094	if ets.ContextAccessToken != nil {
1095		objectMap["contextAccessToken"] = ets.ContextAccessToken
1096	}
1097	if ets.Type != "" {
1098		objectMap["type"] = ets.Type
1099	}
1100	return json.Marshal(objectMap)
1101}
1102
1103// AsDockerBuildStep is the BasicTaskStepProperties implementation for EncodedTaskStep.
1104func (ets EncodedTaskStep) AsDockerBuildStep() (*DockerBuildStep, bool) {
1105	return nil, false
1106}
1107
1108// AsFileTaskStep is the BasicTaskStepProperties implementation for EncodedTaskStep.
1109func (ets EncodedTaskStep) AsFileTaskStep() (*FileTaskStep, bool) {
1110	return nil, false
1111}
1112
1113// AsEncodedTaskStep is the BasicTaskStepProperties implementation for EncodedTaskStep.
1114func (ets EncodedTaskStep) AsEncodedTaskStep() (*EncodedTaskStep, bool) {
1115	return &ets, true
1116}
1117
1118// AsTaskStepProperties is the BasicTaskStepProperties implementation for EncodedTaskStep.
1119func (ets EncodedTaskStep) AsTaskStepProperties() (*TaskStepProperties, bool) {
1120	return nil, false
1121}
1122
1123// AsBasicTaskStepProperties is the BasicTaskStepProperties implementation for EncodedTaskStep.
1124func (ets EncodedTaskStep) AsBasicTaskStepProperties() (BasicTaskStepProperties, bool) {
1125	return &ets, true
1126}
1127
1128// EncodedTaskStepUpdateParameters the properties for updating encoded task step.
1129type EncodedTaskStepUpdateParameters struct {
1130	// EncodedTaskContent - Base64 encoded value of the template/definition file content.
1131	EncodedTaskContent *string `json:"encodedTaskContent,omitempty"`
1132	// EncodedValuesContent - Base64 encoded value of the parameters/values file content.
1133	EncodedValuesContent *string `json:"encodedValuesContent,omitempty"`
1134	// Values - The collection of overridable values that can be passed when running a task.
1135	Values *[]SetValue `json:"values,omitempty"`
1136	// ContextPath - The URL(absolute or relative) of the source context for the task step.
1137	ContextPath *string `json:"contextPath,omitempty"`
1138	// ContextAccessToken - The token (git PAT or SAS token of storage account blob) associated with the context for a step.
1139	ContextAccessToken *string `json:"contextAccessToken,omitempty"`
1140	// Type - Possible values include: 'TypeBasicTaskStepUpdateParametersTypeTaskStepUpdateParameters', 'TypeBasicTaskStepUpdateParametersTypeDocker', 'TypeBasicTaskStepUpdateParametersTypeFileTask', 'TypeBasicTaskStepUpdateParametersTypeEncodedTask'
1141	Type TypeBasicTaskStepUpdateParameters `json:"type,omitempty"`
1142}
1143
1144// MarshalJSON is the custom marshaler for EncodedTaskStepUpdateParameters.
1145func (etsup EncodedTaskStepUpdateParameters) MarshalJSON() ([]byte, error) {
1146	etsup.Type = TypeBasicTaskStepUpdateParametersTypeEncodedTask
1147	objectMap := make(map[string]interface{})
1148	if etsup.EncodedTaskContent != nil {
1149		objectMap["encodedTaskContent"] = etsup.EncodedTaskContent
1150	}
1151	if etsup.EncodedValuesContent != nil {
1152		objectMap["encodedValuesContent"] = etsup.EncodedValuesContent
1153	}
1154	if etsup.Values != nil {
1155		objectMap["values"] = etsup.Values
1156	}
1157	if etsup.ContextPath != nil {
1158		objectMap["contextPath"] = etsup.ContextPath
1159	}
1160	if etsup.ContextAccessToken != nil {
1161		objectMap["contextAccessToken"] = etsup.ContextAccessToken
1162	}
1163	if etsup.Type != "" {
1164		objectMap["type"] = etsup.Type
1165	}
1166	return json.Marshal(objectMap)
1167}
1168
1169// AsDockerBuildStepUpdateParameters is the BasicTaskStepUpdateParameters implementation for EncodedTaskStepUpdateParameters.
1170func (etsup EncodedTaskStepUpdateParameters) AsDockerBuildStepUpdateParameters() (*DockerBuildStepUpdateParameters, bool) {
1171	return nil, false
1172}
1173
1174// AsFileTaskStepUpdateParameters is the BasicTaskStepUpdateParameters implementation for EncodedTaskStepUpdateParameters.
1175func (etsup EncodedTaskStepUpdateParameters) AsFileTaskStepUpdateParameters() (*FileTaskStepUpdateParameters, bool) {
1176	return nil, false
1177}
1178
1179// AsEncodedTaskStepUpdateParameters is the BasicTaskStepUpdateParameters implementation for EncodedTaskStepUpdateParameters.
1180func (etsup EncodedTaskStepUpdateParameters) AsEncodedTaskStepUpdateParameters() (*EncodedTaskStepUpdateParameters, bool) {
1181	return &etsup, true
1182}
1183
1184// AsTaskStepUpdateParameters is the BasicTaskStepUpdateParameters implementation for EncodedTaskStepUpdateParameters.
1185func (etsup EncodedTaskStepUpdateParameters) AsTaskStepUpdateParameters() (*TaskStepUpdateParameters, bool) {
1186	return nil, false
1187}
1188
1189// AsBasicTaskStepUpdateParameters is the BasicTaskStepUpdateParameters implementation for EncodedTaskStepUpdateParameters.
1190func (etsup EncodedTaskStepUpdateParameters) AsBasicTaskStepUpdateParameters() (BasicTaskStepUpdateParameters, bool) {
1191	return &etsup, true
1192}
1193
1194// EncryptionProperty ...
1195type EncryptionProperty struct {
1196	// Status - Indicates whether or not the encryption is enabled for container registry. Possible values include: 'Enabled', 'Disabled'
1197	Status EncryptionStatus `json:"status,omitempty"`
1198	// KeyVaultProperties - Key vault properties.
1199	KeyVaultProperties *KeyVaultProperties `json:"keyVaultProperties,omitempty"`
1200}
1201
1202// ErrorResponse an error response from the Azure Container Registry service.
1203type ErrorResponse struct {
1204	// Error - Azure container registry build API error body.
1205	Error *ErrorResponseBody `json:"error,omitempty"`
1206}
1207
1208// ErrorResponseBody an error response from the Azure Container Registry service.
1209type ErrorResponseBody struct {
1210	// Code - error code.
1211	Code *string `json:"code,omitempty"`
1212	// Message - error message.
1213	Message *string `json:"message,omitempty"`
1214	// Target - target of the particular error.
1215	Target *string `json:"target,omitempty"`
1216	// Details - an array of additional nested error response info objects, as described by this contract.
1217	Details *InnerErrorDescription `json:"details,omitempty"`
1218}
1219
1220// Event the event for a webhook.
1221type Event struct {
1222	// EventRequestMessage - The event request message sent to the service URI.
1223	EventRequestMessage *EventRequestMessage `json:"eventRequestMessage,omitempty"`
1224	// EventResponseMessage - The event response message received from the service URI.
1225	EventResponseMessage *EventResponseMessage `json:"eventResponseMessage,omitempty"`
1226	// ID - The event ID.
1227	ID *string `json:"id,omitempty"`
1228}
1229
1230// EventContent the content of the event request message.
1231type EventContent struct {
1232	// ID - The event ID.
1233	ID *string `json:"id,omitempty"`
1234	// Timestamp - The time at which the event occurred.
1235	Timestamp *date.Time `json:"timestamp,omitempty"`
1236	// Action - The action that encompasses the provided event.
1237	Action *string `json:"action,omitempty"`
1238	// Target - The target of the event.
1239	Target *Target `json:"target,omitempty"`
1240	// Request - The request that generated the event.
1241	Request *Request `json:"request,omitempty"`
1242	// Actor - The agent that initiated the event. For most situations, this could be from the authorization context of the request.
1243	Actor *Actor `json:"actor,omitempty"`
1244	// Source - The registry node that generated the event. Put differently, while the actor initiates the event, the source generates it.
1245	Source *Source `json:"source,omitempty"`
1246}
1247
1248// EventInfo the basic information of an event.
1249type EventInfo struct {
1250	autorest.Response `json:"-"`
1251	// ID - The event ID.
1252	ID *string `json:"id,omitempty"`
1253}
1254
1255// EventListResult the result of a request to list events for a webhook.
1256type EventListResult struct {
1257	autorest.Response `json:"-"`
1258	// Value - The list of events. Since this list may be incomplete, the nextLink field should be used to request the next list of events.
1259	Value *[]Event `json:"value,omitempty"`
1260	// NextLink - The URI that can be used to request the next list of events.
1261	NextLink *string `json:"nextLink,omitempty"`
1262}
1263
1264// EventListResultIterator provides access to a complete listing of Event values.
1265type EventListResultIterator struct {
1266	i    int
1267	page EventListResultPage
1268}
1269
1270// NextWithContext advances to the next value.  If there was an error making
1271// the request the iterator does not advance and the error is returned.
1272func (iter *EventListResultIterator) NextWithContext(ctx context.Context) (err error) {
1273	if tracing.IsEnabled() {
1274		ctx = tracing.StartSpan(ctx, fqdn+"/EventListResultIterator.NextWithContext")
1275		defer func() {
1276			sc := -1
1277			if iter.Response().Response.Response != nil {
1278				sc = iter.Response().Response.Response.StatusCode
1279			}
1280			tracing.EndSpan(ctx, sc, err)
1281		}()
1282	}
1283	iter.i++
1284	if iter.i < len(iter.page.Values()) {
1285		return nil
1286	}
1287	err = iter.page.NextWithContext(ctx)
1288	if err != nil {
1289		iter.i--
1290		return err
1291	}
1292	iter.i = 0
1293	return nil
1294}
1295
1296// Next advances to the next value.  If there was an error making
1297// the request the iterator does not advance and the error is returned.
1298// Deprecated: Use NextWithContext() instead.
1299func (iter *EventListResultIterator) Next() error {
1300	return iter.NextWithContext(context.Background())
1301}
1302
1303// NotDone returns true if the enumeration should be started or is not yet complete.
1304func (iter EventListResultIterator) NotDone() bool {
1305	return iter.page.NotDone() && iter.i < len(iter.page.Values())
1306}
1307
1308// Response returns the raw server response from the last page request.
1309func (iter EventListResultIterator) Response() EventListResult {
1310	return iter.page.Response()
1311}
1312
1313// Value returns the current value or a zero-initialized value if the
1314// iterator has advanced beyond the end of the collection.
1315func (iter EventListResultIterator) Value() Event {
1316	if !iter.page.NotDone() {
1317		return Event{}
1318	}
1319	return iter.page.Values()[iter.i]
1320}
1321
1322// Creates a new instance of the EventListResultIterator type.
1323func NewEventListResultIterator(page EventListResultPage) EventListResultIterator {
1324	return EventListResultIterator{page: page}
1325}
1326
1327// IsEmpty returns true if the ListResult contains no values.
1328func (elr EventListResult) IsEmpty() bool {
1329	return elr.Value == nil || len(*elr.Value) == 0
1330}
1331
1332// hasNextLink returns true if the NextLink is not empty.
1333func (elr EventListResult) hasNextLink() bool {
1334	return elr.NextLink != nil && len(*elr.NextLink) != 0
1335}
1336
1337// eventListResultPreparer prepares a request to retrieve the next set of results.
1338// It returns nil if no more results exist.
1339func (elr EventListResult) eventListResultPreparer(ctx context.Context) (*http.Request, error) {
1340	if !elr.hasNextLink() {
1341		return nil, nil
1342	}
1343	return autorest.Prepare((&http.Request{}).WithContext(ctx),
1344		autorest.AsJSON(),
1345		autorest.AsGet(),
1346		autorest.WithBaseURL(to.String(elr.NextLink)))
1347}
1348
1349// EventListResultPage contains a page of Event values.
1350type EventListResultPage struct {
1351	fn  func(context.Context, EventListResult) (EventListResult, error)
1352	elr EventListResult
1353}
1354
1355// NextWithContext advances to the next page of values.  If there was an error making
1356// the request the page does not advance and the error is returned.
1357func (page *EventListResultPage) NextWithContext(ctx context.Context) (err error) {
1358	if tracing.IsEnabled() {
1359		ctx = tracing.StartSpan(ctx, fqdn+"/EventListResultPage.NextWithContext")
1360		defer func() {
1361			sc := -1
1362			if page.Response().Response.Response != nil {
1363				sc = page.Response().Response.Response.StatusCode
1364			}
1365			tracing.EndSpan(ctx, sc, err)
1366		}()
1367	}
1368	for {
1369		next, err := page.fn(ctx, page.elr)
1370		if err != nil {
1371			return err
1372		}
1373		page.elr = next
1374		if !next.hasNextLink() || !next.IsEmpty() {
1375			break
1376		}
1377	}
1378	return nil
1379}
1380
1381// Next advances to the next page of values.  If there was an error making
1382// the request the page does not advance and the error is returned.
1383// Deprecated: Use NextWithContext() instead.
1384func (page *EventListResultPage) Next() error {
1385	return page.NextWithContext(context.Background())
1386}
1387
1388// NotDone returns true if the page enumeration should be started or is not yet complete.
1389func (page EventListResultPage) NotDone() bool {
1390	return !page.elr.IsEmpty()
1391}
1392
1393// Response returns the raw server response from the last page request.
1394func (page EventListResultPage) Response() EventListResult {
1395	return page.elr
1396}
1397
1398// Values returns the slice of values for the current page or nil if there are no values.
1399func (page EventListResultPage) Values() []Event {
1400	if page.elr.IsEmpty() {
1401		return nil
1402	}
1403	return *page.elr.Value
1404}
1405
1406// Creates a new instance of the EventListResultPage type.
1407func NewEventListResultPage(cur EventListResult, getNextPage func(context.Context, EventListResult) (EventListResult, error)) EventListResultPage {
1408	return EventListResultPage{
1409		fn:  getNextPage,
1410		elr: cur,
1411	}
1412}
1413
1414// EventRequestMessage the event request message sent to the service URI.
1415type EventRequestMessage struct {
1416	// Content - The content of the event request message.
1417	Content *EventContent `json:"content,omitempty"`
1418	// Headers - The headers of the event request message.
1419	Headers map[string]*string `json:"headers"`
1420	// Method - The HTTP method used to send the event request message.
1421	Method *string `json:"method,omitempty"`
1422	// RequestURI - The URI used to send the event request message.
1423	RequestURI *string `json:"requestUri,omitempty"`
1424	// Version - The HTTP message version.
1425	Version *string `json:"version,omitempty"`
1426}
1427
1428// MarshalJSON is the custom marshaler for EventRequestMessage.
1429func (erm EventRequestMessage) MarshalJSON() ([]byte, error) {
1430	objectMap := make(map[string]interface{})
1431	if erm.Content != nil {
1432		objectMap["content"] = erm.Content
1433	}
1434	if erm.Headers != nil {
1435		objectMap["headers"] = erm.Headers
1436	}
1437	if erm.Method != nil {
1438		objectMap["method"] = erm.Method
1439	}
1440	if erm.RequestURI != nil {
1441		objectMap["requestUri"] = erm.RequestURI
1442	}
1443	if erm.Version != nil {
1444		objectMap["version"] = erm.Version
1445	}
1446	return json.Marshal(objectMap)
1447}
1448
1449// EventResponseMessage the event response message received from the service URI.
1450type EventResponseMessage struct {
1451	// Content - The content of the event response message.
1452	Content *string `json:"content,omitempty"`
1453	// Headers - The headers of the event response message.
1454	Headers map[string]*string `json:"headers"`
1455	// ReasonPhrase - The reason phrase of the event response message.
1456	ReasonPhrase *string `json:"reasonPhrase,omitempty"`
1457	// StatusCode - The status code of the event response message.
1458	StatusCode *string `json:"statusCode,omitempty"`
1459	// Version - The HTTP message version.
1460	Version *string `json:"version,omitempty"`
1461}
1462
1463// MarshalJSON is the custom marshaler for EventResponseMessage.
1464func (erm EventResponseMessage) MarshalJSON() ([]byte, error) {
1465	objectMap := make(map[string]interface{})
1466	if erm.Content != nil {
1467		objectMap["content"] = erm.Content
1468	}
1469	if erm.Headers != nil {
1470		objectMap["headers"] = erm.Headers
1471	}
1472	if erm.ReasonPhrase != nil {
1473		objectMap["reasonPhrase"] = erm.ReasonPhrase
1474	}
1475	if erm.StatusCode != nil {
1476		objectMap["statusCode"] = erm.StatusCode
1477	}
1478	if erm.Version != nil {
1479		objectMap["version"] = erm.Version
1480	}
1481	return json.Marshal(objectMap)
1482}
1483
1484// ExportPipeline an object that represents an export pipeline for a container registry.
1485type ExportPipeline struct {
1486	autorest.Response `json:"-"`
1487	// Location - The location of the export pipeline.
1488	Location *string `json:"location,omitempty"`
1489	// Identity - The identity of the export pipeline.
1490	Identity *IdentityProperties `json:"identity,omitempty"`
1491	// ExportPipelineProperties - The properties of the export pipeline.
1492	*ExportPipelineProperties `json:"properties,omitempty"`
1493	// ID - READ-ONLY; The resource ID.
1494	ID *string `json:"id,omitempty"`
1495	// Name - READ-ONLY; The name of the resource.
1496	Name *string `json:"name,omitempty"`
1497	// Type - READ-ONLY; The type of the resource.
1498	Type *string `json:"type,omitempty"`
1499	// SystemData - READ-ONLY; Metadata pertaining to creation and last modification of the resource.
1500	SystemData *SystemData `json:"systemData,omitempty"`
1501}
1502
1503// MarshalJSON is the custom marshaler for ExportPipeline.
1504func (ep ExportPipeline) MarshalJSON() ([]byte, error) {
1505	objectMap := make(map[string]interface{})
1506	if ep.Location != nil {
1507		objectMap["location"] = ep.Location
1508	}
1509	if ep.Identity != nil {
1510		objectMap["identity"] = ep.Identity
1511	}
1512	if ep.ExportPipelineProperties != nil {
1513		objectMap["properties"] = ep.ExportPipelineProperties
1514	}
1515	return json.Marshal(objectMap)
1516}
1517
1518// UnmarshalJSON is the custom unmarshaler for ExportPipeline struct.
1519func (ep *ExportPipeline) UnmarshalJSON(body []byte) error {
1520	var m map[string]*json.RawMessage
1521	err := json.Unmarshal(body, &m)
1522	if err != nil {
1523		return err
1524	}
1525	for k, v := range m {
1526		switch k {
1527		case "location":
1528			if v != nil {
1529				var location string
1530				err = json.Unmarshal(*v, &location)
1531				if err != nil {
1532					return err
1533				}
1534				ep.Location = &location
1535			}
1536		case "identity":
1537			if v != nil {
1538				var identity IdentityProperties
1539				err = json.Unmarshal(*v, &identity)
1540				if err != nil {
1541					return err
1542				}
1543				ep.Identity = &identity
1544			}
1545		case "properties":
1546			if v != nil {
1547				var exportPipelineProperties ExportPipelineProperties
1548				err = json.Unmarshal(*v, &exportPipelineProperties)
1549				if err != nil {
1550					return err
1551				}
1552				ep.ExportPipelineProperties = &exportPipelineProperties
1553			}
1554		case "id":
1555			if v != nil {
1556				var ID string
1557				err = json.Unmarshal(*v, &ID)
1558				if err != nil {
1559					return err
1560				}
1561				ep.ID = &ID
1562			}
1563		case "name":
1564			if v != nil {
1565				var name string
1566				err = json.Unmarshal(*v, &name)
1567				if err != nil {
1568					return err
1569				}
1570				ep.Name = &name
1571			}
1572		case "type":
1573			if v != nil {
1574				var typeVar string
1575				err = json.Unmarshal(*v, &typeVar)
1576				if err != nil {
1577					return err
1578				}
1579				ep.Type = &typeVar
1580			}
1581		case "systemData":
1582			if v != nil {
1583				var systemData SystemData
1584				err = json.Unmarshal(*v, &systemData)
1585				if err != nil {
1586					return err
1587				}
1588				ep.SystemData = &systemData
1589			}
1590		}
1591	}
1592
1593	return nil
1594}
1595
1596// ExportPipelineListResult the result of a request to list export pipelines for a container registry.
1597type ExportPipelineListResult struct {
1598	autorest.Response `json:"-"`
1599	// Value - The list of export pipelines. Since this list may be incomplete, the nextLink field should be used to request the next list of export pipelines.
1600	Value *[]ExportPipeline `json:"value,omitempty"`
1601	// NextLink - The URI that can be used to request the next list of pipeline runs.
1602	NextLink *string `json:"nextLink,omitempty"`
1603}
1604
1605// ExportPipelineListResultIterator provides access to a complete listing of ExportPipeline values.
1606type ExportPipelineListResultIterator struct {
1607	i    int
1608	page ExportPipelineListResultPage
1609}
1610
1611// NextWithContext advances to the next value.  If there was an error making
1612// the request the iterator does not advance and the error is returned.
1613func (iter *ExportPipelineListResultIterator) NextWithContext(ctx context.Context) (err error) {
1614	if tracing.IsEnabled() {
1615		ctx = tracing.StartSpan(ctx, fqdn+"/ExportPipelineListResultIterator.NextWithContext")
1616		defer func() {
1617			sc := -1
1618			if iter.Response().Response.Response != nil {
1619				sc = iter.Response().Response.Response.StatusCode
1620			}
1621			tracing.EndSpan(ctx, sc, err)
1622		}()
1623	}
1624	iter.i++
1625	if iter.i < len(iter.page.Values()) {
1626		return nil
1627	}
1628	err = iter.page.NextWithContext(ctx)
1629	if err != nil {
1630		iter.i--
1631		return err
1632	}
1633	iter.i = 0
1634	return nil
1635}
1636
1637// Next advances to the next value.  If there was an error making
1638// the request the iterator does not advance and the error is returned.
1639// Deprecated: Use NextWithContext() instead.
1640func (iter *ExportPipelineListResultIterator) Next() error {
1641	return iter.NextWithContext(context.Background())
1642}
1643
1644// NotDone returns true if the enumeration should be started or is not yet complete.
1645func (iter ExportPipelineListResultIterator) NotDone() bool {
1646	return iter.page.NotDone() && iter.i < len(iter.page.Values())
1647}
1648
1649// Response returns the raw server response from the last page request.
1650func (iter ExportPipelineListResultIterator) Response() ExportPipelineListResult {
1651	return iter.page.Response()
1652}
1653
1654// Value returns the current value or a zero-initialized value if the
1655// iterator has advanced beyond the end of the collection.
1656func (iter ExportPipelineListResultIterator) Value() ExportPipeline {
1657	if !iter.page.NotDone() {
1658		return ExportPipeline{}
1659	}
1660	return iter.page.Values()[iter.i]
1661}
1662
1663// Creates a new instance of the ExportPipelineListResultIterator type.
1664func NewExportPipelineListResultIterator(page ExportPipelineListResultPage) ExportPipelineListResultIterator {
1665	return ExportPipelineListResultIterator{page: page}
1666}
1667
1668// IsEmpty returns true if the ListResult contains no values.
1669func (eplr ExportPipelineListResult) IsEmpty() bool {
1670	return eplr.Value == nil || len(*eplr.Value) == 0
1671}
1672
1673// hasNextLink returns true if the NextLink is not empty.
1674func (eplr ExportPipelineListResult) hasNextLink() bool {
1675	return eplr.NextLink != nil && len(*eplr.NextLink) != 0
1676}
1677
1678// exportPipelineListResultPreparer prepares a request to retrieve the next set of results.
1679// It returns nil if no more results exist.
1680func (eplr ExportPipelineListResult) exportPipelineListResultPreparer(ctx context.Context) (*http.Request, error) {
1681	if !eplr.hasNextLink() {
1682		return nil, nil
1683	}
1684	return autorest.Prepare((&http.Request{}).WithContext(ctx),
1685		autorest.AsJSON(),
1686		autorest.AsGet(),
1687		autorest.WithBaseURL(to.String(eplr.NextLink)))
1688}
1689
1690// ExportPipelineListResultPage contains a page of ExportPipeline values.
1691type ExportPipelineListResultPage struct {
1692	fn   func(context.Context, ExportPipelineListResult) (ExportPipelineListResult, error)
1693	eplr ExportPipelineListResult
1694}
1695
1696// NextWithContext advances to the next page of values.  If there was an error making
1697// the request the page does not advance and the error is returned.
1698func (page *ExportPipelineListResultPage) NextWithContext(ctx context.Context) (err error) {
1699	if tracing.IsEnabled() {
1700		ctx = tracing.StartSpan(ctx, fqdn+"/ExportPipelineListResultPage.NextWithContext")
1701		defer func() {
1702			sc := -1
1703			if page.Response().Response.Response != nil {
1704				sc = page.Response().Response.Response.StatusCode
1705			}
1706			tracing.EndSpan(ctx, sc, err)
1707		}()
1708	}
1709	for {
1710		next, err := page.fn(ctx, page.eplr)
1711		if err != nil {
1712			return err
1713		}
1714		page.eplr = next
1715		if !next.hasNextLink() || !next.IsEmpty() {
1716			break
1717		}
1718	}
1719	return nil
1720}
1721
1722// Next advances to the next page of values.  If there was an error making
1723// the request the page does not advance and the error is returned.
1724// Deprecated: Use NextWithContext() instead.
1725func (page *ExportPipelineListResultPage) Next() error {
1726	return page.NextWithContext(context.Background())
1727}
1728
1729// NotDone returns true if the page enumeration should be started or is not yet complete.
1730func (page ExportPipelineListResultPage) NotDone() bool {
1731	return !page.eplr.IsEmpty()
1732}
1733
1734// Response returns the raw server response from the last page request.
1735func (page ExportPipelineListResultPage) Response() ExportPipelineListResult {
1736	return page.eplr
1737}
1738
1739// Values returns the slice of values for the current page or nil if there are no values.
1740func (page ExportPipelineListResultPage) Values() []ExportPipeline {
1741	if page.eplr.IsEmpty() {
1742		return nil
1743	}
1744	return *page.eplr.Value
1745}
1746
1747// Creates a new instance of the ExportPipelineListResultPage type.
1748func NewExportPipelineListResultPage(cur ExportPipelineListResult, getNextPage func(context.Context, ExportPipelineListResult) (ExportPipelineListResult, error)) ExportPipelineListResultPage {
1749	return ExportPipelineListResultPage{
1750		fn:   getNextPage,
1751		eplr: cur,
1752	}
1753}
1754
1755// ExportPipelineProperties the properties of an export pipeline.
1756type ExportPipelineProperties struct {
1757	// Target - The target properties of the export pipeline.
1758	Target *ExportPipelineTargetProperties `json:"target,omitempty"`
1759	// Options - The list of all options configured for the pipeline.
1760	Options *[]PipelineOptions `json:"options,omitempty"`
1761	// ProvisioningState - READ-ONLY; The provisioning state of the pipeline at the time the operation was called. Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', 'Canceled'
1762	ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
1763}
1764
1765// MarshalJSON is the custom marshaler for ExportPipelineProperties.
1766func (epp ExportPipelineProperties) MarshalJSON() ([]byte, error) {
1767	objectMap := make(map[string]interface{})
1768	if epp.Target != nil {
1769		objectMap["target"] = epp.Target
1770	}
1771	if epp.Options != nil {
1772		objectMap["options"] = epp.Options
1773	}
1774	return json.Marshal(objectMap)
1775}
1776
1777// ExportPipelinesCreateFuture an abstraction for monitoring and retrieving the results of a long-running
1778// operation.
1779type ExportPipelinesCreateFuture struct {
1780	azure.FutureAPI
1781	// Result returns the result of the asynchronous operation.
1782	// If the operation has not completed it will return an error.
1783	Result func(ExportPipelinesClient) (ExportPipeline, error)
1784}
1785
1786// UnmarshalJSON is the custom unmarshaller for CreateFuture.
1787func (future *ExportPipelinesCreateFuture) UnmarshalJSON(body []byte) error {
1788	var azFuture azure.Future
1789	if err := json.Unmarshal(body, &azFuture); err != nil {
1790		return err
1791	}
1792	future.FutureAPI = &azFuture
1793	future.Result = future.result
1794	return nil
1795}
1796
1797// result is the default implementation for ExportPipelinesCreateFuture.Result.
1798func (future *ExportPipelinesCreateFuture) result(client ExportPipelinesClient) (ep ExportPipeline, err error) {
1799	var done bool
1800	done, err = future.DoneWithContext(context.Background(), client)
1801	if err != nil {
1802		err = autorest.NewErrorWithError(err, "containerregistry.ExportPipelinesCreateFuture", "Result", future.Response(), "Polling failure")
1803		return
1804	}
1805	if !done {
1806		ep.Response.Response = future.Response()
1807		err = azure.NewAsyncOpIncompleteError("containerregistry.ExportPipelinesCreateFuture")
1808		return
1809	}
1810	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
1811	if ep.Response.Response, err = future.GetResult(sender); err == nil && ep.Response.Response.StatusCode != http.StatusNoContent {
1812		ep, err = client.CreateResponder(ep.Response.Response)
1813		if err != nil {
1814			err = autorest.NewErrorWithError(err, "containerregistry.ExportPipelinesCreateFuture", "Result", ep.Response.Response, "Failure responding to request")
1815		}
1816	}
1817	return
1818}
1819
1820// ExportPipelinesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
1821// operation.
1822type ExportPipelinesDeleteFuture struct {
1823	azure.FutureAPI
1824	// Result returns the result of the asynchronous operation.
1825	// If the operation has not completed it will return an error.
1826	Result func(ExportPipelinesClient) (autorest.Response, error)
1827}
1828
1829// UnmarshalJSON is the custom unmarshaller for CreateFuture.
1830func (future *ExportPipelinesDeleteFuture) UnmarshalJSON(body []byte) error {
1831	var azFuture azure.Future
1832	if err := json.Unmarshal(body, &azFuture); err != nil {
1833		return err
1834	}
1835	future.FutureAPI = &azFuture
1836	future.Result = future.result
1837	return nil
1838}
1839
1840// result is the default implementation for ExportPipelinesDeleteFuture.Result.
1841func (future *ExportPipelinesDeleteFuture) result(client ExportPipelinesClient) (ar autorest.Response, err error) {
1842	var done bool
1843	done, err = future.DoneWithContext(context.Background(), client)
1844	if err != nil {
1845		err = autorest.NewErrorWithError(err, "containerregistry.ExportPipelinesDeleteFuture", "Result", future.Response(), "Polling failure")
1846		return
1847	}
1848	if !done {
1849		ar.Response = future.Response()
1850		err = azure.NewAsyncOpIncompleteError("containerregistry.ExportPipelinesDeleteFuture")
1851		return
1852	}
1853	ar.Response = future.Response()
1854	return
1855}
1856
1857// ExportPipelineTargetProperties the properties of the export pipeline target.
1858type ExportPipelineTargetProperties struct {
1859	// Type - The type of target for the export pipeline.
1860	Type *string `json:"type,omitempty"`
1861	// URI - The target uri of the export pipeline.
1862	// When 'AzureStorageBlob': "https://accountName.blob.core.windows.net/containerName/blobName"
1863	// When 'AzureStorageBlobContainer':  "https://accountName.blob.core.windows.net/containerName"
1864	URI *string `json:"uri,omitempty"`
1865	// KeyVaultURI - They key vault secret uri to obtain the target storage SAS token.
1866	KeyVaultURI *string `json:"keyVaultUri,omitempty"`
1867}
1868
1869// FileTaskRunRequest the request parameters for a scheduling run against a task file.
1870type FileTaskRunRequest struct {
1871	// TaskFilePath - The template/definition file path relative to the source.
1872	TaskFilePath *string `json:"taskFilePath,omitempty"`
1873	// ValuesFilePath - The values/parameters file path relative to the source.
1874	ValuesFilePath *string `json:"valuesFilePath,omitempty"`
1875	// Values - The collection of overridable values that can be passed when running a task.
1876	Values *[]SetValue `json:"values,omitempty"`
1877	// Timeout - Run timeout in seconds.
1878	Timeout *int32 `json:"timeout,omitempty"`
1879	// Platform - The platform properties against which the run has to happen.
1880	Platform *PlatformProperties `json:"platform,omitempty"`
1881	// AgentConfiguration - The machine configuration of the run agent.
1882	AgentConfiguration *AgentProperties `json:"agentConfiguration,omitempty"`
1883	// SourceLocation - The URL(absolute or relative) of the source context. It can be an URL to a tar or git repository.
1884	// If it is relative URL, the relative path should be obtained from calling listBuildSourceUploadUrl API.
1885	SourceLocation *string `json:"sourceLocation,omitempty"`
1886	// Credentials - The properties that describes a set of credentials that will be used when this run is invoked.
1887	Credentials *Credentials `json:"credentials,omitempty"`
1888	// IsArchiveEnabled - The value that indicates whether archiving is enabled for the run or not.
1889	IsArchiveEnabled *bool `json:"isArchiveEnabled,omitempty"`
1890	// AgentPoolName - The dedicated agent pool for the run.
1891	AgentPoolName *string `json:"agentPoolName,omitempty"`
1892	// LogTemplate - The template that describes the repository and tag information for run log artifact.
1893	LogTemplate *string `json:"logTemplate,omitempty"`
1894	// Type - Possible values include: 'TypeRunRequest', 'TypeDockerBuildRequest', 'TypeFileTaskRunRequest', 'TypeTaskRunRequest', 'TypeEncodedTaskRunRequest'
1895	Type Type `json:"type,omitempty"`
1896}
1897
1898// MarshalJSON is the custom marshaler for FileTaskRunRequest.
1899func (ftrr FileTaskRunRequest) MarshalJSON() ([]byte, error) {
1900	ftrr.Type = TypeFileTaskRunRequest
1901	objectMap := make(map[string]interface{})
1902	if ftrr.TaskFilePath != nil {
1903		objectMap["taskFilePath"] = ftrr.TaskFilePath
1904	}
1905	if ftrr.ValuesFilePath != nil {
1906		objectMap["valuesFilePath"] = ftrr.ValuesFilePath
1907	}
1908	if ftrr.Values != nil {
1909		objectMap["values"] = ftrr.Values
1910	}
1911	if ftrr.Timeout != nil {
1912		objectMap["timeout"] = ftrr.Timeout
1913	}
1914	if ftrr.Platform != nil {
1915		objectMap["platform"] = ftrr.Platform
1916	}
1917	if ftrr.AgentConfiguration != nil {
1918		objectMap["agentConfiguration"] = ftrr.AgentConfiguration
1919	}
1920	if ftrr.SourceLocation != nil {
1921		objectMap["sourceLocation"] = ftrr.SourceLocation
1922	}
1923	if ftrr.Credentials != nil {
1924		objectMap["credentials"] = ftrr.Credentials
1925	}
1926	if ftrr.IsArchiveEnabled != nil {
1927		objectMap["isArchiveEnabled"] = ftrr.IsArchiveEnabled
1928	}
1929	if ftrr.AgentPoolName != nil {
1930		objectMap["agentPoolName"] = ftrr.AgentPoolName
1931	}
1932	if ftrr.LogTemplate != nil {
1933		objectMap["logTemplate"] = ftrr.LogTemplate
1934	}
1935	if ftrr.Type != "" {
1936		objectMap["type"] = ftrr.Type
1937	}
1938	return json.Marshal(objectMap)
1939}
1940
1941// AsDockerBuildRequest is the BasicRunRequest implementation for FileTaskRunRequest.
1942func (ftrr FileTaskRunRequest) AsDockerBuildRequest() (*DockerBuildRequest, bool) {
1943	return nil, false
1944}
1945
1946// AsFileTaskRunRequest is the BasicRunRequest implementation for FileTaskRunRequest.
1947func (ftrr FileTaskRunRequest) AsFileTaskRunRequest() (*FileTaskRunRequest, bool) {
1948	return &ftrr, true
1949}
1950
1951// AsTaskRunRequest is the BasicRunRequest implementation for FileTaskRunRequest.
1952func (ftrr FileTaskRunRequest) AsTaskRunRequest() (*TaskRunRequest, bool) {
1953	return nil, false
1954}
1955
1956// AsEncodedTaskRunRequest is the BasicRunRequest implementation for FileTaskRunRequest.
1957func (ftrr FileTaskRunRequest) AsEncodedTaskRunRequest() (*EncodedTaskRunRequest, bool) {
1958	return nil, false
1959}
1960
1961// AsRunRequest is the BasicRunRequest implementation for FileTaskRunRequest.
1962func (ftrr FileTaskRunRequest) AsRunRequest() (*RunRequest, bool) {
1963	return nil, false
1964}
1965
1966// AsBasicRunRequest is the BasicRunRequest implementation for FileTaskRunRequest.
1967func (ftrr FileTaskRunRequest) AsBasicRunRequest() (BasicRunRequest, bool) {
1968	return &ftrr, true
1969}
1970
1971// FileTaskStep the properties of a task step.
1972type FileTaskStep struct {
1973	// TaskFilePath - The task template/definition file path relative to the source context.
1974	TaskFilePath *string `json:"taskFilePath,omitempty"`
1975	// ValuesFilePath - The task values/parameters file path relative to the source context.
1976	ValuesFilePath *string `json:"valuesFilePath,omitempty"`
1977	// Values - The collection of overridable values that can be passed when running a task.
1978	Values *[]SetValue `json:"values,omitempty"`
1979	// BaseImageDependencies - READ-ONLY; List of base image dependencies for a step.
1980	BaseImageDependencies *[]BaseImageDependency `json:"baseImageDependencies,omitempty"`
1981	// ContextPath - The URL(absolute or relative) of the source context for the task step.
1982	ContextPath *string `json:"contextPath,omitempty"`
1983	// ContextAccessToken - The token (git PAT or SAS token of storage account blob) associated with the context for a step.
1984	ContextAccessToken *string `json:"contextAccessToken,omitempty"`
1985	// Type - Possible values include: 'TypeTaskStepProperties', 'TypeDocker', 'TypeFileTask', 'TypeEncodedTask'
1986	Type TypeBasicTaskStepProperties `json:"type,omitempty"`
1987}
1988
1989// MarshalJSON is the custom marshaler for FileTaskStep.
1990func (fts FileTaskStep) MarshalJSON() ([]byte, error) {
1991	fts.Type = TypeFileTask
1992	objectMap := make(map[string]interface{})
1993	if fts.TaskFilePath != nil {
1994		objectMap["taskFilePath"] = fts.TaskFilePath
1995	}
1996	if fts.ValuesFilePath != nil {
1997		objectMap["valuesFilePath"] = fts.ValuesFilePath
1998	}
1999	if fts.Values != nil {
2000		objectMap["values"] = fts.Values
2001	}
2002	if fts.ContextPath != nil {
2003		objectMap["contextPath"] = fts.ContextPath
2004	}
2005	if fts.ContextAccessToken != nil {
2006		objectMap["contextAccessToken"] = fts.ContextAccessToken
2007	}
2008	if fts.Type != "" {
2009		objectMap["type"] = fts.Type
2010	}
2011	return json.Marshal(objectMap)
2012}
2013
2014// AsDockerBuildStep is the BasicTaskStepProperties implementation for FileTaskStep.
2015func (fts FileTaskStep) AsDockerBuildStep() (*DockerBuildStep, bool) {
2016	return nil, false
2017}
2018
2019// AsFileTaskStep is the BasicTaskStepProperties implementation for FileTaskStep.
2020func (fts FileTaskStep) AsFileTaskStep() (*FileTaskStep, bool) {
2021	return &fts, true
2022}
2023
2024// AsEncodedTaskStep is the BasicTaskStepProperties implementation for FileTaskStep.
2025func (fts FileTaskStep) AsEncodedTaskStep() (*EncodedTaskStep, bool) {
2026	return nil, false
2027}
2028
2029// AsTaskStepProperties is the BasicTaskStepProperties implementation for FileTaskStep.
2030func (fts FileTaskStep) AsTaskStepProperties() (*TaskStepProperties, bool) {
2031	return nil, false
2032}
2033
2034// AsBasicTaskStepProperties is the BasicTaskStepProperties implementation for FileTaskStep.
2035func (fts FileTaskStep) AsBasicTaskStepProperties() (BasicTaskStepProperties, bool) {
2036	return &fts, true
2037}
2038
2039// FileTaskStepUpdateParameters the properties of updating a task step.
2040type FileTaskStepUpdateParameters struct {
2041	// TaskFilePath - The task template/definition file path relative to the source context.
2042	TaskFilePath *string `json:"taskFilePath,omitempty"`
2043	// ValuesFilePath - The values/parameters file path relative to the source context.
2044	ValuesFilePath *string `json:"valuesFilePath,omitempty"`
2045	// Values - The collection of overridable values that can be passed when running a task.
2046	Values *[]SetValue `json:"values,omitempty"`
2047	// ContextPath - The URL(absolute or relative) of the source context for the task step.
2048	ContextPath *string `json:"contextPath,omitempty"`
2049	// ContextAccessToken - The token (git PAT or SAS token of storage account blob) associated with the context for a step.
2050	ContextAccessToken *string `json:"contextAccessToken,omitempty"`
2051	// Type - Possible values include: 'TypeBasicTaskStepUpdateParametersTypeTaskStepUpdateParameters', 'TypeBasicTaskStepUpdateParametersTypeDocker', 'TypeBasicTaskStepUpdateParametersTypeFileTask', 'TypeBasicTaskStepUpdateParametersTypeEncodedTask'
2052	Type TypeBasicTaskStepUpdateParameters `json:"type,omitempty"`
2053}
2054
2055// MarshalJSON is the custom marshaler for FileTaskStepUpdateParameters.
2056func (ftsup FileTaskStepUpdateParameters) MarshalJSON() ([]byte, error) {
2057	ftsup.Type = TypeBasicTaskStepUpdateParametersTypeFileTask
2058	objectMap := make(map[string]interface{})
2059	if ftsup.TaskFilePath != nil {
2060		objectMap["taskFilePath"] = ftsup.TaskFilePath
2061	}
2062	if ftsup.ValuesFilePath != nil {
2063		objectMap["valuesFilePath"] = ftsup.ValuesFilePath
2064	}
2065	if ftsup.Values != nil {
2066		objectMap["values"] = ftsup.Values
2067	}
2068	if ftsup.ContextPath != nil {
2069		objectMap["contextPath"] = ftsup.ContextPath
2070	}
2071	if ftsup.ContextAccessToken != nil {
2072		objectMap["contextAccessToken"] = ftsup.ContextAccessToken
2073	}
2074	if ftsup.Type != "" {
2075		objectMap["type"] = ftsup.Type
2076	}
2077	return json.Marshal(objectMap)
2078}
2079
2080// AsDockerBuildStepUpdateParameters is the BasicTaskStepUpdateParameters implementation for FileTaskStepUpdateParameters.
2081func (ftsup FileTaskStepUpdateParameters) AsDockerBuildStepUpdateParameters() (*DockerBuildStepUpdateParameters, bool) {
2082	return nil, false
2083}
2084
2085// AsFileTaskStepUpdateParameters is the BasicTaskStepUpdateParameters implementation for FileTaskStepUpdateParameters.
2086func (ftsup FileTaskStepUpdateParameters) AsFileTaskStepUpdateParameters() (*FileTaskStepUpdateParameters, bool) {
2087	return &ftsup, true
2088}
2089
2090// AsEncodedTaskStepUpdateParameters is the BasicTaskStepUpdateParameters implementation for FileTaskStepUpdateParameters.
2091func (ftsup FileTaskStepUpdateParameters) AsEncodedTaskStepUpdateParameters() (*EncodedTaskStepUpdateParameters, bool) {
2092	return nil, false
2093}
2094
2095// AsTaskStepUpdateParameters is the BasicTaskStepUpdateParameters implementation for FileTaskStepUpdateParameters.
2096func (ftsup FileTaskStepUpdateParameters) AsTaskStepUpdateParameters() (*TaskStepUpdateParameters, bool) {
2097	return nil, false
2098}
2099
2100// AsBasicTaskStepUpdateParameters is the BasicTaskStepUpdateParameters implementation for FileTaskStepUpdateParameters.
2101func (ftsup FileTaskStepUpdateParameters) AsBasicTaskStepUpdateParameters() (BasicTaskStepUpdateParameters, bool) {
2102	return &ftsup, true
2103}
2104
2105// GenerateCredentialsParameters the parameters used to generate credentials for a specified token or user
2106// of a container registry.
2107type GenerateCredentialsParameters struct {
2108	// TokenID - The resource ID of the token for which credentials have to be generated.
2109	TokenID *string `json:"tokenId,omitempty"`
2110	// Expiry - The expiry date of the generated credentials after which the credentials become invalid.
2111	Expiry *date.Time `json:"expiry,omitempty"`
2112	// Name - Specifies name of the password which should be regenerated if any -- password1 or password2. Possible values include: 'TokenPasswordNamePassword1', 'TokenPasswordNamePassword2'
2113	Name TokenPasswordName `json:"name,omitempty"`
2114}
2115
2116// GenerateCredentialsResult the response from the GenerateCredentials operation.
2117type GenerateCredentialsResult struct {
2118	autorest.Response `json:"-"`
2119	// Username - The username for a container registry.
2120	Username *string `json:"username,omitempty"`
2121	// Passwords - The list of passwords for a container registry.
2122	Passwords *[]TokenPassword `json:"passwords,omitempty"`
2123}
2124
2125// IdentityProperties managed identity for the resource.
2126type IdentityProperties struct {
2127	// PrincipalID - The principal ID of resource identity.
2128	PrincipalID *string `json:"principalId,omitempty"`
2129	// TenantID - The tenant ID of resource.
2130	TenantID *string `json:"tenantId,omitempty"`
2131	// Type - The identity type. Possible values include: 'ResourceIdentityTypeSystemAssigned', 'ResourceIdentityTypeUserAssigned', 'ResourceIdentityTypeSystemAssignedUserAssigned', 'ResourceIdentityTypeNone'
2132	Type ResourceIdentityType `json:"type,omitempty"`
2133	// UserAssignedIdentities - The list of user identities associated with the resource. The user identity
2134	// dictionary key references will be ARM resource ids in the form:
2135	// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/
2136	//     providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.
2137	UserAssignedIdentities map[string]*UserIdentityProperties `json:"userAssignedIdentities"`
2138}
2139
2140// MarshalJSON is the custom marshaler for IdentityProperties.
2141func (IP IdentityProperties) MarshalJSON() ([]byte, error) {
2142	objectMap := make(map[string]interface{})
2143	if IP.PrincipalID != nil {
2144		objectMap["principalId"] = IP.PrincipalID
2145	}
2146	if IP.TenantID != nil {
2147		objectMap["tenantId"] = IP.TenantID
2148	}
2149	if IP.Type != "" {
2150		objectMap["type"] = IP.Type
2151	}
2152	if IP.UserAssignedIdentities != nil {
2153		objectMap["userAssignedIdentities"] = IP.UserAssignedIdentities
2154	}
2155	return json.Marshal(objectMap)
2156}
2157
2158// ImageDescriptor properties for a registry image.
2159type ImageDescriptor struct {
2160	// Registry - The registry login server.
2161	Registry *string `json:"registry,omitempty"`
2162	// Repository - The repository name.
2163	Repository *string `json:"repository,omitempty"`
2164	// Tag - The tag name.
2165	Tag *string `json:"tag,omitempty"`
2166	// Digest - The sha256-based digest of the image manifest.
2167	Digest *string `json:"digest,omitempty"`
2168}
2169
2170// ImageUpdateTrigger the image update trigger that caused a build.
2171type ImageUpdateTrigger struct {
2172	// ID - The unique ID of the trigger.
2173	ID *string `json:"id,omitempty"`
2174	// Timestamp - The timestamp when the image update happened.
2175	Timestamp *date.Time `json:"timestamp,omitempty"`
2176	// Images - The list of image updates that caused the build.
2177	Images *[]ImageDescriptor `json:"images,omitempty"`
2178}
2179
2180// ImportImageParameters ...
2181type ImportImageParameters struct {
2182	// Source - The source of the image.
2183	Source *ImportSource `json:"source,omitempty"`
2184	// TargetTags - List of strings of the form repo[:tag]. When tag is omitted the source will be used (or 'latest' if source tag is also omitted).
2185	TargetTags *[]string `json:"targetTags,omitempty"`
2186	// UntaggedTargetRepositories - List of strings of repository names to do a manifest only copy. No tag will be created.
2187	UntaggedTargetRepositories *[]string `json:"untaggedTargetRepositories,omitempty"`
2188	// Mode - When Force, any existing target tags will be overwritten. When NoForce, any existing target tags will fail the operation before any copying begins. Possible values include: 'NoForce', 'Force'
2189	Mode ImportMode `json:"mode,omitempty"`
2190}
2191
2192// ImportPipeline an object that represents an import pipeline for a container registry.
2193type ImportPipeline struct {
2194	autorest.Response `json:"-"`
2195	// Location - The location of the import pipeline.
2196	Location *string `json:"location,omitempty"`
2197	// Identity - The identity of the import pipeline.
2198	Identity *IdentityProperties `json:"identity,omitempty"`
2199	// ImportPipelineProperties - The properties of the import pipeline.
2200	*ImportPipelineProperties `json:"properties,omitempty"`
2201	// ID - READ-ONLY; The resource ID.
2202	ID *string `json:"id,omitempty"`
2203	// Name - READ-ONLY; The name of the resource.
2204	Name *string `json:"name,omitempty"`
2205	// Type - READ-ONLY; The type of the resource.
2206	Type *string `json:"type,omitempty"`
2207	// SystemData - READ-ONLY; Metadata pertaining to creation and last modification of the resource.
2208	SystemData *SystemData `json:"systemData,omitempty"`
2209}
2210
2211// MarshalJSON is the custom marshaler for ImportPipeline.
2212func (IP ImportPipeline) MarshalJSON() ([]byte, error) {
2213	objectMap := make(map[string]interface{})
2214	if IP.Location != nil {
2215		objectMap["location"] = IP.Location
2216	}
2217	if IP.Identity != nil {
2218		objectMap["identity"] = IP.Identity
2219	}
2220	if IP.ImportPipelineProperties != nil {
2221		objectMap["properties"] = IP.ImportPipelineProperties
2222	}
2223	return json.Marshal(objectMap)
2224}
2225
2226// UnmarshalJSON is the custom unmarshaler for ImportPipeline struct.
2227func (IP *ImportPipeline) UnmarshalJSON(body []byte) error {
2228	var m map[string]*json.RawMessage
2229	err := json.Unmarshal(body, &m)
2230	if err != nil {
2231		return err
2232	}
2233	for k, v := range m {
2234		switch k {
2235		case "location":
2236			if v != nil {
2237				var location string
2238				err = json.Unmarshal(*v, &location)
2239				if err != nil {
2240					return err
2241				}
2242				IP.Location = &location
2243			}
2244		case "identity":
2245			if v != nil {
2246				var identity IdentityProperties
2247				err = json.Unmarshal(*v, &identity)
2248				if err != nil {
2249					return err
2250				}
2251				IP.Identity = &identity
2252			}
2253		case "properties":
2254			if v != nil {
2255				var importPipelineProperties ImportPipelineProperties
2256				err = json.Unmarshal(*v, &importPipelineProperties)
2257				if err != nil {
2258					return err
2259				}
2260				IP.ImportPipelineProperties = &importPipelineProperties
2261			}
2262		case "id":
2263			if v != nil {
2264				var ID string
2265				err = json.Unmarshal(*v, &ID)
2266				if err != nil {
2267					return err
2268				}
2269				IP.ID = &ID
2270			}
2271		case "name":
2272			if v != nil {
2273				var name string
2274				err = json.Unmarshal(*v, &name)
2275				if err != nil {
2276					return err
2277				}
2278				IP.Name = &name
2279			}
2280		case "type":
2281			if v != nil {
2282				var typeVar string
2283				err = json.Unmarshal(*v, &typeVar)
2284				if err != nil {
2285					return err
2286				}
2287				IP.Type = &typeVar
2288			}
2289		case "systemData":
2290			if v != nil {
2291				var systemData SystemData
2292				err = json.Unmarshal(*v, &systemData)
2293				if err != nil {
2294					return err
2295				}
2296				IP.SystemData = &systemData
2297			}
2298		}
2299	}
2300
2301	return nil
2302}
2303
2304// ImportPipelineListResult the result of a request to list import pipelines for a container registry.
2305type ImportPipelineListResult struct {
2306	autorest.Response `json:"-"`
2307	// Value - The list of import pipelines. Since this list may be incomplete, the nextLink field should be used to request the next list of import pipelines.
2308	Value *[]ImportPipeline `json:"value,omitempty"`
2309	// NextLink - The URI that can be used to request the next list of pipeline runs.
2310	NextLink *string `json:"nextLink,omitempty"`
2311}
2312
2313// ImportPipelineListResultIterator provides access to a complete listing of ImportPipeline values.
2314type ImportPipelineListResultIterator struct {
2315	i    int
2316	page ImportPipelineListResultPage
2317}
2318
2319// NextWithContext advances to the next value.  If there was an error making
2320// the request the iterator does not advance and the error is returned.
2321func (iter *ImportPipelineListResultIterator) NextWithContext(ctx context.Context) (err error) {
2322	if tracing.IsEnabled() {
2323		ctx = tracing.StartSpan(ctx, fqdn+"/ImportPipelineListResultIterator.NextWithContext")
2324		defer func() {
2325			sc := -1
2326			if iter.Response().Response.Response != nil {
2327				sc = iter.Response().Response.Response.StatusCode
2328			}
2329			tracing.EndSpan(ctx, sc, err)
2330		}()
2331	}
2332	iter.i++
2333	if iter.i < len(iter.page.Values()) {
2334		return nil
2335	}
2336	err = iter.page.NextWithContext(ctx)
2337	if err != nil {
2338		iter.i--
2339		return err
2340	}
2341	iter.i = 0
2342	return nil
2343}
2344
2345// Next advances to the next value.  If there was an error making
2346// the request the iterator does not advance and the error is returned.
2347// Deprecated: Use NextWithContext() instead.
2348func (iter *ImportPipelineListResultIterator) Next() error {
2349	return iter.NextWithContext(context.Background())
2350}
2351
2352// NotDone returns true if the enumeration should be started or is not yet complete.
2353func (iter ImportPipelineListResultIterator) NotDone() bool {
2354	return iter.page.NotDone() && iter.i < len(iter.page.Values())
2355}
2356
2357// Response returns the raw server response from the last page request.
2358func (iter ImportPipelineListResultIterator) Response() ImportPipelineListResult {
2359	return iter.page.Response()
2360}
2361
2362// Value returns the current value or a zero-initialized value if the
2363// iterator has advanced beyond the end of the collection.
2364func (iter ImportPipelineListResultIterator) Value() ImportPipeline {
2365	if !iter.page.NotDone() {
2366		return ImportPipeline{}
2367	}
2368	return iter.page.Values()[iter.i]
2369}
2370
2371// Creates a new instance of the ImportPipelineListResultIterator type.
2372func NewImportPipelineListResultIterator(page ImportPipelineListResultPage) ImportPipelineListResultIterator {
2373	return ImportPipelineListResultIterator{page: page}
2374}
2375
2376// IsEmpty returns true if the ListResult contains no values.
2377func (iplr ImportPipelineListResult) IsEmpty() bool {
2378	return iplr.Value == nil || len(*iplr.Value) == 0
2379}
2380
2381// hasNextLink returns true if the NextLink is not empty.
2382func (iplr ImportPipelineListResult) hasNextLink() bool {
2383	return iplr.NextLink != nil && len(*iplr.NextLink) != 0
2384}
2385
2386// importPipelineListResultPreparer prepares a request to retrieve the next set of results.
2387// It returns nil if no more results exist.
2388func (iplr ImportPipelineListResult) importPipelineListResultPreparer(ctx context.Context) (*http.Request, error) {
2389	if !iplr.hasNextLink() {
2390		return nil, nil
2391	}
2392	return autorest.Prepare((&http.Request{}).WithContext(ctx),
2393		autorest.AsJSON(),
2394		autorest.AsGet(),
2395		autorest.WithBaseURL(to.String(iplr.NextLink)))
2396}
2397
2398// ImportPipelineListResultPage contains a page of ImportPipeline values.
2399type ImportPipelineListResultPage struct {
2400	fn   func(context.Context, ImportPipelineListResult) (ImportPipelineListResult, error)
2401	iplr ImportPipelineListResult
2402}
2403
2404// NextWithContext advances to the next page of values.  If there was an error making
2405// the request the page does not advance and the error is returned.
2406func (page *ImportPipelineListResultPage) NextWithContext(ctx context.Context) (err error) {
2407	if tracing.IsEnabled() {
2408		ctx = tracing.StartSpan(ctx, fqdn+"/ImportPipelineListResultPage.NextWithContext")
2409		defer func() {
2410			sc := -1
2411			if page.Response().Response.Response != nil {
2412				sc = page.Response().Response.Response.StatusCode
2413			}
2414			tracing.EndSpan(ctx, sc, err)
2415		}()
2416	}
2417	for {
2418		next, err := page.fn(ctx, page.iplr)
2419		if err != nil {
2420			return err
2421		}
2422		page.iplr = next
2423		if !next.hasNextLink() || !next.IsEmpty() {
2424			break
2425		}
2426	}
2427	return nil
2428}
2429
2430// Next advances to the next page of values.  If there was an error making
2431// the request the page does not advance and the error is returned.
2432// Deprecated: Use NextWithContext() instead.
2433func (page *ImportPipelineListResultPage) Next() error {
2434	return page.NextWithContext(context.Background())
2435}
2436
2437// NotDone returns true if the page enumeration should be started or is not yet complete.
2438func (page ImportPipelineListResultPage) NotDone() bool {
2439	return !page.iplr.IsEmpty()
2440}
2441
2442// Response returns the raw server response from the last page request.
2443func (page ImportPipelineListResultPage) Response() ImportPipelineListResult {
2444	return page.iplr
2445}
2446
2447// Values returns the slice of values for the current page or nil if there are no values.
2448func (page ImportPipelineListResultPage) Values() []ImportPipeline {
2449	if page.iplr.IsEmpty() {
2450		return nil
2451	}
2452	return *page.iplr.Value
2453}
2454
2455// Creates a new instance of the ImportPipelineListResultPage type.
2456func NewImportPipelineListResultPage(cur ImportPipelineListResult, getNextPage func(context.Context, ImportPipelineListResult) (ImportPipelineListResult, error)) ImportPipelineListResultPage {
2457	return ImportPipelineListResultPage{
2458		fn:   getNextPage,
2459		iplr: cur,
2460	}
2461}
2462
2463// ImportPipelineProperties the properties of an import pipeline.
2464type ImportPipelineProperties struct {
2465	// Source - The source properties of the import pipeline.
2466	Source *ImportPipelineSourceProperties `json:"source,omitempty"`
2467	// Trigger - The properties that describe the trigger of the import pipeline.
2468	Trigger *PipelineTriggerProperties `json:"trigger,omitempty"`
2469	// Options - The list of all options configured for the pipeline.
2470	Options *[]PipelineOptions `json:"options,omitempty"`
2471	// ProvisioningState - READ-ONLY; The provisioning state of the pipeline at the time the operation was called. Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', 'Canceled'
2472	ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
2473}
2474
2475// MarshalJSON is the custom marshaler for ImportPipelineProperties.
2476func (ipp ImportPipelineProperties) MarshalJSON() ([]byte, error) {
2477	objectMap := make(map[string]interface{})
2478	if ipp.Source != nil {
2479		objectMap["source"] = ipp.Source
2480	}
2481	if ipp.Trigger != nil {
2482		objectMap["trigger"] = ipp.Trigger
2483	}
2484	if ipp.Options != nil {
2485		objectMap["options"] = ipp.Options
2486	}
2487	return json.Marshal(objectMap)
2488}
2489
2490// ImportPipelinesCreateFuture an abstraction for monitoring and retrieving the results of a long-running
2491// operation.
2492type ImportPipelinesCreateFuture struct {
2493	azure.FutureAPI
2494	// Result returns the result of the asynchronous operation.
2495	// If the operation has not completed it will return an error.
2496	Result func(ImportPipelinesClient) (ImportPipeline, error)
2497}
2498
2499// UnmarshalJSON is the custom unmarshaller for CreateFuture.
2500func (future *ImportPipelinesCreateFuture) UnmarshalJSON(body []byte) error {
2501	var azFuture azure.Future
2502	if err := json.Unmarshal(body, &azFuture); err != nil {
2503		return err
2504	}
2505	future.FutureAPI = &azFuture
2506	future.Result = future.result
2507	return nil
2508}
2509
2510// result is the default implementation for ImportPipelinesCreateFuture.Result.
2511func (future *ImportPipelinesCreateFuture) result(client ImportPipelinesClient) (IP ImportPipeline, err error) {
2512	var done bool
2513	done, err = future.DoneWithContext(context.Background(), client)
2514	if err != nil {
2515		err = autorest.NewErrorWithError(err, "containerregistry.ImportPipelinesCreateFuture", "Result", future.Response(), "Polling failure")
2516		return
2517	}
2518	if !done {
2519		IP.Response.Response = future.Response()
2520		err = azure.NewAsyncOpIncompleteError("containerregistry.ImportPipelinesCreateFuture")
2521		return
2522	}
2523	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
2524	if IP.Response.Response, err = future.GetResult(sender); err == nil && IP.Response.Response.StatusCode != http.StatusNoContent {
2525		IP, err = client.CreateResponder(IP.Response.Response)
2526		if err != nil {
2527			err = autorest.NewErrorWithError(err, "containerregistry.ImportPipelinesCreateFuture", "Result", IP.Response.Response, "Failure responding to request")
2528		}
2529	}
2530	return
2531}
2532
2533// ImportPipelinesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
2534// operation.
2535type ImportPipelinesDeleteFuture struct {
2536	azure.FutureAPI
2537	// Result returns the result of the asynchronous operation.
2538	// If the operation has not completed it will return an error.
2539	Result func(ImportPipelinesClient) (autorest.Response, error)
2540}
2541
2542// UnmarshalJSON is the custom unmarshaller for CreateFuture.
2543func (future *ImportPipelinesDeleteFuture) UnmarshalJSON(body []byte) error {
2544	var azFuture azure.Future
2545	if err := json.Unmarshal(body, &azFuture); err != nil {
2546		return err
2547	}
2548	future.FutureAPI = &azFuture
2549	future.Result = future.result
2550	return nil
2551}
2552
2553// result is the default implementation for ImportPipelinesDeleteFuture.Result.
2554func (future *ImportPipelinesDeleteFuture) result(client ImportPipelinesClient) (ar autorest.Response, err error) {
2555	var done bool
2556	done, err = future.DoneWithContext(context.Background(), client)
2557	if err != nil {
2558		err = autorest.NewErrorWithError(err, "containerregistry.ImportPipelinesDeleteFuture", "Result", future.Response(), "Polling failure")
2559		return
2560	}
2561	if !done {
2562		ar.Response = future.Response()
2563		err = azure.NewAsyncOpIncompleteError("containerregistry.ImportPipelinesDeleteFuture")
2564		return
2565	}
2566	ar.Response = future.Response()
2567	return
2568}
2569
2570// ImportPipelineSourceProperties the properties of the import pipeline source.
2571type ImportPipelineSourceProperties struct {
2572	// Type - The type of source for the import pipeline. Possible values include: 'AzureStorageBlobContainer'
2573	Type PipelineSourceType `json:"type,omitempty"`
2574	// URI - The source uri of the import pipeline.
2575	// When 'AzureStorageBlob': "https://accountName.blob.core.windows.net/containerName/blobName"
2576	// When 'AzureStorageBlobContainer': "https://accountName.blob.core.windows.net/containerName"
2577	URI *string `json:"uri,omitempty"`
2578	// KeyVaultURI - They key vault secret uri to obtain the source storage SAS token.
2579	KeyVaultURI *string `json:"keyVaultUri,omitempty"`
2580}
2581
2582// ImportSource ...
2583type ImportSource struct {
2584	// ResourceID - The resource identifier of the source Azure Container Registry.
2585	ResourceID *string `json:"resourceId,omitempty"`
2586	// RegistryURI - The address of the source registry (e.g. 'mcr.microsoft.com').
2587	RegistryURI *string `json:"registryUri,omitempty"`
2588	// Credentials - Credentials used when importing from a registry uri.
2589	Credentials *ImportSourceCredentials `json:"credentials,omitempty"`
2590	// SourceImage - Repository name of the source image.
2591	// Specify an image by repository ('hello-world'). This will use the 'latest' tag.
2592	// Specify an image by tag ('hello-world:latest').
2593	// Specify an image by sha256-based manifest digest ('hello-world@sha256:abc123').
2594	SourceImage *string `json:"sourceImage,omitempty"`
2595}
2596
2597// ImportSourceCredentials ...
2598type ImportSourceCredentials struct {
2599	// Username - The username to authenticate with the source registry.
2600	Username *string `json:"username,omitempty"`
2601	// Password - The password used to authenticate with the source registry.
2602	Password *string `json:"password,omitempty"`
2603}
2604
2605// InnerErrorDescription inner error.
2606type InnerErrorDescription struct {
2607	// Code - error code.
2608	Code *string `json:"code,omitempty"`
2609	// Message - error message.
2610	Message *string `json:"message,omitempty"`
2611	// Target - target of the particular error.
2612	Target *string `json:"target,omitempty"`
2613}
2614
2615// IPRule IP rule with specific IP or IP range in CIDR format.
2616type IPRule struct {
2617	// Action - The action of IP ACL rule. Possible values include: 'Allow'
2618	Action Action `json:"action,omitempty"`
2619	// IPAddressOrRange - Specifies the IP or IP range in CIDR format. Only IPV4 address is allowed.
2620	IPAddressOrRange *string `json:"value,omitempty"`
2621}
2622
2623// KeyVaultProperties ...
2624type KeyVaultProperties struct {
2625	// KeyIdentifier - Key vault uri to access the encryption key.
2626	KeyIdentifier *string `json:"keyIdentifier,omitempty"`
2627	// VersionedKeyIdentifier - READ-ONLY; The fully qualified key identifier that includes the version of the key that is actually used for encryption.
2628	VersionedKeyIdentifier *string `json:"versionedKeyIdentifier,omitempty"`
2629	// Identity - The client id of the identity which will be used to access key vault.
2630	Identity *string `json:"identity,omitempty"`
2631	// KeyRotationEnabled - READ-ONLY; Auto key rotation status for a CMK enabled registry.
2632	KeyRotationEnabled *bool `json:"keyRotationEnabled,omitempty"`
2633	// LastKeyRotationTimestamp - READ-ONLY; Timestamp of the last successful key rotation.
2634	LastKeyRotationTimestamp *date.Time `json:"lastKeyRotationTimestamp,omitempty"`
2635}
2636
2637// MarshalJSON is the custom marshaler for KeyVaultProperties.
2638func (kvp KeyVaultProperties) MarshalJSON() ([]byte, error) {
2639	objectMap := make(map[string]interface{})
2640	if kvp.KeyIdentifier != nil {
2641		objectMap["keyIdentifier"] = kvp.KeyIdentifier
2642	}
2643	if kvp.Identity != nil {
2644		objectMap["identity"] = kvp.Identity
2645	}
2646	return json.Marshal(objectMap)
2647}
2648
2649// NetworkRuleSet the network rule set for a container registry.
2650type NetworkRuleSet struct {
2651	// DefaultAction - The default action of allow or deny when no other rules match. Possible values include: 'DefaultActionAllow', 'DefaultActionDeny'
2652	DefaultAction DefaultAction `json:"defaultAction,omitempty"`
2653	// VirtualNetworkRules - The virtual network rules.
2654	VirtualNetworkRules *[]VirtualNetworkRule `json:"virtualNetworkRules,omitempty"`
2655	// IPRules - The IP ACL rules.
2656	IPRules *[]IPRule `json:"ipRules,omitempty"`
2657}
2658
2659// OperationDefinition the definition of a container registry operation.
2660type OperationDefinition struct {
2661	// Origin - The origin information of the container registry operation.
2662	Origin *string `json:"origin,omitempty"`
2663	// Name - Operation name: {provider}/{resource}/{operation}.
2664	Name *string `json:"name,omitempty"`
2665	// Display - The display information for the container registry operation.
2666	Display *OperationDisplayDefinition `json:"display,omitempty"`
2667	// OperationPropertiesDefinition - The properties information for the container registry operation.
2668	*OperationPropertiesDefinition `json:"properties,omitempty"`
2669}
2670
2671// MarshalJSON is the custom marshaler for OperationDefinition.
2672func (od OperationDefinition) MarshalJSON() ([]byte, error) {
2673	objectMap := make(map[string]interface{})
2674	if od.Origin != nil {
2675		objectMap["origin"] = od.Origin
2676	}
2677	if od.Name != nil {
2678		objectMap["name"] = od.Name
2679	}
2680	if od.Display != nil {
2681		objectMap["display"] = od.Display
2682	}
2683	if od.OperationPropertiesDefinition != nil {
2684		objectMap["properties"] = od.OperationPropertiesDefinition
2685	}
2686	return json.Marshal(objectMap)
2687}
2688
2689// UnmarshalJSON is the custom unmarshaler for OperationDefinition struct.
2690func (od *OperationDefinition) UnmarshalJSON(body []byte) error {
2691	var m map[string]*json.RawMessage
2692	err := json.Unmarshal(body, &m)
2693	if err != nil {
2694		return err
2695	}
2696	for k, v := range m {
2697		switch k {
2698		case "origin":
2699			if v != nil {
2700				var origin string
2701				err = json.Unmarshal(*v, &origin)
2702				if err != nil {
2703					return err
2704				}
2705				od.Origin = &origin
2706			}
2707		case "name":
2708			if v != nil {
2709				var name string
2710				err = json.Unmarshal(*v, &name)
2711				if err != nil {
2712					return err
2713				}
2714				od.Name = &name
2715			}
2716		case "display":
2717			if v != nil {
2718				var display OperationDisplayDefinition
2719				err = json.Unmarshal(*v, &display)
2720				if err != nil {
2721					return err
2722				}
2723				od.Display = &display
2724			}
2725		case "properties":
2726			if v != nil {
2727				var operationPropertiesDefinition OperationPropertiesDefinition
2728				err = json.Unmarshal(*v, &operationPropertiesDefinition)
2729				if err != nil {
2730					return err
2731				}
2732				od.OperationPropertiesDefinition = &operationPropertiesDefinition
2733			}
2734		}
2735	}
2736
2737	return nil
2738}
2739
2740// OperationDisplayDefinition the display information for a container registry operation.
2741type OperationDisplayDefinition struct {
2742	// Provider - The resource provider name: Microsoft.ContainerRegistry.
2743	Provider *string `json:"provider,omitempty"`
2744	// Resource - The resource on which the operation is performed.
2745	Resource *string `json:"resource,omitempty"`
2746	// Operation - The operation that users can perform.
2747	Operation *string `json:"operation,omitempty"`
2748	// Description - The description for the operation.
2749	Description *string `json:"description,omitempty"`
2750}
2751
2752// OperationListResult the result of a request to list container registry operations.
2753type OperationListResult struct {
2754	autorest.Response `json:"-"`
2755	// 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.
2756	Value *[]OperationDefinition `json:"value,omitempty"`
2757	// NextLink - The URI that can be used to request the next list of container registry operations.
2758	NextLink *string `json:"nextLink,omitempty"`
2759}
2760
2761// OperationListResultIterator provides access to a complete listing of OperationDefinition values.
2762type OperationListResultIterator struct {
2763	i    int
2764	page OperationListResultPage
2765}
2766
2767// NextWithContext advances to the next value.  If there was an error making
2768// the request the iterator does not advance and the error is returned.
2769func (iter *OperationListResultIterator) NextWithContext(ctx context.Context) (err error) {
2770	if tracing.IsEnabled() {
2771		ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultIterator.NextWithContext")
2772		defer func() {
2773			sc := -1
2774			if iter.Response().Response.Response != nil {
2775				sc = iter.Response().Response.Response.StatusCode
2776			}
2777			tracing.EndSpan(ctx, sc, err)
2778		}()
2779	}
2780	iter.i++
2781	if iter.i < len(iter.page.Values()) {
2782		return nil
2783	}
2784	err = iter.page.NextWithContext(ctx)
2785	if err != nil {
2786		iter.i--
2787		return err
2788	}
2789	iter.i = 0
2790	return nil
2791}
2792
2793// Next advances to the next value.  If there was an error making
2794// the request the iterator does not advance and the error is returned.
2795// Deprecated: Use NextWithContext() instead.
2796func (iter *OperationListResultIterator) Next() error {
2797	return iter.NextWithContext(context.Background())
2798}
2799
2800// NotDone returns true if the enumeration should be started or is not yet complete.
2801func (iter OperationListResultIterator) NotDone() bool {
2802	return iter.page.NotDone() && iter.i < len(iter.page.Values())
2803}
2804
2805// Response returns the raw server response from the last page request.
2806func (iter OperationListResultIterator) Response() OperationListResult {
2807	return iter.page.Response()
2808}
2809
2810// Value returns the current value or a zero-initialized value if the
2811// iterator has advanced beyond the end of the collection.
2812func (iter OperationListResultIterator) Value() OperationDefinition {
2813	if !iter.page.NotDone() {
2814		return OperationDefinition{}
2815	}
2816	return iter.page.Values()[iter.i]
2817}
2818
2819// Creates a new instance of the OperationListResultIterator type.
2820func NewOperationListResultIterator(page OperationListResultPage) OperationListResultIterator {
2821	return OperationListResultIterator{page: page}
2822}
2823
2824// IsEmpty returns true if the ListResult contains no values.
2825func (olr OperationListResult) IsEmpty() bool {
2826	return olr.Value == nil || len(*olr.Value) == 0
2827}
2828
2829// hasNextLink returns true if the NextLink is not empty.
2830func (olr OperationListResult) hasNextLink() bool {
2831	return olr.NextLink != nil && len(*olr.NextLink) != 0
2832}
2833
2834// operationListResultPreparer prepares a request to retrieve the next set of results.
2835// It returns nil if no more results exist.
2836func (olr OperationListResult) operationListResultPreparer(ctx context.Context) (*http.Request, error) {
2837	if !olr.hasNextLink() {
2838		return nil, nil
2839	}
2840	return autorest.Prepare((&http.Request{}).WithContext(ctx),
2841		autorest.AsJSON(),
2842		autorest.AsGet(),
2843		autorest.WithBaseURL(to.String(olr.NextLink)))
2844}
2845
2846// OperationListResultPage contains a page of OperationDefinition values.
2847type OperationListResultPage struct {
2848	fn  func(context.Context, OperationListResult) (OperationListResult, error)
2849	olr OperationListResult
2850}
2851
2852// NextWithContext advances to the next page of values.  If there was an error making
2853// the request the page does not advance and the error is returned.
2854func (page *OperationListResultPage) NextWithContext(ctx context.Context) (err error) {
2855	if tracing.IsEnabled() {
2856		ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultPage.NextWithContext")
2857		defer func() {
2858			sc := -1
2859			if page.Response().Response.Response != nil {
2860				sc = page.Response().Response.Response.StatusCode
2861			}
2862			tracing.EndSpan(ctx, sc, err)
2863		}()
2864	}
2865	for {
2866		next, err := page.fn(ctx, page.olr)
2867		if err != nil {
2868			return err
2869		}
2870		page.olr = next
2871		if !next.hasNextLink() || !next.IsEmpty() {
2872			break
2873		}
2874	}
2875	return nil
2876}
2877
2878// Next advances to the next page of values.  If there was an error making
2879// the request the page does not advance and the error is returned.
2880// Deprecated: Use NextWithContext() instead.
2881func (page *OperationListResultPage) Next() error {
2882	return page.NextWithContext(context.Background())
2883}
2884
2885// NotDone returns true if the page enumeration should be started or is not yet complete.
2886func (page OperationListResultPage) NotDone() bool {
2887	return !page.olr.IsEmpty()
2888}
2889
2890// Response returns the raw server response from the last page request.
2891func (page OperationListResultPage) Response() OperationListResult {
2892	return page.olr
2893}
2894
2895// Values returns the slice of values for the current page or nil if there are no values.
2896func (page OperationListResultPage) Values() []OperationDefinition {
2897	if page.olr.IsEmpty() {
2898		return nil
2899	}
2900	return *page.olr.Value
2901}
2902
2903// Creates a new instance of the OperationListResultPage type.
2904func NewOperationListResultPage(cur OperationListResult, getNextPage func(context.Context, OperationListResult) (OperationListResult, error)) OperationListResultPage {
2905	return OperationListResultPage{
2906		fn:  getNextPage,
2907		olr: cur,
2908	}
2909}
2910
2911// OperationMetricSpecificationDefinition the definition of Azure Monitoring metric.
2912type OperationMetricSpecificationDefinition struct {
2913	// Name - Metric name.
2914	Name *string `json:"name,omitempty"`
2915	// DisplayName - Metric display name.
2916	DisplayName *string `json:"displayName,omitempty"`
2917	// DisplayDescription - Metric description.
2918	DisplayDescription *string `json:"displayDescription,omitempty"`
2919	// Unit - Metric unit.
2920	Unit *string `json:"unit,omitempty"`
2921	// AggregationType - Metric aggregation type.
2922	AggregationType *string `json:"aggregationType,omitempty"`
2923	// InternalMetricName - Internal metric name.
2924	InternalMetricName *string `json:"internalMetricName,omitempty"`
2925}
2926
2927// OperationPropertiesDefinition the definition of Azure Monitoring properties.
2928type OperationPropertiesDefinition struct {
2929	// ServiceSpecification - The definition of Azure Monitoring service.
2930	ServiceSpecification *OperationServiceSpecificationDefinition `json:"serviceSpecification,omitempty"`
2931}
2932
2933// OperationServiceSpecificationDefinition the definition of Azure Monitoring list.
2934type OperationServiceSpecificationDefinition struct {
2935	// MetricSpecifications - A list of Azure Monitoring metrics definition.
2936	MetricSpecifications *[]OperationMetricSpecificationDefinition `json:"metricSpecifications,omitempty"`
2937}
2938
2939// OverrideTaskStepProperties ...
2940type OverrideTaskStepProperties struct {
2941	// ContextPath - The source context against which run has to be queued.
2942	ContextPath *string `json:"contextPath,omitempty"`
2943	// File - The file against which run has to be queued.
2944	File *string `json:"file,omitempty"`
2945	// Arguments - Gets or sets the collection of override arguments to be used when
2946	// executing a build step.
2947	Arguments *[]Argument `json:"arguments,omitempty"`
2948	// Target - The name of the target build stage for the docker build.
2949	Target *string `json:"target,omitempty"`
2950	// Values - The collection of overridable values that can be passed when running a Task.
2951	Values *[]SetValue `json:"values,omitempty"`
2952	// UpdateTriggerToken - Base64 encoded update trigger token that will be attached with the base image trigger webhook.
2953	UpdateTriggerToken *string `json:"updateTriggerToken,omitempty"`
2954}
2955
2956// PipelineRun an object that represents a pipeline run for a container registry.
2957type PipelineRun struct {
2958	autorest.Response `json:"-"`
2959	// PipelineRunProperties - The properties of a pipeline run.
2960	*PipelineRunProperties `json:"properties,omitempty"`
2961	// ID - READ-ONLY; The resource ID.
2962	ID *string `json:"id,omitempty"`
2963	// Name - READ-ONLY; The name of the resource.
2964	Name *string `json:"name,omitempty"`
2965	// Type - READ-ONLY; The type of the resource.
2966	Type *string `json:"type,omitempty"`
2967	// SystemData - READ-ONLY; Metadata pertaining to creation and last modification of the resource.
2968	SystemData *SystemData `json:"systemData,omitempty"`
2969}
2970
2971// MarshalJSON is the custom marshaler for PipelineRun.
2972func (pr PipelineRun) MarshalJSON() ([]byte, error) {
2973	objectMap := make(map[string]interface{})
2974	if pr.PipelineRunProperties != nil {
2975		objectMap["properties"] = pr.PipelineRunProperties
2976	}
2977	return json.Marshal(objectMap)
2978}
2979
2980// UnmarshalJSON is the custom unmarshaler for PipelineRun struct.
2981func (pr *PipelineRun) UnmarshalJSON(body []byte) error {
2982	var m map[string]*json.RawMessage
2983	err := json.Unmarshal(body, &m)
2984	if err != nil {
2985		return err
2986	}
2987	for k, v := range m {
2988		switch k {
2989		case "properties":
2990			if v != nil {
2991				var pipelineRunProperties PipelineRunProperties
2992				err = json.Unmarshal(*v, &pipelineRunProperties)
2993				if err != nil {
2994					return err
2995				}
2996				pr.PipelineRunProperties = &pipelineRunProperties
2997			}
2998		case "id":
2999			if v != nil {
3000				var ID string
3001				err = json.Unmarshal(*v, &ID)
3002				if err != nil {
3003					return err
3004				}
3005				pr.ID = &ID
3006			}
3007		case "name":
3008			if v != nil {
3009				var name string
3010				err = json.Unmarshal(*v, &name)
3011				if err != nil {
3012					return err
3013				}
3014				pr.Name = &name
3015			}
3016		case "type":
3017			if v != nil {
3018				var typeVar string
3019				err = json.Unmarshal(*v, &typeVar)
3020				if err != nil {
3021					return err
3022				}
3023				pr.Type = &typeVar
3024			}
3025		case "systemData":
3026			if v != nil {
3027				var systemData SystemData
3028				err = json.Unmarshal(*v, &systemData)
3029				if err != nil {
3030					return err
3031				}
3032				pr.SystemData = &systemData
3033			}
3034		}
3035	}
3036
3037	return nil
3038}
3039
3040// PipelineRunListResult the result of a request to list pipeline runs for a container registry.
3041type PipelineRunListResult struct {
3042	autorest.Response `json:"-"`
3043	// Value - The list of pipeline runs. Since this list may be incomplete, the nextLink field should be used to request the next list of pipeline runs.
3044	Value *[]PipelineRun `json:"value,omitempty"`
3045	// NextLink - The URI that can be used to request the next list of pipeline runs.
3046	NextLink *string `json:"nextLink,omitempty"`
3047}
3048
3049// PipelineRunListResultIterator provides access to a complete listing of PipelineRun values.
3050type PipelineRunListResultIterator struct {
3051	i    int
3052	page PipelineRunListResultPage
3053}
3054
3055// NextWithContext advances to the next value.  If there was an error making
3056// the request the iterator does not advance and the error is returned.
3057func (iter *PipelineRunListResultIterator) NextWithContext(ctx context.Context) (err error) {
3058	if tracing.IsEnabled() {
3059		ctx = tracing.StartSpan(ctx, fqdn+"/PipelineRunListResultIterator.NextWithContext")
3060		defer func() {
3061			sc := -1
3062			if iter.Response().Response.Response != nil {
3063				sc = iter.Response().Response.Response.StatusCode
3064			}
3065			tracing.EndSpan(ctx, sc, err)
3066		}()
3067	}
3068	iter.i++
3069	if iter.i < len(iter.page.Values()) {
3070		return nil
3071	}
3072	err = iter.page.NextWithContext(ctx)
3073	if err != nil {
3074		iter.i--
3075		return err
3076	}
3077	iter.i = 0
3078	return nil
3079}
3080
3081// Next advances to the next value.  If there was an error making
3082// the request the iterator does not advance and the error is returned.
3083// Deprecated: Use NextWithContext() instead.
3084func (iter *PipelineRunListResultIterator) Next() error {
3085	return iter.NextWithContext(context.Background())
3086}
3087
3088// NotDone returns true if the enumeration should be started or is not yet complete.
3089func (iter PipelineRunListResultIterator) NotDone() bool {
3090	return iter.page.NotDone() && iter.i < len(iter.page.Values())
3091}
3092
3093// Response returns the raw server response from the last page request.
3094func (iter PipelineRunListResultIterator) Response() PipelineRunListResult {
3095	return iter.page.Response()
3096}
3097
3098// Value returns the current value or a zero-initialized value if the
3099// iterator has advanced beyond the end of the collection.
3100func (iter PipelineRunListResultIterator) Value() PipelineRun {
3101	if !iter.page.NotDone() {
3102		return PipelineRun{}
3103	}
3104	return iter.page.Values()[iter.i]
3105}
3106
3107// Creates a new instance of the PipelineRunListResultIterator type.
3108func NewPipelineRunListResultIterator(page PipelineRunListResultPage) PipelineRunListResultIterator {
3109	return PipelineRunListResultIterator{page: page}
3110}
3111
3112// IsEmpty returns true if the ListResult contains no values.
3113func (prlr PipelineRunListResult) IsEmpty() bool {
3114	return prlr.Value == nil || len(*prlr.Value) == 0
3115}
3116
3117// hasNextLink returns true if the NextLink is not empty.
3118func (prlr PipelineRunListResult) hasNextLink() bool {
3119	return prlr.NextLink != nil && len(*prlr.NextLink) != 0
3120}
3121
3122// pipelineRunListResultPreparer prepares a request to retrieve the next set of results.
3123// It returns nil if no more results exist.
3124func (prlr PipelineRunListResult) pipelineRunListResultPreparer(ctx context.Context) (*http.Request, error) {
3125	if !prlr.hasNextLink() {
3126		return nil, nil
3127	}
3128	return autorest.Prepare((&http.Request{}).WithContext(ctx),
3129		autorest.AsJSON(),
3130		autorest.AsGet(),
3131		autorest.WithBaseURL(to.String(prlr.NextLink)))
3132}
3133
3134// PipelineRunListResultPage contains a page of PipelineRun values.
3135type PipelineRunListResultPage struct {
3136	fn   func(context.Context, PipelineRunListResult) (PipelineRunListResult, error)
3137	prlr PipelineRunListResult
3138}
3139
3140// NextWithContext advances to the next page of values.  If there was an error making
3141// the request the page does not advance and the error is returned.
3142func (page *PipelineRunListResultPage) NextWithContext(ctx context.Context) (err error) {
3143	if tracing.IsEnabled() {
3144		ctx = tracing.StartSpan(ctx, fqdn+"/PipelineRunListResultPage.NextWithContext")
3145		defer func() {
3146			sc := -1
3147			if page.Response().Response.Response != nil {
3148				sc = page.Response().Response.Response.StatusCode
3149			}
3150			tracing.EndSpan(ctx, sc, err)
3151		}()
3152	}
3153	for {
3154		next, err := page.fn(ctx, page.prlr)
3155		if err != nil {
3156			return err
3157		}
3158		page.prlr = next
3159		if !next.hasNextLink() || !next.IsEmpty() {
3160			break
3161		}
3162	}
3163	return nil
3164}
3165
3166// Next advances to the next page of values.  If there was an error making
3167// the request the page does not advance and the error is returned.
3168// Deprecated: Use NextWithContext() instead.
3169func (page *PipelineRunListResultPage) Next() error {
3170	return page.NextWithContext(context.Background())
3171}
3172
3173// NotDone returns true if the page enumeration should be started or is not yet complete.
3174func (page PipelineRunListResultPage) NotDone() bool {
3175	return !page.prlr.IsEmpty()
3176}
3177
3178// Response returns the raw server response from the last page request.
3179func (page PipelineRunListResultPage) Response() PipelineRunListResult {
3180	return page.prlr
3181}
3182
3183// Values returns the slice of values for the current page or nil if there are no values.
3184func (page PipelineRunListResultPage) Values() []PipelineRun {
3185	if page.prlr.IsEmpty() {
3186		return nil
3187	}
3188	return *page.prlr.Value
3189}
3190
3191// Creates a new instance of the PipelineRunListResultPage type.
3192func NewPipelineRunListResultPage(cur PipelineRunListResult, getNextPage func(context.Context, PipelineRunListResult) (PipelineRunListResult, error)) PipelineRunListResultPage {
3193	return PipelineRunListResultPage{
3194		fn:   getNextPage,
3195		prlr: cur,
3196	}
3197}
3198
3199// PipelineRunProperties the properties of a pipeline run.
3200type PipelineRunProperties struct {
3201	// ProvisioningState - READ-ONLY; The provisioning state of a pipeline run. Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', 'Canceled'
3202	ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
3203	// Request - The request parameters for a pipeline run.
3204	Request *PipelineRunRequest `json:"request,omitempty"`
3205	// Response - READ-ONLY; The response of a pipeline run.
3206	Response *PipelineRunResponse `json:"response,omitempty"`
3207	// ForceUpdateTag - How the pipeline run should be forced to recreate even if the pipeline run configuration has not changed.
3208	ForceUpdateTag *string `json:"forceUpdateTag,omitempty"`
3209}
3210
3211// MarshalJSON is the custom marshaler for PipelineRunProperties.
3212func (prp PipelineRunProperties) MarshalJSON() ([]byte, error) {
3213	objectMap := make(map[string]interface{})
3214	if prp.Request != nil {
3215		objectMap["request"] = prp.Request
3216	}
3217	if prp.ForceUpdateTag != nil {
3218		objectMap["forceUpdateTag"] = prp.ForceUpdateTag
3219	}
3220	return json.Marshal(objectMap)
3221}
3222
3223// PipelineRunRequest the request properties provided for a pipeline run.
3224type PipelineRunRequest struct {
3225	// PipelineResourceID - The resource ID of the pipeline to run.
3226	PipelineResourceID *string `json:"pipelineResourceId,omitempty"`
3227	// Artifacts - List of source artifacts to be transferred by the pipeline.
3228	// Specify an image by repository ('hello-world'). This will use the 'latest' tag.
3229	// Specify an image by tag ('hello-world:latest').
3230	// Specify an image by sha256-based manifest digest ('hello-world@sha256:abc123').
3231	Artifacts *[]string `json:"artifacts,omitempty"`
3232	// Source - The source properties of the pipeline run.
3233	Source *PipelineRunSourceProperties `json:"source,omitempty"`
3234	// Target - The target properties of the pipeline run.
3235	Target *PipelineRunTargetProperties `json:"target,omitempty"`
3236	// CatalogDigest - The digest of the tar used to transfer the artifacts.
3237	CatalogDigest *string `json:"catalogDigest,omitempty"`
3238}
3239
3240// PipelineRunResponse the response properties returned for a pipeline run.
3241type PipelineRunResponse struct {
3242	// Status - The current status of the pipeline run.
3243	Status *string `json:"status,omitempty"`
3244	// ImportedArtifacts - The artifacts imported in the pipeline run.
3245	ImportedArtifacts *[]string `json:"importedArtifacts,omitempty"`
3246	// Progress - The current progress of the copy operation.
3247	Progress *ProgressProperties `json:"progress,omitempty"`
3248	// StartTime - The time the pipeline run started.
3249	StartTime *date.Time `json:"startTime,omitempty"`
3250	// FinishTime - The time the pipeline run finished.
3251	FinishTime *date.Time `json:"finishTime,omitempty"`
3252	// Source - The source of the pipeline run.
3253	Source *ImportPipelineSourceProperties `json:"source,omitempty"`
3254	// Target - The target of the pipeline run.
3255	Target *ExportPipelineTargetProperties `json:"target,omitempty"`
3256	// CatalogDigest - The digest of the tar used to transfer the artifacts.
3257	CatalogDigest *string `json:"catalogDigest,omitempty"`
3258	// Trigger - The trigger that caused the pipeline run.
3259	Trigger *PipelineTriggerDescriptor `json:"trigger,omitempty"`
3260	// PipelineRunErrorMessage - The detailed error message for the pipeline run in the case of failure.
3261	PipelineRunErrorMessage *string `json:"pipelineRunErrorMessage,omitempty"`
3262}
3263
3264// PipelineRunsCreateFuture an abstraction for monitoring and retrieving the results of a long-running
3265// operation.
3266type PipelineRunsCreateFuture struct {
3267	azure.FutureAPI
3268	// Result returns the result of the asynchronous operation.
3269	// If the operation has not completed it will return an error.
3270	Result func(PipelineRunsClient) (PipelineRun, error)
3271}
3272
3273// UnmarshalJSON is the custom unmarshaller for CreateFuture.
3274func (future *PipelineRunsCreateFuture) UnmarshalJSON(body []byte) error {
3275	var azFuture azure.Future
3276	if err := json.Unmarshal(body, &azFuture); err != nil {
3277		return err
3278	}
3279	future.FutureAPI = &azFuture
3280	future.Result = future.result
3281	return nil
3282}
3283
3284// result is the default implementation for PipelineRunsCreateFuture.Result.
3285func (future *PipelineRunsCreateFuture) result(client PipelineRunsClient) (pr PipelineRun, err error) {
3286	var done bool
3287	done, err = future.DoneWithContext(context.Background(), client)
3288	if err != nil {
3289		err = autorest.NewErrorWithError(err, "containerregistry.PipelineRunsCreateFuture", "Result", future.Response(), "Polling failure")
3290		return
3291	}
3292	if !done {
3293		pr.Response.Response = future.Response()
3294		err = azure.NewAsyncOpIncompleteError("containerregistry.PipelineRunsCreateFuture")
3295		return
3296	}
3297	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
3298	if pr.Response.Response, err = future.GetResult(sender); err == nil && pr.Response.Response.StatusCode != http.StatusNoContent {
3299		pr, err = client.CreateResponder(pr.Response.Response)
3300		if err != nil {
3301			err = autorest.NewErrorWithError(err, "containerregistry.PipelineRunsCreateFuture", "Result", pr.Response.Response, "Failure responding to request")
3302		}
3303	}
3304	return
3305}
3306
3307// PipelineRunsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
3308// operation.
3309type PipelineRunsDeleteFuture struct {
3310	azure.FutureAPI
3311	// Result returns the result of the asynchronous operation.
3312	// If the operation has not completed it will return an error.
3313	Result func(PipelineRunsClient) (autorest.Response, error)
3314}
3315
3316// UnmarshalJSON is the custom unmarshaller for CreateFuture.
3317func (future *PipelineRunsDeleteFuture) UnmarshalJSON(body []byte) error {
3318	var azFuture azure.Future
3319	if err := json.Unmarshal(body, &azFuture); err != nil {
3320		return err
3321	}
3322	future.FutureAPI = &azFuture
3323	future.Result = future.result
3324	return nil
3325}
3326
3327// result is the default implementation for PipelineRunsDeleteFuture.Result.
3328func (future *PipelineRunsDeleteFuture) result(client PipelineRunsClient) (ar autorest.Response, err error) {
3329	var done bool
3330	done, err = future.DoneWithContext(context.Background(), client)
3331	if err != nil {
3332		err = autorest.NewErrorWithError(err, "containerregistry.PipelineRunsDeleteFuture", "Result", future.Response(), "Polling failure")
3333		return
3334	}
3335	if !done {
3336		ar.Response = future.Response()
3337		err = azure.NewAsyncOpIncompleteError("containerregistry.PipelineRunsDeleteFuture")
3338		return
3339	}
3340	ar.Response = future.Response()
3341	return
3342}
3343
3344// PipelineRunSourceProperties ...
3345type PipelineRunSourceProperties struct {
3346	// Type - The type of the source. Possible values include: 'AzureStorageBlob'
3347	Type PipelineRunSourceType `json:"type,omitempty"`
3348	// Name - The name of the source.
3349	Name *string `json:"name,omitempty"`
3350}
3351
3352// PipelineRunTargetProperties ...
3353type PipelineRunTargetProperties struct {
3354	// Type - The type of the target. Possible values include: 'PipelineRunTargetTypeAzureStorageBlob'
3355	Type PipelineRunTargetType `json:"type,omitempty"`
3356	// Name - The name of the target.
3357	Name *string `json:"name,omitempty"`
3358}
3359
3360// PipelineSourceTriggerDescriptor ...
3361type PipelineSourceTriggerDescriptor struct {
3362	// Timestamp - The timestamp when the source update happened.
3363	Timestamp *date.Time `json:"timestamp,omitempty"`
3364}
3365
3366// PipelineSourceTriggerProperties ...
3367type PipelineSourceTriggerProperties struct {
3368	// Status - The current status of the source trigger. Possible values include: 'TriggerStatusEnabled', 'TriggerStatusDisabled'
3369	Status TriggerStatus `json:"status,omitempty"`
3370}
3371
3372// PipelineTriggerDescriptor ...
3373type PipelineTriggerDescriptor struct {
3374	// SourceTrigger - The source trigger that caused the pipeline run.
3375	SourceTrigger *PipelineSourceTriggerDescriptor `json:"sourceTrigger,omitempty"`
3376}
3377
3378// PipelineTriggerProperties ...
3379type PipelineTriggerProperties struct {
3380	// SourceTrigger - The source trigger properties of the pipeline.
3381	SourceTrigger *PipelineSourceTriggerProperties `json:"sourceTrigger,omitempty"`
3382}
3383
3384// PlatformProperties the platform properties against which the run has to happen.
3385type PlatformProperties struct {
3386	// Os - The operating system type required for the run. Possible values include: 'Windows', 'Linux'
3387	Os OS `json:"os,omitempty"`
3388	// Architecture - The OS architecture. Possible values include: 'Amd64', 'X86', 'ThreeEightSix', 'Arm', 'Arm64'
3389	Architecture Architecture `json:"architecture,omitempty"`
3390	// Variant - Variant of the CPU. Possible values include: 'V6', 'V7', 'V8'
3391	Variant Variant `json:"variant,omitempty"`
3392}
3393
3394// PlatformUpdateParameters the properties for updating the platform configuration.
3395type PlatformUpdateParameters struct {
3396	// Os - The operating system type required for the run. Possible values include: 'Windows', 'Linux'
3397	Os OS `json:"os,omitempty"`
3398	// Architecture - The OS architecture. Possible values include: 'Amd64', 'X86', 'ThreeEightSix', 'Arm', 'Arm64'
3399	Architecture Architecture `json:"architecture,omitempty"`
3400	// Variant - Variant of the CPU. Possible values include: 'V6', 'V7', 'V8'
3401	Variant Variant `json:"variant,omitempty"`
3402}
3403
3404// Policies the policies for a container registry.
3405type Policies struct {
3406	// QuarantinePolicy - The quarantine policy for a container registry.
3407	QuarantinePolicy *QuarantinePolicy `json:"quarantinePolicy,omitempty"`
3408	// TrustPolicy - The content trust policy for a container registry.
3409	TrustPolicy *TrustPolicy `json:"trustPolicy,omitempty"`
3410	// RetentionPolicy - The retention policy for a container registry.
3411	RetentionPolicy *RetentionPolicy `json:"retentionPolicy,omitempty"`
3412}
3413
3414// PrivateEndpoint the Private Endpoint resource.
3415type PrivateEndpoint struct {
3416	// ID - This is private endpoint resource created with Microsoft.Network resource provider.
3417	ID *string `json:"id,omitempty"`
3418}
3419
3420// PrivateEndpointConnection an object that represents a private endpoint connection for a container
3421// registry.
3422type PrivateEndpointConnection struct {
3423	autorest.Response `json:"-"`
3424	// PrivateEndpointConnectionProperties - The properties of a private endpoint connection.
3425	*PrivateEndpointConnectionProperties `json:"properties,omitempty"`
3426	// ID - READ-ONLY; The resource ID.
3427	ID *string `json:"id,omitempty"`
3428	// Name - READ-ONLY; The name of the resource.
3429	Name *string `json:"name,omitempty"`
3430	// Type - READ-ONLY; The type of the resource.
3431	Type *string `json:"type,omitempty"`
3432	// SystemData - READ-ONLY; Metadata pertaining to creation and last modification of the resource.
3433	SystemData *SystemData `json:"systemData,omitempty"`
3434}
3435
3436// MarshalJSON is the custom marshaler for PrivateEndpointConnection.
3437func (pec PrivateEndpointConnection) MarshalJSON() ([]byte, error) {
3438	objectMap := make(map[string]interface{})
3439	if pec.PrivateEndpointConnectionProperties != nil {
3440		objectMap["properties"] = pec.PrivateEndpointConnectionProperties
3441	}
3442	return json.Marshal(objectMap)
3443}
3444
3445// UnmarshalJSON is the custom unmarshaler for PrivateEndpointConnection struct.
3446func (pec *PrivateEndpointConnection) UnmarshalJSON(body []byte) error {
3447	var m map[string]*json.RawMessage
3448	err := json.Unmarshal(body, &m)
3449	if err != nil {
3450		return err
3451	}
3452	for k, v := range m {
3453		switch k {
3454		case "properties":
3455			if v != nil {
3456				var privateEndpointConnectionProperties PrivateEndpointConnectionProperties
3457				err = json.Unmarshal(*v, &privateEndpointConnectionProperties)
3458				if err != nil {
3459					return err
3460				}
3461				pec.PrivateEndpointConnectionProperties = &privateEndpointConnectionProperties
3462			}
3463		case "id":
3464			if v != nil {
3465				var ID string
3466				err = json.Unmarshal(*v, &ID)
3467				if err != nil {
3468					return err
3469				}
3470				pec.ID = &ID
3471			}
3472		case "name":
3473			if v != nil {
3474				var name string
3475				err = json.Unmarshal(*v, &name)
3476				if err != nil {
3477					return err
3478				}
3479				pec.Name = &name
3480			}
3481		case "type":
3482			if v != nil {
3483				var typeVar string
3484				err = json.Unmarshal(*v, &typeVar)
3485				if err != nil {
3486					return err
3487				}
3488				pec.Type = &typeVar
3489			}
3490		case "systemData":
3491			if v != nil {
3492				var systemData SystemData
3493				err = json.Unmarshal(*v, &systemData)
3494				if err != nil {
3495					return err
3496				}
3497				pec.SystemData = &systemData
3498			}
3499		}
3500	}
3501
3502	return nil
3503}
3504
3505// PrivateEndpointConnectionListResult the result of a request to list private endpoint connections for a
3506// container registry.
3507type PrivateEndpointConnectionListResult struct {
3508	autorest.Response `json:"-"`
3509	// Value - The list of private endpoint connections. Since this list may be incomplete, the nextLink field should be used to request the next list of private endpoint connections.
3510	Value *[]PrivateEndpointConnection `json:"value,omitempty"`
3511	// NextLink - The URI that can be used to request the next list of private endpoint connections.
3512	NextLink *string `json:"nextLink,omitempty"`
3513}
3514
3515// PrivateEndpointConnectionListResultIterator provides access to a complete listing of
3516// PrivateEndpointConnection values.
3517type PrivateEndpointConnectionListResultIterator struct {
3518	i    int
3519	page PrivateEndpointConnectionListResultPage
3520}
3521
3522// NextWithContext advances to the next value.  If there was an error making
3523// the request the iterator does not advance and the error is returned.
3524func (iter *PrivateEndpointConnectionListResultIterator) NextWithContext(ctx context.Context) (err error) {
3525	if tracing.IsEnabled() {
3526		ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionListResultIterator.NextWithContext")
3527		defer func() {
3528			sc := -1
3529			if iter.Response().Response.Response != nil {
3530				sc = iter.Response().Response.Response.StatusCode
3531			}
3532			tracing.EndSpan(ctx, sc, err)
3533		}()
3534	}
3535	iter.i++
3536	if iter.i < len(iter.page.Values()) {
3537		return nil
3538	}
3539	err = iter.page.NextWithContext(ctx)
3540	if err != nil {
3541		iter.i--
3542		return err
3543	}
3544	iter.i = 0
3545	return nil
3546}
3547
3548// Next advances to the next value.  If there was an error making
3549// the request the iterator does not advance and the error is returned.
3550// Deprecated: Use NextWithContext() instead.
3551func (iter *PrivateEndpointConnectionListResultIterator) Next() error {
3552	return iter.NextWithContext(context.Background())
3553}
3554
3555// NotDone returns true if the enumeration should be started or is not yet complete.
3556func (iter PrivateEndpointConnectionListResultIterator) NotDone() bool {
3557	return iter.page.NotDone() && iter.i < len(iter.page.Values())
3558}
3559
3560// Response returns the raw server response from the last page request.
3561func (iter PrivateEndpointConnectionListResultIterator) Response() PrivateEndpointConnectionListResult {
3562	return iter.page.Response()
3563}
3564
3565// Value returns the current value or a zero-initialized value if the
3566// iterator has advanced beyond the end of the collection.
3567func (iter PrivateEndpointConnectionListResultIterator) Value() PrivateEndpointConnection {
3568	if !iter.page.NotDone() {
3569		return PrivateEndpointConnection{}
3570	}
3571	return iter.page.Values()[iter.i]
3572}
3573
3574// Creates a new instance of the PrivateEndpointConnectionListResultIterator type.
3575func NewPrivateEndpointConnectionListResultIterator(page PrivateEndpointConnectionListResultPage) PrivateEndpointConnectionListResultIterator {
3576	return PrivateEndpointConnectionListResultIterator{page: page}
3577}
3578
3579// IsEmpty returns true if the ListResult contains no values.
3580func (peclr PrivateEndpointConnectionListResult) IsEmpty() bool {
3581	return peclr.Value == nil || len(*peclr.Value) == 0
3582}
3583
3584// hasNextLink returns true if the NextLink is not empty.
3585func (peclr PrivateEndpointConnectionListResult) hasNextLink() bool {
3586	return peclr.NextLink != nil && len(*peclr.NextLink) != 0
3587}
3588
3589// privateEndpointConnectionListResultPreparer prepares a request to retrieve the next set of results.
3590// It returns nil if no more results exist.
3591func (peclr PrivateEndpointConnectionListResult) privateEndpointConnectionListResultPreparer(ctx context.Context) (*http.Request, error) {
3592	if !peclr.hasNextLink() {
3593		return nil, nil
3594	}
3595	return autorest.Prepare((&http.Request{}).WithContext(ctx),
3596		autorest.AsJSON(),
3597		autorest.AsGet(),
3598		autorest.WithBaseURL(to.String(peclr.NextLink)))
3599}
3600
3601// PrivateEndpointConnectionListResultPage contains a page of PrivateEndpointConnection values.
3602type PrivateEndpointConnectionListResultPage struct {
3603	fn    func(context.Context, PrivateEndpointConnectionListResult) (PrivateEndpointConnectionListResult, error)
3604	peclr PrivateEndpointConnectionListResult
3605}
3606
3607// NextWithContext advances to the next page of values.  If there was an error making
3608// the request the page does not advance and the error is returned.
3609func (page *PrivateEndpointConnectionListResultPage) NextWithContext(ctx context.Context) (err error) {
3610	if tracing.IsEnabled() {
3611		ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionListResultPage.NextWithContext")
3612		defer func() {
3613			sc := -1
3614			if page.Response().Response.Response != nil {
3615				sc = page.Response().Response.Response.StatusCode
3616			}
3617			tracing.EndSpan(ctx, sc, err)
3618		}()
3619	}
3620	for {
3621		next, err := page.fn(ctx, page.peclr)
3622		if err != nil {
3623			return err
3624		}
3625		page.peclr = next
3626		if !next.hasNextLink() || !next.IsEmpty() {
3627			break
3628		}
3629	}
3630	return nil
3631}
3632
3633// Next advances to the next page of values.  If there was an error making
3634// the request the page does not advance and the error is returned.
3635// Deprecated: Use NextWithContext() instead.
3636func (page *PrivateEndpointConnectionListResultPage) Next() error {
3637	return page.NextWithContext(context.Background())
3638}
3639
3640// NotDone returns true if the page enumeration should be started or is not yet complete.
3641func (page PrivateEndpointConnectionListResultPage) NotDone() bool {
3642	return !page.peclr.IsEmpty()
3643}
3644
3645// Response returns the raw server response from the last page request.
3646func (page PrivateEndpointConnectionListResultPage) Response() PrivateEndpointConnectionListResult {
3647	return page.peclr
3648}
3649
3650// Values returns the slice of values for the current page or nil if there are no values.
3651func (page PrivateEndpointConnectionListResultPage) Values() []PrivateEndpointConnection {
3652	if page.peclr.IsEmpty() {
3653		return nil
3654	}
3655	return *page.peclr.Value
3656}
3657
3658// Creates a new instance of the PrivateEndpointConnectionListResultPage type.
3659func NewPrivateEndpointConnectionListResultPage(cur PrivateEndpointConnectionListResult, getNextPage func(context.Context, PrivateEndpointConnectionListResult) (PrivateEndpointConnectionListResult, error)) PrivateEndpointConnectionListResultPage {
3660	return PrivateEndpointConnectionListResultPage{
3661		fn:    getNextPage,
3662		peclr: cur,
3663	}
3664}
3665
3666// PrivateEndpointConnectionProperties the properties of a private endpoint connection.
3667type PrivateEndpointConnectionProperties struct {
3668	// PrivateEndpoint - The resource of private endpoint.
3669	PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"`
3670	// PrivateLinkServiceConnectionState - A collection of information about the state of the connection between service consumer and provider.
3671	PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"`
3672	// ProvisioningState - READ-ONLY; The provisioning state of private endpoint connection resource. Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', 'Canceled'
3673	ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
3674}
3675
3676// MarshalJSON is the custom marshaler for PrivateEndpointConnectionProperties.
3677func (pecp PrivateEndpointConnectionProperties) MarshalJSON() ([]byte, error) {
3678	objectMap := make(map[string]interface{})
3679	if pecp.PrivateEndpoint != nil {
3680		objectMap["privateEndpoint"] = pecp.PrivateEndpoint
3681	}
3682	if pecp.PrivateLinkServiceConnectionState != nil {
3683		objectMap["privateLinkServiceConnectionState"] = pecp.PrivateLinkServiceConnectionState
3684	}
3685	return json.Marshal(objectMap)
3686}
3687
3688// PrivateEndpointConnectionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results
3689// of a long-running operation.
3690type PrivateEndpointConnectionsCreateOrUpdateFuture struct {
3691	azure.FutureAPI
3692	// Result returns the result of the asynchronous operation.
3693	// If the operation has not completed it will return an error.
3694	Result func(PrivateEndpointConnectionsClient) (PrivateEndpointConnection, error)
3695}
3696
3697// UnmarshalJSON is the custom unmarshaller for CreateFuture.
3698func (future *PrivateEndpointConnectionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
3699	var azFuture azure.Future
3700	if err := json.Unmarshal(body, &azFuture); err != nil {
3701		return err
3702	}
3703	future.FutureAPI = &azFuture
3704	future.Result = future.result
3705	return nil
3706}
3707
3708// result is the default implementation for PrivateEndpointConnectionsCreateOrUpdateFuture.Result.
3709func (future *PrivateEndpointConnectionsCreateOrUpdateFuture) result(client PrivateEndpointConnectionsClient) (pec PrivateEndpointConnection, err error) {
3710	var done bool
3711	done, err = future.DoneWithContext(context.Background(), client)
3712	if err != nil {
3713		err = autorest.NewErrorWithError(err, "containerregistry.PrivateEndpointConnectionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
3714		return
3715	}
3716	if !done {
3717		pec.Response.Response = future.Response()
3718		err = azure.NewAsyncOpIncompleteError("containerregistry.PrivateEndpointConnectionsCreateOrUpdateFuture")
3719		return
3720	}
3721	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
3722	if pec.Response.Response, err = future.GetResult(sender); err == nil && pec.Response.Response.StatusCode != http.StatusNoContent {
3723		pec, err = client.CreateOrUpdateResponder(pec.Response.Response)
3724		if err != nil {
3725			err = autorest.NewErrorWithError(err, "containerregistry.PrivateEndpointConnectionsCreateOrUpdateFuture", "Result", pec.Response.Response, "Failure responding to request")
3726		}
3727	}
3728	return
3729}
3730
3731// PrivateEndpointConnectionsDeleteFuture an abstraction for monitoring and retrieving the results of a
3732// long-running operation.
3733type PrivateEndpointConnectionsDeleteFuture struct {
3734	azure.FutureAPI
3735	// Result returns the result of the asynchronous operation.
3736	// If the operation has not completed it will return an error.
3737	Result func(PrivateEndpointConnectionsClient) (autorest.Response, error)
3738}
3739
3740// UnmarshalJSON is the custom unmarshaller for CreateFuture.
3741func (future *PrivateEndpointConnectionsDeleteFuture) UnmarshalJSON(body []byte) error {
3742	var azFuture azure.Future
3743	if err := json.Unmarshal(body, &azFuture); err != nil {
3744		return err
3745	}
3746	future.FutureAPI = &azFuture
3747	future.Result = future.result
3748	return nil
3749}
3750
3751// result is the default implementation for PrivateEndpointConnectionsDeleteFuture.Result.
3752func (future *PrivateEndpointConnectionsDeleteFuture) result(client PrivateEndpointConnectionsClient) (ar autorest.Response, err error) {
3753	var done bool
3754	done, err = future.DoneWithContext(context.Background(), client)
3755	if err != nil {
3756		err = autorest.NewErrorWithError(err, "containerregistry.PrivateEndpointConnectionsDeleteFuture", "Result", future.Response(), "Polling failure")
3757		return
3758	}
3759	if !done {
3760		ar.Response = future.Response()
3761		err = azure.NewAsyncOpIncompleteError("containerregistry.PrivateEndpointConnectionsDeleteFuture")
3762		return
3763	}
3764	ar.Response = future.Response()
3765	return
3766}
3767
3768// PrivateLinkResource a resource that supports private link capabilities.
3769type PrivateLinkResource struct {
3770	// Type - READ-ONLY; The resource type is private link resource.
3771	Type *string `json:"type,omitempty"`
3772	// ID - The resource ID.
3773	ID *string `json:"id,omitempty"`
3774	// Name - The name of the resource.
3775	Name *string `json:"name,omitempty"`
3776	// PrivateLinkResourceProperties - A resource that supports private link capabilities.
3777	*PrivateLinkResourceProperties `json:"properties,omitempty"`
3778}
3779
3780// MarshalJSON is the custom marshaler for PrivateLinkResource.
3781func (plr PrivateLinkResource) MarshalJSON() ([]byte, error) {
3782	objectMap := make(map[string]interface{})
3783	if plr.ID != nil {
3784		objectMap["id"] = plr.ID
3785	}
3786	if plr.Name != nil {
3787		objectMap["name"] = plr.Name
3788	}
3789	if plr.PrivateLinkResourceProperties != nil {
3790		objectMap["properties"] = plr.PrivateLinkResourceProperties
3791	}
3792	return json.Marshal(objectMap)
3793}
3794
3795// UnmarshalJSON is the custom unmarshaler for PrivateLinkResource struct.
3796func (plr *PrivateLinkResource) UnmarshalJSON(body []byte) error {
3797	var m map[string]*json.RawMessage
3798	err := json.Unmarshal(body, &m)
3799	if err != nil {
3800		return err
3801	}
3802	for k, v := range m {
3803		switch k {
3804		case "type":
3805			if v != nil {
3806				var typeVar string
3807				err = json.Unmarshal(*v, &typeVar)
3808				if err != nil {
3809					return err
3810				}
3811				plr.Type = &typeVar
3812			}
3813		case "id":
3814			if v != nil {
3815				var ID string
3816				err = json.Unmarshal(*v, &ID)
3817				if err != nil {
3818					return err
3819				}
3820				plr.ID = &ID
3821			}
3822		case "name":
3823			if v != nil {
3824				var name string
3825				err = json.Unmarshal(*v, &name)
3826				if err != nil {
3827					return err
3828				}
3829				plr.Name = &name
3830			}
3831		case "properties":
3832			if v != nil {
3833				var privateLinkResourceProperties PrivateLinkResourceProperties
3834				err = json.Unmarshal(*v, &privateLinkResourceProperties)
3835				if err != nil {
3836					return err
3837				}
3838				plr.PrivateLinkResourceProperties = &privateLinkResourceProperties
3839			}
3840		}
3841	}
3842
3843	return nil
3844}
3845
3846// PrivateLinkResourceListResult the result of a request to list private link resources for a container
3847// registry.
3848type PrivateLinkResourceListResult struct {
3849	autorest.Response `json:"-"`
3850	// Value - The list of private link resources. Since this list may be incomplete, the nextLink field should be used to request the next list of private link resources.
3851	Value *[]PrivateLinkResource `json:"value,omitempty"`
3852	// NextLink - The URI that can be used to request the next list of private link resources.
3853	NextLink *string `json:"nextLink,omitempty"`
3854}
3855
3856// PrivateLinkResourceListResultIterator provides access to a complete listing of PrivateLinkResource
3857// values.
3858type PrivateLinkResourceListResultIterator struct {
3859	i    int
3860	page PrivateLinkResourceListResultPage
3861}
3862
3863// NextWithContext advances to the next value.  If there was an error making
3864// the request the iterator does not advance and the error is returned.
3865func (iter *PrivateLinkResourceListResultIterator) NextWithContext(ctx context.Context) (err error) {
3866	if tracing.IsEnabled() {
3867		ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkResourceListResultIterator.NextWithContext")
3868		defer func() {
3869			sc := -1
3870			if iter.Response().Response.Response != nil {
3871				sc = iter.Response().Response.Response.StatusCode
3872			}
3873			tracing.EndSpan(ctx, sc, err)
3874		}()
3875	}
3876	iter.i++
3877	if iter.i < len(iter.page.Values()) {
3878		return nil
3879	}
3880	err = iter.page.NextWithContext(ctx)
3881	if err != nil {
3882		iter.i--
3883		return err
3884	}
3885	iter.i = 0
3886	return nil
3887}
3888
3889// Next advances to the next value.  If there was an error making
3890// the request the iterator does not advance and the error is returned.
3891// Deprecated: Use NextWithContext() instead.
3892func (iter *PrivateLinkResourceListResultIterator) Next() error {
3893	return iter.NextWithContext(context.Background())
3894}
3895
3896// NotDone returns true if the enumeration should be started or is not yet complete.
3897func (iter PrivateLinkResourceListResultIterator) NotDone() bool {
3898	return iter.page.NotDone() && iter.i < len(iter.page.Values())
3899}
3900
3901// Response returns the raw server response from the last page request.
3902func (iter PrivateLinkResourceListResultIterator) Response() PrivateLinkResourceListResult {
3903	return iter.page.Response()
3904}
3905
3906// Value returns the current value or a zero-initialized value if the
3907// iterator has advanced beyond the end of the collection.
3908func (iter PrivateLinkResourceListResultIterator) Value() PrivateLinkResource {
3909	if !iter.page.NotDone() {
3910		return PrivateLinkResource{}
3911	}
3912	return iter.page.Values()[iter.i]
3913}
3914
3915// Creates a new instance of the PrivateLinkResourceListResultIterator type.
3916func NewPrivateLinkResourceListResultIterator(page PrivateLinkResourceListResultPage) PrivateLinkResourceListResultIterator {
3917	return PrivateLinkResourceListResultIterator{page: page}
3918}
3919
3920// IsEmpty returns true if the ListResult contains no values.
3921func (plrlr PrivateLinkResourceListResult) IsEmpty() bool {
3922	return plrlr.Value == nil || len(*plrlr.Value) == 0
3923}
3924
3925// hasNextLink returns true if the NextLink is not empty.
3926func (plrlr PrivateLinkResourceListResult) hasNextLink() bool {
3927	return plrlr.NextLink != nil && len(*plrlr.NextLink) != 0
3928}
3929
3930// privateLinkResourceListResultPreparer prepares a request to retrieve the next set of results.
3931// It returns nil if no more results exist.
3932func (plrlr PrivateLinkResourceListResult) privateLinkResourceListResultPreparer(ctx context.Context) (*http.Request, error) {
3933	if !plrlr.hasNextLink() {
3934		return nil, nil
3935	}
3936	return autorest.Prepare((&http.Request{}).WithContext(ctx),
3937		autorest.AsJSON(),
3938		autorest.AsGet(),
3939		autorest.WithBaseURL(to.String(plrlr.NextLink)))
3940}
3941
3942// PrivateLinkResourceListResultPage contains a page of PrivateLinkResource values.
3943type PrivateLinkResourceListResultPage struct {
3944	fn    func(context.Context, PrivateLinkResourceListResult) (PrivateLinkResourceListResult, error)
3945	plrlr PrivateLinkResourceListResult
3946}
3947
3948// NextWithContext advances to the next page of values.  If there was an error making
3949// the request the page does not advance and the error is returned.
3950func (page *PrivateLinkResourceListResultPage) NextWithContext(ctx context.Context) (err error) {
3951	if tracing.IsEnabled() {
3952		ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkResourceListResultPage.NextWithContext")
3953		defer func() {
3954			sc := -1
3955			if page.Response().Response.Response != nil {
3956				sc = page.Response().Response.Response.StatusCode
3957			}
3958			tracing.EndSpan(ctx, sc, err)
3959		}()
3960	}
3961	for {
3962		next, err := page.fn(ctx, page.plrlr)
3963		if err != nil {
3964			return err
3965		}
3966		page.plrlr = next
3967		if !next.hasNextLink() || !next.IsEmpty() {
3968			break
3969		}
3970	}
3971	return nil
3972}
3973
3974// Next advances to the next page of values.  If there was an error making
3975// the request the page does not advance and the error is returned.
3976// Deprecated: Use NextWithContext() instead.
3977func (page *PrivateLinkResourceListResultPage) Next() error {
3978	return page.NextWithContext(context.Background())
3979}
3980
3981// NotDone returns true if the page enumeration should be started or is not yet complete.
3982func (page PrivateLinkResourceListResultPage) NotDone() bool {
3983	return !page.plrlr.IsEmpty()
3984}
3985
3986// Response returns the raw server response from the last page request.
3987func (page PrivateLinkResourceListResultPage) Response() PrivateLinkResourceListResult {
3988	return page.plrlr
3989}
3990
3991// Values returns the slice of values for the current page or nil if there are no values.
3992func (page PrivateLinkResourceListResultPage) Values() []PrivateLinkResource {
3993	if page.plrlr.IsEmpty() {
3994		return nil
3995	}
3996	return *page.plrlr.Value
3997}
3998
3999// Creates a new instance of the PrivateLinkResourceListResultPage type.
4000func NewPrivateLinkResourceListResultPage(cur PrivateLinkResourceListResult, getNextPage func(context.Context, PrivateLinkResourceListResult) (PrivateLinkResourceListResult, error)) PrivateLinkResourceListResultPage {
4001	return PrivateLinkResourceListResultPage{
4002		fn:    getNextPage,
4003		plrlr: cur,
4004	}
4005}
4006
4007// PrivateLinkResourceProperties the properties of a private link resource.
4008type PrivateLinkResourceProperties struct {
4009	// GroupID - The private link resource group id.
4010	GroupID *string `json:"groupId,omitempty"`
4011	// RequiredMembers - The private link resource required member names.
4012	RequiredMembers *[]string `json:"requiredMembers,omitempty"`
4013	// RequiredZoneNames - The private link resource Private link DNS zone name.
4014	RequiredZoneNames *[]string `json:"requiredZoneNames,omitempty"`
4015}
4016
4017// PrivateLinkServiceConnectionState the state of a private link service connection.
4018type PrivateLinkServiceConnectionState struct {
4019	// Status - The private link service connection status. Possible values include: 'Approved', 'Pending', 'Rejected', 'Disconnected'
4020	Status ConnectionStatus `json:"status,omitempty"`
4021	// Description - The description for connection status. For example if connection is rejected it can indicate reason for rejection.
4022	Description *string `json:"description,omitempty"`
4023	// ActionsRequired - A message indicating if changes on the service provider require any updates on the consumer. Possible values include: 'None', 'Recreate'
4024	ActionsRequired ActionsRequired `json:"actionsRequired,omitempty"`
4025}
4026
4027// ProgressProperties ...
4028type ProgressProperties struct {
4029	// Percentage - The percentage complete of the copy operation.
4030	Percentage *string `json:"percentage,omitempty"`
4031}
4032
4033// ProxyResource the resource model definition for a ARM proxy resource. It will have everything other than
4034// required location and tags.
4035type ProxyResource struct {
4036	// ID - READ-ONLY; The resource ID.
4037	ID *string `json:"id,omitempty"`
4038	// Name - READ-ONLY; The name of the resource.
4039	Name *string `json:"name,omitempty"`
4040	// Type - READ-ONLY; The type of the resource.
4041	Type *string `json:"type,omitempty"`
4042	// SystemData - READ-ONLY; Metadata pertaining to creation and last modification of the resource.
4043	SystemData *SystemData `json:"systemData,omitempty"`
4044}
4045
4046// MarshalJSON is the custom marshaler for ProxyResource.
4047func (pr ProxyResource) MarshalJSON() ([]byte, error) {
4048	objectMap := make(map[string]interface{})
4049	return json.Marshal(objectMap)
4050}
4051
4052// QuarantinePolicy the quarantine policy for a container registry.
4053type QuarantinePolicy struct {
4054	// Status - The value that indicates whether the policy is enabled or not. Possible values include: 'PolicyStatusEnabled', 'PolicyStatusDisabled'
4055	Status PolicyStatus `json:"status,omitempty"`
4056}
4057
4058// RegenerateCredentialParameters the parameters used to regenerate the login credential.
4059type RegenerateCredentialParameters struct {
4060	// Name - Specifies name of the password which should be regenerated -- password or password2. Possible values include: 'Password', 'Password2'
4061	Name PasswordName `json:"name,omitempty"`
4062}
4063
4064// RegistriesCreateFuture an abstraction for monitoring and retrieving the results of a long-running
4065// operation.
4066type RegistriesCreateFuture struct {
4067	azure.FutureAPI
4068	// Result returns the result of the asynchronous operation.
4069	// If the operation has not completed it will return an error.
4070	Result func(RegistriesClient) (Registry, error)
4071}
4072
4073// UnmarshalJSON is the custom unmarshaller for CreateFuture.
4074func (future *RegistriesCreateFuture) UnmarshalJSON(body []byte) error {
4075	var azFuture azure.Future
4076	if err := json.Unmarshal(body, &azFuture); err != nil {
4077		return err
4078	}
4079	future.FutureAPI = &azFuture
4080	future.Result = future.result
4081	return nil
4082}
4083
4084// result is the default implementation for RegistriesCreateFuture.Result.
4085func (future *RegistriesCreateFuture) result(client RegistriesClient) (r Registry, err error) {
4086	var done bool
4087	done, err = future.DoneWithContext(context.Background(), client)
4088	if err != nil {
4089		err = autorest.NewErrorWithError(err, "containerregistry.RegistriesCreateFuture", "Result", future.Response(), "Polling failure")
4090		return
4091	}
4092	if !done {
4093		r.Response.Response = future.Response()
4094		err = azure.NewAsyncOpIncompleteError("containerregistry.RegistriesCreateFuture")
4095		return
4096	}
4097	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
4098	if r.Response.Response, err = future.GetResult(sender); err == nil && r.Response.Response.StatusCode != http.StatusNoContent {
4099		r, err = client.CreateResponder(r.Response.Response)
4100		if err != nil {
4101			err = autorest.NewErrorWithError(err, "containerregistry.RegistriesCreateFuture", "Result", r.Response.Response, "Failure responding to request")
4102		}
4103	}
4104	return
4105}
4106
4107// RegistriesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
4108// operation.
4109type RegistriesDeleteFuture struct {
4110	azure.FutureAPI
4111	// Result returns the result of the asynchronous operation.
4112	// If the operation has not completed it will return an error.
4113	Result func(RegistriesClient) (autorest.Response, error)
4114}
4115
4116// UnmarshalJSON is the custom unmarshaller for CreateFuture.
4117func (future *RegistriesDeleteFuture) UnmarshalJSON(body []byte) error {
4118	var azFuture azure.Future
4119	if err := json.Unmarshal(body, &azFuture); err != nil {
4120		return err
4121	}
4122	future.FutureAPI = &azFuture
4123	future.Result = future.result
4124	return nil
4125}
4126
4127// result is the default implementation for RegistriesDeleteFuture.Result.
4128func (future *RegistriesDeleteFuture) result(client RegistriesClient) (ar autorest.Response, err error) {
4129	var done bool
4130	done, err = future.DoneWithContext(context.Background(), client)
4131	if err != nil {
4132		err = autorest.NewErrorWithError(err, "containerregistry.RegistriesDeleteFuture", "Result", future.Response(), "Polling failure")
4133		return
4134	}
4135	if !done {
4136		ar.Response = future.Response()
4137		err = azure.NewAsyncOpIncompleteError("containerregistry.RegistriesDeleteFuture")
4138		return
4139	}
4140	ar.Response = future.Response()
4141	return
4142}
4143
4144// RegistriesGenerateCredentialsFuture an abstraction for monitoring and retrieving the results of a
4145// long-running operation.
4146type RegistriesGenerateCredentialsFuture struct {
4147	azure.FutureAPI
4148	// Result returns the result of the asynchronous operation.
4149	// If the operation has not completed it will return an error.
4150	Result func(RegistriesClient) (GenerateCredentialsResult, error)
4151}
4152
4153// UnmarshalJSON is the custom unmarshaller for CreateFuture.
4154func (future *RegistriesGenerateCredentialsFuture) UnmarshalJSON(body []byte) error {
4155	var azFuture azure.Future
4156	if err := json.Unmarshal(body, &azFuture); err != nil {
4157		return err
4158	}
4159	future.FutureAPI = &azFuture
4160	future.Result = future.result
4161	return nil
4162}
4163
4164// result is the default implementation for RegistriesGenerateCredentialsFuture.Result.
4165func (future *RegistriesGenerateCredentialsFuture) result(client RegistriesClient) (gcr GenerateCredentialsResult, err error) {
4166	var done bool
4167	done, err = future.DoneWithContext(context.Background(), client)
4168	if err != nil {
4169		err = autorest.NewErrorWithError(err, "containerregistry.RegistriesGenerateCredentialsFuture", "Result", future.Response(), "Polling failure")
4170		return
4171	}
4172	if !done {
4173		gcr.Response.Response = future.Response()
4174		err = azure.NewAsyncOpIncompleteError("containerregistry.RegistriesGenerateCredentialsFuture")
4175		return
4176	}
4177	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
4178	if gcr.Response.Response, err = future.GetResult(sender); err == nil && gcr.Response.Response.StatusCode != http.StatusNoContent {
4179		gcr, err = client.GenerateCredentialsResponder(gcr.Response.Response)
4180		if err != nil {
4181			err = autorest.NewErrorWithError(err, "containerregistry.RegistriesGenerateCredentialsFuture", "Result", gcr.Response.Response, "Failure responding to request")
4182		}
4183	}
4184	return
4185}
4186
4187// RegistriesImportImageFuture an abstraction for monitoring and retrieving the results of a long-running
4188// operation.
4189type RegistriesImportImageFuture struct {
4190	azure.FutureAPI
4191	// Result returns the result of the asynchronous operation.
4192	// If the operation has not completed it will return an error.
4193	Result func(RegistriesClient) (autorest.Response, error)
4194}
4195
4196// UnmarshalJSON is the custom unmarshaller for CreateFuture.
4197func (future *RegistriesImportImageFuture) UnmarshalJSON(body []byte) error {
4198	var azFuture azure.Future
4199	if err := json.Unmarshal(body, &azFuture); err != nil {
4200		return err
4201	}
4202	future.FutureAPI = &azFuture
4203	future.Result = future.result
4204	return nil
4205}
4206
4207// result is the default implementation for RegistriesImportImageFuture.Result.
4208func (future *RegistriesImportImageFuture) result(client RegistriesClient) (ar autorest.Response, err error) {
4209	var done bool
4210	done, err = future.DoneWithContext(context.Background(), client)
4211	if err != nil {
4212		err = autorest.NewErrorWithError(err, "containerregistry.RegistriesImportImageFuture", "Result", future.Response(), "Polling failure")
4213		return
4214	}
4215	if !done {
4216		ar.Response = future.Response()
4217		err = azure.NewAsyncOpIncompleteError("containerregistry.RegistriesImportImageFuture")
4218		return
4219	}
4220	ar.Response = future.Response()
4221	return
4222}
4223
4224// RegistriesScheduleRunFuture an abstraction for monitoring and retrieving the results of a long-running
4225// operation.
4226type RegistriesScheduleRunFuture struct {
4227	azure.FutureAPI
4228	// Result returns the result of the asynchronous operation.
4229	// If the operation has not completed it will return an error.
4230	Result func(RegistriesClient) (Run, error)
4231}
4232
4233// UnmarshalJSON is the custom unmarshaller for CreateFuture.
4234func (future *RegistriesScheduleRunFuture) UnmarshalJSON(body []byte) error {
4235	var azFuture azure.Future
4236	if err := json.Unmarshal(body, &azFuture); err != nil {
4237		return err
4238	}
4239	future.FutureAPI = &azFuture
4240	future.Result = future.result
4241	return nil
4242}
4243
4244// result is the default implementation for RegistriesScheduleRunFuture.Result.
4245func (future *RegistriesScheduleRunFuture) result(client RegistriesClient) (r Run, err error) {
4246	var done bool
4247	done, err = future.DoneWithContext(context.Background(), client)
4248	if err != nil {
4249		err = autorest.NewErrorWithError(err, "containerregistry.RegistriesScheduleRunFuture", "Result", future.Response(), "Polling failure")
4250		return
4251	}
4252	if !done {
4253		r.Response.Response = future.Response()
4254		err = azure.NewAsyncOpIncompleteError("containerregistry.RegistriesScheduleRunFuture")
4255		return
4256	}
4257	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
4258	if r.Response.Response, err = future.GetResult(sender); err == nil && r.Response.Response.StatusCode != http.StatusNoContent {
4259		r, err = client.ScheduleRunResponder(r.Response.Response)
4260		if err != nil {
4261			err = autorest.NewErrorWithError(err, "containerregistry.RegistriesScheduleRunFuture", "Result", r.Response.Response, "Failure responding to request")
4262		}
4263	}
4264	return
4265}
4266
4267// RegistriesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
4268// operation.
4269type RegistriesUpdateFuture struct {
4270	azure.FutureAPI
4271	// Result returns the result of the asynchronous operation.
4272	// If the operation has not completed it will return an error.
4273	Result func(RegistriesClient) (Registry, error)
4274}
4275
4276// UnmarshalJSON is the custom unmarshaller for CreateFuture.
4277func (future *RegistriesUpdateFuture) UnmarshalJSON(body []byte) error {
4278	var azFuture azure.Future
4279	if err := json.Unmarshal(body, &azFuture); err != nil {
4280		return err
4281	}
4282	future.FutureAPI = &azFuture
4283	future.Result = future.result
4284	return nil
4285}
4286
4287// result is the default implementation for RegistriesUpdateFuture.Result.
4288func (future *RegistriesUpdateFuture) result(client RegistriesClient) (r Registry, err error) {
4289	var done bool
4290	done, err = future.DoneWithContext(context.Background(), client)
4291	if err != nil {
4292		err = autorest.NewErrorWithError(err, "containerregistry.RegistriesUpdateFuture", "Result", future.Response(), "Polling failure")
4293		return
4294	}
4295	if !done {
4296		r.Response.Response = future.Response()
4297		err = azure.NewAsyncOpIncompleteError("containerregistry.RegistriesUpdateFuture")
4298		return
4299	}
4300	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
4301	if r.Response.Response, err = future.GetResult(sender); err == nil && r.Response.Response.StatusCode != http.StatusNoContent {
4302		r, err = client.UpdateResponder(r.Response.Response)
4303		if err != nil {
4304			err = autorest.NewErrorWithError(err, "containerregistry.RegistriesUpdateFuture", "Result", r.Response.Response, "Failure responding to request")
4305		}
4306	}
4307	return
4308}
4309
4310// Registry an object that represents a container registry.
4311type Registry struct {
4312	autorest.Response `json:"-"`
4313	// Sku - The SKU of the container registry.
4314	Sku *Sku `json:"sku,omitempty"`
4315	// Identity - The identity of the container registry.
4316	Identity *IdentityProperties `json:"identity,omitempty"`
4317	// RegistryProperties - The properties of the container registry.
4318	*RegistryProperties `json:"properties,omitempty"`
4319	// ID - READ-ONLY; The resource ID.
4320	ID *string `json:"id,omitempty"`
4321	// Name - READ-ONLY; The name of the resource.
4322	Name *string `json:"name,omitempty"`
4323	// Type - READ-ONLY; The type of the resource.
4324	Type *string `json:"type,omitempty"`
4325	// Location - The location of the resource. This cannot be changed after the resource is created.
4326	Location *string `json:"location,omitempty"`
4327	// Tags - The tags of the resource.
4328	Tags map[string]*string `json:"tags"`
4329	// SystemData - READ-ONLY; Metadata pertaining to creation and last modification of the resource.
4330	SystemData *SystemData `json:"systemData,omitempty"`
4331}
4332
4333// MarshalJSON is the custom marshaler for Registry.
4334func (r Registry) MarshalJSON() ([]byte, error) {
4335	objectMap := make(map[string]interface{})
4336	if r.Sku != nil {
4337		objectMap["sku"] = r.Sku
4338	}
4339	if r.Identity != nil {
4340		objectMap["identity"] = r.Identity
4341	}
4342	if r.RegistryProperties != nil {
4343		objectMap["properties"] = r.RegistryProperties
4344	}
4345	if r.Location != nil {
4346		objectMap["location"] = r.Location
4347	}
4348	if r.Tags != nil {
4349		objectMap["tags"] = r.Tags
4350	}
4351	return json.Marshal(objectMap)
4352}
4353
4354// UnmarshalJSON is the custom unmarshaler for Registry struct.
4355func (r *Registry) UnmarshalJSON(body []byte) error {
4356	var m map[string]*json.RawMessage
4357	err := json.Unmarshal(body, &m)
4358	if err != nil {
4359		return err
4360	}
4361	for k, v := range m {
4362		switch k {
4363		case "sku":
4364			if v != nil {
4365				var sku Sku
4366				err = json.Unmarshal(*v, &sku)
4367				if err != nil {
4368					return err
4369				}
4370				r.Sku = &sku
4371			}
4372		case "identity":
4373			if v != nil {
4374				var identity IdentityProperties
4375				err = json.Unmarshal(*v, &identity)
4376				if err != nil {
4377					return err
4378				}
4379				r.Identity = &identity
4380			}
4381		case "properties":
4382			if v != nil {
4383				var registryProperties RegistryProperties
4384				err = json.Unmarshal(*v, &registryProperties)
4385				if err != nil {
4386					return err
4387				}
4388				r.RegistryProperties = &registryProperties
4389			}
4390		case "id":
4391			if v != nil {
4392				var ID string
4393				err = json.Unmarshal(*v, &ID)
4394				if err != nil {
4395					return err
4396				}
4397				r.ID = &ID
4398			}
4399		case "name":
4400			if v != nil {
4401				var name string
4402				err = json.Unmarshal(*v, &name)
4403				if err != nil {
4404					return err
4405				}
4406				r.Name = &name
4407			}
4408		case "type":
4409			if v != nil {
4410				var typeVar string
4411				err = json.Unmarshal(*v, &typeVar)
4412				if err != nil {
4413					return err
4414				}
4415				r.Type = &typeVar
4416			}
4417		case "location":
4418			if v != nil {
4419				var location string
4420				err = json.Unmarshal(*v, &location)
4421				if err != nil {
4422					return err
4423				}
4424				r.Location = &location
4425			}
4426		case "tags":
4427			if v != nil {
4428				var tags map[string]*string
4429				err = json.Unmarshal(*v, &tags)
4430				if err != nil {
4431					return err
4432				}
4433				r.Tags = tags
4434			}
4435		case "systemData":
4436			if v != nil {
4437				var systemData SystemData
4438				err = json.Unmarshal(*v, &systemData)
4439				if err != nil {
4440					return err
4441				}
4442				r.SystemData = &systemData
4443			}
4444		}
4445	}
4446
4447	return nil
4448}
4449
4450// RegistryListCredentialsResult the response from the ListCredentials operation.
4451type RegistryListCredentialsResult struct {
4452	autorest.Response `json:"-"`
4453	// Username - The username for a container registry.
4454	Username *string `json:"username,omitempty"`
4455	// Passwords - The list of passwords for a container registry.
4456	Passwords *[]RegistryPassword `json:"passwords,omitempty"`
4457}
4458
4459// RegistryListResult the result of a request to list container registries.
4460type RegistryListResult struct {
4461	autorest.Response `json:"-"`
4462	// 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.
4463	Value *[]Registry `json:"value,omitempty"`
4464	// NextLink - The URI that can be used to request the next list of container registries.
4465	NextLink *string `json:"nextLink,omitempty"`
4466}
4467
4468// RegistryListResultIterator provides access to a complete listing of Registry values.
4469type RegistryListResultIterator struct {
4470	i    int
4471	page RegistryListResultPage
4472}
4473
4474// NextWithContext advances to the next value.  If there was an error making
4475// the request the iterator does not advance and the error is returned.
4476func (iter *RegistryListResultIterator) NextWithContext(ctx context.Context) (err error) {
4477	if tracing.IsEnabled() {
4478		ctx = tracing.StartSpan(ctx, fqdn+"/RegistryListResultIterator.NextWithContext")
4479		defer func() {
4480			sc := -1
4481			if iter.Response().Response.Response != nil {
4482				sc = iter.Response().Response.Response.StatusCode
4483			}
4484			tracing.EndSpan(ctx, sc, err)
4485		}()
4486	}
4487	iter.i++
4488	if iter.i < len(iter.page.Values()) {
4489		return nil
4490	}
4491	err = iter.page.NextWithContext(ctx)
4492	if err != nil {
4493		iter.i--
4494		return err
4495	}
4496	iter.i = 0
4497	return nil
4498}
4499
4500// Next advances to the next value.  If there was an error making
4501// the request the iterator does not advance and the error is returned.
4502// Deprecated: Use NextWithContext() instead.
4503func (iter *RegistryListResultIterator) Next() error {
4504	return iter.NextWithContext(context.Background())
4505}
4506
4507// NotDone returns true if the enumeration should be started or is not yet complete.
4508func (iter RegistryListResultIterator) NotDone() bool {
4509	return iter.page.NotDone() && iter.i < len(iter.page.Values())
4510}
4511
4512// Response returns the raw server response from the last page request.
4513func (iter RegistryListResultIterator) Response() RegistryListResult {
4514	return iter.page.Response()
4515}
4516
4517// Value returns the current value or a zero-initialized value if the
4518// iterator has advanced beyond the end of the collection.
4519func (iter RegistryListResultIterator) Value() Registry {
4520	if !iter.page.NotDone() {
4521		return Registry{}
4522	}
4523	return iter.page.Values()[iter.i]
4524}
4525
4526// Creates a new instance of the RegistryListResultIterator type.
4527func NewRegistryListResultIterator(page RegistryListResultPage) RegistryListResultIterator {
4528	return RegistryListResultIterator{page: page}
4529}
4530
4531// IsEmpty returns true if the ListResult contains no values.
4532func (rlr RegistryListResult) IsEmpty() bool {
4533	return rlr.Value == nil || len(*rlr.Value) == 0
4534}
4535
4536// hasNextLink returns true if the NextLink is not empty.
4537func (rlr RegistryListResult) hasNextLink() bool {
4538	return rlr.NextLink != nil && len(*rlr.NextLink) != 0
4539}
4540
4541// registryListResultPreparer prepares a request to retrieve the next set of results.
4542// It returns nil if no more results exist.
4543func (rlr RegistryListResult) registryListResultPreparer(ctx context.Context) (*http.Request, error) {
4544	if !rlr.hasNextLink() {
4545		return nil, nil
4546	}
4547	return autorest.Prepare((&http.Request{}).WithContext(ctx),
4548		autorest.AsJSON(),
4549		autorest.AsGet(),
4550		autorest.WithBaseURL(to.String(rlr.NextLink)))
4551}
4552
4553// RegistryListResultPage contains a page of Registry values.
4554type RegistryListResultPage struct {
4555	fn  func(context.Context, RegistryListResult) (RegistryListResult, error)
4556	rlr RegistryListResult
4557}
4558
4559// NextWithContext advances to the next page of values.  If there was an error making
4560// the request the page does not advance and the error is returned.
4561func (page *RegistryListResultPage) NextWithContext(ctx context.Context) (err error) {
4562	if tracing.IsEnabled() {
4563		ctx = tracing.StartSpan(ctx, fqdn+"/RegistryListResultPage.NextWithContext")
4564		defer func() {
4565			sc := -1
4566			if page.Response().Response.Response != nil {
4567				sc = page.Response().Response.Response.StatusCode
4568			}
4569			tracing.EndSpan(ctx, sc, err)
4570		}()
4571	}
4572	for {
4573		next, err := page.fn(ctx, page.rlr)
4574		if err != nil {
4575			return err
4576		}
4577		page.rlr = next
4578		if !next.hasNextLink() || !next.IsEmpty() {
4579			break
4580		}
4581	}
4582	return nil
4583}
4584
4585// Next advances to the next page of values.  If there was an error making
4586// the request the page does not advance and the error is returned.
4587// Deprecated: Use NextWithContext() instead.
4588func (page *RegistryListResultPage) Next() error {
4589	return page.NextWithContext(context.Background())
4590}
4591
4592// NotDone returns true if the page enumeration should be started or is not yet complete.
4593func (page RegistryListResultPage) NotDone() bool {
4594	return !page.rlr.IsEmpty()
4595}
4596
4597// Response returns the raw server response from the last page request.
4598func (page RegistryListResultPage) Response() RegistryListResult {
4599	return page.rlr
4600}
4601
4602// Values returns the slice of values for the current page or nil if there are no values.
4603func (page RegistryListResultPage) Values() []Registry {
4604	if page.rlr.IsEmpty() {
4605		return nil
4606	}
4607	return *page.rlr.Value
4608}
4609
4610// Creates a new instance of the RegistryListResultPage type.
4611func NewRegistryListResultPage(cur RegistryListResult, getNextPage func(context.Context, RegistryListResult) (RegistryListResult, error)) RegistryListResultPage {
4612	return RegistryListResultPage{
4613		fn:  getNextPage,
4614		rlr: cur,
4615	}
4616}
4617
4618// RegistryNameCheckRequest a request to check whether a container registry name is available.
4619type RegistryNameCheckRequest struct {
4620	// Name - The name of the container registry.
4621	Name *string `json:"name,omitempty"`
4622	// Type - The resource type of the container registry. This field must be set to 'Microsoft.ContainerRegistry/registries'.
4623	Type *string `json:"type,omitempty"`
4624}
4625
4626// RegistryNameStatus the result of a request to check the availability of a container registry name.
4627type RegistryNameStatus struct {
4628	autorest.Response `json:"-"`
4629	// NameAvailable - The value that indicates whether the name is available.
4630	NameAvailable *bool `json:"nameAvailable,omitempty"`
4631	// Reason - If any, the reason that the name is not available.
4632	Reason *string `json:"reason,omitempty"`
4633	// Message - If any, the error message that provides more detail for the reason that the name is not available.
4634	Message *string `json:"message,omitempty"`
4635}
4636
4637// RegistryPassword the login password for the container registry.
4638type RegistryPassword struct {
4639	// Name - The password name. Possible values include: 'Password', 'Password2'
4640	Name PasswordName `json:"name,omitempty"`
4641	// Value - The password value.
4642	Value *string `json:"value,omitempty"`
4643}
4644
4645// RegistryProperties the properties of a container registry.
4646type RegistryProperties struct {
4647	// LoginServer - READ-ONLY; The URL that can be used to log into the container registry.
4648	LoginServer *string `json:"loginServer,omitempty"`
4649	// CreationDate - READ-ONLY; The creation date of the container registry in ISO8601 format.
4650	CreationDate *date.Time `json:"creationDate,omitempty"`
4651	// ProvisioningState - READ-ONLY; The provisioning state of the container registry at the time the operation was called. Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', 'Canceled'
4652	ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
4653	// Status - READ-ONLY; The status of the container registry at the time the operation was called.
4654	Status *Status `json:"status,omitempty"`
4655	// AdminUserEnabled - The value that indicates whether the admin user is enabled.
4656	AdminUserEnabled *bool `json:"adminUserEnabled,omitempty"`
4657	// StorageAccount - The properties of the storage account for the container registry. Only applicable to Classic SKU.
4658	StorageAccount *StorageAccountProperties `json:"storageAccount,omitempty"`
4659	// NetworkRuleSet - The network rule set for a container registry.
4660	NetworkRuleSet *NetworkRuleSet `json:"networkRuleSet,omitempty"`
4661	// Policies - The policies for a container registry.
4662	Policies *Policies `json:"policies,omitempty"`
4663	// Encryption - The encryption settings of container registry.
4664	Encryption *EncryptionProperty `json:"encryption,omitempty"`
4665	// DataEndpointEnabled - Enable a single data endpoint per region for serving data.
4666	DataEndpointEnabled *bool `json:"dataEndpointEnabled,omitempty"`
4667	// DataEndpointHostNames - READ-ONLY; List of host names that will serve data when dataEndpointEnabled is true.
4668	DataEndpointHostNames *[]string `json:"dataEndpointHostNames,omitempty"`
4669	// PrivateEndpointConnections - READ-ONLY; List of private endpoint connections for a container registry.
4670	PrivateEndpointConnections *[]PrivateEndpointConnection `json:"privateEndpointConnections,omitempty"`
4671	// PublicNetworkAccess - Whether or not public network access is allowed for the container registry. Possible values include: 'PublicNetworkAccessEnabled', 'PublicNetworkAccessDisabled'
4672	PublicNetworkAccess PublicNetworkAccess `json:"publicNetworkAccess,omitempty"`
4673}
4674
4675// MarshalJSON is the custom marshaler for RegistryProperties.
4676func (rp RegistryProperties) MarshalJSON() ([]byte, error) {
4677	objectMap := make(map[string]interface{})
4678	if rp.AdminUserEnabled != nil {
4679		objectMap["adminUserEnabled"] = rp.AdminUserEnabled
4680	}
4681	if rp.StorageAccount != nil {
4682		objectMap["storageAccount"] = rp.StorageAccount
4683	}
4684	if rp.NetworkRuleSet != nil {
4685		objectMap["networkRuleSet"] = rp.NetworkRuleSet
4686	}
4687	if rp.Policies != nil {
4688		objectMap["policies"] = rp.Policies
4689	}
4690	if rp.Encryption != nil {
4691		objectMap["encryption"] = rp.Encryption
4692	}
4693	if rp.DataEndpointEnabled != nil {
4694		objectMap["dataEndpointEnabled"] = rp.DataEndpointEnabled
4695	}
4696	if rp.PublicNetworkAccess != "" {
4697		objectMap["publicNetworkAccess"] = rp.PublicNetworkAccess
4698	}
4699	return json.Marshal(objectMap)
4700}
4701
4702// RegistryPropertiesUpdateParameters the parameters for updating the properties of a container registry.
4703type RegistryPropertiesUpdateParameters struct {
4704	// AdminUserEnabled - The value that indicates whether the admin user is enabled.
4705	AdminUserEnabled *bool `json:"adminUserEnabled,omitempty"`
4706	// NetworkRuleSet - The network rule set for a container registry.
4707	NetworkRuleSet *NetworkRuleSet `json:"networkRuleSet,omitempty"`
4708	// Policies - The policies for a container registry.
4709	Policies *Policies `json:"policies,omitempty"`
4710	// Encryption - The encryption settings of container registry.
4711	Encryption *EncryptionProperty `json:"encryption,omitempty"`
4712	// DataEndpointEnabled - Enable a single data endpoint per region for serving data.
4713	DataEndpointEnabled *bool `json:"dataEndpointEnabled,omitempty"`
4714	// PublicNetworkAccess - Whether or not public network access is allowed for the container registry. Possible values include: 'PublicNetworkAccessEnabled', 'PublicNetworkAccessDisabled'
4715	PublicNetworkAccess PublicNetworkAccess `json:"publicNetworkAccess,omitempty"`
4716}
4717
4718// RegistryUpdateParameters the parameters for updating a container registry.
4719type RegistryUpdateParameters struct {
4720	// Tags - The tags for the container registry.
4721	Tags map[string]*string `json:"tags"`
4722	// Sku - The SKU of the container registry.
4723	Sku *Sku `json:"sku,omitempty"`
4724	// Identity - The identity of the container registry.
4725	Identity *IdentityProperties `json:"identity,omitempty"`
4726	// RegistryPropertiesUpdateParameters - The properties that the container registry will be updated with.
4727	*RegistryPropertiesUpdateParameters `json:"properties,omitempty"`
4728}
4729
4730// MarshalJSON is the custom marshaler for RegistryUpdateParameters.
4731func (rup RegistryUpdateParameters) MarshalJSON() ([]byte, error) {
4732	objectMap := make(map[string]interface{})
4733	if rup.Tags != nil {
4734		objectMap["tags"] = rup.Tags
4735	}
4736	if rup.Sku != nil {
4737		objectMap["sku"] = rup.Sku
4738	}
4739	if rup.Identity != nil {
4740		objectMap["identity"] = rup.Identity
4741	}
4742	if rup.RegistryPropertiesUpdateParameters != nil {
4743		objectMap["properties"] = rup.RegistryPropertiesUpdateParameters
4744	}
4745	return json.Marshal(objectMap)
4746}
4747
4748// UnmarshalJSON is the custom unmarshaler for RegistryUpdateParameters struct.
4749func (rup *RegistryUpdateParameters) UnmarshalJSON(body []byte) error {
4750	var m map[string]*json.RawMessage
4751	err := json.Unmarshal(body, &m)
4752	if err != nil {
4753		return err
4754	}
4755	for k, v := range m {
4756		switch k {
4757		case "tags":
4758			if v != nil {
4759				var tags map[string]*string
4760				err = json.Unmarshal(*v, &tags)
4761				if err != nil {
4762					return err
4763				}
4764				rup.Tags = tags
4765			}
4766		case "sku":
4767			if v != nil {
4768				var sku Sku
4769				err = json.Unmarshal(*v, &sku)
4770				if err != nil {
4771					return err
4772				}
4773				rup.Sku = &sku
4774			}
4775		case "identity":
4776			if v != nil {
4777				var identity IdentityProperties
4778				err = json.Unmarshal(*v, &identity)
4779				if err != nil {
4780					return err
4781				}
4782				rup.Identity = &identity
4783			}
4784		case "properties":
4785			if v != nil {
4786				var registryPropertiesUpdateParameters RegistryPropertiesUpdateParameters
4787				err = json.Unmarshal(*v, &registryPropertiesUpdateParameters)
4788				if err != nil {
4789					return err
4790				}
4791				rup.RegistryPropertiesUpdateParameters = &registryPropertiesUpdateParameters
4792			}
4793		}
4794	}
4795
4796	return nil
4797}
4798
4799// RegistryUsage the quota usage for a container registry.
4800type RegistryUsage struct {
4801	// Name - The name of the usage.
4802	Name *string `json:"name,omitempty"`
4803	// Limit - The limit of the usage.
4804	Limit *int64 `json:"limit,omitempty"`
4805	// CurrentValue - The current value of the usage.
4806	CurrentValue *int64 `json:"currentValue,omitempty"`
4807	// Unit - The unit of measurement. Possible values include: 'Count', 'Bytes'
4808	Unit RegistryUsageUnit `json:"unit,omitempty"`
4809}
4810
4811// RegistryUsageListResult the result of a request to get container registry quota usages.
4812type RegistryUsageListResult struct {
4813	autorest.Response `json:"-"`
4814	// Value - The list of container registry quota usages.
4815	Value *[]RegistryUsage `json:"value,omitempty"`
4816}
4817
4818// Replication an object that represents a replication for a container registry.
4819type Replication struct {
4820	autorest.Response `json:"-"`
4821	// ReplicationProperties - The properties of the replication.
4822	*ReplicationProperties `json:"properties,omitempty"`
4823	// ID - READ-ONLY; The resource ID.
4824	ID *string `json:"id,omitempty"`
4825	// Name - READ-ONLY; The name of the resource.
4826	Name *string `json:"name,omitempty"`
4827	// Type - READ-ONLY; The type of the resource.
4828	Type *string `json:"type,omitempty"`
4829	// Location - The location of the resource. This cannot be changed after the resource is created.
4830	Location *string `json:"location,omitempty"`
4831	// Tags - The tags of the resource.
4832	Tags map[string]*string `json:"tags"`
4833	// SystemData - READ-ONLY; Metadata pertaining to creation and last modification of the resource.
4834	SystemData *SystemData `json:"systemData,omitempty"`
4835}
4836
4837// MarshalJSON is the custom marshaler for Replication.
4838func (r Replication) MarshalJSON() ([]byte, error) {
4839	objectMap := make(map[string]interface{})
4840	if r.ReplicationProperties != nil {
4841		objectMap["properties"] = r.ReplicationProperties
4842	}
4843	if r.Location != nil {
4844		objectMap["location"] = r.Location
4845	}
4846	if r.Tags != nil {
4847		objectMap["tags"] = r.Tags
4848	}
4849	return json.Marshal(objectMap)
4850}
4851
4852// UnmarshalJSON is the custom unmarshaler for Replication struct.
4853func (r *Replication) UnmarshalJSON(body []byte) error {
4854	var m map[string]*json.RawMessage
4855	err := json.Unmarshal(body, &m)
4856	if err != nil {
4857		return err
4858	}
4859	for k, v := range m {
4860		switch k {
4861		case "properties":
4862			if v != nil {
4863				var replicationProperties ReplicationProperties
4864				err = json.Unmarshal(*v, &replicationProperties)
4865				if err != nil {
4866					return err
4867				}
4868				r.ReplicationProperties = &replicationProperties
4869			}
4870		case "id":
4871			if v != nil {
4872				var ID string
4873				err = json.Unmarshal(*v, &ID)
4874				if err != nil {
4875					return err
4876				}
4877				r.ID = &ID
4878			}
4879		case "name":
4880			if v != nil {
4881				var name string
4882				err = json.Unmarshal(*v, &name)
4883				if err != nil {
4884					return err
4885				}
4886				r.Name = &name
4887			}
4888		case "type":
4889			if v != nil {
4890				var typeVar string
4891				err = json.Unmarshal(*v, &typeVar)
4892				if err != nil {
4893					return err
4894				}
4895				r.Type = &typeVar
4896			}
4897		case "location":
4898			if v != nil {
4899				var location string
4900				err = json.Unmarshal(*v, &location)
4901				if err != nil {
4902					return err
4903				}
4904				r.Location = &location
4905			}
4906		case "tags":
4907			if v != nil {
4908				var tags map[string]*string
4909				err = json.Unmarshal(*v, &tags)
4910				if err != nil {
4911					return err
4912				}
4913				r.Tags = tags
4914			}
4915		case "systemData":
4916			if v != nil {
4917				var systemData SystemData
4918				err = json.Unmarshal(*v, &systemData)
4919				if err != nil {
4920					return err
4921				}
4922				r.SystemData = &systemData
4923			}
4924		}
4925	}
4926
4927	return nil
4928}
4929
4930// ReplicationListResult the result of a request to list replications for a container registry.
4931type ReplicationListResult struct {
4932	autorest.Response `json:"-"`
4933	// Value - The list of replications. Since this list may be incomplete, the nextLink field should be used to request the next list of replications.
4934	Value *[]Replication `json:"value,omitempty"`
4935	// NextLink - The URI that can be used to request the next list of replications.
4936	NextLink *string `json:"nextLink,omitempty"`
4937}
4938
4939// ReplicationListResultIterator provides access to a complete listing of Replication values.
4940type ReplicationListResultIterator struct {
4941	i    int
4942	page ReplicationListResultPage
4943}
4944
4945// NextWithContext advances to the next value.  If there was an error making
4946// the request the iterator does not advance and the error is returned.
4947func (iter *ReplicationListResultIterator) NextWithContext(ctx context.Context) (err error) {
4948	if tracing.IsEnabled() {
4949		ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationListResultIterator.NextWithContext")
4950		defer func() {
4951			sc := -1
4952			if iter.Response().Response.Response != nil {
4953				sc = iter.Response().Response.Response.StatusCode
4954			}
4955			tracing.EndSpan(ctx, sc, err)
4956		}()
4957	}
4958	iter.i++
4959	if iter.i < len(iter.page.Values()) {
4960		return nil
4961	}
4962	err = iter.page.NextWithContext(ctx)
4963	if err != nil {
4964		iter.i--
4965		return err
4966	}
4967	iter.i = 0
4968	return nil
4969}
4970
4971// Next advances to the next value.  If there was an error making
4972// the request the iterator does not advance and the error is returned.
4973// Deprecated: Use NextWithContext() instead.
4974func (iter *ReplicationListResultIterator) Next() error {
4975	return iter.NextWithContext(context.Background())
4976}
4977
4978// NotDone returns true if the enumeration should be started or is not yet complete.
4979func (iter ReplicationListResultIterator) NotDone() bool {
4980	return iter.page.NotDone() && iter.i < len(iter.page.Values())
4981}
4982
4983// Response returns the raw server response from the last page request.
4984func (iter ReplicationListResultIterator) Response() ReplicationListResult {
4985	return iter.page.Response()
4986}
4987
4988// Value returns the current value or a zero-initialized value if the
4989// iterator has advanced beyond the end of the collection.
4990func (iter ReplicationListResultIterator) Value() Replication {
4991	if !iter.page.NotDone() {
4992		return Replication{}
4993	}
4994	return iter.page.Values()[iter.i]
4995}
4996
4997// Creates a new instance of the ReplicationListResultIterator type.
4998func NewReplicationListResultIterator(page ReplicationListResultPage) ReplicationListResultIterator {
4999	return ReplicationListResultIterator{page: page}
5000}
5001
5002// IsEmpty returns true if the ListResult contains no values.
5003func (rlr ReplicationListResult) IsEmpty() bool {
5004	return rlr.Value == nil || len(*rlr.Value) == 0
5005}
5006
5007// hasNextLink returns true if the NextLink is not empty.
5008func (rlr ReplicationListResult) hasNextLink() bool {
5009	return rlr.NextLink != nil && len(*rlr.NextLink) != 0
5010}
5011
5012// replicationListResultPreparer prepares a request to retrieve the next set of results.
5013// It returns nil if no more results exist.
5014func (rlr ReplicationListResult) replicationListResultPreparer(ctx context.Context) (*http.Request, error) {
5015	if !rlr.hasNextLink() {
5016		return nil, nil
5017	}
5018	return autorest.Prepare((&http.Request{}).WithContext(ctx),
5019		autorest.AsJSON(),
5020		autorest.AsGet(),
5021		autorest.WithBaseURL(to.String(rlr.NextLink)))
5022}
5023
5024// ReplicationListResultPage contains a page of Replication values.
5025type ReplicationListResultPage struct {
5026	fn  func(context.Context, ReplicationListResult) (ReplicationListResult, error)
5027	rlr ReplicationListResult
5028}
5029
5030// NextWithContext advances to the next page of values.  If there was an error making
5031// the request the page does not advance and the error is returned.
5032func (page *ReplicationListResultPage) NextWithContext(ctx context.Context) (err error) {
5033	if tracing.IsEnabled() {
5034		ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationListResultPage.NextWithContext")
5035		defer func() {
5036			sc := -1
5037			if page.Response().Response.Response != nil {
5038				sc = page.Response().Response.Response.StatusCode
5039			}
5040			tracing.EndSpan(ctx, sc, err)
5041		}()
5042	}
5043	for {
5044		next, err := page.fn(ctx, page.rlr)
5045		if err != nil {
5046			return err
5047		}
5048		page.rlr = next
5049		if !next.hasNextLink() || !next.IsEmpty() {
5050			break
5051		}
5052	}
5053	return nil
5054}
5055
5056// Next advances to the next page of values.  If there was an error making
5057// the request the page does not advance and the error is returned.
5058// Deprecated: Use NextWithContext() instead.
5059func (page *ReplicationListResultPage) Next() error {
5060	return page.NextWithContext(context.Background())
5061}
5062
5063// NotDone returns true if the page enumeration should be started or is not yet complete.
5064func (page ReplicationListResultPage) NotDone() bool {
5065	return !page.rlr.IsEmpty()
5066}
5067
5068// Response returns the raw server response from the last page request.
5069func (page ReplicationListResultPage) Response() ReplicationListResult {
5070	return page.rlr
5071}
5072
5073// Values returns the slice of values for the current page or nil if there are no values.
5074func (page ReplicationListResultPage) Values() []Replication {
5075	if page.rlr.IsEmpty() {
5076		return nil
5077	}
5078	return *page.rlr.Value
5079}
5080
5081// Creates a new instance of the ReplicationListResultPage type.
5082func NewReplicationListResultPage(cur ReplicationListResult, getNextPage func(context.Context, ReplicationListResult) (ReplicationListResult, error)) ReplicationListResultPage {
5083	return ReplicationListResultPage{
5084		fn:  getNextPage,
5085		rlr: cur,
5086	}
5087}
5088
5089// ReplicationProperties the properties of a replication.
5090type ReplicationProperties struct {
5091	// ProvisioningState - READ-ONLY; The provisioning state of the replication at the time the operation was called. Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', 'Canceled'
5092	ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
5093	// Status - READ-ONLY; The status of the replication at the time the operation was called.
5094	Status *Status `json:"status,omitempty"`
5095	// RegionEndpointEnabled - Specifies whether the replication's regional endpoint is enabled. Requests will not be routed to a replication whose regional endpoint is disabled, however its data will continue to be synced with other replications.
5096	RegionEndpointEnabled *bool `json:"regionEndpointEnabled,omitempty"`
5097}
5098
5099// MarshalJSON is the custom marshaler for ReplicationProperties.
5100func (rp ReplicationProperties) MarshalJSON() ([]byte, error) {
5101	objectMap := make(map[string]interface{})
5102	if rp.RegionEndpointEnabled != nil {
5103		objectMap["regionEndpointEnabled"] = rp.RegionEndpointEnabled
5104	}
5105	return json.Marshal(objectMap)
5106}
5107
5108// ReplicationsCreateFuture an abstraction for monitoring and retrieving the results of a long-running
5109// operation.
5110type ReplicationsCreateFuture struct {
5111	azure.FutureAPI
5112	// Result returns the result of the asynchronous operation.
5113	// If the operation has not completed it will return an error.
5114	Result func(ReplicationsClient) (Replication, error)
5115}
5116
5117// UnmarshalJSON is the custom unmarshaller for CreateFuture.
5118func (future *ReplicationsCreateFuture) UnmarshalJSON(body []byte) error {
5119	var azFuture azure.Future
5120	if err := json.Unmarshal(body, &azFuture); err != nil {
5121		return err
5122	}
5123	future.FutureAPI = &azFuture
5124	future.Result = future.result
5125	return nil
5126}
5127
5128// result is the default implementation for ReplicationsCreateFuture.Result.
5129func (future *ReplicationsCreateFuture) result(client ReplicationsClient) (r Replication, err error) {
5130	var done bool
5131	done, err = future.DoneWithContext(context.Background(), client)
5132	if err != nil {
5133		err = autorest.NewErrorWithError(err, "containerregistry.ReplicationsCreateFuture", "Result", future.Response(), "Polling failure")
5134		return
5135	}
5136	if !done {
5137		r.Response.Response = future.Response()
5138		err = azure.NewAsyncOpIncompleteError("containerregistry.ReplicationsCreateFuture")
5139		return
5140	}
5141	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
5142	if r.Response.Response, err = future.GetResult(sender); err == nil && r.Response.Response.StatusCode != http.StatusNoContent {
5143		r, err = client.CreateResponder(r.Response.Response)
5144		if err != nil {
5145			err = autorest.NewErrorWithError(err, "containerregistry.ReplicationsCreateFuture", "Result", r.Response.Response, "Failure responding to request")
5146		}
5147	}
5148	return
5149}
5150
5151// ReplicationsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
5152// operation.
5153type ReplicationsDeleteFuture struct {
5154	azure.FutureAPI
5155	// Result returns the result of the asynchronous operation.
5156	// If the operation has not completed it will return an error.
5157	Result func(ReplicationsClient) (autorest.Response, error)
5158}
5159
5160// UnmarshalJSON is the custom unmarshaller for CreateFuture.
5161func (future *ReplicationsDeleteFuture) UnmarshalJSON(body []byte) error {
5162	var azFuture azure.Future
5163	if err := json.Unmarshal(body, &azFuture); err != nil {
5164		return err
5165	}
5166	future.FutureAPI = &azFuture
5167	future.Result = future.result
5168	return nil
5169}
5170
5171// result is the default implementation for ReplicationsDeleteFuture.Result.
5172func (future *ReplicationsDeleteFuture) result(client ReplicationsClient) (ar autorest.Response, err error) {
5173	var done bool
5174	done, err = future.DoneWithContext(context.Background(), client)
5175	if err != nil {
5176		err = autorest.NewErrorWithError(err, "containerregistry.ReplicationsDeleteFuture", "Result", future.Response(), "Polling failure")
5177		return
5178	}
5179	if !done {
5180		ar.Response = future.Response()
5181		err = azure.NewAsyncOpIncompleteError("containerregistry.ReplicationsDeleteFuture")
5182		return
5183	}
5184	ar.Response = future.Response()
5185	return
5186}
5187
5188// ReplicationsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
5189// operation.
5190type ReplicationsUpdateFuture struct {
5191	azure.FutureAPI
5192	// Result returns the result of the asynchronous operation.
5193	// If the operation has not completed it will return an error.
5194	Result func(ReplicationsClient) (Replication, error)
5195}
5196
5197// UnmarshalJSON is the custom unmarshaller for CreateFuture.
5198func (future *ReplicationsUpdateFuture) UnmarshalJSON(body []byte) error {
5199	var azFuture azure.Future
5200	if err := json.Unmarshal(body, &azFuture); err != nil {
5201		return err
5202	}
5203	future.FutureAPI = &azFuture
5204	future.Result = future.result
5205	return nil
5206}
5207
5208// result is the default implementation for ReplicationsUpdateFuture.Result.
5209func (future *ReplicationsUpdateFuture) result(client ReplicationsClient) (r Replication, err error) {
5210	var done bool
5211	done, err = future.DoneWithContext(context.Background(), client)
5212	if err != nil {
5213		err = autorest.NewErrorWithError(err, "containerregistry.ReplicationsUpdateFuture", "Result", future.Response(), "Polling failure")
5214		return
5215	}
5216	if !done {
5217		r.Response.Response = future.Response()
5218		err = azure.NewAsyncOpIncompleteError("containerregistry.ReplicationsUpdateFuture")
5219		return
5220	}
5221	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
5222	if r.Response.Response, err = future.GetResult(sender); err == nil && r.Response.Response.StatusCode != http.StatusNoContent {
5223		r, err = client.UpdateResponder(r.Response.Response)
5224		if err != nil {
5225			err = autorest.NewErrorWithError(err, "containerregistry.ReplicationsUpdateFuture", "Result", r.Response.Response, "Failure responding to request")
5226		}
5227	}
5228	return
5229}
5230
5231// ReplicationUpdateParameters the parameters for updating a replication.
5232type ReplicationUpdateParameters struct {
5233	// Tags - The tags for the replication.
5234	Tags map[string]*string `json:"tags"`
5235	// ReplicationUpdateParametersProperties - The parameters for updating a replication's properties
5236	*ReplicationUpdateParametersProperties `json:"properties,omitempty"`
5237}
5238
5239// MarshalJSON is the custom marshaler for ReplicationUpdateParameters.
5240func (rup ReplicationUpdateParameters) MarshalJSON() ([]byte, error) {
5241	objectMap := make(map[string]interface{})
5242	if rup.Tags != nil {
5243		objectMap["tags"] = rup.Tags
5244	}
5245	if rup.ReplicationUpdateParametersProperties != nil {
5246		objectMap["properties"] = rup.ReplicationUpdateParametersProperties
5247	}
5248	return json.Marshal(objectMap)
5249}
5250
5251// UnmarshalJSON is the custom unmarshaler for ReplicationUpdateParameters struct.
5252func (rup *ReplicationUpdateParameters) UnmarshalJSON(body []byte) error {
5253	var m map[string]*json.RawMessage
5254	err := json.Unmarshal(body, &m)
5255	if err != nil {
5256		return err
5257	}
5258	for k, v := range m {
5259		switch k {
5260		case "tags":
5261			if v != nil {
5262				var tags map[string]*string
5263				err = json.Unmarshal(*v, &tags)
5264				if err != nil {
5265					return err
5266				}
5267				rup.Tags = tags
5268			}
5269		case "properties":
5270			if v != nil {
5271				var replicationUpdateParametersProperties ReplicationUpdateParametersProperties
5272				err = json.Unmarshal(*v, &replicationUpdateParametersProperties)
5273				if err != nil {
5274					return err
5275				}
5276				rup.ReplicationUpdateParametersProperties = &replicationUpdateParametersProperties
5277			}
5278		}
5279	}
5280
5281	return nil
5282}
5283
5284// ReplicationUpdateParametersProperties ...
5285type ReplicationUpdateParametersProperties struct {
5286	// RegionEndpointEnabled - Specifies whether the replication's regional endpoint is enabled. Requests will not be routed to a replication whose regional endpoint is disabled, however its data will continue to be synced with other replications.
5287	RegionEndpointEnabled *bool `json:"regionEndpointEnabled,omitempty"`
5288}
5289
5290// Request the request that generated the event.
5291type Request struct {
5292	// ID - The ID of the request that initiated the event.
5293	ID *string `json:"id,omitempty"`
5294	// 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.
5295	Addr *string `json:"addr,omitempty"`
5296	// Host - The externally accessible hostname of the registry instance, as specified by the http host header on incoming requests.
5297	Host *string `json:"host,omitempty"`
5298	// Method - The request method that generated the event.
5299	Method *string `json:"method,omitempty"`
5300	// Useragent - The user agent header of the request.
5301	Useragent *string `json:"useragent,omitempty"`
5302}
5303
5304// Resource an Azure resource.
5305type Resource struct {
5306	// ID - READ-ONLY; The resource ID.
5307	ID *string `json:"id,omitempty"`
5308	// Name - READ-ONLY; The name of the resource.
5309	Name *string `json:"name,omitempty"`
5310	// Type - READ-ONLY; The type of the resource.
5311	Type *string `json:"type,omitempty"`
5312	// Location - The location of the resource. This cannot be changed after the resource is created.
5313	Location *string `json:"location,omitempty"`
5314	// Tags - The tags of the resource.
5315	Tags map[string]*string `json:"tags"`
5316	// SystemData - READ-ONLY; Metadata pertaining to creation and last modification of the resource.
5317	SystemData *SystemData `json:"systemData,omitempty"`
5318}
5319
5320// MarshalJSON is the custom marshaler for Resource.
5321func (r Resource) MarshalJSON() ([]byte, error) {
5322	objectMap := make(map[string]interface{})
5323	if r.Location != nil {
5324		objectMap["location"] = r.Location
5325	}
5326	if r.Tags != nil {
5327		objectMap["tags"] = r.Tags
5328	}
5329	return json.Marshal(objectMap)
5330}
5331
5332// RetentionPolicy the retention policy for a container registry.
5333type RetentionPolicy struct {
5334	// Days - The number of days to retain an untagged manifest after which it gets purged.
5335	Days *int32 `json:"days,omitempty"`
5336	// LastUpdatedTime - READ-ONLY; The timestamp when the policy was last updated.
5337	LastUpdatedTime *date.Time `json:"lastUpdatedTime,omitempty"`
5338	// Status - The value that indicates whether the policy is enabled or not. Possible values include: 'PolicyStatusEnabled', 'PolicyStatusDisabled'
5339	Status PolicyStatus `json:"status,omitempty"`
5340}
5341
5342// MarshalJSON is the custom marshaler for RetentionPolicy.
5343func (rp RetentionPolicy) MarshalJSON() ([]byte, error) {
5344	objectMap := make(map[string]interface{})
5345	if rp.Days != nil {
5346		objectMap["days"] = rp.Days
5347	}
5348	if rp.Status != "" {
5349		objectMap["status"] = rp.Status
5350	}
5351	return json.Marshal(objectMap)
5352}
5353
5354// Run run resource properties
5355type Run struct {
5356	autorest.Response `json:"-"`
5357	// RunProperties - The properties of a run.
5358	*RunProperties `json:"properties,omitempty"`
5359	// ID - READ-ONLY; The resource ID.
5360	ID *string `json:"id,omitempty"`
5361	// Name - READ-ONLY; The name of the resource.
5362	Name *string `json:"name,omitempty"`
5363	// Type - READ-ONLY; The type of the resource.
5364	Type *string `json:"type,omitempty"`
5365	// SystemData - READ-ONLY; Metadata pertaining to creation and last modification of the resource.
5366	SystemData *SystemData `json:"systemData,omitempty"`
5367}
5368
5369// MarshalJSON is the custom marshaler for Run.
5370func (r Run) MarshalJSON() ([]byte, error) {
5371	objectMap := make(map[string]interface{})
5372	if r.RunProperties != nil {
5373		objectMap["properties"] = r.RunProperties
5374	}
5375	return json.Marshal(objectMap)
5376}
5377
5378// UnmarshalJSON is the custom unmarshaler for Run struct.
5379func (r *Run) UnmarshalJSON(body []byte) error {
5380	var m map[string]*json.RawMessage
5381	err := json.Unmarshal(body, &m)
5382	if err != nil {
5383		return err
5384	}
5385	for k, v := range m {
5386		switch k {
5387		case "properties":
5388			if v != nil {
5389				var runProperties RunProperties
5390				err = json.Unmarshal(*v, &runProperties)
5391				if err != nil {
5392					return err
5393				}
5394				r.RunProperties = &runProperties
5395			}
5396		case "id":
5397			if v != nil {
5398				var ID string
5399				err = json.Unmarshal(*v, &ID)
5400				if err != nil {
5401					return err
5402				}
5403				r.ID = &ID
5404			}
5405		case "name":
5406			if v != nil {
5407				var name string
5408				err = json.Unmarshal(*v, &name)
5409				if err != nil {
5410					return err
5411				}
5412				r.Name = &name
5413			}
5414		case "type":
5415			if v != nil {
5416				var typeVar string
5417				err = json.Unmarshal(*v, &typeVar)
5418				if err != nil {
5419					return err
5420				}
5421				r.Type = &typeVar
5422			}
5423		case "systemData":
5424			if v != nil {
5425				var systemData SystemData
5426				err = json.Unmarshal(*v, &systemData)
5427				if err != nil {
5428					return err
5429				}
5430				r.SystemData = &systemData
5431			}
5432		}
5433	}
5434
5435	return nil
5436}
5437
5438// RunFilter properties that are enabled for Odata querying on runs.
5439type RunFilter struct {
5440	// RunID - The unique identifier for the run.
5441	RunID *string `json:"runId,omitempty"`
5442	// RunType - The type of run. Possible values include: 'QuickBuild', 'QuickRun', 'AutoBuild', 'AutoRun'
5443	RunType RunType `json:"runType,omitempty"`
5444	// Status - The current status of the run. Possible values include: 'RunStatusQueued', 'RunStatusStarted', 'RunStatusRunning', 'RunStatusSucceeded', 'RunStatusFailed', 'RunStatusCanceled', 'RunStatusError', 'RunStatusTimeout'
5445	Status RunStatus `json:"status,omitempty"`
5446	// CreateTime - The create time for a run.
5447	CreateTime *date.Time `json:"createTime,omitempty"`
5448	// FinishTime - The time the run finished.
5449	FinishTime *date.Time `json:"finishTime,omitempty"`
5450	// OutputImageManifests - The list of comma-separated image manifests that were generated from the run. This is applicable if the run is of
5451	// build type.
5452	OutputImageManifests *string `json:"outputImageManifests,omitempty"`
5453	// IsArchiveEnabled - The value that indicates whether archiving is enabled or not.
5454	IsArchiveEnabled *bool `json:"isArchiveEnabled,omitempty"`
5455	// TaskName - The name of the task that the run corresponds to.
5456	TaskName *string `json:"taskName,omitempty"`
5457	// AgentPoolName - The name of the agent pool that the run corresponds to.
5458	AgentPoolName *string `json:"agentPoolName,omitempty"`
5459}
5460
5461// RunGetLogResult the result of get log link operation.
5462type RunGetLogResult struct {
5463	autorest.Response `json:"-"`
5464	// LogLink - The link to logs for a run on a azure container registry.
5465	LogLink *string `json:"logLink,omitempty"`
5466	// LogArtifactLink - The link to logs in registry for a run on a azure container registry.
5467	LogArtifactLink *string `json:"logArtifactLink,omitempty"`
5468}
5469
5470// RunListResult collection of runs.
5471type RunListResult struct {
5472	autorest.Response `json:"-"`
5473	// Value - The collection value.
5474	Value *[]Run `json:"value,omitempty"`
5475	// NextLink - The URI that can be used to request the next set of paged results.
5476	NextLink *string `json:"nextLink,omitempty"`
5477}
5478
5479// RunListResultIterator provides access to a complete listing of Run values.
5480type RunListResultIterator struct {
5481	i    int
5482	page RunListResultPage
5483}
5484
5485// NextWithContext advances to the next value.  If there was an error making
5486// the request the iterator does not advance and the error is returned.
5487func (iter *RunListResultIterator) NextWithContext(ctx context.Context) (err error) {
5488	if tracing.IsEnabled() {
5489		ctx = tracing.StartSpan(ctx, fqdn+"/RunListResultIterator.NextWithContext")
5490		defer func() {
5491			sc := -1
5492			if iter.Response().Response.Response != nil {
5493				sc = iter.Response().Response.Response.StatusCode
5494			}
5495			tracing.EndSpan(ctx, sc, err)
5496		}()
5497	}
5498	iter.i++
5499	if iter.i < len(iter.page.Values()) {
5500		return nil
5501	}
5502	err = iter.page.NextWithContext(ctx)
5503	if err != nil {
5504		iter.i--
5505		return err
5506	}
5507	iter.i = 0
5508	return nil
5509}
5510
5511// Next advances to the next value.  If there was an error making
5512// the request the iterator does not advance and the error is returned.
5513// Deprecated: Use NextWithContext() instead.
5514func (iter *RunListResultIterator) Next() error {
5515	return iter.NextWithContext(context.Background())
5516}
5517
5518// NotDone returns true if the enumeration should be started or is not yet complete.
5519func (iter RunListResultIterator) NotDone() bool {
5520	return iter.page.NotDone() && iter.i < len(iter.page.Values())
5521}
5522
5523// Response returns the raw server response from the last page request.
5524func (iter RunListResultIterator) Response() RunListResult {
5525	return iter.page.Response()
5526}
5527
5528// Value returns the current value or a zero-initialized value if the
5529// iterator has advanced beyond the end of the collection.
5530func (iter RunListResultIterator) Value() Run {
5531	if !iter.page.NotDone() {
5532		return Run{}
5533	}
5534	return iter.page.Values()[iter.i]
5535}
5536
5537// Creates a new instance of the RunListResultIterator type.
5538func NewRunListResultIterator(page RunListResultPage) RunListResultIterator {
5539	return RunListResultIterator{page: page}
5540}
5541
5542// IsEmpty returns true if the ListResult contains no values.
5543func (rlr RunListResult) IsEmpty() bool {
5544	return rlr.Value == nil || len(*rlr.Value) == 0
5545}
5546
5547// hasNextLink returns true if the NextLink is not empty.
5548func (rlr RunListResult) hasNextLink() bool {
5549	return rlr.NextLink != nil && len(*rlr.NextLink) != 0
5550}
5551
5552// runListResultPreparer prepares a request to retrieve the next set of results.
5553// It returns nil if no more results exist.
5554func (rlr RunListResult) runListResultPreparer(ctx context.Context) (*http.Request, error) {
5555	if !rlr.hasNextLink() {
5556		return nil, nil
5557	}
5558	return autorest.Prepare((&http.Request{}).WithContext(ctx),
5559		autorest.AsJSON(),
5560		autorest.AsGet(),
5561		autorest.WithBaseURL(to.String(rlr.NextLink)))
5562}
5563
5564// RunListResultPage contains a page of Run values.
5565type RunListResultPage struct {
5566	fn  func(context.Context, RunListResult) (RunListResult, error)
5567	rlr RunListResult
5568}
5569
5570// NextWithContext advances to the next page of values.  If there was an error making
5571// the request the page does not advance and the error is returned.
5572func (page *RunListResultPage) NextWithContext(ctx context.Context) (err error) {
5573	if tracing.IsEnabled() {
5574		ctx = tracing.StartSpan(ctx, fqdn+"/RunListResultPage.NextWithContext")
5575		defer func() {
5576			sc := -1
5577			if page.Response().Response.Response != nil {
5578				sc = page.Response().Response.Response.StatusCode
5579			}
5580			tracing.EndSpan(ctx, sc, err)
5581		}()
5582	}
5583	for {
5584		next, err := page.fn(ctx, page.rlr)
5585		if err != nil {
5586			return err
5587		}
5588		page.rlr = next
5589		if !next.hasNextLink() || !next.IsEmpty() {
5590			break
5591		}
5592	}
5593	return nil
5594}
5595
5596// Next advances to the next page of values.  If there was an error making
5597// the request the page does not advance and the error is returned.
5598// Deprecated: Use NextWithContext() instead.
5599func (page *RunListResultPage) Next() error {
5600	return page.NextWithContext(context.Background())
5601}
5602
5603// NotDone returns true if the page enumeration should be started or is not yet complete.
5604func (page RunListResultPage) NotDone() bool {
5605	return !page.rlr.IsEmpty()
5606}
5607
5608// Response returns the raw server response from the last page request.
5609func (page RunListResultPage) Response() RunListResult {
5610	return page.rlr
5611}
5612
5613// Values returns the slice of values for the current page or nil if there are no values.
5614func (page RunListResultPage) Values() []Run {
5615	if page.rlr.IsEmpty() {
5616		return nil
5617	}
5618	return *page.rlr.Value
5619}
5620
5621// Creates a new instance of the RunListResultPage type.
5622func NewRunListResultPage(cur RunListResult, getNextPage func(context.Context, RunListResult) (RunListResult, error)) RunListResultPage {
5623	return RunListResultPage{
5624		fn:  getNextPage,
5625		rlr: cur,
5626	}
5627}
5628
5629// RunProperties the properties for a run.
5630type RunProperties struct {
5631	// RunID - The unique identifier for the run.
5632	RunID *string `json:"runId,omitempty"`
5633	// Status - The current status of the run. Possible values include: 'RunStatusQueued', 'RunStatusStarted', 'RunStatusRunning', 'RunStatusSucceeded', 'RunStatusFailed', 'RunStatusCanceled', 'RunStatusError', 'RunStatusTimeout'
5634	Status RunStatus `json:"status,omitempty"`
5635	// LastUpdatedTime - The last updated time for the run.
5636	LastUpdatedTime *date.Time `json:"lastUpdatedTime,omitempty"`
5637	// RunType - The type of run. Possible values include: 'QuickBuild', 'QuickRun', 'AutoBuild', 'AutoRun'
5638	RunType RunType `json:"runType,omitempty"`
5639	// AgentPoolName - The dedicated agent pool for the run.
5640	AgentPoolName *string `json:"agentPoolName,omitempty"`
5641	// CreateTime - The time the run was scheduled.
5642	CreateTime *date.Time `json:"createTime,omitempty"`
5643	// StartTime - The time the run started.
5644	StartTime *date.Time `json:"startTime,omitempty"`
5645	// FinishTime - The time the run finished.
5646	FinishTime *date.Time `json:"finishTime,omitempty"`
5647	// OutputImages - The list of all images that were generated from the run. This is applicable if the run generates base image dependencies.
5648	OutputImages *[]ImageDescriptor `json:"outputImages,omitempty"`
5649	// Task - The task against which run was scheduled.
5650	Task *string `json:"task,omitempty"`
5651	// ImageUpdateTrigger - The image update trigger that caused the run. This is applicable if the task has base image trigger configured.
5652	ImageUpdateTrigger *ImageUpdateTrigger `json:"imageUpdateTrigger,omitempty"`
5653	// SourceTrigger - The source trigger that caused the run.
5654	SourceTrigger *SourceTriggerDescriptor `json:"sourceTrigger,omitempty"`
5655	// TimerTrigger - The timer trigger that caused the run.
5656	TimerTrigger *TimerTriggerDescriptor `json:"timerTrigger,omitempty"`
5657	// Platform - The platform properties against which the run will happen.
5658	Platform *PlatformProperties `json:"platform,omitempty"`
5659	// AgentConfiguration - The machine configuration of the run agent.
5660	AgentConfiguration *AgentProperties `json:"agentConfiguration,omitempty"`
5661	// SourceRegistryAuth - The scope of the credentials that were used to login to the source registry during this run.
5662	SourceRegistryAuth *string `json:"sourceRegistryAuth,omitempty"`
5663	// CustomRegistries - The list of custom registries that were logged in during this run.
5664	CustomRegistries *[]string `json:"customRegistries,omitempty"`
5665	// RunErrorMessage - READ-ONLY; The error message received from backend systems after the run is scheduled.
5666	RunErrorMessage *string `json:"runErrorMessage,omitempty"`
5667	// UpdateTriggerToken - The update trigger token passed for the Run.
5668	UpdateTriggerToken *string `json:"updateTriggerToken,omitempty"`
5669	// LogArtifact - READ-ONLY; The image description for the log artifact.
5670	LogArtifact *ImageDescriptor `json:"logArtifact,omitempty"`
5671	// ProvisioningState - The provisioning state of a run. Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', 'Canceled'
5672	ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
5673	// IsArchiveEnabled - The value that indicates whether archiving is enabled or not.
5674	IsArchiveEnabled *bool `json:"isArchiveEnabled,omitempty"`
5675}
5676
5677// MarshalJSON is the custom marshaler for RunProperties.
5678func (rp RunProperties) MarshalJSON() ([]byte, error) {
5679	objectMap := make(map[string]interface{})
5680	if rp.RunID != nil {
5681		objectMap["runId"] = rp.RunID
5682	}
5683	if rp.Status != "" {
5684		objectMap["status"] = rp.Status
5685	}
5686	if rp.LastUpdatedTime != nil {
5687		objectMap["lastUpdatedTime"] = rp.LastUpdatedTime
5688	}
5689	if rp.RunType != "" {
5690		objectMap["runType"] = rp.RunType
5691	}
5692	if rp.AgentPoolName != nil {
5693		objectMap["agentPoolName"] = rp.AgentPoolName
5694	}
5695	if rp.CreateTime != nil {
5696		objectMap["createTime"] = rp.CreateTime
5697	}
5698	if rp.StartTime != nil {
5699		objectMap["startTime"] = rp.StartTime
5700	}
5701	if rp.FinishTime != nil {
5702		objectMap["finishTime"] = rp.FinishTime
5703	}
5704	if rp.OutputImages != nil {
5705		objectMap["outputImages"] = rp.OutputImages
5706	}
5707	if rp.Task != nil {
5708		objectMap["task"] = rp.Task
5709	}
5710	if rp.ImageUpdateTrigger != nil {
5711		objectMap["imageUpdateTrigger"] = rp.ImageUpdateTrigger
5712	}
5713	if rp.SourceTrigger != nil {
5714		objectMap["sourceTrigger"] = rp.SourceTrigger
5715	}
5716	if rp.TimerTrigger != nil {
5717		objectMap["timerTrigger"] = rp.TimerTrigger
5718	}
5719	if rp.Platform != nil {
5720		objectMap["platform"] = rp.Platform
5721	}
5722	if rp.AgentConfiguration != nil {
5723		objectMap["agentConfiguration"] = rp.AgentConfiguration
5724	}
5725	if rp.SourceRegistryAuth != nil {
5726		objectMap["sourceRegistryAuth"] = rp.SourceRegistryAuth
5727	}
5728	if rp.CustomRegistries != nil {
5729		objectMap["customRegistries"] = rp.CustomRegistries
5730	}
5731	if rp.UpdateTriggerToken != nil {
5732		objectMap["updateTriggerToken"] = rp.UpdateTriggerToken
5733	}
5734	if rp.ProvisioningState != "" {
5735		objectMap["provisioningState"] = rp.ProvisioningState
5736	}
5737	if rp.IsArchiveEnabled != nil {
5738		objectMap["isArchiveEnabled"] = rp.IsArchiveEnabled
5739	}
5740	return json.Marshal(objectMap)
5741}
5742
5743// BasicRunRequest the request parameters for scheduling a run.
5744type BasicRunRequest interface {
5745	AsDockerBuildRequest() (*DockerBuildRequest, bool)
5746	AsFileTaskRunRequest() (*FileTaskRunRequest, bool)
5747	AsTaskRunRequest() (*TaskRunRequest, bool)
5748	AsEncodedTaskRunRequest() (*EncodedTaskRunRequest, bool)
5749	AsRunRequest() (*RunRequest, bool)
5750}
5751
5752// RunRequest the request parameters for scheduling a run.
5753type RunRequest struct {
5754	// IsArchiveEnabled - The value that indicates whether archiving is enabled for the run or not.
5755	IsArchiveEnabled *bool `json:"isArchiveEnabled,omitempty"`
5756	// AgentPoolName - The dedicated agent pool for the run.
5757	AgentPoolName *string `json:"agentPoolName,omitempty"`
5758	// LogTemplate - The template that describes the repository and tag information for run log artifact.
5759	LogTemplate *string `json:"logTemplate,omitempty"`
5760	// Type - Possible values include: 'TypeRunRequest', 'TypeDockerBuildRequest', 'TypeFileTaskRunRequest', 'TypeTaskRunRequest', 'TypeEncodedTaskRunRequest'
5761	Type Type `json:"type,omitempty"`
5762}
5763
5764func unmarshalBasicRunRequest(body []byte) (BasicRunRequest, error) {
5765	var m map[string]interface{}
5766	err := json.Unmarshal(body, &m)
5767	if err != nil {
5768		return nil, err
5769	}
5770
5771	switch m["type"] {
5772	case string(TypeDockerBuildRequest):
5773		var dbr DockerBuildRequest
5774		err := json.Unmarshal(body, &dbr)
5775		return dbr, err
5776	case string(TypeFileTaskRunRequest):
5777		var ftrr FileTaskRunRequest
5778		err := json.Unmarshal(body, &ftrr)
5779		return ftrr, err
5780	case string(TypeTaskRunRequest):
5781		var trr TaskRunRequest
5782		err := json.Unmarshal(body, &trr)
5783		return trr, err
5784	case string(TypeEncodedTaskRunRequest):
5785		var etrr EncodedTaskRunRequest
5786		err := json.Unmarshal(body, &etrr)
5787		return etrr, err
5788	default:
5789		var rr RunRequest
5790		err := json.Unmarshal(body, &rr)
5791		return rr, err
5792	}
5793}
5794func unmarshalBasicRunRequestArray(body []byte) ([]BasicRunRequest, error) {
5795	var rawMessages []*json.RawMessage
5796	err := json.Unmarshal(body, &rawMessages)
5797	if err != nil {
5798		return nil, err
5799	}
5800
5801	rrArray := make([]BasicRunRequest, len(rawMessages))
5802
5803	for index, rawMessage := range rawMessages {
5804		rr, err := unmarshalBasicRunRequest(*rawMessage)
5805		if err != nil {
5806			return nil, err
5807		}
5808		rrArray[index] = rr
5809	}
5810	return rrArray, nil
5811}
5812
5813// MarshalJSON is the custom marshaler for RunRequest.
5814func (rr RunRequest) MarshalJSON() ([]byte, error) {
5815	rr.Type = TypeRunRequest
5816	objectMap := make(map[string]interface{})
5817	if rr.IsArchiveEnabled != nil {
5818		objectMap["isArchiveEnabled"] = rr.IsArchiveEnabled
5819	}
5820	if rr.AgentPoolName != nil {
5821		objectMap["agentPoolName"] = rr.AgentPoolName
5822	}
5823	if rr.LogTemplate != nil {
5824		objectMap["logTemplate"] = rr.LogTemplate
5825	}
5826	if rr.Type != "" {
5827		objectMap["type"] = rr.Type
5828	}
5829	return json.Marshal(objectMap)
5830}
5831
5832// AsDockerBuildRequest is the BasicRunRequest implementation for RunRequest.
5833func (rr RunRequest) AsDockerBuildRequest() (*DockerBuildRequest, bool) {
5834	return nil, false
5835}
5836
5837// AsFileTaskRunRequest is the BasicRunRequest implementation for RunRequest.
5838func (rr RunRequest) AsFileTaskRunRequest() (*FileTaskRunRequest, bool) {
5839	return nil, false
5840}
5841
5842// AsTaskRunRequest is the BasicRunRequest implementation for RunRequest.
5843func (rr RunRequest) AsTaskRunRequest() (*TaskRunRequest, bool) {
5844	return nil, false
5845}
5846
5847// AsEncodedTaskRunRequest is the BasicRunRequest implementation for RunRequest.
5848func (rr RunRequest) AsEncodedTaskRunRequest() (*EncodedTaskRunRequest, bool) {
5849	return nil, false
5850}
5851
5852// AsRunRequest is the BasicRunRequest implementation for RunRequest.
5853func (rr RunRequest) AsRunRequest() (*RunRequest, bool) {
5854	return &rr, true
5855}
5856
5857// AsBasicRunRequest is the BasicRunRequest implementation for RunRequest.
5858func (rr RunRequest) AsBasicRunRequest() (BasicRunRequest, bool) {
5859	return &rr, true
5860}
5861
5862// RunsCancelFuture an abstraction for monitoring and retrieving the results of a long-running operation.
5863type RunsCancelFuture struct {
5864	azure.FutureAPI
5865	// Result returns the result of the asynchronous operation.
5866	// If the operation has not completed it will return an error.
5867	Result func(RunsClient) (autorest.Response, error)
5868}
5869
5870// UnmarshalJSON is the custom unmarshaller for CreateFuture.
5871func (future *RunsCancelFuture) UnmarshalJSON(body []byte) error {
5872	var azFuture azure.Future
5873	if err := json.Unmarshal(body, &azFuture); err != nil {
5874		return err
5875	}
5876	future.FutureAPI = &azFuture
5877	future.Result = future.result
5878	return nil
5879}
5880
5881// result is the default implementation for RunsCancelFuture.Result.
5882func (future *RunsCancelFuture) result(client RunsClient) (ar autorest.Response, err error) {
5883	var done bool
5884	done, err = future.DoneWithContext(context.Background(), client)
5885	if err != nil {
5886		err = autorest.NewErrorWithError(err, "containerregistry.RunsCancelFuture", "Result", future.Response(), "Polling failure")
5887		return
5888	}
5889	if !done {
5890		ar.Response = future.Response()
5891		err = azure.NewAsyncOpIncompleteError("containerregistry.RunsCancelFuture")
5892		return
5893	}
5894	ar.Response = future.Response()
5895	return
5896}
5897
5898// RunsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation.
5899type RunsUpdateFuture struct {
5900	azure.FutureAPI
5901	// Result returns the result of the asynchronous operation.
5902	// If the operation has not completed it will return an error.
5903	Result func(RunsClient) (Run, error)
5904}
5905
5906// UnmarshalJSON is the custom unmarshaller for CreateFuture.
5907func (future *RunsUpdateFuture) UnmarshalJSON(body []byte) error {
5908	var azFuture azure.Future
5909	if err := json.Unmarshal(body, &azFuture); err != nil {
5910		return err
5911	}
5912	future.FutureAPI = &azFuture
5913	future.Result = future.result
5914	return nil
5915}
5916
5917// result is the default implementation for RunsUpdateFuture.Result.
5918func (future *RunsUpdateFuture) result(client RunsClient) (r Run, err error) {
5919	var done bool
5920	done, err = future.DoneWithContext(context.Background(), client)
5921	if err != nil {
5922		err = autorest.NewErrorWithError(err, "containerregistry.RunsUpdateFuture", "Result", future.Response(), "Polling failure")
5923		return
5924	}
5925	if !done {
5926		r.Response.Response = future.Response()
5927		err = azure.NewAsyncOpIncompleteError("containerregistry.RunsUpdateFuture")
5928		return
5929	}
5930	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
5931	if r.Response.Response, err = future.GetResult(sender); err == nil && r.Response.Response.StatusCode != http.StatusNoContent {
5932		r, err = client.UpdateResponder(r.Response.Response)
5933		if err != nil {
5934			err = autorest.NewErrorWithError(err, "containerregistry.RunsUpdateFuture", "Result", r.Response.Response, "Failure responding to request")
5935		}
5936	}
5937	return
5938}
5939
5940// RunUpdateParameters the set of run properties that can be updated.
5941type RunUpdateParameters struct {
5942	// IsArchiveEnabled - The value that indicates whether archiving is enabled or not.
5943	IsArchiveEnabled *bool `json:"isArchiveEnabled,omitempty"`
5944}
5945
5946// ScopeMap an object that represents a scope map for a container registry.
5947type ScopeMap struct {
5948	autorest.Response `json:"-"`
5949	// ScopeMapProperties - The properties of the scope map.
5950	*ScopeMapProperties `json:"properties,omitempty"`
5951	// ID - READ-ONLY; The resource ID.
5952	ID *string `json:"id,omitempty"`
5953	// Name - READ-ONLY; The name of the resource.
5954	Name *string `json:"name,omitempty"`
5955	// Type - READ-ONLY; The type of the resource.
5956	Type *string `json:"type,omitempty"`
5957	// SystemData - READ-ONLY; Metadata pertaining to creation and last modification of the resource.
5958	SystemData *SystemData `json:"systemData,omitempty"`
5959}
5960
5961// MarshalJSON is the custom marshaler for ScopeMap.
5962func (sm ScopeMap) MarshalJSON() ([]byte, error) {
5963	objectMap := make(map[string]interface{})
5964	if sm.ScopeMapProperties != nil {
5965		objectMap["properties"] = sm.ScopeMapProperties
5966	}
5967	return json.Marshal(objectMap)
5968}
5969
5970// UnmarshalJSON is the custom unmarshaler for ScopeMap struct.
5971func (sm *ScopeMap) UnmarshalJSON(body []byte) error {
5972	var m map[string]*json.RawMessage
5973	err := json.Unmarshal(body, &m)
5974	if err != nil {
5975		return err
5976	}
5977	for k, v := range m {
5978		switch k {
5979		case "properties":
5980			if v != nil {
5981				var scopeMapProperties ScopeMapProperties
5982				err = json.Unmarshal(*v, &scopeMapProperties)
5983				if err != nil {
5984					return err
5985				}
5986				sm.ScopeMapProperties = &scopeMapProperties
5987			}
5988		case "id":
5989			if v != nil {
5990				var ID string
5991				err = json.Unmarshal(*v, &ID)
5992				if err != nil {
5993					return err
5994				}
5995				sm.ID = &ID
5996			}
5997		case "name":
5998			if v != nil {
5999				var name string
6000				err = json.Unmarshal(*v, &name)
6001				if err != nil {
6002					return err
6003				}
6004				sm.Name = &name
6005			}
6006		case "type":
6007			if v != nil {
6008				var typeVar string
6009				err = json.Unmarshal(*v, &typeVar)
6010				if err != nil {
6011					return err
6012				}
6013				sm.Type = &typeVar
6014			}
6015		case "systemData":
6016			if v != nil {
6017				var systemData SystemData
6018				err = json.Unmarshal(*v, &systemData)
6019				if err != nil {
6020					return err
6021				}
6022				sm.SystemData = &systemData
6023			}
6024		}
6025	}
6026
6027	return nil
6028}
6029
6030// ScopeMapListResult the result of a request to list scope maps for a container registry.
6031type ScopeMapListResult struct {
6032	autorest.Response `json:"-"`
6033	// Value - The list of scope maps. Since this list may be incomplete, the nextLink field should be used to request the next list of scope maps.
6034	Value *[]ScopeMap `json:"value,omitempty"`
6035	// NextLink - The URI that can be used to request the next list of scope maps.
6036	NextLink *string `json:"nextLink,omitempty"`
6037}
6038
6039// ScopeMapListResultIterator provides access to a complete listing of ScopeMap values.
6040type ScopeMapListResultIterator struct {
6041	i    int
6042	page ScopeMapListResultPage
6043}
6044
6045// NextWithContext advances to the next value.  If there was an error making
6046// the request the iterator does not advance and the error is returned.
6047func (iter *ScopeMapListResultIterator) NextWithContext(ctx context.Context) (err error) {
6048	if tracing.IsEnabled() {
6049		ctx = tracing.StartSpan(ctx, fqdn+"/ScopeMapListResultIterator.NextWithContext")
6050		defer func() {
6051			sc := -1
6052			if iter.Response().Response.Response != nil {
6053				sc = iter.Response().Response.Response.StatusCode
6054			}
6055			tracing.EndSpan(ctx, sc, err)
6056		}()
6057	}
6058	iter.i++
6059	if iter.i < len(iter.page.Values()) {
6060		return nil
6061	}
6062	err = iter.page.NextWithContext(ctx)
6063	if err != nil {
6064		iter.i--
6065		return err
6066	}
6067	iter.i = 0
6068	return nil
6069}
6070
6071// Next advances to the next value.  If there was an error making
6072// the request the iterator does not advance and the error is returned.
6073// Deprecated: Use NextWithContext() instead.
6074func (iter *ScopeMapListResultIterator) Next() error {
6075	return iter.NextWithContext(context.Background())
6076}
6077
6078// NotDone returns true if the enumeration should be started or is not yet complete.
6079func (iter ScopeMapListResultIterator) NotDone() bool {
6080	return iter.page.NotDone() && iter.i < len(iter.page.Values())
6081}
6082
6083// Response returns the raw server response from the last page request.
6084func (iter ScopeMapListResultIterator) Response() ScopeMapListResult {
6085	return iter.page.Response()
6086}
6087
6088// Value returns the current value or a zero-initialized value if the
6089// iterator has advanced beyond the end of the collection.
6090func (iter ScopeMapListResultIterator) Value() ScopeMap {
6091	if !iter.page.NotDone() {
6092		return ScopeMap{}
6093	}
6094	return iter.page.Values()[iter.i]
6095}
6096
6097// Creates a new instance of the ScopeMapListResultIterator type.
6098func NewScopeMapListResultIterator(page ScopeMapListResultPage) ScopeMapListResultIterator {
6099	return ScopeMapListResultIterator{page: page}
6100}
6101
6102// IsEmpty returns true if the ListResult contains no values.
6103func (smlr ScopeMapListResult) IsEmpty() bool {
6104	return smlr.Value == nil || len(*smlr.Value) == 0
6105}
6106
6107// hasNextLink returns true if the NextLink is not empty.
6108func (smlr ScopeMapListResult) hasNextLink() bool {
6109	return smlr.NextLink != nil && len(*smlr.NextLink) != 0
6110}
6111
6112// scopeMapListResultPreparer prepares a request to retrieve the next set of results.
6113// It returns nil if no more results exist.
6114func (smlr ScopeMapListResult) scopeMapListResultPreparer(ctx context.Context) (*http.Request, error) {
6115	if !smlr.hasNextLink() {
6116		return nil, nil
6117	}
6118	return autorest.Prepare((&http.Request{}).WithContext(ctx),
6119		autorest.AsJSON(),
6120		autorest.AsGet(),
6121		autorest.WithBaseURL(to.String(smlr.NextLink)))
6122}
6123
6124// ScopeMapListResultPage contains a page of ScopeMap values.
6125type ScopeMapListResultPage struct {
6126	fn   func(context.Context, ScopeMapListResult) (ScopeMapListResult, error)
6127	smlr ScopeMapListResult
6128}
6129
6130// NextWithContext advances to the next page of values.  If there was an error making
6131// the request the page does not advance and the error is returned.
6132func (page *ScopeMapListResultPage) NextWithContext(ctx context.Context) (err error) {
6133	if tracing.IsEnabled() {
6134		ctx = tracing.StartSpan(ctx, fqdn+"/ScopeMapListResultPage.NextWithContext")
6135		defer func() {
6136			sc := -1
6137			if page.Response().Response.Response != nil {
6138				sc = page.Response().Response.Response.StatusCode
6139			}
6140			tracing.EndSpan(ctx, sc, err)
6141		}()
6142	}
6143	for {
6144		next, err := page.fn(ctx, page.smlr)
6145		if err != nil {
6146			return err
6147		}
6148		page.smlr = next
6149		if !next.hasNextLink() || !next.IsEmpty() {
6150			break
6151		}
6152	}
6153	return nil
6154}
6155
6156// Next advances to the next page of values.  If there was an error making
6157// the request the page does not advance and the error is returned.
6158// Deprecated: Use NextWithContext() instead.
6159func (page *ScopeMapListResultPage) Next() error {
6160	return page.NextWithContext(context.Background())
6161}
6162
6163// NotDone returns true if the page enumeration should be started or is not yet complete.
6164func (page ScopeMapListResultPage) NotDone() bool {
6165	return !page.smlr.IsEmpty()
6166}
6167
6168// Response returns the raw server response from the last page request.
6169func (page ScopeMapListResultPage) Response() ScopeMapListResult {
6170	return page.smlr
6171}
6172
6173// Values returns the slice of values for the current page or nil if there are no values.
6174func (page ScopeMapListResultPage) Values() []ScopeMap {
6175	if page.smlr.IsEmpty() {
6176		return nil
6177	}
6178	return *page.smlr.Value
6179}
6180
6181// Creates a new instance of the ScopeMapListResultPage type.
6182func NewScopeMapListResultPage(cur ScopeMapListResult, getNextPage func(context.Context, ScopeMapListResult) (ScopeMapListResult, error)) ScopeMapListResultPage {
6183	return ScopeMapListResultPage{
6184		fn:   getNextPage,
6185		smlr: cur,
6186	}
6187}
6188
6189// ScopeMapProperties the properties of a scope map.
6190type ScopeMapProperties struct {
6191	// Description - The user friendly description of the scope map.
6192	Description *string `json:"description,omitempty"`
6193	// Type - READ-ONLY; The type of the scope map. E.g. BuildIn scope map.
6194	Type *string `json:"type,omitempty"`
6195	// CreationDate - READ-ONLY; The creation date of scope map.
6196	CreationDate *date.Time `json:"creationDate,omitempty"`
6197	// ProvisioningState - READ-ONLY; Provisioning state of the resource. Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', 'Canceled'
6198	ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
6199	// Actions - The list of scoped permissions for registry artifacts.
6200	// E.g. repositories/repository-name/content/read,
6201	// repositories/repository-name/metadata/write
6202	Actions *[]string `json:"actions,omitempty"`
6203}
6204
6205// MarshalJSON is the custom marshaler for ScopeMapProperties.
6206func (smp ScopeMapProperties) MarshalJSON() ([]byte, error) {
6207	objectMap := make(map[string]interface{})
6208	if smp.Description != nil {
6209		objectMap["description"] = smp.Description
6210	}
6211	if smp.Actions != nil {
6212		objectMap["actions"] = smp.Actions
6213	}
6214	return json.Marshal(objectMap)
6215}
6216
6217// ScopeMapPropertiesUpdateParameters the update parameters for scope map properties.
6218type ScopeMapPropertiesUpdateParameters struct {
6219	// Description - The user friendly description of the scope map.
6220	Description *string `json:"description,omitempty"`
6221	// Actions - The list of scope permissions for registry artifacts.
6222	// E.g. repositories/repository-name/pull,
6223	// repositories/repository-name/delete
6224	Actions *[]string `json:"actions,omitempty"`
6225}
6226
6227// ScopeMapsCreateFuture an abstraction for monitoring and retrieving the results of a long-running
6228// operation.
6229type ScopeMapsCreateFuture struct {
6230	azure.FutureAPI
6231	// Result returns the result of the asynchronous operation.
6232	// If the operation has not completed it will return an error.
6233	Result func(ScopeMapsClient) (ScopeMap, error)
6234}
6235
6236// UnmarshalJSON is the custom unmarshaller for CreateFuture.
6237func (future *ScopeMapsCreateFuture) UnmarshalJSON(body []byte) error {
6238	var azFuture azure.Future
6239	if err := json.Unmarshal(body, &azFuture); err != nil {
6240		return err
6241	}
6242	future.FutureAPI = &azFuture
6243	future.Result = future.result
6244	return nil
6245}
6246
6247// result is the default implementation for ScopeMapsCreateFuture.Result.
6248func (future *ScopeMapsCreateFuture) result(client ScopeMapsClient) (sm ScopeMap, err error) {
6249	var done bool
6250	done, err = future.DoneWithContext(context.Background(), client)
6251	if err != nil {
6252		err = autorest.NewErrorWithError(err, "containerregistry.ScopeMapsCreateFuture", "Result", future.Response(), "Polling failure")
6253		return
6254	}
6255	if !done {
6256		sm.Response.Response = future.Response()
6257		err = azure.NewAsyncOpIncompleteError("containerregistry.ScopeMapsCreateFuture")
6258		return
6259	}
6260	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
6261	if sm.Response.Response, err = future.GetResult(sender); err == nil && sm.Response.Response.StatusCode != http.StatusNoContent {
6262		sm, err = client.CreateResponder(sm.Response.Response)
6263		if err != nil {
6264			err = autorest.NewErrorWithError(err, "containerregistry.ScopeMapsCreateFuture", "Result", sm.Response.Response, "Failure responding to request")
6265		}
6266	}
6267	return
6268}
6269
6270// ScopeMapsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
6271// operation.
6272type ScopeMapsDeleteFuture struct {
6273	azure.FutureAPI
6274	// Result returns the result of the asynchronous operation.
6275	// If the operation has not completed it will return an error.
6276	Result func(ScopeMapsClient) (autorest.Response, error)
6277}
6278
6279// UnmarshalJSON is the custom unmarshaller for CreateFuture.
6280func (future *ScopeMapsDeleteFuture) UnmarshalJSON(body []byte) error {
6281	var azFuture azure.Future
6282	if err := json.Unmarshal(body, &azFuture); err != nil {
6283		return err
6284	}
6285	future.FutureAPI = &azFuture
6286	future.Result = future.result
6287	return nil
6288}
6289
6290// result is the default implementation for ScopeMapsDeleteFuture.Result.
6291func (future *ScopeMapsDeleteFuture) result(client ScopeMapsClient) (ar autorest.Response, err error) {
6292	var done bool
6293	done, err = future.DoneWithContext(context.Background(), client)
6294	if err != nil {
6295		err = autorest.NewErrorWithError(err, "containerregistry.ScopeMapsDeleteFuture", "Result", future.Response(), "Polling failure")
6296		return
6297	}
6298	if !done {
6299		ar.Response = future.Response()
6300		err = azure.NewAsyncOpIncompleteError("containerregistry.ScopeMapsDeleteFuture")
6301		return
6302	}
6303	ar.Response = future.Response()
6304	return
6305}
6306
6307// ScopeMapsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
6308// operation.
6309type ScopeMapsUpdateFuture struct {
6310	azure.FutureAPI
6311	// Result returns the result of the asynchronous operation.
6312	// If the operation has not completed it will return an error.
6313	Result func(ScopeMapsClient) (ScopeMap, error)
6314}
6315
6316// UnmarshalJSON is the custom unmarshaller for CreateFuture.
6317func (future *ScopeMapsUpdateFuture) UnmarshalJSON(body []byte) error {
6318	var azFuture azure.Future
6319	if err := json.Unmarshal(body, &azFuture); err != nil {
6320		return err
6321	}
6322	future.FutureAPI = &azFuture
6323	future.Result = future.result
6324	return nil
6325}
6326
6327// result is the default implementation for ScopeMapsUpdateFuture.Result.
6328func (future *ScopeMapsUpdateFuture) result(client ScopeMapsClient) (sm ScopeMap, err error) {
6329	var done bool
6330	done, err = future.DoneWithContext(context.Background(), client)
6331	if err != nil {
6332		err = autorest.NewErrorWithError(err, "containerregistry.ScopeMapsUpdateFuture", "Result", future.Response(), "Polling failure")
6333		return
6334	}
6335	if !done {
6336		sm.Response.Response = future.Response()
6337		err = azure.NewAsyncOpIncompleteError("containerregistry.ScopeMapsUpdateFuture")
6338		return
6339	}
6340	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
6341	if sm.Response.Response, err = future.GetResult(sender); err == nil && sm.Response.Response.StatusCode != http.StatusNoContent {
6342		sm, err = client.UpdateResponder(sm.Response.Response)
6343		if err != nil {
6344			err = autorest.NewErrorWithError(err, "containerregistry.ScopeMapsUpdateFuture", "Result", sm.Response.Response, "Failure responding to request")
6345		}
6346	}
6347	return
6348}
6349
6350// ScopeMapUpdateParameters the properties for updating the scope map.
6351type ScopeMapUpdateParameters struct {
6352	// ScopeMapPropertiesUpdateParameters - The update parameters for scope map properties.
6353	*ScopeMapPropertiesUpdateParameters `json:"properties,omitempty"`
6354}
6355
6356// MarshalJSON is the custom marshaler for ScopeMapUpdateParameters.
6357func (smup ScopeMapUpdateParameters) MarshalJSON() ([]byte, error) {
6358	objectMap := make(map[string]interface{})
6359	if smup.ScopeMapPropertiesUpdateParameters != nil {
6360		objectMap["properties"] = smup.ScopeMapPropertiesUpdateParameters
6361	}
6362	return json.Marshal(objectMap)
6363}
6364
6365// UnmarshalJSON is the custom unmarshaler for ScopeMapUpdateParameters struct.
6366func (smup *ScopeMapUpdateParameters) UnmarshalJSON(body []byte) error {
6367	var m map[string]*json.RawMessage
6368	err := json.Unmarshal(body, &m)
6369	if err != nil {
6370		return err
6371	}
6372	for k, v := range m {
6373		switch k {
6374		case "properties":
6375			if v != nil {
6376				var scopeMapPropertiesUpdateParameters ScopeMapPropertiesUpdateParameters
6377				err = json.Unmarshal(*v, &scopeMapPropertiesUpdateParameters)
6378				if err != nil {
6379					return err
6380				}
6381				smup.ScopeMapPropertiesUpdateParameters = &scopeMapPropertiesUpdateParameters
6382			}
6383		}
6384	}
6385
6386	return nil
6387}
6388
6389// SecretObject describes the properties of a secret object value.
6390type SecretObject struct {
6391	// Value - The value of the secret. The format of this value will be determined
6392	// based on the type of the secret object. If the type is Opaque, the value will be
6393	// used as is without any modification.
6394	Value *string `json:"value,omitempty"`
6395	// Type - The type of the secret object which determines how the value of the secret object has to be
6396	// interpreted. Possible values include: 'Opaque', 'Vaultsecret'
6397	Type SecretObjectType `json:"type,omitempty"`
6398}
6399
6400// SetValue the properties of a overridable value that can be passed to a task template.
6401type SetValue struct {
6402	// Name - The name of the overridable value.
6403	Name *string `json:"name,omitempty"`
6404	// Value - The overridable value.
6405	Value *string `json:"value,omitempty"`
6406	// IsSecret - Flag to indicate whether the value represents a secret or not.
6407	IsSecret *bool `json:"isSecret,omitempty"`
6408}
6409
6410// Sku the SKU of a container registry.
6411type Sku struct {
6412	// Name - The SKU name of the container registry. Required for registry creation. Possible values include: 'Classic', 'Basic', 'Standard', 'Premium'
6413	Name SkuName `json:"name,omitempty"`
6414	// Tier - READ-ONLY; The SKU tier based on the SKU name. Possible values include: 'SkuTierClassic', 'SkuTierBasic', 'SkuTierStandard', 'SkuTierPremium'
6415	Tier SkuTier `json:"tier,omitempty"`
6416}
6417
6418// MarshalJSON is the custom marshaler for Sku.
6419func (s Sku) MarshalJSON() ([]byte, error) {
6420	objectMap := make(map[string]interface{})
6421	if s.Name != "" {
6422		objectMap["name"] = s.Name
6423	}
6424	return json.Marshal(objectMap)
6425}
6426
6427// Source the registry node that generated the event. Put differently, while the actor initiates the event,
6428// the source generates it.
6429type Source struct {
6430	// 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.
6431	Addr *string `json:"addr,omitempty"`
6432	// InstanceID - The running instance of an application. Changes after each restart.
6433	InstanceID *string `json:"instanceID,omitempty"`
6434}
6435
6436// SourceProperties the properties of the source code repository.
6437type SourceProperties struct {
6438	// SourceControlType - The type of source control service. Possible values include: 'Github', 'VisualStudioTeamService'
6439	SourceControlType SourceControlType `json:"sourceControlType,omitempty"`
6440	// RepositoryURL - The full URL to the source code repository
6441	RepositoryURL *string `json:"repositoryUrl,omitempty"`
6442	// Branch - The branch name of the source code.
6443	Branch *string `json:"branch,omitempty"`
6444	// SourceControlAuthProperties - The authorization properties for accessing the source code repository and to set up
6445	// webhooks for notifications.
6446	SourceControlAuthProperties *AuthInfo `json:"sourceControlAuthProperties,omitempty"`
6447}
6448
6449// SourceRegistryCredentials describes the credential parameters for accessing the source registry.
6450type SourceRegistryCredentials struct {
6451	// LoginMode - The authentication mode which determines the source registry login scope. The credentials for the source registry
6452	// will be generated using the given scope. These credentials will be used to login to
6453	// the source registry during the run. Possible values include: 'SourceRegistryLoginModeNone', 'SourceRegistryLoginModeDefault'
6454	LoginMode SourceRegistryLoginMode `json:"loginMode,omitempty"`
6455}
6456
6457// SourceTrigger the properties of a source based trigger.
6458type SourceTrigger struct {
6459	// SourceRepository - The properties that describes the source(code) for the task.
6460	SourceRepository *SourceProperties `json:"sourceRepository,omitempty"`
6461	// SourceTriggerEvents - The source event corresponding to the trigger.
6462	SourceTriggerEvents *[]SourceTriggerEvent `json:"sourceTriggerEvents,omitempty"`
6463	// Status - The current status of trigger. Possible values include: 'TriggerStatusEnabled', 'TriggerStatusDisabled'
6464	Status TriggerStatus `json:"status,omitempty"`
6465	// Name - The name of the trigger.
6466	Name *string `json:"name,omitempty"`
6467}
6468
6469// SourceTriggerDescriptor the source trigger that caused a run.
6470type SourceTriggerDescriptor struct {
6471	// ID - The unique ID of the trigger.
6472	ID *string `json:"id,omitempty"`
6473	// EventType - The event type of the trigger.
6474	EventType *string `json:"eventType,omitempty"`
6475	// CommitID - The unique ID that identifies a commit.
6476	CommitID *string `json:"commitId,omitempty"`
6477	// PullRequestID - The unique ID that identifies pull request.
6478	PullRequestID *string `json:"pullRequestId,omitempty"`
6479	// RepositoryURL - The repository URL.
6480	RepositoryURL *string `json:"repositoryUrl,omitempty"`
6481	// BranchName - The branch name in the repository.
6482	BranchName *string `json:"branchName,omitempty"`
6483	// ProviderType - The source control provider type.
6484	ProviderType *string `json:"providerType,omitempty"`
6485}
6486
6487// SourceTriggerUpdateParameters the properties for updating a source based trigger.
6488type SourceTriggerUpdateParameters struct {
6489	// SourceRepository - The properties that describes the source(code) for the task.
6490	SourceRepository *SourceUpdateParameters `json:"sourceRepository,omitempty"`
6491	// SourceTriggerEvents - The source event corresponding to the trigger.
6492	SourceTriggerEvents *[]SourceTriggerEvent `json:"sourceTriggerEvents,omitempty"`
6493	// Status - The current status of trigger. Possible values include: 'TriggerStatusEnabled', 'TriggerStatusDisabled'
6494	Status TriggerStatus `json:"status,omitempty"`
6495	// Name - The name of the trigger.
6496	Name *string `json:"name,omitempty"`
6497}
6498
6499// SourceUpdateParameters the properties for updating the source code repository.
6500type SourceUpdateParameters struct {
6501	// SourceControlType - The type of source control service. Possible values include: 'Github', 'VisualStudioTeamService'
6502	SourceControlType SourceControlType `json:"sourceControlType,omitempty"`
6503	// RepositoryURL - The full URL to the source code repository
6504	RepositoryURL *string `json:"repositoryUrl,omitempty"`
6505	// Branch - The branch name of the source code.
6506	Branch *string `json:"branch,omitempty"`
6507	// SourceControlAuthProperties - The authorization properties for accessing the source code repository and to set up
6508	// webhooks for notifications.
6509	SourceControlAuthProperties *AuthInfoUpdateParameters `json:"sourceControlAuthProperties,omitempty"`
6510}
6511
6512// SourceUploadDefinition the properties of a response to source upload request.
6513type SourceUploadDefinition struct {
6514	autorest.Response `json:"-"`
6515	// UploadURL - The URL where the client can upload the source.
6516	UploadURL *string `json:"uploadUrl,omitempty"`
6517	// RelativePath - The relative path to the source. This is used to submit the subsequent queue build request.
6518	RelativePath *string `json:"relativePath,omitempty"`
6519}
6520
6521// Status the status of an Azure resource at the time the operation was called.
6522type Status struct {
6523	// DisplayStatus - READ-ONLY; The short label for the status.
6524	DisplayStatus *string `json:"displayStatus,omitempty"`
6525	// Message - READ-ONLY; The detailed message for the status, including alerts and error messages.
6526	Message *string `json:"message,omitempty"`
6527	// Timestamp - READ-ONLY; The timestamp when the status was changed to the current value.
6528	Timestamp *date.Time `json:"timestamp,omitempty"`
6529}
6530
6531// MarshalJSON is the custom marshaler for Status.
6532func (s Status) MarshalJSON() ([]byte, error) {
6533	objectMap := make(map[string]interface{})
6534	return json.Marshal(objectMap)
6535}
6536
6537// StorageAccountProperties the properties of a storage account for a container registry. Only applicable
6538// to Classic SKU.
6539type StorageAccountProperties struct {
6540	// ID - The resource ID of the storage account.
6541	ID *string `json:"id,omitempty"`
6542}
6543
6544// SystemData metadata pertaining to creation and last modification of the resource.
6545type SystemData struct {
6546	// CreatedBy - The identity that created the resource.
6547	CreatedBy *string `json:"createdBy,omitempty"`
6548	// CreatedByType - The type of identity that created the resource. Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key'
6549	CreatedByType CreatedByType `json:"createdByType,omitempty"`
6550	// CreatedAt - The timestamp of resource creation (UTC).
6551	CreatedAt *date.Time `json:"createdAt,omitempty"`
6552	// LastModifiedBy - The identity that last modified the resource.
6553	LastModifiedBy *string `json:"lastModifiedBy,omitempty"`
6554	// LastModifiedByType - The type of identity that last modified the resource. Possible values include: 'LastModifiedByTypeUser', 'LastModifiedByTypeApplication', 'LastModifiedByTypeManagedIdentity', 'LastModifiedByTypeKey'
6555	LastModifiedByType LastModifiedByType `json:"lastModifiedByType,omitempty"`
6556	// LastModifiedAt - The timestamp of resource modification (UTC).
6557	LastModifiedAt *date.Time `json:"lastModifiedAt,omitempty"`
6558}
6559
6560// Target the target of the event.
6561type Target struct {
6562	// MediaType - The MIME type of the referenced object.
6563	MediaType *string `json:"mediaType,omitempty"`
6564	// Size - The number of bytes of the content. Same as Length field.
6565	Size *int64 `json:"size,omitempty"`
6566	// Digest - The digest of the content, as defined by the Registry V2 HTTP API Specification.
6567	Digest *string `json:"digest,omitempty"`
6568	// Length - The number of bytes of the content. Same as Size field.
6569	Length *int64 `json:"length,omitempty"`
6570	// Repository - The repository name.
6571	Repository *string `json:"repository,omitempty"`
6572	// URL - The direct URL to the content.
6573	URL *string `json:"url,omitempty"`
6574	// Tag - The tag name.
6575	Tag *string `json:"tag,omitempty"`
6576	// Name - The name of the artifact.
6577	Name *string `json:"name,omitempty"`
6578	// Version - The version of the artifact.
6579	Version *string `json:"version,omitempty"`
6580}
6581
6582// Task the task that has the ARM resource and task properties.
6583// The task will have all information to schedule a run against it.
6584type Task struct {
6585	autorest.Response `json:"-"`
6586	// Identity - Identity for the resource.
6587	Identity *IdentityProperties `json:"identity,omitempty"`
6588	// TaskProperties - The properties of a task.
6589	*TaskProperties `json:"properties,omitempty"`
6590	// ID - READ-ONLY; The resource ID.
6591	ID *string `json:"id,omitempty"`
6592	// Name - READ-ONLY; The name of the resource.
6593	Name *string `json:"name,omitempty"`
6594	// Type - READ-ONLY; The type of the resource.
6595	Type *string `json:"type,omitempty"`
6596	// Location - The location of the resource. This cannot be changed after the resource is created.
6597	Location *string `json:"location,omitempty"`
6598	// Tags - The tags of the resource.
6599	Tags map[string]*string `json:"tags"`
6600	// SystemData - READ-ONLY; Metadata pertaining to creation and last modification of the resource.
6601	SystemData *SystemData `json:"systemData,omitempty"`
6602}
6603
6604// MarshalJSON is the custom marshaler for Task.
6605func (t Task) MarshalJSON() ([]byte, error) {
6606	objectMap := make(map[string]interface{})
6607	if t.Identity != nil {
6608		objectMap["identity"] = t.Identity
6609	}
6610	if t.TaskProperties != nil {
6611		objectMap["properties"] = t.TaskProperties
6612	}
6613	if t.Location != nil {
6614		objectMap["location"] = t.Location
6615	}
6616	if t.Tags != nil {
6617		objectMap["tags"] = t.Tags
6618	}
6619	return json.Marshal(objectMap)
6620}
6621
6622// UnmarshalJSON is the custom unmarshaler for Task struct.
6623func (t *Task) UnmarshalJSON(body []byte) error {
6624	var m map[string]*json.RawMessage
6625	err := json.Unmarshal(body, &m)
6626	if err != nil {
6627		return err
6628	}
6629	for k, v := range m {
6630		switch k {
6631		case "identity":
6632			if v != nil {
6633				var identity IdentityProperties
6634				err = json.Unmarshal(*v, &identity)
6635				if err != nil {
6636					return err
6637				}
6638				t.Identity = &identity
6639			}
6640		case "properties":
6641			if v != nil {
6642				var taskProperties TaskProperties
6643				err = json.Unmarshal(*v, &taskProperties)
6644				if err != nil {
6645					return err
6646				}
6647				t.TaskProperties = &taskProperties
6648			}
6649		case "id":
6650			if v != nil {
6651				var ID string
6652				err = json.Unmarshal(*v, &ID)
6653				if err != nil {
6654					return err
6655				}
6656				t.ID = &ID
6657			}
6658		case "name":
6659			if v != nil {
6660				var name string
6661				err = json.Unmarshal(*v, &name)
6662				if err != nil {
6663					return err
6664				}
6665				t.Name = &name
6666			}
6667		case "type":
6668			if v != nil {
6669				var typeVar string
6670				err = json.Unmarshal(*v, &typeVar)
6671				if err != nil {
6672					return err
6673				}
6674				t.Type = &typeVar
6675			}
6676		case "location":
6677			if v != nil {
6678				var location string
6679				err = json.Unmarshal(*v, &location)
6680				if err != nil {
6681					return err
6682				}
6683				t.Location = &location
6684			}
6685		case "tags":
6686			if v != nil {
6687				var tags map[string]*string
6688				err = json.Unmarshal(*v, &tags)
6689				if err != nil {
6690					return err
6691				}
6692				t.Tags = tags
6693			}
6694		case "systemData":
6695			if v != nil {
6696				var systemData SystemData
6697				err = json.Unmarshal(*v, &systemData)
6698				if err != nil {
6699					return err
6700				}
6701				t.SystemData = &systemData
6702			}
6703		}
6704	}
6705
6706	return nil
6707}
6708
6709// TaskListResult the collection of tasks.
6710type TaskListResult struct {
6711	autorest.Response `json:"-"`
6712	// Value - The collection value.
6713	Value *[]Task `json:"value,omitempty"`
6714	// NextLink - The URI that can be used to request the next set of paged results.
6715	NextLink *string `json:"nextLink,omitempty"`
6716}
6717
6718// TaskListResultIterator provides access to a complete listing of Task values.
6719type TaskListResultIterator struct {
6720	i    int
6721	page TaskListResultPage
6722}
6723
6724// NextWithContext advances to the next value.  If there was an error making
6725// the request the iterator does not advance and the error is returned.
6726func (iter *TaskListResultIterator) NextWithContext(ctx context.Context) (err error) {
6727	if tracing.IsEnabled() {
6728		ctx = tracing.StartSpan(ctx, fqdn+"/TaskListResultIterator.NextWithContext")
6729		defer func() {
6730			sc := -1
6731			if iter.Response().Response.Response != nil {
6732				sc = iter.Response().Response.Response.StatusCode
6733			}
6734			tracing.EndSpan(ctx, sc, err)
6735		}()
6736	}
6737	iter.i++
6738	if iter.i < len(iter.page.Values()) {
6739		return nil
6740	}
6741	err = iter.page.NextWithContext(ctx)
6742	if err != nil {
6743		iter.i--
6744		return err
6745	}
6746	iter.i = 0
6747	return nil
6748}
6749
6750// Next advances to the next value.  If there was an error making
6751// the request the iterator does not advance and the error is returned.
6752// Deprecated: Use NextWithContext() instead.
6753func (iter *TaskListResultIterator) Next() error {
6754	return iter.NextWithContext(context.Background())
6755}
6756
6757// NotDone returns true if the enumeration should be started or is not yet complete.
6758func (iter TaskListResultIterator) NotDone() bool {
6759	return iter.page.NotDone() && iter.i < len(iter.page.Values())
6760}
6761
6762// Response returns the raw server response from the last page request.
6763func (iter TaskListResultIterator) Response() TaskListResult {
6764	return iter.page.Response()
6765}
6766
6767// Value returns the current value or a zero-initialized value if the
6768// iterator has advanced beyond the end of the collection.
6769func (iter TaskListResultIterator) Value() Task {
6770	if !iter.page.NotDone() {
6771		return Task{}
6772	}
6773	return iter.page.Values()[iter.i]
6774}
6775
6776// Creates a new instance of the TaskListResultIterator type.
6777func NewTaskListResultIterator(page TaskListResultPage) TaskListResultIterator {
6778	return TaskListResultIterator{page: page}
6779}
6780
6781// IsEmpty returns true if the ListResult contains no values.
6782func (tlr TaskListResult) IsEmpty() bool {
6783	return tlr.Value == nil || len(*tlr.Value) == 0
6784}
6785
6786// hasNextLink returns true if the NextLink is not empty.
6787func (tlr TaskListResult) hasNextLink() bool {
6788	return tlr.NextLink != nil && len(*tlr.NextLink) != 0
6789}
6790
6791// taskListResultPreparer prepares a request to retrieve the next set of results.
6792// It returns nil if no more results exist.
6793func (tlr TaskListResult) taskListResultPreparer(ctx context.Context) (*http.Request, error) {
6794	if !tlr.hasNextLink() {
6795		return nil, nil
6796	}
6797	return autorest.Prepare((&http.Request{}).WithContext(ctx),
6798		autorest.AsJSON(),
6799		autorest.AsGet(),
6800		autorest.WithBaseURL(to.String(tlr.NextLink)))
6801}
6802
6803// TaskListResultPage contains a page of Task values.
6804type TaskListResultPage struct {
6805	fn  func(context.Context, TaskListResult) (TaskListResult, error)
6806	tlr TaskListResult
6807}
6808
6809// NextWithContext advances to the next page of values.  If there was an error making
6810// the request the page does not advance and the error is returned.
6811func (page *TaskListResultPage) NextWithContext(ctx context.Context) (err error) {
6812	if tracing.IsEnabled() {
6813		ctx = tracing.StartSpan(ctx, fqdn+"/TaskListResultPage.NextWithContext")
6814		defer func() {
6815			sc := -1
6816			if page.Response().Response.Response != nil {
6817				sc = page.Response().Response.Response.StatusCode
6818			}
6819			tracing.EndSpan(ctx, sc, err)
6820		}()
6821	}
6822	for {
6823		next, err := page.fn(ctx, page.tlr)
6824		if err != nil {
6825			return err
6826		}
6827		page.tlr = next
6828		if !next.hasNextLink() || !next.IsEmpty() {
6829			break
6830		}
6831	}
6832	return nil
6833}
6834
6835// Next advances to the next page of values.  If there was an error making
6836// the request the page does not advance and the error is returned.
6837// Deprecated: Use NextWithContext() instead.
6838func (page *TaskListResultPage) Next() error {
6839	return page.NextWithContext(context.Background())
6840}
6841
6842// NotDone returns true if the page enumeration should be started or is not yet complete.
6843func (page TaskListResultPage) NotDone() bool {
6844	return !page.tlr.IsEmpty()
6845}
6846
6847// Response returns the raw server response from the last page request.
6848func (page TaskListResultPage) Response() TaskListResult {
6849	return page.tlr
6850}
6851
6852// Values returns the slice of values for the current page or nil if there are no values.
6853func (page TaskListResultPage) Values() []Task {
6854	if page.tlr.IsEmpty() {
6855		return nil
6856	}
6857	return *page.tlr.Value
6858}
6859
6860// Creates a new instance of the TaskListResultPage type.
6861func NewTaskListResultPage(cur TaskListResult, getNextPage func(context.Context, TaskListResult) (TaskListResult, error)) TaskListResultPage {
6862	return TaskListResultPage{
6863		fn:  getNextPage,
6864		tlr: cur,
6865	}
6866}
6867
6868// TaskProperties the properties of a task.
6869type TaskProperties struct {
6870	// ProvisioningState - READ-ONLY; The provisioning state of the task. Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', 'Canceled'
6871	ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
6872	// CreationDate - READ-ONLY; The creation date of task.
6873	CreationDate *date.Time `json:"creationDate,omitempty"`
6874	// Status - The current status of task. Possible values include: 'TaskStatusDisabled', 'TaskStatusEnabled'
6875	Status TaskStatus `json:"status,omitempty"`
6876	// Platform - The platform properties against which the run has to happen.
6877	Platform *PlatformProperties `json:"platform,omitempty"`
6878	// AgentConfiguration - The machine configuration of the run agent.
6879	AgentConfiguration *AgentProperties `json:"agentConfiguration,omitempty"`
6880	// AgentPoolName - The dedicated agent pool for the task.
6881	AgentPoolName *string `json:"agentPoolName,omitempty"`
6882	// Timeout - Run timeout in seconds.
6883	Timeout *int32 `json:"timeout,omitempty"`
6884	// Step - The properties of a task step.
6885	Step BasicTaskStepProperties `json:"step,omitempty"`
6886	// Trigger - The properties that describe all triggers for the task.
6887	Trigger *TriggerProperties `json:"trigger,omitempty"`
6888	// Credentials - The properties that describes a set of credentials that will be used when this run is invoked.
6889	Credentials *Credentials `json:"credentials,omitempty"`
6890	// LogTemplate - The template that describes the repository and tag information for run log artifact.
6891	LogTemplate *string `json:"logTemplate,omitempty"`
6892	// IsSystemTask - The value of this property indicates whether the task resource is system task or not.
6893	IsSystemTask *bool `json:"isSystemTask,omitempty"`
6894}
6895
6896// MarshalJSON is the custom marshaler for TaskProperties.
6897func (tp TaskProperties) MarshalJSON() ([]byte, error) {
6898	objectMap := make(map[string]interface{})
6899	if tp.Status != "" {
6900		objectMap["status"] = tp.Status
6901	}
6902	if tp.Platform != nil {
6903		objectMap["platform"] = tp.Platform
6904	}
6905	if tp.AgentConfiguration != nil {
6906		objectMap["agentConfiguration"] = tp.AgentConfiguration
6907	}
6908	if tp.AgentPoolName != nil {
6909		objectMap["agentPoolName"] = tp.AgentPoolName
6910	}
6911	if tp.Timeout != nil {
6912		objectMap["timeout"] = tp.Timeout
6913	}
6914	objectMap["step"] = tp.Step
6915	if tp.Trigger != nil {
6916		objectMap["trigger"] = tp.Trigger
6917	}
6918	if tp.Credentials != nil {
6919		objectMap["credentials"] = tp.Credentials
6920	}
6921	if tp.LogTemplate != nil {
6922		objectMap["logTemplate"] = tp.LogTemplate
6923	}
6924	if tp.IsSystemTask != nil {
6925		objectMap["isSystemTask"] = tp.IsSystemTask
6926	}
6927	return json.Marshal(objectMap)
6928}
6929
6930// UnmarshalJSON is the custom unmarshaler for TaskProperties struct.
6931func (tp *TaskProperties) UnmarshalJSON(body []byte) error {
6932	var m map[string]*json.RawMessage
6933	err := json.Unmarshal(body, &m)
6934	if err != nil {
6935		return err
6936	}
6937	for k, v := range m {
6938		switch k {
6939		case "provisioningState":
6940			if v != nil {
6941				var provisioningState ProvisioningState
6942				err = json.Unmarshal(*v, &provisioningState)
6943				if err != nil {
6944					return err
6945				}
6946				tp.ProvisioningState = provisioningState
6947			}
6948		case "creationDate":
6949			if v != nil {
6950				var creationDate date.Time
6951				err = json.Unmarshal(*v, &creationDate)
6952				if err != nil {
6953					return err
6954				}
6955				tp.CreationDate = &creationDate
6956			}
6957		case "status":
6958			if v != nil {
6959				var status TaskStatus
6960				err = json.Unmarshal(*v, &status)
6961				if err != nil {
6962					return err
6963				}
6964				tp.Status = status
6965			}
6966		case "platform":
6967			if v != nil {
6968				var platform PlatformProperties
6969				err = json.Unmarshal(*v, &platform)
6970				if err != nil {
6971					return err
6972				}
6973				tp.Platform = &platform
6974			}
6975		case "agentConfiguration":
6976			if v != nil {
6977				var agentConfiguration AgentProperties
6978				err = json.Unmarshal(*v, &agentConfiguration)
6979				if err != nil {
6980					return err
6981				}
6982				tp.AgentConfiguration = &agentConfiguration
6983			}
6984		case "agentPoolName":
6985			if v != nil {
6986				var agentPoolName string
6987				err = json.Unmarshal(*v, &agentPoolName)
6988				if err != nil {
6989					return err
6990				}
6991				tp.AgentPoolName = &agentPoolName
6992			}
6993		case "timeout":
6994			if v != nil {
6995				var timeout int32
6996				err = json.Unmarshal(*v, &timeout)
6997				if err != nil {
6998					return err
6999				}
7000				tp.Timeout = &timeout
7001			}
7002		case "step":
7003			if v != nil {
7004				step, err := unmarshalBasicTaskStepProperties(*v)
7005				if err != nil {
7006					return err
7007				}
7008				tp.Step = step
7009			}
7010		case "trigger":
7011			if v != nil {
7012				var trigger TriggerProperties
7013				err = json.Unmarshal(*v, &trigger)
7014				if err != nil {
7015					return err
7016				}
7017				tp.Trigger = &trigger
7018			}
7019		case "credentials":
7020			if v != nil {
7021				var credentials Credentials
7022				err = json.Unmarshal(*v, &credentials)
7023				if err != nil {
7024					return err
7025				}
7026				tp.Credentials = &credentials
7027			}
7028		case "logTemplate":
7029			if v != nil {
7030				var logTemplate string
7031				err = json.Unmarshal(*v, &logTemplate)
7032				if err != nil {
7033					return err
7034				}
7035				tp.LogTemplate = &logTemplate
7036			}
7037		case "isSystemTask":
7038			if v != nil {
7039				var isSystemTask bool
7040				err = json.Unmarshal(*v, &isSystemTask)
7041				if err != nil {
7042					return err
7043				}
7044				tp.IsSystemTask = &isSystemTask
7045			}
7046		}
7047	}
7048
7049	return nil
7050}
7051
7052// TaskPropertiesUpdateParameters the properties for updating a task.
7053type TaskPropertiesUpdateParameters struct {
7054	// Status - The current status of task. Possible values include: 'TaskStatusDisabled', 'TaskStatusEnabled'
7055	Status TaskStatus `json:"status,omitempty"`
7056	// Platform - The platform properties against which the run has to happen.
7057	Platform *PlatformUpdateParameters `json:"platform,omitempty"`
7058	// AgentConfiguration - The machine configuration of the run agent.
7059	AgentConfiguration *AgentProperties `json:"agentConfiguration,omitempty"`
7060	// AgentPoolName - The dedicated agent pool for the task.
7061	AgentPoolName *string `json:"agentPoolName,omitempty"`
7062	// Timeout - Run timeout in seconds.
7063	Timeout *int32 `json:"timeout,omitempty"`
7064	// Step - The properties for updating a task step.
7065	Step BasicTaskStepUpdateParameters `json:"step,omitempty"`
7066	// Trigger - The properties for updating trigger properties.
7067	Trigger *TriggerUpdateParameters `json:"trigger,omitempty"`
7068	// Credentials - The parameters that describes a set of credentials that will be used when this run is invoked.
7069	Credentials *Credentials `json:"credentials,omitempty"`
7070	// LogTemplate - The template that describes the repository and tag information for run log artifact.
7071	LogTemplate *string `json:"logTemplate,omitempty"`
7072}
7073
7074// UnmarshalJSON is the custom unmarshaler for TaskPropertiesUpdateParameters struct.
7075func (tpup *TaskPropertiesUpdateParameters) UnmarshalJSON(body []byte) error {
7076	var m map[string]*json.RawMessage
7077	err := json.Unmarshal(body, &m)
7078	if err != nil {
7079		return err
7080	}
7081	for k, v := range m {
7082		switch k {
7083		case "status":
7084			if v != nil {
7085				var status TaskStatus
7086				err = json.Unmarshal(*v, &status)
7087				if err != nil {
7088					return err
7089				}
7090				tpup.Status = status
7091			}
7092		case "platform":
7093			if v != nil {
7094				var platform PlatformUpdateParameters
7095				err = json.Unmarshal(*v, &platform)
7096				if err != nil {
7097					return err
7098				}
7099				tpup.Platform = &platform
7100			}
7101		case "agentConfiguration":
7102			if v != nil {
7103				var agentConfiguration AgentProperties
7104				err = json.Unmarshal(*v, &agentConfiguration)
7105				if err != nil {
7106					return err
7107				}
7108				tpup.AgentConfiguration = &agentConfiguration
7109			}
7110		case "agentPoolName":
7111			if v != nil {
7112				var agentPoolName string
7113				err = json.Unmarshal(*v, &agentPoolName)
7114				if err != nil {
7115					return err
7116				}
7117				tpup.AgentPoolName = &agentPoolName
7118			}
7119		case "timeout":
7120			if v != nil {
7121				var timeout int32
7122				err = json.Unmarshal(*v, &timeout)
7123				if err != nil {
7124					return err
7125				}
7126				tpup.Timeout = &timeout
7127			}
7128		case "step":
7129			if v != nil {
7130				step, err := unmarshalBasicTaskStepUpdateParameters(*v)
7131				if err != nil {
7132					return err
7133				}
7134				tpup.Step = step
7135			}
7136		case "trigger":
7137			if v != nil {
7138				var trigger TriggerUpdateParameters
7139				err = json.Unmarshal(*v, &trigger)
7140				if err != nil {
7141					return err
7142				}
7143				tpup.Trigger = &trigger
7144			}
7145		case "credentials":
7146			if v != nil {
7147				var credentials Credentials
7148				err = json.Unmarshal(*v, &credentials)
7149				if err != nil {
7150					return err
7151				}
7152				tpup.Credentials = &credentials
7153			}
7154		case "logTemplate":
7155			if v != nil {
7156				var logTemplate string
7157				err = json.Unmarshal(*v, &logTemplate)
7158				if err != nil {
7159					return err
7160				}
7161				tpup.LogTemplate = &logTemplate
7162			}
7163		}
7164	}
7165
7166	return nil
7167}
7168
7169// TaskRun the task run that has the ARM resource and properties.
7170// The task run will have the information of request and result of a run.
7171type TaskRun struct {
7172	autorest.Response `json:"-"`
7173	// Identity - Identity for the resource.
7174	Identity *IdentityProperties `json:"identity,omitempty"`
7175	// TaskRunProperties - The properties associated with the task run, i.e., request and result of the run
7176	*TaskRunProperties `json:"properties,omitempty"`
7177	// Location - The location of the resource
7178	Location *string `json:"location,omitempty"`
7179	// ID - READ-ONLY; The resource ID.
7180	ID *string `json:"id,omitempty"`
7181	// Name - READ-ONLY; The name of the resource.
7182	Name *string `json:"name,omitempty"`
7183	// Type - READ-ONLY; The type of the resource.
7184	Type *string `json:"type,omitempty"`
7185	// SystemData - READ-ONLY; Metadata pertaining to creation and last modification of the resource.
7186	SystemData *SystemData `json:"systemData,omitempty"`
7187}
7188
7189// MarshalJSON is the custom marshaler for TaskRun.
7190func (tr TaskRun) MarshalJSON() ([]byte, error) {
7191	objectMap := make(map[string]interface{})
7192	if tr.Identity != nil {
7193		objectMap["identity"] = tr.Identity
7194	}
7195	if tr.TaskRunProperties != nil {
7196		objectMap["properties"] = tr.TaskRunProperties
7197	}
7198	if tr.Location != nil {
7199		objectMap["location"] = tr.Location
7200	}
7201	return json.Marshal(objectMap)
7202}
7203
7204// UnmarshalJSON is the custom unmarshaler for TaskRun struct.
7205func (tr *TaskRun) UnmarshalJSON(body []byte) error {
7206	var m map[string]*json.RawMessage
7207	err := json.Unmarshal(body, &m)
7208	if err != nil {
7209		return err
7210	}
7211	for k, v := range m {
7212		switch k {
7213		case "identity":
7214			if v != nil {
7215				var identity IdentityProperties
7216				err = json.Unmarshal(*v, &identity)
7217				if err != nil {
7218					return err
7219				}
7220				tr.Identity = &identity
7221			}
7222		case "properties":
7223			if v != nil {
7224				var taskRunProperties TaskRunProperties
7225				err = json.Unmarshal(*v, &taskRunProperties)
7226				if err != nil {
7227					return err
7228				}
7229				tr.TaskRunProperties = &taskRunProperties
7230			}
7231		case "location":
7232			if v != nil {
7233				var location string
7234				err = json.Unmarshal(*v, &location)
7235				if err != nil {
7236					return err
7237				}
7238				tr.Location = &location
7239			}
7240		case "id":
7241			if v != nil {
7242				var ID string
7243				err = json.Unmarshal(*v, &ID)
7244				if err != nil {
7245					return err
7246				}
7247				tr.ID = &ID
7248			}
7249		case "name":
7250			if v != nil {
7251				var name string
7252				err = json.Unmarshal(*v, &name)
7253				if err != nil {
7254					return err
7255				}
7256				tr.Name = &name
7257			}
7258		case "type":
7259			if v != nil {
7260				var typeVar string
7261				err = json.Unmarshal(*v, &typeVar)
7262				if err != nil {
7263					return err
7264				}
7265				tr.Type = &typeVar
7266			}
7267		case "systemData":
7268			if v != nil {
7269				var systemData SystemData
7270				err = json.Unmarshal(*v, &systemData)
7271				if err != nil {
7272					return err
7273				}
7274				tr.SystemData = &systemData
7275			}
7276		}
7277	}
7278
7279	return nil
7280}
7281
7282// TaskRunListResult the collection of task runs.
7283type TaskRunListResult struct {
7284	autorest.Response `json:"-"`
7285	// Value - The collection value.
7286	Value *[]TaskRun `json:"value,omitempty"`
7287	// NextLink - The URI that can be used to request the next set of paged results.
7288	NextLink *string `json:"nextLink,omitempty"`
7289}
7290
7291// TaskRunListResultIterator provides access to a complete listing of TaskRun values.
7292type TaskRunListResultIterator struct {
7293	i    int
7294	page TaskRunListResultPage
7295}
7296
7297// NextWithContext advances to the next value.  If there was an error making
7298// the request the iterator does not advance and the error is returned.
7299func (iter *TaskRunListResultIterator) NextWithContext(ctx context.Context) (err error) {
7300	if tracing.IsEnabled() {
7301		ctx = tracing.StartSpan(ctx, fqdn+"/TaskRunListResultIterator.NextWithContext")
7302		defer func() {
7303			sc := -1
7304			if iter.Response().Response.Response != nil {
7305				sc = iter.Response().Response.Response.StatusCode
7306			}
7307			tracing.EndSpan(ctx, sc, err)
7308		}()
7309	}
7310	iter.i++
7311	if iter.i < len(iter.page.Values()) {
7312		return nil
7313	}
7314	err = iter.page.NextWithContext(ctx)
7315	if err != nil {
7316		iter.i--
7317		return err
7318	}
7319	iter.i = 0
7320	return nil
7321}
7322
7323// Next advances to the next value.  If there was an error making
7324// the request the iterator does not advance and the error is returned.
7325// Deprecated: Use NextWithContext() instead.
7326func (iter *TaskRunListResultIterator) Next() error {
7327	return iter.NextWithContext(context.Background())
7328}
7329
7330// NotDone returns true if the enumeration should be started or is not yet complete.
7331func (iter TaskRunListResultIterator) NotDone() bool {
7332	return iter.page.NotDone() && iter.i < len(iter.page.Values())
7333}
7334
7335// Response returns the raw server response from the last page request.
7336func (iter TaskRunListResultIterator) Response() TaskRunListResult {
7337	return iter.page.Response()
7338}
7339
7340// Value returns the current value or a zero-initialized value if the
7341// iterator has advanced beyond the end of the collection.
7342func (iter TaskRunListResultIterator) Value() TaskRun {
7343	if !iter.page.NotDone() {
7344		return TaskRun{}
7345	}
7346	return iter.page.Values()[iter.i]
7347}
7348
7349// Creates a new instance of the TaskRunListResultIterator type.
7350func NewTaskRunListResultIterator(page TaskRunListResultPage) TaskRunListResultIterator {
7351	return TaskRunListResultIterator{page: page}
7352}
7353
7354// IsEmpty returns true if the ListResult contains no values.
7355func (trlr TaskRunListResult) IsEmpty() bool {
7356	return trlr.Value == nil || len(*trlr.Value) == 0
7357}
7358
7359// hasNextLink returns true if the NextLink is not empty.
7360func (trlr TaskRunListResult) hasNextLink() bool {
7361	return trlr.NextLink != nil && len(*trlr.NextLink) != 0
7362}
7363
7364// taskRunListResultPreparer prepares a request to retrieve the next set of results.
7365// It returns nil if no more results exist.
7366func (trlr TaskRunListResult) taskRunListResultPreparer(ctx context.Context) (*http.Request, error) {
7367	if !trlr.hasNextLink() {
7368		return nil, nil
7369	}
7370	return autorest.Prepare((&http.Request{}).WithContext(ctx),
7371		autorest.AsJSON(),
7372		autorest.AsGet(),
7373		autorest.WithBaseURL(to.String(trlr.NextLink)))
7374}
7375
7376// TaskRunListResultPage contains a page of TaskRun values.
7377type TaskRunListResultPage struct {
7378	fn   func(context.Context, TaskRunListResult) (TaskRunListResult, error)
7379	trlr TaskRunListResult
7380}
7381
7382// NextWithContext advances to the next page of values.  If there was an error making
7383// the request the page does not advance and the error is returned.
7384func (page *TaskRunListResultPage) NextWithContext(ctx context.Context) (err error) {
7385	if tracing.IsEnabled() {
7386		ctx = tracing.StartSpan(ctx, fqdn+"/TaskRunListResultPage.NextWithContext")
7387		defer func() {
7388			sc := -1
7389			if page.Response().Response.Response != nil {
7390				sc = page.Response().Response.Response.StatusCode
7391			}
7392			tracing.EndSpan(ctx, sc, err)
7393		}()
7394	}
7395	for {
7396		next, err := page.fn(ctx, page.trlr)
7397		if err != nil {
7398			return err
7399		}
7400		page.trlr = next
7401		if !next.hasNextLink() || !next.IsEmpty() {
7402			break
7403		}
7404	}
7405	return nil
7406}
7407
7408// Next advances to the next page of values.  If there was an error making
7409// the request the page does not advance and the error is returned.
7410// Deprecated: Use NextWithContext() instead.
7411func (page *TaskRunListResultPage) Next() error {
7412	return page.NextWithContext(context.Background())
7413}
7414
7415// NotDone returns true if the page enumeration should be started or is not yet complete.
7416func (page TaskRunListResultPage) NotDone() bool {
7417	return !page.trlr.IsEmpty()
7418}
7419
7420// Response returns the raw server response from the last page request.
7421func (page TaskRunListResultPage) Response() TaskRunListResult {
7422	return page.trlr
7423}
7424
7425// Values returns the slice of values for the current page or nil if there are no values.
7426func (page TaskRunListResultPage) Values() []TaskRun {
7427	if page.trlr.IsEmpty() {
7428		return nil
7429	}
7430	return *page.trlr.Value
7431}
7432
7433// Creates a new instance of the TaskRunListResultPage type.
7434func NewTaskRunListResultPage(cur TaskRunListResult, getNextPage func(context.Context, TaskRunListResult) (TaskRunListResult, error)) TaskRunListResultPage {
7435	return TaskRunListResultPage{
7436		fn:   getNextPage,
7437		trlr: cur,
7438	}
7439}
7440
7441// TaskRunProperties the properties of task run.
7442type TaskRunProperties struct {
7443	// ProvisioningState - READ-ONLY; The provisioning state of this task run. Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', 'Canceled'
7444	ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
7445	// RunRequest - The request (parameters) for the run
7446	RunRequest BasicRunRequest `json:"runRequest,omitempty"`
7447	// RunResult - READ-ONLY; The result of this task run
7448	RunResult *Run `json:"runResult,omitempty"`
7449	// ForceUpdateTag - How the run should be forced to rerun even if the run request configuration has not changed
7450	ForceUpdateTag *string `json:"forceUpdateTag,omitempty"`
7451}
7452
7453// MarshalJSON is the custom marshaler for TaskRunProperties.
7454func (trp TaskRunProperties) MarshalJSON() ([]byte, error) {
7455	objectMap := make(map[string]interface{})
7456	objectMap["runRequest"] = trp.RunRequest
7457	if trp.ForceUpdateTag != nil {
7458		objectMap["forceUpdateTag"] = trp.ForceUpdateTag
7459	}
7460	return json.Marshal(objectMap)
7461}
7462
7463// UnmarshalJSON is the custom unmarshaler for TaskRunProperties struct.
7464func (trp *TaskRunProperties) UnmarshalJSON(body []byte) error {
7465	var m map[string]*json.RawMessage
7466	err := json.Unmarshal(body, &m)
7467	if err != nil {
7468		return err
7469	}
7470	for k, v := range m {
7471		switch k {
7472		case "provisioningState":
7473			if v != nil {
7474				var provisioningState ProvisioningState
7475				err = json.Unmarshal(*v, &provisioningState)
7476				if err != nil {
7477					return err
7478				}
7479				trp.ProvisioningState = provisioningState
7480			}
7481		case "runRequest":
7482			if v != nil {
7483				runRequest, err := unmarshalBasicRunRequest(*v)
7484				if err != nil {
7485					return err
7486				}
7487				trp.RunRequest = runRequest
7488			}
7489		case "runResult":
7490			if v != nil {
7491				var runResult Run
7492				err = json.Unmarshal(*v, &runResult)
7493				if err != nil {
7494					return err
7495				}
7496				trp.RunResult = &runResult
7497			}
7498		case "forceUpdateTag":
7499			if v != nil {
7500				var forceUpdateTag string
7501				err = json.Unmarshal(*v, &forceUpdateTag)
7502				if err != nil {
7503					return err
7504				}
7505				trp.ForceUpdateTag = &forceUpdateTag
7506			}
7507		}
7508	}
7509
7510	return nil
7511}
7512
7513// TaskRunPropertiesUpdateParameters the properties of a task run update parameters.
7514type TaskRunPropertiesUpdateParameters struct {
7515	// RunRequest - The request (parameters) for the new run
7516	RunRequest BasicRunRequest `json:"runRequest,omitempty"`
7517	// ForceUpdateTag - How the run should be forced to rerun even if the run request configuration has not changed
7518	ForceUpdateTag *string `json:"forceUpdateTag,omitempty"`
7519}
7520
7521// UnmarshalJSON is the custom unmarshaler for TaskRunPropertiesUpdateParameters struct.
7522func (trpup *TaskRunPropertiesUpdateParameters) UnmarshalJSON(body []byte) error {
7523	var m map[string]*json.RawMessage
7524	err := json.Unmarshal(body, &m)
7525	if err != nil {
7526		return err
7527	}
7528	for k, v := range m {
7529		switch k {
7530		case "runRequest":
7531			if v != nil {
7532				runRequest, err := unmarshalBasicRunRequest(*v)
7533				if err != nil {
7534					return err
7535				}
7536				trpup.RunRequest = runRequest
7537			}
7538		case "forceUpdateTag":
7539			if v != nil {
7540				var forceUpdateTag string
7541				err = json.Unmarshal(*v, &forceUpdateTag)
7542				if err != nil {
7543					return err
7544				}
7545				trpup.ForceUpdateTag = &forceUpdateTag
7546			}
7547		}
7548	}
7549
7550	return nil
7551}
7552
7553// TaskRunRequest the parameters for a task run request.
7554type TaskRunRequest struct {
7555	// TaskID - The resource ID of task against which run has to be queued.
7556	TaskID *string `json:"taskId,omitempty"`
7557	// OverrideTaskStepProperties - Set of overridable parameters that can be passed when running a Task.
7558	OverrideTaskStepProperties *OverrideTaskStepProperties `json:"overrideTaskStepProperties,omitempty"`
7559	// IsArchiveEnabled - The value that indicates whether archiving is enabled for the run or not.
7560	IsArchiveEnabled *bool `json:"isArchiveEnabled,omitempty"`
7561	// AgentPoolName - The dedicated agent pool for the run.
7562	AgentPoolName *string `json:"agentPoolName,omitempty"`
7563	// LogTemplate - The template that describes the repository and tag information for run log artifact.
7564	LogTemplate *string `json:"logTemplate,omitempty"`
7565	// Type - Possible values include: 'TypeRunRequest', 'TypeDockerBuildRequest', 'TypeFileTaskRunRequest', 'TypeTaskRunRequest', 'TypeEncodedTaskRunRequest'
7566	Type Type `json:"type,omitempty"`
7567}
7568
7569// MarshalJSON is the custom marshaler for TaskRunRequest.
7570func (trr TaskRunRequest) MarshalJSON() ([]byte, error) {
7571	trr.Type = TypeTaskRunRequest
7572	objectMap := make(map[string]interface{})
7573	if trr.TaskID != nil {
7574		objectMap["taskId"] = trr.TaskID
7575	}
7576	if trr.OverrideTaskStepProperties != nil {
7577		objectMap["overrideTaskStepProperties"] = trr.OverrideTaskStepProperties
7578	}
7579	if trr.IsArchiveEnabled != nil {
7580		objectMap["isArchiveEnabled"] = trr.IsArchiveEnabled
7581	}
7582	if trr.AgentPoolName != nil {
7583		objectMap["agentPoolName"] = trr.AgentPoolName
7584	}
7585	if trr.LogTemplate != nil {
7586		objectMap["logTemplate"] = trr.LogTemplate
7587	}
7588	if trr.Type != "" {
7589		objectMap["type"] = trr.Type
7590	}
7591	return json.Marshal(objectMap)
7592}
7593
7594// AsDockerBuildRequest is the BasicRunRequest implementation for TaskRunRequest.
7595func (trr TaskRunRequest) AsDockerBuildRequest() (*DockerBuildRequest, bool) {
7596	return nil, false
7597}
7598
7599// AsFileTaskRunRequest is the BasicRunRequest implementation for TaskRunRequest.
7600func (trr TaskRunRequest) AsFileTaskRunRequest() (*FileTaskRunRequest, bool) {
7601	return nil, false
7602}
7603
7604// AsTaskRunRequest is the BasicRunRequest implementation for TaskRunRequest.
7605func (trr TaskRunRequest) AsTaskRunRequest() (*TaskRunRequest, bool) {
7606	return &trr, true
7607}
7608
7609// AsEncodedTaskRunRequest is the BasicRunRequest implementation for TaskRunRequest.
7610func (trr TaskRunRequest) AsEncodedTaskRunRequest() (*EncodedTaskRunRequest, bool) {
7611	return nil, false
7612}
7613
7614// AsRunRequest is the BasicRunRequest implementation for TaskRunRequest.
7615func (trr TaskRunRequest) AsRunRequest() (*RunRequest, bool) {
7616	return nil, false
7617}
7618
7619// AsBasicRunRequest is the BasicRunRequest implementation for TaskRunRequest.
7620func (trr TaskRunRequest) AsBasicRunRequest() (BasicRunRequest, bool) {
7621	return &trr, true
7622}
7623
7624// TaskRunsCreateFuture an abstraction for monitoring and retrieving the results of a long-running
7625// operation.
7626type TaskRunsCreateFuture struct {
7627	azure.FutureAPI
7628	// Result returns the result of the asynchronous operation.
7629	// If the operation has not completed it will return an error.
7630	Result func(TaskRunsClient) (TaskRun, error)
7631}
7632
7633// UnmarshalJSON is the custom unmarshaller for CreateFuture.
7634func (future *TaskRunsCreateFuture) UnmarshalJSON(body []byte) error {
7635	var azFuture azure.Future
7636	if err := json.Unmarshal(body, &azFuture); err != nil {
7637		return err
7638	}
7639	future.FutureAPI = &azFuture
7640	future.Result = future.result
7641	return nil
7642}
7643
7644// result is the default implementation for TaskRunsCreateFuture.Result.
7645func (future *TaskRunsCreateFuture) result(client TaskRunsClient) (tr TaskRun, err error) {
7646	var done bool
7647	done, err = future.DoneWithContext(context.Background(), client)
7648	if err != nil {
7649		err = autorest.NewErrorWithError(err, "containerregistry.TaskRunsCreateFuture", "Result", future.Response(), "Polling failure")
7650		return
7651	}
7652	if !done {
7653		tr.Response.Response = future.Response()
7654		err = azure.NewAsyncOpIncompleteError("containerregistry.TaskRunsCreateFuture")
7655		return
7656	}
7657	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
7658	if tr.Response.Response, err = future.GetResult(sender); err == nil && tr.Response.Response.StatusCode != http.StatusNoContent {
7659		tr, err = client.CreateResponder(tr.Response.Response)
7660		if err != nil {
7661			err = autorest.NewErrorWithError(err, "containerregistry.TaskRunsCreateFuture", "Result", tr.Response.Response, "Failure responding to request")
7662		}
7663	}
7664	return
7665}
7666
7667// TaskRunsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
7668// operation.
7669type TaskRunsDeleteFuture struct {
7670	azure.FutureAPI
7671	// Result returns the result of the asynchronous operation.
7672	// If the operation has not completed it will return an error.
7673	Result func(TaskRunsClient) (autorest.Response, error)
7674}
7675
7676// UnmarshalJSON is the custom unmarshaller for CreateFuture.
7677func (future *TaskRunsDeleteFuture) UnmarshalJSON(body []byte) error {
7678	var azFuture azure.Future
7679	if err := json.Unmarshal(body, &azFuture); err != nil {
7680		return err
7681	}
7682	future.FutureAPI = &azFuture
7683	future.Result = future.result
7684	return nil
7685}
7686
7687// result is the default implementation for TaskRunsDeleteFuture.Result.
7688func (future *TaskRunsDeleteFuture) result(client TaskRunsClient) (ar autorest.Response, err error) {
7689	var done bool
7690	done, err = future.DoneWithContext(context.Background(), client)
7691	if err != nil {
7692		err = autorest.NewErrorWithError(err, "containerregistry.TaskRunsDeleteFuture", "Result", future.Response(), "Polling failure")
7693		return
7694	}
7695	if !done {
7696		ar.Response = future.Response()
7697		err = azure.NewAsyncOpIncompleteError("containerregistry.TaskRunsDeleteFuture")
7698		return
7699	}
7700	ar.Response = future.Response()
7701	return
7702}
7703
7704// TaskRunsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
7705// operation.
7706type TaskRunsUpdateFuture struct {
7707	azure.FutureAPI
7708	// Result returns the result of the asynchronous operation.
7709	// If the operation has not completed it will return an error.
7710	Result func(TaskRunsClient) (TaskRun, error)
7711}
7712
7713// UnmarshalJSON is the custom unmarshaller for CreateFuture.
7714func (future *TaskRunsUpdateFuture) UnmarshalJSON(body []byte) error {
7715	var azFuture azure.Future
7716	if err := json.Unmarshal(body, &azFuture); err != nil {
7717		return err
7718	}
7719	future.FutureAPI = &azFuture
7720	future.Result = future.result
7721	return nil
7722}
7723
7724// result is the default implementation for TaskRunsUpdateFuture.Result.
7725func (future *TaskRunsUpdateFuture) result(client TaskRunsClient) (tr TaskRun, err error) {
7726	var done bool
7727	done, err = future.DoneWithContext(context.Background(), client)
7728	if err != nil {
7729		err = autorest.NewErrorWithError(err, "containerregistry.TaskRunsUpdateFuture", "Result", future.Response(), "Polling failure")
7730		return
7731	}
7732	if !done {
7733		tr.Response.Response = future.Response()
7734		err = azure.NewAsyncOpIncompleteError("containerregistry.TaskRunsUpdateFuture")
7735		return
7736	}
7737	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
7738	if tr.Response.Response, err = future.GetResult(sender); err == nil && tr.Response.Response.StatusCode != http.StatusNoContent {
7739		tr, err = client.UpdateResponder(tr.Response.Response)
7740		if err != nil {
7741			err = autorest.NewErrorWithError(err, "containerregistry.TaskRunsUpdateFuture", "Result", tr.Response.Response, "Failure responding to request")
7742		}
7743	}
7744	return
7745}
7746
7747// TaskRunUpdateParameters the parameters for updating a task run.
7748type TaskRunUpdateParameters struct {
7749	// Identity - Identity for the resource.
7750	Identity *IdentityProperties `json:"identity,omitempty"`
7751	// TaskRunPropertiesUpdateParameters - The properties for updating a task run.
7752	*TaskRunPropertiesUpdateParameters `json:"properties,omitempty"`
7753	// Location - The location of the resource
7754	Location *string `json:"location,omitempty"`
7755	// Tags - The ARM resource tags.
7756	Tags map[string]*string `json:"tags"`
7757}
7758
7759// MarshalJSON is the custom marshaler for TaskRunUpdateParameters.
7760func (trup TaskRunUpdateParameters) MarshalJSON() ([]byte, error) {
7761	objectMap := make(map[string]interface{})
7762	if trup.Identity != nil {
7763		objectMap["identity"] = trup.Identity
7764	}
7765	if trup.TaskRunPropertiesUpdateParameters != nil {
7766		objectMap["properties"] = trup.TaskRunPropertiesUpdateParameters
7767	}
7768	if trup.Location != nil {
7769		objectMap["location"] = trup.Location
7770	}
7771	if trup.Tags != nil {
7772		objectMap["tags"] = trup.Tags
7773	}
7774	return json.Marshal(objectMap)
7775}
7776
7777// UnmarshalJSON is the custom unmarshaler for TaskRunUpdateParameters struct.
7778func (trup *TaskRunUpdateParameters) UnmarshalJSON(body []byte) error {
7779	var m map[string]*json.RawMessage
7780	err := json.Unmarshal(body, &m)
7781	if err != nil {
7782		return err
7783	}
7784	for k, v := range m {
7785		switch k {
7786		case "identity":
7787			if v != nil {
7788				var identity IdentityProperties
7789				err = json.Unmarshal(*v, &identity)
7790				if err != nil {
7791					return err
7792				}
7793				trup.Identity = &identity
7794			}
7795		case "properties":
7796			if v != nil {
7797				var taskRunPropertiesUpdateParameters TaskRunPropertiesUpdateParameters
7798				err = json.Unmarshal(*v, &taskRunPropertiesUpdateParameters)
7799				if err != nil {
7800					return err
7801				}
7802				trup.TaskRunPropertiesUpdateParameters = &taskRunPropertiesUpdateParameters
7803			}
7804		case "location":
7805			if v != nil {
7806				var location string
7807				err = json.Unmarshal(*v, &location)
7808				if err != nil {
7809					return err
7810				}
7811				trup.Location = &location
7812			}
7813		case "tags":
7814			if v != nil {
7815				var tags map[string]*string
7816				err = json.Unmarshal(*v, &tags)
7817				if err != nil {
7818					return err
7819				}
7820				trup.Tags = tags
7821			}
7822		}
7823	}
7824
7825	return nil
7826}
7827
7828// TasksCreateFuture an abstraction for monitoring and retrieving the results of a long-running operation.
7829type TasksCreateFuture struct {
7830	azure.FutureAPI
7831	// Result returns the result of the asynchronous operation.
7832	// If the operation has not completed it will return an error.
7833	Result func(TasksClient) (Task, error)
7834}
7835
7836// UnmarshalJSON is the custom unmarshaller for CreateFuture.
7837func (future *TasksCreateFuture) UnmarshalJSON(body []byte) error {
7838	var azFuture azure.Future
7839	if err := json.Unmarshal(body, &azFuture); err != nil {
7840		return err
7841	}
7842	future.FutureAPI = &azFuture
7843	future.Result = future.result
7844	return nil
7845}
7846
7847// result is the default implementation for TasksCreateFuture.Result.
7848func (future *TasksCreateFuture) result(client TasksClient) (t Task, err error) {
7849	var done bool
7850	done, err = future.DoneWithContext(context.Background(), client)
7851	if err != nil {
7852		err = autorest.NewErrorWithError(err, "containerregistry.TasksCreateFuture", "Result", future.Response(), "Polling failure")
7853		return
7854	}
7855	if !done {
7856		t.Response.Response = future.Response()
7857		err = azure.NewAsyncOpIncompleteError("containerregistry.TasksCreateFuture")
7858		return
7859	}
7860	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
7861	if t.Response.Response, err = future.GetResult(sender); err == nil && t.Response.Response.StatusCode != http.StatusNoContent {
7862		t, err = client.CreateResponder(t.Response.Response)
7863		if err != nil {
7864			err = autorest.NewErrorWithError(err, "containerregistry.TasksCreateFuture", "Result", t.Response.Response, "Failure responding to request")
7865		}
7866	}
7867	return
7868}
7869
7870// TasksDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation.
7871type TasksDeleteFuture struct {
7872	azure.FutureAPI
7873	// Result returns the result of the asynchronous operation.
7874	// If the operation has not completed it will return an error.
7875	Result func(TasksClient) (autorest.Response, error)
7876}
7877
7878// UnmarshalJSON is the custom unmarshaller for CreateFuture.
7879func (future *TasksDeleteFuture) UnmarshalJSON(body []byte) error {
7880	var azFuture azure.Future
7881	if err := json.Unmarshal(body, &azFuture); err != nil {
7882		return err
7883	}
7884	future.FutureAPI = &azFuture
7885	future.Result = future.result
7886	return nil
7887}
7888
7889// result is the default implementation for TasksDeleteFuture.Result.
7890func (future *TasksDeleteFuture) result(client TasksClient) (ar autorest.Response, err error) {
7891	var done bool
7892	done, err = future.DoneWithContext(context.Background(), client)
7893	if err != nil {
7894		err = autorest.NewErrorWithError(err, "containerregistry.TasksDeleteFuture", "Result", future.Response(), "Polling failure")
7895		return
7896	}
7897	if !done {
7898		ar.Response = future.Response()
7899		err = azure.NewAsyncOpIncompleteError("containerregistry.TasksDeleteFuture")
7900		return
7901	}
7902	ar.Response = future.Response()
7903	return
7904}
7905
7906// BasicTaskStepProperties base properties for any task step.
7907type BasicTaskStepProperties interface {
7908	AsDockerBuildStep() (*DockerBuildStep, bool)
7909	AsFileTaskStep() (*FileTaskStep, bool)
7910	AsEncodedTaskStep() (*EncodedTaskStep, bool)
7911	AsTaskStepProperties() (*TaskStepProperties, bool)
7912}
7913
7914// TaskStepProperties base properties for any task step.
7915type TaskStepProperties struct {
7916	// BaseImageDependencies - READ-ONLY; List of base image dependencies for a step.
7917	BaseImageDependencies *[]BaseImageDependency `json:"baseImageDependencies,omitempty"`
7918	// ContextPath - The URL(absolute or relative) of the source context for the task step.
7919	ContextPath *string `json:"contextPath,omitempty"`
7920	// ContextAccessToken - The token (git PAT or SAS token of storage account blob) associated with the context for a step.
7921	ContextAccessToken *string `json:"contextAccessToken,omitempty"`
7922	// Type - Possible values include: 'TypeTaskStepProperties', 'TypeDocker', 'TypeFileTask', 'TypeEncodedTask'
7923	Type TypeBasicTaskStepProperties `json:"type,omitempty"`
7924}
7925
7926func unmarshalBasicTaskStepProperties(body []byte) (BasicTaskStepProperties, error) {
7927	var m map[string]interface{}
7928	err := json.Unmarshal(body, &m)
7929	if err != nil {
7930		return nil, err
7931	}
7932
7933	switch m["type"] {
7934	case string(TypeDocker):
7935		var dbs DockerBuildStep
7936		err := json.Unmarshal(body, &dbs)
7937		return dbs, err
7938	case string(TypeFileTask):
7939		var fts FileTaskStep
7940		err := json.Unmarshal(body, &fts)
7941		return fts, err
7942	case string(TypeEncodedTask):
7943		var ets EncodedTaskStep
7944		err := json.Unmarshal(body, &ets)
7945		return ets, err
7946	default:
7947		var tsp TaskStepProperties
7948		err := json.Unmarshal(body, &tsp)
7949		return tsp, err
7950	}
7951}
7952func unmarshalBasicTaskStepPropertiesArray(body []byte) ([]BasicTaskStepProperties, error) {
7953	var rawMessages []*json.RawMessage
7954	err := json.Unmarshal(body, &rawMessages)
7955	if err != nil {
7956		return nil, err
7957	}
7958
7959	tspArray := make([]BasicTaskStepProperties, len(rawMessages))
7960
7961	for index, rawMessage := range rawMessages {
7962		tsp, err := unmarshalBasicTaskStepProperties(*rawMessage)
7963		if err != nil {
7964			return nil, err
7965		}
7966		tspArray[index] = tsp
7967	}
7968	return tspArray, nil
7969}
7970
7971// MarshalJSON is the custom marshaler for TaskStepProperties.
7972func (tsp TaskStepProperties) MarshalJSON() ([]byte, error) {
7973	tsp.Type = TypeTaskStepProperties
7974	objectMap := make(map[string]interface{})
7975	if tsp.ContextPath != nil {
7976		objectMap["contextPath"] = tsp.ContextPath
7977	}
7978	if tsp.ContextAccessToken != nil {
7979		objectMap["contextAccessToken"] = tsp.ContextAccessToken
7980	}
7981	if tsp.Type != "" {
7982		objectMap["type"] = tsp.Type
7983	}
7984	return json.Marshal(objectMap)
7985}
7986
7987// AsDockerBuildStep is the BasicTaskStepProperties implementation for TaskStepProperties.
7988func (tsp TaskStepProperties) AsDockerBuildStep() (*DockerBuildStep, bool) {
7989	return nil, false
7990}
7991
7992// AsFileTaskStep is the BasicTaskStepProperties implementation for TaskStepProperties.
7993func (tsp TaskStepProperties) AsFileTaskStep() (*FileTaskStep, bool) {
7994	return nil, false
7995}
7996
7997// AsEncodedTaskStep is the BasicTaskStepProperties implementation for TaskStepProperties.
7998func (tsp TaskStepProperties) AsEncodedTaskStep() (*EncodedTaskStep, bool) {
7999	return nil, false
8000}
8001
8002// AsTaskStepProperties is the BasicTaskStepProperties implementation for TaskStepProperties.
8003func (tsp TaskStepProperties) AsTaskStepProperties() (*TaskStepProperties, bool) {
8004	return &tsp, true
8005}
8006
8007// AsBasicTaskStepProperties is the BasicTaskStepProperties implementation for TaskStepProperties.
8008func (tsp TaskStepProperties) AsBasicTaskStepProperties() (BasicTaskStepProperties, bool) {
8009	return &tsp, true
8010}
8011
8012// BasicTaskStepUpdateParameters base properties for updating any task step.
8013type BasicTaskStepUpdateParameters interface {
8014	AsDockerBuildStepUpdateParameters() (*DockerBuildStepUpdateParameters, bool)
8015	AsFileTaskStepUpdateParameters() (*FileTaskStepUpdateParameters, bool)
8016	AsEncodedTaskStepUpdateParameters() (*EncodedTaskStepUpdateParameters, bool)
8017	AsTaskStepUpdateParameters() (*TaskStepUpdateParameters, bool)
8018}
8019
8020// TaskStepUpdateParameters base properties for updating any task step.
8021type TaskStepUpdateParameters struct {
8022	// ContextPath - The URL(absolute or relative) of the source context for the task step.
8023	ContextPath *string `json:"contextPath,omitempty"`
8024	// ContextAccessToken - The token (git PAT or SAS token of storage account blob) associated with the context for a step.
8025	ContextAccessToken *string `json:"contextAccessToken,omitempty"`
8026	// Type - Possible values include: 'TypeBasicTaskStepUpdateParametersTypeTaskStepUpdateParameters', 'TypeBasicTaskStepUpdateParametersTypeDocker', 'TypeBasicTaskStepUpdateParametersTypeFileTask', 'TypeBasicTaskStepUpdateParametersTypeEncodedTask'
8027	Type TypeBasicTaskStepUpdateParameters `json:"type,omitempty"`
8028}
8029
8030func unmarshalBasicTaskStepUpdateParameters(body []byte) (BasicTaskStepUpdateParameters, error) {
8031	var m map[string]interface{}
8032	err := json.Unmarshal(body, &m)
8033	if err != nil {
8034		return nil, err
8035	}
8036
8037	switch m["type"] {
8038	case string(TypeBasicTaskStepUpdateParametersTypeDocker):
8039		var dbsup DockerBuildStepUpdateParameters
8040		err := json.Unmarshal(body, &dbsup)
8041		return dbsup, err
8042	case string(TypeBasicTaskStepUpdateParametersTypeFileTask):
8043		var ftsup FileTaskStepUpdateParameters
8044		err := json.Unmarshal(body, &ftsup)
8045		return ftsup, err
8046	case string(TypeBasicTaskStepUpdateParametersTypeEncodedTask):
8047		var etsup EncodedTaskStepUpdateParameters
8048		err := json.Unmarshal(body, &etsup)
8049		return etsup, err
8050	default:
8051		var tsup TaskStepUpdateParameters
8052		err := json.Unmarshal(body, &tsup)
8053		return tsup, err
8054	}
8055}
8056func unmarshalBasicTaskStepUpdateParametersArray(body []byte) ([]BasicTaskStepUpdateParameters, error) {
8057	var rawMessages []*json.RawMessage
8058	err := json.Unmarshal(body, &rawMessages)
8059	if err != nil {
8060		return nil, err
8061	}
8062
8063	tsupArray := make([]BasicTaskStepUpdateParameters, len(rawMessages))
8064
8065	for index, rawMessage := range rawMessages {
8066		tsup, err := unmarshalBasicTaskStepUpdateParameters(*rawMessage)
8067		if err != nil {
8068			return nil, err
8069		}
8070		tsupArray[index] = tsup
8071	}
8072	return tsupArray, nil
8073}
8074
8075// MarshalJSON is the custom marshaler for TaskStepUpdateParameters.
8076func (tsup TaskStepUpdateParameters) MarshalJSON() ([]byte, error) {
8077	tsup.Type = TypeBasicTaskStepUpdateParametersTypeTaskStepUpdateParameters
8078	objectMap := make(map[string]interface{})
8079	if tsup.ContextPath != nil {
8080		objectMap["contextPath"] = tsup.ContextPath
8081	}
8082	if tsup.ContextAccessToken != nil {
8083		objectMap["contextAccessToken"] = tsup.ContextAccessToken
8084	}
8085	if tsup.Type != "" {
8086		objectMap["type"] = tsup.Type
8087	}
8088	return json.Marshal(objectMap)
8089}
8090
8091// AsDockerBuildStepUpdateParameters is the BasicTaskStepUpdateParameters implementation for TaskStepUpdateParameters.
8092func (tsup TaskStepUpdateParameters) AsDockerBuildStepUpdateParameters() (*DockerBuildStepUpdateParameters, bool) {
8093	return nil, false
8094}
8095
8096// AsFileTaskStepUpdateParameters is the BasicTaskStepUpdateParameters implementation for TaskStepUpdateParameters.
8097func (tsup TaskStepUpdateParameters) AsFileTaskStepUpdateParameters() (*FileTaskStepUpdateParameters, bool) {
8098	return nil, false
8099}
8100
8101// AsEncodedTaskStepUpdateParameters is the BasicTaskStepUpdateParameters implementation for TaskStepUpdateParameters.
8102func (tsup TaskStepUpdateParameters) AsEncodedTaskStepUpdateParameters() (*EncodedTaskStepUpdateParameters, bool) {
8103	return nil, false
8104}
8105
8106// AsTaskStepUpdateParameters is the BasicTaskStepUpdateParameters implementation for TaskStepUpdateParameters.
8107func (tsup TaskStepUpdateParameters) AsTaskStepUpdateParameters() (*TaskStepUpdateParameters, bool) {
8108	return &tsup, true
8109}
8110
8111// AsBasicTaskStepUpdateParameters is the BasicTaskStepUpdateParameters implementation for TaskStepUpdateParameters.
8112func (tsup TaskStepUpdateParameters) AsBasicTaskStepUpdateParameters() (BasicTaskStepUpdateParameters, bool) {
8113	return &tsup, true
8114}
8115
8116// TasksUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation.
8117type TasksUpdateFuture struct {
8118	azure.FutureAPI
8119	// Result returns the result of the asynchronous operation.
8120	// If the operation has not completed it will return an error.
8121	Result func(TasksClient) (Task, error)
8122}
8123
8124// UnmarshalJSON is the custom unmarshaller for CreateFuture.
8125func (future *TasksUpdateFuture) UnmarshalJSON(body []byte) error {
8126	var azFuture azure.Future
8127	if err := json.Unmarshal(body, &azFuture); err != nil {
8128		return err
8129	}
8130	future.FutureAPI = &azFuture
8131	future.Result = future.result
8132	return nil
8133}
8134
8135// result is the default implementation for TasksUpdateFuture.Result.
8136func (future *TasksUpdateFuture) result(client TasksClient) (t Task, err error) {
8137	var done bool
8138	done, err = future.DoneWithContext(context.Background(), client)
8139	if err != nil {
8140		err = autorest.NewErrorWithError(err, "containerregistry.TasksUpdateFuture", "Result", future.Response(), "Polling failure")
8141		return
8142	}
8143	if !done {
8144		t.Response.Response = future.Response()
8145		err = azure.NewAsyncOpIncompleteError("containerregistry.TasksUpdateFuture")
8146		return
8147	}
8148	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
8149	if t.Response.Response, err = future.GetResult(sender); err == nil && t.Response.Response.StatusCode != http.StatusNoContent {
8150		t, err = client.UpdateResponder(t.Response.Response)
8151		if err != nil {
8152			err = autorest.NewErrorWithError(err, "containerregistry.TasksUpdateFuture", "Result", t.Response.Response, "Failure responding to request")
8153		}
8154	}
8155	return
8156}
8157
8158// TaskUpdateParameters the parameters for updating a task.
8159type TaskUpdateParameters struct {
8160	// Identity - Identity for the resource.
8161	Identity *IdentityProperties `json:"identity,omitempty"`
8162	// TaskPropertiesUpdateParameters - The properties for updating a task.
8163	*TaskPropertiesUpdateParameters `json:"properties,omitempty"`
8164	// Tags - The ARM resource tags.
8165	Tags map[string]*string `json:"tags"`
8166}
8167
8168// MarshalJSON is the custom marshaler for TaskUpdateParameters.
8169func (tup TaskUpdateParameters) MarshalJSON() ([]byte, error) {
8170	objectMap := make(map[string]interface{})
8171	if tup.Identity != nil {
8172		objectMap["identity"] = tup.Identity
8173	}
8174	if tup.TaskPropertiesUpdateParameters != nil {
8175		objectMap["properties"] = tup.TaskPropertiesUpdateParameters
8176	}
8177	if tup.Tags != nil {
8178		objectMap["tags"] = tup.Tags
8179	}
8180	return json.Marshal(objectMap)
8181}
8182
8183// UnmarshalJSON is the custom unmarshaler for TaskUpdateParameters struct.
8184func (tup *TaskUpdateParameters) UnmarshalJSON(body []byte) error {
8185	var m map[string]*json.RawMessage
8186	err := json.Unmarshal(body, &m)
8187	if err != nil {
8188		return err
8189	}
8190	for k, v := range m {
8191		switch k {
8192		case "identity":
8193			if v != nil {
8194				var identity IdentityProperties
8195				err = json.Unmarshal(*v, &identity)
8196				if err != nil {
8197					return err
8198				}
8199				tup.Identity = &identity
8200			}
8201		case "properties":
8202			if v != nil {
8203				var taskPropertiesUpdateParameters TaskPropertiesUpdateParameters
8204				err = json.Unmarshal(*v, &taskPropertiesUpdateParameters)
8205				if err != nil {
8206					return err
8207				}
8208				tup.TaskPropertiesUpdateParameters = &taskPropertiesUpdateParameters
8209			}
8210		case "tags":
8211			if v != nil {
8212				var tags map[string]*string
8213				err = json.Unmarshal(*v, &tags)
8214				if err != nil {
8215					return err
8216				}
8217				tup.Tags = tags
8218			}
8219		}
8220	}
8221
8222	return nil
8223}
8224
8225// TimerTrigger the properties of a timer trigger.
8226type TimerTrigger struct {
8227	// Schedule - The CRON expression for the task schedule
8228	Schedule *string `json:"schedule,omitempty"`
8229	// Status - The current status of trigger. Possible values include: 'TriggerStatusEnabled', 'TriggerStatusDisabled'
8230	Status TriggerStatus `json:"status,omitempty"`
8231	// Name - The name of the trigger.
8232	Name *string `json:"name,omitempty"`
8233}
8234
8235// TimerTriggerDescriptor ...
8236type TimerTriggerDescriptor struct {
8237	// TimerTriggerName - The timer trigger name that caused the run.
8238	TimerTriggerName *string `json:"timerTriggerName,omitempty"`
8239	// ScheduleOccurrence - The occurrence that triggered the run.
8240	ScheduleOccurrence *string `json:"scheduleOccurrence,omitempty"`
8241}
8242
8243// TimerTriggerUpdateParameters the properties for updating a timer trigger.
8244type TimerTriggerUpdateParameters struct {
8245	// Schedule - The CRON expression for the task schedule
8246	Schedule *string `json:"schedule,omitempty"`
8247	// Status - The current status of trigger. Possible values include: 'TriggerStatusEnabled', 'TriggerStatusDisabled'
8248	Status TriggerStatus `json:"status,omitempty"`
8249	// Name - The name of the trigger.
8250	Name *string `json:"name,omitempty"`
8251}
8252
8253// Token an object that represents a token for a container registry.
8254type Token struct {
8255	autorest.Response `json:"-"`
8256	// TokenProperties - The properties of the token.
8257	*TokenProperties `json:"properties,omitempty"`
8258	// ID - READ-ONLY; The resource ID.
8259	ID *string `json:"id,omitempty"`
8260	// Name - READ-ONLY; The name of the resource.
8261	Name *string `json:"name,omitempty"`
8262	// Type - READ-ONLY; The type of the resource.
8263	Type *string `json:"type,omitempty"`
8264	// SystemData - READ-ONLY; Metadata pertaining to creation and last modification of the resource.
8265	SystemData *SystemData `json:"systemData,omitempty"`
8266}
8267
8268// MarshalJSON is the custom marshaler for Token.
8269func (t Token) MarshalJSON() ([]byte, error) {
8270	objectMap := make(map[string]interface{})
8271	if t.TokenProperties != nil {
8272		objectMap["properties"] = t.TokenProperties
8273	}
8274	return json.Marshal(objectMap)
8275}
8276
8277// UnmarshalJSON is the custom unmarshaler for Token struct.
8278func (t *Token) UnmarshalJSON(body []byte) error {
8279	var m map[string]*json.RawMessage
8280	err := json.Unmarshal(body, &m)
8281	if err != nil {
8282		return err
8283	}
8284	for k, v := range m {
8285		switch k {
8286		case "properties":
8287			if v != nil {
8288				var tokenProperties TokenProperties
8289				err = json.Unmarshal(*v, &tokenProperties)
8290				if err != nil {
8291					return err
8292				}
8293				t.TokenProperties = &tokenProperties
8294			}
8295		case "id":
8296			if v != nil {
8297				var ID string
8298				err = json.Unmarshal(*v, &ID)
8299				if err != nil {
8300					return err
8301				}
8302				t.ID = &ID
8303			}
8304		case "name":
8305			if v != nil {
8306				var name string
8307				err = json.Unmarshal(*v, &name)
8308				if err != nil {
8309					return err
8310				}
8311				t.Name = &name
8312			}
8313		case "type":
8314			if v != nil {
8315				var typeVar string
8316				err = json.Unmarshal(*v, &typeVar)
8317				if err != nil {
8318					return err
8319				}
8320				t.Type = &typeVar
8321			}
8322		case "systemData":
8323			if v != nil {
8324				var systemData SystemData
8325				err = json.Unmarshal(*v, &systemData)
8326				if err != nil {
8327					return err
8328				}
8329				t.SystemData = &systemData
8330			}
8331		}
8332	}
8333
8334	return nil
8335}
8336
8337// TokenCertificate the properties of a certificate used for authenticating a token.
8338type TokenCertificate struct {
8339	// Name - Possible values include: 'Certificate1', 'Certificate2'
8340	Name TokenCertificateName `json:"name,omitempty"`
8341	// Expiry - The expiry datetime of the certificate.
8342	Expiry *date.Time `json:"expiry,omitempty"`
8343	// Thumbprint - The thumbprint of the certificate.
8344	Thumbprint *string `json:"thumbprint,omitempty"`
8345	// EncodedPemCertificate - Base 64 encoded string of the public certificate1 in PEM format that will be used for authenticating the token.
8346	EncodedPemCertificate *string `json:"encodedPemCertificate,omitempty"`
8347}
8348
8349// TokenCredentialsProperties the properties of the credentials that can be used for authenticating the
8350// token.
8351type TokenCredentialsProperties struct {
8352	ActiveDirectoryObject *ActiveDirectoryObject `json:"activeDirectoryObject,omitempty"`
8353	Certificates          *[]TokenCertificate    `json:"certificates,omitempty"`
8354	Passwords             *[]TokenPassword       `json:"passwords,omitempty"`
8355}
8356
8357// TokenListResult the result of a request to list tokens for a container registry.
8358type TokenListResult struct {
8359	autorest.Response `json:"-"`
8360	// Value - The list of tokens. Since this list may be incomplete, the nextLink field should be used to request the next list of tokens.
8361	Value *[]Token `json:"value,omitempty"`
8362	// NextLink - The URI that can be used to request the next list of tokens.
8363	NextLink *string `json:"nextLink,omitempty"`
8364}
8365
8366// TokenListResultIterator provides access to a complete listing of Token values.
8367type TokenListResultIterator struct {
8368	i    int
8369	page TokenListResultPage
8370}
8371
8372// NextWithContext advances to the next value.  If there was an error making
8373// the request the iterator does not advance and the error is returned.
8374func (iter *TokenListResultIterator) NextWithContext(ctx context.Context) (err error) {
8375	if tracing.IsEnabled() {
8376		ctx = tracing.StartSpan(ctx, fqdn+"/TokenListResultIterator.NextWithContext")
8377		defer func() {
8378			sc := -1
8379			if iter.Response().Response.Response != nil {
8380				sc = iter.Response().Response.Response.StatusCode
8381			}
8382			tracing.EndSpan(ctx, sc, err)
8383		}()
8384	}
8385	iter.i++
8386	if iter.i < len(iter.page.Values()) {
8387		return nil
8388	}
8389	err = iter.page.NextWithContext(ctx)
8390	if err != nil {
8391		iter.i--
8392		return err
8393	}
8394	iter.i = 0
8395	return nil
8396}
8397
8398// Next advances to the next value.  If there was an error making
8399// the request the iterator does not advance and the error is returned.
8400// Deprecated: Use NextWithContext() instead.
8401func (iter *TokenListResultIterator) Next() error {
8402	return iter.NextWithContext(context.Background())
8403}
8404
8405// NotDone returns true if the enumeration should be started or is not yet complete.
8406func (iter TokenListResultIterator) NotDone() bool {
8407	return iter.page.NotDone() && iter.i < len(iter.page.Values())
8408}
8409
8410// Response returns the raw server response from the last page request.
8411func (iter TokenListResultIterator) Response() TokenListResult {
8412	return iter.page.Response()
8413}
8414
8415// Value returns the current value or a zero-initialized value if the
8416// iterator has advanced beyond the end of the collection.
8417func (iter TokenListResultIterator) Value() Token {
8418	if !iter.page.NotDone() {
8419		return Token{}
8420	}
8421	return iter.page.Values()[iter.i]
8422}
8423
8424// Creates a new instance of the TokenListResultIterator type.
8425func NewTokenListResultIterator(page TokenListResultPage) TokenListResultIterator {
8426	return TokenListResultIterator{page: page}
8427}
8428
8429// IsEmpty returns true if the ListResult contains no values.
8430func (tlr TokenListResult) IsEmpty() bool {
8431	return tlr.Value == nil || len(*tlr.Value) == 0
8432}
8433
8434// hasNextLink returns true if the NextLink is not empty.
8435func (tlr TokenListResult) hasNextLink() bool {
8436	return tlr.NextLink != nil && len(*tlr.NextLink) != 0
8437}
8438
8439// tokenListResultPreparer prepares a request to retrieve the next set of results.
8440// It returns nil if no more results exist.
8441func (tlr TokenListResult) tokenListResultPreparer(ctx context.Context) (*http.Request, error) {
8442	if !tlr.hasNextLink() {
8443		return nil, nil
8444	}
8445	return autorest.Prepare((&http.Request{}).WithContext(ctx),
8446		autorest.AsJSON(),
8447		autorest.AsGet(),
8448		autorest.WithBaseURL(to.String(tlr.NextLink)))
8449}
8450
8451// TokenListResultPage contains a page of Token values.
8452type TokenListResultPage struct {
8453	fn  func(context.Context, TokenListResult) (TokenListResult, error)
8454	tlr TokenListResult
8455}
8456
8457// NextWithContext advances to the next page of values.  If there was an error making
8458// the request the page does not advance and the error is returned.
8459func (page *TokenListResultPage) NextWithContext(ctx context.Context) (err error) {
8460	if tracing.IsEnabled() {
8461		ctx = tracing.StartSpan(ctx, fqdn+"/TokenListResultPage.NextWithContext")
8462		defer func() {
8463			sc := -1
8464			if page.Response().Response.Response != nil {
8465				sc = page.Response().Response.Response.StatusCode
8466			}
8467			tracing.EndSpan(ctx, sc, err)
8468		}()
8469	}
8470	for {
8471		next, err := page.fn(ctx, page.tlr)
8472		if err != nil {
8473			return err
8474		}
8475		page.tlr = next
8476		if !next.hasNextLink() || !next.IsEmpty() {
8477			break
8478		}
8479	}
8480	return nil
8481}
8482
8483// Next advances to the next page of values.  If there was an error making
8484// the request the page does not advance and the error is returned.
8485// Deprecated: Use NextWithContext() instead.
8486func (page *TokenListResultPage) Next() error {
8487	return page.NextWithContext(context.Background())
8488}
8489
8490// NotDone returns true if the page enumeration should be started or is not yet complete.
8491func (page TokenListResultPage) NotDone() bool {
8492	return !page.tlr.IsEmpty()
8493}
8494
8495// Response returns the raw server response from the last page request.
8496func (page TokenListResultPage) Response() TokenListResult {
8497	return page.tlr
8498}
8499
8500// Values returns the slice of values for the current page or nil if there are no values.
8501func (page TokenListResultPage) Values() []Token {
8502	if page.tlr.IsEmpty() {
8503		return nil
8504	}
8505	return *page.tlr.Value
8506}
8507
8508// Creates a new instance of the TokenListResultPage type.
8509func NewTokenListResultPage(cur TokenListResult, getNextPage func(context.Context, TokenListResult) (TokenListResult, error)) TokenListResultPage {
8510	return TokenListResultPage{
8511		fn:  getNextPage,
8512		tlr: cur,
8513	}
8514}
8515
8516// TokenPassword the password that will be used for authenticating the token of a container registry.
8517type TokenPassword struct {
8518	// CreationTime - The creation datetime of the password.
8519	CreationTime *date.Time `json:"creationTime,omitempty"`
8520	// Expiry - The expiry datetime of the password.
8521	Expiry *date.Time `json:"expiry,omitempty"`
8522	// Name - The password name "password1" or "password2". Possible values include: 'TokenPasswordNamePassword1', 'TokenPasswordNamePassword2'
8523	Name TokenPasswordName `json:"name,omitempty"`
8524	// Value - READ-ONLY; The password value.
8525	Value *string `json:"value,omitempty"`
8526}
8527
8528// MarshalJSON is the custom marshaler for TokenPassword.
8529func (tp TokenPassword) MarshalJSON() ([]byte, error) {
8530	objectMap := make(map[string]interface{})
8531	if tp.CreationTime != nil {
8532		objectMap["creationTime"] = tp.CreationTime
8533	}
8534	if tp.Expiry != nil {
8535		objectMap["expiry"] = tp.Expiry
8536	}
8537	if tp.Name != "" {
8538		objectMap["name"] = tp.Name
8539	}
8540	return json.Marshal(objectMap)
8541}
8542
8543// TokenProperties the properties of a token.
8544type TokenProperties struct {
8545	// CreationDate - READ-ONLY; The creation date of scope map.
8546	CreationDate *date.Time `json:"creationDate,omitempty"`
8547	// ProvisioningState - READ-ONLY; Provisioning state of the resource. Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', 'Canceled'
8548	ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
8549	// ScopeMapID - The resource ID of the scope map to which the token will be associated with.
8550	ScopeMapID *string `json:"scopeMapId,omitempty"`
8551	// Credentials - The credentials that can be used for authenticating the token.
8552	Credentials *TokenCredentialsProperties `json:"credentials,omitempty"`
8553	// Status - The status of the token example enabled or disabled. Possible values include: 'TokenStatusEnabled', 'TokenStatusDisabled'
8554	Status TokenStatus `json:"status,omitempty"`
8555}
8556
8557// MarshalJSON is the custom marshaler for TokenProperties.
8558func (tp TokenProperties) MarshalJSON() ([]byte, error) {
8559	objectMap := make(map[string]interface{})
8560	if tp.ScopeMapID != nil {
8561		objectMap["scopeMapId"] = tp.ScopeMapID
8562	}
8563	if tp.Credentials != nil {
8564		objectMap["credentials"] = tp.Credentials
8565	}
8566	if tp.Status != "" {
8567		objectMap["status"] = tp.Status
8568	}
8569	return json.Marshal(objectMap)
8570}
8571
8572// TokensCreateFuture an abstraction for monitoring and retrieving the results of a long-running operation.
8573type TokensCreateFuture struct {
8574	azure.FutureAPI
8575	// Result returns the result of the asynchronous operation.
8576	// If the operation has not completed it will return an error.
8577	Result func(TokensClient) (Token, error)
8578}
8579
8580// UnmarshalJSON is the custom unmarshaller for CreateFuture.
8581func (future *TokensCreateFuture) UnmarshalJSON(body []byte) error {
8582	var azFuture azure.Future
8583	if err := json.Unmarshal(body, &azFuture); err != nil {
8584		return err
8585	}
8586	future.FutureAPI = &azFuture
8587	future.Result = future.result
8588	return nil
8589}
8590
8591// result is the default implementation for TokensCreateFuture.Result.
8592func (future *TokensCreateFuture) result(client TokensClient) (t Token, err error) {
8593	var done bool
8594	done, err = future.DoneWithContext(context.Background(), client)
8595	if err != nil {
8596		err = autorest.NewErrorWithError(err, "containerregistry.TokensCreateFuture", "Result", future.Response(), "Polling failure")
8597		return
8598	}
8599	if !done {
8600		t.Response.Response = future.Response()
8601		err = azure.NewAsyncOpIncompleteError("containerregistry.TokensCreateFuture")
8602		return
8603	}
8604	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
8605	if t.Response.Response, err = future.GetResult(sender); err == nil && t.Response.Response.StatusCode != http.StatusNoContent {
8606		t, err = client.CreateResponder(t.Response.Response)
8607		if err != nil {
8608			err = autorest.NewErrorWithError(err, "containerregistry.TokensCreateFuture", "Result", t.Response.Response, "Failure responding to request")
8609		}
8610	}
8611	return
8612}
8613
8614// TokensDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation.
8615type TokensDeleteFuture struct {
8616	azure.FutureAPI
8617	// Result returns the result of the asynchronous operation.
8618	// If the operation has not completed it will return an error.
8619	Result func(TokensClient) (autorest.Response, error)
8620}
8621
8622// UnmarshalJSON is the custom unmarshaller for CreateFuture.
8623func (future *TokensDeleteFuture) UnmarshalJSON(body []byte) error {
8624	var azFuture azure.Future
8625	if err := json.Unmarshal(body, &azFuture); err != nil {
8626		return err
8627	}
8628	future.FutureAPI = &azFuture
8629	future.Result = future.result
8630	return nil
8631}
8632
8633// result is the default implementation for TokensDeleteFuture.Result.
8634func (future *TokensDeleteFuture) result(client TokensClient) (ar autorest.Response, err error) {
8635	var done bool
8636	done, err = future.DoneWithContext(context.Background(), client)
8637	if err != nil {
8638		err = autorest.NewErrorWithError(err, "containerregistry.TokensDeleteFuture", "Result", future.Response(), "Polling failure")
8639		return
8640	}
8641	if !done {
8642		ar.Response = future.Response()
8643		err = azure.NewAsyncOpIncompleteError("containerregistry.TokensDeleteFuture")
8644		return
8645	}
8646	ar.Response = future.Response()
8647	return
8648}
8649
8650// TokensUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation.
8651type TokensUpdateFuture struct {
8652	azure.FutureAPI
8653	// Result returns the result of the asynchronous operation.
8654	// If the operation has not completed it will return an error.
8655	Result func(TokensClient) (Token, error)
8656}
8657
8658// UnmarshalJSON is the custom unmarshaller for CreateFuture.
8659func (future *TokensUpdateFuture) UnmarshalJSON(body []byte) error {
8660	var azFuture azure.Future
8661	if err := json.Unmarshal(body, &azFuture); err != nil {
8662		return err
8663	}
8664	future.FutureAPI = &azFuture
8665	future.Result = future.result
8666	return nil
8667}
8668
8669// result is the default implementation for TokensUpdateFuture.Result.
8670func (future *TokensUpdateFuture) result(client TokensClient) (t Token, err error) {
8671	var done bool
8672	done, err = future.DoneWithContext(context.Background(), client)
8673	if err != nil {
8674		err = autorest.NewErrorWithError(err, "containerregistry.TokensUpdateFuture", "Result", future.Response(), "Polling failure")
8675		return
8676	}
8677	if !done {
8678		t.Response.Response = future.Response()
8679		err = azure.NewAsyncOpIncompleteError("containerregistry.TokensUpdateFuture")
8680		return
8681	}
8682	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
8683	if t.Response.Response, err = future.GetResult(sender); err == nil && t.Response.Response.StatusCode != http.StatusNoContent {
8684		t, err = client.UpdateResponder(t.Response.Response)
8685		if err != nil {
8686			err = autorest.NewErrorWithError(err, "containerregistry.TokensUpdateFuture", "Result", t.Response.Response, "Failure responding to request")
8687		}
8688	}
8689	return
8690}
8691
8692// TokenUpdateParameters the parameters for updating a token.
8693type TokenUpdateParameters struct {
8694	// TokenUpdateProperties - The properties of the token update parameters.
8695	*TokenUpdateProperties `json:"properties,omitempty"`
8696}
8697
8698// MarshalJSON is the custom marshaler for TokenUpdateParameters.
8699func (tup TokenUpdateParameters) MarshalJSON() ([]byte, error) {
8700	objectMap := make(map[string]interface{})
8701	if tup.TokenUpdateProperties != nil {
8702		objectMap["properties"] = tup.TokenUpdateProperties
8703	}
8704	return json.Marshal(objectMap)
8705}
8706
8707// UnmarshalJSON is the custom unmarshaler for TokenUpdateParameters struct.
8708func (tup *TokenUpdateParameters) UnmarshalJSON(body []byte) error {
8709	var m map[string]*json.RawMessage
8710	err := json.Unmarshal(body, &m)
8711	if err != nil {
8712		return err
8713	}
8714	for k, v := range m {
8715		switch k {
8716		case "properties":
8717			if v != nil {
8718				var tokenUpdateProperties TokenUpdateProperties
8719				err = json.Unmarshal(*v, &tokenUpdateProperties)
8720				if err != nil {
8721					return err
8722				}
8723				tup.TokenUpdateProperties = &tokenUpdateProperties
8724			}
8725		}
8726	}
8727
8728	return nil
8729}
8730
8731// TokenUpdateProperties the parameters for updating token properties.
8732type TokenUpdateProperties struct {
8733	// ScopeMapID - The resource ID of the scope map to which the token will be associated with.
8734	ScopeMapID *string `json:"scopeMapId,omitempty"`
8735	// Status - The status of the token example enabled or disabled. Possible values include: 'TokenStatusEnabled', 'TokenStatusDisabled'
8736	Status TokenStatus `json:"status,omitempty"`
8737	// Credentials - The credentials that can be used for authenticating the token.
8738	Credentials *TokenCredentialsProperties `json:"credentials,omitempty"`
8739}
8740
8741// TriggerProperties the properties of a trigger.
8742type TriggerProperties struct {
8743	// TimerTriggers - The collection of timer triggers.
8744	TimerTriggers *[]TimerTrigger `json:"timerTriggers,omitempty"`
8745	// SourceTriggers - The collection of triggers based on source code repository.
8746	SourceTriggers *[]SourceTrigger `json:"sourceTriggers,omitempty"`
8747	// BaseImageTrigger - The trigger based on base image dependencies.
8748	BaseImageTrigger *BaseImageTrigger `json:"baseImageTrigger,omitempty"`
8749}
8750
8751// TriggerUpdateParameters the properties for updating triggers.
8752type TriggerUpdateParameters struct {
8753	// TimerTriggers - The collection of timer triggers.
8754	TimerTriggers *[]TimerTriggerUpdateParameters `json:"timerTriggers,omitempty"`
8755	// SourceTriggers - The collection of triggers based on source code repository.
8756	SourceTriggers *[]SourceTriggerUpdateParameters `json:"sourceTriggers,omitempty"`
8757	// BaseImageTrigger - The trigger based on base image dependencies.
8758	BaseImageTrigger *BaseImageTriggerUpdateParameters `json:"baseImageTrigger,omitempty"`
8759}
8760
8761// TrustPolicy the content trust policy for a container registry.
8762type TrustPolicy struct {
8763	// Type - The type of trust policy. Possible values include: 'Notary'
8764	Type TrustPolicyType `json:"type,omitempty"`
8765	// Status - The value that indicates whether the policy is enabled or not. Possible values include: 'PolicyStatusEnabled', 'PolicyStatusDisabled'
8766	Status PolicyStatus `json:"status,omitempty"`
8767}
8768
8769// UserIdentityProperties ...
8770type UserIdentityProperties struct {
8771	// PrincipalID - The principal id of user assigned identity.
8772	PrincipalID *string `json:"principalId,omitempty"`
8773	// ClientID - The client id of user assigned identity.
8774	ClientID *string `json:"clientId,omitempty"`
8775}
8776
8777// VirtualNetworkRule virtual network rule.
8778type VirtualNetworkRule struct {
8779	// Action - The action of virtual network rule. Possible values include: 'Allow'
8780	Action Action `json:"action,omitempty"`
8781	// VirtualNetworkResourceID - Resource ID of a subnet, for example: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}.
8782	VirtualNetworkResourceID *string `json:"id,omitempty"`
8783}
8784
8785// Webhook an object that represents a webhook for a container registry.
8786type Webhook struct {
8787	autorest.Response `json:"-"`
8788	// WebhookProperties - The properties of the webhook.
8789	*WebhookProperties `json:"properties,omitempty"`
8790	// ID - READ-ONLY; The resource ID.
8791	ID *string `json:"id,omitempty"`
8792	// Name - READ-ONLY; The name of the resource.
8793	Name *string `json:"name,omitempty"`
8794	// Type - READ-ONLY; The type of the resource.
8795	Type *string `json:"type,omitempty"`
8796	// Location - The location of the resource. This cannot be changed after the resource is created.
8797	Location *string `json:"location,omitempty"`
8798	// Tags - The tags of the resource.
8799	Tags map[string]*string `json:"tags"`
8800	// SystemData - READ-ONLY; Metadata pertaining to creation and last modification of the resource.
8801	SystemData *SystemData `json:"systemData,omitempty"`
8802}
8803
8804// MarshalJSON is the custom marshaler for Webhook.
8805func (w Webhook) MarshalJSON() ([]byte, error) {
8806	objectMap := make(map[string]interface{})
8807	if w.WebhookProperties != nil {
8808		objectMap["properties"] = w.WebhookProperties
8809	}
8810	if w.Location != nil {
8811		objectMap["location"] = w.Location
8812	}
8813	if w.Tags != nil {
8814		objectMap["tags"] = w.Tags
8815	}
8816	return json.Marshal(objectMap)
8817}
8818
8819// UnmarshalJSON is the custom unmarshaler for Webhook struct.
8820func (w *Webhook) UnmarshalJSON(body []byte) error {
8821	var m map[string]*json.RawMessage
8822	err := json.Unmarshal(body, &m)
8823	if err != nil {
8824		return err
8825	}
8826	for k, v := range m {
8827		switch k {
8828		case "properties":
8829			if v != nil {
8830				var webhookProperties WebhookProperties
8831				err = json.Unmarshal(*v, &webhookProperties)
8832				if err != nil {
8833					return err
8834				}
8835				w.WebhookProperties = &webhookProperties
8836			}
8837		case "id":
8838			if v != nil {
8839				var ID string
8840				err = json.Unmarshal(*v, &ID)
8841				if err != nil {
8842					return err
8843				}
8844				w.ID = &ID
8845			}
8846		case "name":
8847			if v != nil {
8848				var name string
8849				err = json.Unmarshal(*v, &name)
8850				if err != nil {
8851					return err
8852				}
8853				w.Name = &name
8854			}
8855		case "type":
8856			if v != nil {
8857				var typeVar string
8858				err = json.Unmarshal(*v, &typeVar)
8859				if err != nil {
8860					return err
8861				}
8862				w.Type = &typeVar
8863			}
8864		case "location":
8865			if v != nil {
8866				var location string
8867				err = json.Unmarshal(*v, &location)
8868				if err != nil {
8869					return err
8870				}
8871				w.Location = &location
8872			}
8873		case "tags":
8874			if v != nil {
8875				var tags map[string]*string
8876				err = json.Unmarshal(*v, &tags)
8877				if err != nil {
8878					return err
8879				}
8880				w.Tags = tags
8881			}
8882		case "systemData":
8883			if v != nil {
8884				var systemData SystemData
8885				err = json.Unmarshal(*v, &systemData)
8886				if err != nil {
8887					return err
8888				}
8889				w.SystemData = &systemData
8890			}
8891		}
8892	}
8893
8894	return nil
8895}
8896
8897// WebhookCreateParameters the parameters for creating a webhook.
8898type WebhookCreateParameters struct {
8899	// Tags - The tags for the webhook.
8900	Tags map[string]*string `json:"tags"`
8901	// Location - The location of the webhook. This cannot be changed after the resource is created.
8902	Location *string `json:"location,omitempty"`
8903	// WebhookPropertiesCreateParameters - The properties that the webhook will be created with.
8904	*WebhookPropertiesCreateParameters `json:"properties,omitempty"`
8905}
8906
8907// MarshalJSON is the custom marshaler for WebhookCreateParameters.
8908func (wcp WebhookCreateParameters) MarshalJSON() ([]byte, error) {
8909	objectMap := make(map[string]interface{})
8910	if wcp.Tags != nil {
8911		objectMap["tags"] = wcp.Tags
8912	}
8913	if wcp.Location != nil {
8914		objectMap["location"] = wcp.Location
8915	}
8916	if wcp.WebhookPropertiesCreateParameters != nil {
8917		objectMap["properties"] = wcp.WebhookPropertiesCreateParameters
8918	}
8919	return json.Marshal(objectMap)
8920}
8921
8922// UnmarshalJSON is the custom unmarshaler for WebhookCreateParameters struct.
8923func (wcp *WebhookCreateParameters) UnmarshalJSON(body []byte) error {
8924	var m map[string]*json.RawMessage
8925	err := json.Unmarshal(body, &m)
8926	if err != nil {
8927		return err
8928	}
8929	for k, v := range m {
8930		switch k {
8931		case "tags":
8932			if v != nil {
8933				var tags map[string]*string
8934				err = json.Unmarshal(*v, &tags)
8935				if err != nil {
8936					return err
8937				}
8938				wcp.Tags = tags
8939			}
8940		case "location":
8941			if v != nil {
8942				var location string
8943				err = json.Unmarshal(*v, &location)
8944				if err != nil {
8945					return err
8946				}
8947				wcp.Location = &location
8948			}
8949		case "properties":
8950			if v != nil {
8951				var webhookPropertiesCreateParameters WebhookPropertiesCreateParameters
8952				err = json.Unmarshal(*v, &webhookPropertiesCreateParameters)
8953				if err != nil {
8954					return err
8955				}
8956				wcp.WebhookPropertiesCreateParameters = &webhookPropertiesCreateParameters
8957			}
8958		}
8959	}
8960
8961	return nil
8962}
8963
8964// WebhookListResult the result of a request to list webhooks for a container registry.
8965type WebhookListResult struct {
8966	autorest.Response `json:"-"`
8967	// Value - The list of webhooks. Since this list may be incomplete, the nextLink field should be used to request the next list of webhooks.
8968	Value *[]Webhook `json:"value,omitempty"`
8969	// NextLink - The URI that can be used to request the next list of webhooks.
8970	NextLink *string `json:"nextLink,omitempty"`
8971}
8972
8973// WebhookListResultIterator provides access to a complete listing of Webhook values.
8974type WebhookListResultIterator struct {
8975	i    int
8976	page WebhookListResultPage
8977}
8978
8979// NextWithContext advances to the next value.  If there was an error making
8980// the request the iterator does not advance and the error is returned.
8981func (iter *WebhookListResultIterator) NextWithContext(ctx context.Context) (err error) {
8982	if tracing.IsEnabled() {
8983		ctx = tracing.StartSpan(ctx, fqdn+"/WebhookListResultIterator.NextWithContext")
8984		defer func() {
8985			sc := -1
8986			if iter.Response().Response.Response != nil {
8987				sc = iter.Response().Response.Response.StatusCode
8988			}
8989			tracing.EndSpan(ctx, sc, err)
8990		}()
8991	}
8992	iter.i++
8993	if iter.i < len(iter.page.Values()) {
8994		return nil
8995	}
8996	err = iter.page.NextWithContext(ctx)
8997	if err != nil {
8998		iter.i--
8999		return err
9000	}
9001	iter.i = 0
9002	return nil
9003}
9004
9005// Next advances to the next value.  If there was an error making
9006// the request the iterator does not advance and the error is returned.
9007// Deprecated: Use NextWithContext() instead.
9008func (iter *WebhookListResultIterator) Next() error {
9009	return iter.NextWithContext(context.Background())
9010}
9011
9012// NotDone returns true if the enumeration should be started or is not yet complete.
9013func (iter WebhookListResultIterator) NotDone() bool {
9014	return iter.page.NotDone() && iter.i < len(iter.page.Values())
9015}
9016
9017// Response returns the raw server response from the last page request.
9018func (iter WebhookListResultIterator) Response() WebhookListResult {
9019	return iter.page.Response()
9020}
9021
9022// Value returns the current value or a zero-initialized value if the
9023// iterator has advanced beyond the end of the collection.
9024func (iter WebhookListResultIterator) Value() Webhook {
9025	if !iter.page.NotDone() {
9026		return Webhook{}
9027	}
9028	return iter.page.Values()[iter.i]
9029}
9030
9031// Creates a new instance of the WebhookListResultIterator type.
9032func NewWebhookListResultIterator(page WebhookListResultPage) WebhookListResultIterator {
9033	return WebhookListResultIterator{page: page}
9034}
9035
9036// IsEmpty returns true if the ListResult contains no values.
9037func (wlr WebhookListResult) IsEmpty() bool {
9038	return wlr.Value == nil || len(*wlr.Value) == 0
9039}
9040
9041// hasNextLink returns true if the NextLink is not empty.
9042func (wlr WebhookListResult) hasNextLink() bool {
9043	return wlr.NextLink != nil && len(*wlr.NextLink) != 0
9044}
9045
9046// webhookListResultPreparer prepares a request to retrieve the next set of results.
9047// It returns nil if no more results exist.
9048func (wlr WebhookListResult) webhookListResultPreparer(ctx context.Context) (*http.Request, error) {
9049	if !wlr.hasNextLink() {
9050		return nil, nil
9051	}
9052	return autorest.Prepare((&http.Request{}).WithContext(ctx),
9053		autorest.AsJSON(),
9054		autorest.AsGet(),
9055		autorest.WithBaseURL(to.String(wlr.NextLink)))
9056}
9057
9058// WebhookListResultPage contains a page of Webhook values.
9059type WebhookListResultPage struct {
9060	fn  func(context.Context, WebhookListResult) (WebhookListResult, error)
9061	wlr WebhookListResult
9062}
9063
9064// NextWithContext advances to the next page of values.  If there was an error making
9065// the request the page does not advance and the error is returned.
9066func (page *WebhookListResultPage) NextWithContext(ctx context.Context) (err error) {
9067	if tracing.IsEnabled() {
9068		ctx = tracing.StartSpan(ctx, fqdn+"/WebhookListResultPage.NextWithContext")
9069		defer func() {
9070			sc := -1
9071			if page.Response().Response.Response != nil {
9072				sc = page.Response().Response.Response.StatusCode
9073			}
9074			tracing.EndSpan(ctx, sc, err)
9075		}()
9076	}
9077	for {
9078		next, err := page.fn(ctx, page.wlr)
9079		if err != nil {
9080			return err
9081		}
9082		page.wlr = next
9083		if !next.hasNextLink() || !next.IsEmpty() {
9084			break
9085		}
9086	}
9087	return nil
9088}
9089
9090// Next advances to the next page of values.  If there was an error making
9091// the request the page does not advance and the error is returned.
9092// Deprecated: Use NextWithContext() instead.
9093func (page *WebhookListResultPage) Next() error {
9094	return page.NextWithContext(context.Background())
9095}
9096
9097// NotDone returns true if the page enumeration should be started or is not yet complete.
9098func (page WebhookListResultPage) NotDone() bool {
9099	return !page.wlr.IsEmpty()
9100}
9101
9102// Response returns the raw server response from the last page request.
9103func (page WebhookListResultPage) Response() WebhookListResult {
9104	return page.wlr
9105}
9106
9107// Values returns the slice of values for the current page or nil if there are no values.
9108func (page WebhookListResultPage) Values() []Webhook {
9109	if page.wlr.IsEmpty() {
9110		return nil
9111	}
9112	return *page.wlr.Value
9113}
9114
9115// Creates a new instance of the WebhookListResultPage type.
9116func NewWebhookListResultPage(cur WebhookListResult, getNextPage func(context.Context, WebhookListResult) (WebhookListResult, error)) WebhookListResultPage {
9117	return WebhookListResultPage{
9118		fn:  getNextPage,
9119		wlr: cur,
9120	}
9121}
9122
9123// WebhookProperties the properties of a webhook.
9124type WebhookProperties struct {
9125	// Status - The status of the webhook at the time the operation was called. Possible values include: 'WebhookStatusEnabled', 'WebhookStatusDisabled'
9126	Status WebhookStatus `json:"status,omitempty"`
9127	// 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.
9128	Scope *string `json:"scope,omitempty"`
9129	// Actions - The list of actions that trigger the webhook to post notifications.
9130	Actions *[]WebhookAction `json:"actions,omitempty"`
9131	// ProvisioningState - READ-ONLY; The provisioning state of the webhook at the time the operation was called. Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', 'Canceled'
9132	ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
9133}
9134
9135// MarshalJSON is the custom marshaler for WebhookProperties.
9136func (wp WebhookProperties) MarshalJSON() ([]byte, error) {
9137	objectMap := make(map[string]interface{})
9138	if wp.Status != "" {
9139		objectMap["status"] = wp.Status
9140	}
9141	if wp.Scope != nil {
9142		objectMap["scope"] = wp.Scope
9143	}
9144	if wp.Actions != nil {
9145		objectMap["actions"] = wp.Actions
9146	}
9147	return json.Marshal(objectMap)
9148}
9149
9150// WebhookPropertiesCreateParameters the parameters for creating the properties of a webhook.
9151type WebhookPropertiesCreateParameters struct {
9152	// ServiceURI - The service URI for the webhook to post notifications.
9153	ServiceURI *string `json:"serviceUri,omitempty"`
9154	// CustomHeaders - Custom headers that will be added to the webhook notifications.
9155	CustomHeaders map[string]*string `json:"customHeaders"`
9156	// Status - The status of the webhook at the time the operation was called. Possible values include: 'WebhookStatusEnabled', 'WebhookStatusDisabled'
9157	Status WebhookStatus `json:"status,omitempty"`
9158	// 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.
9159	Scope *string `json:"scope,omitempty"`
9160	// Actions - The list of actions that trigger the webhook to post notifications.
9161	Actions *[]WebhookAction `json:"actions,omitempty"`
9162}
9163
9164// MarshalJSON is the custom marshaler for WebhookPropertiesCreateParameters.
9165func (wpcp WebhookPropertiesCreateParameters) MarshalJSON() ([]byte, error) {
9166	objectMap := make(map[string]interface{})
9167	if wpcp.ServiceURI != nil {
9168		objectMap["serviceUri"] = wpcp.ServiceURI
9169	}
9170	if wpcp.CustomHeaders != nil {
9171		objectMap["customHeaders"] = wpcp.CustomHeaders
9172	}
9173	if wpcp.Status != "" {
9174		objectMap["status"] = wpcp.Status
9175	}
9176	if wpcp.Scope != nil {
9177		objectMap["scope"] = wpcp.Scope
9178	}
9179	if wpcp.Actions != nil {
9180		objectMap["actions"] = wpcp.Actions
9181	}
9182	return json.Marshal(objectMap)
9183}
9184
9185// WebhookPropertiesUpdateParameters the parameters for updating the properties of a webhook.
9186type WebhookPropertiesUpdateParameters struct {
9187	// ServiceURI - The service URI for the webhook to post notifications.
9188	ServiceURI *string `json:"serviceUri,omitempty"`
9189	// CustomHeaders - Custom headers that will be added to the webhook notifications.
9190	CustomHeaders map[string]*string `json:"customHeaders"`
9191	// Status - The status of the webhook at the time the operation was called. Possible values include: 'WebhookStatusEnabled', 'WebhookStatusDisabled'
9192	Status WebhookStatus `json:"status,omitempty"`
9193	// 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.
9194	Scope *string `json:"scope,omitempty"`
9195	// Actions - The list of actions that trigger the webhook to post notifications.
9196	Actions *[]WebhookAction `json:"actions,omitempty"`
9197}
9198
9199// MarshalJSON is the custom marshaler for WebhookPropertiesUpdateParameters.
9200func (wpup WebhookPropertiesUpdateParameters) MarshalJSON() ([]byte, error) {
9201	objectMap := make(map[string]interface{})
9202	if wpup.ServiceURI != nil {
9203		objectMap["serviceUri"] = wpup.ServiceURI
9204	}
9205	if wpup.CustomHeaders != nil {
9206		objectMap["customHeaders"] = wpup.CustomHeaders
9207	}
9208	if wpup.Status != "" {
9209		objectMap["status"] = wpup.Status
9210	}
9211	if wpup.Scope != nil {
9212		objectMap["scope"] = wpup.Scope
9213	}
9214	if wpup.Actions != nil {
9215		objectMap["actions"] = wpup.Actions
9216	}
9217	return json.Marshal(objectMap)
9218}
9219
9220// WebhooksCreateFuture an abstraction for monitoring and retrieving the results of a long-running
9221// operation.
9222type WebhooksCreateFuture struct {
9223	azure.FutureAPI
9224	// Result returns the result of the asynchronous operation.
9225	// If the operation has not completed it will return an error.
9226	Result func(WebhooksClient) (Webhook, error)
9227}
9228
9229// UnmarshalJSON is the custom unmarshaller for CreateFuture.
9230func (future *WebhooksCreateFuture) UnmarshalJSON(body []byte) error {
9231	var azFuture azure.Future
9232	if err := json.Unmarshal(body, &azFuture); err != nil {
9233		return err
9234	}
9235	future.FutureAPI = &azFuture
9236	future.Result = future.result
9237	return nil
9238}
9239
9240// result is the default implementation for WebhooksCreateFuture.Result.
9241func (future *WebhooksCreateFuture) result(client WebhooksClient) (w Webhook, err error) {
9242	var done bool
9243	done, err = future.DoneWithContext(context.Background(), client)
9244	if err != nil {
9245		err = autorest.NewErrorWithError(err, "containerregistry.WebhooksCreateFuture", "Result", future.Response(), "Polling failure")
9246		return
9247	}
9248	if !done {
9249		w.Response.Response = future.Response()
9250		err = azure.NewAsyncOpIncompleteError("containerregistry.WebhooksCreateFuture")
9251		return
9252	}
9253	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
9254	if w.Response.Response, err = future.GetResult(sender); err == nil && w.Response.Response.StatusCode != http.StatusNoContent {
9255		w, err = client.CreateResponder(w.Response.Response)
9256		if err != nil {
9257			err = autorest.NewErrorWithError(err, "containerregistry.WebhooksCreateFuture", "Result", w.Response.Response, "Failure responding to request")
9258		}
9259	}
9260	return
9261}
9262
9263// WebhooksDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
9264// operation.
9265type WebhooksDeleteFuture struct {
9266	azure.FutureAPI
9267	// Result returns the result of the asynchronous operation.
9268	// If the operation has not completed it will return an error.
9269	Result func(WebhooksClient) (autorest.Response, error)
9270}
9271
9272// UnmarshalJSON is the custom unmarshaller for CreateFuture.
9273func (future *WebhooksDeleteFuture) UnmarshalJSON(body []byte) error {
9274	var azFuture azure.Future
9275	if err := json.Unmarshal(body, &azFuture); err != nil {
9276		return err
9277	}
9278	future.FutureAPI = &azFuture
9279	future.Result = future.result
9280	return nil
9281}
9282
9283// result is the default implementation for WebhooksDeleteFuture.Result.
9284func (future *WebhooksDeleteFuture) result(client WebhooksClient) (ar autorest.Response, err error) {
9285	var done bool
9286	done, err = future.DoneWithContext(context.Background(), client)
9287	if err != nil {
9288		err = autorest.NewErrorWithError(err, "containerregistry.WebhooksDeleteFuture", "Result", future.Response(), "Polling failure")
9289		return
9290	}
9291	if !done {
9292		ar.Response = future.Response()
9293		err = azure.NewAsyncOpIncompleteError("containerregistry.WebhooksDeleteFuture")
9294		return
9295	}
9296	ar.Response = future.Response()
9297	return
9298}
9299
9300// WebhooksUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
9301// operation.
9302type WebhooksUpdateFuture struct {
9303	azure.FutureAPI
9304	// Result returns the result of the asynchronous operation.
9305	// If the operation has not completed it will return an error.
9306	Result func(WebhooksClient) (Webhook, error)
9307}
9308
9309// UnmarshalJSON is the custom unmarshaller for CreateFuture.
9310func (future *WebhooksUpdateFuture) UnmarshalJSON(body []byte) error {
9311	var azFuture azure.Future
9312	if err := json.Unmarshal(body, &azFuture); err != nil {
9313		return err
9314	}
9315	future.FutureAPI = &azFuture
9316	future.Result = future.result
9317	return nil
9318}
9319
9320// result is the default implementation for WebhooksUpdateFuture.Result.
9321func (future *WebhooksUpdateFuture) result(client WebhooksClient) (w Webhook, err error) {
9322	var done bool
9323	done, err = future.DoneWithContext(context.Background(), client)
9324	if err != nil {
9325		err = autorest.NewErrorWithError(err, "containerregistry.WebhooksUpdateFuture", "Result", future.Response(), "Polling failure")
9326		return
9327	}
9328	if !done {
9329		w.Response.Response = future.Response()
9330		err = azure.NewAsyncOpIncompleteError("containerregistry.WebhooksUpdateFuture")
9331		return
9332	}
9333	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
9334	if w.Response.Response, err = future.GetResult(sender); err == nil && w.Response.Response.StatusCode != http.StatusNoContent {
9335		w, err = client.UpdateResponder(w.Response.Response)
9336		if err != nil {
9337			err = autorest.NewErrorWithError(err, "containerregistry.WebhooksUpdateFuture", "Result", w.Response.Response, "Failure responding to request")
9338		}
9339	}
9340	return
9341}
9342
9343// WebhookUpdateParameters the parameters for updating a webhook.
9344type WebhookUpdateParameters struct {
9345	// Tags - The tags for the webhook.
9346	Tags map[string]*string `json:"tags"`
9347	// WebhookPropertiesUpdateParameters - The properties that the webhook will be updated with.
9348	*WebhookPropertiesUpdateParameters `json:"properties,omitempty"`
9349}
9350
9351// MarshalJSON is the custom marshaler for WebhookUpdateParameters.
9352func (wup WebhookUpdateParameters) MarshalJSON() ([]byte, error) {
9353	objectMap := make(map[string]interface{})
9354	if wup.Tags != nil {
9355		objectMap["tags"] = wup.Tags
9356	}
9357	if wup.WebhookPropertiesUpdateParameters != nil {
9358		objectMap["properties"] = wup.WebhookPropertiesUpdateParameters
9359	}
9360	return json.Marshal(objectMap)
9361}
9362
9363// UnmarshalJSON is the custom unmarshaler for WebhookUpdateParameters struct.
9364func (wup *WebhookUpdateParameters) UnmarshalJSON(body []byte) error {
9365	var m map[string]*json.RawMessage
9366	err := json.Unmarshal(body, &m)
9367	if err != nil {
9368		return err
9369	}
9370	for k, v := range m {
9371		switch k {
9372		case "tags":
9373			if v != nil {
9374				var tags map[string]*string
9375				err = json.Unmarshal(*v, &tags)
9376				if err != nil {
9377					return err
9378				}
9379				wup.Tags = tags
9380			}
9381		case "properties":
9382			if v != nil {
9383				var webhookPropertiesUpdateParameters WebhookPropertiesUpdateParameters
9384				err = json.Unmarshal(*v, &webhookPropertiesUpdateParameters)
9385				if err != nil {
9386					return err
9387				}
9388				wup.WebhookPropertiesUpdateParameters = &webhookPropertiesUpdateParameters
9389			}
9390		}
9391	}
9392
9393	return nil
9394}
9395