1package databox
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/databox/mgmt/2019-09-01/databox"
22
23// AccountCopyLogDetails copy log details for a storage account of a DataBox job
24type AccountCopyLogDetails struct {
25	// AccountName - READ-ONLY; Destination account name.
26	AccountName *string `json:"accountName,omitempty"`
27	// CopyLogLink - READ-ONLY; Link for copy logs.
28	CopyLogLink *string `json:"copyLogLink,omitempty"`
29	// CopyLogDetailsType - Possible values include: 'CopyLogDetailsTypeCopyLogDetails', 'CopyLogDetailsTypeDataBox', 'CopyLogDetailsTypeDataBoxDisk', 'CopyLogDetailsTypeDataBoxHeavy'
30	CopyLogDetailsType CopyLogDetailsType `json:"copyLogDetailsType,omitempty"`
31}
32
33// MarshalJSON is the custom marshaler for AccountCopyLogDetails.
34func (acld AccountCopyLogDetails) MarshalJSON() ([]byte, error) {
35	acld.CopyLogDetailsType = CopyLogDetailsTypeDataBox
36	objectMap := make(map[string]interface{})
37	if acld.CopyLogDetailsType != "" {
38		objectMap["copyLogDetailsType"] = acld.CopyLogDetailsType
39	}
40	return json.Marshal(objectMap)
41}
42
43// AsAccountCopyLogDetails is the BasicCopyLogDetails implementation for AccountCopyLogDetails.
44func (acld AccountCopyLogDetails) AsAccountCopyLogDetails() (*AccountCopyLogDetails, bool) {
45	return &acld, true
46}
47
48// AsDiskCopyLogDetails is the BasicCopyLogDetails implementation for AccountCopyLogDetails.
49func (acld AccountCopyLogDetails) AsDiskCopyLogDetails() (*DiskCopyLogDetails, bool) {
50	return nil, false
51}
52
53// AsHeavyAccountCopyLogDetails is the BasicCopyLogDetails implementation for AccountCopyLogDetails.
54func (acld AccountCopyLogDetails) AsHeavyAccountCopyLogDetails() (*HeavyAccountCopyLogDetails, bool) {
55	return nil, false
56}
57
58// AsCopyLogDetails is the BasicCopyLogDetails implementation for AccountCopyLogDetails.
59func (acld AccountCopyLogDetails) AsCopyLogDetails() (*CopyLogDetails, bool) {
60	return nil, false
61}
62
63// AsBasicCopyLogDetails is the BasicCopyLogDetails implementation for AccountCopyLogDetails.
64func (acld AccountCopyLogDetails) AsBasicCopyLogDetails() (BasicCopyLogDetails, bool) {
65	return &acld, true
66}
67
68// AccountCredentialDetails credential details of the account.
69type AccountCredentialDetails struct {
70	// AccountName - READ-ONLY; Name of the account.
71	AccountName *string `json:"accountName,omitempty"`
72	// DataDestinationType - READ-ONLY; Data Destination Type. Possible values include: 'StorageAccount', 'ManagedDisk'
73	DataDestinationType DataDestinationType `json:"dataDestinationType,omitempty"`
74	// AccountConnectionString - READ-ONLY; Connection string of the account endpoint to use the account as a storage endpoint on the device.
75	AccountConnectionString *string `json:"accountConnectionString,omitempty"`
76	// ShareCredentialDetails - READ-ONLY; Per share level unencrypted access credentials.
77	ShareCredentialDetails *[]ShareCredentialDetails `json:"shareCredentialDetails,omitempty"`
78}
79
80// MarshalJSON is the custom marshaler for AccountCredentialDetails.
81func (acd AccountCredentialDetails) MarshalJSON() ([]byte, error) {
82	objectMap := make(map[string]interface{})
83	return json.Marshal(objectMap)
84}
85
86// AddressValidationOutput output of the address validation api.
87type AddressValidationOutput struct {
88	autorest.Response `json:"-"`
89	// AddressValidationProperties - READ-ONLY; The address validation properties.
90	*AddressValidationProperties `json:"properties,omitempty"`
91}
92
93// MarshalJSON is the custom marshaler for AddressValidationOutput.
94func (avo AddressValidationOutput) MarshalJSON() ([]byte, error) {
95	objectMap := make(map[string]interface{})
96	return json.Marshal(objectMap)
97}
98
99// UnmarshalJSON is the custom unmarshaler for AddressValidationOutput struct.
100func (avo *AddressValidationOutput) UnmarshalJSON(body []byte) error {
101	var m map[string]*json.RawMessage
102	err := json.Unmarshal(body, &m)
103	if err != nil {
104		return err
105	}
106	for k, v := range m {
107		switch k {
108		case "properties":
109			if v != nil {
110				var addressValidationProperties AddressValidationProperties
111				err = json.Unmarshal(*v, &addressValidationProperties)
112				if err != nil {
113					return err
114				}
115				avo.AddressValidationProperties = &addressValidationProperties
116			}
117		}
118	}
119
120	return nil
121}
122
123// AddressValidationProperties the address validation output.
124type AddressValidationProperties struct {
125	// ValidationStatus - READ-ONLY; The address validation status. Possible values include: 'Valid', 'Invalid', 'Ambiguous'
126	ValidationStatus AddressValidationStatus `json:"validationStatus,omitempty"`
127	// AlternateAddresses - READ-ONLY; List of alternate addresses.
128	AlternateAddresses *[]ShippingAddress `json:"alternateAddresses,omitempty"`
129	// Error - READ-ONLY; Error code and message of validation response.
130	Error *Error `json:"error,omitempty"`
131	// ValidationType - Possible values include: 'ValidationTypeBasicValidationInputResponseValidationTypeValidationInputResponse', 'ValidationTypeBasicValidationInputResponseValidationTypeValidateAddress', 'ValidationTypeBasicValidationInputResponseValidationTypeValidateCreateOrderLimit', 'ValidationTypeBasicValidationInputResponseValidationTypeValidateDataDestinationDetails', 'ValidationTypeBasicValidationInputResponseValidationTypeValidatePreferences', 'ValidationTypeBasicValidationInputResponseValidationTypeValidateSkuAvailability', 'ValidationTypeBasicValidationInputResponseValidationTypeValidateSubscriptionIsAllowedToCreateJob'
132	ValidationType ValidationTypeBasicValidationInputResponse `json:"validationType,omitempty"`
133}
134
135// MarshalJSON is the custom marshaler for AddressValidationProperties.
136func (avp AddressValidationProperties) MarshalJSON() ([]byte, error) {
137	avp.ValidationType = ValidationTypeBasicValidationInputResponseValidationTypeValidateAddress
138	objectMap := make(map[string]interface{})
139	if avp.ValidationType != "" {
140		objectMap["validationType"] = avp.ValidationType
141	}
142	return json.Marshal(objectMap)
143}
144
145// AsAddressValidationProperties is the BasicValidationInputResponse implementation for AddressValidationProperties.
146func (avp AddressValidationProperties) AsAddressValidationProperties() (*AddressValidationProperties, bool) {
147	return &avp, true
148}
149
150// AsCreateOrderLimitForSubscriptionValidationResponseProperties is the BasicValidationInputResponse implementation for AddressValidationProperties.
151func (avp AddressValidationProperties) AsCreateOrderLimitForSubscriptionValidationResponseProperties() (*CreateOrderLimitForSubscriptionValidationResponseProperties, bool) {
152	return nil, false
153}
154
155// AsDataDestinationDetailsValidationResponseProperties is the BasicValidationInputResponse implementation for AddressValidationProperties.
156func (avp AddressValidationProperties) AsDataDestinationDetailsValidationResponseProperties() (*DataDestinationDetailsValidationResponseProperties, bool) {
157	return nil, false
158}
159
160// AsPreferencesValidationResponseProperties is the BasicValidationInputResponse implementation for AddressValidationProperties.
161func (avp AddressValidationProperties) AsPreferencesValidationResponseProperties() (*PreferencesValidationResponseProperties, bool) {
162	return nil, false
163}
164
165// AsSkuAvailabilityValidationResponseProperties is the BasicValidationInputResponse implementation for AddressValidationProperties.
166func (avp AddressValidationProperties) AsSkuAvailabilityValidationResponseProperties() (*SkuAvailabilityValidationResponseProperties, bool) {
167	return nil, false
168}
169
170// AsSubscriptionIsAllowedToCreateJobValidationResponseProperties is the BasicValidationInputResponse implementation for AddressValidationProperties.
171func (avp AddressValidationProperties) AsSubscriptionIsAllowedToCreateJobValidationResponseProperties() (*SubscriptionIsAllowedToCreateJobValidationResponseProperties, bool) {
172	return nil, false
173}
174
175// AsValidationInputResponse is the BasicValidationInputResponse implementation for AddressValidationProperties.
176func (avp AddressValidationProperties) AsValidationInputResponse() (*ValidationInputResponse, bool) {
177	return nil, false
178}
179
180// AsBasicValidationInputResponse is the BasicValidationInputResponse implementation for AddressValidationProperties.
181func (avp AddressValidationProperties) AsBasicValidationInputResponse() (BasicValidationInputResponse, bool) {
182	return &avp, true
183}
184
185// ApplianceNetworkConfiguration the Network Adapter configuration of a DataBox.
186type ApplianceNetworkConfiguration struct {
187	// Name - READ-ONLY; Name of the network.
188	Name *string `json:"name,omitempty"`
189	// MacAddress - READ-ONLY; Mac Address.
190	MacAddress *string `json:"macAddress,omitempty"`
191}
192
193// MarshalJSON is the custom marshaler for ApplianceNetworkConfiguration.
194func (anc ApplianceNetworkConfiguration) MarshalJSON() ([]byte, error) {
195	objectMap := make(map[string]interface{})
196	return json.Marshal(objectMap)
197}
198
199// ArmBaseObject base class for all objects under resource.
200type ArmBaseObject struct {
201	// Name - READ-ONLY; Name of the object.
202	Name *string `json:"name,omitempty"`
203	// ID - READ-ONLY; Id of the object.
204	ID *string `json:"id,omitempty"`
205	// Type - READ-ONLY; Type of the object.
206	Type *string `json:"type,omitempty"`
207}
208
209// MarshalJSON is the custom marshaler for ArmBaseObject.
210func (abo ArmBaseObject) MarshalJSON() ([]byte, error) {
211	objectMap := make(map[string]interface{})
212	return json.Marshal(objectMap)
213}
214
215// AvailableSkuRequest the filters for showing the available skus.
216type AvailableSkuRequest struct {
217	// TransferType - Type of the transfer.
218	TransferType *string `json:"transferType,omitempty"`
219	// Country - ISO country code. Country for hardware shipment. For codes check: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements
220	Country *string `json:"country,omitempty"`
221	// Location - Location for data transfer. For locations check: https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01
222	Location *string `json:"location,omitempty"`
223	// SkuNames - Sku Names to filter for available skus
224	SkuNames *[]SkuName `json:"skuNames,omitempty"`
225}
226
227// AvailableSkusResult the available skus operation response.
228type AvailableSkusResult struct {
229	autorest.Response `json:"-"`
230	// Value - READ-ONLY; List of available skus.
231	Value *[]SkuInformation `json:"value,omitempty"`
232	// NextLink - Link for the next set of skus.
233	NextLink *string `json:"nextLink,omitempty"`
234}
235
236// MarshalJSON is the custom marshaler for AvailableSkusResult.
237func (asr AvailableSkusResult) MarshalJSON() ([]byte, error) {
238	objectMap := make(map[string]interface{})
239	if asr.NextLink != nil {
240		objectMap["nextLink"] = asr.NextLink
241	}
242	return json.Marshal(objectMap)
243}
244
245// AvailableSkusResultIterator provides access to a complete listing of SkuInformation values.
246type AvailableSkusResultIterator struct {
247	i    int
248	page AvailableSkusResultPage
249}
250
251// NextWithContext advances to the next value.  If there was an error making
252// the request the iterator does not advance and the error is returned.
253func (iter *AvailableSkusResultIterator) NextWithContext(ctx context.Context) (err error) {
254	if tracing.IsEnabled() {
255		ctx = tracing.StartSpan(ctx, fqdn+"/AvailableSkusResultIterator.NextWithContext")
256		defer func() {
257			sc := -1
258			if iter.Response().Response.Response != nil {
259				sc = iter.Response().Response.Response.StatusCode
260			}
261			tracing.EndSpan(ctx, sc, err)
262		}()
263	}
264	iter.i++
265	if iter.i < len(iter.page.Values()) {
266		return nil
267	}
268	err = iter.page.NextWithContext(ctx)
269	if err != nil {
270		iter.i--
271		return err
272	}
273	iter.i = 0
274	return nil
275}
276
277// Next advances to the next value.  If there was an error making
278// the request the iterator does not advance and the error is returned.
279// Deprecated: Use NextWithContext() instead.
280func (iter *AvailableSkusResultIterator) Next() error {
281	return iter.NextWithContext(context.Background())
282}
283
284// NotDone returns true if the enumeration should be started or is not yet complete.
285func (iter AvailableSkusResultIterator) NotDone() bool {
286	return iter.page.NotDone() && iter.i < len(iter.page.Values())
287}
288
289// Response returns the raw server response from the last page request.
290func (iter AvailableSkusResultIterator) Response() AvailableSkusResult {
291	return iter.page.Response()
292}
293
294// Value returns the current value or a zero-initialized value if the
295// iterator has advanced beyond the end of the collection.
296func (iter AvailableSkusResultIterator) Value() SkuInformation {
297	if !iter.page.NotDone() {
298		return SkuInformation{}
299	}
300	return iter.page.Values()[iter.i]
301}
302
303// Creates a new instance of the AvailableSkusResultIterator type.
304func NewAvailableSkusResultIterator(page AvailableSkusResultPage) AvailableSkusResultIterator {
305	return AvailableSkusResultIterator{page: page}
306}
307
308// IsEmpty returns true if the ListResult contains no values.
309func (asr AvailableSkusResult) IsEmpty() bool {
310	return asr.Value == nil || len(*asr.Value) == 0
311}
312
313// hasNextLink returns true if the NextLink is not empty.
314func (asr AvailableSkusResult) hasNextLink() bool {
315	return asr.NextLink != nil && len(*asr.NextLink) != 0
316}
317
318// availableSkusResultPreparer prepares a request to retrieve the next set of results.
319// It returns nil if no more results exist.
320func (asr AvailableSkusResult) availableSkusResultPreparer(ctx context.Context) (*http.Request, error) {
321	if !asr.hasNextLink() {
322		return nil, nil
323	}
324	return autorest.Prepare((&http.Request{}).WithContext(ctx),
325		autorest.AsJSON(),
326		autorest.AsGet(),
327		autorest.WithBaseURL(to.String(asr.NextLink)))
328}
329
330// AvailableSkusResultPage contains a page of SkuInformation values.
331type AvailableSkusResultPage struct {
332	fn  func(context.Context, AvailableSkusResult) (AvailableSkusResult, error)
333	asr AvailableSkusResult
334}
335
336// NextWithContext advances to the next page of values.  If there was an error making
337// the request the page does not advance and the error is returned.
338func (page *AvailableSkusResultPage) NextWithContext(ctx context.Context) (err error) {
339	if tracing.IsEnabled() {
340		ctx = tracing.StartSpan(ctx, fqdn+"/AvailableSkusResultPage.NextWithContext")
341		defer func() {
342			sc := -1
343			if page.Response().Response.Response != nil {
344				sc = page.Response().Response.Response.StatusCode
345			}
346			tracing.EndSpan(ctx, sc, err)
347		}()
348	}
349	for {
350		next, err := page.fn(ctx, page.asr)
351		if err != nil {
352			return err
353		}
354		page.asr = next
355		if !next.hasNextLink() || !next.IsEmpty() {
356			break
357		}
358	}
359	return nil
360}
361
362// Next advances to the next page of values.  If there was an error making
363// the request the page does not advance and the error is returned.
364// Deprecated: Use NextWithContext() instead.
365func (page *AvailableSkusResultPage) Next() error {
366	return page.NextWithContext(context.Background())
367}
368
369// NotDone returns true if the page enumeration should be started or is not yet complete.
370func (page AvailableSkusResultPage) NotDone() bool {
371	return !page.asr.IsEmpty()
372}
373
374// Response returns the raw server response from the last page request.
375func (page AvailableSkusResultPage) Response() AvailableSkusResult {
376	return page.asr
377}
378
379// Values returns the slice of values for the current page or nil if there are no values.
380func (page AvailableSkusResultPage) Values() []SkuInformation {
381	if page.asr.IsEmpty() {
382		return nil
383	}
384	return *page.asr.Value
385}
386
387// Creates a new instance of the AvailableSkusResultPage type.
388func NewAvailableSkusResultPage(cur AvailableSkusResult, getNextPage func(context.Context, AvailableSkusResult) (AvailableSkusResult, error)) AvailableSkusResultPage {
389	return AvailableSkusResultPage{
390		fn:  getNextPage,
391		asr: cur,
392	}
393}
394
395// CancellationReason reason for cancellation.
396type CancellationReason struct {
397	// Reason - Reason for cancellation.
398	Reason *string `json:"reason,omitempty"`
399}
400
401// CloudError the error information object.
402type CloudError struct {
403	// Code - READ-ONLY; Error code string.
404	Code *string `json:"code,omitempty"`
405	// Message - READ-ONLY; Descriptive error information.
406	Message *string `json:"message,omitempty"`
407	// Target - Error target
408	Target *string `json:"target,omitempty"`
409	// Details - More detailed error information.
410	Details *[]CloudError `json:"details,omitempty"`
411}
412
413// MarshalJSON is the custom marshaler for CloudError.
414func (ce CloudError) MarshalJSON() ([]byte, error) {
415	objectMap := make(map[string]interface{})
416	if ce.Target != nil {
417		objectMap["target"] = ce.Target
418	}
419	if ce.Details != nil {
420		objectMap["details"] = ce.Details
421	}
422	return json.Marshal(objectMap)
423}
424
425// ContactDetails contact Details.
426type ContactDetails struct {
427	// ContactName - Contact name of the person.
428	ContactName *string `json:"contactName,omitempty"`
429	// Phone - Phone number of the contact person.
430	Phone *string `json:"phone,omitempty"`
431	// PhoneExtension - Phone extension number of the contact person.
432	PhoneExtension *string `json:"phoneExtension,omitempty"`
433	// Mobile - Mobile number of the contact person.
434	Mobile *string `json:"mobile,omitempty"`
435	// EmailList - List of Email-ids to be notified about job progress.
436	EmailList *[]string `json:"emailList,omitempty"`
437	// NotificationPreference - Notification preference for a job stage.
438	NotificationPreference *[]NotificationPreference `json:"notificationPreference,omitempty"`
439}
440
441// BasicCopyLogDetails details for log generated during copy.
442type BasicCopyLogDetails interface {
443	AsAccountCopyLogDetails() (*AccountCopyLogDetails, bool)
444	AsDiskCopyLogDetails() (*DiskCopyLogDetails, bool)
445	AsHeavyAccountCopyLogDetails() (*HeavyAccountCopyLogDetails, bool)
446	AsCopyLogDetails() (*CopyLogDetails, bool)
447}
448
449// CopyLogDetails details for log generated during copy.
450type CopyLogDetails struct {
451	// CopyLogDetailsType - Possible values include: 'CopyLogDetailsTypeCopyLogDetails', 'CopyLogDetailsTypeDataBox', 'CopyLogDetailsTypeDataBoxDisk', 'CopyLogDetailsTypeDataBoxHeavy'
452	CopyLogDetailsType CopyLogDetailsType `json:"copyLogDetailsType,omitempty"`
453}
454
455func unmarshalBasicCopyLogDetails(body []byte) (BasicCopyLogDetails, error) {
456	var m map[string]interface{}
457	err := json.Unmarshal(body, &m)
458	if err != nil {
459		return nil, err
460	}
461
462	switch m["copyLogDetailsType"] {
463	case string(CopyLogDetailsTypeDataBox):
464		var acld AccountCopyLogDetails
465		err := json.Unmarshal(body, &acld)
466		return acld, err
467	case string(CopyLogDetailsTypeDataBoxDisk):
468		var dcld DiskCopyLogDetails
469		err := json.Unmarshal(body, &dcld)
470		return dcld, err
471	case string(CopyLogDetailsTypeDataBoxHeavy):
472		var hacld HeavyAccountCopyLogDetails
473		err := json.Unmarshal(body, &hacld)
474		return hacld, err
475	default:
476		var cld CopyLogDetails
477		err := json.Unmarshal(body, &cld)
478		return cld, err
479	}
480}
481func unmarshalBasicCopyLogDetailsArray(body []byte) ([]BasicCopyLogDetails, error) {
482	var rawMessages []*json.RawMessage
483	err := json.Unmarshal(body, &rawMessages)
484	if err != nil {
485		return nil, err
486	}
487
488	cldArray := make([]BasicCopyLogDetails, len(rawMessages))
489
490	for index, rawMessage := range rawMessages {
491		cld, err := unmarshalBasicCopyLogDetails(*rawMessage)
492		if err != nil {
493			return nil, err
494		}
495		cldArray[index] = cld
496	}
497	return cldArray, nil
498}
499
500// MarshalJSON is the custom marshaler for CopyLogDetails.
501func (cld CopyLogDetails) MarshalJSON() ([]byte, error) {
502	cld.CopyLogDetailsType = CopyLogDetailsTypeCopyLogDetails
503	objectMap := make(map[string]interface{})
504	if cld.CopyLogDetailsType != "" {
505		objectMap["copyLogDetailsType"] = cld.CopyLogDetailsType
506	}
507	return json.Marshal(objectMap)
508}
509
510// AsAccountCopyLogDetails is the BasicCopyLogDetails implementation for CopyLogDetails.
511func (cld CopyLogDetails) AsAccountCopyLogDetails() (*AccountCopyLogDetails, bool) {
512	return nil, false
513}
514
515// AsDiskCopyLogDetails is the BasicCopyLogDetails implementation for CopyLogDetails.
516func (cld CopyLogDetails) AsDiskCopyLogDetails() (*DiskCopyLogDetails, bool) {
517	return nil, false
518}
519
520// AsHeavyAccountCopyLogDetails is the BasicCopyLogDetails implementation for CopyLogDetails.
521func (cld CopyLogDetails) AsHeavyAccountCopyLogDetails() (*HeavyAccountCopyLogDetails, bool) {
522	return nil, false
523}
524
525// AsCopyLogDetails is the BasicCopyLogDetails implementation for CopyLogDetails.
526func (cld CopyLogDetails) AsCopyLogDetails() (*CopyLogDetails, bool) {
527	return &cld, true
528}
529
530// AsBasicCopyLogDetails is the BasicCopyLogDetails implementation for CopyLogDetails.
531func (cld CopyLogDetails) AsBasicCopyLogDetails() (BasicCopyLogDetails, bool) {
532	return &cld, true
533}
534
535// CopyProgress copy progress.
536type CopyProgress struct {
537	// StorageAccountName - READ-ONLY; Name of the storage account where the data needs to be uploaded.
538	StorageAccountName *string `json:"storageAccountName,omitempty"`
539	// DataDestinationType - READ-ONLY; Data Destination Type. Possible values include: 'StorageAccount', 'ManagedDisk'
540	DataDestinationType DataDestinationType `json:"dataDestinationType,omitempty"`
541	// AccountID - READ-ONLY; Id of the account where the data needs to be uploaded.
542	AccountID *string `json:"accountId,omitempty"`
543	// BytesSentToCloud - READ-ONLY; Amount of data uploaded by the job as of now.
544	BytesSentToCloud *int64 `json:"bytesSentToCloud,omitempty"`
545	// TotalBytesToProcess - READ-ONLY; Total amount of data to be processed by the job.
546	TotalBytesToProcess *int64 `json:"totalBytesToProcess,omitempty"`
547	// FilesProcessed - READ-ONLY; Number of files processed by the job as of now.
548	FilesProcessed *int64 `json:"filesProcessed,omitempty"`
549	// TotalFilesToProcess - READ-ONLY; Total number of files to be processed by the job.
550	TotalFilesToProcess *int64 `json:"totalFilesToProcess,omitempty"`
551	// InvalidFilesProcessed - READ-ONLY; Number of files not adhering to azure naming conventions which were processed by automatic renaming
552	InvalidFilesProcessed *int64 `json:"invalidFilesProcessed,omitempty"`
553	// InvalidFileBytesUploaded - READ-ONLY; Total amount of data not adhering to azure naming conventions which were processed by automatic renaming
554	InvalidFileBytesUploaded *int64 `json:"invalidFileBytesUploaded,omitempty"`
555	// RenamedContainerCount - READ-ONLY; Number of folders not adhering to azure naming conventions which were processed by automatic renaming
556	RenamedContainerCount *int64 `json:"renamedContainerCount,omitempty"`
557	// FilesErroredOut - READ-ONLY; Number of files which could not be copied
558	FilesErroredOut *int64 `json:"filesErroredOut,omitempty"`
559}
560
561// MarshalJSON is the custom marshaler for CopyProgress.
562func (cp CopyProgress) MarshalJSON() ([]byte, error) {
563	objectMap := make(map[string]interface{})
564	return json.Marshal(objectMap)
565}
566
567// CreateJobValidations it does all pre-job creation validations.
568type CreateJobValidations struct {
569	// IndividualRequestDetails - List of request details contain validationType and its request as key and value respectively.
570	IndividualRequestDetails *[]BasicValidationInputRequest `json:"individualRequestDetails,omitempty"`
571	// ValidationCategory - Possible values include: 'ValidationCategoryValidationRequest', 'ValidationCategoryJobCreationValidation'
572	ValidationCategory ValidationCategory `json:"validationCategory,omitempty"`
573}
574
575// MarshalJSON is the custom marshaler for CreateJobValidations.
576func (cjv CreateJobValidations) MarshalJSON() ([]byte, error) {
577	cjv.ValidationCategory = ValidationCategoryJobCreationValidation
578	objectMap := make(map[string]interface{})
579	if cjv.IndividualRequestDetails != nil {
580		objectMap["individualRequestDetails"] = cjv.IndividualRequestDetails
581	}
582	if cjv.ValidationCategory != "" {
583		objectMap["validationCategory"] = cjv.ValidationCategory
584	}
585	return json.Marshal(objectMap)
586}
587
588// AsCreateJobValidations is the BasicValidationRequest implementation for CreateJobValidations.
589func (cjv CreateJobValidations) AsCreateJobValidations() (*CreateJobValidations, bool) {
590	return &cjv, true
591}
592
593// AsValidationRequest is the BasicValidationRequest implementation for CreateJobValidations.
594func (cjv CreateJobValidations) AsValidationRequest() (*ValidationRequest, bool) {
595	return nil, false
596}
597
598// AsBasicValidationRequest is the BasicValidationRequest implementation for CreateJobValidations.
599func (cjv CreateJobValidations) AsBasicValidationRequest() (BasicValidationRequest, bool) {
600	return &cjv, true
601}
602
603// UnmarshalJSON is the custom unmarshaler for CreateJobValidations struct.
604func (cjv *CreateJobValidations) UnmarshalJSON(body []byte) error {
605	var m map[string]*json.RawMessage
606	err := json.Unmarshal(body, &m)
607	if err != nil {
608		return err
609	}
610	for k, v := range m {
611		switch k {
612		case "individualRequestDetails":
613			if v != nil {
614				individualRequestDetails, err := unmarshalBasicValidationInputRequestArray(*v)
615				if err != nil {
616					return err
617				}
618				cjv.IndividualRequestDetails = &individualRequestDetails
619			}
620		case "validationCategory":
621			if v != nil {
622				var validationCategory ValidationCategory
623				err = json.Unmarshal(*v, &validationCategory)
624				if err != nil {
625					return err
626				}
627				cjv.ValidationCategory = validationCategory
628			}
629		}
630	}
631
632	return nil
633}
634
635// CreateOrderLimitForSubscriptionValidationRequest request to validate create order limit for current
636// subscription.
637type CreateOrderLimitForSubscriptionValidationRequest struct {
638	// DeviceType - Device type to be used for the job. Possible values include: 'DataBox', 'DataBoxDisk', 'DataBoxHeavy'
639	DeviceType SkuName `json:"deviceType,omitempty"`
640	// ValidationType - Possible values include: 'ValidationTypeValidationInputRequest', 'ValidationTypeValidateCreateOrderLimit', 'ValidationTypeValidateDataDestinationDetails', 'ValidationTypeValidatePreferences', 'ValidationTypeValidateSkuAvailability', 'ValidationTypeValidateSubscriptionIsAllowedToCreateJob', 'ValidationTypeValidateAddress'
641	ValidationType ValidationType `json:"validationType,omitempty"`
642}
643
644// MarshalJSON is the custom marshaler for CreateOrderLimitForSubscriptionValidationRequest.
645func (colfsvr CreateOrderLimitForSubscriptionValidationRequest) MarshalJSON() ([]byte, error) {
646	colfsvr.ValidationType = ValidationTypeValidateCreateOrderLimit
647	objectMap := make(map[string]interface{})
648	if colfsvr.DeviceType != "" {
649		objectMap["deviceType"] = colfsvr.DeviceType
650	}
651	if colfsvr.ValidationType != "" {
652		objectMap["validationType"] = colfsvr.ValidationType
653	}
654	return json.Marshal(objectMap)
655}
656
657// AsCreateOrderLimitForSubscriptionValidationRequest is the BasicValidationInputRequest implementation for CreateOrderLimitForSubscriptionValidationRequest.
658func (colfsvr CreateOrderLimitForSubscriptionValidationRequest) AsCreateOrderLimitForSubscriptionValidationRequest() (*CreateOrderLimitForSubscriptionValidationRequest, bool) {
659	return &colfsvr, true
660}
661
662// AsDataDestinationDetailsValidationRequest is the BasicValidationInputRequest implementation for CreateOrderLimitForSubscriptionValidationRequest.
663func (colfsvr CreateOrderLimitForSubscriptionValidationRequest) AsDataDestinationDetailsValidationRequest() (*DataDestinationDetailsValidationRequest, bool) {
664	return nil, false
665}
666
667// AsPreferencesValidationRequest is the BasicValidationInputRequest implementation for CreateOrderLimitForSubscriptionValidationRequest.
668func (colfsvr CreateOrderLimitForSubscriptionValidationRequest) AsPreferencesValidationRequest() (*PreferencesValidationRequest, bool) {
669	return nil, false
670}
671
672// AsSkuAvailabilityValidationRequest is the BasicValidationInputRequest implementation for CreateOrderLimitForSubscriptionValidationRequest.
673func (colfsvr CreateOrderLimitForSubscriptionValidationRequest) AsSkuAvailabilityValidationRequest() (*SkuAvailabilityValidationRequest, bool) {
674	return nil, false
675}
676
677// AsSubscriptionIsAllowedToCreateJobValidationRequest is the BasicValidationInputRequest implementation for CreateOrderLimitForSubscriptionValidationRequest.
678func (colfsvr CreateOrderLimitForSubscriptionValidationRequest) AsSubscriptionIsAllowedToCreateJobValidationRequest() (*SubscriptionIsAllowedToCreateJobValidationRequest, bool) {
679	return nil, false
680}
681
682// AsValidateAddress is the BasicValidationInputRequest implementation for CreateOrderLimitForSubscriptionValidationRequest.
683func (colfsvr CreateOrderLimitForSubscriptionValidationRequest) AsValidateAddress() (*ValidateAddress, bool) {
684	return nil, false
685}
686
687// AsValidationInputRequest is the BasicValidationInputRequest implementation for CreateOrderLimitForSubscriptionValidationRequest.
688func (colfsvr CreateOrderLimitForSubscriptionValidationRequest) AsValidationInputRequest() (*ValidationInputRequest, bool) {
689	return nil, false
690}
691
692// AsBasicValidationInputRequest is the BasicValidationInputRequest implementation for CreateOrderLimitForSubscriptionValidationRequest.
693func (colfsvr CreateOrderLimitForSubscriptionValidationRequest) AsBasicValidationInputRequest() (BasicValidationInputRequest, bool) {
694	return &colfsvr, true
695}
696
697// CreateOrderLimitForSubscriptionValidationResponseProperties properties of create order limit for
698// subscription validation response.
699type CreateOrderLimitForSubscriptionValidationResponseProperties struct {
700	// Status - READ-ONLY; Create order limit validation status. Possible values include: 'ValidationStatusValid', 'ValidationStatusInvalid', 'ValidationStatusSkipped'
701	Status ValidationStatus `json:"status,omitempty"`
702	// Error - READ-ONLY; Error code and message of validation response.
703	Error *Error `json:"error,omitempty"`
704	// ValidationType - Possible values include: 'ValidationTypeBasicValidationInputResponseValidationTypeValidationInputResponse', 'ValidationTypeBasicValidationInputResponseValidationTypeValidateAddress', 'ValidationTypeBasicValidationInputResponseValidationTypeValidateCreateOrderLimit', 'ValidationTypeBasicValidationInputResponseValidationTypeValidateDataDestinationDetails', 'ValidationTypeBasicValidationInputResponseValidationTypeValidatePreferences', 'ValidationTypeBasicValidationInputResponseValidationTypeValidateSkuAvailability', 'ValidationTypeBasicValidationInputResponseValidationTypeValidateSubscriptionIsAllowedToCreateJob'
705	ValidationType ValidationTypeBasicValidationInputResponse `json:"validationType,omitempty"`
706}
707
708// MarshalJSON is the custom marshaler for CreateOrderLimitForSubscriptionValidationResponseProperties.
709func (colfsvrp CreateOrderLimitForSubscriptionValidationResponseProperties) MarshalJSON() ([]byte, error) {
710	colfsvrp.ValidationType = ValidationTypeBasicValidationInputResponseValidationTypeValidateCreateOrderLimit
711	objectMap := make(map[string]interface{})
712	if colfsvrp.ValidationType != "" {
713		objectMap["validationType"] = colfsvrp.ValidationType
714	}
715	return json.Marshal(objectMap)
716}
717
718// AsAddressValidationProperties is the BasicValidationInputResponse implementation for CreateOrderLimitForSubscriptionValidationResponseProperties.
719func (colfsvrp CreateOrderLimitForSubscriptionValidationResponseProperties) AsAddressValidationProperties() (*AddressValidationProperties, bool) {
720	return nil, false
721}
722
723// AsCreateOrderLimitForSubscriptionValidationResponseProperties is the BasicValidationInputResponse implementation for CreateOrderLimitForSubscriptionValidationResponseProperties.
724func (colfsvrp CreateOrderLimitForSubscriptionValidationResponseProperties) AsCreateOrderLimitForSubscriptionValidationResponseProperties() (*CreateOrderLimitForSubscriptionValidationResponseProperties, bool) {
725	return &colfsvrp, true
726}
727
728// AsDataDestinationDetailsValidationResponseProperties is the BasicValidationInputResponse implementation for CreateOrderLimitForSubscriptionValidationResponseProperties.
729func (colfsvrp CreateOrderLimitForSubscriptionValidationResponseProperties) AsDataDestinationDetailsValidationResponseProperties() (*DataDestinationDetailsValidationResponseProperties, bool) {
730	return nil, false
731}
732
733// AsPreferencesValidationResponseProperties is the BasicValidationInputResponse implementation for CreateOrderLimitForSubscriptionValidationResponseProperties.
734func (colfsvrp CreateOrderLimitForSubscriptionValidationResponseProperties) AsPreferencesValidationResponseProperties() (*PreferencesValidationResponseProperties, bool) {
735	return nil, false
736}
737
738// AsSkuAvailabilityValidationResponseProperties is the BasicValidationInputResponse implementation for CreateOrderLimitForSubscriptionValidationResponseProperties.
739func (colfsvrp CreateOrderLimitForSubscriptionValidationResponseProperties) AsSkuAvailabilityValidationResponseProperties() (*SkuAvailabilityValidationResponseProperties, bool) {
740	return nil, false
741}
742
743// AsSubscriptionIsAllowedToCreateJobValidationResponseProperties is the BasicValidationInputResponse implementation for CreateOrderLimitForSubscriptionValidationResponseProperties.
744func (colfsvrp CreateOrderLimitForSubscriptionValidationResponseProperties) AsSubscriptionIsAllowedToCreateJobValidationResponseProperties() (*SubscriptionIsAllowedToCreateJobValidationResponseProperties, bool) {
745	return nil, false
746}
747
748// AsValidationInputResponse is the BasicValidationInputResponse implementation for CreateOrderLimitForSubscriptionValidationResponseProperties.
749func (colfsvrp CreateOrderLimitForSubscriptionValidationResponseProperties) AsValidationInputResponse() (*ValidationInputResponse, bool) {
750	return nil, false
751}
752
753// AsBasicValidationInputResponse is the BasicValidationInputResponse implementation for CreateOrderLimitForSubscriptionValidationResponseProperties.
754func (colfsvrp CreateOrderLimitForSubscriptionValidationResponseProperties) AsBasicValidationInputResponse() (BasicValidationInputResponse, bool) {
755	return &colfsvrp, true
756}
757
758// DataDestinationDetailsValidationRequest request to validate data destination details.
759type DataDestinationDetailsValidationRequest struct {
760	// DestinationAccountDetails - Destination account details list.
761	DestinationAccountDetails *[]BasicDestinationAccountDetails `json:"destinationAccountDetails,omitempty"`
762	// Location - Location of stamp or geo.
763	Location *string `json:"location,omitempty"`
764	// ValidationType - Possible values include: 'ValidationTypeValidationInputRequest', 'ValidationTypeValidateCreateOrderLimit', 'ValidationTypeValidateDataDestinationDetails', 'ValidationTypeValidatePreferences', 'ValidationTypeValidateSkuAvailability', 'ValidationTypeValidateSubscriptionIsAllowedToCreateJob', 'ValidationTypeValidateAddress'
765	ValidationType ValidationType `json:"validationType,omitempty"`
766}
767
768// MarshalJSON is the custom marshaler for DataDestinationDetailsValidationRequest.
769func (dddvr DataDestinationDetailsValidationRequest) MarshalJSON() ([]byte, error) {
770	dddvr.ValidationType = ValidationTypeValidateDataDestinationDetails
771	objectMap := make(map[string]interface{})
772	if dddvr.DestinationAccountDetails != nil {
773		objectMap["destinationAccountDetails"] = dddvr.DestinationAccountDetails
774	}
775	if dddvr.Location != nil {
776		objectMap["location"] = dddvr.Location
777	}
778	if dddvr.ValidationType != "" {
779		objectMap["validationType"] = dddvr.ValidationType
780	}
781	return json.Marshal(objectMap)
782}
783
784// AsCreateOrderLimitForSubscriptionValidationRequest is the BasicValidationInputRequest implementation for DataDestinationDetailsValidationRequest.
785func (dddvr DataDestinationDetailsValidationRequest) AsCreateOrderLimitForSubscriptionValidationRequest() (*CreateOrderLimitForSubscriptionValidationRequest, bool) {
786	return nil, false
787}
788
789// AsDataDestinationDetailsValidationRequest is the BasicValidationInputRequest implementation for DataDestinationDetailsValidationRequest.
790func (dddvr DataDestinationDetailsValidationRequest) AsDataDestinationDetailsValidationRequest() (*DataDestinationDetailsValidationRequest, bool) {
791	return &dddvr, true
792}
793
794// AsPreferencesValidationRequest is the BasicValidationInputRequest implementation for DataDestinationDetailsValidationRequest.
795func (dddvr DataDestinationDetailsValidationRequest) AsPreferencesValidationRequest() (*PreferencesValidationRequest, bool) {
796	return nil, false
797}
798
799// AsSkuAvailabilityValidationRequest is the BasicValidationInputRequest implementation for DataDestinationDetailsValidationRequest.
800func (dddvr DataDestinationDetailsValidationRequest) AsSkuAvailabilityValidationRequest() (*SkuAvailabilityValidationRequest, bool) {
801	return nil, false
802}
803
804// AsSubscriptionIsAllowedToCreateJobValidationRequest is the BasicValidationInputRequest implementation for DataDestinationDetailsValidationRequest.
805func (dddvr DataDestinationDetailsValidationRequest) AsSubscriptionIsAllowedToCreateJobValidationRequest() (*SubscriptionIsAllowedToCreateJobValidationRequest, bool) {
806	return nil, false
807}
808
809// AsValidateAddress is the BasicValidationInputRequest implementation for DataDestinationDetailsValidationRequest.
810func (dddvr DataDestinationDetailsValidationRequest) AsValidateAddress() (*ValidateAddress, bool) {
811	return nil, false
812}
813
814// AsValidationInputRequest is the BasicValidationInputRequest implementation for DataDestinationDetailsValidationRequest.
815func (dddvr DataDestinationDetailsValidationRequest) AsValidationInputRequest() (*ValidationInputRequest, bool) {
816	return nil, false
817}
818
819// AsBasicValidationInputRequest is the BasicValidationInputRequest implementation for DataDestinationDetailsValidationRequest.
820func (dddvr DataDestinationDetailsValidationRequest) AsBasicValidationInputRequest() (BasicValidationInputRequest, bool) {
821	return &dddvr, true
822}
823
824// UnmarshalJSON is the custom unmarshaler for DataDestinationDetailsValidationRequest struct.
825func (dddvr *DataDestinationDetailsValidationRequest) UnmarshalJSON(body []byte) error {
826	var m map[string]*json.RawMessage
827	err := json.Unmarshal(body, &m)
828	if err != nil {
829		return err
830	}
831	for k, v := range m {
832		switch k {
833		case "destinationAccountDetails":
834			if v != nil {
835				destinationAccountDetails, err := unmarshalBasicDestinationAccountDetailsArray(*v)
836				if err != nil {
837					return err
838				}
839				dddvr.DestinationAccountDetails = &destinationAccountDetails
840			}
841		case "location":
842			if v != nil {
843				var location string
844				err = json.Unmarshal(*v, &location)
845				if err != nil {
846					return err
847				}
848				dddvr.Location = &location
849			}
850		case "validationType":
851			if v != nil {
852				var validationType ValidationType
853				err = json.Unmarshal(*v, &validationType)
854				if err != nil {
855					return err
856				}
857				dddvr.ValidationType = validationType
858			}
859		}
860	}
861
862	return nil
863}
864
865// DataDestinationDetailsValidationResponseProperties properties of data destination details validation
866// response.
867type DataDestinationDetailsValidationResponseProperties struct {
868	// Status - READ-ONLY; Data destination details validation status. Possible values include: 'ValidationStatusValid', 'ValidationStatusInvalid', 'ValidationStatusSkipped'
869	Status ValidationStatus `json:"status,omitempty"`
870	// Error - READ-ONLY; Error code and message of validation response.
871	Error *Error `json:"error,omitempty"`
872	// ValidationType - Possible values include: 'ValidationTypeBasicValidationInputResponseValidationTypeValidationInputResponse', 'ValidationTypeBasicValidationInputResponseValidationTypeValidateAddress', 'ValidationTypeBasicValidationInputResponseValidationTypeValidateCreateOrderLimit', 'ValidationTypeBasicValidationInputResponseValidationTypeValidateDataDestinationDetails', 'ValidationTypeBasicValidationInputResponseValidationTypeValidatePreferences', 'ValidationTypeBasicValidationInputResponseValidationTypeValidateSkuAvailability', 'ValidationTypeBasicValidationInputResponseValidationTypeValidateSubscriptionIsAllowedToCreateJob'
873	ValidationType ValidationTypeBasicValidationInputResponse `json:"validationType,omitempty"`
874}
875
876// MarshalJSON is the custom marshaler for DataDestinationDetailsValidationResponseProperties.
877func (dddvrp DataDestinationDetailsValidationResponseProperties) MarshalJSON() ([]byte, error) {
878	dddvrp.ValidationType = ValidationTypeBasicValidationInputResponseValidationTypeValidateDataDestinationDetails
879	objectMap := make(map[string]interface{})
880	if dddvrp.ValidationType != "" {
881		objectMap["validationType"] = dddvrp.ValidationType
882	}
883	return json.Marshal(objectMap)
884}
885
886// AsAddressValidationProperties is the BasicValidationInputResponse implementation for DataDestinationDetailsValidationResponseProperties.
887func (dddvrp DataDestinationDetailsValidationResponseProperties) AsAddressValidationProperties() (*AddressValidationProperties, bool) {
888	return nil, false
889}
890
891// AsCreateOrderLimitForSubscriptionValidationResponseProperties is the BasicValidationInputResponse implementation for DataDestinationDetailsValidationResponseProperties.
892func (dddvrp DataDestinationDetailsValidationResponseProperties) AsCreateOrderLimitForSubscriptionValidationResponseProperties() (*CreateOrderLimitForSubscriptionValidationResponseProperties, bool) {
893	return nil, false
894}
895
896// AsDataDestinationDetailsValidationResponseProperties is the BasicValidationInputResponse implementation for DataDestinationDetailsValidationResponseProperties.
897func (dddvrp DataDestinationDetailsValidationResponseProperties) AsDataDestinationDetailsValidationResponseProperties() (*DataDestinationDetailsValidationResponseProperties, bool) {
898	return &dddvrp, true
899}
900
901// AsPreferencesValidationResponseProperties is the BasicValidationInputResponse implementation for DataDestinationDetailsValidationResponseProperties.
902func (dddvrp DataDestinationDetailsValidationResponseProperties) AsPreferencesValidationResponseProperties() (*PreferencesValidationResponseProperties, bool) {
903	return nil, false
904}
905
906// AsSkuAvailabilityValidationResponseProperties is the BasicValidationInputResponse implementation for DataDestinationDetailsValidationResponseProperties.
907func (dddvrp DataDestinationDetailsValidationResponseProperties) AsSkuAvailabilityValidationResponseProperties() (*SkuAvailabilityValidationResponseProperties, bool) {
908	return nil, false
909}
910
911// AsSubscriptionIsAllowedToCreateJobValidationResponseProperties is the BasicValidationInputResponse implementation for DataDestinationDetailsValidationResponseProperties.
912func (dddvrp DataDestinationDetailsValidationResponseProperties) AsSubscriptionIsAllowedToCreateJobValidationResponseProperties() (*SubscriptionIsAllowedToCreateJobValidationResponseProperties, bool) {
913	return nil, false
914}
915
916// AsValidationInputResponse is the BasicValidationInputResponse implementation for DataDestinationDetailsValidationResponseProperties.
917func (dddvrp DataDestinationDetailsValidationResponseProperties) AsValidationInputResponse() (*ValidationInputResponse, bool) {
918	return nil, false
919}
920
921// AsBasicValidationInputResponse is the BasicValidationInputResponse implementation for DataDestinationDetailsValidationResponseProperties.
922func (dddvrp DataDestinationDetailsValidationResponseProperties) AsBasicValidationInputResponse() (BasicValidationInputResponse, bool) {
923	return &dddvrp, true
924}
925
926// DcAccessSecurityCode dc Access Security code for device.
927type DcAccessSecurityCode struct {
928	// ForwardDcAccessCode - Dc Access Code for dispatching from DC.
929	ForwardDcAccessCode *string `json:"forwardDcAccessCode,omitempty"`
930	// ReverseDcAccessCode - Dc Access code for dropping off at DC.
931	ReverseDcAccessCode *string `json:"reverseDcAccessCode,omitempty"`
932}
933
934// BasicDestinationAccountDetails details of the destination storage accounts.
935type BasicDestinationAccountDetails interface {
936	AsDestinationManagedDiskDetails() (*DestinationManagedDiskDetails, bool)
937	AsDestinationStorageAccountDetails() (*DestinationStorageAccountDetails, bool)
938	AsDestinationAccountDetails() (*DestinationAccountDetails, bool)
939}
940
941// DestinationAccountDetails details of the destination storage accounts.
942type DestinationAccountDetails struct {
943	// AccountID - Arm Id of the destination where the data has to be moved.
944	AccountID *string `json:"accountId,omitempty"`
945	// SharePassword - Share password to be shared by all shares in SA.
946	SharePassword *string `json:"sharePassword,omitempty"`
947	// DataDestinationType - Possible values include: 'DataDestinationTypeDestinationAccountDetails', 'DataDestinationTypeManagedDisk', 'DataDestinationTypeStorageAccount'
948	DataDestinationType DataDestinationTypeBasicDestinationAccountDetails `json:"dataDestinationType,omitempty"`
949}
950
951func unmarshalBasicDestinationAccountDetails(body []byte) (BasicDestinationAccountDetails, error) {
952	var m map[string]interface{}
953	err := json.Unmarshal(body, &m)
954	if err != nil {
955		return nil, err
956	}
957
958	switch m["dataDestinationType"] {
959	case string(DataDestinationTypeManagedDisk):
960		var dmdd DestinationManagedDiskDetails
961		err := json.Unmarshal(body, &dmdd)
962		return dmdd, err
963	case string(DataDestinationTypeStorageAccount):
964		var dsad DestinationStorageAccountDetails
965		err := json.Unmarshal(body, &dsad)
966		return dsad, err
967	default:
968		var dad DestinationAccountDetails
969		err := json.Unmarshal(body, &dad)
970		return dad, err
971	}
972}
973func unmarshalBasicDestinationAccountDetailsArray(body []byte) ([]BasicDestinationAccountDetails, error) {
974	var rawMessages []*json.RawMessage
975	err := json.Unmarshal(body, &rawMessages)
976	if err != nil {
977		return nil, err
978	}
979
980	dadArray := make([]BasicDestinationAccountDetails, len(rawMessages))
981
982	for index, rawMessage := range rawMessages {
983		dad, err := unmarshalBasicDestinationAccountDetails(*rawMessage)
984		if err != nil {
985			return nil, err
986		}
987		dadArray[index] = dad
988	}
989	return dadArray, nil
990}
991
992// MarshalJSON is the custom marshaler for DestinationAccountDetails.
993func (dad DestinationAccountDetails) MarshalJSON() ([]byte, error) {
994	dad.DataDestinationType = DataDestinationTypeDestinationAccountDetails
995	objectMap := make(map[string]interface{})
996	if dad.AccountID != nil {
997		objectMap["accountId"] = dad.AccountID
998	}
999	if dad.SharePassword != nil {
1000		objectMap["sharePassword"] = dad.SharePassword
1001	}
1002	if dad.DataDestinationType != "" {
1003		objectMap["dataDestinationType"] = dad.DataDestinationType
1004	}
1005	return json.Marshal(objectMap)
1006}
1007
1008// AsDestinationManagedDiskDetails is the BasicDestinationAccountDetails implementation for DestinationAccountDetails.
1009func (dad DestinationAccountDetails) AsDestinationManagedDiskDetails() (*DestinationManagedDiskDetails, bool) {
1010	return nil, false
1011}
1012
1013// AsDestinationStorageAccountDetails is the BasicDestinationAccountDetails implementation for DestinationAccountDetails.
1014func (dad DestinationAccountDetails) AsDestinationStorageAccountDetails() (*DestinationStorageAccountDetails, bool) {
1015	return nil, false
1016}
1017
1018// AsDestinationAccountDetails is the BasicDestinationAccountDetails implementation for DestinationAccountDetails.
1019func (dad DestinationAccountDetails) AsDestinationAccountDetails() (*DestinationAccountDetails, bool) {
1020	return &dad, true
1021}
1022
1023// AsBasicDestinationAccountDetails is the BasicDestinationAccountDetails implementation for DestinationAccountDetails.
1024func (dad DestinationAccountDetails) AsBasicDestinationAccountDetails() (BasicDestinationAccountDetails, bool) {
1025	return &dad, true
1026}
1027
1028// DestinationManagedDiskDetails details for the destination compute disks.
1029type DestinationManagedDiskDetails struct {
1030	// ResourceGroupID - Destination Resource Group Id where the Compute disks should be created.
1031	ResourceGroupID *string `json:"resourceGroupId,omitempty"`
1032	// StagingStorageAccountID - Arm Id of the storage account that can be used to copy the vhd for staging.
1033	StagingStorageAccountID *string `json:"stagingStorageAccountId,omitempty"`
1034	// AccountID - Arm Id of the destination where the data has to be moved.
1035	AccountID *string `json:"accountId,omitempty"`
1036	// SharePassword - Share password to be shared by all shares in SA.
1037	SharePassword *string `json:"sharePassword,omitempty"`
1038	// DataDestinationType - Possible values include: 'DataDestinationTypeDestinationAccountDetails', 'DataDestinationTypeManagedDisk', 'DataDestinationTypeStorageAccount'
1039	DataDestinationType DataDestinationTypeBasicDestinationAccountDetails `json:"dataDestinationType,omitempty"`
1040}
1041
1042// MarshalJSON is the custom marshaler for DestinationManagedDiskDetails.
1043func (dmdd DestinationManagedDiskDetails) MarshalJSON() ([]byte, error) {
1044	dmdd.DataDestinationType = DataDestinationTypeManagedDisk
1045	objectMap := make(map[string]interface{})
1046	if dmdd.ResourceGroupID != nil {
1047		objectMap["resourceGroupId"] = dmdd.ResourceGroupID
1048	}
1049	if dmdd.StagingStorageAccountID != nil {
1050		objectMap["stagingStorageAccountId"] = dmdd.StagingStorageAccountID
1051	}
1052	if dmdd.AccountID != nil {
1053		objectMap["accountId"] = dmdd.AccountID
1054	}
1055	if dmdd.SharePassword != nil {
1056		objectMap["sharePassword"] = dmdd.SharePassword
1057	}
1058	if dmdd.DataDestinationType != "" {
1059		objectMap["dataDestinationType"] = dmdd.DataDestinationType
1060	}
1061	return json.Marshal(objectMap)
1062}
1063
1064// AsDestinationManagedDiskDetails is the BasicDestinationAccountDetails implementation for DestinationManagedDiskDetails.
1065func (dmdd DestinationManagedDiskDetails) AsDestinationManagedDiskDetails() (*DestinationManagedDiskDetails, bool) {
1066	return &dmdd, true
1067}
1068
1069// AsDestinationStorageAccountDetails is the BasicDestinationAccountDetails implementation for DestinationManagedDiskDetails.
1070func (dmdd DestinationManagedDiskDetails) AsDestinationStorageAccountDetails() (*DestinationStorageAccountDetails, bool) {
1071	return nil, false
1072}
1073
1074// AsDestinationAccountDetails is the BasicDestinationAccountDetails implementation for DestinationManagedDiskDetails.
1075func (dmdd DestinationManagedDiskDetails) AsDestinationAccountDetails() (*DestinationAccountDetails, bool) {
1076	return nil, false
1077}
1078
1079// AsBasicDestinationAccountDetails is the BasicDestinationAccountDetails implementation for DestinationManagedDiskDetails.
1080func (dmdd DestinationManagedDiskDetails) AsBasicDestinationAccountDetails() (BasicDestinationAccountDetails, bool) {
1081	return &dmdd, true
1082}
1083
1084// DestinationStorageAccountDetails details for the destination storage account.
1085type DestinationStorageAccountDetails struct {
1086	// StorageAccountID - Destination Storage Account Arm Id.
1087	StorageAccountID *string `json:"storageAccountId,omitempty"`
1088	// AccountID - Arm Id of the destination where the data has to be moved.
1089	AccountID *string `json:"accountId,omitempty"`
1090	// SharePassword - Share password to be shared by all shares in SA.
1091	SharePassword *string `json:"sharePassword,omitempty"`
1092	// DataDestinationType - Possible values include: 'DataDestinationTypeDestinationAccountDetails', 'DataDestinationTypeManagedDisk', 'DataDestinationTypeStorageAccount'
1093	DataDestinationType DataDestinationTypeBasicDestinationAccountDetails `json:"dataDestinationType,omitempty"`
1094}
1095
1096// MarshalJSON is the custom marshaler for DestinationStorageAccountDetails.
1097func (dsad DestinationStorageAccountDetails) MarshalJSON() ([]byte, error) {
1098	dsad.DataDestinationType = DataDestinationTypeStorageAccount
1099	objectMap := make(map[string]interface{})
1100	if dsad.StorageAccountID != nil {
1101		objectMap["storageAccountId"] = dsad.StorageAccountID
1102	}
1103	if dsad.AccountID != nil {
1104		objectMap["accountId"] = dsad.AccountID
1105	}
1106	if dsad.SharePassword != nil {
1107		objectMap["sharePassword"] = dsad.SharePassword
1108	}
1109	if dsad.DataDestinationType != "" {
1110		objectMap["dataDestinationType"] = dsad.DataDestinationType
1111	}
1112	return json.Marshal(objectMap)
1113}
1114
1115// AsDestinationManagedDiskDetails is the BasicDestinationAccountDetails implementation for DestinationStorageAccountDetails.
1116func (dsad DestinationStorageAccountDetails) AsDestinationManagedDiskDetails() (*DestinationManagedDiskDetails, bool) {
1117	return nil, false
1118}
1119
1120// AsDestinationStorageAccountDetails is the BasicDestinationAccountDetails implementation for DestinationStorageAccountDetails.
1121func (dsad DestinationStorageAccountDetails) AsDestinationStorageAccountDetails() (*DestinationStorageAccountDetails, bool) {
1122	return &dsad, true
1123}
1124
1125// AsDestinationAccountDetails is the BasicDestinationAccountDetails implementation for DestinationStorageAccountDetails.
1126func (dsad DestinationStorageAccountDetails) AsDestinationAccountDetails() (*DestinationAccountDetails, bool) {
1127	return nil, false
1128}
1129
1130// AsBasicDestinationAccountDetails is the BasicDestinationAccountDetails implementation for DestinationStorageAccountDetails.
1131func (dsad DestinationStorageAccountDetails) AsBasicDestinationAccountDetails() (BasicDestinationAccountDetails, bool) {
1132	return &dsad, true
1133}
1134
1135// DestinationToServiceLocationMap map of destination location to service location.
1136type DestinationToServiceLocationMap struct {
1137	// DestinationLocation - READ-ONLY; Location of the destination.
1138	DestinationLocation *string `json:"destinationLocation,omitempty"`
1139	// ServiceLocation - READ-ONLY; Location of the service.
1140	ServiceLocation *string `json:"serviceLocation,omitempty"`
1141}
1142
1143// MarshalJSON is the custom marshaler for DestinationToServiceLocationMap.
1144func (dtslm DestinationToServiceLocationMap) MarshalJSON() ([]byte, error) {
1145	objectMap := make(map[string]interface{})
1146	return json.Marshal(objectMap)
1147}
1148
1149// DiskCopyLogDetails copy Log Details for a disk
1150type DiskCopyLogDetails struct {
1151	// DiskSerialNumber - READ-ONLY; Disk Serial Number.
1152	DiskSerialNumber *string `json:"diskSerialNumber,omitempty"`
1153	// ErrorLogLink - READ-ONLY; Link for copy error logs.
1154	ErrorLogLink *string `json:"errorLogLink,omitempty"`
1155	// VerboseLogLink - READ-ONLY; Link for copy verbose logs.
1156	VerboseLogLink *string `json:"verboseLogLink,omitempty"`
1157	// CopyLogDetailsType - Possible values include: 'CopyLogDetailsTypeCopyLogDetails', 'CopyLogDetailsTypeDataBox', 'CopyLogDetailsTypeDataBoxDisk', 'CopyLogDetailsTypeDataBoxHeavy'
1158	CopyLogDetailsType CopyLogDetailsType `json:"copyLogDetailsType,omitempty"`
1159}
1160
1161// MarshalJSON is the custom marshaler for DiskCopyLogDetails.
1162func (dcld DiskCopyLogDetails) MarshalJSON() ([]byte, error) {
1163	dcld.CopyLogDetailsType = CopyLogDetailsTypeDataBoxDisk
1164	objectMap := make(map[string]interface{})
1165	if dcld.CopyLogDetailsType != "" {
1166		objectMap["copyLogDetailsType"] = dcld.CopyLogDetailsType
1167	}
1168	return json.Marshal(objectMap)
1169}
1170
1171// AsAccountCopyLogDetails is the BasicCopyLogDetails implementation for DiskCopyLogDetails.
1172func (dcld DiskCopyLogDetails) AsAccountCopyLogDetails() (*AccountCopyLogDetails, bool) {
1173	return nil, false
1174}
1175
1176// AsDiskCopyLogDetails is the BasicCopyLogDetails implementation for DiskCopyLogDetails.
1177func (dcld DiskCopyLogDetails) AsDiskCopyLogDetails() (*DiskCopyLogDetails, bool) {
1178	return &dcld, true
1179}
1180
1181// AsHeavyAccountCopyLogDetails is the BasicCopyLogDetails implementation for DiskCopyLogDetails.
1182func (dcld DiskCopyLogDetails) AsHeavyAccountCopyLogDetails() (*HeavyAccountCopyLogDetails, bool) {
1183	return nil, false
1184}
1185
1186// AsCopyLogDetails is the BasicCopyLogDetails implementation for DiskCopyLogDetails.
1187func (dcld DiskCopyLogDetails) AsCopyLogDetails() (*CopyLogDetails, bool) {
1188	return nil, false
1189}
1190
1191// AsBasicCopyLogDetails is the BasicCopyLogDetails implementation for DiskCopyLogDetails.
1192func (dcld DiskCopyLogDetails) AsBasicCopyLogDetails() (BasicCopyLogDetails, bool) {
1193	return &dcld, true
1194}
1195
1196// DiskCopyProgress dataBox Disk Copy Progress
1197type DiskCopyProgress struct {
1198	// SerialNumber - READ-ONLY; The serial number of the disk
1199	SerialNumber *string `json:"serialNumber,omitempty"`
1200	// BytesCopied - READ-ONLY; Bytes copied during the copy of disk.
1201	BytesCopied *int64 `json:"bytesCopied,omitempty"`
1202	// PercentComplete - READ-ONLY; Indicates the percentage completed for the copy of the disk.
1203	PercentComplete *int32 `json:"percentComplete,omitempty"`
1204	// Status - READ-ONLY; The Status of the copy. Possible values include: 'NotStarted', 'InProgress', 'Completed', 'CompletedWithErrors', 'Failed', 'NotReturned', 'HardwareError', 'DeviceFormatted', 'DeviceMetadataModified', 'StorageAccountNotAccessible', 'UnsupportedData'
1205	Status CopyStatus `json:"status,omitempty"`
1206}
1207
1208// MarshalJSON is the custom marshaler for DiskCopyProgress.
1209func (dcp DiskCopyProgress) MarshalJSON() ([]byte, error) {
1210	objectMap := make(map[string]interface{})
1211	return json.Marshal(objectMap)
1212}
1213
1214// DiskJobDetails dataBox Disk Job Details.
1215type DiskJobDetails struct {
1216	// PreferredDisks - User preference on what size disks are needed for the job. The map is from the disk size in TB to the count. Eg. {2,5} means 5 disks of 2 TB size. Key is string but will be checked against an int.
1217	PreferredDisks map[string]*int32 `json:"preferredDisks"`
1218	// CopyProgress - READ-ONLY; Copy progress per disk.
1219	CopyProgress *[]DiskCopyProgress `json:"copyProgress,omitempty"`
1220	// DisksAndSizeDetails - READ-ONLY; Contains the map of disk serial number to the disk size being used for the job. Is returned only after the disks are shipped to the customer.
1221	DisksAndSizeDetails map[string]*int32 `json:"disksAndSizeDetails"`
1222	// Passkey - User entered passkey for DataBox Disk job.
1223	Passkey *string `json:"passkey,omitempty"`
1224	// ExpectedDataSizeInTerabytes - The expected size of the data, which needs to be transferred in this job, in terabytes.
1225	ExpectedDataSizeInTerabytes *int32 `json:"expectedDataSizeInTerabytes,omitempty"`
1226	// JobStages - READ-ONLY; List of stages that run in the job.
1227	JobStages *[]JobStages `json:"jobStages,omitempty"`
1228	// ContactDetails - Contact details for notification and shipping.
1229	ContactDetails *ContactDetails `json:"contactDetails,omitempty"`
1230	// ShippingAddress - Shipping address of the customer.
1231	ShippingAddress *ShippingAddress `json:"shippingAddress,omitempty"`
1232	// DeliveryPackage - READ-ONLY; Delivery package shipping details.
1233	DeliveryPackage *PackageShippingDetails `json:"deliveryPackage,omitempty"`
1234	// ReturnPackage - READ-ONLY; Return package shipping details.
1235	ReturnPackage *PackageShippingDetails `json:"returnPackage,omitempty"`
1236	// DestinationAccountDetails - Destination account details.
1237	DestinationAccountDetails *[]BasicDestinationAccountDetails `json:"destinationAccountDetails,omitempty"`
1238	// ErrorDetails - READ-ONLY; Error details for failure. This is optional.
1239	ErrorDetails *[]JobErrorDetails `json:"errorDetails,omitempty"`
1240	// Preferences - Preferences for the order.
1241	Preferences *Preferences `json:"preferences,omitempty"`
1242	// CopyLogDetails - READ-ONLY; List of copy log details.
1243	CopyLogDetails *[]BasicCopyLogDetails `json:"copyLogDetails,omitempty"`
1244	// ReverseShipmentLabelSasKey - READ-ONLY; Shared access key to download the return shipment label
1245	ReverseShipmentLabelSasKey *string `json:"reverseShipmentLabelSasKey,omitempty"`
1246	// ChainOfCustodySasKey - READ-ONLY; Shared access key to download the chain of custody logs
1247	ChainOfCustodySasKey *string `json:"chainOfCustodySasKey,omitempty"`
1248	// JobDetailsType - Possible values include: 'JobDetailsTypeJobDetails', 'JobDetailsTypeDataBoxDisk', 'JobDetailsTypeDataBoxHeavy', 'JobDetailsTypeDataBox'
1249	JobDetailsType JobDetailsTypeEnum `json:"jobDetailsType,omitempty"`
1250}
1251
1252// MarshalJSON is the custom marshaler for DiskJobDetails.
1253func (djd DiskJobDetails) MarshalJSON() ([]byte, error) {
1254	djd.JobDetailsType = JobDetailsTypeDataBoxDisk
1255	objectMap := make(map[string]interface{})
1256	if djd.PreferredDisks != nil {
1257		objectMap["preferredDisks"] = djd.PreferredDisks
1258	}
1259	if djd.Passkey != nil {
1260		objectMap["passkey"] = djd.Passkey
1261	}
1262	if djd.ExpectedDataSizeInTerabytes != nil {
1263		objectMap["expectedDataSizeInTerabytes"] = djd.ExpectedDataSizeInTerabytes
1264	}
1265	if djd.ContactDetails != nil {
1266		objectMap["contactDetails"] = djd.ContactDetails
1267	}
1268	if djd.ShippingAddress != nil {
1269		objectMap["shippingAddress"] = djd.ShippingAddress
1270	}
1271	if djd.DestinationAccountDetails != nil {
1272		objectMap["destinationAccountDetails"] = djd.DestinationAccountDetails
1273	}
1274	if djd.Preferences != nil {
1275		objectMap["preferences"] = djd.Preferences
1276	}
1277	if djd.JobDetailsType != "" {
1278		objectMap["jobDetailsType"] = djd.JobDetailsType
1279	}
1280	return json.Marshal(objectMap)
1281}
1282
1283// AsDiskJobDetails is the BasicJobDetails implementation for DiskJobDetails.
1284func (djd DiskJobDetails) AsDiskJobDetails() (*DiskJobDetails, bool) {
1285	return &djd, true
1286}
1287
1288// AsHeavyJobDetails is the BasicJobDetails implementation for DiskJobDetails.
1289func (djd DiskJobDetails) AsHeavyJobDetails() (*HeavyJobDetails, bool) {
1290	return nil, false
1291}
1292
1293// AsJobDetailsType is the BasicJobDetails implementation for DiskJobDetails.
1294func (djd DiskJobDetails) AsJobDetailsType() (*JobDetailsType, bool) {
1295	return nil, false
1296}
1297
1298// AsJobDetails is the BasicJobDetails implementation for DiskJobDetails.
1299func (djd DiskJobDetails) AsJobDetails() (*JobDetails, bool) {
1300	return nil, false
1301}
1302
1303// AsBasicJobDetails is the BasicJobDetails implementation for DiskJobDetails.
1304func (djd DiskJobDetails) AsBasicJobDetails() (BasicJobDetails, bool) {
1305	return &djd, true
1306}
1307
1308// UnmarshalJSON is the custom unmarshaler for DiskJobDetails struct.
1309func (djd *DiskJobDetails) UnmarshalJSON(body []byte) error {
1310	var m map[string]*json.RawMessage
1311	err := json.Unmarshal(body, &m)
1312	if err != nil {
1313		return err
1314	}
1315	for k, v := range m {
1316		switch k {
1317		case "preferredDisks":
1318			if v != nil {
1319				var preferredDisks map[string]*int32
1320				err = json.Unmarshal(*v, &preferredDisks)
1321				if err != nil {
1322					return err
1323				}
1324				djd.PreferredDisks = preferredDisks
1325			}
1326		case "copyProgress":
1327			if v != nil {
1328				var copyProgress []DiskCopyProgress
1329				err = json.Unmarshal(*v, &copyProgress)
1330				if err != nil {
1331					return err
1332				}
1333				djd.CopyProgress = &copyProgress
1334			}
1335		case "disksAndSizeDetails":
1336			if v != nil {
1337				var disksAndSizeDetails map[string]*int32
1338				err = json.Unmarshal(*v, &disksAndSizeDetails)
1339				if err != nil {
1340					return err
1341				}
1342				djd.DisksAndSizeDetails = disksAndSizeDetails
1343			}
1344		case "passkey":
1345			if v != nil {
1346				var passkey string
1347				err = json.Unmarshal(*v, &passkey)
1348				if err != nil {
1349					return err
1350				}
1351				djd.Passkey = &passkey
1352			}
1353		case "expectedDataSizeInTerabytes":
1354			if v != nil {
1355				var expectedDataSizeInTerabytes int32
1356				err = json.Unmarshal(*v, &expectedDataSizeInTerabytes)
1357				if err != nil {
1358					return err
1359				}
1360				djd.ExpectedDataSizeInTerabytes = &expectedDataSizeInTerabytes
1361			}
1362		case "jobStages":
1363			if v != nil {
1364				var jobStages []JobStages
1365				err = json.Unmarshal(*v, &jobStages)
1366				if err != nil {
1367					return err
1368				}
1369				djd.JobStages = &jobStages
1370			}
1371		case "contactDetails":
1372			if v != nil {
1373				var contactDetails ContactDetails
1374				err = json.Unmarshal(*v, &contactDetails)
1375				if err != nil {
1376					return err
1377				}
1378				djd.ContactDetails = &contactDetails
1379			}
1380		case "shippingAddress":
1381			if v != nil {
1382				var shippingAddress ShippingAddress
1383				err = json.Unmarshal(*v, &shippingAddress)
1384				if err != nil {
1385					return err
1386				}
1387				djd.ShippingAddress = &shippingAddress
1388			}
1389		case "deliveryPackage":
1390			if v != nil {
1391				var deliveryPackage PackageShippingDetails
1392				err = json.Unmarshal(*v, &deliveryPackage)
1393				if err != nil {
1394					return err
1395				}
1396				djd.DeliveryPackage = &deliveryPackage
1397			}
1398		case "returnPackage":
1399			if v != nil {
1400				var returnPackage PackageShippingDetails
1401				err = json.Unmarshal(*v, &returnPackage)
1402				if err != nil {
1403					return err
1404				}
1405				djd.ReturnPackage = &returnPackage
1406			}
1407		case "destinationAccountDetails":
1408			if v != nil {
1409				destinationAccountDetails, err := unmarshalBasicDestinationAccountDetailsArray(*v)
1410				if err != nil {
1411					return err
1412				}
1413				djd.DestinationAccountDetails = &destinationAccountDetails
1414			}
1415		case "errorDetails":
1416			if v != nil {
1417				var errorDetails []JobErrorDetails
1418				err = json.Unmarshal(*v, &errorDetails)
1419				if err != nil {
1420					return err
1421				}
1422				djd.ErrorDetails = &errorDetails
1423			}
1424		case "preferences":
1425			if v != nil {
1426				var preferences Preferences
1427				err = json.Unmarshal(*v, &preferences)
1428				if err != nil {
1429					return err
1430				}
1431				djd.Preferences = &preferences
1432			}
1433		case "copyLogDetails":
1434			if v != nil {
1435				copyLogDetails, err := unmarshalBasicCopyLogDetailsArray(*v)
1436				if err != nil {
1437					return err
1438				}
1439				djd.CopyLogDetails = &copyLogDetails
1440			}
1441		case "reverseShipmentLabelSasKey":
1442			if v != nil {
1443				var reverseShipmentLabelSasKey string
1444				err = json.Unmarshal(*v, &reverseShipmentLabelSasKey)
1445				if err != nil {
1446					return err
1447				}
1448				djd.ReverseShipmentLabelSasKey = &reverseShipmentLabelSasKey
1449			}
1450		case "chainOfCustodySasKey":
1451			if v != nil {
1452				var chainOfCustodySasKey string
1453				err = json.Unmarshal(*v, &chainOfCustodySasKey)
1454				if err != nil {
1455					return err
1456				}
1457				djd.ChainOfCustodySasKey = &chainOfCustodySasKey
1458			}
1459		case "jobDetailsType":
1460			if v != nil {
1461				var jobDetailsType JobDetailsTypeEnum
1462				err = json.Unmarshal(*v, &jobDetailsType)
1463				if err != nil {
1464					return err
1465				}
1466				djd.JobDetailsType = jobDetailsType
1467			}
1468		}
1469	}
1470
1471	return nil
1472}
1473
1474// DiskJobSecrets the secrets related to disk job.
1475type DiskJobSecrets struct {
1476	// DiskSecrets - READ-ONLY; Contains the list of secrets object for that device.
1477	DiskSecrets *[]DiskSecret `json:"diskSecrets,omitempty"`
1478	// PassKey - READ-ONLY; PassKey for the disk Job.
1479	PassKey *string `json:"passKey,omitempty"`
1480	// IsPasskeyUserDefined - READ-ONLY; Whether passkey was provided by user.
1481	IsPasskeyUserDefined *bool `json:"isPasskeyUserDefined,omitempty"`
1482	// DcAccessSecurityCode - Dc Access Security Code for Customer Managed Shipping
1483	DcAccessSecurityCode *DcAccessSecurityCode `json:"dcAccessSecurityCode,omitempty"`
1484	// JobSecretsType - Possible values include: 'JobSecretsTypeJobSecrets', 'JobSecretsTypeDataBoxDisk', 'JobSecretsTypeDataBoxHeavy', 'JobSecretsTypeDataBox'
1485	JobSecretsType JobSecretsTypeEnum `json:"jobSecretsType,omitempty"`
1486}
1487
1488// MarshalJSON is the custom marshaler for DiskJobSecrets.
1489func (djs DiskJobSecrets) MarshalJSON() ([]byte, error) {
1490	djs.JobSecretsType = JobSecretsTypeDataBoxDisk
1491	objectMap := make(map[string]interface{})
1492	if djs.DcAccessSecurityCode != nil {
1493		objectMap["dcAccessSecurityCode"] = djs.DcAccessSecurityCode
1494	}
1495	if djs.JobSecretsType != "" {
1496		objectMap["jobSecretsType"] = djs.JobSecretsType
1497	}
1498	return json.Marshal(objectMap)
1499}
1500
1501// AsDiskJobSecrets is the BasicJobSecrets implementation for DiskJobSecrets.
1502func (djs DiskJobSecrets) AsDiskJobSecrets() (*DiskJobSecrets, bool) {
1503	return &djs, true
1504}
1505
1506// AsHeavyJobSecrets is the BasicJobSecrets implementation for DiskJobSecrets.
1507func (djs DiskJobSecrets) AsHeavyJobSecrets() (*HeavyJobSecrets, bool) {
1508	return nil, false
1509}
1510
1511// AsJobSecretsType is the BasicJobSecrets implementation for DiskJobSecrets.
1512func (djs DiskJobSecrets) AsJobSecretsType() (*JobSecretsType, bool) {
1513	return nil, false
1514}
1515
1516// AsJobSecrets is the BasicJobSecrets implementation for DiskJobSecrets.
1517func (djs DiskJobSecrets) AsJobSecrets() (*JobSecrets, bool) {
1518	return nil, false
1519}
1520
1521// AsBasicJobSecrets is the BasicJobSecrets implementation for DiskJobSecrets.
1522func (djs DiskJobSecrets) AsBasicJobSecrets() (BasicJobSecrets, bool) {
1523	return &djs, true
1524}
1525
1526// DiskScheduleAvailabilityRequest request body to get the availability for scheduling disk orders.
1527type DiskScheduleAvailabilityRequest struct {
1528	// ExpectedDataSizeInTerabytes - The expected size of the data, which needs to be transferred in this job, in terabytes.
1529	ExpectedDataSizeInTerabytes *int32 `json:"expectedDataSizeInTerabytes,omitempty"`
1530	// StorageLocation - Location for data transfer.
1531	// For locations check: https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01
1532	StorageLocation *string `json:"storageLocation,omitempty"`
1533	// SkuName - Possible values include: 'SkuNameScheduleAvailabilityRequest', 'SkuNameDataBox', 'SkuNameDataBoxDisk', 'SkuNameDataBoxHeavy'
1534	SkuName SkuNameBasicScheduleAvailabilityRequest `json:"skuName,omitempty"`
1535}
1536
1537// MarshalJSON is the custom marshaler for DiskScheduleAvailabilityRequest.
1538func (dsar DiskScheduleAvailabilityRequest) MarshalJSON() ([]byte, error) {
1539	dsar.SkuName = SkuNameDataBoxDisk
1540	objectMap := make(map[string]interface{})
1541	if dsar.ExpectedDataSizeInTerabytes != nil {
1542		objectMap["expectedDataSizeInTerabytes"] = dsar.ExpectedDataSizeInTerabytes
1543	}
1544	if dsar.StorageLocation != nil {
1545		objectMap["storageLocation"] = dsar.StorageLocation
1546	}
1547	if dsar.SkuName != "" {
1548		objectMap["skuName"] = dsar.SkuName
1549	}
1550	return json.Marshal(objectMap)
1551}
1552
1553// AsScheduleAvailabilityRequestType is the BasicScheduleAvailabilityRequest implementation for DiskScheduleAvailabilityRequest.
1554func (dsar DiskScheduleAvailabilityRequest) AsScheduleAvailabilityRequestType() (*ScheduleAvailabilityRequestType, bool) {
1555	return nil, false
1556}
1557
1558// AsDiskScheduleAvailabilityRequest is the BasicScheduleAvailabilityRequest implementation for DiskScheduleAvailabilityRequest.
1559func (dsar DiskScheduleAvailabilityRequest) AsDiskScheduleAvailabilityRequest() (*DiskScheduleAvailabilityRequest, bool) {
1560	return &dsar, true
1561}
1562
1563// AsHeavyScheduleAvailabilityRequest is the BasicScheduleAvailabilityRequest implementation for DiskScheduleAvailabilityRequest.
1564func (dsar DiskScheduleAvailabilityRequest) AsHeavyScheduleAvailabilityRequest() (*HeavyScheduleAvailabilityRequest, bool) {
1565	return nil, false
1566}
1567
1568// AsScheduleAvailabilityRequest is the BasicScheduleAvailabilityRequest implementation for DiskScheduleAvailabilityRequest.
1569func (dsar DiskScheduleAvailabilityRequest) AsScheduleAvailabilityRequest() (*ScheduleAvailabilityRequest, bool) {
1570	return nil, false
1571}
1572
1573// AsBasicScheduleAvailabilityRequest is the BasicScheduleAvailabilityRequest implementation for DiskScheduleAvailabilityRequest.
1574func (dsar DiskScheduleAvailabilityRequest) AsBasicScheduleAvailabilityRequest() (BasicScheduleAvailabilityRequest, bool) {
1575	return &dsar, true
1576}
1577
1578// DiskSecret contains all the secrets of a Disk.
1579type DiskSecret struct {
1580	// DiskSerialNumber - READ-ONLY; Serial number of the assigned disk.
1581	DiskSerialNumber *string `json:"diskSerialNumber,omitempty"`
1582	// BitLockerKey - READ-ONLY; Bit Locker key of the disk which can be used to unlock the disk to copy data.
1583	BitLockerKey *string `json:"bitLockerKey,omitempty"`
1584}
1585
1586// MarshalJSON is the custom marshaler for DiskSecret.
1587func (ds DiskSecret) MarshalJSON() ([]byte, error) {
1588	objectMap := make(map[string]interface{})
1589	return json.Marshal(objectMap)
1590}
1591
1592// Error top level error for the job.
1593type Error struct {
1594	// Code - READ-ONLY; Error code that can be used to programmatically identify the error.
1595	Code *string `json:"code,omitempty"`
1596	// Message - READ-ONLY; Describes the error in detail and provides debugging information.
1597	Message *string `json:"message,omitempty"`
1598}
1599
1600// MarshalJSON is the custom marshaler for Error.
1601func (e Error) MarshalJSON() ([]byte, error) {
1602	objectMap := make(map[string]interface{})
1603	return json.Marshal(objectMap)
1604}
1605
1606// HeavyAccountCopyLogDetails copy log details for a storage account for Databox heavy
1607type HeavyAccountCopyLogDetails struct {
1608	// AccountName - READ-ONLY; Destination account name.
1609	AccountName *string `json:"accountName,omitempty"`
1610	// CopyLogLink - READ-ONLY; Link for copy logs.
1611	CopyLogLink *[]string `json:"copyLogLink,omitempty"`
1612	// CopyLogDetailsType - Possible values include: 'CopyLogDetailsTypeCopyLogDetails', 'CopyLogDetailsTypeDataBox', 'CopyLogDetailsTypeDataBoxDisk', 'CopyLogDetailsTypeDataBoxHeavy'
1613	CopyLogDetailsType CopyLogDetailsType `json:"copyLogDetailsType,omitempty"`
1614}
1615
1616// MarshalJSON is the custom marshaler for HeavyAccountCopyLogDetails.
1617func (hacld HeavyAccountCopyLogDetails) MarshalJSON() ([]byte, error) {
1618	hacld.CopyLogDetailsType = CopyLogDetailsTypeDataBoxHeavy
1619	objectMap := make(map[string]interface{})
1620	if hacld.CopyLogDetailsType != "" {
1621		objectMap["copyLogDetailsType"] = hacld.CopyLogDetailsType
1622	}
1623	return json.Marshal(objectMap)
1624}
1625
1626// AsAccountCopyLogDetails is the BasicCopyLogDetails implementation for HeavyAccountCopyLogDetails.
1627func (hacld HeavyAccountCopyLogDetails) AsAccountCopyLogDetails() (*AccountCopyLogDetails, bool) {
1628	return nil, false
1629}
1630
1631// AsDiskCopyLogDetails is the BasicCopyLogDetails implementation for HeavyAccountCopyLogDetails.
1632func (hacld HeavyAccountCopyLogDetails) AsDiskCopyLogDetails() (*DiskCopyLogDetails, bool) {
1633	return nil, false
1634}
1635
1636// AsHeavyAccountCopyLogDetails is the BasicCopyLogDetails implementation for HeavyAccountCopyLogDetails.
1637func (hacld HeavyAccountCopyLogDetails) AsHeavyAccountCopyLogDetails() (*HeavyAccountCopyLogDetails, bool) {
1638	return &hacld, true
1639}
1640
1641// AsCopyLogDetails is the BasicCopyLogDetails implementation for HeavyAccountCopyLogDetails.
1642func (hacld HeavyAccountCopyLogDetails) AsCopyLogDetails() (*CopyLogDetails, bool) {
1643	return nil, false
1644}
1645
1646// AsBasicCopyLogDetails is the BasicCopyLogDetails implementation for HeavyAccountCopyLogDetails.
1647func (hacld HeavyAccountCopyLogDetails) AsBasicCopyLogDetails() (BasicCopyLogDetails, bool) {
1648	return &hacld, true
1649}
1650
1651// HeavyJobDetails databox Heavy Device Job Details
1652type HeavyJobDetails struct {
1653	// CopyProgress - READ-ONLY; Copy progress per account.
1654	CopyProgress *[]CopyProgress `json:"copyProgress,omitempty"`
1655	// DevicePassword - Set Device password for unlocking Databox Heavy
1656	DevicePassword *string `json:"devicePassword,omitempty"`
1657	// ExpectedDataSizeInTerabytes - The expected size of the data, which needs to be transferred in this job, in terabytes.
1658	ExpectedDataSizeInTerabytes *int32 `json:"expectedDataSizeInTerabytes,omitempty"`
1659	// JobStages - READ-ONLY; List of stages that run in the job.
1660	JobStages *[]JobStages `json:"jobStages,omitempty"`
1661	// ContactDetails - Contact details for notification and shipping.
1662	ContactDetails *ContactDetails `json:"contactDetails,omitempty"`
1663	// ShippingAddress - Shipping address of the customer.
1664	ShippingAddress *ShippingAddress `json:"shippingAddress,omitempty"`
1665	// DeliveryPackage - READ-ONLY; Delivery package shipping details.
1666	DeliveryPackage *PackageShippingDetails `json:"deliveryPackage,omitempty"`
1667	// ReturnPackage - READ-ONLY; Return package shipping details.
1668	ReturnPackage *PackageShippingDetails `json:"returnPackage,omitempty"`
1669	// DestinationAccountDetails - Destination account details.
1670	DestinationAccountDetails *[]BasicDestinationAccountDetails `json:"destinationAccountDetails,omitempty"`
1671	// ErrorDetails - READ-ONLY; Error details for failure. This is optional.
1672	ErrorDetails *[]JobErrorDetails `json:"errorDetails,omitempty"`
1673	// Preferences - Preferences for the order.
1674	Preferences *Preferences `json:"preferences,omitempty"`
1675	// CopyLogDetails - READ-ONLY; List of copy log details.
1676	CopyLogDetails *[]BasicCopyLogDetails `json:"copyLogDetails,omitempty"`
1677	// ReverseShipmentLabelSasKey - READ-ONLY; Shared access key to download the return shipment label
1678	ReverseShipmentLabelSasKey *string `json:"reverseShipmentLabelSasKey,omitempty"`
1679	// ChainOfCustodySasKey - READ-ONLY; Shared access key to download the chain of custody logs
1680	ChainOfCustodySasKey *string `json:"chainOfCustodySasKey,omitempty"`
1681	// JobDetailsType - Possible values include: 'JobDetailsTypeJobDetails', 'JobDetailsTypeDataBoxDisk', 'JobDetailsTypeDataBoxHeavy', 'JobDetailsTypeDataBox'
1682	JobDetailsType JobDetailsTypeEnum `json:"jobDetailsType,omitempty"`
1683}
1684
1685// MarshalJSON is the custom marshaler for HeavyJobDetails.
1686func (hjd HeavyJobDetails) MarshalJSON() ([]byte, error) {
1687	hjd.JobDetailsType = JobDetailsTypeDataBoxHeavy
1688	objectMap := make(map[string]interface{})
1689	if hjd.DevicePassword != nil {
1690		objectMap["devicePassword"] = hjd.DevicePassword
1691	}
1692	if hjd.ExpectedDataSizeInTerabytes != nil {
1693		objectMap["expectedDataSizeInTerabytes"] = hjd.ExpectedDataSizeInTerabytes
1694	}
1695	if hjd.ContactDetails != nil {
1696		objectMap["contactDetails"] = hjd.ContactDetails
1697	}
1698	if hjd.ShippingAddress != nil {
1699		objectMap["shippingAddress"] = hjd.ShippingAddress
1700	}
1701	if hjd.DestinationAccountDetails != nil {
1702		objectMap["destinationAccountDetails"] = hjd.DestinationAccountDetails
1703	}
1704	if hjd.Preferences != nil {
1705		objectMap["preferences"] = hjd.Preferences
1706	}
1707	if hjd.JobDetailsType != "" {
1708		objectMap["jobDetailsType"] = hjd.JobDetailsType
1709	}
1710	return json.Marshal(objectMap)
1711}
1712
1713// AsDiskJobDetails is the BasicJobDetails implementation for HeavyJobDetails.
1714func (hjd HeavyJobDetails) AsDiskJobDetails() (*DiskJobDetails, bool) {
1715	return nil, false
1716}
1717
1718// AsHeavyJobDetails is the BasicJobDetails implementation for HeavyJobDetails.
1719func (hjd HeavyJobDetails) AsHeavyJobDetails() (*HeavyJobDetails, bool) {
1720	return &hjd, true
1721}
1722
1723// AsJobDetailsType is the BasicJobDetails implementation for HeavyJobDetails.
1724func (hjd HeavyJobDetails) AsJobDetailsType() (*JobDetailsType, bool) {
1725	return nil, false
1726}
1727
1728// AsJobDetails is the BasicJobDetails implementation for HeavyJobDetails.
1729func (hjd HeavyJobDetails) AsJobDetails() (*JobDetails, bool) {
1730	return nil, false
1731}
1732
1733// AsBasicJobDetails is the BasicJobDetails implementation for HeavyJobDetails.
1734func (hjd HeavyJobDetails) AsBasicJobDetails() (BasicJobDetails, bool) {
1735	return &hjd, true
1736}
1737
1738// UnmarshalJSON is the custom unmarshaler for HeavyJobDetails struct.
1739func (hjd *HeavyJobDetails) UnmarshalJSON(body []byte) error {
1740	var m map[string]*json.RawMessage
1741	err := json.Unmarshal(body, &m)
1742	if err != nil {
1743		return err
1744	}
1745	for k, v := range m {
1746		switch k {
1747		case "copyProgress":
1748			if v != nil {
1749				var copyProgress []CopyProgress
1750				err = json.Unmarshal(*v, &copyProgress)
1751				if err != nil {
1752					return err
1753				}
1754				hjd.CopyProgress = &copyProgress
1755			}
1756		case "devicePassword":
1757			if v != nil {
1758				var devicePassword string
1759				err = json.Unmarshal(*v, &devicePassword)
1760				if err != nil {
1761					return err
1762				}
1763				hjd.DevicePassword = &devicePassword
1764			}
1765		case "expectedDataSizeInTerabytes":
1766			if v != nil {
1767				var expectedDataSizeInTerabytes int32
1768				err = json.Unmarshal(*v, &expectedDataSizeInTerabytes)
1769				if err != nil {
1770					return err
1771				}
1772				hjd.ExpectedDataSizeInTerabytes = &expectedDataSizeInTerabytes
1773			}
1774		case "jobStages":
1775			if v != nil {
1776				var jobStages []JobStages
1777				err = json.Unmarshal(*v, &jobStages)
1778				if err != nil {
1779					return err
1780				}
1781				hjd.JobStages = &jobStages
1782			}
1783		case "contactDetails":
1784			if v != nil {
1785				var contactDetails ContactDetails
1786				err = json.Unmarshal(*v, &contactDetails)
1787				if err != nil {
1788					return err
1789				}
1790				hjd.ContactDetails = &contactDetails
1791			}
1792		case "shippingAddress":
1793			if v != nil {
1794				var shippingAddress ShippingAddress
1795				err = json.Unmarshal(*v, &shippingAddress)
1796				if err != nil {
1797					return err
1798				}
1799				hjd.ShippingAddress = &shippingAddress
1800			}
1801		case "deliveryPackage":
1802			if v != nil {
1803				var deliveryPackage PackageShippingDetails
1804				err = json.Unmarshal(*v, &deliveryPackage)
1805				if err != nil {
1806					return err
1807				}
1808				hjd.DeliveryPackage = &deliveryPackage
1809			}
1810		case "returnPackage":
1811			if v != nil {
1812				var returnPackage PackageShippingDetails
1813				err = json.Unmarshal(*v, &returnPackage)
1814				if err != nil {
1815					return err
1816				}
1817				hjd.ReturnPackage = &returnPackage
1818			}
1819		case "destinationAccountDetails":
1820			if v != nil {
1821				destinationAccountDetails, err := unmarshalBasicDestinationAccountDetailsArray(*v)
1822				if err != nil {
1823					return err
1824				}
1825				hjd.DestinationAccountDetails = &destinationAccountDetails
1826			}
1827		case "errorDetails":
1828			if v != nil {
1829				var errorDetails []JobErrorDetails
1830				err = json.Unmarshal(*v, &errorDetails)
1831				if err != nil {
1832					return err
1833				}
1834				hjd.ErrorDetails = &errorDetails
1835			}
1836		case "preferences":
1837			if v != nil {
1838				var preferences Preferences
1839				err = json.Unmarshal(*v, &preferences)
1840				if err != nil {
1841					return err
1842				}
1843				hjd.Preferences = &preferences
1844			}
1845		case "copyLogDetails":
1846			if v != nil {
1847				copyLogDetails, err := unmarshalBasicCopyLogDetailsArray(*v)
1848				if err != nil {
1849					return err
1850				}
1851				hjd.CopyLogDetails = &copyLogDetails
1852			}
1853		case "reverseShipmentLabelSasKey":
1854			if v != nil {
1855				var reverseShipmentLabelSasKey string
1856				err = json.Unmarshal(*v, &reverseShipmentLabelSasKey)
1857				if err != nil {
1858					return err
1859				}
1860				hjd.ReverseShipmentLabelSasKey = &reverseShipmentLabelSasKey
1861			}
1862		case "chainOfCustodySasKey":
1863			if v != nil {
1864				var chainOfCustodySasKey string
1865				err = json.Unmarshal(*v, &chainOfCustodySasKey)
1866				if err != nil {
1867					return err
1868				}
1869				hjd.ChainOfCustodySasKey = &chainOfCustodySasKey
1870			}
1871		case "jobDetailsType":
1872			if v != nil {
1873				var jobDetailsType JobDetailsTypeEnum
1874				err = json.Unmarshal(*v, &jobDetailsType)
1875				if err != nil {
1876					return err
1877				}
1878				hjd.JobDetailsType = jobDetailsType
1879			}
1880		}
1881	}
1882
1883	return nil
1884}
1885
1886// HeavyJobSecrets the secrets related to a databox heavy job.
1887type HeavyJobSecrets struct {
1888	// CabinetPodSecrets - READ-ONLY; Contains the list of secret objects for a databox heavy job.
1889	CabinetPodSecrets *[]HeavySecret `json:"cabinetPodSecrets,omitempty"`
1890	// DcAccessSecurityCode - Dc Access Security Code for Customer Managed Shipping
1891	DcAccessSecurityCode *DcAccessSecurityCode `json:"dcAccessSecurityCode,omitempty"`
1892	// JobSecretsType - Possible values include: 'JobSecretsTypeJobSecrets', 'JobSecretsTypeDataBoxDisk', 'JobSecretsTypeDataBoxHeavy', 'JobSecretsTypeDataBox'
1893	JobSecretsType JobSecretsTypeEnum `json:"jobSecretsType,omitempty"`
1894}
1895
1896// MarshalJSON is the custom marshaler for HeavyJobSecrets.
1897func (hjs HeavyJobSecrets) MarshalJSON() ([]byte, error) {
1898	hjs.JobSecretsType = JobSecretsTypeDataBoxHeavy
1899	objectMap := make(map[string]interface{})
1900	if hjs.DcAccessSecurityCode != nil {
1901		objectMap["dcAccessSecurityCode"] = hjs.DcAccessSecurityCode
1902	}
1903	if hjs.JobSecretsType != "" {
1904		objectMap["jobSecretsType"] = hjs.JobSecretsType
1905	}
1906	return json.Marshal(objectMap)
1907}
1908
1909// AsDiskJobSecrets is the BasicJobSecrets implementation for HeavyJobSecrets.
1910func (hjs HeavyJobSecrets) AsDiskJobSecrets() (*DiskJobSecrets, bool) {
1911	return nil, false
1912}
1913
1914// AsHeavyJobSecrets is the BasicJobSecrets implementation for HeavyJobSecrets.
1915func (hjs HeavyJobSecrets) AsHeavyJobSecrets() (*HeavyJobSecrets, bool) {
1916	return &hjs, true
1917}
1918
1919// AsJobSecretsType is the BasicJobSecrets implementation for HeavyJobSecrets.
1920func (hjs HeavyJobSecrets) AsJobSecretsType() (*JobSecretsType, bool) {
1921	return nil, false
1922}
1923
1924// AsJobSecrets is the BasicJobSecrets implementation for HeavyJobSecrets.
1925func (hjs HeavyJobSecrets) AsJobSecrets() (*JobSecrets, bool) {
1926	return nil, false
1927}
1928
1929// AsBasicJobSecrets is the BasicJobSecrets implementation for HeavyJobSecrets.
1930func (hjs HeavyJobSecrets) AsBasicJobSecrets() (BasicJobSecrets, bool) {
1931	return &hjs, true
1932}
1933
1934// HeavyScheduleAvailabilityRequest request body to get the availability for scheduling heavy orders.
1935type HeavyScheduleAvailabilityRequest struct {
1936	// StorageLocation - Location for data transfer.
1937	// For locations check: https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01
1938	StorageLocation *string `json:"storageLocation,omitempty"`
1939	// SkuName - Possible values include: 'SkuNameScheduleAvailabilityRequest', 'SkuNameDataBox', 'SkuNameDataBoxDisk', 'SkuNameDataBoxHeavy'
1940	SkuName SkuNameBasicScheduleAvailabilityRequest `json:"skuName,omitempty"`
1941}
1942
1943// MarshalJSON is the custom marshaler for HeavyScheduleAvailabilityRequest.
1944func (hsar HeavyScheduleAvailabilityRequest) MarshalJSON() ([]byte, error) {
1945	hsar.SkuName = SkuNameDataBoxHeavy
1946	objectMap := make(map[string]interface{})
1947	if hsar.StorageLocation != nil {
1948		objectMap["storageLocation"] = hsar.StorageLocation
1949	}
1950	if hsar.SkuName != "" {
1951		objectMap["skuName"] = hsar.SkuName
1952	}
1953	return json.Marshal(objectMap)
1954}
1955
1956// AsScheduleAvailabilityRequestType is the BasicScheduleAvailabilityRequest implementation for HeavyScheduleAvailabilityRequest.
1957func (hsar HeavyScheduleAvailabilityRequest) AsScheduleAvailabilityRequestType() (*ScheduleAvailabilityRequestType, bool) {
1958	return nil, false
1959}
1960
1961// AsDiskScheduleAvailabilityRequest is the BasicScheduleAvailabilityRequest implementation for HeavyScheduleAvailabilityRequest.
1962func (hsar HeavyScheduleAvailabilityRequest) AsDiskScheduleAvailabilityRequest() (*DiskScheduleAvailabilityRequest, bool) {
1963	return nil, false
1964}
1965
1966// AsHeavyScheduleAvailabilityRequest is the BasicScheduleAvailabilityRequest implementation for HeavyScheduleAvailabilityRequest.
1967func (hsar HeavyScheduleAvailabilityRequest) AsHeavyScheduleAvailabilityRequest() (*HeavyScheduleAvailabilityRequest, bool) {
1968	return &hsar, true
1969}
1970
1971// AsScheduleAvailabilityRequest is the BasicScheduleAvailabilityRequest implementation for HeavyScheduleAvailabilityRequest.
1972func (hsar HeavyScheduleAvailabilityRequest) AsScheduleAvailabilityRequest() (*ScheduleAvailabilityRequest, bool) {
1973	return nil, false
1974}
1975
1976// AsBasicScheduleAvailabilityRequest is the BasicScheduleAvailabilityRequest implementation for HeavyScheduleAvailabilityRequest.
1977func (hsar HeavyScheduleAvailabilityRequest) AsBasicScheduleAvailabilityRequest() (BasicScheduleAvailabilityRequest, bool) {
1978	return &hsar, true
1979}
1980
1981// HeavySecret the secrets related to a databox heavy.
1982type HeavySecret struct {
1983	// DeviceSerialNumber - READ-ONLY; Serial number of the assigned device.
1984	DeviceSerialNumber *string `json:"deviceSerialNumber,omitempty"`
1985	// DevicePassword - READ-ONLY; Password for out of the box experience on device.
1986	DevicePassword *string `json:"devicePassword,omitempty"`
1987	// NetworkConfigurations - READ-ONLY; Network configuration of the appliance.
1988	NetworkConfigurations *[]ApplianceNetworkConfiguration `json:"networkConfigurations,omitempty"`
1989	// EncodedValidationCertPubKey - READ-ONLY; The base 64 encoded public key to authenticate with the device
1990	EncodedValidationCertPubKey *string `json:"encodedValidationCertPubKey,omitempty"`
1991	// AccountCredentialDetails - READ-ONLY; Per account level access credentials.
1992	AccountCredentialDetails *[]AccountCredentialDetails `json:"accountCredentialDetails,omitempty"`
1993}
1994
1995// MarshalJSON is the custom marshaler for HeavySecret.
1996func (hs HeavySecret) MarshalJSON() ([]byte, error) {
1997	objectMap := make(map[string]interface{})
1998	return json.Marshal(objectMap)
1999}
2000
2001// JobDeliveryInfo additional delivery info.
2002type JobDeliveryInfo struct {
2003	// ScheduledDateTime - Scheduled date time.
2004	ScheduledDateTime *date.Time `json:"scheduledDateTime,omitempty"`
2005}
2006
2007// BasicJobDetails job details.
2008type BasicJobDetails interface {
2009	AsDiskJobDetails() (*DiskJobDetails, bool)
2010	AsHeavyJobDetails() (*HeavyJobDetails, bool)
2011	AsJobDetailsType() (*JobDetailsType, bool)
2012	AsJobDetails() (*JobDetails, bool)
2013}
2014
2015// JobDetails job details.
2016type JobDetails struct {
2017	// ExpectedDataSizeInTerabytes - The expected size of the data, which needs to be transferred in this job, in terabytes.
2018	ExpectedDataSizeInTerabytes *int32 `json:"expectedDataSizeInTerabytes,omitempty"`
2019	// JobStages - READ-ONLY; List of stages that run in the job.
2020	JobStages *[]JobStages `json:"jobStages,omitempty"`
2021	// ContactDetails - Contact details for notification and shipping.
2022	ContactDetails *ContactDetails `json:"contactDetails,omitempty"`
2023	// ShippingAddress - Shipping address of the customer.
2024	ShippingAddress *ShippingAddress `json:"shippingAddress,omitempty"`
2025	// DeliveryPackage - READ-ONLY; Delivery package shipping details.
2026	DeliveryPackage *PackageShippingDetails `json:"deliveryPackage,omitempty"`
2027	// ReturnPackage - READ-ONLY; Return package shipping details.
2028	ReturnPackage *PackageShippingDetails `json:"returnPackage,omitempty"`
2029	// DestinationAccountDetails - Destination account details.
2030	DestinationAccountDetails *[]BasicDestinationAccountDetails `json:"destinationAccountDetails,omitempty"`
2031	// ErrorDetails - READ-ONLY; Error details for failure. This is optional.
2032	ErrorDetails *[]JobErrorDetails `json:"errorDetails,omitempty"`
2033	// Preferences - Preferences for the order.
2034	Preferences *Preferences `json:"preferences,omitempty"`
2035	// CopyLogDetails - READ-ONLY; List of copy log details.
2036	CopyLogDetails *[]BasicCopyLogDetails `json:"copyLogDetails,omitempty"`
2037	// ReverseShipmentLabelSasKey - READ-ONLY; Shared access key to download the return shipment label
2038	ReverseShipmentLabelSasKey *string `json:"reverseShipmentLabelSasKey,omitempty"`
2039	// ChainOfCustodySasKey - READ-ONLY; Shared access key to download the chain of custody logs
2040	ChainOfCustodySasKey *string `json:"chainOfCustodySasKey,omitempty"`
2041	// JobDetailsType - Possible values include: 'JobDetailsTypeJobDetails', 'JobDetailsTypeDataBoxDisk', 'JobDetailsTypeDataBoxHeavy', 'JobDetailsTypeDataBox'
2042	JobDetailsType JobDetailsTypeEnum `json:"jobDetailsType,omitempty"`
2043}
2044
2045func unmarshalBasicJobDetails(body []byte) (BasicJobDetails, error) {
2046	var m map[string]interface{}
2047	err := json.Unmarshal(body, &m)
2048	if err != nil {
2049		return nil, err
2050	}
2051
2052	switch m["jobDetailsType"] {
2053	case string(JobDetailsTypeDataBoxDisk):
2054		var djd DiskJobDetails
2055		err := json.Unmarshal(body, &djd)
2056		return djd, err
2057	case string(JobDetailsTypeDataBoxHeavy):
2058		var hjd HeavyJobDetails
2059		err := json.Unmarshal(body, &hjd)
2060		return hjd, err
2061	case string(JobDetailsTypeDataBox):
2062		var jdt JobDetailsType
2063		err := json.Unmarshal(body, &jdt)
2064		return jdt, err
2065	default:
2066		var jd JobDetails
2067		err := json.Unmarshal(body, &jd)
2068		return jd, err
2069	}
2070}
2071func unmarshalBasicJobDetailsArray(body []byte) ([]BasicJobDetails, error) {
2072	var rawMessages []*json.RawMessage
2073	err := json.Unmarshal(body, &rawMessages)
2074	if err != nil {
2075		return nil, err
2076	}
2077
2078	jdArray := make([]BasicJobDetails, len(rawMessages))
2079
2080	for index, rawMessage := range rawMessages {
2081		jd, err := unmarshalBasicJobDetails(*rawMessage)
2082		if err != nil {
2083			return nil, err
2084		}
2085		jdArray[index] = jd
2086	}
2087	return jdArray, nil
2088}
2089
2090// MarshalJSON is the custom marshaler for JobDetails.
2091func (jd JobDetails) MarshalJSON() ([]byte, error) {
2092	jd.JobDetailsType = JobDetailsTypeJobDetails
2093	objectMap := make(map[string]interface{})
2094	if jd.ExpectedDataSizeInTerabytes != nil {
2095		objectMap["expectedDataSizeInTerabytes"] = jd.ExpectedDataSizeInTerabytes
2096	}
2097	if jd.ContactDetails != nil {
2098		objectMap["contactDetails"] = jd.ContactDetails
2099	}
2100	if jd.ShippingAddress != nil {
2101		objectMap["shippingAddress"] = jd.ShippingAddress
2102	}
2103	if jd.DestinationAccountDetails != nil {
2104		objectMap["destinationAccountDetails"] = jd.DestinationAccountDetails
2105	}
2106	if jd.Preferences != nil {
2107		objectMap["preferences"] = jd.Preferences
2108	}
2109	if jd.JobDetailsType != "" {
2110		objectMap["jobDetailsType"] = jd.JobDetailsType
2111	}
2112	return json.Marshal(objectMap)
2113}
2114
2115// AsDiskJobDetails is the BasicJobDetails implementation for JobDetails.
2116func (jd JobDetails) AsDiskJobDetails() (*DiskJobDetails, bool) {
2117	return nil, false
2118}
2119
2120// AsHeavyJobDetails is the BasicJobDetails implementation for JobDetails.
2121func (jd JobDetails) AsHeavyJobDetails() (*HeavyJobDetails, bool) {
2122	return nil, false
2123}
2124
2125// AsJobDetailsType is the BasicJobDetails implementation for JobDetails.
2126func (jd JobDetails) AsJobDetailsType() (*JobDetailsType, bool) {
2127	return nil, false
2128}
2129
2130// AsJobDetails is the BasicJobDetails implementation for JobDetails.
2131func (jd JobDetails) AsJobDetails() (*JobDetails, bool) {
2132	return &jd, true
2133}
2134
2135// AsBasicJobDetails is the BasicJobDetails implementation for JobDetails.
2136func (jd JobDetails) AsBasicJobDetails() (BasicJobDetails, bool) {
2137	return &jd, true
2138}
2139
2140// UnmarshalJSON is the custom unmarshaler for JobDetails struct.
2141func (jd *JobDetails) UnmarshalJSON(body []byte) error {
2142	var m map[string]*json.RawMessage
2143	err := json.Unmarshal(body, &m)
2144	if err != nil {
2145		return err
2146	}
2147	for k, v := range m {
2148		switch k {
2149		case "expectedDataSizeInTerabytes":
2150			if v != nil {
2151				var expectedDataSizeInTerabytes int32
2152				err = json.Unmarshal(*v, &expectedDataSizeInTerabytes)
2153				if err != nil {
2154					return err
2155				}
2156				jd.ExpectedDataSizeInTerabytes = &expectedDataSizeInTerabytes
2157			}
2158		case "jobStages":
2159			if v != nil {
2160				var jobStages []JobStages
2161				err = json.Unmarshal(*v, &jobStages)
2162				if err != nil {
2163					return err
2164				}
2165				jd.JobStages = &jobStages
2166			}
2167		case "contactDetails":
2168			if v != nil {
2169				var contactDetails ContactDetails
2170				err = json.Unmarshal(*v, &contactDetails)
2171				if err != nil {
2172					return err
2173				}
2174				jd.ContactDetails = &contactDetails
2175			}
2176		case "shippingAddress":
2177			if v != nil {
2178				var shippingAddress ShippingAddress
2179				err = json.Unmarshal(*v, &shippingAddress)
2180				if err != nil {
2181					return err
2182				}
2183				jd.ShippingAddress = &shippingAddress
2184			}
2185		case "deliveryPackage":
2186			if v != nil {
2187				var deliveryPackage PackageShippingDetails
2188				err = json.Unmarshal(*v, &deliveryPackage)
2189				if err != nil {
2190					return err
2191				}
2192				jd.DeliveryPackage = &deliveryPackage
2193			}
2194		case "returnPackage":
2195			if v != nil {
2196				var returnPackage PackageShippingDetails
2197				err = json.Unmarshal(*v, &returnPackage)
2198				if err != nil {
2199					return err
2200				}
2201				jd.ReturnPackage = &returnPackage
2202			}
2203		case "destinationAccountDetails":
2204			if v != nil {
2205				destinationAccountDetails, err := unmarshalBasicDestinationAccountDetailsArray(*v)
2206				if err != nil {
2207					return err
2208				}
2209				jd.DestinationAccountDetails = &destinationAccountDetails
2210			}
2211		case "errorDetails":
2212			if v != nil {
2213				var errorDetails []JobErrorDetails
2214				err = json.Unmarshal(*v, &errorDetails)
2215				if err != nil {
2216					return err
2217				}
2218				jd.ErrorDetails = &errorDetails
2219			}
2220		case "preferences":
2221			if v != nil {
2222				var preferences Preferences
2223				err = json.Unmarshal(*v, &preferences)
2224				if err != nil {
2225					return err
2226				}
2227				jd.Preferences = &preferences
2228			}
2229		case "copyLogDetails":
2230			if v != nil {
2231				copyLogDetails, err := unmarshalBasicCopyLogDetailsArray(*v)
2232				if err != nil {
2233					return err
2234				}
2235				jd.CopyLogDetails = &copyLogDetails
2236			}
2237		case "reverseShipmentLabelSasKey":
2238			if v != nil {
2239				var reverseShipmentLabelSasKey string
2240				err = json.Unmarshal(*v, &reverseShipmentLabelSasKey)
2241				if err != nil {
2242					return err
2243				}
2244				jd.ReverseShipmentLabelSasKey = &reverseShipmentLabelSasKey
2245			}
2246		case "chainOfCustodySasKey":
2247			if v != nil {
2248				var chainOfCustodySasKey string
2249				err = json.Unmarshal(*v, &chainOfCustodySasKey)
2250				if err != nil {
2251					return err
2252				}
2253				jd.ChainOfCustodySasKey = &chainOfCustodySasKey
2254			}
2255		case "jobDetailsType":
2256			if v != nil {
2257				var jobDetailsType JobDetailsTypeEnum
2258				err = json.Unmarshal(*v, &jobDetailsType)
2259				if err != nil {
2260					return err
2261				}
2262				jd.JobDetailsType = jobDetailsType
2263			}
2264		}
2265	}
2266
2267	return nil
2268}
2269
2270// JobDetailsType databox Job Details
2271type JobDetailsType struct {
2272	// CopyProgress - READ-ONLY; Copy progress per storage account.
2273	CopyProgress *[]CopyProgress `json:"copyProgress,omitempty"`
2274	// DevicePassword - Set Device password for unlocking Databox
2275	DevicePassword *string `json:"devicePassword,omitempty"`
2276	// ExpectedDataSizeInTerabytes - The expected size of the data, which needs to be transferred in this job, in terabytes.
2277	ExpectedDataSizeInTerabytes *int32 `json:"expectedDataSizeInTerabytes,omitempty"`
2278	// JobStages - READ-ONLY; List of stages that run in the job.
2279	JobStages *[]JobStages `json:"jobStages,omitempty"`
2280	// ContactDetails - Contact details for notification and shipping.
2281	ContactDetails *ContactDetails `json:"contactDetails,omitempty"`
2282	// ShippingAddress - Shipping address of the customer.
2283	ShippingAddress *ShippingAddress `json:"shippingAddress,omitempty"`
2284	// DeliveryPackage - READ-ONLY; Delivery package shipping details.
2285	DeliveryPackage *PackageShippingDetails `json:"deliveryPackage,omitempty"`
2286	// ReturnPackage - READ-ONLY; Return package shipping details.
2287	ReturnPackage *PackageShippingDetails `json:"returnPackage,omitempty"`
2288	// DestinationAccountDetails - Destination account details.
2289	DestinationAccountDetails *[]BasicDestinationAccountDetails `json:"destinationAccountDetails,omitempty"`
2290	// ErrorDetails - READ-ONLY; Error details for failure. This is optional.
2291	ErrorDetails *[]JobErrorDetails `json:"errorDetails,omitempty"`
2292	// Preferences - Preferences for the order.
2293	Preferences *Preferences `json:"preferences,omitempty"`
2294	// CopyLogDetails - READ-ONLY; List of copy log details.
2295	CopyLogDetails *[]BasicCopyLogDetails `json:"copyLogDetails,omitempty"`
2296	// ReverseShipmentLabelSasKey - READ-ONLY; Shared access key to download the return shipment label
2297	ReverseShipmentLabelSasKey *string `json:"reverseShipmentLabelSasKey,omitempty"`
2298	// ChainOfCustodySasKey - READ-ONLY; Shared access key to download the chain of custody logs
2299	ChainOfCustodySasKey *string `json:"chainOfCustodySasKey,omitempty"`
2300	// JobDetailsType - Possible values include: 'JobDetailsTypeJobDetails', 'JobDetailsTypeDataBoxDisk', 'JobDetailsTypeDataBoxHeavy', 'JobDetailsTypeDataBox'
2301	JobDetailsType JobDetailsTypeEnum `json:"jobDetailsType,omitempty"`
2302}
2303
2304// MarshalJSON is the custom marshaler for JobDetailsType.
2305func (jdt JobDetailsType) MarshalJSON() ([]byte, error) {
2306	jdt.JobDetailsType = JobDetailsTypeDataBox
2307	objectMap := make(map[string]interface{})
2308	if jdt.DevicePassword != nil {
2309		objectMap["devicePassword"] = jdt.DevicePassword
2310	}
2311	if jdt.ExpectedDataSizeInTerabytes != nil {
2312		objectMap["expectedDataSizeInTerabytes"] = jdt.ExpectedDataSizeInTerabytes
2313	}
2314	if jdt.ContactDetails != nil {
2315		objectMap["contactDetails"] = jdt.ContactDetails
2316	}
2317	if jdt.ShippingAddress != nil {
2318		objectMap["shippingAddress"] = jdt.ShippingAddress
2319	}
2320	if jdt.DestinationAccountDetails != nil {
2321		objectMap["destinationAccountDetails"] = jdt.DestinationAccountDetails
2322	}
2323	if jdt.Preferences != nil {
2324		objectMap["preferences"] = jdt.Preferences
2325	}
2326	if jdt.JobDetailsType != "" {
2327		objectMap["jobDetailsType"] = jdt.JobDetailsType
2328	}
2329	return json.Marshal(objectMap)
2330}
2331
2332// AsDiskJobDetails is the BasicJobDetails implementation for JobDetailsType.
2333func (jdt JobDetailsType) AsDiskJobDetails() (*DiskJobDetails, bool) {
2334	return nil, false
2335}
2336
2337// AsHeavyJobDetails is the BasicJobDetails implementation for JobDetailsType.
2338func (jdt JobDetailsType) AsHeavyJobDetails() (*HeavyJobDetails, bool) {
2339	return nil, false
2340}
2341
2342// AsJobDetailsType is the BasicJobDetails implementation for JobDetailsType.
2343func (jdt JobDetailsType) AsJobDetailsType() (*JobDetailsType, bool) {
2344	return &jdt, true
2345}
2346
2347// AsJobDetails is the BasicJobDetails implementation for JobDetailsType.
2348func (jdt JobDetailsType) AsJobDetails() (*JobDetails, bool) {
2349	return nil, false
2350}
2351
2352// AsBasicJobDetails is the BasicJobDetails implementation for JobDetailsType.
2353func (jdt JobDetailsType) AsBasicJobDetails() (BasicJobDetails, bool) {
2354	return &jdt, true
2355}
2356
2357// UnmarshalJSON is the custom unmarshaler for JobDetailsType struct.
2358func (jdt *JobDetailsType) UnmarshalJSON(body []byte) error {
2359	var m map[string]*json.RawMessage
2360	err := json.Unmarshal(body, &m)
2361	if err != nil {
2362		return err
2363	}
2364	for k, v := range m {
2365		switch k {
2366		case "copyProgress":
2367			if v != nil {
2368				var copyProgress []CopyProgress
2369				err = json.Unmarshal(*v, &copyProgress)
2370				if err != nil {
2371					return err
2372				}
2373				jdt.CopyProgress = &copyProgress
2374			}
2375		case "devicePassword":
2376			if v != nil {
2377				var devicePassword string
2378				err = json.Unmarshal(*v, &devicePassword)
2379				if err != nil {
2380					return err
2381				}
2382				jdt.DevicePassword = &devicePassword
2383			}
2384		case "expectedDataSizeInTerabytes":
2385			if v != nil {
2386				var expectedDataSizeInTerabytes int32
2387				err = json.Unmarshal(*v, &expectedDataSizeInTerabytes)
2388				if err != nil {
2389					return err
2390				}
2391				jdt.ExpectedDataSizeInTerabytes = &expectedDataSizeInTerabytes
2392			}
2393		case "jobStages":
2394			if v != nil {
2395				var jobStages []JobStages
2396				err = json.Unmarshal(*v, &jobStages)
2397				if err != nil {
2398					return err
2399				}
2400				jdt.JobStages = &jobStages
2401			}
2402		case "contactDetails":
2403			if v != nil {
2404				var contactDetails ContactDetails
2405				err = json.Unmarshal(*v, &contactDetails)
2406				if err != nil {
2407					return err
2408				}
2409				jdt.ContactDetails = &contactDetails
2410			}
2411		case "shippingAddress":
2412			if v != nil {
2413				var shippingAddress ShippingAddress
2414				err = json.Unmarshal(*v, &shippingAddress)
2415				if err != nil {
2416					return err
2417				}
2418				jdt.ShippingAddress = &shippingAddress
2419			}
2420		case "deliveryPackage":
2421			if v != nil {
2422				var deliveryPackage PackageShippingDetails
2423				err = json.Unmarshal(*v, &deliveryPackage)
2424				if err != nil {
2425					return err
2426				}
2427				jdt.DeliveryPackage = &deliveryPackage
2428			}
2429		case "returnPackage":
2430			if v != nil {
2431				var returnPackage PackageShippingDetails
2432				err = json.Unmarshal(*v, &returnPackage)
2433				if err != nil {
2434					return err
2435				}
2436				jdt.ReturnPackage = &returnPackage
2437			}
2438		case "destinationAccountDetails":
2439			if v != nil {
2440				destinationAccountDetails, err := unmarshalBasicDestinationAccountDetailsArray(*v)
2441				if err != nil {
2442					return err
2443				}
2444				jdt.DestinationAccountDetails = &destinationAccountDetails
2445			}
2446		case "errorDetails":
2447			if v != nil {
2448				var errorDetails []JobErrorDetails
2449				err = json.Unmarshal(*v, &errorDetails)
2450				if err != nil {
2451					return err
2452				}
2453				jdt.ErrorDetails = &errorDetails
2454			}
2455		case "preferences":
2456			if v != nil {
2457				var preferences Preferences
2458				err = json.Unmarshal(*v, &preferences)
2459				if err != nil {
2460					return err
2461				}
2462				jdt.Preferences = &preferences
2463			}
2464		case "copyLogDetails":
2465			if v != nil {
2466				copyLogDetails, err := unmarshalBasicCopyLogDetailsArray(*v)
2467				if err != nil {
2468					return err
2469				}
2470				jdt.CopyLogDetails = &copyLogDetails
2471			}
2472		case "reverseShipmentLabelSasKey":
2473			if v != nil {
2474				var reverseShipmentLabelSasKey string
2475				err = json.Unmarshal(*v, &reverseShipmentLabelSasKey)
2476				if err != nil {
2477					return err
2478				}
2479				jdt.ReverseShipmentLabelSasKey = &reverseShipmentLabelSasKey
2480			}
2481		case "chainOfCustodySasKey":
2482			if v != nil {
2483				var chainOfCustodySasKey string
2484				err = json.Unmarshal(*v, &chainOfCustodySasKey)
2485				if err != nil {
2486					return err
2487				}
2488				jdt.ChainOfCustodySasKey = &chainOfCustodySasKey
2489			}
2490		case "jobDetailsType":
2491			if v != nil {
2492				var jobDetailsType JobDetailsTypeEnum
2493				err = json.Unmarshal(*v, &jobDetailsType)
2494				if err != nil {
2495					return err
2496				}
2497				jdt.JobDetailsType = jobDetailsType
2498			}
2499		}
2500	}
2501
2502	return nil
2503}
2504
2505// JobErrorDetails job Error Details for providing the information and recommended action.
2506type JobErrorDetails struct {
2507	// ErrorMessage - READ-ONLY; Message for the error.
2508	ErrorMessage *string `json:"errorMessage,omitempty"`
2509	// ErrorCode - READ-ONLY; Code for the error.
2510	ErrorCode *int32 `json:"errorCode,omitempty"`
2511	// RecommendedAction - READ-ONLY; Recommended action for the error.
2512	RecommendedAction *string `json:"recommendedAction,omitempty"`
2513	// ExceptionMessage - READ-ONLY; Contains the non localized exception message
2514	ExceptionMessage *string `json:"exceptionMessage,omitempty"`
2515}
2516
2517// MarshalJSON is the custom marshaler for JobErrorDetails.
2518func (jed JobErrorDetails) MarshalJSON() ([]byte, error) {
2519	objectMap := make(map[string]interface{})
2520	return json.Marshal(objectMap)
2521}
2522
2523// JobProperties job Properties
2524type JobProperties struct {
2525	// IsCancellable - READ-ONLY; Describes whether the job is cancellable or not.
2526	IsCancellable *bool `json:"isCancellable,omitempty"`
2527	// IsDeletable - READ-ONLY; Describes whether the job is deletable or not.
2528	IsDeletable *bool `json:"isDeletable,omitempty"`
2529	// IsShippingAddressEditable - READ-ONLY; Describes whether the shipping address is editable or not.
2530	IsShippingAddressEditable *bool `json:"isShippingAddressEditable,omitempty"`
2531	// Status - READ-ONLY; Name of the stage which is in progress. Possible values include: 'StageNameDeviceOrdered', 'StageNameDevicePrepared', 'StageNameDispatched', 'StageNameDelivered', 'StageNamePickedUp', 'StageNameAtAzureDC', 'StageNameDataCopy', 'StageNameCompleted', 'StageNameCompletedWithErrors', 'StageNameCancelled', 'StageNameFailedIssueReportedAtCustomer', 'StageNameFailedIssueDetectedAtAzureDC', 'StageNameAborted', 'StageNameCompletedWithWarnings', 'StageNameReadyToDispatchFromAzureDC', 'StageNameReadyToReceiveAtAzureDC'
2532	Status StageName `json:"status,omitempty"`
2533	// StartTime - READ-ONLY; Time at which the job was started in UTC ISO 8601 format.
2534	StartTime *date.Time `json:"startTime,omitempty"`
2535	// Error - READ-ONLY; Top level error for the job.
2536	Error *Error `json:"error,omitempty"`
2537	// Details - Details of a job run. This field will only be sent for expand details filter.
2538	Details BasicJobDetails `json:"details,omitempty"`
2539	// CancellationReason - READ-ONLY; Reason for cancellation.
2540	CancellationReason *string `json:"cancellationReason,omitempty"`
2541	// DeliveryType - Delivery type of Job. Possible values include: 'NonScheduled', 'Scheduled'
2542	DeliveryType JobDeliveryType `json:"deliveryType,omitempty"`
2543	// DeliveryInfo - Delivery Info of Job.
2544	DeliveryInfo *JobDeliveryInfo `json:"deliveryInfo,omitempty"`
2545	// IsCancellableWithoutFee - READ-ONLY; Flag to indicate cancellation of scheduled job.
2546	IsCancellableWithoutFee *bool `json:"isCancellableWithoutFee,omitempty"`
2547}
2548
2549// MarshalJSON is the custom marshaler for JobProperties.
2550func (jp JobProperties) MarshalJSON() ([]byte, error) {
2551	objectMap := make(map[string]interface{})
2552	objectMap["details"] = jp.Details
2553	if jp.DeliveryType != "" {
2554		objectMap["deliveryType"] = jp.DeliveryType
2555	}
2556	if jp.DeliveryInfo != nil {
2557		objectMap["deliveryInfo"] = jp.DeliveryInfo
2558	}
2559	return json.Marshal(objectMap)
2560}
2561
2562// UnmarshalJSON is the custom unmarshaler for JobProperties struct.
2563func (jp *JobProperties) UnmarshalJSON(body []byte) error {
2564	var m map[string]*json.RawMessage
2565	err := json.Unmarshal(body, &m)
2566	if err != nil {
2567		return err
2568	}
2569	for k, v := range m {
2570		switch k {
2571		case "isCancellable":
2572			if v != nil {
2573				var isCancellable bool
2574				err = json.Unmarshal(*v, &isCancellable)
2575				if err != nil {
2576					return err
2577				}
2578				jp.IsCancellable = &isCancellable
2579			}
2580		case "isDeletable":
2581			if v != nil {
2582				var isDeletable bool
2583				err = json.Unmarshal(*v, &isDeletable)
2584				if err != nil {
2585					return err
2586				}
2587				jp.IsDeletable = &isDeletable
2588			}
2589		case "isShippingAddressEditable":
2590			if v != nil {
2591				var isShippingAddressEditable bool
2592				err = json.Unmarshal(*v, &isShippingAddressEditable)
2593				if err != nil {
2594					return err
2595				}
2596				jp.IsShippingAddressEditable = &isShippingAddressEditable
2597			}
2598		case "status":
2599			if v != nil {
2600				var status StageName
2601				err = json.Unmarshal(*v, &status)
2602				if err != nil {
2603					return err
2604				}
2605				jp.Status = status
2606			}
2607		case "startTime":
2608			if v != nil {
2609				var startTime date.Time
2610				err = json.Unmarshal(*v, &startTime)
2611				if err != nil {
2612					return err
2613				}
2614				jp.StartTime = &startTime
2615			}
2616		case "error":
2617			if v != nil {
2618				var errorVar Error
2619				err = json.Unmarshal(*v, &errorVar)
2620				if err != nil {
2621					return err
2622				}
2623				jp.Error = &errorVar
2624			}
2625		case "details":
2626			if v != nil {
2627				details, err := unmarshalBasicJobDetails(*v)
2628				if err != nil {
2629					return err
2630				}
2631				jp.Details = details
2632			}
2633		case "cancellationReason":
2634			if v != nil {
2635				var cancellationReason string
2636				err = json.Unmarshal(*v, &cancellationReason)
2637				if err != nil {
2638					return err
2639				}
2640				jp.CancellationReason = &cancellationReason
2641			}
2642		case "deliveryType":
2643			if v != nil {
2644				var deliveryType JobDeliveryType
2645				err = json.Unmarshal(*v, &deliveryType)
2646				if err != nil {
2647					return err
2648				}
2649				jp.DeliveryType = deliveryType
2650			}
2651		case "deliveryInfo":
2652			if v != nil {
2653				var deliveryInfo JobDeliveryInfo
2654				err = json.Unmarshal(*v, &deliveryInfo)
2655				if err != nil {
2656					return err
2657				}
2658				jp.DeliveryInfo = &deliveryInfo
2659			}
2660		case "isCancellableWithoutFee":
2661			if v != nil {
2662				var isCancellableWithoutFee bool
2663				err = json.Unmarshal(*v, &isCancellableWithoutFee)
2664				if err != nil {
2665					return err
2666				}
2667				jp.IsCancellableWithoutFee = &isCancellableWithoutFee
2668			}
2669		}
2670	}
2671
2672	return nil
2673}
2674
2675// JobResource job Resource.
2676type JobResource struct {
2677	autorest.Response `json:"-"`
2678	// JobProperties - Properties of a job.
2679	*JobProperties `json:"properties,omitempty"`
2680	// Name - READ-ONLY; Name of the object.
2681	Name *string `json:"name,omitempty"`
2682	// ID - READ-ONLY; Id of the object.
2683	ID *string `json:"id,omitempty"`
2684	// Type - READ-ONLY; Type of the object.
2685	Type *string `json:"type,omitempty"`
2686	// Location - The location of the resource. This will be one of the supported and registered Azure Regions (e.g. West US, East US, Southeast Asia, etc.). The region of a resource cannot be changed once it is created, but if an identical region is specified on update the request will succeed.
2687	Location *string `json:"location,omitempty"`
2688	// Tags - The list of key value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups).
2689	Tags map[string]*string `json:"tags"`
2690	// Sku - The sku type.
2691	Sku *Sku `json:"sku,omitempty"`
2692}
2693
2694// MarshalJSON is the custom marshaler for JobResource.
2695func (jr JobResource) MarshalJSON() ([]byte, error) {
2696	objectMap := make(map[string]interface{})
2697	if jr.JobProperties != nil {
2698		objectMap["properties"] = jr.JobProperties
2699	}
2700	if jr.Location != nil {
2701		objectMap["location"] = jr.Location
2702	}
2703	if jr.Tags != nil {
2704		objectMap["tags"] = jr.Tags
2705	}
2706	if jr.Sku != nil {
2707		objectMap["sku"] = jr.Sku
2708	}
2709	return json.Marshal(objectMap)
2710}
2711
2712// UnmarshalJSON is the custom unmarshaler for JobResource struct.
2713func (jr *JobResource) UnmarshalJSON(body []byte) error {
2714	var m map[string]*json.RawMessage
2715	err := json.Unmarshal(body, &m)
2716	if err != nil {
2717		return err
2718	}
2719	for k, v := range m {
2720		switch k {
2721		case "properties":
2722			if v != nil {
2723				var jobProperties JobProperties
2724				err = json.Unmarshal(*v, &jobProperties)
2725				if err != nil {
2726					return err
2727				}
2728				jr.JobProperties = &jobProperties
2729			}
2730		case "name":
2731			if v != nil {
2732				var name string
2733				err = json.Unmarshal(*v, &name)
2734				if err != nil {
2735					return err
2736				}
2737				jr.Name = &name
2738			}
2739		case "id":
2740			if v != nil {
2741				var ID string
2742				err = json.Unmarshal(*v, &ID)
2743				if err != nil {
2744					return err
2745				}
2746				jr.ID = &ID
2747			}
2748		case "type":
2749			if v != nil {
2750				var typeVar string
2751				err = json.Unmarshal(*v, &typeVar)
2752				if err != nil {
2753					return err
2754				}
2755				jr.Type = &typeVar
2756			}
2757		case "location":
2758			if v != nil {
2759				var location string
2760				err = json.Unmarshal(*v, &location)
2761				if err != nil {
2762					return err
2763				}
2764				jr.Location = &location
2765			}
2766		case "tags":
2767			if v != nil {
2768				var tags map[string]*string
2769				err = json.Unmarshal(*v, &tags)
2770				if err != nil {
2771					return err
2772				}
2773				jr.Tags = tags
2774			}
2775		case "sku":
2776			if v != nil {
2777				var sku Sku
2778				err = json.Unmarshal(*v, &sku)
2779				if err != nil {
2780					return err
2781				}
2782				jr.Sku = &sku
2783			}
2784		}
2785	}
2786
2787	return nil
2788}
2789
2790// JobResourceList job Resource Collection
2791type JobResourceList struct {
2792	autorest.Response `json:"-"`
2793	// Value - List of job resources.
2794	Value *[]JobResource `json:"value,omitempty"`
2795	// NextLink - Link for the next set of job resources.
2796	NextLink *string `json:"nextLink,omitempty"`
2797}
2798
2799// JobResourceListIterator provides access to a complete listing of JobResource values.
2800type JobResourceListIterator struct {
2801	i    int
2802	page JobResourceListPage
2803}
2804
2805// NextWithContext advances to the next value.  If there was an error making
2806// the request the iterator does not advance and the error is returned.
2807func (iter *JobResourceListIterator) NextWithContext(ctx context.Context) (err error) {
2808	if tracing.IsEnabled() {
2809		ctx = tracing.StartSpan(ctx, fqdn+"/JobResourceListIterator.NextWithContext")
2810		defer func() {
2811			sc := -1
2812			if iter.Response().Response.Response != nil {
2813				sc = iter.Response().Response.Response.StatusCode
2814			}
2815			tracing.EndSpan(ctx, sc, err)
2816		}()
2817	}
2818	iter.i++
2819	if iter.i < len(iter.page.Values()) {
2820		return nil
2821	}
2822	err = iter.page.NextWithContext(ctx)
2823	if err != nil {
2824		iter.i--
2825		return err
2826	}
2827	iter.i = 0
2828	return nil
2829}
2830
2831// Next advances to the next value.  If there was an error making
2832// the request the iterator does not advance and the error is returned.
2833// Deprecated: Use NextWithContext() instead.
2834func (iter *JobResourceListIterator) Next() error {
2835	return iter.NextWithContext(context.Background())
2836}
2837
2838// NotDone returns true if the enumeration should be started or is not yet complete.
2839func (iter JobResourceListIterator) NotDone() bool {
2840	return iter.page.NotDone() && iter.i < len(iter.page.Values())
2841}
2842
2843// Response returns the raw server response from the last page request.
2844func (iter JobResourceListIterator) Response() JobResourceList {
2845	return iter.page.Response()
2846}
2847
2848// Value returns the current value or a zero-initialized value if the
2849// iterator has advanced beyond the end of the collection.
2850func (iter JobResourceListIterator) Value() JobResource {
2851	if !iter.page.NotDone() {
2852		return JobResource{}
2853	}
2854	return iter.page.Values()[iter.i]
2855}
2856
2857// Creates a new instance of the JobResourceListIterator type.
2858func NewJobResourceListIterator(page JobResourceListPage) JobResourceListIterator {
2859	return JobResourceListIterator{page: page}
2860}
2861
2862// IsEmpty returns true if the ListResult contains no values.
2863func (jrl JobResourceList) IsEmpty() bool {
2864	return jrl.Value == nil || len(*jrl.Value) == 0
2865}
2866
2867// hasNextLink returns true if the NextLink is not empty.
2868func (jrl JobResourceList) hasNextLink() bool {
2869	return jrl.NextLink != nil && len(*jrl.NextLink) != 0
2870}
2871
2872// jobResourceListPreparer prepares a request to retrieve the next set of results.
2873// It returns nil if no more results exist.
2874func (jrl JobResourceList) jobResourceListPreparer(ctx context.Context) (*http.Request, error) {
2875	if !jrl.hasNextLink() {
2876		return nil, nil
2877	}
2878	return autorest.Prepare((&http.Request{}).WithContext(ctx),
2879		autorest.AsJSON(),
2880		autorest.AsGet(),
2881		autorest.WithBaseURL(to.String(jrl.NextLink)))
2882}
2883
2884// JobResourceListPage contains a page of JobResource values.
2885type JobResourceListPage struct {
2886	fn  func(context.Context, JobResourceList) (JobResourceList, error)
2887	jrl JobResourceList
2888}
2889
2890// NextWithContext advances to the next page of values.  If there was an error making
2891// the request the page does not advance and the error is returned.
2892func (page *JobResourceListPage) NextWithContext(ctx context.Context) (err error) {
2893	if tracing.IsEnabled() {
2894		ctx = tracing.StartSpan(ctx, fqdn+"/JobResourceListPage.NextWithContext")
2895		defer func() {
2896			sc := -1
2897			if page.Response().Response.Response != nil {
2898				sc = page.Response().Response.Response.StatusCode
2899			}
2900			tracing.EndSpan(ctx, sc, err)
2901		}()
2902	}
2903	for {
2904		next, err := page.fn(ctx, page.jrl)
2905		if err != nil {
2906			return err
2907		}
2908		page.jrl = next
2909		if !next.hasNextLink() || !next.IsEmpty() {
2910			break
2911		}
2912	}
2913	return nil
2914}
2915
2916// Next advances to the next page of values.  If there was an error making
2917// the request the page does not advance and the error is returned.
2918// Deprecated: Use NextWithContext() instead.
2919func (page *JobResourceListPage) Next() error {
2920	return page.NextWithContext(context.Background())
2921}
2922
2923// NotDone returns true if the page enumeration should be started or is not yet complete.
2924func (page JobResourceListPage) NotDone() bool {
2925	return !page.jrl.IsEmpty()
2926}
2927
2928// Response returns the raw server response from the last page request.
2929func (page JobResourceListPage) Response() JobResourceList {
2930	return page.jrl
2931}
2932
2933// Values returns the slice of values for the current page or nil if there are no values.
2934func (page JobResourceListPage) Values() []JobResource {
2935	if page.jrl.IsEmpty() {
2936		return nil
2937	}
2938	return *page.jrl.Value
2939}
2940
2941// Creates a new instance of the JobResourceListPage type.
2942func NewJobResourceListPage(cur JobResourceList, getNextPage func(context.Context, JobResourceList) (JobResourceList, error)) JobResourceListPage {
2943	return JobResourceListPage{
2944		fn:  getNextPage,
2945		jrl: cur,
2946	}
2947}
2948
2949// JobResourceUpdateParameter the JobResourceUpdateParameter.
2950type JobResourceUpdateParameter struct {
2951	// UpdateJobProperties - Properties of a job to be updated.
2952	*UpdateJobProperties `json:"properties,omitempty"`
2953	// Tags - The list of key value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups).
2954	Tags map[string]*string `json:"tags"`
2955}
2956
2957// MarshalJSON is the custom marshaler for JobResourceUpdateParameter.
2958func (jrup JobResourceUpdateParameter) MarshalJSON() ([]byte, error) {
2959	objectMap := make(map[string]interface{})
2960	if jrup.UpdateJobProperties != nil {
2961		objectMap["properties"] = jrup.UpdateJobProperties
2962	}
2963	if jrup.Tags != nil {
2964		objectMap["tags"] = jrup.Tags
2965	}
2966	return json.Marshal(objectMap)
2967}
2968
2969// UnmarshalJSON is the custom unmarshaler for JobResourceUpdateParameter struct.
2970func (jrup *JobResourceUpdateParameter) UnmarshalJSON(body []byte) error {
2971	var m map[string]*json.RawMessage
2972	err := json.Unmarshal(body, &m)
2973	if err != nil {
2974		return err
2975	}
2976	for k, v := range m {
2977		switch k {
2978		case "properties":
2979			if v != nil {
2980				var updateJobProperties UpdateJobProperties
2981				err = json.Unmarshal(*v, &updateJobProperties)
2982				if err != nil {
2983					return err
2984				}
2985				jrup.UpdateJobProperties = &updateJobProperties
2986			}
2987		case "tags":
2988			if v != nil {
2989				var tags map[string]*string
2990				err = json.Unmarshal(*v, &tags)
2991				if err != nil {
2992					return err
2993				}
2994				jrup.Tags = tags
2995			}
2996		}
2997	}
2998
2999	return nil
3000}
3001
3002// JobsCreateFuture an abstraction for monitoring and retrieving the results of a long-running operation.
3003type JobsCreateFuture struct {
3004	azure.FutureAPI
3005	// Result returns the result of the asynchronous operation.
3006	// If the operation has not completed it will return an error.
3007	Result func(JobsClient) (JobResource, error)
3008}
3009
3010// UnmarshalJSON is the custom unmarshaller for CreateFuture.
3011func (future *JobsCreateFuture) UnmarshalJSON(body []byte) error {
3012	var azFuture azure.Future
3013	if err := json.Unmarshal(body, &azFuture); err != nil {
3014		return err
3015	}
3016	future.FutureAPI = &azFuture
3017	future.Result = future.result
3018	return nil
3019}
3020
3021// result is the default implementation for JobsCreateFuture.Result.
3022func (future *JobsCreateFuture) result(client JobsClient) (jr JobResource, err error) {
3023	var done bool
3024	done, err = future.DoneWithContext(context.Background(), client)
3025	if err != nil {
3026		err = autorest.NewErrorWithError(err, "databox.JobsCreateFuture", "Result", future.Response(), "Polling failure")
3027		return
3028	}
3029	if !done {
3030		jr.Response.Response = future.Response()
3031		err = azure.NewAsyncOpIncompleteError("databox.JobsCreateFuture")
3032		return
3033	}
3034	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
3035	if jr.Response.Response, err = future.GetResult(sender); err == nil && jr.Response.Response.StatusCode != http.StatusNoContent {
3036		jr, err = client.CreateResponder(jr.Response.Response)
3037		if err != nil {
3038			err = autorest.NewErrorWithError(err, "databox.JobsCreateFuture", "Result", jr.Response.Response, "Failure responding to request")
3039		}
3040	}
3041	return
3042}
3043
3044// JobsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation.
3045type JobsDeleteFuture struct {
3046	azure.FutureAPI
3047	// Result returns the result of the asynchronous operation.
3048	// If the operation has not completed it will return an error.
3049	Result func(JobsClient) (autorest.Response, error)
3050}
3051
3052// UnmarshalJSON is the custom unmarshaller for CreateFuture.
3053func (future *JobsDeleteFuture) UnmarshalJSON(body []byte) error {
3054	var azFuture azure.Future
3055	if err := json.Unmarshal(body, &azFuture); err != nil {
3056		return err
3057	}
3058	future.FutureAPI = &azFuture
3059	future.Result = future.result
3060	return nil
3061}
3062
3063// result is the default implementation for JobsDeleteFuture.Result.
3064func (future *JobsDeleteFuture) result(client JobsClient) (ar autorest.Response, err error) {
3065	var done bool
3066	done, err = future.DoneWithContext(context.Background(), client)
3067	if err != nil {
3068		err = autorest.NewErrorWithError(err, "databox.JobsDeleteFuture", "Result", future.Response(), "Polling failure")
3069		return
3070	}
3071	if !done {
3072		ar.Response = future.Response()
3073		err = azure.NewAsyncOpIncompleteError("databox.JobsDeleteFuture")
3074		return
3075	}
3076	ar.Response = future.Response()
3077	return
3078}
3079
3080// BasicJobSecrets the base class for the secrets
3081type BasicJobSecrets interface {
3082	AsDiskJobSecrets() (*DiskJobSecrets, bool)
3083	AsHeavyJobSecrets() (*HeavyJobSecrets, bool)
3084	AsJobSecretsType() (*JobSecretsType, bool)
3085	AsJobSecrets() (*JobSecrets, bool)
3086}
3087
3088// JobSecrets the base class for the secrets
3089type JobSecrets struct {
3090	// DcAccessSecurityCode - Dc Access Security Code for Customer Managed Shipping
3091	DcAccessSecurityCode *DcAccessSecurityCode `json:"dcAccessSecurityCode,omitempty"`
3092	// JobSecretsType - Possible values include: 'JobSecretsTypeJobSecrets', 'JobSecretsTypeDataBoxDisk', 'JobSecretsTypeDataBoxHeavy', 'JobSecretsTypeDataBox'
3093	JobSecretsType JobSecretsTypeEnum `json:"jobSecretsType,omitempty"`
3094}
3095
3096func unmarshalBasicJobSecrets(body []byte) (BasicJobSecrets, error) {
3097	var m map[string]interface{}
3098	err := json.Unmarshal(body, &m)
3099	if err != nil {
3100		return nil, err
3101	}
3102
3103	switch m["jobSecretsType"] {
3104	case string(JobSecretsTypeDataBoxDisk):
3105		var djs DiskJobSecrets
3106		err := json.Unmarshal(body, &djs)
3107		return djs, err
3108	case string(JobSecretsTypeDataBoxHeavy):
3109		var hjs HeavyJobSecrets
3110		err := json.Unmarshal(body, &hjs)
3111		return hjs, err
3112	case string(JobSecretsTypeDataBox):
3113		var jst JobSecretsType
3114		err := json.Unmarshal(body, &jst)
3115		return jst, err
3116	default:
3117		var js JobSecrets
3118		err := json.Unmarshal(body, &js)
3119		return js, err
3120	}
3121}
3122func unmarshalBasicJobSecretsArray(body []byte) ([]BasicJobSecrets, error) {
3123	var rawMessages []*json.RawMessage
3124	err := json.Unmarshal(body, &rawMessages)
3125	if err != nil {
3126		return nil, err
3127	}
3128
3129	jsArray := make([]BasicJobSecrets, len(rawMessages))
3130
3131	for index, rawMessage := range rawMessages {
3132		js, err := unmarshalBasicJobSecrets(*rawMessage)
3133		if err != nil {
3134			return nil, err
3135		}
3136		jsArray[index] = js
3137	}
3138	return jsArray, nil
3139}
3140
3141// MarshalJSON is the custom marshaler for JobSecrets.
3142func (js JobSecrets) MarshalJSON() ([]byte, error) {
3143	js.JobSecretsType = JobSecretsTypeJobSecrets
3144	objectMap := make(map[string]interface{})
3145	if js.DcAccessSecurityCode != nil {
3146		objectMap["dcAccessSecurityCode"] = js.DcAccessSecurityCode
3147	}
3148	if js.JobSecretsType != "" {
3149		objectMap["jobSecretsType"] = js.JobSecretsType
3150	}
3151	return json.Marshal(objectMap)
3152}
3153
3154// AsDiskJobSecrets is the BasicJobSecrets implementation for JobSecrets.
3155func (js JobSecrets) AsDiskJobSecrets() (*DiskJobSecrets, bool) {
3156	return nil, false
3157}
3158
3159// AsHeavyJobSecrets is the BasicJobSecrets implementation for JobSecrets.
3160func (js JobSecrets) AsHeavyJobSecrets() (*HeavyJobSecrets, bool) {
3161	return nil, false
3162}
3163
3164// AsJobSecretsType is the BasicJobSecrets implementation for JobSecrets.
3165func (js JobSecrets) AsJobSecretsType() (*JobSecretsType, bool) {
3166	return nil, false
3167}
3168
3169// AsJobSecrets is the BasicJobSecrets implementation for JobSecrets.
3170func (js JobSecrets) AsJobSecrets() (*JobSecrets, bool) {
3171	return &js, true
3172}
3173
3174// AsBasicJobSecrets is the BasicJobSecrets implementation for JobSecrets.
3175func (js JobSecrets) AsBasicJobSecrets() (BasicJobSecrets, bool) {
3176	return &js, true
3177}
3178
3179// JobSecretsType the secrets related to a databox job.
3180type JobSecretsType struct {
3181	// PodSecrets - Contains the list of secret objects for a job.
3182	PodSecrets *[]Secret `json:"podSecrets,omitempty"`
3183	// DcAccessSecurityCode - Dc Access Security Code for Customer Managed Shipping
3184	DcAccessSecurityCode *DcAccessSecurityCode `json:"dcAccessSecurityCode,omitempty"`
3185	// JobSecretsType - Possible values include: 'JobSecretsTypeJobSecrets', 'JobSecretsTypeDataBoxDisk', 'JobSecretsTypeDataBoxHeavy', 'JobSecretsTypeDataBox'
3186	JobSecretsType JobSecretsTypeEnum `json:"jobSecretsType,omitempty"`
3187}
3188
3189// MarshalJSON is the custom marshaler for JobSecretsType.
3190func (jst JobSecretsType) MarshalJSON() ([]byte, error) {
3191	jst.JobSecretsType = JobSecretsTypeDataBox
3192	objectMap := make(map[string]interface{})
3193	if jst.PodSecrets != nil {
3194		objectMap["podSecrets"] = jst.PodSecrets
3195	}
3196	if jst.DcAccessSecurityCode != nil {
3197		objectMap["dcAccessSecurityCode"] = jst.DcAccessSecurityCode
3198	}
3199	if jst.JobSecretsType != "" {
3200		objectMap["jobSecretsType"] = jst.JobSecretsType
3201	}
3202	return json.Marshal(objectMap)
3203}
3204
3205// AsDiskJobSecrets is the BasicJobSecrets implementation for JobSecretsType.
3206func (jst JobSecretsType) AsDiskJobSecrets() (*DiskJobSecrets, bool) {
3207	return nil, false
3208}
3209
3210// AsHeavyJobSecrets is the BasicJobSecrets implementation for JobSecretsType.
3211func (jst JobSecretsType) AsHeavyJobSecrets() (*HeavyJobSecrets, bool) {
3212	return nil, false
3213}
3214
3215// AsJobSecretsType is the BasicJobSecrets implementation for JobSecretsType.
3216func (jst JobSecretsType) AsJobSecretsType() (*JobSecretsType, bool) {
3217	return &jst, true
3218}
3219
3220// AsJobSecrets is the BasicJobSecrets implementation for JobSecretsType.
3221func (jst JobSecretsType) AsJobSecrets() (*JobSecrets, bool) {
3222	return nil, false
3223}
3224
3225// AsBasicJobSecrets is the BasicJobSecrets implementation for JobSecretsType.
3226func (jst JobSecretsType) AsBasicJobSecrets() (BasicJobSecrets, bool) {
3227	return &jst, true
3228}
3229
3230// JobStages job stages.
3231type JobStages struct {
3232	// StageName - READ-ONLY; Name of the job stage. Possible values include: 'StageNameDeviceOrdered', 'StageNameDevicePrepared', 'StageNameDispatched', 'StageNameDelivered', 'StageNamePickedUp', 'StageNameAtAzureDC', 'StageNameDataCopy', 'StageNameCompleted', 'StageNameCompletedWithErrors', 'StageNameCancelled', 'StageNameFailedIssueReportedAtCustomer', 'StageNameFailedIssueDetectedAtAzureDC', 'StageNameAborted', 'StageNameCompletedWithWarnings', 'StageNameReadyToDispatchFromAzureDC', 'StageNameReadyToReceiveAtAzureDC'
3233	StageName StageName `json:"stageName,omitempty"`
3234	// DisplayName - READ-ONLY; Display name of the job stage.
3235	DisplayName *string `json:"displayName,omitempty"`
3236	// StageStatus - READ-ONLY; Status of the job stage. Possible values include: 'StageStatusNone', 'StageStatusInProgress', 'StageStatusSucceeded', 'StageStatusFailed', 'StageStatusCancelled', 'StageStatusCancelling', 'StageStatusSucceededWithErrors'
3237	StageStatus StageStatus `json:"stageStatus,omitempty"`
3238	// StageTime - READ-ONLY; Time for the job stage in UTC ISO 8601 format.
3239	StageTime *date.Time `json:"stageTime,omitempty"`
3240	// JobStageDetails - READ-ONLY; Job Stage Details
3241	JobStageDetails interface{} `json:"jobStageDetails,omitempty"`
3242	// ErrorDetails - READ-ONLY; Error details for the stage.
3243	ErrorDetails *[]JobErrorDetails `json:"errorDetails,omitempty"`
3244}
3245
3246// MarshalJSON is the custom marshaler for JobStages.
3247func (js JobStages) MarshalJSON() ([]byte, error) {
3248	objectMap := make(map[string]interface{})
3249	return json.Marshal(objectMap)
3250}
3251
3252// JobsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation.
3253type JobsUpdateFuture struct {
3254	azure.FutureAPI
3255	// Result returns the result of the asynchronous operation.
3256	// If the operation has not completed it will return an error.
3257	Result func(JobsClient) (JobResource, error)
3258}
3259
3260// UnmarshalJSON is the custom unmarshaller for CreateFuture.
3261func (future *JobsUpdateFuture) UnmarshalJSON(body []byte) error {
3262	var azFuture azure.Future
3263	if err := json.Unmarshal(body, &azFuture); err != nil {
3264		return err
3265	}
3266	future.FutureAPI = &azFuture
3267	future.Result = future.result
3268	return nil
3269}
3270
3271// result is the default implementation for JobsUpdateFuture.Result.
3272func (future *JobsUpdateFuture) result(client JobsClient) (jr JobResource, err error) {
3273	var done bool
3274	done, err = future.DoneWithContext(context.Background(), client)
3275	if err != nil {
3276		err = autorest.NewErrorWithError(err, "databox.JobsUpdateFuture", "Result", future.Response(), "Polling failure")
3277		return
3278	}
3279	if !done {
3280		jr.Response.Response = future.Response()
3281		err = azure.NewAsyncOpIncompleteError("databox.JobsUpdateFuture")
3282		return
3283	}
3284	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
3285	if jr.Response.Response, err = future.GetResult(sender); err == nil && jr.Response.Response.StatusCode != http.StatusNoContent {
3286		jr, err = client.UpdateResponder(jr.Response.Response)
3287		if err != nil {
3288			err = autorest.NewErrorWithError(err, "databox.JobsUpdateFuture", "Result", jr.Response.Response, "Failure responding to request")
3289		}
3290	}
3291	return
3292}
3293
3294// NotificationPreference notification preference for a job stage.
3295type NotificationPreference struct {
3296	// StageName - Name of the stage. Possible values include: 'DevicePrepared', 'Dispatched', 'Delivered', 'PickedUp', 'AtAzureDC', 'DataCopy'
3297	StageName NotificationStageName `json:"stageName,omitempty"`
3298	// SendNotification - Notification is required or not.
3299	SendNotification *bool `json:"sendNotification,omitempty"`
3300}
3301
3302// Operation operation entity.
3303type Operation struct {
3304	// Name - READ-ONLY; Name of the operation. Format: {resourceProviderNamespace}/{resourceType}/{read|write|delete|action}
3305	Name *string `json:"name,omitempty"`
3306	// Display - READ-ONLY; Operation display values.
3307	Display *OperationDisplay `json:"display,omitempty"`
3308	// Properties - READ-ONLY; Operation properties.
3309	Properties interface{} `json:"properties,omitempty"`
3310	// Origin - READ-ONLY; Origin of the operation. Can be : user|system|user,system
3311	Origin *string `json:"origin,omitempty"`
3312}
3313
3314// MarshalJSON is the custom marshaler for Operation.
3315func (o Operation) MarshalJSON() ([]byte, error) {
3316	objectMap := make(map[string]interface{})
3317	return json.Marshal(objectMap)
3318}
3319
3320// OperationDisplay operation display
3321type OperationDisplay struct {
3322	// Provider - Provider name.
3323	Provider *string `json:"provider,omitempty"`
3324	// Resource - Resource name.
3325	Resource *string `json:"resource,omitempty"`
3326	// Operation - Localized name of the operation for display purpose.
3327	Operation *string `json:"operation,omitempty"`
3328	// Description - Localized description of the operation for display purpose.
3329	Description *string `json:"description,omitempty"`
3330}
3331
3332// OperationList operation Collection.
3333type OperationList struct {
3334	autorest.Response `json:"-"`
3335	// Value - READ-ONLY; List of operations.
3336	Value *[]Operation `json:"value,omitempty"`
3337	// NextLink - Link for the next set of operations.
3338	NextLink *string `json:"nextLink,omitempty"`
3339}
3340
3341// MarshalJSON is the custom marshaler for OperationList.
3342func (ol OperationList) MarshalJSON() ([]byte, error) {
3343	objectMap := make(map[string]interface{})
3344	if ol.NextLink != nil {
3345		objectMap["nextLink"] = ol.NextLink
3346	}
3347	return json.Marshal(objectMap)
3348}
3349
3350// OperationListIterator provides access to a complete listing of Operation values.
3351type OperationListIterator struct {
3352	i    int
3353	page OperationListPage
3354}
3355
3356// NextWithContext advances to the next value.  If there was an error making
3357// the request the iterator does not advance and the error is returned.
3358func (iter *OperationListIterator) NextWithContext(ctx context.Context) (err error) {
3359	if tracing.IsEnabled() {
3360		ctx = tracing.StartSpan(ctx, fqdn+"/OperationListIterator.NextWithContext")
3361		defer func() {
3362			sc := -1
3363			if iter.Response().Response.Response != nil {
3364				sc = iter.Response().Response.Response.StatusCode
3365			}
3366			tracing.EndSpan(ctx, sc, err)
3367		}()
3368	}
3369	iter.i++
3370	if iter.i < len(iter.page.Values()) {
3371		return nil
3372	}
3373	err = iter.page.NextWithContext(ctx)
3374	if err != nil {
3375		iter.i--
3376		return err
3377	}
3378	iter.i = 0
3379	return nil
3380}
3381
3382// Next advances to the next value.  If there was an error making
3383// the request the iterator does not advance and the error is returned.
3384// Deprecated: Use NextWithContext() instead.
3385func (iter *OperationListIterator) Next() error {
3386	return iter.NextWithContext(context.Background())
3387}
3388
3389// NotDone returns true if the enumeration should be started or is not yet complete.
3390func (iter OperationListIterator) NotDone() bool {
3391	return iter.page.NotDone() && iter.i < len(iter.page.Values())
3392}
3393
3394// Response returns the raw server response from the last page request.
3395func (iter OperationListIterator) Response() OperationList {
3396	return iter.page.Response()
3397}
3398
3399// Value returns the current value or a zero-initialized value if the
3400// iterator has advanced beyond the end of the collection.
3401func (iter OperationListIterator) Value() Operation {
3402	if !iter.page.NotDone() {
3403		return Operation{}
3404	}
3405	return iter.page.Values()[iter.i]
3406}
3407
3408// Creates a new instance of the OperationListIterator type.
3409func NewOperationListIterator(page OperationListPage) OperationListIterator {
3410	return OperationListIterator{page: page}
3411}
3412
3413// IsEmpty returns true if the ListResult contains no values.
3414func (ol OperationList) IsEmpty() bool {
3415	return ol.Value == nil || len(*ol.Value) == 0
3416}
3417
3418// hasNextLink returns true if the NextLink is not empty.
3419func (ol OperationList) hasNextLink() bool {
3420	return ol.NextLink != nil && len(*ol.NextLink) != 0
3421}
3422
3423// operationListPreparer prepares a request to retrieve the next set of results.
3424// It returns nil if no more results exist.
3425func (ol OperationList) operationListPreparer(ctx context.Context) (*http.Request, error) {
3426	if !ol.hasNextLink() {
3427		return nil, nil
3428	}
3429	return autorest.Prepare((&http.Request{}).WithContext(ctx),
3430		autorest.AsJSON(),
3431		autorest.AsGet(),
3432		autorest.WithBaseURL(to.String(ol.NextLink)))
3433}
3434
3435// OperationListPage contains a page of Operation values.
3436type OperationListPage struct {
3437	fn func(context.Context, OperationList) (OperationList, error)
3438	ol OperationList
3439}
3440
3441// NextWithContext advances to the next page of values.  If there was an error making
3442// the request the page does not advance and the error is returned.
3443func (page *OperationListPage) NextWithContext(ctx context.Context) (err error) {
3444	if tracing.IsEnabled() {
3445		ctx = tracing.StartSpan(ctx, fqdn+"/OperationListPage.NextWithContext")
3446		defer func() {
3447			sc := -1
3448			if page.Response().Response.Response != nil {
3449				sc = page.Response().Response.Response.StatusCode
3450			}
3451			tracing.EndSpan(ctx, sc, err)
3452		}()
3453	}
3454	for {
3455		next, err := page.fn(ctx, page.ol)
3456		if err != nil {
3457			return err
3458		}
3459		page.ol = next
3460		if !next.hasNextLink() || !next.IsEmpty() {
3461			break
3462		}
3463	}
3464	return nil
3465}
3466
3467// Next advances to the next page of values.  If there was an error making
3468// the request the page does not advance and the error is returned.
3469// Deprecated: Use NextWithContext() instead.
3470func (page *OperationListPage) Next() error {
3471	return page.NextWithContext(context.Background())
3472}
3473
3474// NotDone returns true if the page enumeration should be started or is not yet complete.
3475func (page OperationListPage) NotDone() bool {
3476	return !page.ol.IsEmpty()
3477}
3478
3479// Response returns the raw server response from the last page request.
3480func (page OperationListPage) Response() OperationList {
3481	return page.ol
3482}
3483
3484// Values returns the slice of values for the current page or nil if there are no values.
3485func (page OperationListPage) Values() []Operation {
3486	if page.ol.IsEmpty() {
3487		return nil
3488	}
3489	return *page.ol.Value
3490}
3491
3492// Creates a new instance of the OperationListPage type.
3493func NewOperationListPage(cur OperationList, getNextPage func(context.Context, OperationList) (OperationList, error)) OperationListPage {
3494	return OperationListPage{
3495		fn: getNextPage,
3496		ol: cur,
3497	}
3498}
3499
3500// PackageShippingDetails shipping details.
3501type PackageShippingDetails struct {
3502	// CarrierName - READ-ONLY; Name of the carrier.
3503	CarrierName *string `json:"carrierName,omitempty"`
3504	// TrackingID - READ-ONLY; Tracking Id of shipment.
3505	TrackingID *string `json:"trackingId,omitempty"`
3506	// TrackingURL - READ-ONLY; Url where shipment can be tracked.
3507	TrackingURL *string `json:"trackingUrl,omitempty"`
3508}
3509
3510// MarshalJSON is the custom marshaler for PackageShippingDetails.
3511func (psd PackageShippingDetails) MarshalJSON() ([]byte, error) {
3512	objectMap := make(map[string]interface{})
3513	return json.Marshal(objectMap)
3514}
3515
3516// Preferences preferences related to the order
3517type Preferences struct {
3518	// PreferredDataCenterRegion - Preferred Data Center Region.
3519	PreferredDataCenterRegion *[]string `json:"preferredDataCenterRegion,omitempty"`
3520	// TransportPreferences - Preferences related to the shipment logistics of the sku.
3521	TransportPreferences *TransportPreferences `json:"transportPreferences,omitempty"`
3522}
3523
3524// PreferencesValidationRequest request to validate preference of transport and data center.
3525type PreferencesValidationRequest struct {
3526	// Preference - Preference requested with respect to transport type and data center
3527	Preference *Preferences `json:"preference,omitempty"`
3528	// DeviceType - Device type to be used for the job. Possible values include: 'DataBox', 'DataBoxDisk', 'DataBoxHeavy'
3529	DeviceType SkuName `json:"deviceType,omitempty"`
3530	// ValidationType - Possible values include: 'ValidationTypeValidationInputRequest', 'ValidationTypeValidateCreateOrderLimit', 'ValidationTypeValidateDataDestinationDetails', 'ValidationTypeValidatePreferences', 'ValidationTypeValidateSkuAvailability', 'ValidationTypeValidateSubscriptionIsAllowedToCreateJob', 'ValidationTypeValidateAddress'
3531	ValidationType ValidationType `json:"validationType,omitempty"`
3532}
3533
3534// MarshalJSON is the custom marshaler for PreferencesValidationRequest.
3535func (pvr PreferencesValidationRequest) MarshalJSON() ([]byte, error) {
3536	pvr.ValidationType = ValidationTypeValidatePreferences
3537	objectMap := make(map[string]interface{})
3538	if pvr.Preference != nil {
3539		objectMap["preference"] = pvr.Preference
3540	}
3541	if pvr.DeviceType != "" {
3542		objectMap["deviceType"] = pvr.DeviceType
3543	}
3544	if pvr.ValidationType != "" {
3545		objectMap["validationType"] = pvr.ValidationType
3546	}
3547	return json.Marshal(objectMap)
3548}
3549
3550// AsCreateOrderLimitForSubscriptionValidationRequest is the BasicValidationInputRequest implementation for PreferencesValidationRequest.
3551func (pvr PreferencesValidationRequest) AsCreateOrderLimitForSubscriptionValidationRequest() (*CreateOrderLimitForSubscriptionValidationRequest, bool) {
3552	return nil, false
3553}
3554
3555// AsDataDestinationDetailsValidationRequest is the BasicValidationInputRequest implementation for PreferencesValidationRequest.
3556func (pvr PreferencesValidationRequest) AsDataDestinationDetailsValidationRequest() (*DataDestinationDetailsValidationRequest, bool) {
3557	return nil, false
3558}
3559
3560// AsPreferencesValidationRequest is the BasicValidationInputRequest implementation for PreferencesValidationRequest.
3561func (pvr PreferencesValidationRequest) AsPreferencesValidationRequest() (*PreferencesValidationRequest, bool) {
3562	return &pvr, true
3563}
3564
3565// AsSkuAvailabilityValidationRequest is the BasicValidationInputRequest implementation for PreferencesValidationRequest.
3566func (pvr PreferencesValidationRequest) AsSkuAvailabilityValidationRequest() (*SkuAvailabilityValidationRequest, bool) {
3567	return nil, false
3568}
3569
3570// AsSubscriptionIsAllowedToCreateJobValidationRequest is the BasicValidationInputRequest implementation for PreferencesValidationRequest.
3571func (pvr PreferencesValidationRequest) AsSubscriptionIsAllowedToCreateJobValidationRequest() (*SubscriptionIsAllowedToCreateJobValidationRequest, bool) {
3572	return nil, false
3573}
3574
3575// AsValidateAddress is the BasicValidationInputRequest implementation for PreferencesValidationRequest.
3576func (pvr PreferencesValidationRequest) AsValidateAddress() (*ValidateAddress, bool) {
3577	return nil, false
3578}
3579
3580// AsValidationInputRequest is the BasicValidationInputRequest implementation for PreferencesValidationRequest.
3581func (pvr PreferencesValidationRequest) AsValidationInputRequest() (*ValidationInputRequest, bool) {
3582	return nil, false
3583}
3584
3585// AsBasicValidationInputRequest is the BasicValidationInputRequest implementation for PreferencesValidationRequest.
3586func (pvr PreferencesValidationRequest) AsBasicValidationInputRequest() (BasicValidationInputRequest, bool) {
3587	return &pvr, true
3588}
3589
3590// PreferencesValidationResponseProperties properties of data center and transport preference validation
3591// response.
3592type PreferencesValidationResponseProperties struct {
3593	// Status - READ-ONLY; Validation status of requested data center and transport. Possible values include: 'ValidationStatusValid', 'ValidationStatusInvalid', 'ValidationStatusSkipped'
3594	Status ValidationStatus `json:"status,omitempty"`
3595	// Error - READ-ONLY; Error code and message of validation response.
3596	Error *Error `json:"error,omitempty"`
3597	// ValidationType - Possible values include: 'ValidationTypeBasicValidationInputResponseValidationTypeValidationInputResponse', 'ValidationTypeBasicValidationInputResponseValidationTypeValidateAddress', 'ValidationTypeBasicValidationInputResponseValidationTypeValidateCreateOrderLimit', 'ValidationTypeBasicValidationInputResponseValidationTypeValidateDataDestinationDetails', 'ValidationTypeBasicValidationInputResponseValidationTypeValidatePreferences', 'ValidationTypeBasicValidationInputResponseValidationTypeValidateSkuAvailability', 'ValidationTypeBasicValidationInputResponseValidationTypeValidateSubscriptionIsAllowedToCreateJob'
3598	ValidationType ValidationTypeBasicValidationInputResponse `json:"validationType,omitempty"`
3599}
3600
3601// MarshalJSON is the custom marshaler for PreferencesValidationResponseProperties.
3602func (pvrp PreferencesValidationResponseProperties) MarshalJSON() ([]byte, error) {
3603	pvrp.ValidationType = ValidationTypeBasicValidationInputResponseValidationTypeValidatePreferences
3604	objectMap := make(map[string]interface{})
3605	if pvrp.ValidationType != "" {
3606		objectMap["validationType"] = pvrp.ValidationType
3607	}
3608	return json.Marshal(objectMap)
3609}
3610
3611// AsAddressValidationProperties is the BasicValidationInputResponse implementation for PreferencesValidationResponseProperties.
3612func (pvrp PreferencesValidationResponseProperties) AsAddressValidationProperties() (*AddressValidationProperties, bool) {
3613	return nil, false
3614}
3615
3616// AsCreateOrderLimitForSubscriptionValidationResponseProperties is the BasicValidationInputResponse implementation for PreferencesValidationResponseProperties.
3617func (pvrp PreferencesValidationResponseProperties) AsCreateOrderLimitForSubscriptionValidationResponseProperties() (*CreateOrderLimitForSubscriptionValidationResponseProperties, bool) {
3618	return nil, false
3619}
3620
3621// AsDataDestinationDetailsValidationResponseProperties is the BasicValidationInputResponse implementation for PreferencesValidationResponseProperties.
3622func (pvrp PreferencesValidationResponseProperties) AsDataDestinationDetailsValidationResponseProperties() (*DataDestinationDetailsValidationResponseProperties, bool) {
3623	return nil, false
3624}
3625
3626// AsPreferencesValidationResponseProperties is the BasicValidationInputResponse implementation for PreferencesValidationResponseProperties.
3627func (pvrp PreferencesValidationResponseProperties) AsPreferencesValidationResponseProperties() (*PreferencesValidationResponseProperties, bool) {
3628	return &pvrp, true
3629}
3630
3631// AsSkuAvailabilityValidationResponseProperties is the BasicValidationInputResponse implementation for PreferencesValidationResponseProperties.
3632func (pvrp PreferencesValidationResponseProperties) AsSkuAvailabilityValidationResponseProperties() (*SkuAvailabilityValidationResponseProperties, bool) {
3633	return nil, false
3634}
3635
3636// AsSubscriptionIsAllowedToCreateJobValidationResponseProperties is the BasicValidationInputResponse implementation for PreferencesValidationResponseProperties.
3637func (pvrp PreferencesValidationResponseProperties) AsSubscriptionIsAllowedToCreateJobValidationResponseProperties() (*SubscriptionIsAllowedToCreateJobValidationResponseProperties, bool) {
3638	return nil, false
3639}
3640
3641// AsValidationInputResponse is the BasicValidationInputResponse implementation for PreferencesValidationResponseProperties.
3642func (pvrp PreferencesValidationResponseProperties) AsValidationInputResponse() (*ValidationInputResponse, bool) {
3643	return nil, false
3644}
3645
3646// AsBasicValidationInputResponse is the BasicValidationInputResponse implementation for PreferencesValidationResponseProperties.
3647func (pvrp PreferencesValidationResponseProperties) AsBasicValidationInputResponse() (BasicValidationInputResponse, bool) {
3648	return &pvrp, true
3649}
3650
3651// RegionConfigurationRequest request body to get the configuration for the region.
3652type RegionConfigurationRequest struct {
3653	// ScheduleAvailabilityRequest - Request body to get the availability for scheduling orders.
3654	ScheduleAvailabilityRequest BasicScheduleAvailabilityRequest `json:"scheduleAvailabilityRequest,omitempty"`
3655	// TransportAvailabilityRequest - Request body to get the transport availability for given sku.
3656	TransportAvailabilityRequest *TransportAvailabilityRequest `json:"transportAvailabilityRequest,omitempty"`
3657}
3658
3659// UnmarshalJSON is the custom unmarshaler for RegionConfigurationRequest struct.
3660func (rcr *RegionConfigurationRequest) UnmarshalJSON(body []byte) error {
3661	var m map[string]*json.RawMessage
3662	err := json.Unmarshal(body, &m)
3663	if err != nil {
3664		return err
3665	}
3666	for k, v := range m {
3667		switch k {
3668		case "scheduleAvailabilityRequest":
3669			if v != nil {
3670				scheduleAvailabilityRequest, err := unmarshalBasicScheduleAvailabilityRequest(*v)
3671				if err != nil {
3672					return err
3673				}
3674				rcr.ScheduleAvailabilityRequest = scheduleAvailabilityRequest
3675			}
3676		case "transportAvailabilityRequest":
3677			if v != nil {
3678				var transportAvailabilityRequest TransportAvailabilityRequest
3679				err = json.Unmarshal(*v, &transportAvailabilityRequest)
3680				if err != nil {
3681					return err
3682				}
3683				rcr.TransportAvailabilityRequest = &transportAvailabilityRequest
3684			}
3685		}
3686	}
3687
3688	return nil
3689}
3690
3691// RegionConfigurationResponse configuration response specific to a region.
3692type RegionConfigurationResponse struct {
3693	autorest.Response `json:"-"`
3694	// ScheduleAvailabilityResponse - READ-ONLY; Schedule availability for given sku in a region.
3695	ScheduleAvailabilityResponse *ScheduleAvailabilityResponse `json:"scheduleAvailabilityResponse,omitempty"`
3696	// TransportAvailabilityResponse - READ-ONLY; Transport options available for given sku in a region.
3697	TransportAvailabilityResponse *TransportAvailabilityResponse `json:"transportAvailabilityResponse,omitempty"`
3698}
3699
3700// MarshalJSON is the custom marshaler for RegionConfigurationResponse.
3701func (rcr RegionConfigurationResponse) MarshalJSON() ([]byte, error) {
3702	objectMap := make(map[string]interface{})
3703	return json.Marshal(objectMap)
3704}
3705
3706// Resource model of the Resource.
3707type Resource struct {
3708	// Location - The location of the resource. This will be one of the supported and registered Azure Regions (e.g. West US, East US, Southeast Asia, etc.). The region of a resource cannot be changed once it is created, but if an identical region is specified on update the request will succeed.
3709	Location *string `json:"location,omitempty"`
3710	// Tags - The list of key value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups).
3711	Tags map[string]*string `json:"tags"`
3712	// Sku - The sku type.
3713	Sku *Sku `json:"sku,omitempty"`
3714}
3715
3716// MarshalJSON is the custom marshaler for Resource.
3717func (r Resource) MarshalJSON() ([]byte, error) {
3718	objectMap := make(map[string]interface{})
3719	if r.Location != nil {
3720		objectMap["location"] = r.Location
3721	}
3722	if r.Tags != nil {
3723		objectMap["tags"] = r.Tags
3724	}
3725	if r.Sku != nil {
3726		objectMap["sku"] = r.Sku
3727	}
3728	return json.Marshal(objectMap)
3729}
3730
3731// BasicScheduleAvailabilityRequest request body to get the availability for scheduling orders.
3732type BasicScheduleAvailabilityRequest interface {
3733	AsScheduleAvailabilityRequestType() (*ScheduleAvailabilityRequestType, bool)
3734	AsDiskScheduleAvailabilityRequest() (*DiskScheduleAvailabilityRequest, bool)
3735	AsHeavyScheduleAvailabilityRequest() (*HeavyScheduleAvailabilityRequest, bool)
3736	AsScheduleAvailabilityRequest() (*ScheduleAvailabilityRequest, bool)
3737}
3738
3739// ScheduleAvailabilityRequest request body to get the availability for scheduling orders.
3740type ScheduleAvailabilityRequest struct {
3741	// StorageLocation - Location for data transfer.
3742	// For locations check: https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01
3743	StorageLocation *string `json:"storageLocation,omitempty"`
3744	// SkuName - Possible values include: 'SkuNameScheduleAvailabilityRequest', 'SkuNameDataBox', 'SkuNameDataBoxDisk', 'SkuNameDataBoxHeavy'
3745	SkuName SkuNameBasicScheduleAvailabilityRequest `json:"skuName,omitempty"`
3746}
3747
3748func unmarshalBasicScheduleAvailabilityRequest(body []byte) (BasicScheduleAvailabilityRequest, error) {
3749	var m map[string]interface{}
3750	err := json.Unmarshal(body, &m)
3751	if err != nil {
3752		return nil, err
3753	}
3754
3755	switch m["skuName"] {
3756	case string(SkuNameDataBox):
3757		var sart ScheduleAvailabilityRequestType
3758		err := json.Unmarshal(body, &sart)
3759		return sart, err
3760	case string(SkuNameDataBoxDisk):
3761		var dsar DiskScheduleAvailabilityRequest
3762		err := json.Unmarshal(body, &dsar)
3763		return dsar, err
3764	case string(SkuNameDataBoxHeavy):
3765		var hsar HeavyScheduleAvailabilityRequest
3766		err := json.Unmarshal(body, &hsar)
3767		return hsar, err
3768	default:
3769		var sar ScheduleAvailabilityRequest
3770		err := json.Unmarshal(body, &sar)
3771		return sar, err
3772	}
3773}
3774func unmarshalBasicScheduleAvailabilityRequestArray(body []byte) ([]BasicScheduleAvailabilityRequest, error) {
3775	var rawMessages []*json.RawMessage
3776	err := json.Unmarshal(body, &rawMessages)
3777	if err != nil {
3778		return nil, err
3779	}
3780
3781	sarArray := make([]BasicScheduleAvailabilityRequest, len(rawMessages))
3782
3783	for index, rawMessage := range rawMessages {
3784		sar, err := unmarshalBasicScheduleAvailabilityRequest(*rawMessage)
3785		if err != nil {
3786			return nil, err
3787		}
3788		sarArray[index] = sar
3789	}
3790	return sarArray, nil
3791}
3792
3793// MarshalJSON is the custom marshaler for ScheduleAvailabilityRequest.
3794func (sar ScheduleAvailabilityRequest) MarshalJSON() ([]byte, error) {
3795	sar.SkuName = SkuNameScheduleAvailabilityRequest
3796	objectMap := make(map[string]interface{})
3797	if sar.StorageLocation != nil {
3798		objectMap["storageLocation"] = sar.StorageLocation
3799	}
3800	if sar.SkuName != "" {
3801		objectMap["skuName"] = sar.SkuName
3802	}
3803	return json.Marshal(objectMap)
3804}
3805
3806// AsScheduleAvailabilityRequestType is the BasicScheduleAvailabilityRequest implementation for ScheduleAvailabilityRequest.
3807func (sar ScheduleAvailabilityRequest) AsScheduleAvailabilityRequestType() (*ScheduleAvailabilityRequestType, bool) {
3808	return nil, false
3809}
3810
3811// AsDiskScheduleAvailabilityRequest is the BasicScheduleAvailabilityRequest implementation for ScheduleAvailabilityRequest.
3812func (sar ScheduleAvailabilityRequest) AsDiskScheduleAvailabilityRequest() (*DiskScheduleAvailabilityRequest, bool) {
3813	return nil, false
3814}
3815
3816// AsHeavyScheduleAvailabilityRequest is the BasicScheduleAvailabilityRequest implementation for ScheduleAvailabilityRequest.
3817func (sar ScheduleAvailabilityRequest) AsHeavyScheduleAvailabilityRequest() (*HeavyScheduleAvailabilityRequest, bool) {
3818	return nil, false
3819}
3820
3821// AsScheduleAvailabilityRequest is the BasicScheduleAvailabilityRequest implementation for ScheduleAvailabilityRequest.
3822func (sar ScheduleAvailabilityRequest) AsScheduleAvailabilityRequest() (*ScheduleAvailabilityRequest, bool) {
3823	return &sar, true
3824}
3825
3826// AsBasicScheduleAvailabilityRequest is the BasicScheduleAvailabilityRequest implementation for ScheduleAvailabilityRequest.
3827func (sar ScheduleAvailabilityRequest) AsBasicScheduleAvailabilityRequest() (BasicScheduleAvailabilityRequest, bool) {
3828	return &sar, true
3829}
3830
3831// ScheduleAvailabilityRequestType request body to get the availability for scheduling data box orders
3832// orders.
3833type ScheduleAvailabilityRequestType struct {
3834	// StorageLocation - Location for data transfer.
3835	// For locations check: https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01
3836	StorageLocation *string `json:"storageLocation,omitempty"`
3837	// SkuName - Possible values include: 'SkuNameScheduleAvailabilityRequest', 'SkuNameDataBox', 'SkuNameDataBoxDisk', 'SkuNameDataBoxHeavy'
3838	SkuName SkuNameBasicScheduleAvailabilityRequest `json:"skuName,omitempty"`
3839}
3840
3841// MarshalJSON is the custom marshaler for ScheduleAvailabilityRequestType.
3842func (sart ScheduleAvailabilityRequestType) MarshalJSON() ([]byte, error) {
3843	sart.SkuName = SkuNameDataBox
3844	objectMap := make(map[string]interface{})
3845	if sart.StorageLocation != nil {
3846		objectMap["storageLocation"] = sart.StorageLocation
3847	}
3848	if sart.SkuName != "" {
3849		objectMap["skuName"] = sart.SkuName
3850	}
3851	return json.Marshal(objectMap)
3852}
3853
3854// AsScheduleAvailabilityRequestType is the BasicScheduleAvailabilityRequest implementation for ScheduleAvailabilityRequestType.
3855func (sart ScheduleAvailabilityRequestType) AsScheduleAvailabilityRequestType() (*ScheduleAvailabilityRequestType, bool) {
3856	return &sart, true
3857}
3858
3859// AsDiskScheduleAvailabilityRequest is the BasicScheduleAvailabilityRequest implementation for ScheduleAvailabilityRequestType.
3860func (sart ScheduleAvailabilityRequestType) AsDiskScheduleAvailabilityRequest() (*DiskScheduleAvailabilityRequest, bool) {
3861	return nil, false
3862}
3863
3864// AsHeavyScheduleAvailabilityRequest is the BasicScheduleAvailabilityRequest implementation for ScheduleAvailabilityRequestType.
3865func (sart ScheduleAvailabilityRequestType) AsHeavyScheduleAvailabilityRequest() (*HeavyScheduleAvailabilityRequest, bool) {
3866	return nil, false
3867}
3868
3869// AsScheduleAvailabilityRequest is the BasicScheduleAvailabilityRequest implementation for ScheduleAvailabilityRequestType.
3870func (sart ScheduleAvailabilityRequestType) AsScheduleAvailabilityRequest() (*ScheduleAvailabilityRequest, bool) {
3871	return nil, false
3872}
3873
3874// AsBasicScheduleAvailabilityRequest is the BasicScheduleAvailabilityRequest implementation for ScheduleAvailabilityRequestType.
3875func (sart ScheduleAvailabilityRequestType) AsBasicScheduleAvailabilityRequest() (BasicScheduleAvailabilityRequest, bool) {
3876	return &sart, true
3877}
3878
3879// ScheduleAvailabilityResponse schedule availability response for given sku in a region.
3880type ScheduleAvailabilityResponse struct {
3881	// AvailableDates - READ-ONLY; List of dates available to schedule
3882	AvailableDates *[]date.Time `json:"availableDates,omitempty"`
3883}
3884
3885// MarshalJSON is the custom marshaler for ScheduleAvailabilityResponse.
3886func (sar ScheduleAvailabilityResponse) MarshalJSON() ([]byte, error) {
3887	objectMap := make(map[string]interface{})
3888	return json.Marshal(objectMap)
3889}
3890
3891// Secret the secrets related to a DataBox.
3892type Secret struct {
3893	// DeviceSerialNumber - READ-ONLY; Serial number of the assigned device.
3894	DeviceSerialNumber *string `json:"deviceSerialNumber,omitempty"`
3895	// DevicePassword - READ-ONLY; Password for out of the box experience on device.
3896	DevicePassword *string `json:"devicePassword,omitempty"`
3897	// NetworkConfigurations - READ-ONLY; Network configuration of the appliance.
3898	NetworkConfigurations *[]ApplianceNetworkConfiguration `json:"networkConfigurations,omitempty"`
3899	// EncodedValidationCertPubKey - READ-ONLY; The base 64 encoded public key to authenticate with the device
3900	EncodedValidationCertPubKey *string `json:"encodedValidationCertPubKey,omitempty"`
3901	// AccountCredentialDetails - READ-ONLY; Per account level access credentials.
3902	AccountCredentialDetails *[]AccountCredentialDetails `json:"accountCredentialDetails,omitempty"`
3903}
3904
3905// MarshalJSON is the custom marshaler for Secret.
3906func (s Secret) MarshalJSON() ([]byte, error) {
3907	objectMap := make(map[string]interface{})
3908	return json.Marshal(objectMap)
3909}
3910
3911// ShareCredentialDetails credential details of the shares in account.
3912type ShareCredentialDetails struct {
3913	// ShareName - READ-ONLY; Name of the share.
3914	ShareName *string `json:"shareName,omitempty"`
3915	// ShareType - READ-ONLY; Type of the share. Possible values include: 'ShareDestinationFormatTypeUnknownType', 'ShareDestinationFormatTypeHCS', 'ShareDestinationFormatTypeBlockBlob', 'ShareDestinationFormatTypePageBlob', 'ShareDestinationFormatTypeAzureFile', 'ShareDestinationFormatTypeManagedDisk'
3916	ShareType ShareDestinationFormatType `json:"shareType,omitempty"`
3917	// UserName - READ-ONLY; User name for the share.
3918	UserName *string `json:"userName,omitempty"`
3919	// Password - READ-ONLY; Password for the share.
3920	Password *string `json:"password,omitempty"`
3921	// SupportedAccessProtocols - READ-ONLY; Access protocols supported on the device.
3922	SupportedAccessProtocols *[]AccessProtocol `json:"supportedAccessProtocols,omitempty"`
3923}
3924
3925// MarshalJSON is the custom marshaler for ShareCredentialDetails.
3926func (scd ShareCredentialDetails) MarshalJSON() ([]byte, error) {
3927	objectMap := make(map[string]interface{})
3928	return json.Marshal(objectMap)
3929}
3930
3931// ShipmentPickUpRequest shipment pick up request details.
3932type ShipmentPickUpRequest struct {
3933	// StartTime - Minimum date after which the pick up should commence, this must be in local time of pick up area.
3934	StartTime *date.Time `json:"startTime,omitempty"`
3935	// EndTime - Maximum date before which the pick up should commence, this must be in local time of pick up area.
3936	EndTime *date.Time `json:"endTime,omitempty"`
3937	// ShipmentLocation - Shipment Location in the pickup place. Eg.front desk
3938	ShipmentLocation *string `json:"shipmentLocation,omitempty"`
3939}
3940
3941// ShipmentPickUpResponse shipment pick up response.
3942type ShipmentPickUpResponse struct {
3943	autorest.Response `json:"-"`
3944	// ConfirmationNumber - READ-ONLY; Confirmation number for the pick up request.
3945	ConfirmationNumber *string `json:"confirmationNumber,omitempty"`
3946	// ReadyByTime - READ-ONLY; Time by which shipment should be ready for pick up, this is in local time of pick up area.
3947	ReadyByTime *date.Time `json:"readyByTime,omitempty"`
3948}
3949
3950// MarshalJSON is the custom marshaler for ShipmentPickUpResponse.
3951func (spur ShipmentPickUpResponse) MarshalJSON() ([]byte, error) {
3952	objectMap := make(map[string]interface{})
3953	return json.Marshal(objectMap)
3954}
3955
3956// ShippingAddress shipping address where customer wishes to receive the device.
3957type ShippingAddress struct {
3958	// StreetAddress1 - Street Address line 1.
3959	StreetAddress1 *string `json:"streetAddress1,omitempty"`
3960	// StreetAddress2 - Street Address line 2.
3961	StreetAddress2 *string `json:"streetAddress2,omitempty"`
3962	// StreetAddress3 - Street Address line 3.
3963	StreetAddress3 *string `json:"streetAddress3,omitempty"`
3964	// City - Name of the City.
3965	City *string `json:"city,omitempty"`
3966	// StateOrProvince - Name of the State or Province.
3967	StateOrProvince *string `json:"stateOrProvince,omitempty"`
3968	// Country - Name of the Country.
3969	Country *string `json:"country,omitempty"`
3970	// PostalCode - Postal code.
3971	PostalCode *string `json:"postalCode,omitempty"`
3972	// ZipExtendedCode - Extended Zip Code.
3973	ZipExtendedCode *string `json:"zipExtendedCode,omitempty"`
3974	// CompanyName - Name of the company.
3975	CompanyName *string `json:"companyName,omitempty"`
3976	// AddressType - Type of address. Possible values include: 'None', 'Residential', 'Commercial'
3977	AddressType AddressType `json:"addressType,omitempty"`
3978}
3979
3980// Sku the Sku.
3981type Sku struct {
3982	// Name - The sku name. Possible values include: 'DataBox', 'DataBoxDisk', 'DataBoxHeavy'
3983	Name SkuName `json:"name,omitempty"`
3984	// DisplayName - The display name of the sku.
3985	DisplayName *string `json:"displayName,omitempty"`
3986	// Family - The sku family.
3987	Family *string `json:"family,omitempty"`
3988}
3989
3990// SkuAvailabilityValidationRequest request to validate sku availability.
3991type SkuAvailabilityValidationRequest struct {
3992	// DeviceType - Device type to be used for the job. Possible values include: 'DataBox', 'DataBoxDisk', 'DataBoxHeavy'
3993	DeviceType SkuName `json:"deviceType,omitempty"`
3994	// TransferType - Type of the transfer.
3995	TransferType *string `json:"transferType,omitempty"`
3996	// Country - ISO country code. Country for hardware shipment. For codes check: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements
3997	Country *string `json:"country,omitempty"`
3998	// Location - Location for data transfer. For locations check: https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01
3999	Location *string `json:"location,omitempty"`
4000	// ValidationType - Possible values include: 'ValidationTypeValidationInputRequest', 'ValidationTypeValidateCreateOrderLimit', 'ValidationTypeValidateDataDestinationDetails', 'ValidationTypeValidatePreferences', 'ValidationTypeValidateSkuAvailability', 'ValidationTypeValidateSubscriptionIsAllowedToCreateJob', 'ValidationTypeValidateAddress'
4001	ValidationType ValidationType `json:"validationType,omitempty"`
4002}
4003
4004// MarshalJSON is the custom marshaler for SkuAvailabilityValidationRequest.
4005func (savr SkuAvailabilityValidationRequest) MarshalJSON() ([]byte, error) {
4006	savr.ValidationType = ValidationTypeValidateSkuAvailability
4007	objectMap := make(map[string]interface{})
4008	if savr.DeviceType != "" {
4009		objectMap["deviceType"] = savr.DeviceType
4010	}
4011	if savr.TransferType != nil {
4012		objectMap["transferType"] = savr.TransferType
4013	}
4014	if savr.Country != nil {
4015		objectMap["country"] = savr.Country
4016	}
4017	if savr.Location != nil {
4018		objectMap["location"] = savr.Location
4019	}
4020	if savr.ValidationType != "" {
4021		objectMap["validationType"] = savr.ValidationType
4022	}
4023	return json.Marshal(objectMap)
4024}
4025
4026// AsCreateOrderLimitForSubscriptionValidationRequest is the BasicValidationInputRequest implementation for SkuAvailabilityValidationRequest.
4027func (savr SkuAvailabilityValidationRequest) AsCreateOrderLimitForSubscriptionValidationRequest() (*CreateOrderLimitForSubscriptionValidationRequest, bool) {
4028	return nil, false
4029}
4030
4031// AsDataDestinationDetailsValidationRequest is the BasicValidationInputRequest implementation for SkuAvailabilityValidationRequest.
4032func (savr SkuAvailabilityValidationRequest) AsDataDestinationDetailsValidationRequest() (*DataDestinationDetailsValidationRequest, bool) {
4033	return nil, false
4034}
4035
4036// AsPreferencesValidationRequest is the BasicValidationInputRequest implementation for SkuAvailabilityValidationRequest.
4037func (savr SkuAvailabilityValidationRequest) AsPreferencesValidationRequest() (*PreferencesValidationRequest, bool) {
4038	return nil, false
4039}
4040
4041// AsSkuAvailabilityValidationRequest is the BasicValidationInputRequest implementation for SkuAvailabilityValidationRequest.
4042func (savr SkuAvailabilityValidationRequest) AsSkuAvailabilityValidationRequest() (*SkuAvailabilityValidationRequest, bool) {
4043	return &savr, true
4044}
4045
4046// AsSubscriptionIsAllowedToCreateJobValidationRequest is the BasicValidationInputRequest implementation for SkuAvailabilityValidationRequest.
4047func (savr SkuAvailabilityValidationRequest) AsSubscriptionIsAllowedToCreateJobValidationRequest() (*SubscriptionIsAllowedToCreateJobValidationRequest, bool) {
4048	return nil, false
4049}
4050
4051// AsValidateAddress is the BasicValidationInputRequest implementation for SkuAvailabilityValidationRequest.
4052func (savr SkuAvailabilityValidationRequest) AsValidateAddress() (*ValidateAddress, bool) {
4053	return nil, false
4054}
4055
4056// AsValidationInputRequest is the BasicValidationInputRequest implementation for SkuAvailabilityValidationRequest.
4057func (savr SkuAvailabilityValidationRequest) AsValidationInputRequest() (*ValidationInputRequest, bool) {
4058	return nil, false
4059}
4060
4061// AsBasicValidationInputRequest is the BasicValidationInputRequest implementation for SkuAvailabilityValidationRequest.
4062func (savr SkuAvailabilityValidationRequest) AsBasicValidationInputRequest() (BasicValidationInputRequest, bool) {
4063	return &savr, true
4064}
4065
4066// SkuAvailabilityValidationResponseProperties properties of sku availability validation response.
4067type SkuAvailabilityValidationResponseProperties struct {
4068	// Status - READ-ONLY; Sku availability validation status. Possible values include: 'ValidationStatusValid', 'ValidationStatusInvalid', 'ValidationStatusSkipped'
4069	Status ValidationStatus `json:"status,omitempty"`
4070	// Error - READ-ONLY; Error code and message of validation response.
4071	Error *Error `json:"error,omitempty"`
4072	// ValidationType - Possible values include: 'ValidationTypeBasicValidationInputResponseValidationTypeValidationInputResponse', 'ValidationTypeBasicValidationInputResponseValidationTypeValidateAddress', 'ValidationTypeBasicValidationInputResponseValidationTypeValidateCreateOrderLimit', 'ValidationTypeBasicValidationInputResponseValidationTypeValidateDataDestinationDetails', 'ValidationTypeBasicValidationInputResponseValidationTypeValidatePreferences', 'ValidationTypeBasicValidationInputResponseValidationTypeValidateSkuAvailability', 'ValidationTypeBasicValidationInputResponseValidationTypeValidateSubscriptionIsAllowedToCreateJob'
4073	ValidationType ValidationTypeBasicValidationInputResponse `json:"validationType,omitempty"`
4074}
4075
4076// MarshalJSON is the custom marshaler for SkuAvailabilityValidationResponseProperties.
4077func (savrp SkuAvailabilityValidationResponseProperties) MarshalJSON() ([]byte, error) {
4078	savrp.ValidationType = ValidationTypeBasicValidationInputResponseValidationTypeValidateSkuAvailability
4079	objectMap := make(map[string]interface{})
4080	if savrp.ValidationType != "" {
4081		objectMap["validationType"] = savrp.ValidationType
4082	}
4083	return json.Marshal(objectMap)
4084}
4085
4086// AsAddressValidationProperties is the BasicValidationInputResponse implementation for SkuAvailabilityValidationResponseProperties.
4087func (savrp SkuAvailabilityValidationResponseProperties) AsAddressValidationProperties() (*AddressValidationProperties, bool) {
4088	return nil, false
4089}
4090
4091// AsCreateOrderLimitForSubscriptionValidationResponseProperties is the BasicValidationInputResponse implementation for SkuAvailabilityValidationResponseProperties.
4092func (savrp SkuAvailabilityValidationResponseProperties) AsCreateOrderLimitForSubscriptionValidationResponseProperties() (*CreateOrderLimitForSubscriptionValidationResponseProperties, bool) {
4093	return nil, false
4094}
4095
4096// AsDataDestinationDetailsValidationResponseProperties is the BasicValidationInputResponse implementation for SkuAvailabilityValidationResponseProperties.
4097func (savrp SkuAvailabilityValidationResponseProperties) AsDataDestinationDetailsValidationResponseProperties() (*DataDestinationDetailsValidationResponseProperties, bool) {
4098	return nil, false
4099}
4100
4101// AsPreferencesValidationResponseProperties is the BasicValidationInputResponse implementation for SkuAvailabilityValidationResponseProperties.
4102func (savrp SkuAvailabilityValidationResponseProperties) AsPreferencesValidationResponseProperties() (*PreferencesValidationResponseProperties, bool) {
4103	return nil, false
4104}
4105
4106// AsSkuAvailabilityValidationResponseProperties is the BasicValidationInputResponse implementation for SkuAvailabilityValidationResponseProperties.
4107func (savrp SkuAvailabilityValidationResponseProperties) AsSkuAvailabilityValidationResponseProperties() (*SkuAvailabilityValidationResponseProperties, bool) {
4108	return &savrp, true
4109}
4110
4111// AsSubscriptionIsAllowedToCreateJobValidationResponseProperties is the BasicValidationInputResponse implementation for SkuAvailabilityValidationResponseProperties.
4112func (savrp SkuAvailabilityValidationResponseProperties) AsSubscriptionIsAllowedToCreateJobValidationResponseProperties() (*SubscriptionIsAllowedToCreateJobValidationResponseProperties, bool) {
4113	return nil, false
4114}
4115
4116// AsValidationInputResponse is the BasicValidationInputResponse implementation for SkuAvailabilityValidationResponseProperties.
4117func (savrp SkuAvailabilityValidationResponseProperties) AsValidationInputResponse() (*ValidationInputResponse, bool) {
4118	return nil, false
4119}
4120
4121// AsBasicValidationInputResponse is the BasicValidationInputResponse implementation for SkuAvailabilityValidationResponseProperties.
4122func (savrp SkuAvailabilityValidationResponseProperties) AsBasicValidationInputResponse() (BasicValidationInputResponse, bool) {
4123	return &savrp, true
4124}
4125
4126// SkuCapacity capacity of the sku.
4127type SkuCapacity struct {
4128	// Usable - READ-ONLY; Usable capacity in TB.
4129	Usable *string `json:"usable,omitempty"`
4130	// Maximum - READ-ONLY; Maximum capacity in TB.
4131	Maximum *string `json:"maximum,omitempty"`
4132}
4133
4134// MarshalJSON is the custom marshaler for SkuCapacity.
4135func (sc SkuCapacity) MarshalJSON() ([]byte, error) {
4136	objectMap := make(map[string]interface{})
4137	return json.Marshal(objectMap)
4138}
4139
4140// SkuCost describes metadata for retrieving price info.
4141type SkuCost struct {
4142	// MeterID - READ-ONLY; Meter id of the Sku.
4143	MeterID *string `json:"meterId,omitempty"`
4144	// MeterType - READ-ONLY; The type of the meter.
4145	MeterType *string `json:"meterType,omitempty"`
4146}
4147
4148// MarshalJSON is the custom marshaler for SkuCost.
4149func (sc SkuCost) MarshalJSON() ([]byte, error) {
4150	objectMap := make(map[string]interface{})
4151	return json.Marshal(objectMap)
4152}
4153
4154// SkuInformation information of the sku.
4155type SkuInformation struct {
4156	// Sku - READ-ONLY; The Sku.
4157	Sku *Sku `json:"sku,omitempty"`
4158	// Enabled - READ-ONLY; The sku is enabled or not.
4159	Enabled *bool `json:"enabled,omitempty"`
4160	// SkuProperties - READ-ONLY; Properties of the sku.
4161	*SkuProperties `json:"properties,omitempty"`
4162}
4163
4164// MarshalJSON is the custom marshaler for SkuInformation.
4165func (si SkuInformation) MarshalJSON() ([]byte, error) {
4166	objectMap := make(map[string]interface{})
4167	return json.Marshal(objectMap)
4168}
4169
4170// UnmarshalJSON is the custom unmarshaler for SkuInformation struct.
4171func (si *SkuInformation) UnmarshalJSON(body []byte) error {
4172	var m map[string]*json.RawMessage
4173	err := json.Unmarshal(body, &m)
4174	if err != nil {
4175		return err
4176	}
4177	for k, v := range m {
4178		switch k {
4179		case "sku":
4180			if v != nil {
4181				var sku Sku
4182				err = json.Unmarshal(*v, &sku)
4183				if err != nil {
4184					return err
4185				}
4186				si.Sku = &sku
4187			}
4188		case "enabled":
4189			if v != nil {
4190				var enabled bool
4191				err = json.Unmarshal(*v, &enabled)
4192				if err != nil {
4193					return err
4194				}
4195				si.Enabled = &enabled
4196			}
4197		case "properties":
4198			if v != nil {
4199				var skuProperties SkuProperties
4200				err = json.Unmarshal(*v, &skuProperties)
4201				if err != nil {
4202					return err
4203				}
4204				si.SkuProperties = &skuProperties
4205			}
4206		}
4207	}
4208
4209	return nil
4210}
4211
4212// SkuProperties properties of the sku.
4213type SkuProperties struct {
4214	// DestinationToServiceLocationMap - READ-ONLY; The map of destination location to service location.
4215	DestinationToServiceLocationMap *[]DestinationToServiceLocationMap `json:"destinationToServiceLocationMap,omitempty"`
4216	// Capacity - READ-ONLY; Capacity of the Sku.
4217	Capacity *SkuCapacity `json:"capacity,omitempty"`
4218	// Costs - READ-ONLY; Cost of the Sku.
4219	Costs *[]SkuCost `json:"costs,omitempty"`
4220	// APIVersions - READ-ONLY; Api versions that support this Sku.
4221	APIVersions *[]string `json:"apiVersions,omitempty"`
4222	// DisabledReason - READ-ONLY; Reason why the Sku is disabled. Possible values include: 'SkuDisabledReasonNone', 'SkuDisabledReasonCountry', 'SkuDisabledReasonRegion', 'SkuDisabledReasonFeature', 'SkuDisabledReasonOfferType', 'SkuDisabledReasonNoSubscriptionInfo'
4223	DisabledReason SkuDisabledReason `json:"disabledReason,omitempty"`
4224	// DisabledReasonMessage - READ-ONLY; Message for why the Sku is disabled.
4225	DisabledReasonMessage *string `json:"disabledReasonMessage,omitempty"`
4226	// RequiredFeature - READ-ONLY; Required feature to access the sku.
4227	RequiredFeature *string `json:"requiredFeature,omitempty"`
4228}
4229
4230// MarshalJSON is the custom marshaler for SkuProperties.
4231func (sp SkuProperties) MarshalJSON() ([]byte, error) {
4232	objectMap := make(map[string]interface{})
4233	return json.Marshal(objectMap)
4234}
4235
4236// SubscriptionIsAllowedToCreateJobValidationRequest request to validate subscription permission to create
4237// jobs.
4238type SubscriptionIsAllowedToCreateJobValidationRequest struct {
4239	// ValidationType - Possible values include: 'ValidationTypeValidationInputRequest', 'ValidationTypeValidateCreateOrderLimit', 'ValidationTypeValidateDataDestinationDetails', 'ValidationTypeValidatePreferences', 'ValidationTypeValidateSkuAvailability', 'ValidationTypeValidateSubscriptionIsAllowedToCreateJob', 'ValidationTypeValidateAddress'
4240	ValidationType ValidationType `json:"validationType,omitempty"`
4241}
4242
4243// MarshalJSON is the custom marshaler for SubscriptionIsAllowedToCreateJobValidationRequest.
4244func (siatcjvr SubscriptionIsAllowedToCreateJobValidationRequest) MarshalJSON() ([]byte, error) {
4245	siatcjvr.ValidationType = ValidationTypeValidateSubscriptionIsAllowedToCreateJob
4246	objectMap := make(map[string]interface{})
4247	if siatcjvr.ValidationType != "" {
4248		objectMap["validationType"] = siatcjvr.ValidationType
4249	}
4250	return json.Marshal(objectMap)
4251}
4252
4253// AsCreateOrderLimitForSubscriptionValidationRequest is the BasicValidationInputRequest implementation for SubscriptionIsAllowedToCreateJobValidationRequest.
4254func (siatcjvr SubscriptionIsAllowedToCreateJobValidationRequest) AsCreateOrderLimitForSubscriptionValidationRequest() (*CreateOrderLimitForSubscriptionValidationRequest, bool) {
4255	return nil, false
4256}
4257
4258// AsDataDestinationDetailsValidationRequest is the BasicValidationInputRequest implementation for SubscriptionIsAllowedToCreateJobValidationRequest.
4259func (siatcjvr SubscriptionIsAllowedToCreateJobValidationRequest) AsDataDestinationDetailsValidationRequest() (*DataDestinationDetailsValidationRequest, bool) {
4260	return nil, false
4261}
4262
4263// AsPreferencesValidationRequest is the BasicValidationInputRequest implementation for SubscriptionIsAllowedToCreateJobValidationRequest.
4264func (siatcjvr SubscriptionIsAllowedToCreateJobValidationRequest) AsPreferencesValidationRequest() (*PreferencesValidationRequest, bool) {
4265	return nil, false
4266}
4267
4268// AsSkuAvailabilityValidationRequest is the BasicValidationInputRequest implementation for SubscriptionIsAllowedToCreateJobValidationRequest.
4269func (siatcjvr SubscriptionIsAllowedToCreateJobValidationRequest) AsSkuAvailabilityValidationRequest() (*SkuAvailabilityValidationRequest, bool) {
4270	return nil, false
4271}
4272
4273// AsSubscriptionIsAllowedToCreateJobValidationRequest is the BasicValidationInputRequest implementation for SubscriptionIsAllowedToCreateJobValidationRequest.
4274func (siatcjvr SubscriptionIsAllowedToCreateJobValidationRequest) AsSubscriptionIsAllowedToCreateJobValidationRequest() (*SubscriptionIsAllowedToCreateJobValidationRequest, bool) {
4275	return &siatcjvr, true
4276}
4277
4278// AsValidateAddress is the BasicValidationInputRequest implementation for SubscriptionIsAllowedToCreateJobValidationRequest.
4279func (siatcjvr SubscriptionIsAllowedToCreateJobValidationRequest) AsValidateAddress() (*ValidateAddress, bool) {
4280	return nil, false
4281}
4282
4283// AsValidationInputRequest is the BasicValidationInputRequest implementation for SubscriptionIsAllowedToCreateJobValidationRequest.
4284func (siatcjvr SubscriptionIsAllowedToCreateJobValidationRequest) AsValidationInputRequest() (*ValidationInputRequest, bool) {
4285	return nil, false
4286}
4287
4288// AsBasicValidationInputRequest is the BasicValidationInputRequest implementation for SubscriptionIsAllowedToCreateJobValidationRequest.
4289func (siatcjvr SubscriptionIsAllowedToCreateJobValidationRequest) AsBasicValidationInputRequest() (BasicValidationInputRequest, bool) {
4290	return &siatcjvr, true
4291}
4292
4293// SubscriptionIsAllowedToCreateJobValidationResponseProperties properties of subscription permission to
4294// create job validation response.
4295type SubscriptionIsAllowedToCreateJobValidationResponseProperties struct {
4296	// Status - READ-ONLY; Validation status of subscription permission to create job. Possible values include: 'ValidationStatusValid', 'ValidationStatusInvalid', 'ValidationStatusSkipped'
4297	Status ValidationStatus `json:"status,omitempty"`
4298	// Error - READ-ONLY; Error code and message of validation response.
4299	Error *Error `json:"error,omitempty"`
4300	// ValidationType - Possible values include: 'ValidationTypeBasicValidationInputResponseValidationTypeValidationInputResponse', 'ValidationTypeBasicValidationInputResponseValidationTypeValidateAddress', 'ValidationTypeBasicValidationInputResponseValidationTypeValidateCreateOrderLimit', 'ValidationTypeBasicValidationInputResponseValidationTypeValidateDataDestinationDetails', 'ValidationTypeBasicValidationInputResponseValidationTypeValidatePreferences', 'ValidationTypeBasicValidationInputResponseValidationTypeValidateSkuAvailability', 'ValidationTypeBasicValidationInputResponseValidationTypeValidateSubscriptionIsAllowedToCreateJob'
4301	ValidationType ValidationTypeBasicValidationInputResponse `json:"validationType,omitempty"`
4302}
4303
4304// MarshalJSON is the custom marshaler for SubscriptionIsAllowedToCreateJobValidationResponseProperties.
4305func (siatcjvrp SubscriptionIsAllowedToCreateJobValidationResponseProperties) MarshalJSON() ([]byte, error) {
4306	siatcjvrp.ValidationType = ValidationTypeBasicValidationInputResponseValidationTypeValidateSubscriptionIsAllowedToCreateJob
4307	objectMap := make(map[string]interface{})
4308	if siatcjvrp.ValidationType != "" {
4309		objectMap["validationType"] = siatcjvrp.ValidationType
4310	}
4311	return json.Marshal(objectMap)
4312}
4313
4314// AsAddressValidationProperties is the BasicValidationInputResponse implementation for SubscriptionIsAllowedToCreateJobValidationResponseProperties.
4315func (siatcjvrp SubscriptionIsAllowedToCreateJobValidationResponseProperties) AsAddressValidationProperties() (*AddressValidationProperties, bool) {
4316	return nil, false
4317}
4318
4319// AsCreateOrderLimitForSubscriptionValidationResponseProperties is the BasicValidationInputResponse implementation for SubscriptionIsAllowedToCreateJobValidationResponseProperties.
4320func (siatcjvrp SubscriptionIsAllowedToCreateJobValidationResponseProperties) AsCreateOrderLimitForSubscriptionValidationResponseProperties() (*CreateOrderLimitForSubscriptionValidationResponseProperties, bool) {
4321	return nil, false
4322}
4323
4324// AsDataDestinationDetailsValidationResponseProperties is the BasicValidationInputResponse implementation for SubscriptionIsAllowedToCreateJobValidationResponseProperties.
4325func (siatcjvrp SubscriptionIsAllowedToCreateJobValidationResponseProperties) AsDataDestinationDetailsValidationResponseProperties() (*DataDestinationDetailsValidationResponseProperties, bool) {
4326	return nil, false
4327}
4328
4329// AsPreferencesValidationResponseProperties is the BasicValidationInputResponse implementation for SubscriptionIsAllowedToCreateJobValidationResponseProperties.
4330func (siatcjvrp SubscriptionIsAllowedToCreateJobValidationResponseProperties) AsPreferencesValidationResponseProperties() (*PreferencesValidationResponseProperties, bool) {
4331	return nil, false
4332}
4333
4334// AsSkuAvailabilityValidationResponseProperties is the BasicValidationInputResponse implementation for SubscriptionIsAllowedToCreateJobValidationResponseProperties.
4335func (siatcjvrp SubscriptionIsAllowedToCreateJobValidationResponseProperties) AsSkuAvailabilityValidationResponseProperties() (*SkuAvailabilityValidationResponseProperties, bool) {
4336	return nil, false
4337}
4338
4339// AsSubscriptionIsAllowedToCreateJobValidationResponseProperties is the BasicValidationInputResponse implementation for SubscriptionIsAllowedToCreateJobValidationResponseProperties.
4340func (siatcjvrp SubscriptionIsAllowedToCreateJobValidationResponseProperties) AsSubscriptionIsAllowedToCreateJobValidationResponseProperties() (*SubscriptionIsAllowedToCreateJobValidationResponseProperties, bool) {
4341	return &siatcjvrp, true
4342}
4343
4344// AsValidationInputResponse is the BasicValidationInputResponse implementation for SubscriptionIsAllowedToCreateJobValidationResponseProperties.
4345func (siatcjvrp SubscriptionIsAllowedToCreateJobValidationResponseProperties) AsValidationInputResponse() (*ValidationInputResponse, bool) {
4346	return nil, false
4347}
4348
4349// AsBasicValidationInputResponse is the BasicValidationInputResponse implementation for SubscriptionIsAllowedToCreateJobValidationResponseProperties.
4350func (siatcjvrp SubscriptionIsAllowedToCreateJobValidationResponseProperties) AsBasicValidationInputResponse() (BasicValidationInputResponse, bool) {
4351	return &siatcjvrp, true
4352}
4353
4354// TransportAvailabilityDetails transport options availability details for given region.
4355type TransportAvailabilityDetails struct {
4356	// ShipmentType - READ-ONLY; Transport Shipment Type supported for given region. Possible values include: 'CustomerManaged', 'MicrosoftManaged'
4357	ShipmentType TransportShipmentTypes `json:"shipmentType,omitempty"`
4358}
4359
4360// MarshalJSON is the custom marshaler for TransportAvailabilityDetails.
4361func (tad TransportAvailabilityDetails) MarshalJSON() ([]byte, error) {
4362	objectMap := make(map[string]interface{})
4363	return json.Marshal(objectMap)
4364}
4365
4366// TransportAvailabilityRequest request body to get the transport availability for given sku.
4367type TransportAvailabilityRequest struct {
4368	// SkuName - Type of the device. Possible values include: 'DataBox', 'DataBoxDisk', 'DataBoxHeavy'
4369	SkuName SkuName `json:"skuName,omitempty"`
4370}
4371
4372// TransportAvailabilityResponse transport options available for given sku in a region.
4373type TransportAvailabilityResponse struct {
4374	// TransportAvailabilityDetails - READ-ONLY; List of transport availability details for given region
4375	TransportAvailabilityDetails *[]TransportAvailabilityDetails `json:"transportAvailabilityDetails,omitempty"`
4376}
4377
4378// MarshalJSON is the custom marshaler for TransportAvailabilityResponse.
4379func (tarVar TransportAvailabilityResponse) MarshalJSON() ([]byte, error) {
4380	objectMap := make(map[string]interface{})
4381	return json.Marshal(objectMap)
4382}
4383
4384// TransportPreferences preferences related to the shipment logistics of the sku
4385type TransportPreferences struct {
4386	// PreferredShipmentType - Indicates Shipment Logistics type that the customer preferred. Possible values include: 'CustomerManaged', 'MicrosoftManaged'
4387	PreferredShipmentType TransportShipmentTypes `json:"preferredShipmentType,omitempty"`
4388}
4389
4390// UnencryptedCredentials unencrypted credentials for accessing device.
4391type UnencryptedCredentials struct {
4392	// JobName - READ-ONLY; Name of the job.
4393	JobName *string `json:"jobName,omitempty"`
4394	// JobSecrets - READ-ONLY; Secrets related to this job.
4395	JobSecrets BasicJobSecrets `json:"jobSecrets,omitempty"`
4396}
4397
4398// MarshalJSON is the custom marshaler for UnencryptedCredentials.
4399func (uc UnencryptedCredentials) MarshalJSON() ([]byte, error) {
4400	objectMap := make(map[string]interface{})
4401	return json.Marshal(objectMap)
4402}
4403
4404// UnmarshalJSON is the custom unmarshaler for UnencryptedCredentials struct.
4405func (uc *UnencryptedCredentials) UnmarshalJSON(body []byte) error {
4406	var m map[string]*json.RawMessage
4407	err := json.Unmarshal(body, &m)
4408	if err != nil {
4409		return err
4410	}
4411	for k, v := range m {
4412		switch k {
4413		case "jobName":
4414			if v != nil {
4415				var jobName string
4416				err = json.Unmarshal(*v, &jobName)
4417				if err != nil {
4418					return err
4419				}
4420				uc.JobName = &jobName
4421			}
4422		case "jobSecrets":
4423			if v != nil {
4424				jobSecrets, err := unmarshalBasicJobSecrets(*v)
4425				if err != nil {
4426					return err
4427				}
4428				uc.JobSecrets = jobSecrets
4429			}
4430		}
4431	}
4432
4433	return nil
4434}
4435
4436// UnencryptedCredentialsList list of unencrypted credentials for accessing device.
4437type UnencryptedCredentialsList struct {
4438	autorest.Response `json:"-"`
4439	// Value - List of unencrypted credentials.
4440	Value *[]UnencryptedCredentials `json:"value,omitempty"`
4441	// NextLink - Link for the next set of unencrypted credentials.
4442	NextLink *string `json:"nextLink,omitempty"`
4443}
4444
4445// UpdateJobDetails job details for update.
4446type UpdateJobDetails struct {
4447	// ContactDetails - Contact details for notification and shipping.
4448	ContactDetails *ContactDetails `json:"contactDetails,omitempty"`
4449	// ShippingAddress - Shipping address of the customer.
4450	ShippingAddress *ShippingAddress `json:"shippingAddress,omitempty"`
4451}
4452
4453// UpdateJobProperties job Properties for update
4454type UpdateJobProperties struct {
4455	// Details - Details of a job to be updated.
4456	Details *UpdateJobDetails `json:"details,omitempty"`
4457	// DestinationAccountDetails - Destination account details.
4458	DestinationAccountDetails *[]BasicDestinationAccountDetails `json:"destinationAccountDetails,omitempty"`
4459}
4460
4461// UnmarshalJSON is the custom unmarshaler for UpdateJobProperties struct.
4462func (ujp *UpdateJobProperties) UnmarshalJSON(body []byte) error {
4463	var m map[string]*json.RawMessage
4464	err := json.Unmarshal(body, &m)
4465	if err != nil {
4466		return err
4467	}
4468	for k, v := range m {
4469		switch k {
4470		case "details":
4471			if v != nil {
4472				var details UpdateJobDetails
4473				err = json.Unmarshal(*v, &details)
4474				if err != nil {
4475					return err
4476				}
4477				ujp.Details = &details
4478			}
4479		case "destinationAccountDetails":
4480			if v != nil {
4481				destinationAccountDetails, err := unmarshalBasicDestinationAccountDetailsArray(*v)
4482				if err != nil {
4483					return err
4484				}
4485				ujp.DestinationAccountDetails = &destinationAccountDetails
4486			}
4487		}
4488	}
4489
4490	return nil
4491}
4492
4493// ValidateAddress the requirements to validate customer address where the device needs to be shipped.
4494type ValidateAddress struct {
4495	// ShippingAddress - Shipping address of the customer.
4496	ShippingAddress *ShippingAddress `json:"shippingAddress,omitempty"`
4497	// DeviceType - Device type to be used for the job. Possible values include: 'DataBox', 'DataBoxDisk', 'DataBoxHeavy'
4498	DeviceType SkuName `json:"deviceType,omitempty"`
4499	// TransportPreferences - Preferences related to the shipment logistics of the sku.
4500	TransportPreferences *TransportPreferences `json:"transportPreferences,omitempty"`
4501	// ValidationType - Possible values include: 'ValidationTypeValidationInputRequest', 'ValidationTypeValidateCreateOrderLimit', 'ValidationTypeValidateDataDestinationDetails', 'ValidationTypeValidatePreferences', 'ValidationTypeValidateSkuAvailability', 'ValidationTypeValidateSubscriptionIsAllowedToCreateJob', 'ValidationTypeValidateAddress'
4502	ValidationType ValidationType `json:"validationType,omitempty"`
4503}
4504
4505// MarshalJSON is the custom marshaler for ValidateAddress.
4506func (va ValidateAddress) MarshalJSON() ([]byte, error) {
4507	va.ValidationType = ValidationTypeValidateAddress
4508	objectMap := make(map[string]interface{})
4509	if va.ShippingAddress != nil {
4510		objectMap["shippingAddress"] = va.ShippingAddress
4511	}
4512	if va.DeviceType != "" {
4513		objectMap["deviceType"] = va.DeviceType
4514	}
4515	if va.TransportPreferences != nil {
4516		objectMap["transportPreferences"] = va.TransportPreferences
4517	}
4518	if va.ValidationType != "" {
4519		objectMap["validationType"] = va.ValidationType
4520	}
4521	return json.Marshal(objectMap)
4522}
4523
4524// AsCreateOrderLimitForSubscriptionValidationRequest is the BasicValidationInputRequest implementation for ValidateAddress.
4525func (va ValidateAddress) AsCreateOrderLimitForSubscriptionValidationRequest() (*CreateOrderLimitForSubscriptionValidationRequest, bool) {
4526	return nil, false
4527}
4528
4529// AsDataDestinationDetailsValidationRequest is the BasicValidationInputRequest implementation for ValidateAddress.
4530func (va ValidateAddress) AsDataDestinationDetailsValidationRequest() (*DataDestinationDetailsValidationRequest, bool) {
4531	return nil, false
4532}
4533
4534// AsPreferencesValidationRequest is the BasicValidationInputRequest implementation for ValidateAddress.
4535func (va ValidateAddress) AsPreferencesValidationRequest() (*PreferencesValidationRequest, bool) {
4536	return nil, false
4537}
4538
4539// AsSkuAvailabilityValidationRequest is the BasicValidationInputRequest implementation for ValidateAddress.
4540func (va ValidateAddress) AsSkuAvailabilityValidationRequest() (*SkuAvailabilityValidationRequest, bool) {
4541	return nil, false
4542}
4543
4544// AsSubscriptionIsAllowedToCreateJobValidationRequest is the BasicValidationInputRequest implementation for ValidateAddress.
4545func (va ValidateAddress) AsSubscriptionIsAllowedToCreateJobValidationRequest() (*SubscriptionIsAllowedToCreateJobValidationRequest, bool) {
4546	return nil, false
4547}
4548
4549// AsValidateAddress is the BasicValidationInputRequest implementation for ValidateAddress.
4550func (va ValidateAddress) AsValidateAddress() (*ValidateAddress, bool) {
4551	return &va, true
4552}
4553
4554// AsValidationInputRequest is the BasicValidationInputRequest implementation for ValidateAddress.
4555func (va ValidateAddress) AsValidationInputRequest() (*ValidationInputRequest, bool) {
4556	return nil, false
4557}
4558
4559// AsBasicValidationInputRequest is the BasicValidationInputRequest implementation for ValidateAddress.
4560func (va ValidateAddress) AsBasicValidationInputRequest() (BasicValidationInputRequest, bool) {
4561	return &va, true
4562}
4563
4564// BasicValidationInputRequest minimum fields that must be present in any type of validation request.
4565type BasicValidationInputRequest interface {
4566	AsCreateOrderLimitForSubscriptionValidationRequest() (*CreateOrderLimitForSubscriptionValidationRequest, bool)
4567	AsDataDestinationDetailsValidationRequest() (*DataDestinationDetailsValidationRequest, bool)
4568	AsPreferencesValidationRequest() (*PreferencesValidationRequest, bool)
4569	AsSkuAvailabilityValidationRequest() (*SkuAvailabilityValidationRequest, bool)
4570	AsSubscriptionIsAllowedToCreateJobValidationRequest() (*SubscriptionIsAllowedToCreateJobValidationRequest, bool)
4571	AsValidateAddress() (*ValidateAddress, bool)
4572	AsValidationInputRequest() (*ValidationInputRequest, bool)
4573}
4574
4575// ValidationInputRequest minimum fields that must be present in any type of validation request.
4576type ValidationInputRequest struct {
4577	// ValidationType - Possible values include: 'ValidationTypeValidationInputRequest', 'ValidationTypeValidateCreateOrderLimit', 'ValidationTypeValidateDataDestinationDetails', 'ValidationTypeValidatePreferences', 'ValidationTypeValidateSkuAvailability', 'ValidationTypeValidateSubscriptionIsAllowedToCreateJob', 'ValidationTypeValidateAddress'
4578	ValidationType ValidationType `json:"validationType,omitempty"`
4579}
4580
4581func unmarshalBasicValidationInputRequest(body []byte) (BasicValidationInputRequest, error) {
4582	var m map[string]interface{}
4583	err := json.Unmarshal(body, &m)
4584	if err != nil {
4585		return nil, err
4586	}
4587
4588	switch m["validationType"] {
4589	case string(ValidationTypeValidateCreateOrderLimit):
4590		var colfsvr CreateOrderLimitForSubscriptionValidationRequest
4591		err := json.Unmarshal(body, &colfsvr)
4592		return colfsvr, err
4593	case string(ValidationTypeValidateDataDestinationDetails):
4594		var dddvr DataDestinationDetailsValidationRequest
4595		err := json.Unmarshal(body, &dddvr)
4596		return dddvr, err
4597	case string(ValidationTypeValidatePreferences):
4598		var pvr PreferencesValidationRequest
4599		err := json.Unmarshal(body, &pvr)
4600		return pvr, err
4601	case string(ValidationTypeValidateSkuAvailability):
4602		var savr SkuAvailabilityValidationRequest
4603		err := json.Unmarshal(body, &savr)
4604		return savr, err
4605	case string(ValidationTypeValidateSubscriptionIsAllowedToCreateJob):
4606		var siatcjvr SubscriptionIsAllowedToCreateJobValidationRequest
4607		err := json.Unmarshal(body, &siatcjvr)
4608		return siatcjvr, err
4609	case string(ValidationTypeValidateAddress):
4610		var va ValidateAddress
4611		err := json.Unmarshal(body, &va)
4612		return va, err
4613	default:
4614		var vir ValidationInputRequest
4615		err := json.Unmarshal(body, &vir)
4616		return vir, err
4617	}
4618}
4619func unmarshalBasicValidationInputRequestArray(body []byte) ([]BasicValidationInputRequest, error) {
4620	var rawMessages []*json.RawMessage
4621	err := json.Unmarshal(body, &rawMessages)
4622	if err != nil {
4623		return nil, err
4624	}
4625
4626	virArray := make([]BasicValidationInputRequest, len(rawMessages))
4627
4628	for index, rawMessage := range rawMessages {
4629		vir, err := unmarshalBasicValidationInputRequest(*rawMessage)
4630		if err != nil {
4631			return nil, err
4632		}
4633		virArray[index] = vir
4634	}
4635	return virArray, nil
4636}
4637
4638// MarshalJSON is the custom marshaler for ValidationInputRequest.
4639func (vir ValidationInputRequest) MarshalJSON() ([]byte, error) {
4640	vir.ValidationType = ValidationTypeValidationInputRequest
4641	objectMap := make(map[string]interface{})
4642	if vir.ValidationType != "" {
4643		objectMap["validationType"] = vir.ValidationType
4644	}
4645	return json.Marshal(objectMap)
4646}
4647
4648// AsCreateOrderLimitForSubscriptionValidationRequest is the BasicValidationInputRequest implementation for ValidationInputRequest.
4649func (vir ValidationInputRequest) AsCreateOrderLimitForSubscriptionValidationRequest() (*CreateOrderLimitForSubscriptionValidationRequest, bool) {
4650	return nil, false
4651}
4652
4653// AsDataDestinationDetailsValidationRequest is the BasicValidationInputRequest implementation for ValidationInputRequest.
4654func (vir ValidationInputRequest) AsDataDestinationDetailsValidationRequest() (*DataDestinationDetailsValidationRequest, bool) {
4655	return nil, false
4656}
4657
4658// AsPreferencesValidationRequest is the BasicValidationInputRequest implementation for ValidationInputRequest.
4659func (vir ValidationInputRequest) AsPreferencesValidationRequest() (*PreferencesValidationRequest, bool) {
4660	return nil, false
4661}
4662
4663// AsSkuAvailabilityValidationRequest is the BasicValidationInputRequest implementation for ValidationInputRequest.
4664func (vir ValidationInputRequest) AsSkuAvailabilityValidationRequest() (*SkuAvailabilityValidationRequest, bool) {
4665	return nil, false
4666}
4667
4668// AsSubscriptionIsAllowedToCreateJobValidationRequest is the BasicValidationInputRequest implementation for ValidationInputRequest.
4669func (vir ValidationInputRequest) AsSubscriptionIsAllowedToCreateJobValidationRequest() (*SubscriptionIsAllowedToCreateJobValidationRequest, bool) {
4670	return nil, false
4671}
4672
4673// AsValidateAddress is the BasicValidationInputRequest implementation for ValidationInputRequest.
4674func (vir ValidationInputRequest) AsValidateAddress() (*ValidateAddress, bool) {
4675	return nil, false
4676}
4677
4678// AsValidationInputRequest is the BasicValidationInputRequest implementation for ValidationInputRequest.
4679func (vir ValidationInputRequest) AsValidationInputRequest() (*ValidationInputRequest, bool) {
4680	return &vir, true
4681}
4682
4683// AsBasicValidationInputRequest is the BasicValidationInputRequest implementation for ValidationInputRequest.
4684func (vir ValidationInputRequest) AsBasicValidationInputRequest() (BasicValidationInputRequest, bool) {
4685	return &vir, true
4686}
4687
4688// BasicValidationInputResponse minimum properties that should be present in each individual validation response.
4689type BasicValidationInputResponse interface {
4690	AsAddressValidationProperties() (*AddressValidationProperties, bool)
4691	AsCreateOrderLimitForSubscriptionValidationResponseProperties() (*CreateOrderLimitForSubscriptionValidationResponseProperties, bool)
4692	AsDataDestinationDetailsValidationResponseProperties() (*DataDestinationDetailsValidationResponseProperties, bool)
4693	AsPreferencesValidationResponseProperties() (*PreferencesValidationResponseProperties, bool)
4694	AsSkuAvailabilityValidationResponseProperties() (*SkuAvailabilityValidationResponseProperties, bool)
4695	AsSubscriptionIsAllowedToCreateJobValidationResponseProperties() (*SubscriptionIsAllowedToCreateJobValidationResponseProperties, bool)
4696	AsValidationInputResponse() (*ValidationInputResponse, bool)
4697}
4698
4699// ValidationInputResponse minimum properties that should be present in each individual validation response.
4700type ValidationInputResponse struct {
4701	// Error - READ-ONLY; Error code and message of validation response.
4702	Error *Error `json:"error,omitempty"`
4703	// ValidationType - Possible values include: 'ValidationTypeBasicValidationInputResponseValidationTypeValidationInputResponse', 'ValidationTypeBasicValidationInputResponseValidationTypeValidateAddress', 'ValidationTypeBasicValidationInputResponseValidationTypeValidateCreateOrderLimit', 'ValidationTypeBasicValidationInputResponseValidationTypeValidateDataDestinationDetails', 'ValidationTypeBasicValidationInputResponseValidationTypeValidatePreferences', 'ValidationTypeBasicValidationInputResponseValidationTypeValidateSkuAvailability', 'ValidationTypeBasicValidationInputResponseValidationTypeValidateSubscriptionIsAllowedToCreateJob'
4704	ValidationType ValidationTypeBasicValidationInputResponse `json:"validationType,omitempty"`
4705}
4706
4707func unmarshalBasicValidationInputResponse(body []byte) (BasicValidationInputResponse, error) {
4708	var m map[string]interface{}
4709	err := json.Unmarshal(body, &m)
4710	if err != nil {
4711		return nil, err
4712	}
4713
4714	switch m["validationType"] {
4715	case string(ValidationTypeBasicValidationInputResponseValidationTypeValidateAddress):
4716		var avp AddressValidationProperties
4717		err := json.Unmarshal(body, &avp)
4718		return avp, err
4719	case string(ValidationTypeBasicValidationInputResponseValidationTypeValidateCreateOrderLimit):
4720		var colfsvrp CreateOrderLimitForSubscriptionValidationResponseProperties
4721		err := json.Unmarshal(body, &colfsvrp)
4722		return colfsvrp, err
4723	case string(ValidationTypeBasicValidationInputResponseValidationTypeValidateDataDestinationDetails):
4724		var dddvrp DataDestinationDetailsValidationResponseProperties
4725		err := json.Unmarshal(body, &dddvrp)
4726		return dddvrp, err
4727	case string(ValidationTypeBasicValidationInputResponseValidationTypeValidatePreferences):
4728		var pvrp PreferencesValidationResponseProperties
4729		err := json.Unmarshal(body, &pvrp)
4730		return pvrp, err
4731	case string(ValidationTypeBasicValidationInputResponseValidationTypeValidateSkuAvailability):
4732		var savrp SkuAvailabilityValidationResponseProperties
4733		err := json.Unmarshal(body, &savrp)
4734		return savrp, err
4735	case string(ValidationTypeBasicValidationInputResponseValidationTypeValidateSubscriptionIsAllowedToCreateJob):
4736		var siatcjvrp SubscriptionIsAllowedToCreateJobValidationResponseProperties
4737		err := json.Unmarshal(body, &siatcjvrp)
4738		return siatcjvrp, err
4739	default:
4740		var vir ValidationInputResponse
4741		err := json.Unmarshal(body, &vir)
4742		return vir, err
4743	}
4744}
4745func unmarshalBasicValidationInputResponseArray(body []byte) ([]BasicValidationInputResponse, error) {
4746	var rawMessages []*json.RawMessage
4747	err := json.Unmarshal(body, &rawMessages)
4748	if err != nil {
4749		return nil, err
4750	}
4751
4752	virArray := make([]BasicValidationInputResponse, len(rawMessages))
4753
4754	for index, rawMessage := range rawMessages {
4755		vir, err := unmarshalBasicValidationInputResponse(*rawMessage)
4756		if err != nil {
4757			return nil, err
4758		}
4759		virArray[index] = vir
4760	}
4761	return virArray, nil
4762}
4763
4764// MarshalJSON is the custom marshaler for ValidationInputResponse.
4765func (vir ValidationInputResponse) MarshalJSON() ([]byte, error) {
4766	vir.ValidationType = ValidationTypeBasicValidationInputResponseValidationTypeValidationInputResponse
4767	objectMap := make(map[string]interface{})
4768	if vir.ValidationType != "" {
4769		objectMap["validationType"] = vir.ValidationType
4770	}
4771	return json.Marshal(objectMap)
4772}
4773
4774// AsAddressValidationProperties is the BasicValidationInputResponse implementation for ValidationInputResponse.
4775func (vir ValidationInputResponse) AsAddressValidationProperties() (*AddressValidationProperties, bool) {
4776	return nil, false
4777}
4778
4779// AsCreateOrderLimitForSubscriptionValidationResponseProperties is the BasicValidationInputResponse implementation for ValidationInputResponse.
4780func (vir ValidationInputResponse) AsCreateOrderLimitForSubscriptionValidationResponseProperties() (*CreateOrderLimitForSubscriptionValidationResponseProperties, bool) {
4781	return nil, false
4782}
4783
4784// AsDataDestinationDetailsValidationResponseProperties is the BasicValidationInputResponse implementation for ValidationInputResponse.
4785func (vir ValidationInputResponse) AsDataDestinationDetailsValidationResponseProperties() (*DataDestinationDetailsValidationResponseProperties, bool) {
4786	return nil, false
4787}
4788
4789// AsPreferencesValidationResponseProperties is the BasicValidationInputResponse implementation for ValidationInputResponse.
4790func (vir ValidationInputResponse) AsPreferencesValidationResponseProperties() (*PreferencesValidationResponseProperties, bool) {
4791	return nil, false
4792}
4793
4794// AsSkuAvailabilityValidationResponseProperties is the BasicValidationInputResponse implementation for ValidationInputResponse.
4795func (vir ValidationInputResponse) AsSkuAvailabilityValidationResponseProperties() (*SkuAvailabilityValidationResponseProperties, bool) {
4796	return nil, false
4797}
4798
4799// AsSubscriptionIsAllowedToCreateJobValidationResponseProperties is the BasicValidationInputResponse implementation for ValidationInputResponse.
4800func (vir ValidationInputResponse) AsSubscriptionIsAllowedToCreateJobValidationResponseProperties() (*SubscriptionIsAllowedToCreateJobValidationResponseProperties, bool) {
4801	return nil, false
4802}
4803
4804// AsValidationInputResponse is the BasicValidationInputResponse implementation for ValidationInputResponse.
4805func (vir ValidationInputResponse) AsValidationInputResponse() (*ValidationInputResponse, bool) {
4806	return &vir, true
4807}
4808
4809// AsBasicValidationInputResponse is the BasicValidationInputResponse implementation for ValidationInputResponse.
4810func (vir ValidationInputResponse) AsBasicValidationInputResponse() (BasicValidationInputResponse, bool) {
4811	return &vir, true
4812}
4813
4814// BasicValidationRequest input request for all pre job creation validation.
4815type BasicValidationRequest interface {
4816	AsCreateJobValidations() (*CreateJobValidations, bool)
4817	AsValidationRequest() (*ValidationRequest, bool)
4818}
4819
4820// ValidationRequest input request for all pre job creation validation.
4821type ValidationRequest struct {
4822	// IndividualRequestDetails - List of request details contain validationType and its request as key and value respectively.
4823	IndividualRequestDetails *[]BasicValidationInputRequest `json:"individualRequestDetails,omitempty"`
4824	// ValidationCategory - Possible values include: 'ValidationCategoryValidationRequest', 'ValidationCategoryJobCreationValidation'
4825	ValidationCategory ValidationCategory `json:"validationCategory,omitempty"`
4826}
4827
4828func unmarshalBasicValidationRequest(body []byte) (BasicValidationRequest, error) {
4829	var m map[string]interface{}
4830	err := json.Unmarshal(body, &m)
4831	if err != nil {
4832		return nil, err
4833	}
4834
4835	switch m["validationCategory"] {
4836	case string(ValidationCategoryJobCreationValidation):
4837		var cjv CreateJobValidations
4838		err := json.Unmarshal(body, &cjv)
4839		return cjv, err
4840	default:
4841		var vr ValidationRequest
4842		err := json.Unmarshal(body, &vr)
4843		return vr, err
4844	}
4845}
4846func unmarshalBasicValidationRequestArray(body []byte) ([]BasicValidationRequest, error) {
4847	var rawMessages []*json.RawMessage
4848	err := json.Unmarshal(body, &rawMessages)
4849	if err != nil {
4850		return nil, err
4851	}
4852
4853	vrArray := make([]BasicValidationRequest, len(rawMessages))
4854
4855	for index, rawMessage := range rawMessages {
4856		vr, err := unmarshalBasicValidationRequest(*rawMessage)
4857		if err != nil {
4858			return nil, err
4859		}
4860		vrArray[index] = vr
4861	}
4862	return vrArray, nil
4863}
4864
4865// MarshalJSON is the custom marshaler for ValidationRequest.
4866func (vr ValidationRequest) MarshalJSON() ([]byte, error) {
4867	vr.ValidationCategory = ValidationCategoryValidationRequest
4868	objectMap := make(map[string]interface{})
4869	if vr.IndividualRequestDetails != nil {
4870		objectMap["individualRequestDetails"] = vr.IndividualRequestDetails
4871	}
4872	if vr.ValidationCategory != "" {
4873		objectMap["validationCategory"] = vr.ValidationCategory
4874	}
4875	return json.Marshal(objectMap)
4876}
4877
4878// AsCreateJobValidations is the BasicValidationRequest implementation for ValidationRequest.
4879func (vr ValidationRequest) AsCreateJobValidations() (*CreateJobValidations, bool) {
4880	return nil, false
4881}
4882
4883// AsValidationRequest is the BasicValidationRequest implementation for ValidationRequest.
4884func (vr ValidationRequest) AsValidationRequest() (*ValidationRequest, bool) {
4885	return &vr, true
4886}
4887
4888// AsBasicValidationRequest is the BasicValidationRequest implementation for ValidationRequest.
4889func (vr ValidationRequest) AsBasicValidationRequest() (BasicValidationRequest, bool) {
4890	return &vr, true
4891}
4892
4893// UnmarshalJSON is the custom unmarshaler for ValidationRequest struct.
4894func (vr *ValidationRequest) UnmarshalJSON(body []byte) error {
4895	var m map[string]*json.RawMessage
4896	err := json.Unmarshal(body, &m)
4897	if err != nil {
4898		return err
4899	}
4900	for k, v := range m {
4901		switch k {
4902		case "individualRequestDetails":
4903			if v != nil {
4904				individualRequestDetails, err := unmarshalBasicValidationInputRequestArray(*v)
4905				if err != nil {
4906					return err
4907				}
4908				vr.IndividualRequestDetails = &individualRequestDetails
4909			}
4910		case "validationCategory":
4911			if v != nil {
4912				var validationCategory ValidationCategory
4913				err = json.Unmarshal(*v, &validationCategory)
4914				if err != nil {
4915					return err
4916				}
4917				vr.ValidationCategory = validationCategory
4918			}
4919		}
4920	}
4921
4922	return nil
4923}
4924
4925// ValidationResponse response of pre job creation validations.
4926type ValidationResponse struct {
4927	autorest.Response `json:"-"`
4928	// ValidationResponseProperties - READ-ONLY; Properties of pre job creation validation response.
4929	*ValidationResponseProperties `json:"properties,omitempty"`
4930}
4931
4932// MarshalJSON is the custom marshaler for ValidationResponse.
4933func (vr ValidationResponse) MarshalJSON() ([]byte, error) {
4934	objectMap := make(map[string]interface{})
4935	return json.Marshal(objectMap)
4936}
4937
4938// UnmarshalJSON is the custom unmarshaler for ValidationResponse struct.
4939func (vr *ValidationResponse) UnmarshalJSON(body []byte) error {
4940	var m map[string]*json.RawMessage
4941	err := json.Unmarshal(body, &m)
4942	if err != nil {
4943		return err
4944	}
4945	for k, v := range m {
4946		switch k {
4947		case "properties":
4948			if v != nil {
4949				var validationResponseProperties ValidationResponseProperties
4950				err = json.Unmarshal(*v, &validationResponseProperties)
4951				if err != nil {
4952					return err
4953				}
4954				vr.ValidationResponseProperties = &validationResponseProperties
4955			}
4956		}
4957	}
4958
4959	return nil
4960}
4961
4962// ValidationResponseProperties properties of pre job creation validation response.
4963type ValidationResponseProperties struct {
4964	// Status - READ-ONLY; Overall validation status. Possible values include: 'AllValidToProceed', 'InputsRevisitRequired', 'CertainInputValidationsSkipped'
4965	Status OverallValidationStatus `json:"status,omitempty"`
4966	// IndividualResponseDetails - READ-ONLY; List of response details contain validationType and its response as key and value respectively.
4967	IndividualResponseDetails *[]BasicValidationInputResponse `json:"individualResponseDetails,omitempty"`
4968}
4969
4970// MarshalJSON is the custom marshaler for ValidationResponseProperties.
4971func (vrp ValidationResponseProperties) MarshalJSON() ([]byte, error) {
4972	objectMap := make(map[string]interface{})
4973	return json.Marshal(objectMap)
4974}
4975
4976// UnmarshalJSON is the custom unmarshaler for ValidationResponseProperties struct.
4977func (vrp *ValidationResponseProperties) UnmarshalJSON(body []byte) error {
4978	var m map[string]*json.RawMessage
4979	err := json.Unmarshal(body, &m)
4980	if err != nil {
4981		return err
4982	}
4983	for k, v := range m {
4984		switch k {
4985		case "status":
4986			if v != nil {
4987				var status OverallValidationStatus
4988				err = json.Unmarshal(*v, &status)
4989				if err != nil {
4990					return err
4991				}
4992				vrp.Status = status
4993			}
4994		case "individualResponseDetails":
4995			if v != nil {
4996				individualResponseDetails, err := unmarshalBasicValidationInputResponseArray(*v)
4997				if err != nil {
4998					return err
4999				}
5000				vrp.IndividualResponseDetails = &individualResponseDetails
5001			}
5002		}
5003	}
5004
5005	return nil
5006}
5007