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