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