1package servicefabricmesh
2
3// Copyright (c) Microsoft and contributors.  All rights reserved.
4//
5// Licensed under the Apache License, Version 2.0 (the "License");
6// you may not use this file except in compliance with the License.
7// You may obtain a copy of the License at
8// http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13//
14// See the License for the specific language governing permissions and
15// limitations under the License.
16//
17// Code generated by Microsoft (R) AutoRest Code Generator.
18// Changes may cause incorrect behavior and will be lost if the code is regenerated.
19
20import (
21	"context"
22	"encoding/json"
23	"github.com/Azure/go-autorest/autorest"
24	"github.com/Azure/go-autorest/autorest/date"
25	"github.com/Azure/go-autorest/autorest/to"
26	"github.com/Azure/go-autorest/tracing"
27	"net/http"
28)
29
30// The package's fully qualified name.
31const fqdn = "github.com/Azure/azure-sdk-for-go/services/preview/servicefabricmesh/mgmt/2018-07-01-preview/servicefabricmesh"
32
33// ApplicationResourceStatus enumerates the values for application resource status.
34type ApplicationResourceStatus string
35
36const (
37	// Creating ...
38	Creating ApplicationResourceStatus = "Creating"
39	// Deleting ...
40	Deleting ApplicationResourceStatus = "Deleting"
41	// Failed ...
42	Failed ApplicationResourceStatus = "Failed"
43	// Invalid ...
44	Invalid ApplicationResourceStatus = "Invalid"
45	// Ready ...
46	Ready ApplicationResourceStatus = "Ready"
47	// Upgrading ...
48	Upgrading ApplicationResourceStatus = "Upgrading"
49)
50
51// PossibleApplicationResourceStatusValues returns an array of possible values for the ApplicationResourceStatus const type.
52func PossibleApplicationResourceStatusValues() []ApplicationResourceStatus {
53	return []ApplicationResourceStatus{Creating, Deleting, Failed, Invalid, Ready, Upgrading}
54}
55
56// DiagnosticsSinkKind enumerates the values for diagnostics sink kind.
57type DiagnosticsSinkKind string
58
59const (
60	// DiagnosticsSinkKindAzureInternalMonitoringPipeline Diagnostics settings for Geneva.
61	DiagnosticsSinkKindAzureInternalMonitoringPipeline DiagnosticsSinkKind = "AzureInternalMonitoringPipeline"
62	// DiagnosticsSinkKindInvalid Indicates an invalid sink kind. All Service Fabric enumerations have the
63	// invalid type.
64	DiagnosticsSinkKindInvalid DiagnosticsSinkKind = "Invalid"
65)
66
67// PossibleDiagnosticsSinkKindValues returns an array of possible values for the DiagnosticsSinkKind const type.
68func PossibleDiagnosticsSinkKindValues() []DiagnosticsSinkKind {
69	return []DiagnosticsSinkKind{DiagnosticsSinkKindAzureInternalMonitoringPipeline, DiagnosticsSinkKindInvalid}
70}
71
72// HealthState enumerates the values for health state.
73type HealthState string
74
75const (
76	// HealthStateError Indicates the health state is at an error level. Error health state should be
77	// investigated, as they can impact the correct functionality of the cluster. The value is 3.
78	HealthStateError HealthState = "Error"
79	// HealthStateInvalid Indicates an invalid health state. All Service Fabric enumerations have the invalid
80	// type. The value is zero.
81	HealthStateInvalid HealthState = "Invalid"
82	// HealthStateOk Indicates the health state is okay. The value is 1.
83	HealthStateOk HealthState = "Ok"
84	// HealthStateUnknown Indicates an unknown health status. The value is 65535.
85	HealthStateUnknown HealthState = "Unknown"
86	// HealthStateWarning Indicates the health state is at a warning level. The value is 2.
87	HealthStateWarning HealthState = "Warning"
88)
89
90// PossibleHealthStateValues returns an array of possible values for the HealthState const type.
91func PossibleHealthStateValues() []HealthState {
92	return []HealthState{HealthStateError, HealthStateInvalid, HealthStateOk, HealthStateUnknown, HealthStateWarning}
93}
94
95// IngressQoSLevel enumerates the values for ingress qo s level.
96type IngressQoSLevel string
97
98const (
99	// Bronze ...
100	Bronze IngressQoSLevel = "Bronze"
101)
102
103// PossibleIngressQoSLevelValues returns an array of possible values for the IngressQoSLevel const type.
104func PossibleIngressQoSLevelValues() []IngressQoSLevel {
105	return []IngressQoSLevel{Bronze}
106}
107
108// Kind enumerates the values for kind.
109type Kind string
110
111const (
112	// KindAzureInternalMonitoringPipeline ...
113	KindAzureInternalMonitoringPipeline Kind = "AzureInternalMonitoringPipeline"
114	// KindDiagnosticsSinkProperties ...
115	KindDiagnosticsSinkProperties Kind = "DiagnosticsSinkProperties"
116)
117
118// PossibleKindValues returns an array of possible values for the Kind const type.
119func PossibleKindValues() []Kind {
120	return []Kind{KindAzureInternalMonitoringPipeline, KindDiagnosticsSinkProperties}
121}
122
123// OperatingSystemTypes enumerates the values for operating system types.
124type OperatingSystemTypes string
125
126const (
127	// Linux ...
128	Linux OperatingSystemTypes = "Linux"
129	// Windows ...
130	Windows OperatingSystemTypes = "Windows"
131)
132
133// PossibleOperatingSystemTypesValues returns an array of possible values for the OperatingSystemTypes const type.
134func PossibleOperatingSystemTypesValues() []OperatingSystemTypes {
135	return []OperatingSystemTypes{Linux, Windows}
136}
137
138// ServiceResourceStatus enumerates the values for service resource status.
139type ServiceResourceStatus string
140
141const (
142	// ServiceResourceStatusActive ...
143	ServiceResourceStatusActive ServiceResourceStatus = "Active"
144	// ServiceResourceStatusCreating ...
145	ServiceResourceStatusCreating ServiceResourceStatus = "Creating"
146	// ServiceResourceStatusDeleting ...
147	ServiceResourceStatusDeleting ServiceResourceStatus = "Deleting"
148	// ServiceResourceStatusFailed ...
149	ServiceResourceStatusFailed ServiceResourceStatus = "Failed"
150	// ServiceResourceStatusUnknown ...
151	ServiceResourceStatusUnknown ServiceResourceStatus = "Unknown"
152	// ServiceResourceStatusUpgrading ...
153	ServiceResourceStatusUpgrading ServiceResourceStatus = "Upgrading"
154)
155
156// PossibleServiceResourceStatusValues returns an array of possible values for the ServiceResourceStatus const type.
157func PossibleServiceResourceStatusValues() []ServiceResourceStatus {
158	return []ServiceResourceStatus{ServiceResourceStatusActive, ServiceResourceStatusCreating, ServiceResourceStatusDeleting, ServiceResourceStatusFailed, ServiceResourceStatusUnknown, ServiceResourceStatusUpgrading}
159}
160
161// ApplicationProperties this type describes properties of an application resource.
162type ApplicationProperties struct {
163	// Description - User readable description of the application.
164	Description *string `json:"description,omitempty"`
165	// DebugParams - Internal use.
166	DebugParams *string `json:"debugParams,omitempty"`
167	// Services - describes the services in the application.
168	Services *[]ServiceResourceDescription `json:"services,omitempty"`
169	// HealthState - READ-ONLY; Describes the health state of an application resource. Possible values include: 'HealthStateInvalid', 'HealthStateOk', 'HealthStateWarning', 'HealthStateError', 'HealthStateUnknown'
170	HealthState HealthState `json:"healthState,omitempty"`
171	// UnhealthyEvaluation - READ-ONLY; When the application's health state is not 'Ok', this additional details from service fabric Health Manager for the user to know why the application is marked unhealthy.
172	UnhealthyEvaluation *string `json:"unhealthyEvaluation,omitempty"`
173	// Status - READ-ONLY; Status of the application resource. Possible values include: 'Invalid', 'Ready', 'Upgrading', 'Creating', 'Deleting', 'Failed'
174	Status ApplicationResourceStatus `json:"status,omitempty"`
175	// StatusDetails - READ-ONLY; Gives additional information about the current status of the application deployment.
176	StatusDetails *string `json:"statusDetails,omitempty"`
177	// ServiceNames - READ-ONLY; Names of the services in the application.
178	ServiceNames *[]string `json:"serviceNames,omitempty"`
179	// Diagnostics - Describes the diagnostics definition and usage for an application resource.
180	Diagnostics *DiagnosticsDescription `json:"diagnostics,omitempty"`
181}
182
183// ApplicationResourceDescription this type describes an application resource.
184type ApplicationResourceDescription struct {
185	autorest.Response `json:"-"`
186	// ApplicationResourceProperties - This type describes properties of an application resource.
187	*ApplicationResourceProperties `json:"properties,omitempty"`
188	// Tags - Resource tags.
189	Tags map[string]*string `json:"tags"`
190	// ID - READ-ONLY; Fully qualified identifier for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
191	ID *string `json:"id,omitempty"`
192	// Name - READ-ONLY; The name of the resource
193	Name *string `json:"name,omitempty"`
194	// Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts.
195	Type *string `json:"type,omitempty"`
196	// Location - The geo-location where the resource lives
197	Location *string `json:"location,omitempty"`
198}
199
200// MarshalJSON is the custom marshaler for ApplicationResourceDescription.
201func (ard ApplicationResourceDescription) MarshalJSON() ([]byte, error) {
202	objectMap := make(map[string]interface{})
203	if ard.ApplicationResourceProperties != nil {
204		objectMap["properties"] = ard.ApplicationResourceProperties
205	}
206	if ard.Tags != nil {
207		objectMap["tags"] = ard.Tags
208	}
209	if ard.Location != nil {
210		objectMap["location"] = ard.Location
211	}
212	return json.Marshal(objectMap)
213}
214
215// UnmarshalJSON is the custom unmarshaler for ApplicationResourceDescription struct.
216func (ard *ApplicationResourceDescription) UnmarshalJSON(body []byte) error {
217	var m map[string]*json.RawMessage
218	err := json.Unmarshal(body, &m)
219	if err != nil {
220		return err
221	}
222	for k, v := range m {
223		switch k {
224		case "properties":
225			if v != nil {
226				var applicationResourceProperties ApplicationResourceProperties
227				err = json.Unmarshal(*v, &applicationResourceProperties)
228				if err != nil {
229					return err
230				}
231				ard.ApplicationResourceProperties = &applicationResourceProperties
232			}
233		case "tags":
234			if v != nil {
235				var tags map[string]*string
236				err = json.Unmarshal(*v, &tags)
237				if err != nil {
238					return err
239				}
240				ard.Tags = tags
241			}
242		case "id":
243			if v != nil {
244				var ID string
245				err = json.Unmarshal(*v, &ID)
246				if err != nil {
247					return err
248				}
249				ard.ID = &ID
250			}
251		case "name":
252			if v != nil {
253				var name string
254				err = json.Unmarshal(*v, &name)
255				if err != nil {
256					return err
257				}
258				ard.Name = &name
259			}
260		case "type":
261			if v != nil {
262				var typeVar string
263				err = json.Unmarshal(*v, &typeVar)
264				if err != nil {
265					return err
266				}
267				ard.Type = &typeVar
268			}
269		case "location":
270			if v != nil {
271				var location string
272				err = json.Unmarshal(*v, &location)
273				if err != nil {
274					return err
275				}
276				ard.Location = &location
277			}
278		}
279	}
280
281	return nil
282}
283
284// ApplicationResourceDescriptionList a pageable list of application resources.
285type ApplicationResourceDescriptionList struct {
286	autorest.Response `json:"-"`
287	// Value - One page of the list.
288	Value *[]ApplicationResourceDescription `json:"value,omitempty"`
289	// NextLink - URI to fetch the next page of the list.
290	NextLink *string `json:"nextLink,omitempty"`
291}
292
293// ApplicationResourceDescriptionListIterator provides access to a complete listing of
294// ApplicationResourceDescription values.
295type ApplicationResourceDescriptionListIterator struct {
296	i    int
297	page ApplicationResourceDescriptionListPage
298}
299
300// NextWithContext advances to the next value.  If there was an error making
301// the request the iterator does not advance and the error is returned.
302func (iter *ApplicationResourceDescriptionListIterator) NextWithContext(ctx context.Context) (err error) {
303	if tracing.IsEnabled() {
304		ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationResourceDescriptionListIterator.NextWithContext")
305		defer func() {
306			sc := -1
307			if iter.Response().Response.Response != nil {
308				sc = iter.Response().Response.Response.StatusCode
309			}
310			tracing.EndSpan(ctx, sc, err)
311		}()
312	}
313	iter.i++
314	if iter.i < len(iter.page.Values()) {
315		return nil
316	}
317	err = iter.page.NextWithContext(ctx)
318	if err != nil {
319		iter.i--
320		return err
321	}
322	iter.i = 0
323	return nil
324}
325
326// Next advances to the next value.  If there was an error making
327// the request the iterator does not advance and the error is returned.
328// Deprecated: Use NextWithContext() instead.
329func (iter *ApplicationResourceDescriptionListIterator) Next() error {
330	return iter.NextWithContext(context.Background())
331}
332
333// NotDone returns true if the enumeration should be started or is not yet complete.
334func (iter ApplicationResourceDescriptionListIterator) NotDone() bool {
335	return iter.page.NotDone() && iter.i < len(iter.page.Values())
336}
337
338// Response returns the raw server response from the last page request.
339func (iter ApplicationResourceDescriptionListIterator) Response() ApplicationResourceDescriptionList {
340	return iter.page.Response()
341}
342
343// Value returns the current value or a zero-initialized value if the
344// iterator has advanced beyond the end of the collection.
345func (iter ApplicationResourceDescriptionListIterator) Value() ApplicationResourceDescription {
346	if !iter.page.NotDone() {
347		return ApplicationResourceDescription{}
348	}
349	return iter.page.Values()[iter.i]
350}
351
352// Creates a new instance of the ApplicationResourceDescriptionListIterator type.
353func NewApplicationResourceDescriptionListIterator(page ApplicationResourceDescriptionListPage) ApplicationResourceDescriptionListIterator {
354	return ApplicationResourceDescriptionListIterator{page: page}
355}
356
357// IsEmpty returns true if the ListResult contains no values.
358func (ardl ApplicationResourceDescriptionList) IsEmpty() bool {
359	return ardl.Value == nil || len(*ardl.Value) == 0
360}
361
362// applicationResourceDescriptionListPreparer prepares a request to retrieve the next set of results.
363// It returns nil if no more results exist.
364func (ardl ApplicationResourceDescriptionList) applicationResourceDescriptionListPreparer(ctx context.Context) (*http.Request, error) {
365	if ardl.NextLink == nil || len(to.String(ardl.NextLink)) < 1 {
366		return nil, nil
367	}
368	return autorest.Prepare((&http.Request{}).WithContext(ctx),
369		autorest.AsJSON(),
370		autorest.AsGet(),
371		autorest.WithBaseURL(to.String(ardl.NextLink)))
372}
373
374// ApplicationResourceDescriptionListPage contains a page of ApplicationResourceDescription values.
375type ApplicationResourceDescriptionListPage struct {
376	fn   func(context.Context, ApplicationResourceDescriptionList) (ApplicationResourceDescriptionList, error)
377	ardl ApplicationResourceDescriptionList
378}
379
380// NextWithContext advances to the next page of values.  If there was an error making
381// the request the page does not advance and the error is returned.
382func (page *ApplicationResourceDescriptionListPage) NextWithContext(ctx context.Context) (err error) {
383	if tracing.IsEnabled() {
384		ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationResourceDescriptionListPage.NextWithContext")
385		defer func() {
386			sc := -1
387			if page.Response().Response.Response != nil {
388				sc = page.Response().Response.Response.StatusCode
389			}
390			tracing.EndSpan(ctx, sc, err)
391		}()
392	}
393	next, err := page.fn(ctx, page.ardl)
394	if err != nil {
395		return err
396	}
397	page.ardl = next
398	return nil
399}
400
401// Next advances to the next page of values.  If there was an error making
402// the request the page does not advance and the error is returned.
403// Deprecated: Use NextWithContext() instead.
404func (page *ApplicationResourceDescriptionListPage) Next() error {
405	return page.NextWithContext(context.Background())
406}
407
408// NotDone returns true if the page enumeration should be started or is not yet complete.
409func (page ApplicationResourceDescriptionListPage) NotDone() bool {
410	return !page.ardl.IsEmpty()
411}
412
413// Response returns the raw server response from the last page request.
414func (page ApplicationResourceDescriptionListPage) Response() ApplicationResourceDescriptionList {
415	return page.ardl
416}
417
418// Values returns the slice of values for the current page or nil if there are no values.
419func (page ApplicationResourceDescriptionListPage) Values() []ApplicationResourceDescription {
420	if page.ardl.IsEmpty() {
421		return nil
422	}
423	return *page.ardl.Value
424}
425
426// Creates a new instance of the ApplicationResourceDescriptionListPage type.
427func NewApplicationResourceDescriptionListPage(getNextPage func(context.Context, ApplicationResourceDescriptionList) (ApplicationResourceDescriptionList, error)) ApplicationResourceDescriptionListPage {
428	return ApplicationResourceDescriptionListPage{fn: getNextPage}
429}
430
431// ApplicationResourceProperties this type describes properties of an application resource.
432type ApplicationResourceProperties struct {
433	// ProvisioningState - READ-ONLY; State of the resource.
434	ProvisioningState *string `json:"provisioningState,omitempty"`
435	// Description - User readable description of the application.
436	Description *string `json:"description,omitempty"`
437	// DebugParams - Internal use.
438	DebugParams *string `json:"debugParams,omitempty"`
439	// Services - describes the services in the application.
440	Services *[]ServiceResourceDescription `json:"services,omitempty"`
441	// HealthState - READ-ONLY; Describes the health state of an application resource. Possible values include: 'HealthStateInvalid', 'HealthStateOk', 'HealthStateWarning', 'HealthStateError', 'HealthStateUnknown'
442	HealthState HealthState `json:"healthState,omitempty"`
443	// UnhealthyEvaluation - READ-ONLY; When the application's health state is not 'Ok', this additional details from service fabric Health Manager for the user to know why the application is marked unhealthy.
444	UnhealthyEvaluation *string `json:"unhealthyEvaluation,omitempty"`
445	// Status - READ-ONLY; Status of the application resource. Possible values include: 'Invalid', 'Ready', 'Upgrading', 'Creating', 'Deleting', 'Failed'
446	Status ApplicationResourceStatus `json:"status,omitempty"`
447	// StatusDetails - READ-ONLY; Gives additional information about the current status of the application deployment.
448	StatusDetails *string `json:"statusDetails,omitempty"`
449	// ServiceNames - READ-ONLY; Names of the services in the application.
450	ServiceNames *[]string `json:"serviceNames,omitempty"`
451	// Diagnostics - Describes the diagnostics definition and usage for an application resource.
452	Diagnostics *DiagnosticsDescription `json:"diagnostics,omitempty"`
453}
454
455// AvailableOperationDisplay an operation available at the listed Azure resource provider.
456type AvailableOperationDisplay struct {
457	// Provider - Name of the operation provider.
458	Provider *string `json:"provider,omitempty"`
459	// Resource - Name of the resource on which the operation is available.
460	Resource *string `json:"resource,omitempty"`
461	// Operation - Name of the available operation.
462	Operation *string `json:"operation,omitempty"`
463	// Description - Description of the available operation.
464	Description *string `json:"description,omitempty"`
465}
466
467// AzureInternalMonitoringPipelineSinkDescription diagnostics settings for Geneva.
468type AzureInternalMonitoringPipelineSinkDescription struct {
469	// AccountName - Azure Internal monitoring pipeline account.
470	AccountName *string `json:"accountName,omitempty"`
471	// Namespace - Azure Internal monitoring pipeline account namespace.
472	Namespace *string `json:"namespace,omitempty"`
473	// MaConfigURL - Azure Internal monitoring agent configuration.
474	MaConfigURL *string `json:"maConfigUrl,omitempty"`
475	// FluentdConfigURL - Azure Internal monitoring agent fluentd configuration.
476	FluentdConfigURL interface{} `json:"fluentdConfigUrl,omitempty"`
477	// AutoKeyConfigURL - Azure Internal monitoring pipeline autokey associated with the certificate.
478	AutoKeyConfigURL *string `json:"autoKeyConfigUrl,omitempty"`
479	// Name - Name of the sink. This value is referenced by DiagnosticsReferenceDescription
480	Name *string `json:"name,omitempty"`
481	// Description - A description of the sink.
482	Description *string `json:"description,omitempty"`
483	// Kind - Possible values include: 'KindDiagnosticsSinkProperties', 'KindAzureInternalMonitoringPipeline'
484	Kind Kind `json:"kind,omitempty"`
485}
486
487// MarshalJSON is the custom marshaler for AzureInternalMonitoringPipelineSinkDescription.
488func (aimpsd AzureInternalMonitoringPipelineSinkDescription) MarshalJSON() ([]byte, error) {
489	aimpsd.Kind = KindAzureInternalMonitoringPipeline
490	objectMap := make(map[string]interface{})
491	if aimpsd.AccountName != nil {
492		objectMap["accountName"] = aimpsd.AccountName
493	}
494	if aimpsd.Namespace != nil {
495		objectMap["namespace"] = aimpsd.Namespace
496	}
497	if aimpsd.MaConfigURL != nil {
498		objectMap["maConfigUrl"] = aimpsd.MaConfigURL
499	}
500	if aimpsd.FluentdConfigURL != nil {
501		objectMap["fluentdConfigUrl"] = aimpsd.FluentdConfigURL
502	}
503	if aimpsd.AutoKeyConfigURL != nil {
504		objectMap["autoKeyConfigUrl"] = aimpsd.AutoKeyConfigURL
505	}
506	if aimpsd.Name != nil {
507		objectMap["name"] = aimpsd.Name
508	}
509	if aimpsd.Description != nil {
510		objectMap["description"] = aimpsd.Description
511	}
512	if aimpsd.Kind != "" {
513		objectMap["kind"] = aimpsd.Kind
514	}
515	return json.Marshal(objectMap)
516}
517
518// AsAzureInternalMonitoringPipelineSinkDescription is the BasicDiagnosticsSinkProperties implementation for AzureInternalMonitoringPipelineSinkDescription.
519func (aimpsd AzureInternalMonitoringPipelineSinkDescription) AsAzureInternalMonitoringPipelineSinkDescription() (*AzureInternalMonitoringPipelineSinkDescription, bool) {
520	return &aimpsd, true
521}
522
523// AsDiagnosticsSinkProperties is the BasicDiagnosticsSinkProperties implementation for AzureInternalMonitoringPipelineSinkDescription.
524func (aimpsd AzureInternalMonitoringPipelineSinkDescription) AsDiagnosticsSinkProperties() (*DiagnosticsSinkProperties, bool) {
525	return nil, false
526}
527
528// AsBasicDiagnosticsSinkProperties is the BasicDiagnosticsSinkProperties implementation for AzureInternalMonitoringPipelineSinkDescription.
529func (aimpsd AzureInternalMonitoringPipelineSinkDescription) AsBasicDiagnosticsSinkProperties() (BasicDiagnosticsSinkProperties, bool) {
530	return &aimpsd, true
531}
532
533// ContainerCodePackageProperties describes a container and its runtime properties.
534type ContainerCodePackageProperties struct {
535	// Name - The name of the code package.
536	Name *string `json:"name,omitempty"`
537	// Image - The Container image to use.
538	Image *string `json:"image,omitempty"`
539	// ImageRegistryCredential - Image registry credential.
540	ImageRegistryCredential *ImageRegistryCredential `json:"imageRegistryCredential,omitempty"`
541	// Entrypoint - Override for the default entry point in the container.
542	Entrypoint *string `json:"entrypoint,omitempty"`
543	// Commands - Command array to execute within the container in exec form.
544	Commands *[]string `json:"commands,omitempty"`
545	// EnvironmentVariables - The environment variables to set in this container
546	EnvironmentVariables *[]EnvironmentVariable `json:"environmentVariables,omitempty"`
547	// Settings - The settings to set in this container. The setting file path can be fetched from environment variable "Fabric_SettingPath". The path for Windows container is "C:\\secrets". The path for Linux container is "/var/secrets".
548	Settings *[]Setting `json:"settings,omitempty"`
549	// Labels - The labels to set in this container.
550	Labels *[]ContainerLabel `json:"labels,omitempty"`
551	// Endpoints - The endpoints exposed by this container.
552	Endpoints *[]EndpointProperties `json:"endpoints,omitempty"`
553	// Resources - This type describes the resource requirements for a container or a service.
554	Resources *ResourceRequirements `json:"resources,omitempty"`
555	// VolumeRefs - The volumes to be attached to the container.
556	VolumeRefs *[]ContainerVolume `json:"volumeRefs,omitempty"`
557	// InstanceView - READ-ONLY; Runtime information of a container instance.
558	InstanceView *ContainerInstanceView `json:"instanceView,omitempty"`
559	// Diagnostics - Reference to sinks in DiagnosticsDescription.
560	Diagnostics *DiagnosticsRef `json:"diagnostics,omitempty"`
561}
562
563// ContainerEvent a container event.
564type ContainerEvent struct {
565	// Name - The name of the container event.
566	Name *string `json:"name,omitempty"`
567	// Count - The count of the event.
568	Count *int32 `json:"count,omitempty"`
569	// FirstTimestamp - Date/time of the first event.
570	FirstTimestamp *string `json:"firstTimestamp,omitempty"`
571	// LastTimestamp - Date/time of the last event.
572	LastTimestamp *string `json:"lastTimestamp,omitempty"`
573	// Message - The event message
574	Message *string `json:"message,omitempty"`
575	// Type - The event type.
576	Type *string `json:"type,omitempty"`
577}
578
579// ContainerInstanceView runtime information of a container instance.
580type ContainerInstanceView struct {
581	// RestartCount - The number of times the container has been restarted.
582	RestartCount *int32 `json:"restartCount,omitempty"`
583	// CurrentState - Current container instance state.
584	CurrentState *ContainerState `json:"currentState,omitempty"`
585	// PreviousState - Previous container instance state.
586	PreviousState *ContainerState `json:"previousState,omitempty"`
587	// Events - The events of this container instance.
588	Events *[]ContainerEvent `json:"events,omitempty"`
589}
590
591// ContainerLabel describes a container label.
592type ContainerLabel struct {
593	// Name - The name of the container label.
594	Name *string `json:"name,omitempty"`
595	// Value - The value of the container label.
596	Value *string `json:"value,omitempty"`
597}
598
599// ContainerLogs the logs of the container.
600type ContainerLogs struct {
601	autorest.Response `json:"-"`
602	// Content - content of the log.
603	Content *string `json:"content,omitempty"`
604}
605
606// ContainerState the container state.
607type ContainerState struct {
608	// State - The state of this container
609	State *string `json:"state,omitempty"`
610	// StartTime - Date/time when the container state started.
611	StartTime *date.Time `json:"startTime,omitempty"`
612	// ExitCode - The container exit code.
613	ExitCode *string `json:"exitCode,omitempty"`
614	// FinishTime - Date/time when the container state finished.
615	FinishTime *date.Time `json:"finishTime,omitempty"`
616	// DetailStatus - Human-readable status of this state.
617	DetailStatus *string `json:"detailStatus,omitempty"`
618}
619
620// ContainerVolume describes how a volume is attached to a container.
621type ContainerVolume struct {
622	// Name - Name of the volume.
623	Name *string `json:"name,omitempty"`
624	// ReadOnly - The flag indicating whether the volume is read only. Default is 'false'.
625	ReadOnly *bool `json:"readOnly,omitempty"`
626	// DestinationPath - The path within the container at which the volume should be mounted. Only valid path characters are allowed.
627	DestinationPath *string `json:"destinationPath,omitempty"`
628}
629
630// DiagnosticsDescription describes the diagnostics options available
631type DiagnosticsDescription struct {
632	// Sinks - List of supported sinks that can be referenced.
633	Sinks *[]BasicDiagnosticsSinkProperties `json:"sinks,omitempty"`
634	// Enabled - Status of whether or not sinks are enabled.
635	Enabled *bool `json:"enabled,omitempty"`
636	// DefaultSinkRefs - The sinks to be used if diagnostics is enabled. Sink choices can be overridden at the service and code package level.
637	DefaultSinkRefs *[]string `json:"defaultSinkRefs,omitempty"`
638}
639
640// UnmarshalJSON is the custom unmarshaler for DiagnosticsDescription struct.
641func (dd *DiagnosticsDescription) UnmarshalJSON(body []byte) error {
642	var m map[string]*json.RawMessage
643	err := json.Unmarshal(body, &m)
644	if err != nil {
645		return err
646	}
647	for k, v := range m {
648		switch k {
649		case "sinks":
650			if v != nil {
651				sinks, err := unmarshalBasicDiagnosticsSinkPropertiesArray(*v)
652				if err != nil {
653					return err
654				}
655				dd.Sinks = &sinks
656			}
657		case "enabled":
658			if v != nil {
659				var enabled bool
660				err = json.Unmarshal(*v, &enabled)
661				if err != nil {
662					return err
663				}
664				dd.Enabled = &enabled
665			}
666		case "defaultSinkRefs":
667			if v != nil {
668				var defaultSinkRefs []string
669				err = json.Unmarshal(*v, &defaultSinkRefs)
670				if err != nil {
671					return err
672				}
673				dd.DefaultSinkRefs = &defaultSinkRefs
674			}
675		}
676	}
677
678	return nil
679}
680
681// DiagnosticsRef reference to sinks in DiagnosticsDescription.
682type DiagnosticsRef struct {
683	// Enabled - Status of whether or not sinks are enabled.
684	Enabled *bool `json:"enabled,omitempty"`
685	// SinkRefs - List of sinks to be used if enabled. References the list of sinks in DiagnosticsDescription.
686	SinkRefs *[]string `json:"sinkRefs,omitempty"`
687}
688
689// BasicDiagnosticsSinkProperties properties of a DiagnosticsSink.
690type BasicDiagnosticsSinkProperties interface {
691	AsAzureInternalMonitoringPipelineSinkDescription() (*AzureInternalMonitoringPipelineSinkDescription, bool)
692	AsDiagnosticsSinkProperties() (*DiagnosticsSinkProperties, bool)
693}
694
695// DiagnosticsSinkProperties properties of a DiagnosticsSink.
696type DiagnosticsSinkProperties struct {
697	// Name - Name of the sink. This value is referenced by DiagnosticsReferenceDescription
698	Name *string `json:"name,omitempty"`
699	// Description - A description of the sink.
700	Description *string `json:"description,omitempty"`
701	// Kind - Possible values include: 'KindDiagnosticsSinkProperties', 'KindAzureInternalMonitoringPipeline'
702	Kind Kind `json:"kind,omitempty"`
703}
704
705func unmarshalBasicDiagnosticsSinkProperties(body []byte) (BasicDiagnosticsSinkProperties, error) {
706	var m map[string]interface{}
707	err := json.Unmarshal(body, &m)
708	if err != nil {
709		return nil, err
710	}
711
712	switch m["kind"] {
713	case string(KindAzureInternalMonitoringPipeline):
714		var aimpsd AzureInternalMonitoringPipelineSinkDescription
715		err := json.Unmarshal(body, &aimpsd)
716		return aimpsd, err
717	default:
718		var dsp DiagnosticsSinkProperties
719		err := json.Unmarshal(body, &dsp)
720		return dsp, err
721	}
722}
723func unmarshalBasicDiagnosticsSinkPropertiesArray(body []byte) ([]BasicDiagnosticsSinkProperties, error) {
724	var rawMessages []*json.RawMessage
725	err := json.Unmarshal(body, &rawMessages)
726	if err != nil {
727		return nil, err
728	}
729
730	dspArray := make([]BasicDiagnosticsSinkProperties, len(rawMessages))
731
732	for index, rawMessage := range rawMessages {
733		dsp, err := unmarshalBasicDiagnosticsSinkProperties(*rawMessage)
734		if err != nil {
735			return nil, err
736		}
737		dspArray[index] = dsp
738	}
739	return dspArray, nil
740}
741
742// MarshalJSON is the custom marshaler for DiagnosticsSinkProperties.
743func (dsp DiagnosticsSinkProperties) MarshalJSON() ([]byte, error) {
744	dsp.Kind = KindDiagnosticsSinkProperties
745	objectMap := make(map[string]interface{})
746	if dsp.Name != nil {
747		objectMap["name"] = dsp.Name
748	}
749	if dsp.Description != nil {
750		objectMap["description"] = dsp.Description
751	}
752	if dsp.Kind != "" {
753		objectMap["kind"] = dsp.Kind
754	}
755	return json.Marshal(objectMap)
756}
757
758// AsAzureInternalMonitoringPipelineSinkDescription is the BasicDiagnosticsSinkProperties implementation for DiagnosticsSinkProperties.
759func (dsp DiagnosticsSinkProperties) AsAzureInternalMonitoringPipelineSinkDescription() (*AzureInternalMonitoringPipelineSinkDescription, bool) {
760	return nil, false
761}
762
763// AsDiagnosticsSinkProperties is the BasicDiagnosticsSinkProperties implementation for DiagnosticsSinkProperties.
764func (dsp DiagnosticsSinkProperties) AsDiagnosticsSinkProperties() (*DiagnosticsSinkProperties, bool) {
765	return &dsp, true
766}
767
768// AsBasicDiagnosticsSinkProperties is the BasicDiagnosticsSinkProperties implementation for DiagnosticsSinkProperties.
769func (dsp DiagnosticsSinkProperties) AsBasicDiagnosticsSinkProperties() (BasicDiagnosticsSinkProperties, bool) {
770	return &dsp, true
771}
772
773// EndpointProperties describes a container endpoint.
774type EndpointProperties struct {
775	// Name - The name of the endpoint.
776	Name *string `json:"name,omitempty"`
777	// Port - Port used by the container.
778	Port *int32 `json:"port,omitempty"`
779}
780
781// EnvironmentVariable describes an environment variable for the container.
782type EnvironmentVariable struct {
783	// Name - The name of the environment variable.
784	Name *string `json:"name,omitempty"`
785	// Value - The value of the environment variable.
786	Value *string `json:"value,omitempty"`
787}
788
789// ErrorModel the error details.
790type ErrorModel struct {
791	// Code - The error code.
792	Code *string `json:"code,omitempty"`
793	// Message - The error message.
794	Message *string `json:"message,omitempty"`
795}
796
797// ImageRegistryCredential image registry credential.
798type ImageRegistryCredential struct {
799	// Server - Docker image registry server, without protocol such as `http` and `https`.
800	Server *string `json:"server,omitempty"`
801	// Username - The username for the private registry.
802	Username *string `json:"username,omitempty"`
803	// Password - The password for the private registry.
804	Password *string `json:"password,omitempty"`
805}
806
807// IngressConfig describes public connectivity configuration for the network.
808type IngressConfig struct {
809	// QosLevel - The QoS tier for ingress. Possible values include: 'Bronze'
810	QosLevel IngressQoSLevel `json:"qosLevel,omitempty"`
811	// Layer4 - Configuration for layer4 public connectivity for this network.
812	Layer4 *[]Layer4IngressConfig `json:"layer4,omitempty"`
813	// PublicIPAddress - READ-ONLY; The public IP address for reaching this network.
814	PublicIPAddress *string `json:"publicIPAddress,omitempty"`
815}
816
817// Layer4IngressConfig describes the layer4 configuration for public connectivity for this network.
818type Layer4IngressConfig struct {
819	// Name - Layer4 ingress config name.
820	Name *string `json:"name,omitempty"`
821	// PublicPort - Specifies the public port at which the service endpoint below needs to be exposed.
822	PublicPort *int32 `json:"publicPort,omitempty"`
823	// ApplicationName - The application name which contains the service to be exposed.
824	ApplicationName *string `json:"applicationName,omitempty"`
825	// ServiceName - The service whose endpoint needs to be exposed at the public port.
826	ServiceName *string `json:"serviceName,omitempty"`
827	// EndpointName - The service endpoint that needs to be exposed.
828	EndpointName *string `json:"endpointName,omitempty"`
829}
830
831// ManagedProxyResource the resource model definition for Azure Resource Manager proxy resource. It will
832// have everything other than required location and tags. This proxy resource is explicitly created or
833// updated by including it in the parent resource.
834type ManagedProxyResource struct {
835	// ID - READ-ONLY; Fully qualified identifier for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
836	ID *string `json:"id,omitempty"`
837	// Name - The name of the resource
838	Name *string `json:"name,omitempty"`
839	// Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts.
840	Type *string `json:"type,omitempty"`
841}
842
843// NetworkProperties describes a network.
844type NetworkProperties struct {
845	// Description - User readable description of the network.
846	Description *string `json:"description,omitempty"`
847	// AddressPrefix - the address prefix for this network.
848	AddressPrefix *string `json:"addressPrefix,omitempty"`
849	// IngressConfig - Configuration for public connectivity for this network.
850	IngressConfig *IngressConfig `json:"ingressConfig,omitempty"`
851}
852
853// NetworkRef describes a network reference in a service.
854type NetworkRef struct {
855	// Name - Name of the network.
856	Name *string `json:"name,omitempty"`
857}
858
859// NetworkResourceDescription this type describes a network resource.
860type NetworkResourceDescription struct {
861	autorest.Response `json:"-"`
862	// NetworkResourceProperties - Describes properties of a network resource.
863	*NetworkResourceProperties `json:"properties,omitempty"`
864	// Tags - Resource tags.
865	Tags map[string]*string `json:"tags"`
866	// ID - READ-ONLY; Fully qualified identifier for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
867	ID *string `json:"id,omitempty"`
868	// Name - READ-ONLY; The name of the resource
869	Name *string `json:"name,omitempty"`
870	// Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts.
871	Type *string `json:"type,omitempty"`
872	// Location - The geo-location where the resource lives
873	Location *string `json:"location,omitempty"`
874}
875
876// MarshalJSON is the custom marshaler for NetworkResourceDescription.
877func (nrd NetworkResourceDescription) MarshalJSON() ([]byte, error) {
878	objectMap := make(map[string]interface{})
879	if nrd.NetworkResourceProperties != nil {
880		objectMap["properties"] = nrd.NetworkResourceProperties
881	}
882	if nrd.Tags != nil {
883		objectMap["tags"] = nrd.Tags
884	}
885	if nrd.Location != nil {
886		objectMap["location"] = nrd.Location
887	}
888	return json.Marshal(objectMap)
889}
890
891// UnmarshalJSON is the custom unmarshaler for NetworkResourceDescription struct.
892func (nrd *NetworkResourceDescription) UnmarshalJSON(body []byte) error {
893	var m map[string]*json.RawMessage
894	err := json.Unmarshal(body, &m)
895	if err != nil {
896		return err
897	}
898	for k, v := range m {
899		switch k {
900		case "properties":
901			if v != nil {
902				var networkResourceProperties NetworkResourceProperties
903				err = json.Unmarshal(*v, &networkResourceProperties)
904				if err != nil {
905					return err
906				}
907				nrd.NetworkResourceProperties = &networkResourceProperties
908			}
909		case "tags":
910			if v != nil {
911				var tags map[string]*string
912				err = json.Unmarshal(*v, &tags)
913				if err != nil {
914					return err
915				}
916				nrd.Tags = tags
917			}
918		case "id":
919			if v != nil {
920				var ID string
921				err = json.Unmarshal(*v, &ID)
922				if err != nil {
923					return err
924				}
925				nrd.ID = &ID
926			}
927		case "name":
928			if v != nil {
929				var name string
930				err = json.Unmarshal(*v, &name)
931				if err != nil {
932					return err
933				}
934				nrd.Name = &name
935			}
936		case "type":
937			if v != nil {
938				var typeVar string
939				err = json.Unmarshal(*v, &typeVar)
940				if err != nil {
941					return err
942				}
943				nrd.Type = &typeVar
944			}
945		case "location":
946			if v != nil {
947				var location string
948				err = json.Unmarshal(*v, &location)
949				if err != nil {
950					return err
951				}
952				nrd.Location = &location
953			}
954		}
955	}
956
957	return nil
958}
959
960// NetworkResourceDescriptionList a pageable list of network resources.
961type NetworkResourceDescriptionList struct {
962	autorest.Response `json:"-"`
963	// Value - One page of the list.
964	Value *[]NetworkResourceDescription `json:"value,omitempty"`
965	// NextLink - URI to fetch the next page of the list.
966	NextLink *string `json:"nextLink,omitempty"`
967}
968
969// NetworkResourceDescriptionListIterator provides access to a complete listing of
970// NetworkResourceDescription values.
971type NetworkResourceDescriptionListIterator struct {
972	i    int
973	page NetworkResourceDescriptionListPage
974}
975
976// NextWithContext advances to the next value.  If there was an error making
977// the request the iterator does not advance and the error is returned.
978func (iter *NetworkResourceDescriptionListIterator) NextWithContext(ctx context.Context) (err error) {
979	if tracing.IsEnabled() {
980		ctx = tracing.StartSpan(ctx, fqdn+"/NetworkResourceDescriptionListIterator.NextWithContext")
981		defer func() {
982			sc := -1
983			if iter.Response().Response.Response != nil {
984				sc = iter.Response().Response.Response.StatusCode
985			}
986			tracing.EndSpan(ctx, sc, err)
987		}()
988	}
989	iter.i++
990	if iter.i < len(iter.page.Values()) {
991		return nil
992	}
993	err = iter.page.NextWithContext(ctx)
994	if err != nil {
995		iter.i--
996		return err
997	}
998	iter.i = 0
999	return nil
1000}
1001
1002// Next advances to the next value.  If there was an error making
1003// the request the iterator does not advance and the error is returned.
1004// Deprecated: Use NextWithContext() instead.
1005func (iter *NetworkResourceDescriptionListIterator) Next() error {
1006	return iter.NextWithContext(context.Background())
1007}
1008
1009// NotDone returns true if the enumeration should be started or is not yet complete.
1010func (iter NetworkResourceDescriptionListIterator) NotDone() bool {
1011	return iter.page.NotDone() && iter.i < len(iter.page.Values())
1012}
1013
1014// Response returns the raw server response from the last page request.
1015func (iter NetworkResourceDescriptionListIterator) Response() NetworkResourceDescriptionList {
1016	return iter.page.Response()
1017}
1018
1019// Value returns the current value or a zero-initialized value if the
1020// iterator has advanced beyond the end of the collection.
1021func (iter NetworkResourceDescriptionListIterator) Value() NetworkResourceDescription {
1022	if !iter.page.NotDone() {
1023		return NetworkResourceDescription{}
1024	}
1025	return iter.page.Values()[iter.i]
1026}
1027
1028// Creates a new instance of the NetworkResourceDescriptionListIterator type.
1029func NewNetworkResourceDescriptionListIterator(page NetworkResourceDescriptionListPage) NetworkResourceDescriptionListIterator {
1030	return NetworkResourceDescriptionListIterator{page: page}
1031}
1032
1033// IsEmpty returns true if the ListResult contains no values.
1034func (nrdl NetworkResourceDescriptionList) IsEmpty() bool {
1035	return nrdl.Value == nil || len(*nrdl.Value) == 0
1036}
1037
1038// networkResourceDescriptionListPreparer prepares a request to retrieve the next set of results.
1039// It returns nil if no more results exist.
1040func (nrdl NetworkResourceDescriptionList) networkResourceDescriptionListPreparer(ctx context.Context) (*http.Request, error) {
1041	if nrdl.NextLink == nil || len(to.String(nrdl.NextLink)) < 1 {
1042		return nil, nil
1043	}
1044	return autorest.Prepare((&http.Request{}).WithContext(ctx),
1045		autorest.AsJSON(),
1046		autorest.AsGet(),
1047		autorest.WithBaseURL(to.String(nrdl.NextLink)))
1048}
1049
1050// NetworkResourceDescriptionListPage contains a page of NetworkResourceDescription values.
1051type NetworkResourceDescriptionListPage struct {
1052	fn   func(context.Context, NetworkResourceDescriptionList) (NetworkResourceDescriptionList, error)
1053	nrdl NetworkResourceDescriptionList
1054}
1055
1056// NextWithContext advances to the next page of values.  If there was an error making
1057// the request the page does not advance and the error is returned.
1058func (page *NetworkResourceDescriptionListPage) NextWithContext(ctx context.Context) (err error) {
1059	if tracing.IsEnabled() {
1060		ctx = tracing.StartSpan(ctx, fqdn+"/NetworkResourceDescriptionListPage.NextWithContext")
1061		defer func() {
1062			sc := -1
1063			if page.Response().Response.Response != nil {
1064				sc = page.Response().Response.Response.StatusCode
1065			}
1066			tracing.EndSpan(ctx, sc, err)
1067		}()
1068	}
1069	next, err := page.fn(ctx, page.nrdl)
1070	if err != nil {
1071		return err
1072	}
1073	page.nrdl = next
1074	return nil
1075}
1076
1077// Next advances to the next page of values.  If there was an error making
1078// the request the page does not advance and the error is returned.
1079// Deprecated: Use NextWithContext() instead.
1080func (page *NetworkResourceDescriptionListPage) Next() error {
1081	return page.NextWithContext(context.Background())
1082}
1083
1084// NotDone returns true if the page enumeration should be started or is not yet complete.
1085func (page NetworkResourceDescriptionListPage) NotDone() bool {
1086	return !page.nrdl.IsEmpty()
1087}
1088
1089// Response returns the raw server response from the last page request.
1090func (page NetworkResourceDescriptionListPage) Response() NetworkResourceDescriptionList {
1091	return page.nrdl
1092}
1093
1094// Values returns the slice of values for the current page or nil if there are no values.
1095func (page NetworkResourceDescriptionListPage) Values() []NetworkResourceDescription {
1096	if page.nrdl.IsEmpty() {
1097		return nil
1098	}
1099	return *page.nrdl.Value
1100}
1101
1102// Creates a new instance of the NetworkResourceDescriptionListPage type.
1103func NewNetworkResourceDescriptionListPage(getNextPage func(context.Context, NetworkResourceDescriptionList) (NetworkResourceDescriptionList, error)) NetworkResourceDescriptionListPage {
1104	return NetworkResourceDescriptionListPage{fn: getNextPage}
1105}
1106
1107// NetworkResourceProperties describes properties of a network resource.
1108type NetworkResourceProperties struct {
1109	// ProvisioningState - READ-ONLY; State of the resource.
1110	ProvisioningState *string `json:"provisioningState,omitempty"`
1111	// Description - User readable description of the network.
1112	Description *string `json:"description,omitempty"`
1113	// AddressPrefix - the address prefix for this network.
1114	AddressPrefix *string `json:"addressPrefix,omitempty"`
1115	// IngressConfig - Configuration for public connectivity for this network.
1116	IngressConfig *IngressConfig `json:"ingressConfig,omitempty"`
1117}
1118
1119// OperationListResult describes the result of the request to list Service Fabric operations.
1120type OperationListResult struct {
1121	autorest.Response `json:"-"`
1122	// Value - List of Service Fabric operations supported by the Microsoft.ServiceFabric resource provider.
1123	Value *[]OperationResult `json:"value,omitempty"`
1124	// NextLink - READ-ONLY; URL to get the next set of operation list results if there are any.
1125	NextLink *string `json:"nextLink,omitempty"`
1126}
1127
1128// OperationListResultIterator provides access to a complete listing of OperationResult values.
1129type OperationListResultIterator struct {
1130	i    int
1131	page OperationListResultPage
1132}
1133
1134// NextWithContext advances to the next value.  If there was an error making
1135// the request the iterator does not advance and the error is returned.
1136func (iter *OperationListResultIterator) NextWithContext(ctx context.Context) (err error) {
1137	if tracing.IsEnabled() {
1138		ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultIterator.NextWithContext")
1139		defer func() {
1140			sc := -1
1141			if iter.Response().Response.Response != nil {
1142				sc = iter.Response().Response.Response.StatusCode
1143			}
1144			tracing.EndSpan(ctx, sc, err)
1145		}()
1146	}
1147	iter.i++
1148	if iter.i < len(iter.page.Values()) {
1149		return nil
1150	}
1151	err = iter.page.NextWithContext(ctx)
1152	if err != nil {
1153		iter.i--
1154		return err
1155	}
1156	iter.i = 0
1157	return nil
1158}
1159
1160// Next advances to the next value.  If there was an error making
1161// the request the iterator does not advance and the error is returned.
1162// Deprecated: Use NextWithContext() instead.
1163func (iter *OperationListResultIterator) Next() error {
1164	return iter.NextWithContext(context.Background())
1165}
1166
1167// NotDone returns true if the enumeration should be started or is not yet complete.
1168func (iter OperationListResultIterator) NotDone() bool {
1169	return iter.page.NotDone() && iter.i < len(iter.page.Values())
1170}
1171
1172// Response returns the raw server response from the last page request.
1173func (iter OperationListResultIterator) Response() OperationListResult {
1174	return iter.page.Response()
1175}
1176
1177// Value returns the current value or a zero-initialized value if the
1178// iterator has advanced beyond the end of the collection.
1179func (iter OperationListResultIterator) Value() OperationResult {
1180	if !iter.page.NotDone() {
1181		return OperationResult{}
1182	}
1183	return iter.page.Values()[iter.i]
1184}
1185
1186// Creates a new instance of the OperationListResultIterator type.
1187func NewOperationListResultIterator(page OperationListResultPage) OperationListResultIterator {
1188	return OperationListResultIterator{page: page}
1189}
1190
1191// IsEmpty returns true if the ListResult contains no values.
1192func (olr OperationListResult) IsEmpty() bool {
1193	return olr.Value == nil || len(*olr.Value) == 0
1194}
1195
1196// operationListResultPreparer prepares a request to retrieve the next set of results.
1197// It returns nil if no more results exist.
1198func (olr OperationListResult) operationListResultPreparer(ctx context.Context) (*http.Request, error) {
1199	if olr.NextLink == nil || len(to.String(olr.NextLink)) < 1 {
1200		return nil, nil
1201	}
1202	return autorest.Prepare((&http.Request{}).WithContext(ctx),
1203		autorest.AsJSON(),
1204		autorest.AsGet(),
1205		autorest.WithBaseURL(to.String(olr.NextLink)))
1206}
1207
1208// OperationListResultPage contains a page of OperationResult values.
1209type OperationListResultPage struct {
1210	fn  func(context.Context, OperationListResult) (OperationListResult, error)
1211	olr OperationListResult
1212}
1213
1214// NextWithContext advances to the next page of values.  If there was an error making
1215// the request the page does not advance and the error is returned.
1216func (page *OperationListResultPage) NextWithContext(ctx context.Context) (err error) {
1217	if tracing.IsEnabled() {
1218		ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultPage.NextWithContext")
1219		defer func() {
1220			sc := -1
1221			if page.Response().Response.Response != nil {
1222				sc = page.Response().Response.Response.StatusCode
1223			}
1224			tracing.EndSpan(ctx, sc, err)
1225		}()
1226	}
1227	next, err := page.fn(ctx, page.olr)
1228	if err != nil {
1229		return err
1230	}
1231	page.olr = next
1232	return nil
1233}
1234
1235// Next advances to the next page of values.  If there was an error making
1236// the request the page does not advance and the error is returned.
1237// Deprecated: Use NextWithContext() instead.
1238func (page *OperationListResultPage) Next() error {
1239	return page.NextWithContext(context.Background())
1240}
1241
1242// NotDone returns true if the page enumeration should be started or is not yet complete.
1243func (page OperationListResultPage) NotDone() bool {
1244	return !page.olr.IsEmpty()
1245}
1246
1247// Response returns the raw server response from the last page request.
1248func (page OperationListResultPage) Response() OperationListResult {
1249	return page.olr
1250}
1251
1252// Values returns the slice of values for the current page or nil if there are no values.
1253func (page OperationListResultPage) Values() []OperationResult {
1254	if page.olr.IsEmpty() {
1255		return nil
1256	}
1257	return *page.olr.Value
1258}
1259
1260// Creates a new instance of the OperationListResultPage type.
1261func NewOperationListResultPage(getNextPage func(context.Context, OperationListResult) (OperationListResult, error)) OperationListResultPage {
1262	return OperationListResultPage{fn: getNextPage}
1263}
1264
1265// OperationResult list of operations available at the listed Azure resource provider.
1266type OperationResult struct {
1267	// Name - The name of the operation.
1268	Name *string `json:"name,omitempty"`
1269	// Display - The object that represents the operation.
1270	Display *AvailableOperationDisplay `json:"display,omitempty"`
1271	// Origin - Origin result
1272	Origin *string `json:"origin,omitempty"`
1273	// NextLink - The URL to use for getting the next set of results.
1274	NextLink *string `json:"nextLink,omitempty"`
1275}
1276
1277// ProvisionedResourceProperties describes common properties of a provisioned resource.
1278type ProvisionedResourceProperties struct {
1279	// ProvisioningState - READ-ONLY; State of the resource.
1280	ProvisioningState *string `json:"provisioningState,omitempty"`
1281}
1282
1283// ProxyResource the resource model definition for Azure Resource Manager proxy resource. It will have
1284// everything other than required location and tags.
1285type ProxyResource struct {
1286	// ID - READ-ONLY; Fully qualified identifier for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
1287	ID *string `json:"id,omitempty"`
1288	// Name - READ-ONLY; The name of the resource
1289	Name *string `json:"name,omitempty"`
1290	// Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts.
1291	Type *string `json:"type,omitempty"`
1292	// Location - The geo-location where the resource lives
1293	Location *string `json:"location,omitempty"`
1294}
1295
1296// Resource the resource model definition for Azure Resource Manager resource.
1297type Resource struct {
1298	// ID - READ-ONLY; Fully qualified identifier for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
1299	ID *string `json:"id,omitempty"`
1300	// Name - READ-ONLY; The name of the resource
1301	Name *string `json:"name,omitempty"`
1302	// Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts.
1303	Type *string `json:"type,omitempty"`
1304	// Location - The geo-location where the resource lives
1305	Location *string `json:"location,omitempty"`
1306}
1307
1308// ResourceLimits this type describes the resource limits for a given container. It describes the most
1309// amount of resources a container is allowed to use before being restarted.
1310type ResourceLimits struct {
1311	// MemoryInGB - The memory limit in GB.
1312	MemoryInGB *float64 `json:"memoryInGB,omitempty"`
1313	// CPU - CPU limits in cores. At present, only full cores are supported.
1314	CPU *float64 `json:"cpu,omitempty"`
1315}
1316
1317// ResourceRequests this type describes the requested resources for a given container. It describes the
1318// least amount of resources required for the container. A container can consume more than requested
1319// resources up to the specified limits before being restarted. Currently, the requested resources are
1320// treated as limits.
1321type ResourceRequests struct {
1322	// MemoryInGB - The memory request in GB for this container.
1323	MemoryInGB *float64 `json:"memoryInGB,omitempty"`
1324	// CPU - Requested number of CPU cores. At present, only full cores are supported.
1325	CPU *float64 `json:"cpu,omitempty"`
1326}
1327
1328// ResourceRequirements this type describes the resource requirements for a container or a service.
1329type ResourceRequirements struct {
1330	// Requests - Describes the requested resources for a given container.
1331	Requests *ResourceRequests `json:"requests,omitempty"`
1332	// Limits - Describes the maximum limits on the resources for a given container.
1333	Limits *ResourceLimits `json:"limits,omitempty"`
1334}
1335
1336// ServiceList a pageable list of all services in an application.
1337type ServiceList struct {
1338	autorest.Response `json:"-"`
1339	// Value - One page of the list.
1340	Value *[]ServiceResourceDescription `json:"value,omitempty"`
1341	// NextLink - URI to fetch the next page of the list.
1342	NextLink *string `json:"nextLink,omitempty"`
1343}
1344
1345// ServiceListIterator provides access to a complete listing of ServiceResourceDescription values.
1346type ServiceListIterator struct {
1347	i    int
1348	page ServiceListPage
1349}
1350
1351// NextWithContext advances to the next value.  If there was an error making
1352// the request the iterator does not advance and the error is returned.
1353func (iter *ServiceListIterator) NextWithContext(ctx context.Context) (err error) {
1354	if tracing.IsEnabled() {
1355		ctx = tracing.StartSpan(ctx, fqdn+"/ServiceListIterator.NextWithContext")
1356		defer func() {
1357			sc := -1
1358			if iter.Response().Response.Response != nil {
1359				sc = iter.Response().Response.Response.StatusCode
1360			}
1361			tracing.EndSpan(ctx, sc, err)
1362		}()
1363	}
1364	iter.i++
1365	if iter.i < len(iter.page.Values()) {
1366		return nil
1367	}
1368	err = iter.page.NextWithContext(ctx)
1369	if err != nil {
1370		iter.i--
1371		return err
1372	}
1373	iter.i = 0
1374	return nil
1375}
1376
1377// Next advances to the next value.  If there was an error making
1378// the request the iterator does not advance and the error is returned.
1379// Deprecated: Use NextWithContext() instead.
1380func (iter *ServiceListIterator) Next() error {
1381	return iter.NextWithContext(context.Background())
1382}
1383
1384// NotDone returns true if the enumeration should be started or is not yet complete.
1385func (iter ServiceListIterator) NotDone() bool {
1386	return iter.page.NotDone() && iter.i < len(iter.page.Values())
1387}
1388
1389// Response returns the raw server response from the last page request.
1390func (iter ServiceListIterator) Response() ServiceList {
1391	return iter.page.Response()
1392}
1393
1394// Value returns the current value or a zero-initialized value if the
1395// iterator has advanced beyond the end of the collection.
1396func (iter ServiceListIterator) Value() ServiceResourceDescription {
1397	if !iter.page.NotDone() {
1398		return ServiceResourceDescription{}
1399	}
1400	return iter.page.Values()[iter.i]
1401}
1402
1403// Creates a new instance of the ServiceListIterator type.
1404func NewServiceListIterator(page ServiceListPage) ServiceListIterator {
1405	return ServiceListIterator{page: page}
1406}
1407
1408// IsEmpty returns true if the ListResult contains no values.
1409func (sl ServiceList) IsEmpty() bool {
1410	return sl.Value == nil || len(*sl.Value) == 0
1411}
1412
1413// serviceListPreparer prepares a request to retrieve the next set of results.
1414// It returns nil if no more results exist.
1415func (sl ServiceList) serviceListPreparer(ctx context.Context) (*http.Request, error) {
1416	if sl.NextLink == nil || len(to.String(sl.NextLink)) < 1 {
1417		return nil, nil
1418	}
1419	return autorest.Prepare((&http.Request{}).WithContext(ctx),
1420		autorest.AsJSON(),
1421		autorest.AsGet(),
1422		autorest.WithBaseURL(to.String(sl.NextLink)))
1423}
1424
1425// ServiceListPage contains a page of ServiceResourceDescription values.
1426type ServiceListPage struct {
1427	fn func(context.Context, ServiceList) (ServiceList, error)
1428	sl ServiceList
1429}
1430
1431// NextWithContext advances to the next page of values.  If there was an error making
1432// the request the page does not advance and the error is returned.
1433func (page *ServiceListPage) NextWithContext(ctx context.Context) (err error) {
1434	if tracing.IsEnabled() {
1435		ctx = tracing.StartSpan(ctx, fqdn+"/ServiceListPage.NextWithContext")
1436		defer func() {
1437			sc := -1
1438			if page.Response().Response.Response != nil {
1439				sc = page.Response().Response.Response.StatusCode
1440			}
1441			tracing.EndSpan(ctx, sc, err)
1442		}()
1443	}
1444	next, err := page.fn(ctx, page.sl)
1445	if err != nil {
1446		return err
1447	}
1448	page.sl = next
1449	return nil
1450}
1451
1452// Next advances to the next page of values.  If there was an error making
1453// the request the page does not advance and the error is returned.
1454// Deprecated: Use NextWithContext() instead.
1455func (page *ServiceListPage) Next() error {
1456	return page.NextWithContext(context.Background())
1457}
1458
1459// NotDone returns true if the page enumeration should be started or is not yet complete.
1460func (page ServiceListPage) NotDone() bool {
1461	return !page.sl.IsEmpty()
1462}
1463
1464// Response returns the raw server response from the last page request.
1465func (page ServiceListPage) Response() ServiceList {
1466	return page.sl
1467}
1468
1469// Values returns the slice of values for the current page or nil if there are no values.
1470func (page ServiceListPage) Values() []ServiceResourceDescription {
1471	if page.sl.IsEmpty() {
1472		return nil
1473	}
1474	return *page.sl.Value
1475}
1476
1477// Creates a new instance of the ServiceListPage type.
1478func NewServiceListPage(getNextPage func(context.Context, ServiceList) (ServiceList, error)) ServiceListPage {
1479	return ServiceListPage{fn: getNextPage}
1480}
1481
1482// ServiceReplicaDescription this type describes a replica of a service resource.
1483type ServiceReplicaDescription struct {
1484	autorest.Response `json:"-"`
1485	// ReplicaName - Name of the replica.
1486	ReplicaName *string `json:"replicaName,omitempty"`
1487	// OsType - The Operating system type required by the code in service.
1488	// . Possible values include: 'Linux', 'Windows'
1489	OsType OperatingSystemTypes `json:"osType,omitempty"`
1490	// CodePackages - Describes the set of code packages that forms the service. A code package describes the container and the properties for running it. All the code packages are started together on the same host and share the same context (network, process etc.).
1491	CodePackages *[]ContainerCodePackageProperties `json:"codePackages,omitempty"`
1492	// NetworkRefs - The names of the private networks that this service needs to be part of.
1493	NetworkRefs *[]NetworkRef `json:"networkRefs,omitempty"`
1494	// Diagnostics - Reference to sinks in DiagnosticsDescription.
1495	Diagnostics *DiagnosticsRef `json:"diagnostics,omitempty"`
1496}
1497
1498// ServiceReplicaList a pageable list of replicas of a service resource.
1499type ServiceReplicaList struct {
1500	autorest.Response `json:"-"`
1501	// Value - One page of the list.
1502	Value *[]ServiceReplicaDescription `json:"value,omitempty"`
1503	// NextLink - URI to fetch the next page of the list.
1504	NextLink *string `json:"nextLink,omitempty"`
1505}
1506
1507// ServiceReplicaListIterator provides access to a complete listing of ServiceReplicaDescription values.
1508type ServiceReplicaListIterator struct {
1509	i    int
1510	page ServiceReplicaListPage
1511}
1512
1513// NextWithContext advances to the next value.  If there was an error making
1514// the request the iterator does not advance and the error is returned.
1515func (iter *ServiceReplicaListIterator) NextWithContext(ctx context.Context) (err error) {
1516	if tracing.IsEnabled() {
1517		ctx = tracing.StartSpan(ctx, fqdn+"/ServiceReplicaListIterator.NextWithContext")
1518		defer func() {
1519			sc := -1
1520			if iter.Response().Response.Response != nil {
1521				sc = iter.Response().Response.Response.StatusCode
1522			}
1523			tracing.EndSpan(ctx, sc, err)
1524		}()
1525	}
1526	iter.i++
1527	if iter.i < len(iter.page.Values()) {
1528		return nil
1529	}
1530	err = iter.page.NextWithContext(ctx)
1531	if err != nil {
1532		iter.i--
1533		return err
1534	}
1535	iter.i = 0
1536	return nil
1537}
1538
1539// Next advances to the next value.  If there was an error making
1540// the request the iterator does not advance and the error is returned.
1541// Deprecated: Use NextWithContext() instead.
1542func (iter *ServiceReplicaListIterator) Next() error {
1543	return iter.NextWithContext(context.Background())
1544}
1545
1546// NotDone returns true if the enumeration should be started or is not yet complete.
1547func (iter ServiceReplicaListIterator) NotDone() bool {
1548	return iter.page.NotDone() && iter.i < len(iter.page.Values())
1549}
1550
1551// Response returns the raw server response from the last page request.
1552func (iter ServiceReplicaListIterator) Response() ServiceReplicaList {
1553	return iter.page.Response()
1554}
1555
1556// Value returns the current value or a zero-initialized value if the
1557// iterator has advanced beyond the end of the collection.
1558func (iter ServiceReplicaListIterator) Value() ServiceReplicaDescription {
1559	if !iter.page.NotDone() {
1560		return ServiceReplicaDescription{}
1561	}
1562	return iter.page.Values()[iter.i]
1563}
1564
1565// Creates a new instance of the ServiceReplicaListIterator type.
1566func NewServiceReplicaListIterator(page ServiceReplicaListPage) ServiceReplicaListIterator {
1567	return ServiceReplicaListIterator{page: page}
1568}
1569
1570// IsEmpty returns true if the ListResult contains no values.
1571func (srl ServiceReplicaList) IsEmpty() bool {
1572	return srl.Value == nil || len(*srl.Value) == 0
1573}
1574
1575// serviceReplicaListPreparer prepares a request to retrieve the next set of results.
1576// It returns nil if no more results exist.
1577func (srl ServiceReplicaList) serviceReplicaListPreparer(ctx context.Context) (*http.Request, error) {
1578	if srl.NextLink == nil || len(to.String(srl.NextLink)) < 1 {
1579		return nil, nil
1580	}
1581	return autorest.Prepare((&http.Request{}).WithContext(ctx),
1582		autorest.AsJSON(),
1583		autorest.AsGet(),
1584		autorest.WithBaseURL(to.String(srl.NextLink)))
1585}
1586
1587// ServiceReplicaListPage contains a page of ServiceReplicaDescription values.
1588type ServiceReplicaListPage struct {
1589	fn  func(context.Context, ServiceReplicaList) (ServiceReplicaList, error)
1590	srl ServiceReplicaList
1591}
1592
1593// NextWithContext advances to the next page of values.  If there was an error making
1594// the request the page does not advance and the error is returned.
1595func (page *ServiceReplicaListPage) NextWithContext(ctx context.Context) (err error) {
1596	if tracing.IsEnabled() {
1597		ctx = tracing.StartSpan(ctx, fqdn+"/ServiceReplicaListPage.NextWithContext")
1598		defer func() {
1599			sc := -1
1600			if page.Response().Response.Response != nil {
1601				sc = page.Response().Response.Response.StatusCode
1602			}
1603			tracing.EndSpan(ctx, sc, err)
1604		}()
1605	}
1606	next, err := page.fn(ctx, page.srl)
1607	if err != nil {
1608		return err
1609	}
1610	page.srl = next
1611	return nil
1612}
1613
1614// Next advances to the next page of values.  If there was an error making
1615// the request the page does not advance and the error is returned.
1616// Deprecated: Use NextWithContext() instead.
1617func (page *ServiceReplicaListPage) Next() error {
1618	return page.NextWithContext(context.Background())
1619}
1620
1621// NotDone returns true if the page enumeration should be started or is not yet complete.
1622func (page ServiceReplicaListPage) NotDone() bool {
1623	return !page.srl.IsEmpty()
1624}
1625
1626// Response returns the raw server response from the last page request.
1627func (page ServiceReplicaListPage) Response() ServiceReplicaList {
1628	return page.srl
1629}
1630
1631// Values returns the slice of values for the current page or nil if there are no values.
1632func (page ServiceReplicaListPage) Values() []ServiceReplicaDescription {
1633	if page.srl.IsEmpty() {
1634		return nil
1635	}
1636	return *page.srl.Value
1637}
1638
1639// Creates a new instance of the ServiceReplicaListPage type.
1640func NewServiceReplicaListPage(getNextPage func(context.Context, ServiceReplicaList) (ServiceReplicaList, error)) ServiceReplicaListPage {
1641	return ServiceReplicaListPage{fn: getNextPage}
1642}
1643
1644// ServiceReplicaProperties describes the properties of a service replica.
1645type ServiceReplicaProperties struct {
1646	// OsType - The Operating system type required by the code in service.
1647	// . Possible values include: 'Linux', 'Windows'
1648	OsType OperatingSystemTypes `json:"osType,omitempty"`
1649	// CodePackages - Describes the set of code packages that forms the service. A code package describes the container and the properties for running it. All the code packages are started together on the same host and share the same context (network, process etc.).
1650	CodePackages *[]ContainerCodePackageProperties `json:"codePackages,omitempty"`
1651	// NetworkRefs - The names of the private networks that this service needs to be part of.
1652	NetworkRefs *[]NetworkRef `json:"networkRefs,omitempty"`
1653	// Diagnostics - Reference to sinks in DiagnosticsDescription.
1654	Diagnostics *DiagnosticsRef `json:"diagnostics,omitempty"`
1655}
1656
1657// ServiceResourceDescription this type describes a service resource.
1658type ServiceResourceDescription struct {
1659	autorest.Response `json:"-"`
1660	// ServiceResourceProperties - This type describes properties of a service resource.
1661	*ServiceResourceProperties `json:"properties,omitempty"`
1662	// ID - READ-ONLY; Fully qualified identifier for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
1663	ID *string `json:"id,omitempty"`
1664	// Name - The name of the resource
1665	Name *string `json:"name,omitempty"`
1666	// Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts.
1667	Type *string `json:"type,omitempty"`
1668}
1669
1670// MarshalJSON is the custom marshaler for ServiceResourceDescription.
1671func (srd ServiceResourceDescription) MarshalJSON() ([]byte, error) {
1672	objectMap := make(map[string]interface{})
1673	if srd.ServiceResourceProperties != nil {
1674		objectMap["properties"] = srd.ServiceResourceProperties
1675	}
1676	if srd.Name != nil {
1677		objectMap["name"] = srd.Name
1678	}
1679	return json.Marshal(objectMap)
1680}
1681
1682// UnmarshalJSON is the custom unmarshaler for ServiceResourceDescription struct.
1683func (srd *ServiceResourceDescription) UnmarshalJSON(body []byte) error {
1684	var m map[string]*json.RawMessage
1685	err := json.Unmarshal(body, &m)
1686	if err != nil {
1687		return err
1688	}
1689	for k, v := range m {
1690		switch k {
1691		case "properties":
1692			if v != nil {
1693				var serviceResourceProperties ServiceResourceProperties
1694				err = json.Unmarshal(*v, &serviceResourceProperties)
1695				if err != nil {
1696					return err
1697				}
1698				srd.ServiceResourceProperties = &serviceResourceProperties
1699			}
1700		case "id":
1701			if v != nil {
1702				var ID string
1703				err = json.Unmarshal(*v, &ID)
1704				if err != nil {
1705					return err
1706				}
1707				srd.ID = &ID
1708			}
1709		case "name":
1710			if v != nil {
1711				var name string
1712				err = json.Unmarshal(*v, &name)
1713				if err != nil {
1714					return err
1715				}
1716				srd.Name = &name
1717			}
1718		case "type":
1719			if v != nil {
1720				var typeVar string
1721				err = json.Unmarshal(*v, &typeVar)
1722				if err != nil {
1723					return err
1724				}
1725				srd.Type = &typeVar
1726			}
1727		}
1728	}
1729
1730	return nil
1731}
1732
1733// ServiceResourceProperties this type describes properties of a service resource.
1734type ServiceResourceProperties struct {
1735	// Description - User readable description of the service.
1736	Description *string `json:"description,omitempty"`
1737	// ReplicaCount - The number of replicas of the service to create. Defaults to 1 if not specified.
1738	ReplicaCount *int32 `json:"replicaCount,omitempty"`
1739	// HealthState - The health state of a resource such as Application, Service, or Network. Possible values include: 'HealthStateInvalid', 'HealthStateOk', 'HealthStateWarning', 'HealthStateError', 'HealthStateUnknown'
1740	HealthState HealthState `json:"healthState,omitempty"`
1741	// Status - READ-ONLY; Represents the status of the service. Possible values include: 'ServiceResourceStatusUnknown', 'ServiceResourceStatusActive', 'ServiceResourceStatusUpgrading', 'ServiceResourceStatusDeleting', 'ServiceResourceStatusCreating', 'ServiceResourceStatusFailed'
1742	Status ServiceResourceStatus `json:"status,omitempty"`
1743	// OsType - The Operating system type required by the code in service.
1744	// . Possible values include: 'Linux', 'Windows'
1745	OsType OperatingSystemTypes `json:"osType,omitempty"`
1746	// CodePackages - Describes the set of code packages that forms the service. A code package describes the container and the properties for running it. All the code packages are started together on the same host and share the same context (network, process etc.).
1747	CodePackages *[]ContainerCodePackageProperties `json:"codePackages,omitempty"`
1748	// NetworkRefs - The names of the private networks that this service needs to be part of.
1749	NetworkRefs *[]NetworkRef `json:"networkRefs,omitempty"`
1750	// Diagnostics - Reference to sinks in DiagnosticsDescription.
1751	Diagnostics *DiagnosticsRef `json:"diagnostics,omitempty"`
1752}
1753
1754// Setting describes a setting for the container.
1755type Setting struct {
1756	// Name - The name of the setting.
1757	Name *string `json:"name,omitempty"`
1758	// Value - The value of the setting.
1759	Value *string `json:"value,omitempty"`
1760}
1761
1762// TrackedResource the resource model definition for Azure Resource Manager tracked top-level resource.
1763type TrackedResource struct {
1764	// Tags - Resource tags.
1765	Tags map[string]*string `json:"tags"`
1766	// ID - READ-ONLY; Fully qualified identifier for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
1767	ID *string `json:"id,omitempty"`
1768	// Name - READ-ONLY; The name of the resource
1769	Name *string `json:"name,omitempty"`
1770	// Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts.
1771	Type *string `json:"type,omitempty"`
1772	// Location - The geo-location where the resource lives
1773	Location *string `json:"location,omitempty"`
1774}
1775
1776// MarshalJSON is the custom marshaler for TrackedResource.
1777func (tr TrackedResource) MarshalJSON() ([]byte, error) {
1778	objectMap := make(map[string]interface{})
1779	if tr.Tags != nil {
1780		objectMap["tags"] = tr.Tags
1781	}
1782	if tr.Location != nil {
1783		objectMap["location"] = tr.Location
1784	}
1785	return json.Marshal(objectMap)
1786}
1787
1788// VolumeProperties this type describes properties of a volume resource.
1789type VolumeProperties struct {
1790	// Description - User readable description of the volume.
1791	Description *string `json:"description,omitempty"`
1792	// Provider - Provider of the volume.
1793	Provider *string `json:"provider,omitempty"`
1794	// AzureFileParameters - This type describes a volume provided by an Azure Files file share.
1795	AzureFileParameters *VolumeProviderParametersAzureFile `json:"azureFileParameters,omitempty"`
1796}
1797
1798// VolumeProviderParametersAzureFile this type describes a volume provided by an Azure Files file share.
1799type VolumeProviderParametersAzureFile struct {
1800	// AccountName - Name of the Azure storage account for the File Share.
1801	AccountName *string `json:"accountName,omitempty"`
1802	// AccountKey - Access key of the Azure storage account for the File Share.
1803	AccountKey *string `json:"accountKey,omitempty"`
1804	// ShareName - Name of the Azure Files file share that provides storage for the volume.
1805	ShareName *string `json:"shareName,omitempty"`
1806}
1807
1808// VolumeResourceDescription this type describes a volume resource.
1809type VolumeResourceDescription struct {
1810	autorest.Response `json:"-"`
1811	// VolumeResourceProperties - Describes properties of a volume resource.
1812	*VolumeResourceProperties `json:"properties,omitempty"`
1813	// Tags - Resource tags.
1814	Tags map[string]*string `json:"tags"`
1815	// ID - READ-ONLY; Fully qualified identifier for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
1816	ID *string `json:"id,omitempty"`
1817	// Name - READ-ONLY; The name of the resource
1818	Name *string `json:"name,omitempty"`
1819	// Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts.
1820	Type *string `json:"type,omitempty"`
1821	// Location - The geo-location where the resource lives
1822	Location *string `json:"location,omitempty"`
1823}
1824
1825// MarshalJSON is the custom marshaler for VolumeResourceDescription.
1826func (vrd VolumeResourceDescription) MarshalJSON() ([]byte, error) {
1827	objectMap := make(map[string]interface{})
1828	if vrd.VolumeResourceProperties != nil {
1829		objectMap["properties"] = vrd.VolumeResourceProperties
1830	}
1831	if vrd.Tags != nil {
1832		objectMap["tags"] = vrd.Tags
1833	}
1834	if vrd.Location != nil {
1835		objectMap["location"] = vrd.Location
1836	}
1837	return json.Marshal(objectMap)
1838}
1839
1840// UnmarshalJSON is the custom unmarshaler for VolumeResourceDescription struct.
1841func (vrd *VolumeResourceDescription) UnmarshalJSON(body []byte) error {
1842	var m map[string]*json.RawMessage
1843	err := json.Unmarshal(body, &m)
1844	if err != nil {
1845		return err
1846	}
1847	for k, v := range m {
1848		switch k {
1849		case "properties":
1850			if v != nil {
1851				var volumeResourceProperties VolumeResourceProperties
1852				err = json.Unmarshal(*v, &volumeResourceProperties)
1853				if err != nil {
1854					return err
1855				}
1856				vrd.VolumeResourceProperties = &volumeResourceProperties
1857			}
1858		case "tags":
1859			if v != nil {
1860				var tags map[string]*string
1861				err = json.Unmarshal(*v, &tags)
1862				if err != nil {
1863					return err
1864				}
1865				vrd.Tags = tags
1866			}
1867		case "id":
1868			if v != nil {
1869				var ID string
1870				err = json.Unmarshal(*v, &ID)
1871				if err != nil {
1872					return err
1873				}
1874				vrd.ID = &ID
1875			}
1876		case "name":
1877			if v != nil {
1878				var name string
1879				err = json.Unmarshal(*v, &name)
1880				if err != nil {
1881					return err
1882				}
1883				vrd.Name = &name
1884			}
1885		case "type":
1886			if v != nil {
1887				var typeVar string
1888				err = json.Unmarshal(*v, &typeVar)
1889				if err != nil {
1890					return err
1891				}
1892				vrd.Type = &typeVar
1893			}
1894		case "location":
1895			if v != nil {
1896				var location string
1897				err = json.Unmarshal(*v, &location)
1898				if err != nil {
1899					return err
1900				}
1901				vrd.Location = &location
1902			}
1903		}
1904	}
1905
1906	return nil
1907}
1908
1909// VolumeResourceDescriptionList a pageable list of volume resources.
1910type VolumeResourceDescriptionList struct {
1911	autorest.Response `json:"-"`
1912	// Value - One page of the list.
1913	Value *[]VolumeResourceDescription `json:"value,omitempty"`
1914	// NextLink - URI to fetch the next page of the list.
1915	NextLink *string `json:"nextLink,omitempty"`
1916}
1917
1918// VolumeResourceDescriptionListIterator provides access to a complete listing of VolumeResourceDescription
1919// values.
1920type VolumeResourceDescriptionListIterator struct {
1921	i    int
1922	page VolumeResourceDescriptionListPage
1923}
1924
1925// NextWithContext advances to the next value.  If there was an error making
1926// the request the iterator does not advance and the error is returned.
1927func (iter *VolumeResourceDescriptionListIterator) NextWithContext(ctx context.Context) (err error) {
1928	if tracing.IsEnabled() {
1929		ctx = tracing.StartSpan(ctx, fqdn+"/VolumeResourceDescriptionListIterator.NextWithContext")
1930		defer func() {
1931			sc := -1
1932			if iter.Response().Response.Response != nil {
1933				sc = iter.Response().Response.Response.StatusCode
1934			}
1935			tracing.EndSpan(ctx, sc, err)
1936		}()
1937	}
1938	iter.i++
1939	if iter.i < len(iter.page.Values()) {
1940		return nil
1941	}
1942	err = iter.page.NextWithContext(ctx)
1943	if err != nil {
1944		iter.i--
1945		return err
1946	}
1947	iter.i = 0
1948	return nil
1949}
1950
1951// Next advances to the next value.  If there was an error making
1952// the request the iterator does not advance and the error is returned.
1953// Deprecated: Use NextWithContext() instead.
1954func (iter *VolumeResourceDescriptionListIterator) Next() error {
1955	return iter.NextWithContext(context.Background())
1956}
1957
1958// NotDone returns true if the enumeration should be started or is not yet complete.
1959func (iter VolumeResourceDescriptionListIterator) NotDone() bool {
1960	return iter.page.NotDone() && iter.i < len(iter.page.Values())
1961}
1962
1963// Response returns the raw server response from the last page request.
1964func (iter VolumeResourceDescriptionListIterator) Response() VolumeResourceDescriptionList {
1965	return iter.page.Response()
1966}
1967
1968// Value returns the current value or a zero-initialized value if the
1969// iterator has advanced beyond the end of the collection.
1970func (iter VolumeResourceDescriptionListIterator) Value() VolumeResourceDescription {
1971	if !iter.page.NotDone() {
1972		return VolumeResourceDescription{}
1973	}
1974	return iter.page.Values()[iter.i]
1975}
1976
1977// Creates a new instance of the VolumeResourceDescriptionListIterator type.
1978func NewVolumeResourceDescriptionListIterator(page VolumeResourceDescriptionListPage) VolumeResourceDescriptionListIterator {
1979	return VolumeResourceDescriptionListIterator{page: page}
1980}
1981
1982// IsEmpty returns true if the ListResult contains no values.
1983func (vrdl VolumeResourceDescriptionList) IsEmpty() bool {
1984	return vrdl.Value == nil || len(*vrdl.Value) == 0
1985}
1986
1987// volumeResourceDescriptionListPreparer prepares a request to retrieve the next set of results.
1988// It returns nil if no more results exist.
1989func (vrdl VolumeResourceDescriptionList) volumeResourceDescriptionListPreparer(ctx context.Context) (*http.Request, error) {
1990	if vrdl.NextLink == nil || len(to.String(vrdl.NextLink)) < 1 {
1991		return nil, nil
1992	}
1993	return autorest.Prepare((&http.Request{}).WithContext(ctx),
1994		autorest.AsJSON(),
1995		autorest.AsGet(),
1996		autorest.WithBaseURL(to.String(vrdl.NextLink)))
1997}
1998
1999// VolumeResourceDescriptionListPage contains a page of VolumeResourceDescription values.
2000type VolumeResourceDescriptionListPage struct {
2001	fn   func(context.Context, VolumeResourceDescriptionList) (VolumeResourceDescriptionList, error)
2002	vrdl VolumeResourceDescriptionList
2003}
2004
2005// NextWithContext advances to the next page of values.  If there was an error making
2006// the request the page does not advance and the error is returned.
2007func (page *VolumeResourceDescriptionListPage) NextWithContext(ctx context.Context) (err error) {
2008	if tracing.IsEnabled() {
2009		ctx = tracing.StartSpan(ctx, fqdn+"/VolumeResourceDescriptionListPage.NextWithContext")
2010		defer func() {
2011			sc := -1
2012			if page.Response().Response.Response != nil {
2013				sc = page.Response().Response.Response.StatusCode
2014			}
2015			tracing.EndSpan(ctx, sc, err)
2016		}()
2017	}
2018	next, err := page.fn(ctx, page.vrdl)
2019	if err != nil {
2020		return err
2021	}
2022	page.vrdl = next
2023	return nil
2024}
2025
2026// Next advances to the next page of values.  If there was an error making
2027// the request the page does not advance and the error is returned.
2028// Deprecated: Use NextWithContext() instead.
2029func (page *VolumeResourceDescriptionListPage) Next() error {
2030	return page.NextWithContext(context.Background())
2031}
2032
2033// NotDone returns true if the page enumeration should be started or is not yet complete.
2034func (page VolumeResourceDescriptionListPage) NotDone() bool {
2035	return !page.vrdl.IsEmpty()
2036}
2037
2038// Response returns the raw server response from the last page request.
2039func (page VolumeResourceDescriptionListPage) Response() VolumeResourceDescriptionList {
2040	return page.vrdl
2041}
2042
2043// Values returns the slice of values for the current page or nil if there are no values.
2044func (page VolumeResourceDescriptionListPage) Values() []VolumeResourceDescription {
2045	if page.vrdl.IsEmpty() {
2046		return nil
2047	}
2048	return *page.vrdl.Value
2049}
2050
2051// Creates a new instance of the VolumeResourceDescriptionListPage type.
2052func NewVolumeResourceDescriptionListPage(getNextPage func(context.Context, VolumeResourceDescriptionList) (VolumeResourceDescriptionList, error)) VolumeResourceDescriptionListPage {
2053	return VolumeResourceDescriptionListPage{fn: getNextPage}
2054}
2055
2056// VolumeResourceProperties describes properties of a volume resource.
2057type VolumeResourceProperties struct {
2058	// ProvisioningState - READ-ONLY; State of the resource.
2059	ProvisioningState *string `json:"provisioningState,omitempty"`
2060	// Description - User readable description of the volume.
2061	Description *string `json:"description,omitempty"`
2062	// Provider - Provider of the volume.
2063	Provider *string `json:"provider,omitempty"`
2064	// AzureFileParameters - This type describes a volume provided by an Azure Files file share.
2065	AzureFileParameters *VolumeProviderParametersAzureFile `json:"azureFileParameters,omitempty"`
2066}
2067