1package storageimportexport
2
3// Copyright (c) Microsoft Corporation. All rights reserved.
4// Licensed under the MIT License. See License.txt in the project root for license information.
5//
6// Code generated by Microsoft (R) AutoRest Code Generator.
7// Changes may cause incorrect behavior and will be lost if the code is regenerated.
8
9import (
10	"context"
11	"encoding/json"
12	"github.com/Azure/go-autorest/autorest"
13	"github.com/Azure/go-autorest/autorest/to"
14	"github.com/Azure/go-autorest/tracing"
15	"net/http"
16)
17
18// The package's fully qualified name.
19const fqdn = "github.com/Azure/azure-sdk-for-go/services/storageimportexport/mgmt/2016-11-01/storageimportexport"
20
21// DriveBitLockerKey bitLocker recovery key or password to the specified drive
22type DriveBitLockerKey struct {
23	// BitLockerKey - BitLocker recovery key or password
24	BitLockerKey *string `json:"bitLockerKey,omitempty"`
25	// DriveID - Drive ID
26	DriveID *string `json:"driveId,omitempty"`
27}
28
29// DriveStatus provides information about the drive's status
30type DriveStatus struct {
31	// DriveID - The drive's hardware serial number, without spaces.
32	DriveID *string `json:"driveId,omitempty"`
33	// BitLockerKey - The BitLocker key used to encrypt the drive.
34	BitLockerKey *string `json:"bitLockerKey,omitempty"`
35	// ManifestFile - The relative path of the manifest file on the drive.
36	ManifestFile *string `json:"manifestFile,omitempty"`
37	// ManifestHash - The Base16-encoded MD5 hash of the manifest file on the drive.
38	ManifestHash *string `json:"manifestHash,omitempty"`
39	// DriveHeaderHash - The drive header hash value.
40	DriveHeaderHash *string `json:"driveHeaderHash,omitempty"`
41	// State - The drive's current state. Possible values include: 'Specified', 'Received', 'NeverReceived', 'Transferring', 'Completed', 'CompletedMoreInfo', 'ShippedBack'
42	State DriveState `json:"state,omitempty"`
43	// CopyStatus - Detailed status about the data transfer process. This field is not returned in the response until the drive is in the Transferring state.
44	CopyStatus *string `json:"copyStatus,omitempty"`
45	// PercentComplete - Percentage completed for the drive.
46	PercentComplete *int32 `json:"percentComplete,omitempty"`
47	// VerboseLogURI - A URI that points to the blob containing the verbose log for the data transfer operation.
48	VerboseLogURI *string `json:"verboseLogUri,omitempty"`
49	// ErrorLogURI - A URI that points to the blob containing the error log for the data transfer operation.
50	ErrorLogURI *string `json:"errorLogUri,omitempty"`
51	// ManifestURI - A URI that points to the blob containing the drive manifest file.
52	ManifestURI *string `json:"manifestUri,omitempty"`
53	// BytesSucceeded - Bytes successfully transferred for the drive.
54	BytesSucceeded *int64 `json:"bytesSucceeded,omitempty"`
55}
56
57// ErrorResponse response when errors occurred
58type ErrorResponse struct {
59	// ErrorResponseError - Describes the error information.
60	*ErrorResponseError `json:"error,omitempty"`
61}
62
63// MarshalJSON is the custom marshaler for ErrorResponse.
64func (er ErrorResponse) MarshalJSON() ([]byte, error) {
65	objectMap := make(map[string]interface{})
66	if er.ErrorResponseError != nil {
67		objectMap["error"] = er.ErrorResponseError
68	}
69	return json.Marshal(objectMap)
70}
71
72// UnmarshalJSON is the custom unmarshaler for ErrorResponse struct.
73func (er *ErrorResponse) UnmarshalJSON(body []byte) error {
74	var m map[string]*json.RawMessage
75	err := json.Unmarshal(body, &m)
76	if err != nil {
77		return err
78	}
79	for k, v := range m {
80		switch k {
81		case "error":
82			if v != nil {
83				var errorResponseError ErrorResponseError
84				err = json.Unmarshal(*v, &errorResponseError)
85				if err != nil {
86					return err
87				}
88				er.ErrorResponseError = &errorResponseError
89			}
90		}
91	}
92
93	return nil
94}
95
96// ErrorResponseError describes the error information.
97type ErrorResponseError struct {
98	// Code - Provides information about the error code.
99	Code *string `json:"code,omitempty"`
100	// Message - Provides information about the error message.
101	Message *string `json:"message,omitempty"`
102	// Target - Provides information about the error target.
103	Target *string `json:"target,omitempty"`
104	// Details - Describes the error details if present.
105	Details *[]ErrorResponseErrorDetailsItem `json:"details,omitempty"`
106	// Innererror - Inner error object if present.
107	Innererror interface{} `json:"innererror,omitempty"`
108}
109
110// ErrorResponseErrorDetailsItem ...
111type ErrorResponseErrorDetailsItem struct {
112	// Code - Provides information about the error code.
113	Code *string `json:"code,omitempty"`
114	// Target - Provides information about the error target.
115	Target *string `json:"target,omitempty"`
116	// Message - Provides information about the error message.
117	Message *string `json:"message,omitempty"`
118}
119
120// Export a property containing information about the blobs to be exported for an export job. This property
121// is required for export jobs, but must not be specified for import jobs.
122type Export struct {
123	// ExportBlobList - A list of the blobs to be exported.
124	*ExportBlobList `json:"blobList,omitempty"`
125	// BlobListblobPath - The relative URI to the block blob that contains the list of blob paths or blob path prefixes as defined above, beginning with the container name. If the blob is in root container, the URI must begin with $root.
126	BlobListblobPath *string `json:"blobListblobPath,omitempty"`
127}
128
129// MarshalJSON is the custom marshaler for Export.
130func (e Export) MarshalJSON() ([]byte, error) {
131	objectMap := make(map[string]interface{})
132	if e.ExportBlobList != nil {
133		objectMap["blobList"] = e.ExportBlobList
134	}
135	if e.BlobListblobPath != nil {
136		objectMap["blobListblobPath"] = e.BlobListblobPath
137	}
138	return json.Marshal(objectMap)
139}
140
141// UnmarshalJSON is the custom unmarshaler for Export struct.
142func (e *Export) UnmarshalJSON(body []byte) error {
143	var m map[string]*json.RawMessage
144	err := json.Unmarshal(body, &m)
145	if err != nil {
146		return err
147	}
148	for k, v := range m {
149		switch k {
150		case "blobList":
151			if v != nil {
152				var exportBlobList ExportBlobList
153				err = json.Unmarshal(*v, &exportBlobList)
154				if err != nil {
155					return err
156				}
157				e.ExportBlobList = &exportBlobList
158			}
159		case "blobListblobPath":
160			if v != nil {
161				var blobListblobPath string
162				err = json.Unmarshal(*v, &blobListblobPath)
163				if err != nil {
164					return err
165				}
166				e.BlobListblobPath = &blobListblobPath
167			}
168		}
169	}
170
171	return nil
172}
173
174// ExportBlobList a list of the blobs to be exported.
175type ExportBlobList struct {
176	// BlobPath - A collection of blob-path strings.
177	BlobPath *[]string `json:"blobPath,omitempty"`
178	// BlobPathPrefix - A collection of blob-prefix strings.
179	BlobPathPrefix *[]string `json:"blobPathPrefix,omitempty"`
180}
181
182// GetBitLockerKeysResponse getBitLockerKeys response
183type GetBitLockerKeysResponse struct {
184	autorest.Response `json:"-"`
185	// Value - drive status
186	Value *[]DriveBitLockerKey `json:"value,omitempty"`
187}
188
189// JobDetails specifies the job properties
190type JobDetails struct {
191	// StorageAccountID - The resource identifier of the storage account where data will be imported to or exported from.
192	StorageAccountID *string `json:"storageAccountId,omitempty"`
193	// JobType - The type of job
194	JobType *string `json:"jobType,omitempty"`
195	// ReturnAddress - Specifies the return address information for the job.
196	ReturnAddress *ReturnAddress `json:"returnAddress,omitempty"`
197	// ReturnShipping - Specifies the return carrier and customer's account with the carrier.
198	ReturnShipping *ReturnShipping `json:"returnShipping,omitempty"`
199	// ShippingInformation - Contains information about the Microsoft datacenter to which the drives should be shipped.
200	ShippingInformation *ShippingInformation `json:"shippingInformation,omitempty"`
201	// DeliveryPackage - Contains information about the package being shipped by the customer to the Microsoft data center.
202	DeliveryPackage *PackageInfomation `json:"deliveryPackage,omitempty"`
203	// ReturnPackage - Contains information about the package being shipped from the Microsoft data center to the customer to return the drives. The format is the same as the deliveryPackage property above. This property is not included if the drives have not yet been returned.
204	ReturnPackage *PackageInfomation `json:"returnPackage,omitempty"`
205	// DiagnosticsPath - The virtual blob directory to which the copy logs and backups of drive manifest files (if enabled) will be stored.
206	DiagnosticsPath *string `json:"diagnosticsPath,omitempty"`
207	// LogLevel - Default value is Error. Indicates whether error logging or verbose logging will be enabled.
208	LogLevel *string `json:"logLevel,omitempty"`
209	// BackupDriveManifest - Default value is false. Indicates whether the manifest files on the drives should be copied to block blobs.
210	BackupDriveManifest *bool `json:"backupDriveManifest,omitempty"`
211	// State - Current state of the job.
212	State *string `json:"state,omitempty"`
213	// CancelRequested - Indicates whether a request has been submitted to cancel the job.
214	CancelRequested *bool `json:"cancelRequested,omitempty"`
215	// PercentComplete - Overall percentage completed for the job.
216	PercentComplete *int32 `json:"percentComplete,omitempty"`
217	// IncompleteBlobListURI - A blob path that points to a block blob containing a list of blob names that were not exported due to insufficient drive space. If all blobs were exported successfully, then this element is not included in the response.
218	IncompleteBlobListURI *string `json:"incompleteBlobListUri,omitempty"`
219	// DriveList - List of up to ten drives that comprise the job. The drive list is a required element for an import job; it is not specified for export jobs.
220	DriveList *[]DriveStatus `json:"driveList,omitempty"`
221	// Export - A property containing information about the blobs to be exported for an export job. This property is included for export jobs only.
222	Export *Export `json:"export,omitempty"`
223	// ProvisioningState - Specifies the provisioning state of the job.
224	ProvisioningState *string `json:"provisioningState,omitempty"`
225}
226
227// JobResponse contains the job information.
228type JobResponse struct {
229	autorest.Response `json:"-"`
230	// ID - READ-ONLY; Specifies the resource identifier of the job.
231	ID *string `json:"id,omitempty"`
232	// Name - READ-ONLY; Specifies the name of the job.
233	Name *string `json:"name,omitempty"`
234	// Type - READ-ONLY; Specifies the type of the job resource.
235	Type *string `json:"type,omitempty"`
236	// Location - Specifies the Azure location where the job is created.
237	Location *string `json:"location,omitempty"`
238	// Tags - Specifies the tags that are assigned to the job.
239	Tags interface{} `json:"tags,omitempty"`
240	// Properties - Specifies the job properties
241	Properties *JobDetails `json:"properties,omitempty"`
242}
243
244// MarshalJSON is the custom marshaler for JobResponse.
245func (jr JobResponse) MarshalJSON() ([]byte, error) {
246	objectMap := make(map[string]interface{})
247	if jr.Location != nil {
248		objectMap["location"] = jr.Location
249	}
250	if jr.Tags != nil {
251		objectMap["tags"] = jr.Tags
252	}
253	if jr.Properties != nil {
254		objectMap["properties"] = jr.Properties
255	}
256	return json.Marshal(objectMap)
257}
258
259// ListJobsResponse list jobs response
260type ListJobsResponse struct {
261	autorest.Response `json:"-"`
262	// NextLink - link to next batch of jobs
263	NextLink *string `json:"nextLink,omitempty"`
264	// Value - Job list
265	Value *[]JobResponse `json:"value,omitempty"`
266}
267
268// ListJobsResponseIterator provides access to a complete listing of JobResponse values.
269type ListJobsResponseIterator struct {
270	i    int
271	page ListJobsResponsePage
272}
273
274// NextWithContext advances to the next value.  If there was an error making
275// the request the iterator does not advance and the error is returned.
276func (iter *ListJobsResponseIterator) NextWithContext(ctx context.Context) (err error) {
277	if tracing.IsEnabled() {
278		ctx = tracing.StartSpan(ctx, fqdn+"/ListJobsResponseIterator.NextWithContext")
279		defer func() {
280			sc := -1
281			if iter.Response().Response.Response != nil {
282				sc = iter.Response().Response.Response.StatusCode
283			}
284			tracing.EndSpan(ctx, sc, err)
285		}()
286	}
287	iter.i++
288	if iter.i < len(iter.page.Values()) {
289		return nil
290	}
291	err = iter.page.NextWithContext(ctx)
292	if err != nil {
293		iter.i--
294		return err
295	}
296	iter.i = 0
297	return nil
298}
299
300// Next advances to the next value.  If there was an error making
301// the request the iterator does not advance and the error is returned.
302// Deprecated: Use NextWithContext() instead.
303func (iter *ListJobsResponseIterator) Next() error {
304	return iter.NextWithContext(context.Background())
305}
306
307// NotDone returns true if the enumeration should be started or is not yet complete.
308func (iter ListJobsResponseIterator) NotDone() bool {
309	return iter.page.NotDone() && iter.i < len(iter.page.Values())
310}
311
312// Response returns the raw server response from the last page request.
313func (iter ListJobsResponseIterator) Response() ListJobsResponse {
314	return iter.page.Response()
315}
316
317// Value returns the current value or a zero-initialized value if the
318// iterator has advanced beyond the end of the collection.
319func (iter ListJobsResponseIterator) Value() JobResponse {
320	if !iter.page.NotDone() {
321		return JobResponse{}
322	}
323	return iter.page.Values()[iter.i]
324}
325
326// Creates a new instance of the ListJobsResponseIterator type.
327func NewListJobsResponseIterator(page ListJobsResponsePage) ListJobsResponseIterator {
328	return ListJobsResponseIterator{page: page}
329}
330
331// IsEmpty returns true if the ListResult contains no values.
332func (ljr ListJobsResponse) IsEmpty() bool {
333	return ljr.Value == nil || len(*ljr.Value) == 0
334}
335
336// hasNextLink returns true if the NextLink is not empty.
337func (ljr ListJobsResponse) hasNextLink() bool {
338	return ljr.NextLink != nil && len(*ljr.NextLink) != 0
339}
340
341// listJobsResponsePreparer prepares a request to retrieve the next set of results.
342// It returns nil if no more results exist.
343func (ljr ListJobsResponse) listJobsResponsePreparer(ctx context.Context) (*http.Request, error) {
344	if !ljr.hasNextLink() {
345		return nil, nil
346	}
347	return autorest.Prepare((&http.Request{}).WithContext(ctx),
348		autorest.AsJSON(),
349		autorest.AsGet(),
350		autorest.WithBaseURL(to.String(ljr.NextLink)))
351}
352
353// ListJobsResponsePage contains a page of JobResponse values.
354type ListJobsResponsePage struct {
355	fn  func(context.Context, ListJobsResponse) (ListJobsResponse, error)
356	ljr ListJobsResponse
357}
358
359// NextWithContext advances to the next page of values.  If there was an error making
360// the request the page does not advance and the error is returned.
361func (page *ListJobsResponsePage) NextWithContext(ctx context.Context) (err error) {
362	if tracing.IsEnabled() {
363		ctx = tracing.StartSpan(ctx, fqdn+"/ListJobsResponsePage.NextWithContext")
364		defer func() {
365			sc := -1
366			if page.Response().Response.Response != nil {
367				sc = page.Response().Response.Response.StatusCode
368			}
369			tracing.EndSpan(ctx, sc, err)
370		}()
371	}
372	for {
373		next, err := page.fn(ctx, page.ljr)
374		if err != nil {
375			return err
376		}
377		page.ljr = next
378		if !next.hasNextLink() || !next.IsEmpty() {
379			break
380		}
381	}
382	return nil
383}
384
385// Next advances to the next page of values.  If there was an error making
386// the request the page does not advance and the error is returned.
387// Deprecated: Use NextWithContext() instead.
388func (page *ListJobsResponsePage) Next() error {
389	return page.NextWithContext(context.Background())
390}
391
392// NotDone returns true if the page enumeration should be started or is not yet complete.
393func (page ListJobsResponsePage) NotDone() bool {
394	return !page.ljr.IsEmpty()
395}
396
397// Response returns the raw server response from the last page request.
398func (page ListJobsResponsePage) Response() ListJobsResponse {
399	return page.ljr
400}
401
402// Values returns the slice of values for the current page or nil if there are no values.
403func (page ListJobsResponsePage) Values() []JobResponse {
404	if page.ljr.IsEmpty() {
405		return nil
406	}
407	return *page.ljr.Value
408}
409
410// Creates a new instance of the ListJobsResponsePage type.
411func NewListJobsResponsePage(cur ListJobsResponse, getNextPage func(context.Context, ListJobsResponse) (ListJobsResponse, error)) ListJobsResponsePage {
412	return ListJobsResponsePage{
413		fn:  getNextPage,
414		ljr: cur,
415	}
416}
417
418// ListOperationsResponse list operations response
419type ListOperationsResponse struct {
420	autorest.Response `json:"-"`
421	// Value - operations
422	Value *[]Operation `json:"value,omitempty"`
423}
424
425// Location provides information about an Azure data center location.
426type Location struct {
427	autorest.Response `json:"-"`
428	// ID - Specifies the resource identifier of the location.
429	ID *string `json:"id,omitempty"`
430	// Name - Specifies the name of the location. Use List Locations to get all supported locations.
431	Name *string `json:"name,omitempty"`
432	// Type - Specifies the type of the location.
433	Type *string `json:"type,omitempty"`
434	// LocationProperties - location properties
435	*LocationProperties `json:"properties,omitempty"`
436}
437
438// MarshalJSON is the custom marshaler for Location.
439func (l Location) MarshalJSON() ([]byte, error) {
440	objectMap := make(map[string]interface{})
441	if l.ID != nil {
442		objectMap["id"] = l.ID
443	}
444	if l.Name != nil {
445		objectMap["name"] = l.Name
446	}
447	if l.Type != nil {
448		objectMap["type"] = l.Type
449	}
450	if l.LocationProperties != nil {
451		objectMap["properties"] = l.LocationProperties
452	}
453	return json.Marshal(objectMap)
454}
455
456// UnmarshalJSON is the custom unmarshaler for Location struct.
457func (l *Location) UnmarshalJSON(body []byte) error {
458	var m map[string]*json.RawMessage
459	err := json.Unmarshal(body, &m)
460	if err != nil {
461		return err
462	}
463	for k, v := range m {
464		switch k {
465		case "id":
466			if v != nil {
467				var ID string
468				err = json.Unmarshal(*v, &ID)
469				if err != nil {
470					return err
471				}
472				l.ID = &ID
473			}
474		case "name":
475			if v != nil {
476				var name string
477				err = json.Unmarshal(*v, &name)
478				if err != nil {
479					return err
480				}
481				l.Name = &name
482			}
483		case "type":
484			if v != nil {
485				var typeVar string
486				err = json.Unmarshal(*v, &typeVar)
487				if err != nil {
488					return err
489				}
490				l.Type = &typeVar
491			}
492		case "properties":
493			if v != nil {
494				var locationProperties LocationProperties
495				err = json.Unmarshal(*v, &locationProperties)
496				if err != nil {
497					return err
498				}
499				l.LocationProperties = &locationProperties
500			}
501		}
502	}
503
504	return nil
505}
506
507// LocationProperties location properties
508type LocationProperties struct {
509	// RecipientName - The recipient name to use when shipping the drives to the Azure data center.
510	RecipientName *string `json:"recipientName,omitempty"`
511	// StreetAddress1 - The first line of the street address to use when shipping the drives to the Azure data center.
512	StreetAddress1 *string `json:"streetAddress1,omitempty"`
513	// StreetAddress2 - The second line of the street address to use when shipping the drives to the Azure data center.
514	StreetAddress2 *string `json:"streetAddress2,omitempty"`
515	// City - The city name to use when shipping the drives to the Azure data center.
516	City *string `json:"city,omitempty"`
517	// StateOrProvince - The state or province to use when shipping the drives to the Azure data center.
518	StateOrProvince *string `json:"stateOrProvince,omitempty"`
519	// PostalCode - The postal code to use when shipping the drives to the Azure data center.
520	PostalCode *string `json:"postalCode,omitempty"`
521	// CountryOrRegion - The country or region to use when shipping the drives to the Azure data center.
522	CountryOrRegion *string `json:"countryOrRegion,omitempty"`
523	// Phone - The phone number for the Azure data center.
524	Phone *string `json:"phone,omitempty"`
525	// SupportedCarriers - A list of carriers that are supported at this location.
526	SupportedCarriers *[]string `json:"supportedCarriers,omitempty"`
527	// AlternateLocations - A list of location IDs that should be used to ship shipping drives to for jobs created against the current location. If the current location is active, it will be part of the list. If it is temporarily closed due to maintenance, this list may contain other locations.
528	AlternateLocations *[]string `json:"alternateLocations,omitempty"`
529}
530
531// LocationsResponse locations response
532type LocationsResponse struct {
533	autorest.Response `json:"-"`
534	// Value - locations
535	Value *[]Location `json:"value,omitempty"`
536}
537
538// Operation describes a supported operation by the Storage Import/Export job API.
539type Operation struct {
540	// Name - Name of the operation.
541	Name *string `json:"name,omitempty"`
542	// OperationDisplay - operation display properties
543	*OperationDisplay `json:"display,omitempty"`
544}
545
546// MarshalJSON is the custom marshaler for Operation.
547func (o Operation) MarshalJSON() ([]byte, error) {
548	objectMap := make(map[string]interface{})
549	if o.Name != nil {
550		objectMap["name"] = o.Name
551	}
552	if o.OperationDisplay != nil {
553		objectMap["display"] = o.OperationDisplay
554	}
555	return json.Marshal(objectMap)
556}
557
558// UnmarshalJSON is the custom unmarshaler for Operation struct.
559func (o *Operation) UnmarshalJSON(body []byte) error {
560	var m map[string]*json.RawMessage
561	err := json.Unmarshal(body, &m)
562	if err != nil {
563		return err
564	}
565	for k, v := range m {
566		switch k {
567		case "name":
568			if v != nil {
569				var name string
570				err = json.Unmarshal(*v, &name)
571				if err != nil {
572					return err
573				}
574				o.Name = &name
575			}
576		case "display":
577			if v != nil {
578				var operationDisplay OperationDisplay
579				err = json.Unmarshal(*v, &operationDisplay)
580				if err != nil {
581					return err
582				}
583				o.OperationDisplay = &operationDisplay
584			}
585		}
586	}
587
588	return nil
589}
590
591// OperationDisplay operation display properties
592type OperationDisplay struct {
593	// Provider - The resource provider name to which the operation belongs.
594	Provider *string `json:"provider,omitempty"`
595	// Resource - The name of the resource to which the operation belongs.
596	Resource *string `json:"resource,omitempty"`
597	// Operation - The display name of the operation.
598	Operation *string `json:"operation,omitempty"`
599	// Description - Short description of the operation.
600	Description *string `json:"description,omitempty"`
601}
602
603// PackageInfomation contains information about the package being shipped by the customer to the Microsoft
604// data center.
605type PackageInfomation struct {
606	// CarrierName - The name of the carrier that is used to ship the import or export drives.
607	CarrierName *string `json:"carrierName,omitempty"`
608	// TrackingNumber - The tracking number of the package.
609	TrackingNumber *string `json:"trackingNumber,omitempty"`
610	// DriveCount - The number of drives included in the package.
611	DriveCount *int32 `json:"driveCount,omitempty"`
612	// ShipDate - The date when the package is shipped.
613	ShipDate *string `json:"shipDate,omitempty"`
614}
615
616// PutJobParameters put Job parameters
617type PutJobParameters struct {
618	// Location - Specifies the supported Azure location where the job should be created
619	Location *string `json:"location,omitempty"`
620	// Tags - Specifies the tags that will be assigned to the job.
621	Tags interface{} `json:"tags,omitempty"`
622	// Properties - Specifies the job properties
623	Properties *JobDetails `json:"properties,omitempty"`
624}
625
626// ReturnAddress specifies the return address information for the job.
627type ReturnAddress struct {
628	// RecipientName - The name of the recipient who will receive the hard drives when they are returned.
629	RecipientName *string `json:"recipientName,omitempty"`
630	// StreetAddress1 - The first line of the street address to use when returning the drives.
631	StreetAddress1 *string `json:"streetAddress1,omitempty"`
632	// StreetAddress2 - The second line of the street address to use when returning the drives.
633	StreetAddress2 *string `json:"streetAddress2,omitempty"`
634	// City - The city name to use when returning the drives.
635	City *string `json:"city,omitempty"`
636	// StateOrProvince - The state or province to use when returning the drives.
637	StateOrProvince *string `json:"stateOrProvince,omitempty"`
638	// PostalCode - The postal code to use when returning the drives.
639	PostalCode *string `json:"postalCode,omitempty"`
640	// CountryOrRegion - The country or region to use when returning the drives.
641	CountryOrRegion *string `json:"countryOrRegion,omitempty"`
642	// Phone - Phone number of the recipient of the returned drives.
643	Phone *string `json:"phone,omitempty"`
644	// Email - Email address of the recipient of the returned drives.
645	Email *string `json:"email,omitempty"`
646}
647
648// ReturnShipping specifies the return carrier and customer's account with the carrier.
649type ReturnShipping struct {
650	// CarrierName - The carrier's name.
651	CarrierName *string `json:"carrierName,omitempty"`
652	// CarrierAccountNumber - The customer's account number with the carrier.
653	CarrierAccountNumber *string `json:"carrierAccountNumber,omitempty"`
654}
655
656// ShippingInformation contains information about the Microsoft datacenter to which the drives should be
657// shipped.
658type ShippingInformation struct {
659	// RecipientName - The name of the recipient who will receive the hard drives when they are returned.
660	RecipientName *string `json:"recipientName,omitempty"`
661	// StreetAddress1 - The first line of the street address to use when returning the drives.
662	StreetAddress1 *string `json:"streetAddress1,omitempty"`
663	// StreetAddress2 - The second line of the street address to use when returning the drives.
664	StreetAddress2 *string `json:"streetAddress2,omitempty"`
665	// City - The city name to use when returning the drives.
666	City *string `json:"city,omitempty"`
667	// StateOrProvince - The state or province to use when returning the drives.
668	StateOrProvince *string `json:"stateOrProvince,omitempty"`
669	// PostalCode - The postal code to use when returning the drives.
670	PostalCode *string `json:"postalCode,omitempty"`
671	// CountryOrRegion - The country or region to use when returning the drives.
672	CountryOrRegion *string `json:"countryOrRegion,omitempty"`
673	// Phone - Phone number of the recipient of the returned drives.
674	Phone *string `json:"phone,omitempty"`
675}
676
677// UpdateJobParameters update Job parameters
678type UpdateJobParameters struct {
679	// Tags - Specifies the tags that will be assigned to the job
680	Tags interface{} `json:"tags,omitempty"`
681	// UpdateJobParametersProperties - Specifies the properties of a UpdateJob.
682	*UpdateJobParametersProperties `json:"properties,omitempty"`
683}
684
685// MarshalJSON is the custom marshaler for UpdateJobParameters.
686func (ujp UpdateJobParameters) MarshalJSON() ([]byte, error) {
687	objectMap := make(map[string]interface{})
688	if ujp.Tags != nil {
689		objectMap["tags"] = ujp.Tags
690	}
691	if ujp.UpdateJobParametersProperties != nil {
692		objectMap["properties"] = ujp.UpdateJobParametersProperties
693	}
694	return json.Marshal(objectMap)
695}
696
697// UnmarshalJSON is the custom unmarshaler for UpdateJobParameters struct.
698func (ujp *UpdateJobParameters) UnmarshalJSON(body []byte) error {
699	var m map[string]*json.RawMessage
700	err := json.Unmarshal(body, &m)
701	if err != nil {
702		return err
703	}
704	for k, v := range m {
705		switch k {
706		case "tags":
707			if v != nil {
708				var tags interface{}
709				err = json.Unmarshal(*v, &tags)
710				if err != nil {
711					return err
712				}
713				ujp.Tags = tags
714			}
715		case "properties":
716			if v != nil {
717				var updateJobParametersProperties UpdateJobParametersProperties
718				err = json.Unmarshal(*v, &updateJobParametersProperties)
719				if err != nil {
720					return err
721				}
722				ujp.UpdateJobParametersProperties = &updateJobParametersProperties
723			}
724		}
725	}
726
727	return nil
728}
729
730// UpdateJobParametersProperties specifies the properties of a UpdateJob.
731type UpdateJobParametersProperties struct {
732	// CancelRequested - If specified, the value must be true. The service will attempt to cancel the job.
733	CancelRequested *bool `json:"cancelRequested,omitempty"`
734	// State - If specified, the value must be Shipping, which tells the Import/Export service that the package for the job has been shipped. The ReturnAddress and DeliveryPackage properties must have been set either in this request or in a previous request, otherwise the request will fail.
735	State *string `json:"state,omitempty"`
736	// ReturnAddress - Specifies the return address information for the job.
737	ReturnAddress *ReturnAddress `json:"returnAddress,omitempty"`
738	// ReturnShipping - Specifies the return carrier and customer's account with the carrier.
739	ReturnShipping *ReturnShipping `json:"returnShipping,omitempty"`
740	// DeliveryPackage - Contains information about the package being shipped by the customer to the Microsoft data center.
741	DeliveryPackage *PackageInfomation `json:"deliveryPackage,omitempty"`
742	// LogLevel - Indicates whether error logging or verbose logging is enabled.
743	LogLevel *string `json:"logLevel,omitempty"`
744	// BackupDriveManifest - Indicates whether the manifest files on the drives should be copied to block blobs.
745	BackupDriveManifest *bool `json:"backupDriveManifest,omitempty"`
746	// DriveList - List of drives that comprise the job.
747	DriveList *[]DriveStatus `json:"driveList,omitempty"`
748}
749