diff --git a/profiles/preview/databox/mgmt/databox/models.go b/profiles/preview/databox/mgmt/databox/models.go index ad01592a1fd0..9c21ad579176 100644 --- a/profiles/preview/databox/mgmt/databox/models.go +++ b/profiles/preview/databox/mgmt/databox/models.go @@ -27,6 +27,13 @@ const ( type BaseClient = original.BaseClient type JobsClient = original.JobsClient +type AccessProtocol = original.AccessProtocol + +const ( + NFS AccessProtocol = original.NFS + SMB AccessProtocol = original.SMB +) + type AddressType = original.AddressType const ( @@ -47,8 +54,9 @@ type CopyLogDetailsType = original.CopyLogDetailsType const ( CopyLogDetailsTypeCopyLogDetails CopyLogDetailsType = original.CopyLogDetailsTypeCopyLogDetails - CopyLogDetailsTypeDisk CopyLogDetailsType = original.CopyLogDetailsTypeDisk - CopyLogDetailsTypePod CopyLogDetailsType = original.CopyLogDetailsTypePod + CopyLogDetailsTypeDataBox CopyLogDetailsType = original.CopyLogDetailsTypeDataBox + CopyLogDetailsTypeDataBoxDisk CopyLogDetailsType = original.CopyLogDetailsTypeDataBoxDisk + CopyLogDetailsTypeDataBoxHeavy CopyLogDetailsType = original.CopyLogDetailsTypeDataBoxHeavy ) type CopyStatus = original.CopyStatus @@ -58,62 +66,65 @@ const ( CompletedWithErrors CopyStatus = original.CompletedWithErrors Failed CopyStatus = original.Failed InProgress CopyStatus = original.InProgress + NotReturned CopyStatus = original.NotReturned NotStarted CopyStatus = original.NotStarted ) -type DeviceIssueType = original.DeviceIssueType +type JobDetailsType = original.JobDetailsType const ( - DeviceHealthCheckShowFailures DeviceIssueType = original.DeviceHealthCheckShowFailures - DeviceNotBootingUp DeviceIssueType = original.DeviceNotBootingUp - DeviceTampering DeviceIssueType = original.DeviceTampering - Misc DeviceIssueType = original.Misc - NICsAreNotWorking DeviceIssueType = original.NICsAreNotWorking + JobDetailsTypeDataBox JobDetailsType = original.JobDetailsTypeDataBox + JobDetailsTypeDataBoxDisk JobDetailsType = original.JobDetailsTypeDataBoxDisk + JobDetailsTypeDataBoxHeavy JobDetailsType = original.JobDetailsTypeDataBoxHeavy + JobDetailsTypeJobDetails JobDetailsType = original.JobDetailsTypeJobDetails ) -type DeviceType = original.DeviceType +type JobSecretsType = original.JobSecretsType const ( - Cabinet DeviceType = original.Cabinet - Disk DeviceType = original.Disk - Pod DeviceType = original.Pod + JobSecretsTypeDataBox JobSecretsType = original.JobSecretsTypeDataBox + JobSecretsTypeDataBoxDisk JobSecretsType = original.JobSecretsTypeDataBoxDisk + JobSecretsTypeDataBoxHeavy JobSecretsType = original.JobSecretsTypeDataBoxHeavy + JobSecretsTypeJobSecrets JobSecretsType = original.JobSecretsTypeJobSecrets ) -type IssueType = original.IssueType +type NotificationStageName = original.NotificationStageName const ( - CredentialNotWorking IssueType = original.CredentialNotWorking - DeviceFailure IssueType = original.DeviceFailure - DeviceMismatch IssueType = original.DeviceMismatch - ValidationStringMismatch IssueType = original.ValidationStringMismatch + AtAzureDC NotificationStageName = original.AtAzureDC + DataCopy NotificationStageName = original.DataCopy + Delivered NotificationStageName = original.Delivered + DevicePrepared NotificationStageName = original.DevicePrepared + Dispatched NotificationStageName = original.Dispatched + PickedUp NotificationStageName = original.PickedUp ) -type JobDetailsType = original.JobDetailsType +type ShareDestinationFormatType = original.ShareDestinationFormatType const ( - JobDetailsTypeDisk JobDetailsType = original.JobDetailsTypeDisk - JobDetailsTypeJobDetails JobDetailsType = original.JobDetailsTypeJobDetails - JobDetailsTypePod JobDetailsType = original.JobDetailsTypePod + AzureFile ShareDestinationFormatType = original.AzureFile + BlockBlob ShareDestinationFormatType = original.BlockBlob + HCS ShareDestinationFormatType = original.HCS + PageBlob ShareDestinationFormatType = original.PageBlob + UnknownType ShareDestinationFormatType = original.UnknownType ) -type JobSecretsType = original.JobSecretsType +type SkuDisabledReason = original.SkuDisabledReason const ( - JobSecretsTypeCabinet JobSecretsType = original.JobSecretsTypeCabinet - JobSecretsTypeDisk JobSecretsType = original.JobSecretsTypeDisk - JobSecretsTypeJobSecrets JobSecretsType = original.JobSecretsTypeJobSecrets - JobSecretsTypePod JobSecretsType = original.JobSecretsTypePod + SkuDisabledReasonCountry SkuDisabledReason = original.SkuDisabledReasonCountry + SkuDisabledReasonFeature SkuDisabledReason = original.SkuDisabledReasonFeature + SkuDisabledReasonNone SkuDisabledReason = original.SkuDisabledReasonNone + SkuDisabledReasonOfferType SkuDisabledReason = original.SkuDisabledReasonOfferType + SkuDisabledReasonRegion SkuDisabledReason = original.SkuDisabledReasonRegion ) -type NotificationStageName = original.NotificationStageName +type SkuName = original.SkuName const ( - AtAzureDC NotificationStageName = original.AtAzureDC - DataCopy NotificationStageName = original.DataCopy - Delivered NotificationStageName = original.Delivered - DevicePrepared NotificationStageName = original.DevicePrepared - Dispatched NotificationStageName = original.Dispatched - PickedUp NotificationStageName = original.PickedUp + DataBox SkuName = original.DataBox + DataBoxDisk SkuName = original.DataBoxDisk + DataBoxHeavy SkuName = original.DataBoxHeavy ) type StageName = original.StageName @@ -150,13 +161,12 @@ type AccountCopyLogDetails = original.AccountCopyLogDetails type AccountCredentialDetails = original.AccountCredentialDetails type AddressValidationOutput = original.AddressValidationOutput type AddressValidationProperties = original.AddressValidationProperties +type ApplianceNetworkConfiguration = original.ApplianceNetworkConfiguration type ArmBaseObject = original.ArmBaseObject type AvailableSkuRequest = original.AvailableSkuRequest type AvailableSkusResult = original.AvailableSkusResult type AvailableSkusResultIterator = original.AvailableSkusResultIterator type AvailableSkusResultPage = original.AvailableSkusResultPage -type CabinetJobSecrets = original.CabinetJobSecrets -type CabinetPodSecret = original.CabinetPodSecret type CancellationReason = original.CancellationReason type ContactDetails = original.ContactDetails type BasicCopyLogDetails = original.BasicCopyLogDetails @@ -170,9 +180,13 @@ type DiskJobDetails = original.DiskJobDetails type DiskJobSecrets = original.DiskJobSecrets type DiskSecret = original.DiskSecret type Error = original.Error -type GetCopyLogsURIOutput = original.GetCopyLogsURIOutput +type HeavyAccountCopyLogDetails = original.HeavyAccountCopyLogDetails +type HeavyJobDetails = original.HeavyJobDetails +type HeavyJobSecrets = original.HeavyJobSecrets +type HeavySecret = original.HeavySecret type BasicJobDetails = original.BasicJobDetails type JobDetails = original.JobDetails +type JobDetailsType = original.JobDetailsType type JobErrorDetails = original.JobErrorDetails type JobProperties = original.JobProperties type JobResource = original.JobResource @@ -181,8 +195,10 @@ type JobResourceListIterator = original.JobResourceListIterator type JobResourceListPage = original.JobResourceListPage type JobResourceUpdateParameter = original.JobResourceUpdateParameter type JobsCreateFuture = original.JobsCreateFuture +type JobsDeleteFuture = original.JobsDeleteFuture type BasicJobSecrets = original.BasicJobSecrets type JobSecrets = original.JobSecrets +type JobSecretsType = original.JobSecretsType type JobStages = original.JobStages type JobsUpdateFuture = original.JobsUpdateFuture type NotificationPreference = original.NotificationPreference @@ -192,22 +208,20 @@ type OperationList = original.OperationList type OperationListIterator = original.OperationListIterator type OperationListPage = original.OperationListPage type PackageShippingDetails = original.PackageShippingDetails -type PodJobDetails = original.PodJobDetails -type PodJobSecrets = original.PodJobSecrets -type PodSecret = original.PodSecret -type ReportIssueDetails = original.ReportIssueDetails +type Preferences = original.Preferences type Resource = original.Resource +type Secret = original.Secret type ShareCredentialDetails = original.ShareCredentialDetails type ShipmentPickUpRequest = original.ShipmentPickUpRequest type ShipmentPickUpResponse = original.ShipmentPickUpResponse type ShippingAddress = original.ShippingAddress -type ShippingLabelDetails = original.ShippingLabelDetails type Sku = original.Sku type SkuCapacity = original.SkuCapacity type SkuCost = original.SkuCost type SkuInformation = original.SkuInformation type SkuProperties = original.SkuProperties -type UnencryptedSecrets = original.UnencryptedSecrets +type UnencryptedCredentials = original.UnencryptedCredentials +type UnencryptedCredentialsList = original.UnencryptedCredentialsList type UpdateJobDetails = original.UpdateJobDetails type UpdateJobProperties = original.UpdateJobProperties type ValidateAddress = original.ValidateAddress @@ -226,6 +240,9 @@ func NewJobsClient(subscriptionID string) JobsClient { func NewJobsClientWithBaseURI(baseURI string, subscriptionID string) JobsClient { return original.NewJobsClientWithBaseURI(baseURI, subscriptionID) } +func PossibleAccessProtocolValues() []AccessProtocol { + return original.PossibleAccessProtocolValues() +} func PossibleAddressTypeValues() []AddressType { return original.PossibleAddressTypeValues() } @@ -238,15 +255,6 @@ func PossibleCopyLogDetailsTypeValues() []CopyLogDetailsType { func PossibleCopyStatusValues() []CopyStatus { return original.PossibleCopyStatusValues() } -func PossibleDeviceIssueTypeValues() []DeviceIssueType { - return original.PossibleDeviceIssueTypeValues() -} -func PossibleDeviceTypeValues() []DeviceType { - return original.PossibleDeviceTypeValues() -} -func PossibleIssueTypeValues() []IssueType { - return original.PossibleIssueTypeValues() -} func PossibleJobDetailsTypeValues() []JobDetailsType { return original.PossibleJobDetailsTypeValues() } @@ -256,6 +264,15 @@ func PossibleJobSecretsTypeValues() []JobSecretsType { func PossibleNotificationStageNameValues() []NotificationStageName { return original.PossibleNotificationStageNameValues() } +func PossibleShareDestinationFormatTypeValues() []ShareDestinationFormatType { + return original.PossibleShareDestinationFormatTypeValues() +} +func PossibleSkuDisabledReasonValues() []SkuDisabledReason { + return original.PossibleSkuDisabledReasonValues() +} +func PossibleSkuNameValues() []SkuName { + return original.PossibleSkuNameValues() +} func PossibleStageNameValues() []StageName { return original.PossibleStageNameValues() } diff --git a/services/databox/mgmt/2018-01-01/databox/jobs.go b/services/databox/mgmt/2018-01-01/databox/jobs.go index 2307b31fb816..2a47303a6aa5 100644 --- a/services/databox/mgmt/2018-01-01/databox/jobs.go +++ b/services/databox/mgmt/2018-01-01/databox/jobs.go @@ -51,7 +51,11 @@ func (client JobsClient) BookShipmentPickUp(ctx context.Context, resourceGroupNa {TargetValue: jobName, Constraints: []validation.Constraint{{Target: "jobName", Name: validation.MaxLength, Rule: 24, Chain: nil}, {Target: "jobName", Name: validation.MinLength, Rule: 3, Chain: nil}, - {Target: "jobName", Name: validation.Pattern, Rule: `^[-\w\.]+$`, Chain: nil}}}}); err != nil { + {Target: "jobName", Name: validation.Pattern, Rule: `^[-\w\.]+$`, Chain: nil}}}, + {TargetValue: shipmentPickUpRequest, + Constraints: []validation.Constraint{{Target: "shipmentPickUpRequest.StartTime", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "shipmentPickUpRequest.EndTime", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "shipmentPickUpRequest.ShipmentLocation", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { return result, validation.NewError("databox.JobsClient", "BookShipmentPickUp", err.Error()) } @@ -214,20 +218,19 @@ func (client JobsClient) Create(ctx context.Context, resourceGroupName string, j {Target: "jobName", Name: validation.Pattern, Rule: `^[-\w\.]+$`, Chain: nil}}}, {TargetValue: jobResource, Constraints: []validation.Constraint{{Target: "jobResource.JobProperties", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "jobResource.JobProperties.Error", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "jobResource.JobProperties.Error.Code", Name: validation.Null, Rule: true, Chain: nil}}}, - {Target: "jobResource.JobProperties.DestinationAccountDetails", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "jobResource.JobProperties.Details", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "jobResource.JobProperties.Details.ContactDetails", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "jobResource.JobProperties.Details.ContactDetails.Phone", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "jobResource.JobProperties.Details.ContactDetails.EmailList", Name: validation.Null, Rule: true, Chain: nil}, - }}, - {Target: "jobResource.JobProperties.Details.ShippingAddress", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "jobResource.JobProperties.Details.ShippingAddress.StreetAddress1", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "jobResource.JobProperties.Details.ShippingAddress.Country", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "jobResource.JobProperties.Details.ShippingAddress.PostalCode", Name: validation.Null, Rule: true, Chain: nil}, - }}, + Chain: []validation.Constraint{{Target: "jobResource.JobProperties.Details", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "jobResource.JobProperties.Details.ContactDetails", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "jobResource.JobProperties.Details.ContactDetails.ContactName", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "jobResource.JobProperties.Details.ContactDetails.Phone", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "jobResource.JobProperties.Details.ContactDetails.EmailList", Name: validation.Null, Rule: true, Chain: nil}, }}, + {Target: "jobResource.JobProperties.Details.ShippingAddress", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "jobResource.JobProperties.Details.ShippingAddress.StreetAddress1", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "jobResource.JobProperties.Details.ShippingAddress.Country", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "jobResource.JobProperties.Details.ShippingAddress.PostalCode", Name: validation.Null, Rule: true, Chain: nil}, + }}, + {Target: "jobResource.JobProperties.Details.DestinationAccountDetails", Name: validation.Null, Rule: true, Chain: nil}, + }}, }}}}}); err != nil { return result, validation.NewError("databox.JobsClient", "Create", err.Error()) } @@ -305,7 +308,7 @@ func (client JobsClient) CreateResponder(resp *http.Response) (result JobResourc // resourceGroupName - the Resource Group Name // jobName - the name of the job Resource within the specified resource group. job names must be between 3 and // 24 characters in length and use any alphanumeric and underscore only -func (client JobsClient) Delete(ctx context.Context, resourceGroupName string, jobName string) (result autorest.Response, err error) { +func (client JobsClient) Delete(ctx context.Context, resourceGroupName string, jobName string) (result JobsDeleteFuture, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: jobName, Constraints: []validation.Constraint{{Target: "jobName", Name: validation.MaxLength, Rule: 24, Chain: nil}, @@ -320,18 +323,12 @@ func (client JobsClient) Delete(ctx context.Context, resourceGroupName string, j return } - resp, err := client.DeleteSender(req) + result, err = client.DeleteSender(req) if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "databox.JobsClient", "Delete", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "databox.JobsClient", "Delete", result.Response(), "Failure sending request") return } - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "databox.JobsClient", "Delete", resp, "Failure responding to request") - } - return } @@ -358,96 +355,30 @@ func (client JobsClient) DeletePreparer(ctx context.Context, resourceGroupName s // DeleteSender sends the Delete request. The method will close the // http.Response Body if it receives an error. -func (client JobsClient) DeleteSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, +func (client JobsClient) DeleteSender(req *http.Request) (future JobsDeleteFuture, err error) { + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, azure.DoRetryWithRegistration(client.Client)) -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client JobsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// DownloadShippingLabelURI get shipping label sas uri. -// Parameters: -// resourceGroupName - the Resource Group Name -// jobName - the name of the job Resource within the specified resource group. job names must be between 3 and -// 24 characters in length and use any alphanumeric and underscore only -func (client JobsClient) DownloadShippingLabelURI(ctx context.Context, resourceGroupName string, jobName string) (result ShippingLabelDetails, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: jobName, - Constraints: []validation.Constraint{{Target: "jobName", Name: validation.MaxLength, Rule: 24, Chain: nil}, - {Target: "jobName", Name: validation.MinLength, Rule: 3, Chain: nil}, - {Target: "jobName", Name: validation.Pattern, Rule: `^[-\w\.]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("databox.JobsClient", "DownloadShippingLabelURI", err.Error()) - } - - req, err := client.DownloadShippingLabelURIPreparer(ctx, resourceGroupName, jobName) if err != nil { - err = autorest.NewErrorWithError(err, "databox.JobsClient", "DownloadShippingLabelURI", nil, "Failure preparing request") return } - - resp, err := client.DownloadShippingLabelURISender(req) + err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent)) if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "databox.JobsClient", "DownloadShippingLabelURI", resp, "Failure sending request") return } - - result, err = client.DownloadShippingLabelURIResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "databox.JobsClient", "DownloadShippingLabelURI", resp, "Failure responding to request") - } - + future.Future, err = azure.NewFutureFromResponse(resp) return } -// DownloadShippingLabelURIPreparer prepares the DownloadShippingLabelURI request. -func (client JobsClient) DownloadShippingLabelURIPreparer(ctx context.Context, resourceGroupName string, jobName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobName": autorest.Encode("path", jobName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-01-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/downloadShippingLabel", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DownloadShippingLabelURISender sends the DownloadShippingLabelURI request. The method will close the -// http.Response Body if it receives an error. -func (client JobsClient) DownloadShippingLabelURISender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - azure.DoRetryWithRegistration(client.Client)) -} - -// DownloadShippingLabelURIResponder handles the response to the DownloadShippingLabelURI request. The method always +// DeleteResponder handles the response to the Delete request. The method always // closes the http.Response Body. -func (client JobsClient) DownloadShippingLabelURIResponder(resp *http.Response) (result ShippingLabelDetails, err error) { +func (client JobsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} + result.Response = resp return } @@ -531,82 +462,6 @@ func (client JobsClient) GetResponder(resp *http.Response) (result JobResource, return } -// GetCopyLogsURI provides list of copy logs uri. -// Parameters: -// resourceGroupName - the Resource Group Name -// jobName - the name of the job Resource within the specified resource group. job names must be between 3 and -// 24 characters in length and use any alphanumeric and underscore only -func (client JobsClient) GetCopyLogsURI(ctx context.Context, resourceGroupName string, jobName string) (result GetCopyLogsURIOutput, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: jobName, - Constraints: []validation.Constraint{{Target: "jobName", Name: validation.MaxLength, Rule: 24, Chain: nil}, - {Target: "jobName", Name: validation.MinLength, Rule: 3, Chain: nil}, - {Target: "jobName", Name: validation.Pattern, Rule: `^[-\w\.]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("databox.JobsClient", "GetCopyLogsURI", err.Error()) - } - - req, err := client.GetCopyLogsURIPreparer(ctx, resourceGroupName, jobName) - if err != nil { - err = autorest.NewErrorWithError(err, "databox.JobsClient", "GetCopyLogsURI", nil, "Failure preparing request") - return - } - - resp, err := client.GetCopyLogsURISender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "databox.JobsClient", "GetCopyLogsURI", resp, "Failure sending request") - return - } - - result, err = client.GetCopyLogsURIResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "databox.JobsClient", "GetCopyLogsURI", resp, "Failure responding to request") - } - - return -} - -// GetCopyLogsURIPreparer prepares the GetCopyLogsURI request. -func (client JobsClient) GetCopyLogsURIPreparer(ctx context.Context, resourceGroupName string, jobName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobName": autorest.Encode("path", jobName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-01-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/copyLogsUri", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetCopyLogsURISender sends the GetCopyLogsURI request. The method will close the -// http.Response Body if it receives an error. -func (client JobsClient) GetCopyLogsURISender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - azure.DoRetryWithRegistration(client.Client)) -} - -// GetCopyLogsURIResponder handles the response to the GetCopyLogsURI request. The method always -// closes the http.Response Body. -func (client JobsClient) GetCopyLogsURIResponder(resp *http.Response) (result GetCopyLogsURIOutput, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - // List lists all the jobs available under the subscription. // Parameters: // skipToken - $skipToken is supported on Get list of jobs, which provides the next page in the list of jobs. @@ -799,43 +654,43 @@ func (client JobsClient) ListByResourceGroupComplete(ctx context.Context, resour return } -// ListSecrets this method gets the unencrypted secrets related to the job. +// ListCredentials this method gets the unencrypted secrets related to the job. // Parameters: // resourceGroupName - the Resource Group Name // jobName - the name of the job Resource within the specified resource group. job names must be between 3 and // 24 characters in length and use any alphanumeric and underscore only -func (client JobsClient) ListSecrets(ctx context.Context, resourceGroupName string, jobName string) (result UnencryptedSecrets, err error) { +func (client JobsClient) ListCredentials(ctx context.Context, resourceGroupName string, jobName string) (result UnencryptedCredentialsList, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: jobName, Constraints: []validation.Constraint{{Target: "jobName", Name: validation.MaxLength, Rule: 24, Chain: nil}, {Target: "jobName", Name: validation.MinLength, Rule: 3, Chain: nil}, {Target: "jobName", Name: validation.Pattern, Rule: `^[-\w\.]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("databox.JobsClient", "ListSecrets", err.Error()) + return result, validation.NewError("databox.JobsClient", "ListCredentials", err.Error()) } - req, err := client.ListSecretsPreparer(ctx, resourceGroupName, jobName) + req, err := client.ListCredentialsPreparer(ctx, resourceGroupName, jobName) if err != nil { - err = autorest.NewErrorWithError(err, "databox.JobsClient", "ListSecrets", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "databox.JobsClient", "ListCredentials", nil, "Failure preparing request") return } - resp, err := client.ListSecretsSender(req) + resp, err := client.ListCredentialsSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "databox.JobsClient", "ListSecrets", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "databox.JobsClient", "ListCredentials", resp, "Failure sending request") return } - result, err = client.ListSecretsResponder(resp) + result, err = client.ListCredentialsResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "databox.JobsClient", "ListSecrets", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "databox.JobsClient", "ListCredentials", resp, "Failure responding to request") } return } -// ListSecretsPreparer prepares the ListSecrets request. -func (client JobsClient) ListSecretsPreparer(ctx context.Context, resourceGroupName string, jobName string) (*http.Request, error) { +// ListCredentialsPreparer prepares the ListCredentials request. +func (client JobsClient) ListCredentialsPreparer(ctx context.Context, resourceGroupName string, jobName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "jobName": autorest.Encode("path", jobName), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -850,21 +705,21 @@ func (client JobsClient) ListSecretsPreparer(ctx context.Context, resourceGroupN preparer := autorest.CreatePreparer( autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/listSecrets", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/listCredentials", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// ListSecretsSender sends the ListSecrets request. The method will close the +// ListCredentialsSender sends the ListCredentials request. The method will close the // http.Response Body if it receives an error. -func (client JobsClient) ListSecretsSender(req *http.Request) (*http.Response, error) { +func (client JobsClient) ListCredentialsSender(req *http.Request) (*http.Response, error) { return autorest.SendWithSender(client, req, azure.DoRetryWithRegistration(client.Client)) } -// ListSecretsResponder handles the response to the ListSecrets request. The method always +// ListCredentialsResponder handles the response to the ListCredentials request. The method always // closes the http.Response Body. -func (client JobsClient) ListSecretsResponder(resp *http.Response) (result UnencryptedSecrets, err error) { +func (client JobsClient) ListCredentialsResponder(resp *http.Response) (result UnencryptedCredentialsList, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -875,84 +730,6 @@ func (client JobsClient) ListSecretsResponder(resp *http.Response) (result Unenc return } -// ReportIssue reports an issue. -// Parameters: -// resourceGroupName - the Resource Group Name -// jobName - the name of the job Resource within the specified resource group. job names must be between 3 and -// 24 characters in length and use any alphanumeric and underscore only -// reportIssueDetails - details of reported issue. -func (client JobsClient) ReportIssue(ctx context.Context, resourceGroupName string, jobName string, reportIssueDetails ReportIssueDetails) (result autorest.Response, err error) { - if err := validation.Validate([]validation.Validation{ - {TargetValue: jobName, - Constraints: []validation.Constraint{{Target: "jobName", Name: validation.MaxLength, Rule: 24, Chain: nil}, - {Target: "jobName", Name: validation.MinLength, Rule: 3, Chain: nil}, - {Target: "jobName", Name: validation.Pattern, Rule: `^[-\w\.]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("databox.JobsClient", "ReportIssue", err.Error()) - } - - req, err := client.ReportIssuePreparer(ctx, resourceGroupName, jobName, reportIssueDetails) - if err != nil { - err = autorest.NewErrorWithError(err, "databox.JobsClient", "ReportIssue", nil, "Failure preparing request") - return - } - - resp, err := client.ReportIssueSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "databox.JobsClient", "ReportIssue", resp, "Failure sending request") - return - } - - result, err = client.ReportIssueResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "databox.JobsClient", "ReportIssue", resp, "Failure responding to request") - } - - return -} - -// ReportIssuePreparer prepares the ReportIssue request. -func (client JobsClient) ReportIssuePreparer(ctx context.Context, resourceGroupName string, jobName string, reportIssueDetails ReportIssueDetails) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "jobName": autorest.Encode("path", jobName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-01-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/reportIssue", pathParameters), - autorest.WithJSON(reportIssueDetails), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ReportIssueSender sends the ReportIssue request. The method will close the -// http.Response Body if it receives an error. -func (client JobsClient) ReportIssueSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - azure.DoRetryWithRegistration(client.Client)) -} - -// ReportIssueResponder handles the response to the ReportIssue request. The method always -// closes the http.Response Body. -func (client JobsClient) ReportIssueResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - // Update updates the properties of an existing job. // Parameters: // resourceGroupName - the Resource Group Name diff --git a/services/databox/mgmt/2018-01-01/databox/models.go b/services/databox/mgmt/2018-01-01/databox/models.go index b7a88a68ba7d..1e7fd25da16a 100644 --- a/services/databox/mgmt/2018-01-01/databox/models.go +++ b/services/databox/mgmt/2018-01-01/databox/models.go @@ -26,15 +26,30 @@ import ( "net/http" ) +// AccessProtocol enumerates the values for access protocol. +type AccessProtocol string + +const ( + // NFS Network File System protocol(NFS). + NFS AccessProtocol = "NFS" + // SMB Server Message Block protocol(SMB). + SMB AccessProtocol = "SMB" +) + +// PossibleAccessProtocolValues returns an array of possible values for the AccessProtocol const type. +func PossibleAccessProtocolValues() []AccessProtocol { + return []AccessProtocol{NFS, SMB} +} + // AddressType enumerates the values for address type. type AddressType string const ( - // Commercial ... + // Commercial Commercial Address. Commercial AddressType = "Commercial" - // None ... + // None Address type not known. None AddressType = "None" - // Residential ... + // Residential Residential Address. Residential AddressType = "Residential" ) @@ -47,11 +62,11 @@ func PossibleAddressTypeValues() []AddressType { type AddressValidationStatus string const ( - // Ambiguous ... + // Ambiguous Address provided is ambiguous, please choose one of the alternate addresses returned. Ambiguous AddressValidationStatus = "Ambiguous" - // Invalid ... + // Invalid Address provided is invalid or not supported. Invalid AddressValidationStatus = "Invalid" - // Valid ... + // Valid Address provided is valid. Valid AddressValidationStatus = "Valid" ) @@ -66,146 +81,95 @@ type CopyLogDetailsType string const ( // CopyLogDetailsTypeCopyLogDetails ... CopyLogDetailsTypeCopyLogDetails CopyLogDetailsType = "CopyLogDetails" - // CopyLogDetailsTypeDisk ... - CopyLogDetailsTypeDisk CopyLogDetailsType = "Disk" - // CopyLogDetailsTypePod ... - CopyLogDetailsTypePod CopyLogDetailsType = "Pod" + // CopyLogDetailsTypeDataBox ... + CopyLogDetailsTypeDataBox CopyLogDetailsType = "DataBox" + // CopyLogDetailsTypeDataBoxDisk ... + CopyLogDetailsTypeDataBoxDisk CopyLogDetailsType = "DataBoxDisk" + // CopyLogDetailsTypeDataBoxHeavy ... + CopyLogDetailsTypeDataBoxHeavy CopyLogDetailsType = "DataBoxHeavy" ) // PossibleCopyLogDetailsTypeValues returns an array of possible values for the CopyLogDetailsType const type. func PossibleCopyLogDetailsTypeValues() []CopyLogDetailsType { - return []CopyLogDetailsType{CopyLogDetailsTypeCopyLogDetails, CopyLogDetailsTypeDisk, CopyLogDetailsTypePod} + return []CopyLogDetailsType{CopyLogDetailsTypeCopyLogDetails, CopyLogDetailsTypeDataBox, CopyLogDetailsTypeDataBoxDisk, CopyLogDetailsTypeDataBoxHeavy} } // CopyStatus enumerates the values for copy status. type CopyStatus string const ( - // Completed ... + // Completed Data copy completed. Completed CopyStatus = "Completed" - // CompletedWithErrors ... + // CompletedWithErrors Data copy completed with errors. CompletedWithErrors CopyStatus = "CompletedWithErrors" - // Failed ... + // Failed Data copy failed. No data was copied. Failed CopyStatus = "Failed" - // InProgress ... + // InProgress Data copy is in progress. InProgress CopyStatus = "InProgress" - // NotStarted ... + // NotReturned No copy triggered as device was not returned. + NotReturned CopyStatus = "NotReturned" + // NotStarted Data copy hasnt started yet. NotStarted CopyStatus = "NotStarted" ) // PossibleCopyStatusValues returns an array of possible values for the CopyStatus const type. func PossibleCopyStatusValues() []CopyStatus { - return []CopyStatus{Completed, CompletedWithErrors, Failed, InProgress, NotStarted} -} - -// DeviceIssueType enumerates the values for device issue type. -type DeviceIssueType string - -const ( - // DeviceHealthCheckShowFailures ... - DeviceHealthCheckShowFailures DeviceIssueType = "DeviceHealthCheckShowFailures" - // DeviceNotBootingUp ... - DeviceNotBootingUp DeviceIssueType = "DeviceNotBootingUp" - // DeviceTampering ... - DeviceTampering DeviceIssueType = "DeviceTampering" - // Misc ... - Misc DeviceIssueType = "Misc" - // NICsAreNotWorking ... - NICsAreNotWorking DeviceIssueType = "NICsAreNotWorking" -) - -// PossibleDeviceIssueTypeValues returns an array of possible values for the DeviceIssueType const type. -func PossibleDeviceIssueTypeValues() []DeviceIssueType { - return []DeviceIssueType{DeviceHealthCheckShowFailures, DeviceNotBootingUp, DeviceTampering, Misc, NICsAreNotWorking} -} - -// DeviceType enumerates the values for device type. -type DeviceType string - -const ( - // Cabinet ... - Cabinet DeviceType = "Cabinet" - // Disk ... - Disk DeviceType = "Disk" - // Pod ... - Pod DeviceType = "Pod" -) - -// PossibleDeviceTypeValues returns an array of possible values for the DeviceType const type. -func PossibleDeviceTypeValues() []DeviceType { - return []DeviceType{Cabinet, Disk, Pod} -} - -// IssueType enumerates the values for issue type. -type IssueType string - -const ( - // CredentialNotWorking ... - CredentialNotWorking IssueType = "CredentialNotWorking" - // DeviceFailure ... - DeviceFailure IssueType = "DeviceFailure" - // DeviceMismatch ... - DeviceMismatch IssueType = "DeviceMismatch" - // ValidationStringMismatch ... - ValidationStringMismatch IssueType = "ValidationStringMismatch" -) - -// PossibleIssueTypeValues returns an array of possible values for the IssueType const type. -func PossibleIssueTypeValues() []IssueType { - return []IssueType{CredentialNotWorking, DeviceFailure, DeviceMismatch, ValidationStringMismatch} + return []CopyStatus{Completed, CompletedWithErrors, Failed, InProgress, NotReturned, NotStarted} } // JobDetailsType enumerates the values for job details type. type JobDetailsType string const ( - // JobDetailsTypeDisk ... - JobDetailsTypeDisk JobDetailsType = "Disk" + // JobDetailsTypeDataBox ... + JobDetailsTypeDataBox JobDetailsType = "DataBox" + // JobDetailsTypeDataBoxDisk ... + JobDetailsTypeDataBoxDisk JobDetailsType = "DataBoxDisk" + // JobDetailsTypeDataBoxHeavy ... + JobDetailsTypeDataBoxHeavy JobDetailsType = "DataBoxHeavy" // JobDetailsTypeJobDetails ... JobDetailsTypeJobDetails JobDetailsType = "JobDetails" - // JobDetailsTypePod ... - JobDetailsTypePod JobDetailsType = "Pod" ) // PossibleJobDetailsTypeValues returns an array of possible values for the JobDetailsType const type. func PossibleJobDetailsTypeValues() []JobDetailsType { - return []JobDetailsType{JobDetailsTypeDisk, JobDetailsTypeJobDetails, JobDetailsTypePod} + return []JobDetailsType{JobDetailsTypeDataBox, JobDetailsTypeDataBoxDisk, JobDetailsTypeDataBoxHeavy, JobDetailsTypeJobDetails} } // JobSecretsType enumerates the values for job secrets type. type JobSecretsType string const ( - // JobSecretsTypeCabinet ... - JobSecretsTypeCabinet JobSecretsType = "Cabinet" - // JobSecretsTypeDisk ... - JobSecretsTypeDisk JobSecretsType = "Disk" + // JobSecretsTypeDataBox ... + JobSecretsTypeDataBox JobSecretsType = "DataBox" + // JobSecretsTypeDataBoxDisk ... + JobSecretsTypeDataBoxDisk JobSecretsType = "DataBoxDisk" + // JobSecretsTypeDataBoxHeavy ... + JobSecretsTypeDataBoxHeavy JobSecretsType = "DataBoxHeavy" // JobSecretsTypeJobSecrets ... JobSecretsTypeJobSecrets JobSecretsType = "JobSecrets" - // JobSecretsTypePod ... - JobSecretsTypePod JobSecretsType = "Pod" ) // PossibleJobSecretsTypeValues returns an array of possible values for the JobSecretsType const type. func PossibleJobSecretsTypeValues() []JobSecretsType { - return []JobSecretsType{JobSecretsTypeCabinet, JobSecretsTypeDisk, JobSecretsTypeJobSecrets, JobSecretsTypePod} + return []JobSecretsType{JobSecretsTypeDataBox, JobSecretsTypeDataBoxDisk, JobSecretsTypeDataBoxHeavy, JobSecretsTypeJobSecrets} } // NotificationStageName enumerates the values for notification stage name. type NotificationStageName string const ( - // AtAzureDC ... + // AtAzureDC Notification at device received at azure datacenter stage. AtAzureDC NotificationStageName = "AtAzureDC" - // DataCopy ... + // DataCopy Notification at data copy started stage. DataCopy NotificationStageName = "DataCopy" - // Delivered ... + // Delivered Notification at device delivered stage. Delivered NotificationStageName = "Delivered" - // DevicePrepared ... + // DevicePrepared Notification at device prepared stage. DevicePrepared NotificationStageName = "DevicePrepared" - // Dispatched ... + // Dispatched Notification at device dispatched stage. Dispatched NotificationStageName = "Dispatched" - // PickedUp ... + // PickedUp Notification at device picked up from user stage. PickedUp NotificationStageName = "PickedUp" ) @@ -214,35 +178,94 @@ func PossibleNotificationStageNameValues() []NotificationStageName { return []NotificationStageName{AtAzureDC, DataCopy, Delivered, DevicePrepared, Dispatched, PickedUp} } +// ShareDestinationFormatType enumerates the values for share destination format type. +type ShareDestinationFormatType string + +const ( + // AzureFile Azure storage file format. + AzureFile ShareDestinationFormatType = "AzureFile" + // BlockBlob Azure storage block blob format. + BlockBlob ShareDestinationFormatType = "BlockBlob" + // HCS Storsimple data format. + HCS ShareDestinationFormatType = "HCS" + // PageBlob Azure storage page blob format. + PageBlob ShareDestinationFormatType = "PageBlob" + // UnknownType Unknown format. + UnknownType ShareDestinationFormatType = "UnknownType" +) + +// PossibleShareDestinationFormatTypeValues returns an array of possible values for the ShareDestinationFormatType const type. +func PossibleShareDestinationFormatTypeValues() []ShareDestinationFormatType { + return []ShareDestinationFormatType{AzureFile, BlockBlob, HCS, PageBlob, UnknownType} +} + +// SkuDisabledReason enumerates the values for sku disabled reason. +type SkuDisabledReason string + +const ( + // SkuDisabledReasonCountry SKU is not available in the requested country. + SkuDisabledReasonCountry SkuDisabledReason = "Country" + // SkuDisabledReasonFeature Required features are not enabled for the SKU. + SkuDisabledReasonFeature SkuDisabledReason = "Feature" + // SkuDisabledReasonNone SKU is not disabled. + SkuDisabledReasonNone SkuDisabledReason = "None" + // SkuDisabledReasonOfferType Subscription does not have required offer types for the SKU. + SkuDisabledReasonOfferType SkuDisabledReason = "OfferType" + // SkuDisabledReasonRegion SKU is not available to push data to the requested storage account region. + SkuDisabledReasonRegion SkuDisabledReason = "Region" +) + +// PossibleSkuDisabledReasonValues returns an array of possible values for the SkuDisabledReason const type. +func PossibleSkuDisabledReasonValues() []SkuDisabledReason { + return []SkuDisabledReason{SkuDisabledReasonCountry, SkuDisabledReasonFeature, SkuDisabledReasonNone, SkuDisabledReasonOfferType, SkuDisabledReasonRegion} +} + +// SkuName enumerates the values for sku name. +type SkuName string + +const ( + // DataBox Databox. + DataBox SkuName = "DataBox" + // DataBoxDisk DataboxDisk. + DataBoxDisk SkuName = "DataBoxDisk" + // DataBoxHeavy DataboxHeavy. + DataBoxHeavy SkuName = "DataBoxHeavy" +) + +// PossibleSkuNameValues returns an array of possible values for the SkuName const type. +func PossibleSkuNameValues() []SkuName { + return []SkuName{DataBox, DataBoxDisk, DataBoxHeavy} +} + // StageName enumerates the values for stage name. type StageName string const ( - // StageNameAborted ... + // StageNameAborted Order has been aborted. StageNameAborted StageName = "Aborted" - // StageNameAtAzureDC ... + // StageNameAtAzureDC Device has been received at azure datacenter from the user. StageNameAtAzureDC StageName = "AtAzureDC" - // StageNameCancelled ... + // StageNameCancelled Order has been cancelled. StageNameCancelled StageName = "Cancelled" - // StageNameCompleted ... + // StageNameCompleted Order has completed. StageNameCompleted StageName = "Completed" - // StageNameCompletedWithErrors ... + // StageNameCompletedWithErrors Order has completed with errors. StageNameCompletedWithErrors StageName = "CompletedWithErrors" - // StageNameDataCopy ... + // StageNameDataCopy Data copy from the device at azure datacenter. StageNameDataCopy StageName = "DataCopy" - // StageNameDelivered ... + // StageNameDelivered Device has been delivered to the user of the order. StageNameDelivered StageName = "Delivered" - // StageNameDeviceOrdered ... + // StageNameDeviceOrdered An order has been created. StageNameDeviceOrdered StageName = "DeviceOrdered" - // StageNameDevicePrepared ... + // StageNameDevicePrepared A device has been prepared for the order. StageNameDevicePrepared StageName = "DevicePrepared" - // StageNameDispatched ... + // StageNameDispatched Device has been dispatched to the user of the order. StageNameDispatched StageName = "Dispatched" - // StageNameFailedIssueDetectedAtAzureDC ... + // StageNameFailedIssueDetectedAtAzureDC Order has failed due to issue detected at azure datacenter. StageNameFailedIssueDetectedAtAzureDC StageName = "Failed_IssueDetectedAtAzureDC" - // StageNameFailedIssueReportedAtCustomer ... + // StageNameFailedIssueReportedAtCustomer Order has failed due to issue reported by user. StageNameFailedIssueReportedAtCustomer StageName = "Failed_IssueReportedAtCustomer" - // StageNamePickedUp ... + // StageNamePickedUp Device has been picked up from user and in transit to azure datacenter. StageNamePickedUp StageName = "PickedUp" ) @@ -255,19 +278,19 @@ func PossibleStageNameValues() []StageName { type StageStatus string const ( - // StageStatusCancelled ... + // StageStatusCancelled Stage has been cancelled. StageStatusCancelled StageStatus = "Cancelled" - // StageStatusCancelling ... + // StageStatusCancelling Stage is cancelling. StageStatusCancelling StageStatus = "Cancelling" - // StageStatusFailed ... + // StageStatusFailed Stage has failed. StageStatusFailed StageStatus = "Failed" - // StageStatusInProgress ... + // StageStatusInProgress Stage is in progress. StageStatusInProgress StageStatus = "InProgress" - // StageStatusNone ... + // StageStatusNone No status available yet. StageStatusNone StageStatus = "None" - // StageStatusSucceeded ... + // StageStatusSucceeded Stage has succeeded. StageStatusSucceeded StageStatus = "Succeeded" - // StageStatusSucceededWithErrors ... + // StageStatusSucceededWithErrors Stage has succeeded with errors. StageStatusSucceededWithErrors StageStatus = "SucceededWithErrors" ) @@ -276,19 +299,19 @@ func PossibleStageStatusValues() []StageStatus { return []StageStatus{StageStatusCancelled, StageStatusCancelling, StageStatusFailed, StageStatusInProgress, StageStatusNone, StageStatusSucceeded, StageStatusSucceededWithErrors} } -// AccountCopyLogDetails copy log details for an storage account +// AccountCopyLogDetails copy log details for a storage account of a DataBox job type AccountCopyLogDetails struct { // AccountName - Destination account name. AccountName *string `json:"accountName,omitempty"` // CopyLogLink - Link for copy logs. CopyLogLink *string `json:"copyLogLink,omitempty"` - // CopyLogDetailsType - Possible values include: 'CopyLogDetailsTypeCopyLogDetails', 'CopyLogDetailsTypePod', 'CopyLogDetailsTypeDisk' + // CopyLogDetailsType - Possible values include: 'CopyLogDetailsTypeCopyLogDetails', 'CopyLogDetailsTypeDataBox', 'CopyLogDetailsTypeDataBoxDisk', 'CopyLogDetailsTypeDataBoxHeavy' CopyLogDetailsType CopyLogDetailsType `json:"copyLogDetailsType,omitempty"` } // MarshalJSON is the custom marshaler for AccountCopyLogDetails. func (acld AccountCopyLogDetails) MarshalJSON() ([]byte, error) { - acld.CopyLogDetailsType = CopyLogDetailsTypePod + acld.CopyLogDetailsType = CopyLogDetailsTypeDataBox objectMap := make(map[string]interface{}) if acld.AccountName != nil { objectMap["accountName"] = acld.AccountName @@ -312,6 +335,11 @@ func (acld AccountCopyLogDetails) AsDiskCopyLogDetails() (*DiskCopyLogDetails, b return nil, false } +// AsHeavyAccountCopyLogDetails is the BasicCopyLogDetails implementation for AccountCopyLogDetails. +func (acld AccountCopyLogDetails) AsHeavyAccountCopyLogDetails() (*HeavyAccountCopyLogDetails, bool) { + return nil, false +} + // AsCopyLogDetails is the BasicCopyLogDetails implementation for AccountCopyLogDetails. func (acld AccountCopyLogDetails) AsCopyLogDetails() (*CopyLogDetails, bool) { return nil, false @@ -326,6 +354,8 @@ func (acld AccountCopyLogDetails) AsBasicCopyLogDetails() (BasicCopyLogDetails, type AccountCredentialDetails struct { // AccountName - Name of the account. AccountName *string `json:"accountName,omitempty"` + // AccountConnectionString - Connection string of the account endpoint to use the account as a storage endpoint on the device. + AccountConnectionString *string `json:"accountConnectionString,omitempty"` // ShareCredentialDetails - Per share level unencrypted access credentials. ShareCredentialDetails *[]ShareCredentialDetails `json:"shareCredentialDetails,omitempty"` } @@ -378,6 +408,14 @@ type AddressValidationProperties struct { AlternateAddresses *[]ShippingAddress `json:"alternateAddresses,omitempty"` } +// ApplianceNetworkConfiguration the Network Adapter configuration of a DataBox. +type ApplianceNetworkConfiguration struct { + // Name - Name of the network. + Name *string `json:"name,omitempty"` + // MacAddress - Mac Address. + MacAddress *string `json:"macAddress,omitempty"` +} + // ArmBaseObject base class for all objects under resource. type ArmBaseObject struct { // Name - Name of the object. @@ -396,6 +434,8 @@ type AvailableSkuRequest struct { Country *string `json:"country,omitempty"` // Location - Location for data transfer. For locations check: https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01 Location *string `json:"location,omitempty"` + // SkuNames - Sku Names to filter for available skus + SkuNames *[]SkuName `json:"skuNames,omitempty"` } // AvailableSkusResult the available skus operation response. @@ -500,62 +540,6 @@ func (page AvailableSkusResultPage) Values() []SkuInformation { return *page.asr.Value } -// CabinetJobSecrets the secrets related to a cabinet job. -type CabinetJobSecrets struct { - // CabinetPodSecrets - Contains the list of secret objects for a cabinet job. - CabinetPodSecrets *[]CabinetPodSecret `json:"cabinetPodSecrets,omitempty"` - // JobSecretsType - Possible values include: 'JobSecretsTypeJobSecrets', 'JobSecretsTypeCabinet', 'JobSecretsTypeDisk', 'JobSecretsTypePod' - JobSecretsType JobSecretsType `json:"jobSecretsType,omitempty"` -} - -// MarshalJSON is the custom marshaler for CabinetJobSecrets. -func (cjs CabinetJobSecrets) MarshalJSON() ([]byte, error) { - cjs.JobSecretsType = JobSecretsTypeCabinet - objectMap := make(map[string]interface{}) - if cjs.CabinetPodSecrets != nil { - objectMap["cabinetPodSecrets"] = cjs.CabinetPodSecrets - } - if cjs.JobSecretsType != "" { - objectMap["jobSecretsType"] = cjs.JobSecretsType - } - return json.Marshal(objectMap) -} - -// AsCabinetJobSecrets is the BasicJobSecrets implementation for CabinetJobSecrets. -func (cjs CabinetJobSecrets) AsCabinetJobSecrets() (*CabinetJobSecrets, bool) { - return &cjs, true -} - -// AsDiskJobSecrets is the BasicJobSecrets implementation for CabinetJobSecrets. -func (cjs CabinetJobSecrets) AsDiskJobSecrets() (*DiskJobSecrets, bool) { - return nil, false -} - -// AsPodJobSecrets is the BasicJobSecrets implementation for CabinetJobSecrets. -func (cjs CabinetJobSecrets) AsPodJobSecrets() (*PodJobSecrets, bool) { - return nil, false -} - -// AsJobSecrets is the BasicJobSecrets implementation for CabinetJobSecrets. -func (cjs CabinetJobSecrets) AsJobSecrets() (*JobSecrets, bool) { - return nil, false -} - -// AsBasicJobSecrets is the BasicJobSecrets implementation for CabinetJobSecrets. -func (cjs CabinetJobSecrets) AsBasicJobSecrets() (BasicJobSecrets, bool) { - return &cjs, true -} - -// CabinetPodSecret the secrets related to a cabinet pod. -type CabinetPodSecret struct { - // DeviceSerialNumber - Serial number of the assigned device. - DeviceSerialNumber *string `json:"deviceSerialNumber,omitempty"` - // DevicePassword - Password for out of the box experience on device. - DevicePassword *string `json:"devicePassword,omitempty"` - // AccountCredentialDetails - Per account level access credentials. - AccountCredentialDetails *[]AccountCredentialDetails `json:"accountCredentialDetails,omitempty"` -} - // CancellationReason reason for cancellation. type CancellationReason struct { // Reason - Reason for cancellation. @@ -582,12 +566,13 @@ type ContactDetails struct { type BasicCopyLogDetails interface { AsAccountCopyLogDetails() (*AccountCopyLogDetails, bool) AsDiskCopyLogDetails() (*DiskCopyLogDetails, bool) + AsHeavyAccountCopyLogDetails() (*HeavyAccountCopyLogDetails, bool) AsCopyLogDetails() (*CopyLogDetails, bool) } // CopyLogDetails details for log generated during copy. type CopyLogDetails struct { - // CopyLogDetailsType - Possible values include: 'CopyLogDetailsTypeCopyLogDetails', 'CopyLogDetailsTypePod', 'CopyLogDetailsTypeDisk' + // CopyLogDetailsType - Possible values include: 'CopyLogDetailsTypeCopyLogDetails', 'CopyLogDetailsTypeDataBox', 'CopyLogDetailsTypeDataBoxDisk', 'CopyLogDetailsTypeDataBoxHeavy' CopyLogDetailsType CopyLogDetailsType `json:"copyLogDetailsType,omitempty"` } @@ -599,14 +584,18 @@ func unmarshalBasicCopyLogDetails(body []byte) (BasicCopyLogDetails, error) { } switch m["copyLogDetailsType"] { - case string(CopyLogDetailsTypePod): + case string(CopyLogDetailsTypeDataBox): var acld AccountCopyLogDetails err := json.Unmarshal(body, &acld) return acld, err - case string(CopyLogDetailsTypeDisk): + case string(CopyLogDetailsTypeDataBoxDisk): var dcld DiskCopyLogDetails err := json.Unmarshal(body, &dcld) return dcld, err + case string(CopyLogDetailsTypeDataBoxHeavy): + var hacld HeavyAccountCopyLogDetails + err := json.Unmarshal(body, &hacld) + return hacld, err default: var cld CopyLogDetails err := json.Unmarshal(body, &cld) @@ -652,6 +641,11 @@ func (cld CopyLogDetails) AsDiskCopyLogDetails() (*DiskCopyLogDetails, bool) { return nil, false } +// AsHeavyAccountCopyLogDetails is the BasicCopyLogDetails implementation for CopyLogDetails. +func (cld CopyLogDetails) AsHeavyAccountCopyLogDetails() (*HeavyAccountCopyLogDetails, bool) { + return nil, false +} + // AsCopyLogDetails is the BasicCopyLogDetails implementation for CopyLogDetails. func (cld CopyLogDetails) AsCopyLogDetails() (*CopyLogDetails, bool) { return &cld, true @@ -666,6 +660,8 @@ func (cld CopyLogDetails) AsBasicCopyLogDetails() (BasicCopyLogDetails, bool) { type CopyProgress struct { // StorageAccountName - Name of the storage account where the data needs to be uploaded. StorageAccountName *string `json:"storageAccountName,omitempty"` + // AccountID - Id of the account where the data needs to be uploaded. + AccountID *string `json:"accountId,omitempty"` // BytesSentToCloud - Amount of data uploaded by the job as of now. BytesSentToCloud *int64 `json:"bytesSentToCloud,omitempty"` // TotalBytesToProcess - Total amount of data to be processed by the job. @@ -694,13 +690,13 @@ type DiskCopyLogDetails struct { ErrorLogLink *string `json:"errorLogLink,omitempty"` // VerboseLogLink - Link for copy verbose logs. VerboseLogLink *string `json:"verboseLogLink,omitempty"` - // CopyLogDetailsType - Possible values include: 'CopyLogDetailsTypeCopyLogDetails', 'CopyLogDetailsTypePod', 'CopyLogDetailsTypeDisk' + // CopyLogDetailsType - Possible values include: 'CopyLogDetailsTypeCopyLogDetails', 'CopyLogDetailsTypeDataBox', 'CopyLogDetailsTypeDataBoxDisk', 'CopyLogDetailsTypeDataBoxHeavy' CopyLogDetailsType CopyLogDetailsType `json:"copyLogDetailsType,omitempty"` } // MarshalJSON is the custom marshaler for DiskCopyLogDetails. func (dcld DiskCopyLogDetails) MarshalJSON() ([]byte, error) { - dcld.CopyLogDetailsType = CopyLogDetailsTypeDisk + dcld.CopyLogDetailsType = CopyLogDetailsTypeDataBoxDisk objectMap := make(map[string]interface{}) if dcld.DiskSerialNumber != nil { objectMap["diskSerialNumber"] = dcld.DiskSerialNumber @@ -727,6 +723,11 @@ func (dcld DiskCopyLogDetails) AsDiskCopyLogDetails() (*DiskCopyLogDetails, bool return &dcld, true } +// AsHeavyAccountCopyLogDetails is the BasicCopyLogDetails implementation for DiskCopyLogDetails. +func (dcld DiskCopyLogDetails) AsHeavyAccountCopyLogDetails() (*HeavyAccountCopyLogDetails, bool) { + return nil, false +} + // AsCopyLogDetails is the BasicCopyLogDetails implementation for DiskCopyLogDetails. func (dcld DiskCopyLogDetails) AsCopyLogDetails() (*CopyLogDetails, bool) { return nil, false @@ -737,17 +738,19 @@ func (dcld DiskCopyLogDetails) AsBasicCopyLogDetails() (BasicCopyLogDetails, boo return &dcld, true } -// DiskCopyProgress disk Copy Progress +// DiskCopyProgress dataBox Disk Copy Progress type DiskCopyProgress struct { // SerialNumber - The serial number of the disk SerialNumber *string `json:"serialNumber,omitempty"` + // BytesCopied - Bytes copied during the copy of disk. + BytesCopied *int64 `json:"bytesCopied,omitempty"` // PercentComplete - Indicates the percentage completed for the copy of the disk. PercentComplete *int32 `json:"percentComplete,omitempty"` - // Status - The Status of the copy. Possible values include: 'NotStarted', 'InProgress', 'Completed', 'CompletedWithErrors', 'Failed' + // Status - The Status of the copy. Possible values include: 'NotStarted', 'InProgress', 'Completed', 'CompletedWithErrors', 'Failed', 'NotReturned' Status CopyStatus `json:"status,omitempty"` } -// DiskJobDetails disk Job Details. +// DiskJobDetails dataBox Disk Job Details. type DiskJobDetails struct { // 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. PreferredDisks map[string]*int32 `json:"preferredDisks"` @@ -755,6 +758,8 @@ type DiskJobDetails struct { CopyProgress *[]DiskCopyProgress `json:"copyProgress,omitempty"` // DisksAndSizeDetails - 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. DisksAndSizeDetails map[string]*int32 `json:"disksAndSizeDetails"` + // Passkey - User entered passkey for DataBox Disk job. + Passkey *string `json:"passkey,omitempty"` // ExpectedDataSizeInTeraBytes - The expected size of the data, which needs to be transfered in this job, in tera bytes. ExpectedDataSizeInTeraBytes *int32 `json:"expectedDataSizeInTeraBytes,omitempty"` // JobStages - List of stages that run in the job. @@ -763,15 +768,29 @@ type DiskJobDetails struct { ContactDetails *ContactDetails `json:"contactDetails,omitempty"` // ShippingAddress - Shipping address of the customer. ShippingAddress *ShippingAddress `json:"shippingAddress,omitempty"` + // DeliveryPackage - Delivery package shipping details. + DeliveryPackage *PackageShippingDetails `json:"deliveryPackage,omitempty"` + // ReturnPackage - Return package shipping details. + ReturnPackage *PackageShippingDetails `json:"returnPackage,omitempty"` + // DestinationAccountDetails - Destination account details. + DestinationAccountDetails *[]DestinationAccountDetails `json:"destinationAccountDetails,omitempty"` // ErrorDetails - Error details for failure. This is optional. ErrorDetails *[]JobErrorDetails `json:"errorDetails,omitempty"` - // JobDetailsType - Possible values include: 'JobDetailsTypeJobDetails', 'JobDetailsTypeDisk', 'JobDetailsTypePod' + // Preferences - Preferences for the order. + Preferences *Preferences `json:"preferences,omitempty"` + // CopyLogDetails - List of copy log details. + CopyLogDetails *[]BasicCopyLogDetails `json:"copyLogDetails,omitempty"` + // ReverseShipmentLabelSasKey - Shared access key to download the return shipment label + ReverseShipmentLabelSasKey *string `json:"reverseShipmentLabelSasKey,omitempty"` + // ChainOfCustodySasKey - Shared access key to download the chain of custody logs + ChainOfCustodySasKey *string `json:"chainOfCustodySasKey,omitempty"` + // JobDetailsType - Possible values include: 'JobDetailsTypeJobDetails', 'JobDetailsTypeDataBoxDisk', 'JobDetailsTypeDataBoxHeavy', 'JobDetailsTypeDataBox' JobDetailsType JobDetailsType `json:"jobDetailsType,omitempty"` } // MarshalJSON is the custom marshaler for DiskJobDetails. func (djd DiskJobDetails) MarshalJSON() ([]byte, error) { - djd.JobDetailsType = JobDetailsTypeDisk + djd.JobDetailsType = JobDetailsTypeDataBoxDisk objectMap := make(map[string]interface{}) if djd.PreferredDisks != nil { objectMap["preferredDisks"] = djd.PreferredDisks @@ -782,6 +801,9 @@ func (djd DiskJobDetails) MarshalJSON() ([]byte, error) { if djd.DisksAndSizeDetails != nil { objectMap["disksAndSizeDetails"] = djd.DisksAndSizeDetails } + if djd.Passkey != nil { + objectMap["passkey"] = djd.Passkey + } if djd.ExpectedDataSizeInTeraBytes != nil { objectMap["expectedDataSizeInTeraBytes"] = djd.ExpectedDataSizeInTeraBytes } @@ -794,9 +816,30 @@ func (djd DiskJobDetails) MarshalJSON() ([]byte, error) { if djd.ShippingAddress != nil { objectMap["shippingAddress"] = djd.ShippingAddress } + if djd.DeliveryPackage != nil { + objectMap["deliveryPackage"] = djd.DeliveryPackage + } + if djd.ReturnPackage != nil { + objectMap["returnPackage"] = djd.ReturnPackage + } + if djd.DestinationAccountDetails != nil { + objectMap["destinationAccountDetails"] = djd.DestinationAccountDetails + } if djd.ErrorDetails != nil { objectMap["errorDetails"] = djd.ErrorDetails } + if djd.Preferences != nil { + objectMap["preferences"] = djd.Preferences + } + if djd.CopyLogDetails != nil { + objectMap["copyLogDetails"] = djd.CopyLogDetails + } + if djd.ReverseShipmentLabelSasKey != nil { + objectMap["reverseShipmentLabelSasKey"] = djd.ReverseShipmentLabelSasKey + } + if djd.ChainOfCustodySasKey != nil { + objectMap["chainOfCustodySasKey"] = djd.ChainOfCustodySasKey + } if djd.JobDetailsType != "" { objectMap["jobDetailsType"] = djd.JobDetailsType } @@ -808,8 +851,13 @@ func (djd DiskJobDetails) AsDiskJobDetails() (*DiskJobDetails, bool) { return &djd, true } -// AsPodJobDetails is the BasicJobDetails implementation for DiskJobDetails. -func (djd DiskJobDetails) AsPodJobDetails() (*PodJobDetails, bool) { +// AsHeavyJobDetails is the BasicJobDetails implementation for DiskJobDetails. +func (djd DiskJobDetails) AsHeavyJobDetails() (*HeavyJobDetails, bool) { + return nil, false +} + +// AsJobDetailsType is the BasicJobDetails implementation for DiskJobDetails. +func (djd DiskJobDetails) AsJobDetailsType() (*JobDetailsType, bool) { return nil, false } @@ -823,39 +871,216 @@ func (djd DiskJobDetails) AsBasicJobDetails() (BasicJobDetails, bool) { return &djd, true } +// UnmarshalJSON is the custom unmarshaler for DiskJobDetails struct. +func (djd *DiskJobDetails) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "preferredDisks": + if v != nil { + var preferredDisks map[string]*int32 + err = json.Unmarshal(*v, &preferredDisks) + if err != nil { + return err + } + djd.PreferredDisks = preferredDisks + } + case "copyProgress": + if v != nil { + var copyProgress []DiskCopyProgress + err = json.Unmarshal(*v, ©Progress) + if err != nil { + return err + } + djd.CopyProgress = ©Progress + } + case "disksAndSizeDetails": + if v != nil { + var disksAndSizeDetails map[string]*int32 + err = json.Unmarshal(*v, &disksAndSizeDetails) + if err != nil { + return err + } + djd.DisksAndSizeDetails = disksAndSizeDetails + } + case "passkey": + if v != nil { + var passkey string + err = json.Unmarshal(*v, &passkey) + if err != nil { + return err + } + djd.Passkey = &passkey + } + case "expectedDataSizeInTeraBytes": + if v != nil { + var expectedDataSizeInTeraBytes int32 + err = json.Unmarshal(*v, &expectedDataSizeInTeraBytes) + if err != nil { + return err + } + djd.ExpectedDataSizeInTeraBytes = &expectedDataSizeInTeraBytes + } + case "jobStages": + if v != nil { + var jobStages []JobStages + err = json.Unmarshal(*v, &jobStages) + if err != nil { + return err + } + djd.JobStages = &jobStages + } + case "contactDetails": + if v != nil { + var contactDetails ContactDetails + err = json.Unmarshal(*v, &contactDetails) + if err != nil { + return err + } + djd.ContactDetails = &contactDetails + } + case "shippingAddress": + if v != nil { + var shippingAddress ShippingAddress + err = json.Unmarshal(*v, &shippingAddress) + if err != nil { + return err + } + djd.ShippingAddress = &shippingAddress + } + case "deliveryPackage": + if v != nil { + var deliveryPackage PackageShippingDetails + err = json.Unmarshal(*v, &deliveryPackage) + if err != nil { + return err + } + djd.DeliveryPackage = &deliveryPackage + } + case "returnPackage": + if v != nil { + var returnPackage PackageShippingDetails + err = json.Unmarshal(*v, &returnPackage) + if err != nil { + return err + } + djd.ReturnPackage = &returnPackage + } + case "destinationAccountDetails": + if v != nil { + var destinationAccountDetails []DestinationAccountDetails + err = json.Unmarshal(*v, &destinationAccountDetails) + if err != nil { + return err + } + djd.DestinationAccountDetails = &destinationAccountDetails + } + case "errorDetails": + if v != nil { + var errorDetails []JobErrorDetails + err = json.Unmarshal(*v, &errorDetails) + if err != nil { + return err + } + djd.ErrorDetails = &errorDetails + } + case "preferences": + if v != nil { + var preferences Preferences + err = json.Unmarshal(*v, &preferences) + if err != nil { + return err + } + djd.Preferences = &preferences + } + case "copyLogDetails": + if v != nil { + copyLogDetails, err := unmarshalBasicCopyLogDetailsArray(*v) + if err != nil { + return err + } + djd.CopyLogDetails = ©LogDetails + } + case "reverseShipmentLabelSasKey": + if v != nil { + var reverseShipmentLabelSasKey string + err = json.Unmarshal(*v, &reverseShipmentLabelSasKey) + if err != nil { + return err + } + djd.ReverseShipmentLabelSasKey = &reverseShipmentLabelSasKey + } + case "chainOfCustodySasKey": + if v != nil { + var chainOfCustodySasKey string + err = json.Unmarshal(*v, &chainOfCustodySasKey) + if err != nil { + return err + } + djd.ChainOfCustodySasKey = &chainOfCustodySasKey + } + case "jobDetailsType": + if v != nil { + var jobDetailsType JobDetailsType + err = json.Unmarshal(*v, &jobDetailsType) + if err != nil { + return err + } + djd.JobDetailsType = jobDetailsType + } + } + } + + return nil +} + // DiskJobSecrets the secrets related to disk job. type DiskJobSecrets struct { // DiskSecrets - Contains the list of secrets object for that device. DiskSecrets *[]DiskSecret `json:"diskSecrets,omitempty"` - // JobSecretsType - Possible values include: 'JobSecretsTypeJobSecrets', 'JobSecretsTypeCabinet', 'JobSecretsTypeDisk', 'JobSecretsTypePod' + // PassKey - PassKey for the disk Job. + PassKey *string `json:"passKey,omitempty"` + // IsPasskeyUserDefined - Whether passkey was provided by user. + IsPasskeyUserDefined *bool `json:"isPasskeyUserDefined,omitempty"` + // JobSecretsType - Possible values include: 'JobSecretsTypeJobSecrets', 'JobSecretsTypeDataBoxDisk', 'JobSecretsTypeDataBoxHeavy', 'JobSecretsTypeDataBox' JobSecretsType JobSecretsType `json:"jobSecretsType,omitempty"` } // MarshalJSON is the custom marshaler for DiskJobSecrets. func (djs DiskJobSecrets) MarshalJSON() ([]byte, error) { - djs.JobSecretsType = JobSecretsTypeDisk + djs.JobSecretsType = JobSecretsTypeDataBoxDisk objectMap := make(map[string]interface{}) if djs.DiskSecrets != nil { objectMap["diskSecrets"] = djs.DiskSecrets } + if djs.PassKey != nil { + objectMap["passKey"] = djs.PassKey + } + if djs.IsPasskeyUserDefined != nil { + objectMap["isPasskeyUserDefined"] = djs.IsPasskeyUserDefined + } if djs.JobSecretsType != "" { objectMap["jobSecretsType"] = djs.JobSecretsType } return json.Marshal(objectMap) } -// AsCabinetJobSecrets is the BasicJobSecrets implementation for DiskJobSecrets. -func (djs DiskJobSecrets) AsCabinetJobSecrets() (*CabinetJobSecrets, bool) { - return nil, false -} - // AsDiskJobSecrets is the BasicJobSecrets implementation for DiskJobSecrets. func (djs DiskJobSecrets) AsDiskJobSecrets() (*DiskJobSecrets, bool) { return &djs, true } -// AsPodJobSecrets is the BasicJobSecrets implementation for DiskJobSecrets. -func (djs DiskJobSecrets) AsPodJobSecrets() (*PodJobSecrets, bool) { +// AsHeavyJobSecrets is the BasicJobSecrets implementation for DiskJobSecrets. +func (djs DiskJobSecrets) AsHeavyJobSecrets() (*HeavyJobSecrets, bool) { + return nil, false +} + +// AsJobSecretsType is the BasicJobSecrets implementation for DiskJobSecrets. +func (djs DiskJobSecrets) AsJobSecretsType() (*JobSecretsType, bool) { return nil, false } @@ -885,51 +1110,368 @@ type Error struct { Message *string `json:"message,omitempty"` } -// GetCopyLogsURIOutput output for the GetCopyLogsUri. -type GetCopyLogsURIOutput struct { - autorest.Response `json:"-"` - // LogType - Type/Level of the log. - LogType *string `json:"logType,omitempty"` - // CopyLogDetails - List of copy log details. - CopyLogDetails *[]BasicCopyLogDetails `json:"copyLogDetails,omitempty"` +// HeavyAccountCopyLogDetails copy log details for a storage account for Databox heavy +type HeavyAccountCopyLogDetails struct { + // AccountName - Destination account name. + AccountName *string `json:"accountName,omitempty"` + // CopyLogLink - Link for copy logs. + CopyLogLink *[]string `json:"copyLogLink,omitempty"` + // CopyLogDetailsType - Possible values include: 'CopyLogDetailsTypeCopyLogDetails', 'CopyLogDetailsTypeDataBox', 'CopyLogDetailsTypeDataBoxDisk', 'CopyLogDetailsTypeDataBoxHeavy' + CopyLogDetailsType CopyLogDetailsType `json:"copyLogDetailsType,omitempty"` } -// UnmarshalJSON is the custom unmarshaler for GetCopyLogsURIOutput struct. -func (gcluo *GetCopyLogsURIOutput) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err +// MarshalJSON is the custom marshaler for HeavyAccountCopyLogDetails. +func (hacld HeavyAccountCopyLogDetails) MarshalJSON() ([]byte, error) { + hacld.CopyLogDetailsType = CopyLogDetailsTypeDataBoxHeavy + objectMap := make(map[string]interface{}) + if hacld.AccountName != nil { + objectMap["accountName"] = hacld.AccountName } - for k, v := range m { - switch k { - case "logType": - if v != nil { - var logType string - err = json.Unmarshal(*v, &logType) - if err != nil { - return err - } - gcluo.LogType = &logType - } - case "copyLogDetails": - if v != nil { - copyLogDetails, err := unmarshalBasicCopyLogDetailsArray(*v) - if err != nil { - return err - } - gcluo.CopyLogDetails = ©LogDetails - } - } + if hacld.CopyLogLink != nil { + objectMap["copyLogLink"] = hacld.CopyLogLink } + if hacld.CopyLogDetailsType != "" { + objectMap["copyLogDetailsType"] = hacld.CopyLogDetailsType + } + return json.Marshal(objectMap) +} - return nil +// AsAccountCopyLogDetails is the BasicCopyLogDetails implementation for HeavyAccountCopyLogDetails. +func (hacld HeavyAccountCopyLogDetails) AsAccountCopyLogDetails() (*AccountCopyLogDetails, bool) { + return nil, false } -// BasicJobDetails job details. -type BasicJobDetails interface { - AsDiskJobDetails() (*DiskJobDetails, bool) - AsPodJobDetails() (*PodJobDetails, bool) +// AsDiskCopyLogDetails is the BasicCopyLogDetails implementation for HeavyAccountCopyLogDetails. +func (hacld HeavyAccountCopyLogDetails) AsDiskCopyLogDetails() (*DiskCopyLogDetails, bool) { + return nil, false +} + +// AsHeavyAccountCopyLogDetails is the BasicCopyLogDetails implementation for HeavyAccountCopyLogDetails. +func (hacld HeavyAccountCopyLogDetails) AsHeavyAccountCopyLogDetails() (*HeavyAccountCopyLogDetails, bool) { + return &hacld, true +} + +// AsCopyLogDetails is the BasicCopyLogDetails implementation for HeavyAccountCopyLogDetails. +func (hacld HeavyAccountCopyLogDetails) AsCopyLogDetails() (*CopyLogDetails, bool) { + return nil, false +} + +// AsBasicCopyLogDetails is the BasicCopyLogDetails implementation for HeavyAccountCopyLogDetails. +func (hacld HeavyAccountCopyLogDetails) AsBasicCopyLogDetails() (BasicCopyLogDetails, bool) { + return &hacld, true +} + +// HeavyJobDetails databox Heavy Device Job Details +type HeavyJobDetails struct { + // CopyProgress - Copy progress per account. + CopyProgress *[]CopyProgress `json:"copyProgress,omitempty"` + // ExpectedDataSizeInTeraBytes - The expected size of the data, which needs to be transfered in this job, in tera bytes. + ExpectedDataSizeInTeraBytes *int32 `json:"expectedDataSizeInTeraBytes,omitempty"` + // JobStages - List of stages that run in the job. + JobStages *[]JobStages `json:"jobStages,omitempty"` + // ContactDetails - Contact details for notification and shipping. + ContactDetails *ContactDetails `json:"contactDetails,omitempty"` + // ShippingAddress - Shipping address of the customer. + ShippingAddress *ShippingAddress `json:"shippingAddress,omitempty"` + // DeliveryPackage - Delivery package shipping details. + DeliveryPackage *PackageShippingDetails `json:"deliveryPackage,omitempty"` + // ReturnPackage - Return package shipping details. + ReturnPackage *PackageShippingDetails `json:"returnPackage,omitempty"` + // DestinationAccountDetails - Destination account details. + DestinationAccountDetails *[]DestinationAccountDetails `json:"destinationAccountDetails,omitempty"` + // ErrorDetails - Error details for failure. This is optional. + ErrorDetails *[]JobErrorDetails `json:"errorDetails,omitempty"` + // Preferences - Preferences for the order. + Preferences *Preferences `json:"preferences,omitempty"` + // CopyLogDetails - List of copy log details. + CopyLogDetails *[]BasicCopyLogDetails `json:"copyLogDetails,omitempty"` + // ReverseShipmentLabelSasKey - Shared access key to download the return shipment label + ReverseShipmentLabelSasKey *string `json:"reverseShipmentLabelSasKey,omitempty"` + // ChainOfCustodySasKey - Shared access key to download the chain of custody logs + ChainOfCustodySasKey *string `json:"chainOfCustodySasKey,omitempty"` + // JobDetailsType - Possible values include: 'JobDetailsTypeJobDetails', 'JobDetailsTypeDataBoxDisk', 'JobDetailsTypeDataBoxHeavy', 'JobDetailsTypeDataBox' + JobDetailsType JobDetailsType `json:"jobDetailsType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HeavyJobDetails. +func (hjd HeavyJobDetails) MarshalJSON() ([]byte, error) { + hjd.JobDetailsType = JobDetailsTypeDataBoxHeavy + objectMap := make(map[string]interface{}) + if hjd.CopyProgress != nil { + objectMap["copyProgress"] = hjd.CopyProgress + } + if hjd.ExpectedDataSizeInTeraBytes != nil { + objectMap["expectedDataSizeInTeraBytes"] = hjd.ExpectedDataSizeInTeraBytes + } + if hjd.JobStages != nil { + objectMap["jobStages"] = hjd.JobStages + } + if hjd.ContactDetails != nil { + objectMap["contactDetails"] = hjd.ContactDetails + } + if hjd.ShippingAddress != nil { + objectMap["shippingAddress"] = hjd.ShippingAddress + } + if hjd.DeliveryPackage != nil { + objectMap["deliveryPackage"] = hjd.DeliveryPackage + } + if hjd.ReturnPackage != nil { + objectMap["returnPackage"] = hjd.ReturnPackage + } + if hjd.DestinationAccountDetails != nil { + objectMap["destinationAccountDetails"] = hjd.DestinationAccountDetails + } + if hjd.ErrorDetails != nil { + objectMap["errorDetails"] = hjd.ErrorDetails + } + if hjd.Preferences != nil { + objectMap["preferences"] = hjd.Preferences + } + if hjd.CopyLogDetails != nil { + objectMap["copyLogDetails"] = hjd.CopyLogDetails + } + if hjd.ReverseShipmentLabelSasKey != nil { + objectMap["reverseShipmentLabelSasKey"] = hjd.ReverseShipmentLabelSasKey + } + if hjd.ChainOfCustodySasKey != nil { + objectMap["chainOfCustodySasKey"] = hjd.ChainOfCustodySasKey + } + if hjd.JobDetailsType != "" { + objectMap["jobDetailsType"] = hjd.JobDetailsType + } + return json.Marshal(objectMap) +} + +// AsDiskJobDetails is the BasicJobDetails implementation for HeavyJobDetails. +func (hjd HeavyJobDetails) AsDiskJobDetails() (*DiskJobDetails, bool) { + return nil, false +} + +// AsHeavyJobDetails is the BasicJobDetails implementation for HeavyJobDetails. +func (hjd HeavyJobDetails) AsHeavyJobDetails() (*HeavyJobDetails, bool) { + return &hjd, true +} + +// AsJobDetailsType is the BasicJobDetails implementation for HeavyJobDetails. +func (hjd HeavyJobDetails) AsJobDetailsType() (*JobDetailsType, bool) { + return nil, false +} + +// AsJobDetails is the BasicJobDetails implementation for HeavyJobDetails. +func (hjd HeavyJobDetails) AsJobDetails() (*JobDetails, bool) { + return nil, false +} + +// AsBasicJobDetails is the BasicJobDetails implementation for HeavyJobDetails. +func (hjd HeavyJobDetails) AsBasicJobDetails() (BasicJobDetails, bool) { + return &hjd, true +} + +// UnmarshalJSON is the custom unmarshaler for HeavyJobDetails struct. +func (hjd *HeavyJobDetails) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "copyProgress": + if v != nil { + var copyProgress []CopyProgress + err = json.Unmarshal(*v, ©Progress) + if err != nil { + return err + } + hjd.CopyProgress = ©Progress + } + case "expectedDataSizeInTeraBytes": + if v != nil { + var expectedDataSizeInTeraBytes int32 + err = json.Unmarshal(*v, &expectedDataSizeInTeraBytes) + if err != nil { + return err + } + hjd.ExpectedDataSizeInTeraBytes = &expectedDataSizeInTeraBytes + } + case "jobStages": + if v != nil { + var jobStages []JobStages + err = json.Unmarshal(*v, &jobStages) + if err != nil { + return err + } + hjd.JobStages = &jobStages + } + case "contactDetails": + if v != nil { + var contactDetails ContactDetails + err = json.Unmarshal(*v, &contactDetails) + if err != nil { + return err + } + hjd.ContactDetails = &contactDetails + } + case "shippingAddress": + if v != nil { + var shippingAddress ShippingAddress + err = json.Unmarshal(*v, &shippingAddress) + if err != nil { + return err + } + hjd.ShippingAddress = &shippingAddress + } + case "deliveryPackage": + if v != nil { + var deliveryPackage PackageShippingDetails + err = json.Unmarshal(*v, &deliveryPackage) + if err != nil { + return err + } + hjd.DeliveryPackage = &deliveryPackage + } + case "returnPackage": + if v != nil { + var returnPackage PackageShippingDetails + err = json.Unmarshal(*v, &returnPackage) + if err != nil { + return err + } + hjd.ReturnPackage = &returnPackage + } + case "destinationAccountDetails": + if v != nil { + var destinationAccountDetails []DestinationAccountDetails + err = json.Unmarshal(*v, &destinationAccountDetails) + if err != nil { + return err + } + hjd.DestinationAccountDetails = &destinationAccountDetails + } + case "errorDetails": + if v != nil { + var errorDetails []JobErrorDetails + err = json.Unmarshal(*v, &errorDetails) + if err != nil { + return err + } + hjd.ErrorDetails = &errorDetails + } + case "preferences": + if v != nil { + var preferences Preferences + err = json.Unmarshal(*v, &preferences) + if err != nil { + return err + } + hjd.Preferences = &preferences + } + case "copyLogDetails": + if v != nil { + copyLogDetails, err := unmarshalBasicCopyLogDetailsArray(*v) + if err != nil { + return err + } + hjd.CopyLogDetails = ©LogDetails + } + case "reverseShipmentLabelSasKey": + if v != nil { + var reverseShipmentLabelSasKey string + err = json.Unmarshal(*v, &reverseShipmentLabelSasKey) + if err != nil { + return err + } + hjd.ReverseShipmentLabelSasKey = &reverseShipmentLabelSasKey + } + case "chainOfCustodySasKey": + if v != nil { + var chainOfCustodySasKey string + err = json.Unmarshal(*v, &chainOfCustodySasKey) + if err != nil { + return err + } + hjd.ChainOfCustodySasKey = &chainOfCustodySasKey + } + case "jobDetailsType": + if v != nil { + var jobDetailsType JobDetailsType + err = json.Unmarshal(*v, &jobDetailsType) + if err != nil { + return err + } + hjd.JobDetailsType = jobDetailsType + } + } + } + + return nil +} + +// HeavyJobSecrets the secrets related to a databox heavy job. +type HeavyJobSecrets struct { + // CabinetPodSecrets - Contains the list of secret objects for a databox heavy job. + CabinetPodSecrets *[]HeavySecret `json:"cabinetPodSecrets,omitempty"` + // JobSecretsType - Possible values include: 'JobSecretsTypeJobSecrets', 'JobSecretsTypeDataBoxDisk', 'JobSecretsTypeDataBoxHeavy', 'JobSecretsTypeDataBox' + JobSecretsType JobSecretsType `json:"jobSecretsType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HeavyJobSecrets. +func (hjs HeavyJobSecrets) MarshalJSON() ([]byte, error) { + hjs.JobSecretsType = JobSecretsTypeDataBoxHeavy + objectMap := make(map[string]interface{}) + if hjs.CabinetPodSecrets != nil { + objectMap["cabinetPodSecrets"] = hjs.CabinetPodSecrets + } + if hjs.JobSecretsType != "" { + objectMap["jobSecretsType"] = hjs.JobSecretsType + } + return json.Marshal(objectMap) +} + +// AsDiskJobSecrets is the BasicJobSecrets implementation for HeavyJobSecrets. +func (hjs HeavyJobSecrets) AsDiskJobSecrets() (*DiskJobSecrets, bool) { + return nil, false +} + +// AsHeavyJobSecrets is the BasicJobSecrets implementation for HeavyJobSecrets. +func (hjs HeavyJobSecrets) AsHeavyJobSecrets() (*HeavyJobSecrets, bool) { + return &hjs, true +} + +// AsJobSecretsType is the BasicJobSecrets implementation for HeavyJobSecrets. +func (hjs HeavyJobSecrets) AsJobSecretsType() (*JobSecretsType, bool) { + return nil, false +} + +// AsJobSecrets is the BasicJobSecrets implementation for HeavyJobSecrets. +func (hjs HeavyJobSecrets) AsJobSecrets() (*JobSecrets, bool) { + return nil, false +} + +// AsBasicJobSecrets is the BasicJobSecrets implementation for HeavyJobSecrets. +func (hjs HeavyJobSecrets) AsBasicJobSecrets() (BasicJobSecrets, bool) { + return &hjs, true +} + +// HeavySecret the secrets related to a databox heavy. +type HeavySecret struct { + // DeviceSerialNumber - Serial number of the assigned device. + DeviceSerialNumber *string `json:"deviceSerialNumber,omitempty"` + // DevicePassword - Password for out of the box experience on device. + DevicePassword *string `json:"devicePassword,omitempty"` + // NetworkConfigurations - Network configuration of the appliance. + NetworkConfigurations *[]ApplianceNetworkConfiguration `json:"networkConfigurations,omitempty"` + // EncodedValidationCertPubKey - The base 64 encoded public key to authenticate with the device + EncodedValidationCertPubKey *string `json:"encodedValidationCertPubKey,omitempty"` + // AccountCredentialDetails - Per account level access credentials. + AccountCredentialDetails *[]AccountCredentialDetails `json:"accountCredentialDetails,omitempty"` +} + +// BasicJobDetails job details. +type BasicJobDetails interface { + AsDiskJobDetails() (*DiskJobDetails, bool) + AsHeavyJobDetails() (*HeavyJobDetails, bool) + AsJobDetailsType() (*JobDetailsType, bool) AsJobDetails() (*JobDetails, bool) } @@ -943,9 +1485,23 @@ type JobDetails struct { ContactDetails *ContactDetails `json:"contactDetails,omitempty"` // ShippingAddress - Shipping address of the customer. ShippingAddress *ShippingAddress `json:"shippingAddress,omitempty"` + // DeliveryPackage - Delivery package shipping details. + DeliveryPackage *PackageShippingDetails `json:"deliveryPackage,omitempty"` + // ReturnPackage - Return package shipping details. + ReturnPackage *PackageShippingDetails `json:"returnPackage,omitempty"` + // DestinationAccountDetails - Destination account details. + DestinationAccountDetails *[]DestinationAccountDetails `json:"destinationAccountDetails,omitempty"` // ErrorDetails - Error details for failure. This is optional. ErrorDetails *[]JobErrorDetails `json:"errorDetails,omitempty"` - // JobDetailsType - Possible values include: 'JobDetailsTypeJobDetails', 'JobDetailsTypeDisk', 'JobDetailsTypePod' + // Preferences - Preferences for the order. + Preferences *Preferences `json:"preferences,omitempty"` + // CopyLogDetails - List of copy log details. + CopyLogDetails *[]BasicCopyLogDetails `json:"copyLogDetails,omitempty"` + // ReverseShipmentLabelSasKey - Shared access key to download the return shipment label + ReverseShipmentLabelSasKey *string `json:"reverseShipmentLabelSasKey,omitempty"` + // ChainOfCustodySasKey - Shared access key to download the chain of custody logs + ChainOfCustodySasKey *string `json:"chainOfCustodySasKey,omitempty"` + // JobDetailsType - Possible values include: 'JobDetailsTypeJobDetails', 'JobDetailsTypeDataBoxDisk', 'JobDetailsTypeDataBoxHeavy', 'JobDetailsTypeDataBox' JobDetailsType JobDetailsType `json:"jobDetailsType,omitempty"` } @@ -957,14 +1513,18 @@ func unmarshalBasicJobDetails(body []byte) (BasicJobDetails, error) { } switch m["jobDetailsType"] { - case string(JobDetailsTypeDisk): + case string(JobDetailsTypeDataBoxDisk): var djd DiskJobDetails err := json.Unmarshal(body, &djd) return djd, err - case string(JobDetailsTypePod): - var pjd PodJobDetails - err := json.Unmarshal(body, &pjd) - return pjd, err + case string(JobDetailsTypeDataBoxHeavy): + var hjd HeavyJobDetails + err := json.Unmarshal(body, &hjd) + return hjd, err + case string(JobDetailsTypeDataBox): + var jdt JobDetailsType + err := json.Unmarshal(body, &jdt) + return jdt, err default: var jd JobDetails err := json.Unmarshal(body, &jd) @@ -985,54 +1545,457 @@ func unmarshalBasicJobDetailsArray(body []byte) ([]BasicJobDetails, error) { if err != nil { return nil, err } - jdArray[index] = jd - } - return jdArray, nil -} - -// MarshalJSON is the custom marshaler for JobDetails. -func (jd JobDetails) MarshalJSON() ([]byte, error) { - jd.JobDetailsType = JobDetailsTypeJobDetails - objectMap := make(map[string]interface{}) - if jd.ExpectedDataSizeInTeraBytes != nil { - objectMap["expectedDataSizeInTeraBytes"] = jd.ExpectedDataSizeInTeraBytes - } - if jd.JobStages != nil { - objectMap["jobStages"] = jd.JobStages - } - if jd.ContactDetails != nil { - objectMap["contactDetails"] = jd.ContactDetails - } - if jd.ShippingAddress != nil { - objectMap["shippingAddress"] = jd.ShippingAddress - } - if jd.ErrorDetails != nil { - objectMap["errorDetails"] = jd.ErrorDetails - } - if jd.JobDetailsType != "" { - objectMap["jobDetailsType"] = jd.JobDetailsType + jdArray[index] = jd + } + return jdArray, nil +} + +// MarshalJSON is the custom marshaler for JobDetails. +func (jd JobDetails) MarshalJSON() ([]byte, error) { + jd.JobDetailsType = JobDetailsTypeJobDetails + objectMap := make(map[string]interface{}) + if jd.ExpectedDataSizeInTeraBytes != nil { + objectMap["expectedDataSizeInTeraBytes"] = jd.ExpectedDataSizeInTeraBytes + } + if jd.JobStages != nil { + objectMap["jobStages"] = jd.JobStages + } + if jd.ContactDetails != nil { + objectMap["contactDetails"] = jd.ContactDetails + } + if jd.ShippingAddress != nil { + objectMap["shippingAddress"] = jd.ShippingAddress + } + if jd.DeliveryPackage != nil { + objectMap["deliveryPackage"] = jd.DeliveryPackage + } + if jd.ReturnPackage != nil { + objectMap["returnPackage"] = jd.ReturnPackage + } + if jd.DestinationAccountDetails != nil { + objectMap["destinationAccountDetails"] = jd.DestinationAccountDetails + } + if jd.ErrorDetails != nil { + objectMap["errorDetails"] = jd.ErrorDetails + } + if jd.Preferences != nil { + objectMap["preferences"] = jd.Preferences + } + if jd.CopyLogDetails != nil { + objectMap["copyLogDetails"] = jd.CopyLogDetails + } + if jd.ReverseShipmentLabelSasKey != nil { + objectMap["reverseShipmentLabelSasKey"] = jd.ReverseShipmentLabelSasKey + } + if jd.ChainOfCustodySasKey != nil { + objectMap["chainOfCustodySasKey"] = jd.ChainOfCustodySasKey + } + if jd.JobDetailsType != "" { + objectMap["jobDetailsType"] = jd.JobDetailsType + } + return json.Marshal(objectMap) +} + +// AsDiskJobDetails is the BasicJobDetails implementation for JobDetails. +func (jd JobDetails) AsDiskJobDetails() (*DiskJobDetails, bool) { + return nil, false +} + +// AsHeavyJobDetails is the BasicJobDetails implementation for JobDetails. +func (jd JobDetails) AsHeavyJobDetails() (*HeavyJobDetails, bool) { + return nil, false +} + +// AsJobDetailsType is the BasicJobDetails implementation for JobDetails. +func (jd JobDetails) AsJobDetailsType() (*JobDetailsType, bool) { + return nil, false +} + +// AsJobDetails is the BasicJobDetails implementation for JobDetails. +func (jd JobDetails) AsJobDetails() (*JobDetails, bool) { + return &jd, true +} + +// AsBasicJobDetails is the BasicJobDetails implementation for JobDetails. +func (jd JobDetails) AsBasicJobDetails() (BasicJobDetails, bool) { + return &jd, true +} + +// UnmarshalJSON is the custom unmarshaler for JobDetails struct. +func (jd *JobDetails) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "expectedDataSizeInTeraBytes": + if v != nil { + var expectedDataSizeInTeraBytes int32 + err = json.Unmarshal(*v, &expectedDataSizeInTeraBytes) + if err != nil { + return err + } + jd.ExpectedDataSizeInTeraBytes = &expectedDataSizeInTeraBytes + } + case "jobStages": + if v != nil { + var jobStages []JobStages + err = json.Unmarshal(*v, &jobStages) + if err != nil { + return err + } + jd.JobStages = &jobStages + } + case "contactDetails": + if v != nil { + var contactDetails ContactDetails + err = json.Unmarshal(*v, &contactDetails) + if err != nil { + return err + } + jd.ContactDetails = &contactDetails + } + case "shippingAddress": + if v != nil { + var shippingAddress ShippingAddress + err = json.Unmarshal(*v, &shippingAddress) + if err != nil { + return err + } + jd.ShippingAddress = &shippingAddress + } + case "deliveryPackage": + if v != nil { + var deliveryPackage PackageShippingDetails + err = json.Unmarshal(*v, &deliveryPackage) + if err != nil { + return err + } + jd.DeliveryPackage = &deliveryPackage + } + case "returnPackage": + if v != nil { + var returnPackage PackageShippingDetails + err = json.Unmarshal(*v, &returnPackage) + if err != nil { + return err + } + jd.ReturnPackage = &returnPackage + } + case "destinationAccountDetails": + if v != nil { + var destinationAccountDetails []DestinationAccountDetails + err = json.Unmarshal(*v, &destinationAccountDetails) + if err != nil { + return err + } + jd.DestinationAccountDetails = &destinationAccountDetails + } + case "errorDetails": + if v != nil { + var errorDetails []JobErrorDetails + err = json.Unmarshal(*v, &errorDetails) + if err != nil { + return err + } + jd.ErrorDetails = &errorDetails + } + case "preferences": + if v != nil { + var preferences Preferences + err = json.Unmarshal(*v, &preferences) + if err != nil { + return err + } + jd.Preferences = &preferences + } + case "copyLogDetails": + if v != nil { + copyLogDetails, err := unmarshalBasicCopyLogDetailsArray(*v) + if err != nil { + return err + } + jd.CopyLogDetails = ©LogDetails + } + case "reverseShipmentLabelSasKey": + if v != nil { + var reverseShipmentLabelSasKey string + err = json.Unmarshal(*v, &reverseShipmentLabelSasKey) + if err != nil { + return err + } + jd.ReverseShipmentLabelSasKey = &reverseShipmentLabelSasKey + } + case "chainOfCustodySasKey": + if v != nil { + var chainOfCustodySasKey string + err = json.Unmarshal(*v, &chainOfCustodySasKey) + if err != nil { + return err + } + jd.ChainOfCustodySasKey = &chainOfCustodySasKey + } + case "jobDetailsType": + if v != nil { + var jobDetailsType JobDetailsType + err = json.Unmarshal(*v, &jobDetailsType) + if err != nil { + return err + } + jd.JobDetailsType = jobDetailsType + } + } + } + + return nil +} + +// JobDetailsType databox Job Details +type JobDetailsType struct { + // CopyProgress - Copy progress per storage account. + CopyProgress *[]CopyProgress `json:"copyProgress,omitempty"` + // ExpectedDataSizeInTeraBytes - The expected size of the data, which needs to be transfered in this job, in tera bytes. + ExpectedDataSizeInTeraBytes *int32 `json:"expectedDataSizeInTeraBytes,omitempty"` + // JobStages - List of stages that run in the job. + JobStages *[]JobStages `json:"jobStages,omitempty"` + // ContactDetails - Contact details for notification and shipping. + ContactDetails *ContactDetails `json:"contactDetails,omitempty"` + // ShippingAddress - Shipping address of the customer. + ShippingAddress *ShippingAddress `json:"shippingAddress,omitempty"` + // DeliveryPackage - Delivery package shipping details. + DeliveryPackage *PackageShippingDetails `json:"deliveryPackage,omitempty"` + // ReturnPackage - Return package shipping details. + ReturnPackage *PackageShippingDetails `json:"returnPackage,omitempty"` + // DestinationAccountDetails - Destination account details. + DestinationAccountDetails *[]DestinationAccountDetails `json:"destinationAccountDetails,omitempty"` + // ErrorDetails - Error details for failure. This is optional. + ErrorDetails *[]JobErrorDetails `json:"errorDetails,omitempty"` + // Preferences - Preferences for the order. + Preferences *Preferences `json:"preferences,omitempty"` + // CopyLogDetails - List of copy log details. + CopyLogDetails *[]BasicCopyLogDetails `json:"copyLogDetails,omitempty"` + // ReverseShipmentLabelSasKey - Shared access key to download the return shipment label + ReverseShipmentLabelSasKey *string `json:"reverseShipmentLabelSasKey,omitempty"` + // ChainOfCustodySasKey - Shared access key to download the chain of custody logs + ChainOfCustodySasKey *string `json:"chainOfCustodySasKey,omitempty"` + // JobDetailsType - Possible values include: 'JobDetailsTypeJobDetails', 'JobDetailsTypeDataBoxDisk', 'JobDetailsTypeDataBoxHeavy', 'JobDetailsTypeDataBox' + JobDetailsType JobDetailsType `json:"jobDetailsType,omitempty"` +} + +// MarshalJSON is the custom marshaler for JobDetailsType. +func (jdt JobDetailsType) MarshalJSON() ([]byte, error) { + jdt.JobDetailsType = JobDetailsTypeDataBox + objectMap := make(map[string]interface{}) + if jdt.CopyProgress != nil { + objectMap["copyProgress"] = jdt.CopyProgress + } + if jdt.ExpectedDataSizeInTeraBytes != nil { + objectMap["expectedDataSizeInTeraBytes"] = jdt.ExpectedDataSizeInTeraBytes + } + if jdt.JobStages != nil { + objectMap["jobStages"] = jdt.JobStages + } + if jdt.ContactDetails != nil { + objectMap["contactDetails"] = jdt.ContactDetails + } + if jdt.ShippingAddress != nil { + objectMap["shippingAddress"] = jdt.ShippingAddress + } + if jdt.DeliveryPackage != nil { + objectMap["deliveryPackage"] = jdt.DeliveryPackage + } + if jdt.ReturnPackage != nil { + objectMap["returnPackage"] = jdt.ReturnPackage + } + if jdt.DestinationAccountDetails != nil { + objectMap["destinationAccountDetails"] = jdt.DestinationAccountDetails + } + if jdt.ErrorDetails != nil { + objectMap["errorDetails"] = jdt.ErrorDetails + } + if jdt.Preferences != nil { + objectMap["preferences"] = jdt.Preferences + } + if jdt.CopyLogDetails != nil { + objectMap["copyLogDetails"] = jdt.CopyLogDetails + } + if jdt.ReverseShipmentLabelSasKey != nil { + objectMap["reverseShipmentLabelSasKey"] = jdt.ReverseShipmentLabelSasKey + } + if jdt.ChainOfCustodySasKey != nil { + objectMap["chainOfCustodySasKey"] = jdt.ChainOfCustodySasKey + } + if jdt.JobDetailsType != "" { + objectMap["jobDetailsType"] = jdt.JobDetailsType + } + return json.Marshal(objectMap) +} + +// AsDiskJobDetails is the BasicJobDetails implementation for JobDetailsType. +func (jdt JobDetailsType) AsDiskJobDetails() (*DiskJobDetails, bool) { + return nil, false +} + +// AsHeavyJobDetails is the BasicJobDetails implementation for JobDetailsType. +func (jdt JobDetailsType) AsHeavyJobDetails() (*HeavyJobDetails, bool) { + return nil, false +} + +// AsJobDetailsType is the BasicJobDetails implementation for JobDetailsType. +func (jdt JobDetailsType) AsJobDetailsType() (*JobDetailsType, bool) { + return &jdt, true +} + +// AsJobDetails is the BasicJobDetails implementation for JobDetailsType. +func (jdt JobDetailsType) AsJobDetails() (*JobDetails, bool) { + return nil, false +} + +// AsBasicJobDetails is the BasicJobDetails implementation for JobDetailsType. +func (jdt JobDetailsType) AsBasicJobDetails() (BasicJobDetails, bool) { + return &jdt, true +} + +// UnmarshalJSON is the custom unmarshaler for JobDetailsType struct. +func (jdt *JobDetailsType) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "copyProgress": + if v != nil { + var copyProgress []CopyProgress + err = json.Unmarshal(*v, ©Progress) + if err != nil { + return err + } + jdt.CopyProgress = ©Progress + } + case "expectedDataSizeInTeraBytes": + if v != nil { + var expectedDataSizeInTeraBytes int32 + err = json.Unmarshal(*v, &expectedDataSizeInTeraBytes) + if err != nil { + return err + } + jdt.ExpectedDataSizeInTeraBytes = &expectedDataSizeInTeraBytes + } + case "jobStages": + if v != nil { + var jobStages []JobStages + err = json.Unmarshal(*v, &jobStages) + if err != nil { + return err + } + jdt.JobStages = &jobStages + } + case "contactDetails": + if v != nil { + var contactDetails ContactDetails + err = json.Unmarshal(*v, &contactDetails) + if err != nil { + return err + } + jdt.ContactDetails = &contactDetails + } + case "shippingAddress": + if v != nil { + var shippingAddress ShippingAddress + err = json.Unmarshal(*v, &shippingAddress) + if err != nil { + return err + } + jdt.ShippingAddress = &shippingAddress + } + case "deliveryPackage": + if v != nil { + var deliveryPackage PackageShippingDetails + err = json.Unmarshal(*v, &deliveryPackage) + if err != nil { + return err + } + jdt.DeliveryPackage = &deliveryPackage + } + case "returnPackage": + if v != nil { + var returnPackage PackageShippingDetails + err = json.Unmarshal(*v, &returnPackage) + if err != nil { + return err + } + jdt.ReturnPackage = &returnPackage + } + case "destinationAccountDetails": + if v != nil { + var destinationAccountDetails []DestinationAccountDetails + err = json.Unmarshal(*v, &destinationAccountDetails) + if err != nil { + return err + } + jdt.DestinationAccountDetails = &destinationAccountDetails + } + case "errorDetails": + if v != nil { + var errorDetails []JobErrorDetails + err = json.Unmarshal(*v, &errorDetails) + if err != nil { + return err + } + jdt.ErrorDetails = &errorDetails + } + case "preferences": + if v != nil { + var preferences Preferences + err = json.Unmarshal(*v, &preferences) + if err != nil { + return err + } + jdt.Preferences = &preferences + } + case "copyLogDetails": + if v != nil { + copyLogDetails, err := unmarshalBasicCopyLogDetailsArray(*v) + if err != nil { + return err + } + jdt.CopyLogDetails = ©LogDetails + } + case "reverseShipmentLabelSasKey": + if v != nil { + var reverseShipmentLabelSasKey string + err = json.Unmarshal(*v, &reverseShipmentLabelSasKey) + if err != nil { + return err + } + jdt.ReverseShipmentLabelSasKey = &reverseShipmentLabelSasKey + } + case "chainOfCustodySasKey": + if v != nil { + var chainOfCustodySasKey string + err = json.Unmarshal(*v, &chainOfCustodySasKey) + if err != nil { + return err + } + jdt.ChainOfCustodySasKey = &chainOfCustodySasKey + } + case "jobDetailsType": + if v != nil { + var jobDetailsType JobDetailsType + err = json.Unmarshal(*v, &jobDetailsType) + if err != nil { + return err + } + jdt.JobDetailsType = jobDetailsType + } + } } - return json.Marshal(objectMap) -} - -// AsDiskJobDetails is the BasicJobDetails implementation for JobDetails. -func (jd JobDetails) AsDiskJobDetails() (*DiskJobDetails, bool) { - return nil, false -} - -// AsPodJobDetails is the BasicJobDetails implementation for JobDetails. -func (jd JobDetails) AsPodJobDetails() (*PodJobDetails, bool) { - return nil, false -} - -// AsJobDetails is the BasicJobDetails implementation for JobDetails. -func (jd JobDetails) AsJobDetails() (*JobDetails, bool) { - return &jd, true -} -// AsBasicJobDetails is the BasicJobDetails implementation for JobDetails. -func (jd JobDetails) AsBasicJobDetails() (BasicJobDetails, bool) { - return &jd, true + return nil } // JobErrorDetails job Error Details for providing the information and recommended action. @@ -1049,10 +2012,10 @@ type JobErrorDetails struct { // JobProperties job Properties type JobProperties struct { - // DeviceType - Type of the device to be used for the job. Possible values include: 'Pod', 'Disk', 'Cabinet' - DeviceType DeviceType `json:"deviceType,omitempty"` // IsCancellable - Describes whether the job is cancellable or not. IsCancellable *bool `json:"isCancellable,omitempty"` + // IsDeletable - Describes whether the job is deletable or not. + IsDeletable *bool `json:"isDeletable,omitempty"` // IsShippingAddressEditable - Describes whether the shipping address is editable or not. IsShippingAddressEditable *bool `json:"isShippingAddressEditable,omitempty"` // Status - Name of the stage which is in progress. Possible values include: 'StageNameDeviceOrdered', 'StageNameDevicePrepared', 'StageNameDispatched', 'StageNameDelivered', 'StageNamePickedUp', 'StageNameAtAzureDC', 'StageNameDataCopy', 'StageNameCompleted', 'StageNameCompletedWithErrors', 'StageNameCancelled', 'StageNameFailedIssueReportedAtCustomer', 'StageNameFailedIssueDetectedAtAzureDC', 'StageNameAborted' @@ -1061,12 +2024,6 @@ type JobProperties struct { StartTime *date.Time `json:"startTime,omitempty"` // Error - Top level error for the job. Error *Error `json:"error,omitempty"` - // DeliveryPackage - Delivery package shipping details. - DeliveryPackage *PackageShippingDetails `json:"deliveryPackage,omitempty"` - // ReturnPackage - Return package shipping details. - ReturnPackage *PackageShippingDetails `json:"returnPackage,omitempty"` - // DestinationAccountDetails - Destination account details. - DestinationAccountDetails *[]DestinationAccountDetails `json:"destinationAccountDetails,omitempty"` // Details - Details of a job run. This field will only be sent for expand details filter. Details BasicJobDetails `json:"details,omitempty"` // CancellationReason - Reason for cancellation. @@ -1082,23 +2039,23 @@ func (jp *JobProperties) UnmarshalJSON(body []byte) error { } for k, v := range m { switch k { - case "deviceType": + case "isCancellable": if v != nil { - var deviceType DeviceType - err = json.Unmarshal(*v, &deviceType) + var isCancellable bool + err = json.Unmarshal(*v, &isCancellable) if err != nil { return err } - jp.DeviceType = deviceType + jp.IsCancellable = &isCancellable } - case "isCancellable": + case "isDeletable": if v != nil { - var isCancellable bool - err = json.Unmarshal(*v, &isCancellable) + var isDeletable bool + err = json.Unmarshal(*v, &isDeletable) if err != nil { return err } - jp.IsCancellable = &isCancellable + jp.IsDeletable = &isDeletable } case "isShippingAddressEditable": if v != nil { @@ -1136,33 +2093,6 @@ func (jp *JobProperties) UnmarshalJSON(body []byte) error { } jp.Error = &errorVar } - case "deliveryPackage": - if v != nil { - var deliveryPackage PackageShippingDetails - err = json.Unmarshal(*v, &deliveryPackage) - if err != nil { - return err - } - jp.DeliveryPackage = &deliveryPackage - } - case "returnPackage": - if v != nil { - var returnPackage PackageShippingDetails - err = json.Unmarshal(*v, &returnPackage) - if err != nil { - return err - } - jp.ReturnPackage = &returnPackage - } - case "destinationAccountDetails": - if v != nil { - var destinationAccountDetails []DestinationAccountDetails - err = json.Unmarshal(*v, &destinationAccountDetails) - if err != nil { - return err - } - jp.DestinationAccountDetails = &destinationAccountDetails - } case "details": if v != nil { details, err := unmarshalBasicJobDetails(*v) @@ -1493,17 +2423,39 @@ func (future *JobsCreateFuture) Result(client JobsClient) (jr JobResource, err e return } +// JobsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. +type JobsDeleteFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *JobsDeleteFuture) Result(client JobsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.Done(client) + if err != nil { + err = autorest.NewErrorWithError(err, "databox.JobsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("databox.JobsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + // BasicJobSecrets the base class for the secrets type BasicJobSecrets interface { - AsCabinetJobSecrets() (*CabinetJobSecrets, bool) AsDiskJobSecrets() (*DiskJobSecrets, bool) - AsPodJobSecrets() (*PodJobSecrets, bool) + AsHeavyJobSecrets() (*HeavyJobSecrets, bool) + AsJobSecretsType() (*JobSecretsType, bool) AsJobSecrets() (*JobSecrets, bool) } // JobSecrets the base class for the secrets type JobSecrets struct { - // JobSecretsType - Possible values include: 'JobSecretsTypeJobSecrets', 'JobSecretsTypeCabinet', 'JobSecretsTypeDisk', 'JobSecretsTypePod' + // JobSecretsType - Possible values include: 'JobSecretsTypeJobSecrets', 'JobSecretsTypeDataBoxDisk', 'JobSecretsTypeDataBoxHeavy', 'JobSecretsTypeDataBox' JobSecretsType JobSecretsType `json:"jobSecretsType,omitempty"` } @@ -1515,18 +2467,18 @@ func unmarshalBasicJobSecrets(body []byte) (BasicJobSecrets, error) { } switch m["jobSecretsType"] { - case string(JobSecretsTypeCabinet): - var cjs CabinetJobSecrets - err := json.Unmarshal(body, &cjs) - return cjs, err - case string(JobSecretsTypeDisk): + case string(JobSecretsTypeDataBoxDisk): var djs DiskJobSecrets err := json.Unmarshal(body, &djs) return djs, err - case string(JobSecretsTypePod): - var pjs PodJobSecrets - err := json.Unmarshal(body, &pjs) - return pjs, err + case string(JobSecretsTypeDataBoxHeavy): + var hjs HeavyJobSecrets + err := json.Unmarshal(body, &hjs) + return hjs, err + case string(JobSecretsTypeDataBox): + var jst JobSecretsType + err := json.Unmarshal(body, &jst) + return jst, err default: var js JobSecrets err := json.Unmarshal(body, &js) @@ -1562,18 +2514,18 @@ func (js JobSecrets) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// AsCabinetJobSecrets is the BasicJobSecrets implementation for JobSecrets. -func (js JobSecrets) AsCabinetJobSecrets() (*CabinetJobSecrets, bool) { +// AsDiskJobSecrets is the BasicJobSecrets implementation for JobSecrets. +func (js JobSecrets) AsDiskJobSecrets() (*DiskJobSecrets, bool) { return nil, false } -// AsDiskJobSecrets is the BasicJobSecrets implementation for JobSecrets. -func (js JobSecrets) AsDiskJobSecrets() (*DiskJobSecrets, bool) { +// AsHeavyJobSecrets is the BasicJobSecrets implementation for JobSecrets. +func (js JobSecrets) AsHeavyJobSecrets() (*HeavyJobSecrets, bool) { return nil, false } -// AsPodJobSecrets is the BasicJobSecrets implementation for JobSecrets. -func (js JobSecrets) AsPodJobSecrets() (*PodJobSecrets, bool) { +// AsJobSecretsType is the BasicJobSecrets implementation for JobSecrets. +func (js JobSecrets) AsJobSecretsType() (*JobSecretsType, bool) { return nil, false } @@ -1587,6 +2539,52 @@ func (js JobSecrets) AsBasicJobSecrets() (BasicJobSecrets, bool) { return &js, true } +// JobSecretsType the secrets related to a databox job. +type JobSecretsType struct { + // PodSecrets - Contains the list of secret objects for a job. + PodSecrets *[]Secret `json:"podSecrets,omitempty"` + // JobSecretsType - Possible values include: 'JobSecretsTypeJobSecrets', 'JobSecretsTypeDataBoxDisk', 'JobSecretsTypeDataBoxHeavy', 'JobSecretsTypeDataBox' + JobSecretsType JobSecretsType `json:"jobSecretsType,omitempty"` +} + +// MarshalJSON is the custom marshaler for JobSecretsType. +func (jst JobSecretsType) MarshalJSON() ([]byte, error) { + jst.JobSecretsType = JobSecretsTypeDataBox + objectMap := make(map[string]interface{}) + if jst.PodSecrets != nil { + objectMap["podSecrets"] = jst.PodSecrets + } + if jst.JobSecretsType != "" { + objectMap["jobSecretsType"] = jst.JobSecretsType + } + return json.Marshal(objectMap) +} + +// AsDiskJobSecrets is the BasicJobSecrets implementation for JobSecretsType. +func (jst JobSecretsType) AsDiskJobSecrets() (*DiskJobSecrets, bool) { + return nil, false +} + +// AsHeavyJobSecrets is the BasicJobSecrets implementation for JobSecretsType. +func (jst JobSecretsType) AsHeavyJobSecrets() (*HeavyJobSecrets, bool) { + return nil, false +} + +// AsJobSecretsType is the BasicJobSecrets implementation for JobSecretsType. +func (jst JobSecretsType) AsJobSecretsType() (*JobSecretsType, bool) { + return &jst, true +} + +// AsJobSecrets is the BasicJobSecrets implementation for JobSecretsType. +func (jst JobSecretsType) AsJobSecrets() (*JobSecrets, bool) { + return nil, false +} + +// AsBasicJobSecrets is the BasicJobSecrets implementation for JobSecretsType. +func (jst JobSecretsType) AsBasicJobSecrets() (BasicJobSecrets, bool) { + return &jst, true +} + // JobStages job stages. type JobStages struct { // StageName - Name of the job stage. Possible values include: 'StageNameDeviceOrdered', 'StageNameDevicePrepared', 'StageNameDispatched', 'StageNameDelivered', 'StageNamePickedUp', 'StageNameAtAzureDC', 'StageNameDataCopy', 'StageNameCompleted', 'StageNameCompletedWithErrors', 'StageNameCancelled', 'StageNameFailedIssueReportedAtCustomer', 'StageNameFailedIssueDetectedAtAzureDC', 'StageNameAborted' @@ -1775,134 +2773,9 @@ type PackageShippingDetails struct { TrackingURL *string `json:"trackingUrl,omitempty"` } -// PodJobDetails pod Job Details -type PodJobDetails struct { - // CopyProgress - Copy progress per account. - CopyProgress *[]CopyProgress `json:"copyProgress,omitempty"` - // ExpectedDataSizeInTeraBytes - The expected size of the data, which needs to be transfered in this job, in tera bytes. - ExpectedDataSizeInTeraBytes *int32 `json:"expectedDataSizeInTeraBytes,omitempty"` - // JobStages - List of stages that run in the job. - JobStages *[]JobStages `json:"jobStages,omitempty"` - // ContactDetails - Contact details for notification and shipping. - ContactDetails *ContactDetails `json:"contactDetails,omitempty"` - // ShippingAddress - Shipping address of the customer. - ShippingAddress *ShippingAddress `json:"shippingAddress,omitempty"` - // ErrorDetails - Error details for failure. This is optional. - ErrorDetails *[]JobErrorDetails `json:"errorDetails,omitempty"` - // JobDetailsType - Possible values include: 'JobDetailsTypeJobDetails', 'JobDetailsTypeDisk', 'JobDetailsTypePod' - JobDetailsType JobDetailsType `json:"jobDetailsType,omitempty"` -} - -// MarshalJSON is the custom marshaler for PodJobDetails. -func (pjd PodJobDetails) MarshalJSON() ([]byte, error) { - pjd.JobDetailsType = JobDetailsTypePod - objectMap := make(map[string]interface{}) - if pjd.CopyProgress != nil { - objectMap["copyProgress"] = pjd.CopyProgress - } - if pjd.ExpectedDataSizeInTeraBytes != nil { - objectMap["expectedDataSizeInTeraBytes"] = pjd.ExpectedDataSizeInTeraBytes - } - if pjd.JobStages != nil { - objectMap["jobStages"] = pjd.JobStages - } - if pjd.ContactDetails != nil { - objectMap["contactDetails"] = pjd.ContactDetails - } - if pjd.ShippingAddress != nil { - objectMap["shippingAddress"] = pjd.ShippingAddress - } - if pjd.ErrorDetails != nil { - objectMap["errorDetails"] = pjd.ErrorDetails - } - if pjd.JobDetailsType != "" { - objectMap["jobDetailsType"] = pjd.JobDetailsType - } - return json.Marshal(objectMap) -} - -// AsDiskJobDetails is the BasicJobDetails implementation for PodJobDetails. -func (pjd PodJobDetails) AsDiskJobDetails() (*DiskJobDetails, bool) { - return nil, false -} - -// AsPodJobDetails is the BasicJobDetails implementation for PodJobDetails. -func (pjd PodJobDetails) AsPodJobDetails() (*PodJobDetails, bool) { - return &pjd, true -} - -// AsJobDetails is the BasicJobDetails implementation for PodJobDetails. -func (pjd PodJobDetails) AsJobDetails() (*JobDetails, bool) { - return nil, false -} - -// AsBasicJobDetails is the BasicJobDetails implementation for PodJobDetails. -func (pjd PodJobDetails) AsBasicJobDetails() (BasicJobDetails, bool) { - return &pjd, true -} - -// PodJobSecrets the secrets related to a pod job. -type PodJobSecrets struct { - // PodSecrets - Contains the list of secret objects for a job. - PodSecrets *[]PodSecret `json:"podSecrets,omitempty"` - // JobSecretsType - Possible values include: 'JobSecretsTypeJobSecrets', 'JobSecretsTypeCabinet', 'JobSecretsTypeDisk', 'JobSecretsTypePod' - JobSecretsType JobSecretsType `json:"jobSecretsType,omitempty"` -} - -// MarshalJSON is the custom marshaler for PodJobSecrets. -func (pjs PodJobSecrets) MarshalJSON() ([]byte, error) { - pjs.JobSecretsType = JobSecretsTypePod - objectMap := make(map[string]interface{}) - if pjs.PodSecrets != nil { - objectMap["podSecrets"] = pjs.PodSecrets - } - if pjs.JobSecretsType != "" { - objectMap["jobSecretsType"] = pjs.JobSecretsType - } - return json.Marshal(objectMap) -} - -// AsCabinetJobSecrets is the BasicJobSecrets implementation for PodJobSecrets. -func (pjs PodJobSecrets) AsCabinetJobSecrets() (*CabinetJobSecrets, bool) { - return nil, false -} - -// AsDiskJobSecrets is the BasicJobSecrets implementation for PodJobSecrets. -func (pjs PodJobSecrets) AsDiskJobSecrets() (*DiskJobSecrets, bool) { - return nil, false -} - -// AsPodJobSecrets is the BasicJobSecrets implementation for PodJobSecrets. -func (pjs PodJobSecrets) AsPodJobSecrets() (*PodJobSecrets, bool) { - return &pjs, true -} - -// AsJobSecrets is the BasicJobSecrets implementation for PodJobSecrets. -func (pjs PodJobSecrets) AsJobSecrets() (*JobSecrets, bool) { - return nil, false -} - -// AsBasicJobSecrets is the BasicJobSecrets implementation for PodJobSecrets. -func (pjs PodJobSecrets) AsBasicJobSecrets() (BasicJobSecrets, bool) { - return &pjs, true -} - -// PodSecret the secrets related to a Pod. -type PodSecret struct { - // DeviceSerialNumber - Serial number of the assigned device. - DeviceSerialNumber *string `json:"deviceSerialNumber,omitempty"` - // DevicePassword - Password for out of the box experience on device. - DevicePassword *string `json:"devicePassword,omitempty"` - // AccountCredentialDetails - Per account level access credentials. - AccountCredentialDetails *[]AccountCredentialDetails `json:"accountCredentialDetails,omitempty"` -} - -// ReportIssueDetails details of the reported issue. -type ReportIssueDetails struct { - // IssueType - Issue Type. Possible values include: 'DeviceMismatch', 'ValidationStringMismatch', 'CredentialNotWorking', 'DeviceFailure' - IssueType IssueType `json:"issueType,omitempty"` - // DeviceIssueType - Device Issue Type. Only used for Device failure issue. Possible values include: 'DeviceTampering', 'DeviceNotBootingUp', 'DeviceHealthCheckShowFailures', 'NICsAreNotWorking', 'Misc' - DeviceIssueType DeviceIssueType `json:"deviceIssueType,omitempty"` +// Preferences preferences related to the order +type Preferences struct { + PreferredDataCenterRegion *[]string `json:"preferredDataCenterRegion,omitempty"` } // Resource model of the Resource. @@ -1930,14 +2803,32 @@ func (r Resource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// Secret the secrets related to a DataBox. +type Secret struct { + // DeviceSerialNumber - Serial number of the assigned device. + DeviceSerialNumber *string `json:"deviceSerialNumber,omitempty"` + // DevicePassword - Password for out of the box experience on device. + DevicePassword *string `json:"devicePassword,omitempty"` + // NetworkConfigurations - Network configuration of the appliance. + NetworkConfigurations *[]ApplianceNetworkConfiguration `json:"networkConfigurations,omitempty"` + // EncodedValidationCertPubKey - The base 64 encoded public key to authenticate with the device + EncodedValidationCertPubKey *string `json:"encodedValidationCertPubKey,omitempty"` + // AccountCredentialDetails - Per account level access credentials. + AccountCredentialDetails *[]AccountCredentialDetails `json:"accountCredentialDetails,omitempty"` +} + // ShareCredentialDetails credential details of the shares in account. type ShareCredentialDetails struct { // ShareName - Name of the share. ShareName *string `json:"shareName,omitempty"` + // ShareType - Type of the share. Possible values include: 'UnknownType', 'HCS', 'BlockBlob', 'PageBlob', 'AzureFile' + ShareType ShareDestinationFormatType `json:"shareType,omitempty"` // UserName - User name for the share. UserName *string `json:"userName,omitempty"` // Password - Password for the share. Password *string `json:"password,omitempty"` + // SupportedAccessProtocols - Access protocols supported on the device. + SupportedAccessProtocols *[]AccessProtocol `json:"supportedAccessProtocols,omitempty"` } // ShipmentPickUpRequest shipment pick up request details. @@ -1983,17 +2874,10 @@ type ShippingAddress struct { AddressType AddressType `json:"addressType,omitempty"` } -// ShippingLabelDetails details for the shipping label. -type ShippingLabelDetails struct { - autorest.Response `json:"-"` - // ShippingLabelSasURI - Sas uri for accessing the shipping label. - ShippingLabelSasURI *string `json:"shippingLabelSasUri,omitempty"` -} - // Sku the Sku. type Sku struct { - // Name - The sku name. - Name *string `json:"name,omitempty"` + // Name - The sku name. Possible values include: 'DataBox', 'DataBoxDisk', 'DataBoxHeavy' + Name SkuName `json:"name,omitempty"` // DisplayName - The display name of the sku. DisplayName *string `json:"displayName,omitempty"` // Family - The sku family. @@ -2093,23 +2977,24 @@ type SkuProperties struct { Costs *[]SkuCost `json:"costs,omitempty"` // APIVersions - Api versions that support this Sku. APIVersions *[]string `json:"apiVersions,omitempty"` - // DisabledReason - Reason why the Sku is disabled. - DisabledReason *string `json:"disabledReason,omitempty"` + // DisabledReason - Reason why the Sku is disabled. Possible values include: 'SkuDisabledReasonNone', 'SkuDisabledReasonCountry', 'SkuDisabledReasonRegion', 'SkuDisabledReasonFeature', 'SkuDisabledReasonOfferType' + DisabledReason SkuDisabledReason `json:"disabledReason,omitempty"` + // DisabledReasonMessage - Message for why the Sku is disabled. + DisabledReasonMessage *string `json:"disabledReasonMessage,omitempty"` + // RequiredFeature - Required feature to access the sku. + RequiredFeature *string `json:"requiredFeature,omitempty"` } -// UnencryptedSecrets unencrypted secrets for accessing device. -type UnencryptedSecrets struct { - autorest.Response `json:"-"` +// UnencryptedCredentials unencrypted credentials for accessing device. +type UnencryptedCredentials struct { // JobName - Name of the job. JobName *string `json:"jobName,omitempty"` - // DeviceType - The Device Type used in the job. Possible values include: 'Pod', 'Disk', 'Cabinet' - DeviceType DeviceType `json:"deviceType,omitempty"` // JobSecrets - Secrets related to this job. JobSecrets BasicJobSecrets `json:"jobSecrets,omitempty"` } -// UnmarshalJSON is the custom unmarshaler for UnencryptedSecrets struct. -func (us *UnencryptedSecrets) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for UnencryptedCredentials struct. +func (uc *UnencryptedCredentials) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -2124,16 +3009,7 @@ func (us *UnencryptedSecrets) UnmarshalJSON(body []byte) error { if err != nil { return err } - us.JobName = &jobName - } - case "deviceType": - if v != nil { - var deviceType DeviceType - err = json.Unmarshal(*v, &deviceType) - if err != nil { - return err - } - us.DeviceType = deviceType + uc.JobName = &jobName } case "jobSecrets": if v != nil { @@ -2141,7 +3017,7 @@ func (us *UnencryptedSecrets) UnmarshalJSON(body []byte) error { if err != nil { return err } - us.JobSecrets = jobSecrets + uc.JobSecrets = jobSecrets } } } @@ -2149,6 +3025,15 @@ func (us *UnencryptedSecrets) UnmarshalJSON(body []byte) error { return nil } +// UnencryptedCredentialsList list of unencrypted credentials for accessing device. +type UnencryptedCredentialsList struct { + autorest.Response `json:"-"` + // Value - List of unencrypted credentials. + Value *[]UnencryptedCredentials `json:"value,omitempty"` + // NextLink - Link for the next set of unencrypted credentials. + NextLink *string `json:"nextLink,omitempty"` +} + // UpdateJobDetails job details for update. type UpdateJobDetails struct { // ContactDetails - Contact details for notification and shipping. @@ -2161,12 +3046,14 @@ type UpdateJobDetails struct { type UpdateJobProperties struct { // Details - Details of a job to be updated. Details *UpdateJobDetails `json:"details,omitempty"` + // DestinationAccountDetails - Destination account details. + DestinationAccountDetails *[]DestinationAccountDetails `json:"destinationAccountDetails,omitempty"` } // ValidateAddress the requirements to validate customer address where the device needs to be shipped. type ValidateAddress struct { // ShippingAddress - Shipping address of the customer. ShippingAddress *ShippingAddress `json:"shippingAddress,omitempty"` - // DeviceType - Device type to be used for the job. Possible values include: 'Pod', 'Disk', 'Cabinet' - DeviceType DeviceType `json:"deviceType,omitempty"` + // DeviceType - Device type to be used for the job. Possible values include: 'DataBox', 'DataBoxDisk', 'DataBoxHeavy' + DeviceType SkuName `json:"deviceType,omitempty"` } diff --git a/services/databox/mgmt/2018-01-01/databox/service.go b/services/databox/mgmt/2018-01-01/databox/service.go index 442342d81321..257052358584 100644 --- a/services/databox/mgmt/2018-01-01/databox/service.go +++ b/services/databox/mgmt/2018-01-01/databox/service.go @@ -151,7 +151,7 @@ func (client ServiceClient) ListAvailableSkusComplete(ctx context.Context, locat func (client ServiceClient) ValidateAddressMethod(ctx context.Context, location string, validateAddress ValidateAddress) (result AddressValidationOutput, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: validateAddress, - Constraints: []validation.Constraint{{Target: "validateAddress.ShippingAddress", Name: validation.Null, Rule: false, + Constraints: []validation.Constraint{{Target: "validateAddress.ShippingAddress", Name: validation.Null, Rule: true, Chain: []validation.Constraint{{Target: "validateAddress.ShippingAddress.StreetAddress1", Name: validation.Null, Rule: true, Chain: nil}, {Target: "validateAddress.ShippingAddress.Country", Name: validation.Null, Rule: true, Chain: nil}, {Target: "validateAddress.ShippingAddress.PostalCode", Name: validation.Null, Rule: true, Chain: nil},