[Release] sdk/resourcemanager/databox/armdatabox/0.2.0 generation from spec commit: cf47fa91b882618a1043e3aeb5803b3a7397cd08 (#16885)

This commit is contained in:
Jiahui Peng 2022-01-21 14:32:13 +08:00 коммит произвёл GitHub
Родитель 6647e2948e
Коммит 48e54816c1
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
18 изменённых файлов: 3261 добавлений и 2364 удалений

Просмотреть файл

@ -1,5 +1,442 @@
# Release History
## 0.2.0 (2022-01-21)
### Breaking Changes
- Function `*JobsClient.BeginUpdate` parameter(s) have been changed from `(context.Context, string, string, JobResourceUpdateParameter, *JobsBeginUpdateOptions)` to `(context.Context, string, string, JobResourceUpdateParameter, *JobsClientBeginUpdateOptions)`
- Function `*JobsClient.BeginUpdate` return value(s) have been changed from `(JobsUpdatePollerResponse, error)` to `(JobsClientUpdatePollerResponse, error)`
- Function `*ServiceClient.ValidateInputsByResourceGroup` parameter(s) have been changed from `(context.Context, string, string, ValidationRequestClassification, *ServiceValidateInputsByResourceGroupOptions)` to `(context.Context, string, string, ValidationRequestClassification, *ServiceClientValidateInputsByResourceGroupOptions)`
- Function `*ServiceClient.ValidateInputsByResourceGroup` return value(s) have been changed from `(ServiceValidateInputsByResourceGroupResponse, error)` to `(ServiceClientValidateInputsByResourceGroupResponse, error)`
- Function `*JobsClient.BookShipmentPickUp` parameter(s) have been changed from `(context.Context, string, string, ShipmentPickUpRequest, *JobsBookShipmentPickUpOptions)` to `(context.Context, string, string, ShipmentPickUpRequest, *JobsClientBookShipmentPickUpOptions)`
- Function `*JobsClient.BookShipmentPickUp` return value(s) have been changed from `(JobsBookShipmentPickUpResponse, error)` to `(JobsClientBookShipmentPickUpResponse, error)`
- Function `*ServiceClient.ValidateAddress` parameter(s) have been changed from `(context.Context, string, ValidateAddress, *ServiceValidateAddressOptions)` to `(context.Context, string, ValidateAddress, *ServiceClientValidateAddressOptions)`
- Function `*ServiceClient.ValidateAddress` return value(s) have been changed from `(ServiceValidateAddressResponse, error)` to `(ServiceClientValidateAddressResponse, error)`
- Function `*ServiceClient.ListAvailableSKUsByResourceGroup` parameter(s) have been changed from `(string, string, AvailableSKURequest, *ServiceListAvailableSKUsByResourceGroupOptions)` to `(string, string, AvailableSKURequest, *ServiceClientListAvailableSKUsByResourceGroupOptions)`
- Function `*ServiceClient.ListAvailableSKUsByResourceGroup` return value(s) have been changed from `(*ServiceListAvailableSKUsByResourceGroupPager)` to `(*ServiceClientListAvailableSKUsByResourceGroupPager)`
- Function `*ServiceClient.ValidateInputs` parameter(s) have been changed from `(context.Context, string, ValidationRequestClassification, *ServiceValidateInputsOptions)` to `(context.Context, string, ValidationRequestClassification, *ServiceClientValidateInputsOptions)`
- Function `*ServiceClient.ValidateInputs` return value(s) have been changed from `(ServiceValidateInputsResponse, error)` to `(ServiceClientValidateInputsResponse, error)`
- Function `*JobsClient.List` parameter(s) have been changed from `(*JobsListOptions)` to `(*JobsClientListOptions)`
- Function `*JobsClient.List` return value(s) have been changed from `(*JobsListPager)` to `(*JobsClientListPager)`
- Function `*JobsClient.ListByResourceGroup` parameter(s) have been changed from `(string, *JobsListByResourceGroupOptions)` to `(string, *JobsClientListByResourceGroupOptions)`
- Function `*JobsClient.ListByResourceGroup` return value(s) have been changed from `(*JobsListByResourceGroupPager)` to `(*JobsClientListByResourceGroupPager)`
- Function `*JobsClient.Get` parameter(s) have been changed from `(context.Context, string, string, *JobsGetOptions)` to `(context.Context, string, string, *JobsClientGetOptions)`
- Function `*JobsClient.Get` return value(s) have been changed from `(JobsGetResponse, error)` to `(JobsClientGetResponse, error)`
- Function `*ServiceClient.RegionConfiguration` parameter(s) have been changed from `(context.Context, string, RegionConfigurationRequest, *ServiceRegionConfigurationOptions)` to `(context.Context, string, RegionConfigurationRequest, *ServiceClientRegionConfigurationOptions)`
- Function `*ServiceClient.RegionConfiguration` return value(s) have been changed from `(ServiceRegionConfigurationResponse, error)` to `(ServiceClientRegionConfigurationResponse, error)`
- Function `*JobsClient.ListCredentials` parameter(s) have been changed from `(context.Context, string, string, *JobsListCredentialsOptions)` to `(context.Context, string, string, *JobsClientListCredentialsOptions)`
- Function `*JobsClient.ListCredentials` return value(s) have been changed from `(JobsListCredentialsResponse, error)` to `(JobsClientListCredentialsResponse, error)`
- Function `*JobsClient.BeginCreate` parameter(s) have been changed from `(context.Context, string, string, JobResource, *JobsBeginCreateOptions)` to `(context.Context, string, string, JobResource, *JobsClientBeginCreateOptions)`
- Function `*JobsClient.BeginCreate` return value(s) have been changed from `(JobsCreatePollerResponse, error)` to `(JobsClientCreatePollerResponse, error)`
- Function `*JobsClient.BeginDelete` parameter(s) have been changed from `(context.Context, string, string, *JobsBeginDeleteOptions)` to `(context.Context, string, string, *JobsClientBeginDeleteOptions)`
- Function `*JobsClient.BeginDelete` return value(s) have been changed from `(JobsDeletePollerResponse, error)` to `(JobsClientDeletePollerResponse, error)`
- Function `*OperationsClient.List` parameter(s) have been changed from `(*OperationsListOptions)` to `(*OperationsClientListOptions)`
- Function `*OperationsClient.List` return value(s) have been changed from `(*OperationsListPager)` to `(*OperationsClientListPager)`
- Function `*JobsClient.Cancel` parameter(s) have been changed from `(context.Context, string, string, CancellationReason, *JobsCancelOptions)` to `(context.Context, string, string, CancellationReason, *JobsClientCancelOptions)`
- Function `*JobsClient.Cancel` return value(s) have been changed from `(JobsCancelResponse, error)` to `(JobsClientCancelResponse, error)`
- Function `*ServiceClient.RegionConfigurationByResourceGroup` parameter(s) have been changed from `(context.Context, string, string, RegionConfigurationRequest, *ServiceRegionConfigurationByResourceGroupOptions)` to `(context.Context, string, string, RegionConfigurationRequest, *ServiceClientRegionConfigurationByResourceGroupOptions)`
- Function `*ServiceClient.RegionConfigurationByResourceGroup` return value(s) have been changed from `(ServiceRegionConfigurationByResourceGroupResponse, error)` to `(ServiceClientRegionConfigurationByResourceGroupResponse, error)`
- Function `*JobsClient.MarkDevicesShipped` parameter(s) have been changed from `(context.Context, string, string, MarkDevicesShippedRequest, *JobsMarkDevicesShippedOptions)` to `(context.Context, string, string, MarkDevicesShippedRequest, *JobsClientMarkDevicesShippedOptions)`
- Function `*JobsClient.MarkDevicesShipped` return value(s) have been changed from `(JobsMarkDevicesShippedResponse, error)` to `(JobsClientMarkDevicesShippedResponse, error)`
- Type of `RegionConfigurationRequest.ScheduleAvailabilityRequest` has been changed from `ScheduleAvailabilityRequestClassification` to `CommonScheduleAvailabilityRequestClassification`
- Type of `AdditionalErrorInfo.Info` has been changed from `map[string]interface{}` to `interface{}`
- Type of `JobProperties.Details` has been changed from `JobDetailsClassification` to `CommonJobDetailsClassification`
- Type of `UnencryptedCredentials.JobSecrets` has been changed from `JobSecretsClassification` to `CommonJobSecretsClassification`
- Type of `JobStages.JobStageDetails` has been changed from `map[string]interface{}` to `interface{}`
- Type of `Operation.Properties` has been changed from `map[string]interface{}` to `interface{}`
- Function `JobsUpdatePollerResponse.PollUntilDone` has been removed
- Function `*JobsDeletePoller.Done` has been removed
- Function `*DatacenterAddressResponse.UnmarshalJSON` has been removed
- Function `DataBoxScheduleAvailabilityRequest.MarshalJSON` has been removed
- Function `DataBoxDiskJobSecrets.MarshalJSON` has been removed
- Function `DataBoxJobDetails.MarshalJSON` has been removed
- Function `*JobsUpdatePoller.FinalResponse` has been removed
- Function `*ValidationInputResponse.UnmarshalJSON` has been removed
- Function `*DataBoxCustomerDiskJobDetails.UnmarshalJSON` has been removed
- Function `DataBoxHeavyAccountCopyLogDetails.MarshalJSON` has been removed
- Function `*JobsListPager.Err` has been removed
- Function `DataboxJobSecrets.MarshalJSON` has been removed
- Function `*JobsDeletePoller.Poll` has been removed
- Function `*OperationsListPager.NextPage` has been removed
- Function `*JobsCreatePoller.Poll` has been removed
- Function `*DataBoxHeavyAccountCopyLogDetails.UnmarshalJSON` has been removed
- Function `*JobsUpdatePoller.Poll` has been removed
- Function `*DataBoxDiskCopyLogDetails.UnmarshalJSON` has been removed
- Function `ErrorDetail.MarshalJSON` has been removed
- Function `*DataBoxDiskJobDetails.UnmarshalJSON` has been removed
- Function `*DataBoxDiskJobSecrets.UnmarshalJSON` has been removed
- Function `*ServiceListAvailableSKUsByResourceGroupPager.Err` has been removed
- Function `*ValidationInputRequest.UnmarshalJSON` has been removed
- Function `NewDataBoxManagementClient` has been removed
- Function `DataBoxDiskCopyLogDetails.MarshalJSON` has been removed
- Function `*JobsDeletePoller.ResumeToken` has been removed
- Function `*JobsDeletePollerResponse.Resume` has been removed
- Function `*JobsCreatePoller.FinalResponse` has been removed
- Function `DataBoxCustomerDiskCopyLogDetails.MarshalJSON` has been removed
- Function `*OperationsListPager.Err` has been removed
- Function `*JobsUpdatePollerResponse.Resume` has been removed
- Function `*DataBoxHeavyJobSecrets.UnmarshalJSON` has been removed
- Function `DataBoxAccountCopyLogDetails.MarshalJSON` has been removed
- Function `*JobsListPager.NextPage` has been removed
- Function `*DataBoxAccountCopyLogDetails.UnmarshalJSON` has been removed
- Function `DataBoxSecret.MarshalJSON` has been removed
- Function `JobsCreatePollerResponse.PollUntilDone` has been removed
- Function `*DataAccountDetails.UnmarshalJSON` has been removed
- Function `DataBoxCustomerDiskJobDetails.MarshalJSON` has been removed
- Function `DataBoxHeavyJobSecrets.MarshalJSON` has been removed
- Function `*JobsListPager.PageResponse` has been removed
- Function `*JobsDeletePoller.FinalResponse` has been removed
- Function `*ScheduleAvailabilityRequest.GetScheduleAvailabilityRequest` has been removed
- Function `*DataBoxManagementClient.Mitigate` has been removed
- Function `DataBoxDiskJobDetails.MarshalJSON` has been removed
- Function `*JobsListByResourceGroupPager.PageResponse` has been removed
- Function `*OperationsListPager.PageResponse` has been removed
- Function `*JobSecrets.GetJobSecrets` has been removed
- Function `*JobsUpdatePoller.Done` has been removed
- Function `JobsDeletePollerResponse.PollUntilDone` has been removed
- Function `*DataboxJobSecrets.UnmarshalJSON` has been removed
- Function `DataBoxHeavyJobDetails.MarshalJSON` has been removed
- Function `APIError.Error` has been removed
- Function `*JobsCreatePoller.Done` has been removed
- Function `*JobsListByResourceGroupPager.Err` has been removed
- Function `*ServiceListAvailableSKUsByResourceGroupPager.PageResponse` has been removed
- Function `*ServiceListAvailableSKUsByResourceGroupPager.NextPage` has been removed
- Function `*JobsCreatePoller.ResumeToken` has been removed
- Function `*CopyLogDetails.UnmarshalJSON` has been removed
- Function `*DataBoxHeavyJobDetails.UnmarshalJSON` has been removed
- Function `*DataBoxCustomerDiskCopyLogDetails.UnmarshalJSON` has been removed
- Function `DataBoxHeavySecret.MarshalJSON` has been removed
- Function `*JobsCreatePollerResponse.Resume` has been removed
- Function `*JobsListByResourceGroupPager.NextPage` has been removed
- Function `*JobDetails.GetJobDetails` has been removed
- Function `*JobsUpdatePoller.ResumeToken` has been removed
- Function `*DataBoxJobDetails.UnmarshalJSON` has been removed
- Struct `APIError` has been removed
- Struct `ArmBaseObject` has been removed
- Struct `DataBoxAccountCopyLogDetails` has been removed
- Struct `DataBoxCustomerDiskCopyLogDetails` has been removed
- Struct `DataBoxCustomerDiskCopyProgress` has been removed
- Struct `DataBoxCustomerDiskJobDetails` has been removed
- Struct `DataBoxDiskCopyLogDetails` has been removed
- Struct `DataBoxDiskCopyProgress` has been removed
- Struct `DataBoxDiskJobDetails` has been removed
- Struct `DataBoxDiskJobSecrets` has been removed
- Struct `DataBoxHeavyAccountCopyLogDetails` has been removed
- Struct `DataBoxHeavyJobDetails` has been removed
- Struct `DataBoxHeavyJobSecrets` has been removed
- Struct `DataBoxHeavySecret` has been removed
- Struct `DataBoxJobDetails` has been removed
- Struct `DataBoxManagementClient` has been removed
- Struct `DataBoxManagementClientMitigateOptions` has been removed
- Struct `DataBoxManagementClientMitigateResponse` has been removed
- Struct `DataBoxScheduleAvailabilityRequest` has been removed
- Struct `DataBoxSecret` has been removed
- Struct `DataboxJobSecrets` has been removed
- Struct `Details` has been removed
- Struct `ErrorDetail` has been removed
- Struct `JobsBeginCreateOptions` has been removed
- Struct `JobsBeginDeleteOptions` has been removed
- Struct `JobsBeginUpdateOptions` has been removed
- Struct `JobsBookShipmentPickUpOptions` has been removed
- Struct `JobsBookShipmentPickUpResponse` has been removed
- Struct `JobsBookShipmentPickUpResult` has been removed
- Struct `JobsCancelOptions` has been removed
- Struct `JobsCancelResponse` has been removed
- Struct `JobsCreatePoller` has been removed
- Struct `JobsCreatePollerResponse` has been removed
- Struct `JobsCreateResponse` has been removed
- Struct `JobsCreateResult` has been removed
- Struct `JobsDeletePoller` has been removed
- Struct `JobsDeletePollerResponse` has been removed
- Struct `JobsDeleteResponse` has been removed
- Struct `JobsGetOptions` has been removed
- Struct `JobsGetResponse` has been removed
- Struct `JobsGetResult` has been removed
- Struct `JobsListByResourceGroupOptions` has been removed
- Struct `JobsListByResourceGroupPager` has been removed
- Struct `JobsListByResourceGroupResponse` has been removed
- Struct `JobsListByResourceGroupResult` has been removed
- Struct `JobsListCredentialsOptions` has been removed
- Struct `JobsListCredentialsResponse` has been removed
- Struct `JobsListCredentialsResult` has been removed
- Struct `JobsListOptions` has been removed
- Struct `JobsListPager` has been removed
- Struct `JobsListResponse` has been removed
- Struct `JobsListResult` has been removed
- Struct `JobsMarkDevicesShippedOptions` has been removed
- Struct `JobsMarkDevicesShippedResponse` has been removed
- Struct `JobsUpdatePoller` has been removed
- Struct `JobsUpdatePollerResponse` has been removed
- Struct `JobsUpdateResponse` has been removed
- Struct `JobsUpdateResult` has been removed
- Struct `OperationsListOptions` has been removed
- Struct `OperationsListPager` has been removed
- Struct `OperationsListResponse` has been removed
- Struct `OperationsListResult` has been removed
- Struct `ServiceListAvailableSKUsByResourceGroupOptions` has been removed
- Struct `ServiceListAvailableSKUsByResourceGroupPager` has been removed
- Struct `ServiceListAvailableSKUsByResourceGroupResponse` has been removed
- Struct `ServiceListAvailableSKUsByResourceGroupResult` has been removed
- Struct `ServiceRegionConfigurationByResourceGroupOptions` has been removed
- Struct `ServiceRegionConfigurationByResourceGroupResponse` has been removed
- Struct `ServiceRegionConfigurationByResourceGroupResult` has been removed
- Struct `ServiceRegionConfigurationOptions` has been removed
- Struct `ServiceRegionConfigurationResponse` has been removed
- Struct `ServiceRegionConfigurationResult` has been removed
- Struct `ServiceValidateAddressOptions` has been removed
- Struct `ServiceValidateAddressResponse` has been removed
- Struct `ServiceValidateAddressResult` has been removed
- Struct `ServiceValidateInputsByResourceGroupOptions` has been removed
- Struct `ServiceValidateInputsByResourceGroupResponse` has been removed
- Struct `ServiceValidateInputsByResourceGroupResult` has been removed
- Struct `ServiceValidateInputsOptions` has been removed
- Struct `ServiceValidateInputsResponse` has been removed
- Struct `ServiceValidateInputsResult` has been removed
- Field `ValidationInputResponse` of struct `AddressValidationProperties` has been removed
- Field `DatacenterAddressResponse` of struct `DatacenterAddressInstructionResponse` has been removed
- Field `ValidationInputRequest` of struct `SKUAvailabilityValidationRequest` has been removed
- Field `ValidationInputResponse` of struct `PreferencesValidationResponseProperties` has been removed
- Field `ValidationInputRequest` of struct `ValidateAddress` has been removed
- Field `DatacenterAddressResponse` of struct `DatacenterAddressLocationResponse` has been removed
- Field `ScheduleAvailabilityRequest` of struct `DiskScheduleAvailabilityRequest` has been removed
- Field `ValidationInputRequest` of struct `PreferencesValidationRequest` has been removed
- Field `ScheduleAvailabilityRequest` of struct `HeavyScheduleAvailabilityRequest` has been removed
- Field `ValidationInputRequest` of struct `CreateOrderLimitForSubscriptionValidationRequest` has been removed
- Field `ValidationInputResponse` of struct `DataTransferDetailsValidationResponseProperties` has been removed
- Field `ValidationInputRequest` of struct `SubscriptionIsAllowedToCreateJobValidationRequest` has been removed
- Field `DataAccountDetails` of struct `ManagedDiskDetails` has been removed
- Field `Resource` of struct `JobResource` has been removed
- Field `JobSecrets` of struct `CustomerDiskJobSecrets` has been removed
- Field `ValidationInputResponse` of struct `SubscriptionIsAllowedToCreateJobValidationResponseProperties` has been removed
- Field `ValidationRequest` of struct `CreateJobValidations` has been removed
- Field `ValidationInputResponse` of struct `SKUAvailabilityValidationResponseProperties` has been removed
- Field `ValidationInputRequest` of struct `DataTransferDetailsValidationRequest` has been removed
- Field `DataAccountDetails` of struct `StorageAccountDetails` has been removed
- Field `ValidationInputResponse` of struct `CreateOrderLimitForSubscriptionValidationResponseProperties` has been removed
### Features Added
- New function `*JobsClientUpdatePoller.FinalResponse(context.Context) (JobsClientUpdateResponse, error)`
- New function `*CommonJobSecrets.GetCommonJobSecrets() *CommonJobSecrets`
- New function `*CustomerDiskCopyLogDetails.UnmarshalJSON([]byte) error`
- New function `AccountCopyLogDetails.MarshalJSON() ([]byte, error)`
- New function `*SubscriptionIsAllowedToCreateJobValidationRequest.GetValidationInputRequest() *ValidationInputRequest`
- New function `*SubscriptionIsAllowedToCreateJobValidationRequest.UnmarshalJSON([]byte) error`
- New function `*CustomerDiskCopyLogDetails.GetCopyLogDetails() *CopyLogDetails`
- New function `CustomerDiskCopyLogDetails.MarshalJSON() ([]byte, error)`
- New function `*AccountCopyLogDetails.GetCopyLogDetails() *CopyLogDetails`
- New function `CommonJobDetails.MarshalJSON() ([]byte, error)`
- New function `*OperationsClientListPager.PageResponse() OperationsClientListResponse`
- New function `*DataTransferDetailsValidationResponseProperties.GetValidationInputResponse() *ValidationInputResponse`
- New function `*OperationsClientListPager.Err() error`
- New function `*DiskCopyLogDetails.UnmarshalJSON([]byte) error`
- New function `ScheduleAvailabilityRequest.MarshalJSON() ([]byte, error)`
- New function `*JobsClientCreatePoller.Poll(context.Context) (*http.Response, error)`
- New function `*JobSecrets.GetCommonJobSecrets() *CommonJobSecrets`
- New function `*DiskJobDetails.UnmarshalJSON([]byte) error`
- New function `DatacenterAddressResponse.MarshalJSON() ([]byte, error)`
- New function `JobsClientUpdatePollerResponse.PollUntilDone(context.Context, time.Duration) (JobsClientUpdateResponse, error)`
- New function `*JobsClientUpdatePoller.Done() bool`
- New function `*HeavyScheduleAvailabilityRequest.UnmarshalJSON([]byte) error`
- New function `NewManagementClient(string, azcore.TokenCredential, *arm.ClientOptions) *ManagementClient`
- New function `*JobsClientUpdatePoller.Poll(context.Context) (*http.Response, error)`
- New function `*JobsClientDeletePoller.ResumeToken() (string, error)`
- New function `Secret.MarshalJSON() ([]byte, error)`
- New function `*PreferencesValidationRequest.GetValidationInputRequest() *ValidationInputRequest`
- New function `*CreateOrderLimitForSubscriptionValidationRequest.GetValidationInputRequest() *ValidationInputRequest`
- New function `*JobsClientCreatePoller.ResumeToken() (string, error)`
- New function `*JobsClientListByResourceGroupPager.NextPage(context.Context) bool`
- New function `*CustomerDiskJobSecrets.GetCommonJobSecrets() *CommonJobSecrets`
- New function `JobsClientCreatePollerResponse.PollUntilDone(context.Context, time.Duration) (JobsClientCreateResponse, error)`
- New function `*AddressValidationProperties.GetValidationInputResponse() *ValidationInputResponse`
- New function `CustomerDiskJobDetails.MarshalJSON() ([]byte, error)`
- New function `*JobDetails.GetCommonJobDetails() *CommonJobDetails`
- New function `*JobsClientListByResourceGroupPager.Err() error`
- New function `*ServiceClientListAvailableSKUsByResourceGroupPager.Err() error`
- New function `*HeavyScheduleAvailabilityRequest.GetCommonScheduleAvailabilityRequest() *CommonScheduleAvailabilityRequest`
- New function `*CreateOrderLimitForSubscriptionValidationResponseProperties.GetValidationInputResponse() *ValidationInputResponse`
- New function `*JobsClientListByResourceGroupPager.PageResponse() JobsClientListByResourceGroupResponse`
- New function `*HeavyJobSecrets.UnmarshalJSON([]byte) error`
- New function `*ManagedDiskDetails.GetDataAccountDetails() *DataAccountDetails`
- New function `*DiskJobDetails.GetCommonJobDetails() *CommonJobDetails`
- New function `*SKUAvailabilityValidationResponseProperties.GetValidationInputResponse() *ValidationInputResponse`
- New function `*StorageAccountDetails.GetDataAccountDetails() *DataAccountDetails`
- New function `*ScheduleAvailabilityRequest.GetCommonScheduleAvailabilityRequest() *CommonScheduleAvailabilityRequest`
- New function `*CommonScheduleAvailabilityRequest.GetCommonScheduleAvailabilityRequest() *CommonScheduleAvailabilityRequest`
- New function `*JobsClientDeletePoller.Done() bool`
- New function `*DiskJobSecrets.GetCommonJobSecrets() *CommonJobSecrets`
- New function `DiskJobSecrets.MarshalJSON() ([]byte, error)`
- New function `JobDetails.MarshalJSON() ([]byte, error)`
- New function `*JobsClientUpdatePoller.ResumeToken() (string, error)`
- New function `*DataTransferDetailsValidationRequest.GetValidationInputRequest() *ValidationInputRequest`
- New function `*CreateJobValidations.GetValidationRequest() *ValidationRequest`
- New function `*CommonJobDetails.GetCommonJobDetails() *CommonJobDetails`
- New function `*CustomerDiskJobDetails.UnmarshalJSON([]byte) error`
- New function `*ManagementClient.Mitigate(context.Context, string, string, MitigateJobRequest, *ManagementClientMitigateOptions) (ManagementClientMitigateResponse, error)`
- New function `*JobsClientDeletePollerResponse.Resume(context.Context, *JobsClient, string) error`
- New function `*JobsClientCreatePoller.FinalResponse(context.Context) (JobsClientCreateResponse, error)`
- New function `HeavyJobSecrets.MarshalJSON() ([]byte, error)`
- New function `*ValidateAddress.GetValidationInputRequest() *ValidationInputRequest`
- New function `*CreateJobValidations.UnmarshalJSON([]byte) error`
- New function `*CustomerDiskJobDetails.GetCommonJobDetails() *CommonJobDetails`
- New function `*HeavyJobSecrets.GetCommonJobSecrets() *CommonJobSecrets`
- New function `*HeavyJobDetails.UnmarshalJSON([]byte) error`
- New function `*JobsClientUpdatePollerResponse.Resume(context.Context, *JobsClient, string) error`
- New function `*DiskJobSecrets.UnmarshalJSON([]byte) error`
- New function `*JobsClientDeletePoller.Poll(context.Context) (*http.Response, error)`
- New function `*OperationsClientListPager.NextPage(context.Context) bool`
- New function `*DiskScheduleAvailabilityRequest.GetCommonScheduleAvailabilityRequest() *CommonScheduleAvailabilityRequest`
- New function `*ServiceClientListAvailableSKUsByResourceGroupPager.PageResponse() ServiceClientListAvailableSKUsByResourceGroupResponse`
- New function `ValidationRequest.MarshalJSON() ([]byte, error)`
- New function `*JobsClientListPager.PageResponse() JobsClientListResponse`
- New function `*SubscriptionIsAllowedToCreateJobValidationResponseProperties.GetValidationInputResponse() *ValidationInputResponse`
- New function `HeavyJobDetails.MarshalJSON() ([]byte, error)`
- New function `*DatacenterAddressLocationResponse.GetDatacenterAddressResponse() *DatacenterAddressResponse`
- New function `*JobsClientListPager.NextPage(context.Context) bool`
- New function `*JobsClientCreatePollerResponse.Resume(context.Context, *JobsClient, string) error`
- New function `HeavySecret.MarshalJSON() ([]byte, error)`
- New function `*HeavyAccountCopyLogDetails.UnmarshalJSON([]byte) error`
- New function `*ServiceClientListAvailableSKUsByResourceGroupPager.NextPage(context.Context) bool`
- New function `*DatacenterAddressInstructionResponse.GetDatacenterAddressResponse() *DatacenterAddressResponse`
- New function `*JobsClientDeletePoller.FinalResponse(context.Context) (JobsClientDeleteResponse, error)`
- New function `*HeavyAccountCopyLogDetails.GetCopyLogDetails() *CopyLogDetails`
- New function `*PreferencesValidationResponseProperties.GetValidationInputResponse() *ValidationInputResponse`
- New function `DiskCopyLogDetails.MarshalJSON() ([]byte, error)`
- New function `JobsClientDeletePollerResponse.PollUntilDone(context.Context, time.Duration) (JobsClientDeleteResponse, error)`
- New function `JobSecrets.MarshalJSON() ([]byte, error)`
- New function `*CommonJobDetails.UnmarshalJSON([]byte) error`
- New function `*JobsClientCreatePoller.Done() bool`
- New function `HeavyAccountCopyLogDetails.MarshalJSON() ([]byte, error)`
- New function `*HeavyJobDetails.GetCommonJobDetails() *CommonJobDetails`
- New function `*JobsClientListPager.Err() error`
- New function `*AccountCopyLogDetails.UnmarshalJSON([]byte) error`
- New function `*SKUAvailabilityValidationRequest.GetValidationInputRequest() *ValidationInputRequest`
- New function `DiskJobDetails.MarshalJSON() ([]byte, error)`
- New function `*DiskCopyLogDetails.GetCopyLogDetails() *CopyLogDetails`
- New struct `AccountCopyLogDetails`
- New struct `CommonJobDetails`
- New struct `CommonJobSecrets`
- New struct `CommonScheduleAvailabilityRequest`
- New struct `CustomerDiskCopyLogDetails`
- New struct `CustomerDiskCopyProgress`
- New struct `CustomerDiskJobDetails`
- New struct `DiskCopyLogDetails`
- New struct `DiskCopyProgress`
- New struct `DiskJobDetails`
- New struct `DiskJobSecrets`
- New struct `HeavyAccountCopyLogDetails`
- New struct `HeavyJobDetails`
- New struct `HeavyJobSecrets`
- New struct `HeavySecret`
- New struct `JobsClientBeginCreateOptions`
- New struct `JobsClientBeginDeleteOptions`
- New struct `JobsClientBeginUpdateOptions`
- New struct `JobsClientBookShipmentPickUpOptions`
- New struct `JobsClientBookShipmentPickUpResponse`
- New struct `JobsClientBookShipmentPickUpResult`
- New struct `JobsClientCancelOptions`
- New struct `JobsClientCancelResponse`
- New struct `JobsClientCreatePoller`
- New struct `JobsClientCreatePollerResponse`
- New struct `JobsClientCreateResponse`
- New struct `JobsClientCreateResult`
- New struct `JobsClientDeletePoller`
- New struct `JobsClientDeletePollerResponse`
- New struct `JobsClientDeleteResponse`
- New struct `JobsClientGetOptions`
- New struct `JobsClientGetResponse`
- New struct `JobsClientGetResult`
- New struct `JobsClientListByResourceGroupOptions`
- New struct `JobsClientListByResourceGroupPager`
- New struct `JobsClientListByResourceGroupResponse`
- New struct `JobsClientListByResourceGroupResult`
- New struct `JobsClientListCredentialsOptions`
- New struct `JobsClientListCredentialsResponse`
- New struct `JobsClientListCredentialsResult`
- New struct `JobsClientListOptions`
- New struct `JobsClientListPager`
- New struct `JobsClientListResponse`
- New struct `JobsClientListResult`
- New struct `JobsClientMarkDevicesShippedOptions`
- New struct `JobsClientMarkDevicesShippedResponse`
- New struct `JobsClientUpdatePoller`
- New struct `JobsClientUpdatePollerResponse`
- New struct `JobsClientUpdateResponse`
- New struct `JobsClientUpdateResult`
- New struct `ManagementClient`
- New struct `ManagementClientMitigateOptions`
- New struct `ManagementClientMitigateResponse`
- New struct `OperationsClientListOptions`
- New struct `OperationsClientListPager`
- New struct `OperationsClientListResponse`
- New struct `OperationsClientListResult`
- New struct `Secret`
- New struct `ServiceClientListAvailableSKUsByResourceGroupOptions`
- New struct `ServiceClientListAvailableSKUsByResourceGroupPager`
- New struct `ServiceClientListAvailableSKUsByResourceGroupResponse`
- New struct `ServiceClientListAvailableSKUsByResourceGroupResult`
- New struct `ServiceClientRegionConfigurationByResourceGroupOptions`
- New struct `ServiceClientRegionConfigurationByResourceGroupResponse`
- New struct `ServiceClientRegionConfigurationByResourceGroupResult`
- New struct `ServiceClientRegionConfigurationOptions`
- New struct `ServiceClientRegionConfigurationResponse`
- New struct `ServiceClientRegionConfigurationResult`
- New struct `ServiceClientValidateAddressOptions`
- New struct `ServiceClientValidateAddressResponse`
- New struct `ServiceClientValidateAddressResult`
- New struct `ServiceClientValidateInputsByResourceGroupOptions`
- New struct `ServiceClientValidateInputsByResourceGroupResponse`
- New struct `ServiceClientValidateInputsByResourceGroupResult`
- New struct `ServiceClientValidateInputsOptions`
- New struct `ServiceClientValidateInputsResponse`
- New struct `ServiceClientValidateInputsResult`
- New field `ValidationType` in struct `SubscriptionIsAllowedToCreateJobValidationRequest`
- New field `ValidationType` in struct `SKUAvailabilityValidationResponseProperties`
- New field `Error` in struct `SKUAvailabilityValidationResponseProperties`
- New field `IndividualRequestDetails` in struct `CreateJobValidations`
- New field `ValidationCategory` in struct `CreateJobValidations`
- New field `DataAccountType` in struct `ManagedDiskDetails`
- New field `SharePassword` in struct `ManagedDiskDetails`
- New field `ValidationType` in struct `AddressValidationProperties`
- New field `Error` in struct `AddressValidationProperties`
- New field `StorageLocation` in struct `HeavyScheduleAvailabilityRequest`
- New field `Country` in struct `HeavyScheduleAvailabilityRequest`
- New field `SKUName` in struct `HeavyScheduleAvailabilityRequest`
- New field `ValidationType` in struct `ValidateAddress`
- New field `DcAccessSecurityCode` in struct `CustomerDiskJobSecrets`
- New field `Error` in struct `CustomerDiskJobSecrets`
- New field `JobSecretsType` in struct `CustomerDiskJobSecrets`
- New field `DevicePassword` in struct `JobDetails`
- New field `CopyProgress` in struct `JobDetails`
- New field `ValidationType` in struct `PreferencesValidationResponseProperties`
- New field `Error` in struct `PreferencesValidationResponseProperties`
- New field `ValidationType` in struct `SubscriptionIsAllowedToCreateJobValidationResponseProperties`
- New field `Error` in struct `SubscriptionIsAllowedToCreateJobValidationResponseProperties`
- New field `DataAccountType` in struct `StorageAccountDetails`
- New field `SharePassword` in struct `StorageAccountDetails`
- New field `ValidationType` in struct `SKUAvailabilityValidationRequest`
- New field `PodSecrets` in struct `JobSecrets`
- New field `ValidationType` in struct `PreferencesValidationRequest`
- New field `ValidationType` in struct `DataTransferDetailsValidationResponseProperties`
- New field `Error` in struct `DataTransferDetailsValidationResponseProperties`
- New field `DatacenterAddressType` in struct `DatacenterAddressInstructionResponse`
- New field `DataCenterAzureLocation` in struct `DatacenterAddressInstructionResponse`
- New field `SupportedCarriersForReturnShipment` in struct `DatacenterAddressInstructionResponse`
- New field `Tags` in struct `JobResource`
- New field `Location` in struct `JobResource`
- New field `SKU` in struct `JobResource`
- New field `Identity` in struct `JobResource`
- New field `ValidationType` in struct `DataTransferDetailsValidationRequest`
- New field `ValidationType` in struct `CreateOrderLimitForSubscriptionValidationRequest`
- New field `ValidationType` in struct `CreateOrderLimitForSubscriptionValidationResponseProperties`
- New field `Error` in struct `CreateOrderLimitForSubscriptionValidationResponseProperties`
- New field `SKUName` in struct `DiskScheduleAvailabilityRequest`
- New field `StorageLocation` in struct `DiskScheduleAvailabilityRequest`
- New field `Country` in struct `DiskScheduleAvailabilityRequest`
- New field `DatacenterAddressType` in struct `DatacenterAddressLocationResponse`
- New field `DataCenterAzureLocation` in struct `DatacenterAddressLocationResponse`
- New field `SupportedCarriersForReturnShipment` in struct `DatacenterAddressLocationResponse`
## 0.1.0 (2021-12-01)
- Initial preview release.

Просмотреть файл

@ -5,9 +5,9 @@
``` yaml
azure-arm: true
require:
- https://github.com/Azure/azure-rest-api-specs/blob/754938e4cb9416358b02dcc11f444adf14b3b7b6/specification/databox/resource-manager/readme.md
- https://github.com/Azure/azure-rest-api-specs/blob/754938e4cb9416358b02dcc11f444adf14b3b7b6/specification/databox/resource-manager/readme.go.md
- https://github.com/Azure/azure-rest-api-specs/blob/cf47fa91b882618a1043e3aeb5803b3a7397cd08/specification/databox/resource-manager/readme.md
- https://github.com/Azure/azure-rest-api-specs/blob/cf47fa91b882618a1043e3aeb5803b3a7397cd08/specification/databox/resource-manager/readme.go.md
license-header: MICROSOFT_MIT_NO_VERSION
module-version: 0.1.0
module-version: 0.2.0
```

Просмотреть файл

@ -3,7 +3,7 @@ module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/databox/armdatabox
go 1.16
require (
github.com/Azure/azure-sdk-for-go v59.3.0+incompatible
github.com/Azure/azure-sdk-for-go/sdk/azcore v0.20.0
github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.12.0
github.com/Azure/azure-sdk-for-go v61.3.0+incompatible
github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.0
github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.13.0
)

Просмотреть файл

@ -1,18 +1,28 @@
github.com/Azure/azure-sdk-for-go v59.3.0+incompatible h1:dPIm0BO4jsMXFcCI/sLTPkBtE7mk8WMuRHA0JeWhlcQ=
github.com/Azure/azure-sdk-for-go v59.3.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc=
github.com/Azure/azure-sdk-for-go/sdk/azcore v0.20.0 h1:KQgdWmEOmaJKxaUUZwHAYh12t+b+ZJf8q3friycK1kA=
github.com/Azure/azure-sdk-for-go/sdk/azcore v0.20.0/go.mod h1:ZPW/Z0kLCTdDZaDbYTetxc9Cxl/2lNqxYHYNOF2bti0=
github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.12.0 h1:VBvHGLJbaY0+c66NZHdS9cgjHVYSH6DDa0XJMyrblsI=
github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.12.0/go.mod h1:GJzjM4SR9T0KyX5gKCVyz1ytD8FeWeUPCwtFCt1AyfE=
github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.1 h1:BUYIbDf/mMZ8945v3QkG3OuqGVyS4Iek0AOLwdRAYoc=
github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.1/go.mod h1:KLF4gFr6DcKFZwSuH8w8yEK6DpFl3LP5rhdvAb7Yz5I=
github.com/Azure/azure-sdk-for-go v61.3.0+incompatible h1:k7MKrYcGwX5qh+fC9xVhcEuaZajFfbDYMEgo8oemTLo=
github.com/Azure/azure-sdk-for-go v61.3.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc=
github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.0 h1:8wVJL0HUP5yDFXvotdewORTw7Yu88JbreWN/mobSvsQ=
github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.0/go.mod h1:fBF9PQNqB8scdgpZ3ufzaLntG0AG7C1WjPMsiFOmfHM=
github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.13.0 h1:bLRntPH25SkY1uZ/YZW+dmxNky9r1fAHvDFrzluo+4Q=
github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.13.0/go.mod h1:TmXReXZ9yPp5D5TBRMTAtyz+UyOl15Py4hL5E5p6igQ=
github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.3 h1:E+m3SkZCN0Bf5q7YdTs5lSm2CYY3CK4spn5OmUIiQtk=
github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.3/go.mod h1:KLF4gFr6DcKFZwSuH8w8yEK6DpFl3LP5rhdvAb7Yz5I=
github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0 h1:WVsrXCnHlDDX8ls+tootqRE87/hL9S/g4ewig9RsD/c=
github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0/go.mod h1:Vt9sXTKwMyGcOxSmLDMnGPgqsUg7m8pe215qMLrDXw4=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/dnaeon/go-vcr v1.1.0 h1:ReYa/UBrRyQdant9B4fNHGoCNKw6qh6P0fsdGmZpR7c=
github.com/dnaeon/go-vcr v1.1.0/go.mod h1:M7tiix8f0r6mKKJ3Yq/kqU1OYf3MnfmBWVbPx/yU9ko=
github.com/golang-jwt/jwt v3.2.1+incompatible h1:73Z+4BJcrTC+KczS6WvTPvRGOp1WmfEP4Q1lOd9Z/+c=
github.com/golang-jwt/jwt v3.2.1+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I=
github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY=
github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc=
github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw=
github.com/modocache/gover v0.0.0-20171022184752-b58185e213c5/go.mod h1:caMODM3PzxT8aQXRPkAt8xlV/e7d7w8GM5g0fa5F0D8=
github.com/pkg/browser v0.0.0-20180916011732-0a3d74bf9ce4 h1:49lOXmGaUpV9Fz3gd7TFZY106KVlPVa5jcYD1gaQf98=
github.com/pkg/browser v0.0.0-20180916011732-0a3d74bf9ce4/go.mod h1:4OwLy04Bl9Ef3GJJCoec+30X3LQs/0/m4HFRt/2LUSA=
github.com/montanaflynn/stats v0.6.6/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow=
github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 h1:Qj1ukM4GlMWXNdMBuXcXfz/Kw9s1qm0CLY32QxuSImI=
github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4/go.mod h1:N6UoU20jOqggOuDwUaBQpluzLNDqif3kq9z2wpdYEfQ=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
@ -24,21 +34,27 @@ golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897 h1:pLI5jrR7OSLijeIDcmRxNm
golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20201010224723-4f7140c49acb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
golang.org/x/net v0.0.0-20210610132358-84b48f89b13b h1:k+E048sYJHyVnsr1GDrRZWQ32D2C7lWs9JRc0bel53A=
golang.org/x/net v0.0.0-20210610132358-84b48f89b13b/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f h1:OfiFi4JbukWwe3lzw+xunroH1mnC1e2Gy5cxNJApiSY=
golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20211019181941-9d821ace8654 h1:id054HUawV2/6IGm2IV8KZQjqtwAOo2CYlOToYqa0d0=
golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M=
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo=

Просмотреть файл

@ -17,13 +17,13 @@ import (
)
// x-ms-original-file: specification/databox/resource-manager/Microsoft.DataBox/preview/2021-08-01-preview/examples/JobMitigate.json
func ExampleDataBoxManagementClient_Mitigate() {
func ExampleManagementClient_Mitigate() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client := armdatabox.NewDataBoxManagementClient("<subscription-id>", cred, nil)
client := armdatabox.NewManagementClient("<subscription-id>", cred, nil)
_, err = client.Mitigate(ctx,
"<job-name>",
"<resource-group-name>",

Просмотреть файл

@ -27,13 +27,17 @@ func ExampleJobsClient_List() {
}
ctx := context.Background()
client := armdatabox.NewJobsClient("<subscription-id>", cred, nil)
pager := client.List(&armdatabox.JobsListOptions{SkipToken: nil})
for pager.NextPage(ctx) {
pager := client.List(&armdatabox.JobsClientListOptions{SkipToken: nil})
for {
nextResult := pager.NextPage(ctx)
if err := pager.Err(); err != nil {
log.Fatalf("failed to advance page: %v", err)
}
if !nextResult {
break
}
for _, v := range pager.PageResponse().Value {
log.Printf("JobResource.ID: %s\n", *v.ID)
log.Printf("Pager result: %#v\n", v)
}
}
}
@ -70,13 +74,17 @@ func ExampleJobsClient_ListByResourceGroup() {
ctx := context.Background()
client := armdatabox.NewJobsClient("<subscription-id>", cred, nil)
pager := client.ListByResourceGroup("<resource-group-name>",
&armdatabox.JobsListByResourceGroupOptions{SkipToken: nil})
for pager.NextPage(ctx) {
&armdatabox.JobsClientListByResourceGroupOptions{SkipToken: nil})
for {
nextResult := pager.NextPage(ctx)
if err := pager.Err(); err != nil {
log.Fatalf("failed to advance page: %v", err)
}
if !nextResult {
break
}
for _, v := range pager.PageResponse().Value {
log.Printf("JobResource.ID: %s\n", *v.ID)
log.Printf("Pager result: %#v\n", v)
}
}
}
@ -92,11 +100,11 @@ func ExampleJobsClient_Get() {
res, err := client.Get(ctx,
"<resource-group-name>",
"<job-name>",
&armdatabox.JobsGetOptions{Expand: to.StringPtr("<expand>")})
&armdatabox.JobsClientGetOptions{Expand: to.StringPtr("<expand>")})
if err != nil {
log.Fatal(err)
}
log.Printf("JobResource.ID: %s\n", *res.ID)
log.Printf("Response result: %#v\n", res.JobsClientGetResult)
}
// x-ms-original-file: specification/databox/resource-manager/Microsoft.DataBox/preview/2021-08-01-preview/examples/JobsCreate.json
@ -111,43 +119,37 @@ func ExampleJobsClient_BeginCreate() {
"<resource-group-name>",
"<job-name>",
armdatabox.JobResource{
Resource: armdatabox.Resource{
Location: to.StringPtr("<location>"),
SKU: &armdatabox.SKU{
Name: armdatabox.SKUNameDataBox.ToPtr(),
},
Location: to.StringPtr("<location>"),
SKU: &armdatabox.SKU{
Name: armdatabox.SKUNameDataBox.ToPtr(),
},
Properties: &armdatabox.JobProperties{
TransferType: armdatabox.TransferTypeImportToAzure.ToPtr(),
Details: &armdatabox.DataBoxJobDetails{
JobDetails: armdatabox.JobDetails{
ContactDetails: &armdatabox.ContactDetails{
ContactName: to.StringPtr("<contact-name>"),
EmailList: []*string{
to.StringPtr("testing@microsoft.com")},
Phone: to.StringPtr("<phone>"),
PhoneExtension: to.StringPtr("<phone-extension>"),
},
DataImportDetails: []*armdatabox.DataImportDetails{
{
AccountDetails: &armdatabox.StorageAccountDetails{
DataAccountDetails: armdatabox.DataAccountDetails{
DataAccountType: armdatabox.DataAccountTypeStorageAccount.ToPtr(),
},
StorageAccountID: to.StringPtr("<storage-account-id>"),
},
}},
JobDetailsType: armdatabox.ClassDiscriminatorDataBox.ToPtr(),
ShippingAddress: &armdatabox.ShippingAddress{
AddressType: armdatabox.AddressTypeCommercial.ToPtr(),
City: to.StringPtr("<city>"),
CompanyName: to.StringPtr("<company-name>"),
Country: to.StringPtr("<country>"),
PostalCode: to.StringPtr("<postal-code>"),
StateOrProvince: to.StringPtr("<state-or-province>"),
StreetAddress1: to.StringPtr("<street-address1>"),
StreetAddress2: to.StringPtr("<street-address2>"),
},
Details: &armdatabox.JobDetails{
ContactDetails: &armdatabox.ContactDetails{
ContactName: to.StringPtr("<contact-name>"),
EmailList: []*string{
to.StringPtr("testing@microsoft.com")},
Phone: to.StringPtr("<phone>"),
PhoneExtension: to.StringPtr("<phone-extension>"),
},
DataImportDetails: []*armdatabox.DataImportDetails{
{
AccountDetails: &armdatabox.StorageAccountDetails{
DataAccountType: armdatabox.DataAccountTypeStorageAccount.ToPtr(),
StorageAccountID: to.StringPtr("<storage-account-id>"),
},
}},
JobDetailsType: armdatabox.ClassDiscriminatorDataBox.ToPtr(),
ShippingAddress: &armdatabox.ShippingAddress{
AddressType: armdatabox.AddressTypeCommercial.ToPtr(),
City: to.StringPtr("<city>"),
CompanyName: to.StringPtr("<company-name>"),
Country: to.StringPtr("<country>"),
PostalCode: to.StringPtr("<postal-code>"),
StateOrProvince: to.StringPtr("<state-or-province>"),
StreetAddress1: to.StringPtr("<street-address1>"),
StreetAddress2: to.StringPtr("<street-address2>"),
},
},
},
@ -160,7 +162,7 @@ func ExampleJobsClient_BeginCreate() {
if err != nil {
log.Fatal(err)
}
log.Printf("JobResource.ID: %s\n", *res.ID)
log.Printf("Response result: %#v\n", res.JobsClientCreateResult)
}
// x-ms-original-file: specification/databox/resource-manager/Microsoft.DataBox/preview/2021-08-01-preview/examples/JobsDelete.json
@ -218,7 +220,7 @@ func ExampleJobsClient_BeginUpdate() {
},
},
},
&armdatabox.JobsBeginUpdateOptions{IfMatch: nil})
&armdatabox.JobsClientBeginUpdateOptions{IfMatch: nil})
if err != nil {
log.Fatal(err)
}
@ -226,7 +228,7 @@ func ExampleJobsClient_BeginUpdate() {
if err != nil {
log.Fatal(err)
}
log.Printf("JobResource.ID: %s\n", *res.ID)
log.Printf("Response result: %#v\n", res.JobsClientUpdateResult)
}
// x-ms-original-file: specification/databox/resource-manager/Microsoft.DataBox/preview/2021-08-01-preview/examples/BookShipmentPickupPost.json
@ -237,7 +239,7 @@ func ExampleJobsClient_BookShipmentPickUp() {
}
ctx := context.Background()
client := armdatabox.NewJobsClient("<subscription-id>", cred, nil)
_, err = client.BookShipmentPickUp(ctx,
res, err := client.BookShipmentPickUp(ctx,
"<resource-group-name>",
"<job-name>",
armdatabox.ShipmentPickUpRequest{
@ -249,6 +251,7 @@ func ExampleJobsClient_BookShipmentPickUp() {
if err != nil {
log.Fatal(err)
}
log.Printf("Response result: %#v\n", res.JobsClientBookShipmentPickUpResult)
}
// x-ms-original-file: specification/databox/resource-manager/Microsoft.DataBox/preview/2021-08-01-preview/examples/JobsCancelPost.json
@ -279,11 +282,12 @@ func ExampleJobsClient_ListCredentials() {
}
ctx := context.Background()
client := armdatabox.NewJobsClient("<subscription-id>", cred, nil)
_, err = client.ListCredentials(ctx,
res, err := client.ListCredentials(ctx,
"<resource-group-name>",
"<job-name>",
nil)
if err != nil {
log.Fatal(err)
}
log.Printf("Response result: %#v\n", res.JobsClientListCredentialsResult)
}

Просмотреть файл

@ -25,9 +25,16 @@ func ExampleOperationsClient_List() {
ctx := context.Background()
client := armdatabox.NewOperationsClient(cred, nil)
pager := client.List(nil)
for pager.NextPage(ctx) {
for {
nextResult := pager.NextPage(ctx)
if err := pager.Err(); err != nil {
log.Fatalf("failed to advance page: %v", err)
}
if !nextResult {
break
}
for _, v := range pager.PageResponse().Value {
log.Printf("Pager result: %#v\n", v)
}
}
}

Просмотреть файл

@ -17,29 +17,6 @@ import (
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/databox/armdatabox"
)
// x-ms-original-file: specification/databox/resource-manager/Microsoft.DataBox/preview/2021-08-01-preview/examples/AvailableSkusPost.json
func ExampleServiceClient_ListAvailableSKUsByResourceGroup() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client := armdatabox.NewServiceClient("<subscription-id>", cred, nil)
pager := client.ListAvailableSKUsByResourceGroup("<resource-group-name>",
"<location>",
armdatabox.AvailableSKURequest{
Country: to.StringPtr("<country>"),
Location: to.StringPtr("<location>"),
TransferType: armdatabox.TransferTypeImportToAzure.ToPtr(),
},
nil)
for pager.NextPage(ctx) {
if err := pager.Err(); err != nil {
log.Fatalf("failed to advance page: %v", err)
}
}
}
// x-ms-original-file: specification/databox/resource-manager/Microsoft.DataBox/preview/2021-08-01-preview/examples/ValidateAddressPost.json
func ExampleServiceClient_ValidateAddress() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
@ -48,13 +25,11 @@ func ExampleServiceClient_ValidateAddress() {
}
ctx := context.Background()
client := armdatabox.NewServiceClient("<subscription-id>", cred, nil)
_, err = client.ValidateAddress(ctx,
res, err := client.ValidateAddress(ctx,
"<location>",
armdatabox.ValidateAddress{
ValidationInputRequest: armdatabox.ValidationInputRequest{
ValidationType: armdatabox.ValidationInputDiscriminatorValidateAddress.ToPtr(),
},
DeviceType: armdatabox.SKUNameDataBox.ToPtr(),
ValidationType: armdatabox.ValidationInputDiscriminatorValidateAddress.ToPtr(),
DeviceType: armdatabox.SKUNameDataBox.ToPtr(),
ShippingAddress: &armdatabox.ShippingAddress{
AddressType: armdatabox.AddressTypeCommercial.ToPtr(),
City: to.StringPtr("<city>"),
@ -70,6 +45,7 @@ func ExampleServiceClient_ValidateAddress() {
if err != nil {
log.Fatal(err)
}
log.Printf("Response result: %#v\n", res.ServiceClientValidateAddressResult)
}
// x-ms-original-file: specification/databox/resource-manager/Microsoft.DataBox/preview/2021-08-01-preview/examples/ValidateInputsByResourceGroup.json
@ -80,85 +56,70 @@ func ExampleServiceClient_ValidateInputsByResourceGroup() {
}
ctx := context.Background()
client := armdatabox.NewServiceClient("<subscription-id>", cred, nil)
_, err = client.ValidateInputsByResourceGroup(ctx,
res, err := client.ValidateInputsByResourceGroup(ctx,
"<resource-group-name>",
"<location>",
&armdatabox.CreateJobValidations{
ValidationRequest: armdatabox.ValidationRequest{
IndividualRequestDetails: []armdatabox.ValidationInputRequestClassification{
&armdatabox.DataTransferDetailsValidationRequest{
ValidationInputRequest: armdatabox.ValidationInputRequest{
ValidationType: armdatabox.ValidationInputDiscriminatorValidateDataTransferDetails.ToPtr(),
},
DataImportDetails: []*armdatabox.DataImportDetails{
{
AccountDetails: &armdatabox.StorageAccountDetails{
DataAccountDetails: armdatabox.DataAccountDetails{
DataAccountType: armdatabox.DataAccountTypeStorageAccount.ToPtr(),
},
StorageAccountID: to.StringPtr("<storage-account-id>"),
},
}},
DeviceType: armdatabox.SKUNameDataBox.ToPtr(),
TransferType: armdatabox.TransferTypeImportToAzure.ToPtr(),
IndividualRequestDetails: []armdatabox.ValidationInputRequestClassification{
&armdatabox.DataTransferDetailsValidationRequest{
ValidationType: armdatabox.ValidationInputDiscriminatorValidateDataTransferDetails.ToPtr(),
DataImportDetails: []*armdatabox.DataImportDetails{
{
AccountDetails: &armdatabox.StorageAccountDetails{
DataAccountType: armdatabox.DataAccountTypeStorageAccount.ToPtr(),
StorageAccountID: to.StringPtr("<storage-account-id>"),
},
}},
DeviceType: armdatabox.SKUNameDataBox.ToPtr(),
TransferType: armdatabox.TransferTypeImportToAzure.ToPtr(),
},
&armdatabox.ValidateAddress{
ValidationType: armdatabox.ValidationInputDiscriminatorValidateAddress.ToPtr(),
DeviceType: armdatabox.SKUNameDataBox.ToPtr(),
ShippingAddress: &armdatabox.ShippingAddress{
AddressType: armdatabox.AddressTypeCommercial.ToPtr(),
City: to.StringPtr("<city>"),
CompanyName: to.StringPtr("<company-name>"),
Country: to.StringPtr("<country>"),
PostalCode: to.StringPtr("<postal-code>"),
StateOrProvince: to.StringPtr("<state-or-province>"),
StreetAddress1: to.StringPtr("<street-address1>"),
StreetAddress2: to.StringPtr("<street-address2>"),
},
&armdatabox.ValidateAddress{
ValidationInputRequest: armdatabox.ValidationInputRequest{
ValidationType: armdatabox.ValidationInputDiscriminatorValidateAddress.ToPtr(),
},
DeviceType: armdatabox.SKUNameDataBox.ToPtr(),
ShippingAddress: &armdatabox.ShippingAddress{
AddressType: armdatabox.AddressTypeCommercial.ToPtr(),
City: to.StringPtr("<city>"),
CompanyName: to.StringPtr("<company-name>"),
Country: to.StringPtr("<country>"),
PostalCode: to.StringPtr("<postal-code>"),
StateOrProvince: to.StringPtr("<state-or-province>"),
StreetAddress1: to.StringPtr("<street-address1>"),
StreetAddress2: to.StringPtr("<street-address2>"),
},
TransportPreferences: &armdatabox.TransportPreferences{
PreferredShipmentType: armdatabox.TransportShipmentTypesMicrosoftManaged.ToPtr(),
},
},
&armdatabox.SubscriptionIsAllowedToCreateJobValidationRequest{
ValidationType: armdatabox.ValidationInputDiscriminatorValidateSubscriptionIsAllowedToCreateJob.ToPtr(),
},
&armdatabox.SKUAvailabilityValidationRequest{
ValidationType: armdatabox.ValidationInputDiscriminatorValidateSKUAvailability.ToPtr(),
Country: to.StringPtr("<country>"),
DeviceType: armdatabox.SKUNameDataBox.ToPtr(),
Location: to.StringPtr("<location>"),
TransferType: armdatabox.TransferTypeImportToAzure.ToPtr(),
},
&armdatabox.CreateOrderLimitForSubscriptionValidationRequest{
ValidationType: armdatabox.ValidationInputDiscriminatorValidateCreateOrderLimit.ToPtr(),
DeviceType: armdatabox.SKUNameDataBox.ToPtr(),
},
&armdatabox.PreferencesValidationRequest{
ValidationType: armdatabox.ValidationInputDiscriminatorValidatePreferences.ToPtr(),
DeviceType: armdatabox.SKUNameDataBox.ToPtr(),
Preference: &armdatabox.Preferences{
TransportPreferences: &armdatabox.TransportPreferences{
PreferredShipmentType: armdatabox.TransportShipmentTypesMicrosoftManaged.ToPtr(),
},
},
&armdatabox.SubscriptionIsAllowedToCreateJobValidationRequest{
ValidationInputRequest: armdatabox.ValidationInputRequest{
ValidationType: armdatabox.ValidationInputDiscriminatorValidateSubscriptionIsAllowedToCreateJob.ToPtr(),
},
},
&armdatabox.SKUAvailabilityValidationRequest{
ValidationInputRequest: armdatabox.ValidationInputRequest{
ValidationType: armdatabox.ValidationInputDiscriminatorValidateSKUAvailability.ToPtr(),
},
Country: to.StringPtr("<country>"),
DeviceType: armdatabox.SKUNameDataBox.ToPtr(),
Location: to.StringPtr("<location>"),
TransferType: armdatabox.TransferTypeImportToAzure.ToPtr(),
},
&armdatabox.CreateOrderLimitForSubscriptionValidationRequest{
ValidationInputRequest: armdatabox.ValidationInputRequest{
ValidationType: armdatabox.ValidationInputDiscriminatorValidateCreateOrderLimit.ToPtr(),
},
DeviceType: armdatabox.SKUNameDataBox.ToPtr(),
},
&armdatabox.PreferencesValidationRequest{
ValidationInputRequest: armdatabox.ValidationInputRequest{
ValidationType: armdatabox.ValidationInputDiscriminatorValidatePreferences.ToPtr(),
},
DeviceType: armdatabox.SKUNameDataBox.ToPtr(),
Preference: &armdatabox.Preferences{
TransportPreferences: &armdatabox.TransportPreferences{
PreferredShipmentType: armdatabox.TransportShipmentTypesMicrosoftManaged.ToPtr(),
},
},
}},
ValidationCategory: to.StringPtr("<validation-category>"),
},
}},
ValidationCategory: to.StringPtr("<validation-category>"),
},
nil)
if err != nil {
log.Fatal(err)
}
log.Printf("Response result: %#v\n", res.ServiceClientValidateInputsByResourceGroupResult)
}
// x-ms-original-file: specification/databox/resource-manager/Microsoft.DataBox/preview/2021-08-01-preview/examples/ValidateInputs.json
@ -169,84 +130,69 @@ func ExampleServiceClient_ValidateInputs() {
}
ctx := context.Background()
client := armdatabox.NewServiceClient("<subscription-id>", cred, nil)
_, err = client.ValidateInputs(ctx,
res, err := client.ValidateInputs(ctx,
"<location>",
&armdatabox.CreateJobValidations{
ValidationRequest: armdatabox.ValidationRequest{
IndividualRequestDetails: []armdatabox.ValidationInputRequestClassification{
&armdatabox.DataTransferDetailsValidationRequest{
ValidationInputRequest: armdatabox.ValidationInputRequest{
ValidationType: armdatabox.ValidationInputDiscriminatorValidateDataTransferDetails.ToPtr(),
},
DataImportDetails: []*armdatabox.DataImportDetails{
{
AccountDetails: &armdatabox.StorageAccountDetails{
DataAccountDetails: armdatabox.DataAccountDetails{
DataAccountType: armdatabox.DataAccountTypeStorageAccount.ToPtr(),
},
StorageAccountID: to.StringPtr("<storage-account-id>"),
},
}},
DeviceType: armdatabox.SKUNameDataBox.ToPtr(),
TransferType: armdatabox.TransferTypeImportToAzure.ToPtr(),
IndividualRequestDetails: []armdatabox.ValidationInputRequestClassification{
&armdatabox.DataTransferDetailsValidationRequest{
ValidationType: armdatabox.ValidationInputDiscriminatorValidateDataTransferDetails.ToPtr(),
DataImportDetails: []*armdatabox.DataImportDetails{
{
AccountDetails: &armdatabox.StorageAccountDetails{
DataAccountType: armdatabox.DataAccountTypeStorageAccount.ToPtr(),
StorageAccountID: to.StringPtr("<storage-account-id>"),
},
}},
DeviceType: armdatabox.SKUNameDataBox.ToPtr(),
TransferType: armdatabox.TransferTypeImportToAzure.ToPtr(),
},
&armdatabox.ValidateAddress{
ValidationType: armdatabox.ValidationInputDiscriminatorValidateAddress.ToPtr(),
DeviceType: armdatabox.SKUNameDataBox.ToPtr(),
ShippingAddress: &armdatabox.ShippingAddress{
AddressType: armdatabox.AddressTypeCommercial.ToPtr(),
City: to.StringPtr("<city>"),
CompanyName: to.StringPtr("<company-name>"),
Country: to.StringPtr("<country>"),
PostalCode: to.StringPtr("<postal-code>"),
StateOrProvince: to.StringPtr("<state-or-province>"),
StreetAddress1: to.StringPtr("<street-address1>"),
StreetAddress2: to.StringPtr("<street-address2>"),
},
&armdatabox.ValidateAddress{
ValidationInputRequest: armdatabox.ValidationInputRequest{
ValidationType: armdatabox.ValidationInputDiscriminatorValidateAddress.ToPtr(),
},
DeviceType: armdatabox.SKUNameDataBox.ToPtr(),
ShippingAddress: &armdatabox.ShippingAddress{
AddressType: armdatabox.AddressTypeCommercial.ToPtr(),
City: to.StringPtr("<city>"),
CompanyName: to.StringPtr("<company-name>"),
Country: to.StringPtr("<country>"),
PostalCode: to.StringPtr("<postal-code>"),
StateOrProvince: to.StringPtr("<state-or-province>"),
StreetAddress1: to.StringPtr("<street-address1>"),
StreetAddress2: to.StringPtr("<street-address2>"),
},
TransportPreferences: &armdatabox.TransportPreferences{
PreferredShipmentType: armdatabox.TransportShipmentTypesMicrosoftManaged.ToPtr(),
},
},
&armdatabox.SubscriptionIsAllowedToCreateJobValidationRequest{
ValidationType: armdatabox.ValidationInputDiscriminatorValidateSubscriptionIsAllowedToCreateJob.ToPtr(),
},
&armdatabox.SKUAvailabilityValidationRequest{
ValidationType: armdatabox.ValidationInputDiscriminatorValidateSKUAvailability.ToPtr(),
Country: to.StringPtr("<country>"),
DeviceType: armdatabox.SKUNameDataBox.ToPtr(),
Location: to.StringPtr("<location>"),
TransferType: armdatabox.TransferTypeImportToAzure.ToPtr(),
},
&armdatabox.CreateOrderLimitForSubscriptionValidationRequest{
ValidationType: armdatabox.ValidationInputDiscriminatorValidateCreateOrderLimit.ToPtr(),
DeviceType: armdatabox.SKUNameDataBox.ToPtr(),
},
&armdatabox.PreferencesValidationRequest{
ValidationType: armdatabox.ValidationInputDiscriminatorValidatePreferences.ToPtr(),
DeviceType: armdatabox.SKUNameDataBox.ToPtr(),
Preference: &armdatabox.Preferences{
TransportPreferences: &armdatabox.TransportPreferences{
PreferredShipmentType: armdatabox.TransportShipmentTypesMicrosoftManaged.ToPtr(),
},
},
&armdatabox.SubscriptionIsAllowedToCreateJobValidationRequest{
ValidationInputRequest: armdatabox.ValidationInputRequest{
ValidationType: armdatabox.ValidationInputDiscriminatorValidateSubscriptionIsAllowedToCreateJob.ToPtr(),
},
},
&armdatabox.SKUAvailabilityValidationRequest{
ValidationInputRequest: armdatabox.ValidationInputRequest{
ValidationType: armdatabox.ValidationInputDiscriminatorValidateSKUAvailability.ToPtr(),
},
Country: to.StringPtr("<country>"),
DeviceType: armdatabox.SKUNameDataBox.ToPtr(),
Location: to.StringPtr("<location>"),
TransferType: armdatabox.TransferTypeImportToAzure.ToPtr(),
},
&armdatabox.CreateOrderLimitForSubscriptionValidationRequest{
ValidationInputRequest: armdatabox.ValidationInputRequest{
ValidationType: armdatabox.ValidationInputDiscriminatorValidateCreateOrderLimit.ToPtr(),
},
DeviceType: armdatabox.SKUNameDataBox.ToPtr(),
},
&armdatabox.PreferencesValidationRequest{
ValidationInputRequest: armdatabox.ValidationInputRequest{
ValidationType: armdatabox.ValidationInputDiscriminatorValidatePreferences.ToPtr(),
},
DeviceType: armdatabox.SKUNameDataBox.ToPtr(),
Preference: &armdatabox.Preferences{
TransportPreferences: &armdatabox.TransportPreferences{
PreferredShipmentType: armdatabox.TransportShipmentTypesMicrosoftManaged.ToPtr(),
},
},
}},
ValidationCategory: to.StringPtr("<validation-category>"),
},
}},
ValidationCategory: to.StringPtr("<validation-category>"),
},
nil)
if err != nil {
log.Fatal(err)
}
log.Printf("Response result: %#v\n", res.ServiceClientValidateInputsResult)
}
// x-ms-original-file: specification/databox/resource-manager/Microsoft.DataBox/preview/2021-08-01-preview/examples/RegionConfiguration.json
@ -257,20 +203,19 @@ func ExampleServiceClient_RegionConfiguration() {
}
ctx := context.Background()
client := armdatabox.NewServiceClient("<subscription-id>", cred, nil)
_, err = client.RegionConfiguration(ctx,
res, err := client.RegionConfiguration(ctx,
"<location>",
armdatabox.RegionConfigurationRequest{
ScheduleAvailabilityRequest: &armdatabox.DataBoxScheduleAvailabilityRequest{
ScheduleAvailabilityRequest: armdatabox.ScheduleAvailabilityRequest{
SKUName: armdatabox.SKUNameDataBox.ToPtr(),
StorageLocation: to.StringPtr("<storage-location>"),
},
ScheduleAvailabilityRequest: &armdatabox.ScheduleAvailabilityRequest{
SKUName: armdatabox.SKUNameDataBox.ToPtr(),
StorageLocation: to.StringPtr("<storage-location>"),
},
},
nil)
if err != nil {
log.Fatal(err)
}
log.Printf("Response result: %#v\n", res.ServiceClientRegionConfigurationResult)
}
// x-ms-original-file: specification/databox/resource-manager/Microsoft.DataBox/preview/2021-08-01-preview/examples/RegionConfigurationByResourceGroup.json
@ -281,19 +226,18 @@ func ExampleServiceClient_RegionConfigurationByResourceGroup() {
}
ctx := context.Background()
client := armdatabox.NewServiceClient("<subscription-id>", cred, nil)
_, err = client.RegionConfigurationByResourceGroup(ctx,
res, err := client.RegionConfigurationByResourceGroup(ctx,
"<resource-group-name>",
"<location>",
armdatabox.RegionConfigurationRequest{
ScheduleAvailabilityRequest: &armdatabox.DataBoxScheduleAvailabilityRequest{
ScheduleAvailabilityRequest: armdatabox.ScheduleAvailabilityRequest{
SKUName: armdatabox.SKUNameDataBox.ToPtr(),
StorageLocation: to.StringPtr("<storage-location>"),
},
ScheduleAvailabilityRequest: &armdatabox.ScheduleAvailabilityRequest{
SKUName: armdatabox.SKUNameDataBox.ToPtr(),
StorageLocation: to.StringPtr("<storage-location>"),
},
},
nil)
if err != nil {
log.Fatal(err)
}
log.Printf("Response result: %#v\n", res.ServiceClientRegionConfigurationByResourceGroupResult)
}

Просмотреть файл

@ -9,8 +9,8 @@
package armdatabox
const (
module = "armdatabox"
version = "v0.1.0"
moduleName = "armdatabox"
moduleVersion = "v0.2.0"
)
type AccessProtocol string
@ -187,6 +187,7 @@ func (c CopyStatus) ToPtr() *CopyStatus {
return &c
}
// CustomerResolutionCode - Resolution code provided by customer
type CustomerResolutionCode string
const (
@ -571,7 +572,8 @@ const (
SKUDisabledReasonFeature SKUDisabledReason = "Feature"
// SKUDisabledReasonOfferType - Subscription does not have required offer types for the SKU.
SKUDisabledReasonOfferType SKUDisabledReason = "OfferType"
// SKUDisabledReasonNoSubscriptionInfo - Subscription has not registered to Microsoft.DataBox and Service does not have the subscription notification.
// SKUDisabledReasonNoSubscriptionInfo - Subscription has not registered to Microsoft.DataBox and Service does not have the
// subscription notification.
SKUDisabledReasonNoSubscriptionInfo SKUDisabledReason = "NoSubscriptionInfo"
)
@ -863,12 +865,13 @@ type ValidationInputDiscriminator string
const (
// ValidationInputDiscriminatorValidateAddress - Identify request and response of address validation.
ValidationInputDiscriminatorValidateAddress ValidationInputDiscriminator = "ValidateAddress"
// ValidationInputDiscriminatorValidateSubscriptionIsAllowedToCreateJob - Identify request and response for validation of subscription permission to create
// job.
// ValidationInputDiscriminatorValidateSubscriptionIsAllowedToCreateJob - Identify request and response for validation of
// subscription permission to create job.
ValidationInputDiscriminatorValidateSubscriptionIsAllowedToCreateJob ValidationInputDiscriminator = "ValidateSubscriptionIsAllowedToCreateJob"
// ValidationInputDiscriminatorValidatePreferences - Identify request and response of preference validation.
ValidationInputDiscriminatorValidatePreferences ValidationInputDiscriminator = "ValidatePreferences"
// ValidationInputDiscriminatorValidateCreateOrderLimit - Identify request and response of create order limit for subscription validation.
// ValidationInputDiscriminatorValidateCreateOrderLimit - Identify request and response of create order limit for subscription
// validation.
ValidationInputDiscriminatorValidateCreateOrderLimit ValidationInputDiscriminator = "ValidateCreateOrderLimit"
// ValidationInputDiscriminatorValidateSKUAvailability - Identify request and response of active job limit for sku availability.
ValidationInputDiscriminatorValidateSKUAvailability ValidationInputDiscriminator = "ValidateSkuAvailability"

Просмотреть файл

@ -11,7 +11,6 @@ package armdatabox
import (
"context"
"errors"
"fmt"
"github.com/Azure/azure-sdk-for-go/sdk/azcore"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime"
@ -25,42 +24,55 @@ import (
// JobsClient contains the methods for the Jobs group.
// Don't use this type directly, use NewJobsClient() instead.
type JobsClient struct {
ep string
pl runtime.Pipeline
host string
subscriptionID string
pl runtime.Pipeline
}
// NewJobsClient creates a new instance of JobsClient with the specified values.
// subscriptionID - The Subscription Id
// credential - used to authorize requests. Usually a credential from azidentity.
// options - pass nil to accept the default values.
func NewJobsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *JobsClient {
cp := arm.ClientOptions{}
if options != nil {
cp = *options
if options == nil {
options = &arm.ClientOptions{}
}
if len(cp.Host) == 0 {
cp.Host = arm.AzurePublicCloud
ep := options.Endpoint
if len(ep) == 0 {
ep = arm.AzurePublicCloud
}
return &JobsClient{subscriptionID: subscriptionID, ep: string(cp.Host), pl: armruntime.NewPipeline(module, version, credential, &cp)}
client := &JobsClient{
subscriptionID: subscriptionID,
host: string(ep),
pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options),
}
return client
}
// BookShipmentPickUp - Book shipment pick up.
// If the operation fails it returns the *APIError error type.
func (client *JobsClient) BookShipmentPickUp(ctx context.Context, resourceGroupName string, jobName string, shipmentPickUpRequest ShipmentPickUpRequest, options *JobsBookShipmentPickUpOptions) (JobsBookShipmentPickUpResponse, error) {
// If the operation fails it returns an *azcore.ResponseError type.
// 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
// shipmentPickUpRequest - Details of shipment pick up request.
// options - JobsClientBookShipmentPickUpOptions contains the optional parameters for the JobsClient.BookShipmentPickUp method.
func (client *JobsClient) BookShipmentPickUp(ctx context.Context, resourceGroupName string, jobName string, shipmentPickUpRequest ShipmentPickUpRequest, options *JobsClientBookShipmentPickUpOptions) (JobsClientBookShipmentPickUpResponse, error) {
req, err := client.bookShipmentPickUpCreateRequest(ctx, resourceGroupName, jobName, shipmentPickUpRequest, options)
if err != nil {
return JobsBookShipmentPickUpResponse{}, err
return JobsClientBookShipmentPickUpResponse{}, err
}
resp, err := client.pl.Do(req)
if err != nil {
return JobsBookShipmentPickUpResponse{}, err
return JobsClientBookShipmentPickUpResponse{}, err
}
if !runtime.HasStatusCode(resp, http.StatusOK) {
return JobsBookShipmentPickUpResponse{}, client.bookShipmentPickUpHandleError(resp)
return JobsClientBookShipmentPickUpResponse{}, runtime.NewResponseError(resp)
}
return client.bookShipmentPickUpHandleResponse(resp)
}
// bookShipmentPickUpCreateRequest creates the BookShipmentPickUp request.
func (client *JobsClient) bookShipmentPickUpCreateRequest(ctx context.Context, resourceGroupName string, jobName string, shipmentPickUpRequest ShipmentPickUpRequest, options *JobsBookShipmentPickUpOptions) (*policy.Request, error) {
func (client *JobsClient) bookShipmentPickUpCreateRequest(ctx context.Context, resourceGroupName string, jobName string, shipmentPickUpRequest ShipmentPickUpRequest, options *JobsClientBookShipmentPickUpOptions) (*policy.Request, error) {
urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/bookShipmentPickUp"
if client.subscriptionID == "" {
return nil, errors.New("parameter client.subscriptionID cannot be empty")
@ -74,7 +86,7 @@ func (client *JobsClient) bookShipmentPickUpCreateRequest(ctx context.Context, r
return nil, errors.New("parameter jobName cannot be empty")
}
urlPath = strings.ReplaceAll(urlPath, "{jobName}", url.PathEscape(jobName))
req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath))
req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath))
if err != nil {
return nil, err
}
@ -86,46 +98,38 @@ func (client *JobsClient) bookShipmentPickUpCreateRequest(ctx context.Context, r
}
// bookShipmentPickUpHandleResponse handles the BookShipmentPickUp response.
func (client *JobsClient) bookShipmentPickUpHandleResponse(resp *http.Response) (JobsBookShipmentPickUpResponse, error) {
result := JobsBookShipmentPickUpResponse{RawResponse: resp}
func (client *JobsClient) bookShipmentPickUpHandleResponse(resp *http.Response) (JobsClientBookShipmentPickUpResponse, error) {
result := JobsClientBookShipmentPickUpResponse{RawResponse: resp}
if err := runtime.UnmarshalAsJSON(resp, &result.ShipmentPickUpResponse); err != nil {
return JobsBookShipmentPickUpResponse{}, runtime.NewResponseError(err, resp)
return JobsClientBookShipmentPickUpResponse{}, err
}
return result, nil
}
// bookShipmentPickUpHandleError handles the BookShipmentPickUp error response.
func (client *JobsClient) bookShipmentPickUpHandleError(resp *http.Response) error {
body, err := runtime.Payload(resp)
if err != nil {
return runtime.NewResponseError(err, resp)
}
errType := APIError{raw: string(body)}
if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil {
return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp)
}
return runtime.NewResponseError(&errType, resp)
}
// Cancel - CancelJob.
// If the operation fails it returns the *APIError error type.
func (client *JobsClient) Cancel(ctx context.Context, resourceGroupName string, jobName string, cancellationReason CancellationReason, options *JobsCancelOptions) (JobsCancelResponse, error) {
// If the operation fails it returns an *azcore.ResponseError type.
// 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
// cancellationReason - Reason for cancellation.
// options - JobsClientCancelOptions contains the optional parameters for the JobsClient.Cancel method.
func (client *JobsClient) Cancel(ctx context.Context, resourceGroupName string, jobName string, cancellationReason CancellationReason, options *JobsClientCancelOptions) (JobsClientCancelResponse, error) {
req, err := client.cancelCreateRequest(ctx, resourceGroupName, jobName, cancellationReason, options)
if err != nil {
return JobsCancelResponse{}, err
return JobsClientCancelResponse{}, err
}
resp, err := client.pl.Do(req)
if err != nil {
return JobsCancelResponse{}, err
return JobsClientCancelResponse{}, err
}
if !runtime.HasStatusCode(resp, http.StatusNoContent) {
return JobsCancelResponse{}, client.cancelHandleError(resp)
return JobsClientCancelResponse{}, runtime.NewResponseError(resp)
}
return JobsCancelResponse{RawResponse: resp}, nil
return JobsClientCancelResponse{RawResponse: resp}, nil
}
// cancelCreateRequest creates the Cancel request.
func (client *JobsClient) cancelCreateRequest(ctx context.Context, resourceGroupName string, jobName string, cancellationReason CancellationReason, options *JobsCancelOptions) (*policy.Request, error) {
func (client *JobsClient) cancelCreateRequest(ctx context.Context, resourceGroupName string, jobName string, cancellationReason CancellationReason, options *JobsClientCancelOptions) (*policy.Request, error) {
urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/cancel"
if client.subscriptionID == "" {
return nil, errors.New("parameter client.subscriptionID cannot be empty")
@ -139,7 +143,7 @@ func (client *JobsClient) cancelCreateRequest(ctx context.Context, resourceGroup
return nil, errors.New("parameter jobName cannot be empty")
}
urlPath = strings.ReplaceAll(urlPath, "{jobName}", url.PathEscape(jobName))
req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath))
req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath))
if err != nil {
return nil, err
}
@ -150,44 +154,36 @@ func (client *JobsClient) cancelCreateRequest(ctx context.Context, resourceGroup
return req, runtime.MarshalAsJSON(req, cancellationReason)
}
// cancelHandleError handles the Cancel error response.
func (client *JobsClient) cancelHandleError(resp *http.Response) error {
body, err := runtime.Payload(resp)
if err != nil {
return runtime.NewResponseError(err, resp)
}
errType := APIError{raw: string(body)}
if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil {
return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp)
}
return runtime.NewResponseError(&errType, resp)
}
// BeginCreate - Creates a new job with the specified parameters. Existing job cannot be updated with this API and should instead be updated with the Update
// job API.
// If the operation fails it returns the *APIError error type.
func (client *JobsClient) BeginCreate(ctx context.Context, resourceGroupName string, jobName string, jobResource JobResource, options *JobsBeginCreateOptions) (JobsCreatePollerResponse, error) {
// BeginCreate - Creates a new job with the specified parameters. Existing job cannot be updated with this API and should
// instead be updated with the Update job API.
// If the operation fails it returns an *azcore.ResponseError type.
// 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
// jobResource - Job details from request body.
// options - JobsClientBeginCreateOptions contains the optional parameters for the JobsClient.BeginCreate method.
func (client *JobsClient) BeginCreate(ctx context.Context, resourceGroupName string, jobName string, jobResource JobResource, options *JobsClientBeginCreateOptions) (JobsClientCreatePollerResponse, error) {
resp, err := client.create(ctx, resourceGroupName, jobName, jobResource, options)
if err != nil {
return JobsCreatePollerResponse{}, err
return JobsClientCreatePollerResponse{}, err
}
result := JobsCreatePollerResponse{
result := JobsClientCreatePollerResponse{
RawResponse: resp,
}
pt, err := armruntime.NewPoller("JobsClient.Create", "", resp, client.pl, client.createHandleError)
pt, err := armruntime.NewPoller("JobsClient.Create", "", resp, client.pl)
if err != nil {
return JobsCreatePollerResponse{}, err
return JobsClientCreatePollerResponse{}, err
}
result.Poller = &JobsCreatePoller{
result.Poller = &JobsClientCreatePoller{
pt: pt,
}
return result, nil
}
// Create - Creates a new job with the specified parameters. Existing job cannot be updated with this API and should instead be updated with the Update
// job API.
// If the operation fails it returns the *APIError error type.
func (client *JobsClient) create(ctx context.Context, resourceGroupName string, jobName string, jobResource JobResource, options *JobsBeginCreateOptions) (*http.Response, error) {
// Create - Creates a new job with the specified parameters. Existing job cannot be updated with this API and should instead
// be updated with the Update job API.
// If the operation fails it returns an *azcore.ResponseError type.
func (client *JobsClient) create(ctx context.Context, resourceGroupName string, jobName string, jobResource JobResource, options *JobsClientBeginCreateOptions) (*http.Response, error) {
req, err := client.createCreateRequest(ctx, resourceGroupName, jobName, jobResource, options)
if err != nil {
return nil, err
@ -197,13 +193,13 @@ func (client *JobsClient) create(ctx context.Context, resourceGroupName string,
return nil, err
}
if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) {
return nil, client.createHandleError(resp)
return nil, runtime.NewResponseError(resp)
}
return resp, nil
}
// createCreateRequest creates the Create request.
func (client *JobsClient) createCreateRequest(ctx context.Context, resourceGroupName string, jobName string, jobResource JobResource, options *JobsBeginCreateOptions) (*policy.Request, error) {
func (client *JobsClient) createCreateRequest(ctx context.Context, resourceGroupName string, jobName string, jobResource JobResource, options *JobsClientBeginCreateOptions) (*policy.Request, error) {
urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}"
if client.subscriptionID == "" {
return nil, errors.New("parameter client.subscriptionID cannot be empty")
@ -217,7 +213,7 @@ func (client *JobsClient) createCreateRequest(ctx context.Context, resourceGroup
return nil, errors.New("parameter jobName cannot be empty")
}
urlPath = strings.ReplaceAll(urlPath, "{jobName}", url.PathEscape(jobName))
req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.ep, urlPath))
req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath))
if err != nil {
return nil, err
}
@ -228,42 +224,33 @@ func (client *JobsClient) createCreateRequest(ctx context.Context, resourceGroup
return req, runtime.MarshalAsJSON(req, jobResource)
}
// createHandleError handles the Create error response.
func (client *JobsClient) createHandleError(resp *http.Response) error {
body, err := runtime.Payload(resp)
if err != nil {
return runtime.NewResponseError(err, resp)
}
errType := APIError{raw: string(body)}
if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil {
return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp)
}
return runtime.NewResponseError(&errType, resp)
}
// BeginDelete - Deletes a job.
// If the operation fails it returns the *APIError error type.
func (client *JobsClient) BeginDelete(ctx context.Context, resourceGroupName string, jobName string, options *JobsBeginDeleteOptions) (JobsDeletePollerResponse, error) {
// If the operation fails it returns an *azcore.ResponseError type.
// 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
// options - JobsClientBeginDeleteOptions contains the optional parameters for the JobsClient.BeginDelete method.
func (client *JobsClient) BeginDelete(ctx context.Context, resourceGroupName string, jobName string, options *JobsClientBeginDeleteOptions) (JobsClientDeletePollerResponse, error) {
resp, err := client.deleteOperation(ctx, resourceGroupName, jobName, options)
if err != nil {
return JobsDeletePollerResponse{}, err
return JobsClientDeletePollerResponse{}, err
}
result := JobsDeletePollerResponse{
result := JobsClientDeletePollerResponse{
RawResponse: resp,
}
pt, err := armruntime.NewPoller("JobsClient.Delete", "", resp, client.pl, client.deleteHandleError)
pt, err := armruntime.NewPoller("JobsClient.Delete", "", resp, client.pl)
if err != nil {
return JobsDeletePollerResponse{}, err
return JobsClientDeletePollerResponse{}, err
}
result.Poller = &JobsDeletePoller{
result.Poller = &JobsClientDeletePoller{
pt: pt,
}
return result, nil
}
// Delete - Deletes a job.
// If the operation fails it returns the *APIError error type.
func (client *JobsClient) deleteOperation(ctx context.Context, resourceGroupName string, jobName string, options *JobsBeginDeleteOptions) (*http.Response, error) {
// If the operation fails it returns an *azcore.ResponseError type.
func (client *JobsClient) deleteOperation(ctx context.Context, resourceGroupName string, jobName string, options *JobsClientBeginDeleteOptions) (*http.Response, error) {
req, err := client.deleteCreateRequest(ctx, resourceGroupName, jobName, options)
if err != nil {
return nil, err
@ -273,13 +260,13 @@ func (client *JobsClient) deleteOperation(ctx context.Context, resourceGroupName
return nil, err
}
if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) {
return nil, client.deleteHandleError(resp)
return nil, runtime.NewResponseError(resp)
}
return resp, nil
}
// deleteCreateRequest creates the Delete request.
func (client *JobsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, jobName string, options *JobsBeginDeleteOptions) (*policy.Request, error) {
func (client *JobsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, jobName string, options *JobsClientBeginDeleteOptions) (*policy.Request, error) {
urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}"
if client.subscriptionID == "" {
return nil, errors.New("parameter client.subscriptionID cannot be empty")
@ -293,7 +280,7 @@ func (client *JobsClient) deleteCreateRequest(ctx context.Context, resourceGroup
return nil, errors.New("parameter jobName cannot be empty")
}
urlPath = strings.ReplaceAll(urlPath, "{jobName}", url.PathEscape(jobName))
req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.ep, urlPath))
req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath))
if err != nil {
return nil, err
}
@ -304,38 +291,29 @@ func (client *JobsClient) deleteCreateRequest(ctx context.Context, resourceGroup
return req, nil
}
// deleteHandleError handles the Delete error response.
func (client *JobsClient) deleteHandleError(resp *http.Response) error {
body, err := runtime.Payload(resp)
if err != nil {
return runtime.NewResponseError(err, resp)
}
errType := APIError{raw: string(body)}
if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil {
return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp)
}
return runtime.NewResponseError(&errType, resp)
}
// Get - Gets information about the specified job.
// If the operation fails it returns the *APIError error type.
func (client *JobsClient) Get(ctx context.Context, resourceGroupName string, jobName string, options *JobsGetOptions) (JobsGetResponse, error) {
// If the operation fails it returns an *azcore.ResponseError type.
// 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
// options - JobsClientGetOptions contains the optional parameters for the JobsClient.Get method.
func (client *JobsClient) Get(ctx context.Context, resourceGroupName string, jobName string, options *JobsClientGetOptions) (JobsClientGetResponse, error) {
req, err := client.getCreateRequest(ctx, resourceGroupName, jobName, options)
if err != nil {
return JobsGetResponse{}, err
return JobsClientGetResponse{}, err
}
resp, err := client.pl.Do(req)
if err != nil {
return JobsGetResponse{}, err
return JobsClientGetResponse{}, err
}
if !runtime.HasStatusCode(resp, http.StatusOK) {
return JobsGetResponse{}, client.getHandleError(resp)
return JobsClientGetResponse{}, runtime.NewResponseError(resp)
}
return client.getHandleResponse(resp)
}
// getCreateRequest creates the Get request.
func (client *JobsClient) getCreateRequest(ctx context.Context, resourceGroupName string, jobName string, options *JobsGetOptions) (*policy.Request, error) {
func (client *JobsClient) getCreateRequest(ctx context.Context, resourceGroupName string, jobName string, options *JobsClientGetOptions) (*policy.Request, error) {
urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}"
if client.subscriptionID == "" {
return nil, errors.New("parameter client.subscriptionID cannot be empty")
@ -349,7 +327,7 @@ func (client *JobsClient) getCreateRequest(ctx context.Context, resourceGroupNam
return nil, errors.New("parameter jobName cannot be empty")
}
urlPath = strings.ReplaceAll(urlPath, "{jobName}", url.PathEscape(jobName))
req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath))
req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath))
if err != nil {
return nil, err
}
@ -364,49 +342,37 @@ func (client *JobsClient) getCreateRequest(ctx context.Context, resourceGroupNam
}
// getHandleResponse handles the Get response.
func (client *JobsClient) getHandleResponse(resp *http.Response) (JobsGetResponse, error) {
result := JobsGetResponse{RawResponse: resp}
func (client *JobsClient) getHandleResponse(resp *http.Response) (JobsClientGetResponse, error) {
result := JobsClientGetResponse{RawResponse: resp}
if err := runtime.UnmarshalAsJSON(resp, &result.JobResource); err != nil {
return JobsGetResponse{}, runtime.NewResponseError(err, resp)
return JobsClientGetResponse{}, err
}
return result, nil
}
// getHandleError handles the Get error response.
func (client *JobsClient) getHandleError(resp *http.Response) error {
body, err := runtime.Payload(resp)
if err != nil {
return runtime.NewResponseError(err, resp)
}
errType := APIError{raw: string(body)}
if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil {
return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp)
}
return runtime.NewResponseError(&errType, resp)
}
// List - Lists all the jobs available under the subscription.
// If the operation fails it returns the *APIError error type.
func (client *JobsClient) List(options *JobsListOptions) *JobsListPager {
return &JobsListPager{
// If the operation fails it returns an *azcore.ResponseError type.
// options - JobsClientListOptions contains the optional parameters for the JobsClient.List method.
func (client *JobsClient) List(options *JobsClientListOptions) *JobsClientListPager {
return &JobsClientListPager{
client: client,
requester: func(ctx context.Context) (*policy.Request, error) {
return client.listCreateRequest(ctx, options)
},
advancer: func(ctx context.Context, resp JobsListResponse) (*policy.Request, error) {
advancer: func(ctx context.Context, resp JobsClientListResponse) (*policy.Request, error) {
return runtime.NewRequest(ctx, http.MethodGet, *resp.JobResourceList.NextLink)
},
}
}
// listCreateRequest creates the List request.
func (client *JobsClient) listCreateRequest(ctx context.Context, options *JobsListOptions) (*policy.Request, error) {
func (client *JobsClient) listCreateRequest(ctx context.Context, options *JobsClientListOptions) (*policy.Request, error) {
urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/jobs"
if client.subscriptionID == "" {
return nil, errors.New("parameter client.subscriptionID cannot be empty")
}
urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID))
req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath))
req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath))
if err != nil {
return nil, err
}
@ -421,43 +387,33 @@ func (client *JobsClient) listCreateRequest(ctx context.Context, options *JobsLi
}
// listHandleResponse handles the List response.
func (client *JobsClient) listHandleResponse(resp *http.Response) (JobsListResponse, error) {
result := JobsListResponse{RawResponse: resp}
func (client *JobsClient) listHandleResponse(resp *http.Response) (JobsClientListResponse, error) {
result := JobsClientListResponse{RawResponse: resp}
if err := runtime.UnmarshalAsJSON(resp, &result.JobResourceList); err != nil {
return JobsListResponse{}, runtime.NewResponseError(err, resp)
return JobsClientListResponse{}, err
}
return result, nil
}
// listHandleError handles the List error response.
func (client *JobsClient) listHandleError(resp *http.Response) error {
body, err := runtime.Payload(resp)
if err != nil {
return runtime.NewResponseError(err, resp)
}
errType := APIError{raw: string(body)}
if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil {
return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp)
}
return runtime.NewResponseError(&errType, resp)
}
// ListByResourceGroup - Lists all the jobs available under the given resource group.
// If the operation fails it returns the *APIError error type.
func (client *JobsClient) ListByResourceGroup(resourceGroupName string, options *JobsListByResourceGroupOptions) *JobsListByResourceGroupPager {
return &JobsListByResourceGroupPager{
// If the operation fails it returns an *azcore.ResponseError type.
// resourceGroupName - The Resource Group Name
// options - JobsClientListByResourceGroupOptions contains the optional parameters for the JobsClient.ListByResourceGroup
// method.
func (client *JobsClient) ListByResourceGroup(resourceGroupName string, options *JobsClientListByResourceGroupOptions) *JobsClientListByResourceGroupPager {
return &JobsClientListByResourceGroupPager{
client: client,
requester: func(ctx context.Context) (*policy.Request, error) {
return client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options)
},
advancer: func(ctx context.Context, resp JobsListByResourceGroupResponse) (*policy.Request, error) {
advancer: func(ctx context.Context, resp JobsClientListByResourceGroupResponse) (*policy.Request, error) {
return runtime.NewRequest(ctx, http.MethodGet, *resp.JobResourceList.NextLink)
},
}
}
// listByResourceGroupCreateRequest creates the ListByResourceGroup request.
func (client *JobsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *JobsListByResourceGroupOptions) (*policy.Request, error) {
func (client *JobsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *JobsClientListByResourceGroupOptions) (*policy.Request, error) {
urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs"
if client.subscriptionID == "" {
return nil, errors.New("parameter client.subscriptionID cannot be empty")
@ -467,7 +423,7 @@ func (client *JobsClient) listByResourceGroupCreateRequest(ctx context.Context,
return nil, errors.New("parameter resourceGroupName cannot be empty")
}
urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath))
req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath))
if err != nil {
return nil, err
}
@ -482,46 +438,37 @@ func (client *JobsClient) listByResourceGroupCreateRequest(ctx context.Context,
}
// listByResourceGroupHandleResponse handles the ListByResourceGroup response.
func (client *JobsClient) listByResourceGroupHandleResponse(resp *http.Response) (JobsListByResourceGroupResponse, error) {
result := JobsListByResourceGroupResponse{RawResponse: resp}
func (client *JobsClient) listByResourceGroupHandleResponse(resp *http.Response) (JobsClientListByResourceGroupResponse, error) {
result := JobsClientListByResourceGroupResponse{RawResponse: resp}
if err := runtime.UnmarshalAsJSON(resp, &result.JobResourceList); err != nil {
return JobsListByResourceGroupResponse{}, runtime.NewResponseError(err, resp)
return JobsClientListByResourceGroupResponse{}, err
}
return result, nil
}
// listByResourceGroupHandleError handles the ListByResourceGroup error response.
func (client *JobsClient) listByResourceGroupHandleError(resp *http.Response) error {
body, err := runtime.Payload(resp)
if err != nil {
return runtime.NewResponseError(err, resp)
}
errType := APIError{raw: string(body)}
if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil {
return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp)
}
return runtime.NewResponseError(&errType, resp)
}
// ListCredentials - This method gets the unencrypted secrets related to the job.
// If the operation fails it returns the *APIError error type.
func (client *JobsClient) ListCredentials(ctx context.Context, resourceGroupName string, jobName string, options *JobsListCredentialsOptions) (JobsListCredentialsResponse, error) {
// If the operation fails it returns an *azcore.ResponseError type.
// 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
// options - JobsClientListCredentialsOptions contains the optional parameters for the JobsClient.ListCredentials method.
func (client *JobsClient) ListCredentials(ctx context.Context, resourceGroupName string, jobName string, options *JobsClientListCredentialsOptions) (JobsClientListCredentialsResponse, error) {
req, err := client.listCredentialsCreateRequest(ctx, resourceGroupName, jobName, options)
if err != nil {
return JobsListCredentialsResponse{}, err
return JobsClientListCredentialsResponse{}, err
}
resp, err := client.pl.Do(req)
if err != nil {
return JobsListCredentialsResponse{}, err
return JobsClientListCredentialsResponse{}, err
}
if !runtime.HasStatusCode(resp, http.StatusOK) {
return JobsListCredentialsResponse{}, client.listCredentialsHandleError(resp)
return JobsClientListCredentialsResponse{}, runtime.NewResponseError(resp)
}
return client.listCredentialsHandleResponse(resp)
}
// listCredentialsCreateRequest creates the ListCredentials request.
func (client *JobsClient) listCredentialsCreateRequest(ctx context.Context, resourceGroupName string, jobName string, options *JobsListCredentialsOptions) (*policy.Request, error) {
func (client *JobsClient) listCredentialsCreateRequest(ctx context.Context, resourceGroupName string, jobName string, options *JobsClientListCredentialsOptions) (*policy.Request, error) {
urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/listCredentials"
if client.subscriptionID == "" {
return nil, errors.New("parameter client.subscriptionID cannot be empty")
@ -535,7 +482,7 @@ func (client *JobsClient) listCredentialsCreateRequest(ctx context.Context, reso
return nil, errors.New("parameter jobName cannot be empty")
}
urlPath = strings.ReplaceAll(urlPath, "{jobName}", url.PathEscape(jobName))
req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath))
req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath))
if err != nil {
return nil, err
}
@ -547,46 +494,38 @@ func (client *JobsClient) listCredentialsCreateRequest(ctx context.Context, reso
}
// listCredentialsHandleResponse handles the ListCredentials response.
func (client *JobsClient) listCredentialsHandleResponse(resp *http.Response) (JobsListCredentialsResponse, error) {
result := JobsListCredentialsResponse{RawResponse: resp}
func (client *JobsClient) listCredentialsHandleResponse(resp *http.Response) (JobsClientListCredentialsResponse, error) {
result := JobsClientListCredentialsResponse{RawResponse: resp}
if err := runtime.UnmarshalAsJSON(resp, &result.UnencryptedCredentialsList); err != nil {
return JobsListCredentialsResponse{}, runtime.NewResponseError(err, resp)
return JobsClientListCredentialsResponse{}, err
}
return result, nil
}
// listCredentialsHandleError handles the ListCredentials error response.
func (client *JobsClient) listCredentialsHandleError(resp *http.Response) error {
body, err := runtime.Payload(resp)
if err != nil {
return runtime.NewResponseError(err, resp)
}
errType := APIError{raw: string(body)}
if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil {
return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp)
}
return runtime.NewResponseError(&errType, resp)
}
// MarkDevicesShipped - Request to mark devices for a given job as shipped
// If the operation fails it returns the *APIError error type.
func (client *JobsClient) MarkDevicesShipped(ctx context.Context, jobName string, resourceGroupName string, markDevicesShippedRequest MarkDevicesShippedRequest, options *JobsMarkDevicesShippedOptions) (JobsMarkDevicesShippedResponse, error) {
// If the operation fails it returns an *azcore.ResponseError type.
// 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
// resourceGroupName - The Resource Group Name
// markDevicesShippedRequest - Mark Devices Shipped Request
// options - JobsClientMarkDevicesShippedOptions contains the optional parameters for the JobsClient.MarkDevicesShipped method.
func (client *JobsClient) MarkDevicesShipped(ctx context.Context, jobName string, resourceGroupName string, markDevicesShippedRequest MarkDevicesShippedRequest, options *JobsClientMarkDevicesShippedOptions) (JobsClientMarkDevicesShippedResponse, error) {
req, err := client.markDevicesShippedCreateRequest(ctx, jobName, resourceGroupName, markDevicesShippedRequest, options)
if err != nil {
return JobsMarkDevicesShippedResponse{}, err
return JobsClientMarkDevicesShippedResponse{}, err
}
resp, err := client.pl.Do(req)
if err != nil {
return JobsMarkDevicesShippedResponse{}, err
return JobsClientMarkDevicesShippedResponse{}, err
}
if !runtime.HasStatusCode(resp, http.StatusNoContent) {
return JobsMarkDevicesShippedResponse{}, client.markDevicesShippedHandleError(resp)
return JobsClientMarkDevicesShippedResponse{}, runtime.NewResponseError(resp)
}
return JobsMarkDevicesShippedResponse{RawResponse: resp}, nil
return JobsClientMarkDevicesShippedResponse{RawResponse: resp}, nil
}
// markDevicesShippedCreateRequest creates the MarkDevicesShipped request.
func (client *JobsClient) markDevicesShippedCreateRequest(ctx context.Context, jobName string, resourceGroupName string, markDevicesShippedRequest MarkDevicesShippedRequest, options *JobsMarkDevicesShippedOptions) (*policy.Request, error) {
func (client *JobsClient) markDevicesShippedCreateRequest(ctx context.Context, jobName string, resourceGroupName string, markDevicesShippedRequest MarkDevicesShippedRequest, options *JobsClientMarkDevicesShippedOptions) (*policy.Request, error) {
urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/markDevicesShipped"
if jobName == "" {
return nil, errors.New("parameter jobName cannot be empty")
@ -600,7 +539,7 @@ func (client *JobsClient) markDevicesShippedCreateRequest(ctx context.Context, j
return nil, errors.New("parameter resourceGroupName cannot be empty")
}
urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath))
req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath))
if err != nil {
return nil, err
}
@ -611,42 +550,34 @@ func (client *JobsClient) markDevicesShippedCreateRequest(ctx context.Context, j
return req, runtime.MarshalAsJSON(req, markDevicesShippedRequest)
}
// markDevicesShippedHandleError handles the MarkDevicesShipped error response.
func (client *JobsClient) markDevicesShippedHandleError(resp *http.Response) error {
body, err := runtime.Payload(resp)
if err != nil {
return runtime.NewResponseError(err, resp)
}
errType := APIError{raw: string(body)}
if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil {
return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp)
}
return runtime.NewResponseError(&errType, resp)
}
// BeginUpdate - Updates the properties of an existing job.
// If the operation fails it returns the *APIError error type.
func (client *JobsClient) BeginUpdate(ctx context.Context, resourceGroupName string, jobName string, jobResourceUpdateParameter JobResourceUpdateParameter, options *JobsBeginUpdateOptions) (JobsUpdatePollerResponse, error) {
// If the operation fails it returns an *azcore.ResponseError type.
// 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
// jobResourceUpdateParameter - Job update parameters from request body.
// options - JobsClientBeginUpdateOptions contains the optional parameters for the JobsClient.BeginUpdate method.
func (client *JobsClient) BeginUpdate(ctx context.Context, resourceGroupName string, jobName string, jobResourceUpdateParameter JobResourceUpdateParameter, options *JobsClientBeginUpdateOptions) (JobsClientUpdatePollerResponse, error) {
resp, err := client.update(ctx, resourceGroupName, jobName, jobResourceUpdateParameter, options)
if err != nil {
return JobsUpdatePollerResponse{}, err
return JobsClientUpdatePollerResponse{}, err
}
result := JobsUpdatePollerResponse{
result := JobsClientUpdatePollerResponse{
RawResponse: resp,
}
pt, err := armruntime.NewPoller("JobsClient.Update", "", resp, client.pl, client.updateHandleError)
pt, err := armruntime.NewPoller("JobsClient.Update", "", resp, client.pl)
if err != nil {
return JobsUpdatePollerResponse{}, err
return JobsClientUpdatePollerResponse{}, err
}
result.Poller = &JobsUpdatePoller{
result.Poller = &JobsClientUpdatePoller{
pt: pt,
}
return result, nil
}
// Update - Updates the properties of an existing job.
// If the operation fails it returns the *APIError error type.
func (client *JobsClient) update(ctx context.Context, resourceGroupName string, jobName string, jobResourceUpdateParameter JobResourceUpdateParameter, options *JobsBeginUpdateOptions) (*http.Response, error) {
// If the operation fails it returns an *azcore.ResponseError type.
func (client *JobsClient) update(ctx context.Context, resourceGroupName string, jobName string, jobResourceUpdateParameter JobResourceUpdateParameter, options *JobsClientBeginUpdateOptions) (*http.Response, error) {
req, err := client.updateCreateRequest(ctx, resourceGroupName, jobName, jobResourceUpdateParameter, options)
if err != nil {
return nil, err
@ -656,13 +587,13 @@ func (client *JobsClient) update(ctx context.Context, resourceGroupName string,
return nil, err
}
if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) {
return nil, client.updateHandleError(resp)
return nil, runtime.NewResponseError(resp)
}
return resp, nil
}
// updateCreateRequest creates the Update request.
func (client *JobsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, jobName string, jobResourceUpdateParameter JobResourceUpdateParameter, options *JobsBeginUpdateOptions) (*policy.Request, error) {
func (client *JobsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, jobName string, jobResourceUpdateParameter JobResourceUpdateParameter, options *JobsClientBeginUpdateOptions) (*policy.Request, error) {
urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}"
if client.subscriptionID == "" {
return nil, errors.New("parameter client.subscriptionID cannot be empty")
@ -676,7 +607,7 @@ func (client *JobsClient) updateCreateRequest(ctx context.Context, resourceGroup
return nil, errors.New("parameter jobName cannot be empty")
}
urlPath = strings.ReplaceAll(urlPath, "{jobName}", url.PathEscape(jobName))
req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.ep, urlPath))
req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath))
if err != nil {
return nil, err
}
@ -689,16 +620,3 @@ func (client *JobsClient) updateCreateRequest(ctx context.Context, resourceGroup
req.Raw().Header.Set("Accept", "application/json")
return req, runtime.MarshalAsJSON(req, jobResourceUpdateParameter)
}
// updateHandleError handles the Update error response.
func (client *JobsClient) updateHandleError(resp *http.Response) error {
body, err := runtime.Payload(resp)
if err != nil {
return runtime.NewResponseError(err, resp)
}
errType := APIError{raw: string(body)}
if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil {
return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp)
}
return runtime.NewResponseError(&errType, resp)
}

Просмотреть файл

@ -11,7 +11,6 @@ package armdatabox
import (
"context"
"errors"
"fmt"
"github.com/Azure/azure-sdk-for-go/sdk/azcore"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime"
@ -22,45 +21,58 @@ import (
"strings"
)
// DataBoxManagementClient contains the methods for the DataBoxManagementClient group.
// Don't use this type directly, use NewDataBoxManagementClient() instead.
type DataBoxManagementClient struct {
ep string
pl runtime.Pipeline
// ManagementClient contains the methods for the DataBoxManagementClient group.
// Don't use this type directly, use NewManagementClient() instead.
type ManagementClient struct {
host string
subscriptionID string
pl runtime.Pipeline
}
// NewDataBoxManagementClient creates a new instance of DataBoxManagementClient with the specified values.
func NewDataBoxManagementClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *DataBoxManagementClient {
cp := arm.ClientOptions{}
if options != nil {
cp = *options
// NewManagementClient creates a new instance of ManagementClient with the specified values.
// subscriptionID - The Subscription Id
// credential - used to authorize requests. Usually a credential from azidentity.
// options - pass nil to accept the default values.
func NewManagementClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *ManagementClient {
if options == nil {
options = &arm.ClientOptions{}
}
if len(cp.Host) == 0 {
cp.Host = arm.AzurePublicCloud
ep := options.Endpoint
if len(ep) == 0 {
ep = arm.AzurePublicCloud
}
return &DataBoxManagementClient{subscriptionID: subscriptionID, ep: string(cp.Host), pl: armruntime.NewPipeline(module, version, credential, &cp)}
client := &ManagementClient{
subscriptionID: subscriptionID,
host: string(ep),
pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options),
}
return client
}
// Mitigate - Request to mitigate for a given job
// If the operation fails it returns the *APIError error type.
func (client *DataBoxManagementClient) Mitigate(ctx context.Context, jobName string, resourceGroupName string, mitigateJobRequest MitigateJobRequest, options *DataBoxManagementClientMitigateOptions) (DataBoxManagementClientMitigateResponse, error) {
// If the operation fails it returns an *azcore.ResponseError type.
// 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
// resourceGroupName - The Resource Group Name
// mitigateJobRequest - Mitigation Request
// options - ManagementClientMitigateOptions contains the optional parameters for the ManagementClient.Mitigate method.
func (client *ManagementClient) Mitigate(ctx context.Context, jobName string, resourceGroupName string, mitigateJobRequest MitigateJobRequest, options *ManagementClientMitigateOptions) (ManagementClientMitigateResponse, error) {
req, err := client.mitigateCreateRequest(ctx, jobName, resourceGroupName, mitigateJobRequest, options)
if err != nil {
return DataBoxManagementClientMitigateResponse{}, err
return ManagementClientMitigateResponse{}, err
}
resp, err := client.pl.Do(req)
if err != nil {
return DataBoxManagementClientMitigateResponse{}, err
return ManagementClientMitigateResponse{}, err
}
if !runtime.HasStatusCode(resp, http.StatusNoContent) {
return DataBoxManagementClientMitigateResponse{}, client.mitigateHandleError(resp)
return ManagementClientMitigateResponse{}, runtime.NewResponseError(resp)
}
return DataBoxManagementClientMitigateResponse{RawResponse: resp}, nil
return ManagementClientMitigateResponse{RawResponse: resp}, nil
}
// mitigateCreateRequest creates the Mitigate request.
func (client *DataBoxManagementClient) mitigateCreateRequest(ctx context.Context, jobName string, resourceGroupName string, mitigateJobRequest MitigateJobRequest, options *DataBoxManagementClientMitigateOptions) (*policy.Request, error) {
func (client *ManagementClient) mitigateCreateRequest(ctx context.Context, jobName string, resourceGroupName string, mitigateJobRequest MitigateJobRequest, options *ManagementClientMitigateOptions) (*policy.Request, error) {
urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/mitigate"
if jobName == "" {
return nil, errors.New("parameter jobName cannot be empty")
@ -74,7 +86,7 @@ func (client *DataBoxManagementClient) mitigateCreateRequest(ctx context.Context
return nil, errors.New("parameter resourceGroupName cannot be empty")
}
urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName))
req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath))
req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath))
if err != nil {
return nil, err
}
@ -84,16 +96,3 @@ func (client *DataBoxManagementClient) mitigateCreateRequest(ctx context.Context
req.Raw().Header.Set("Accept", "application/json")
return req, runtime.MarshalAsJSON(req, mitigateJobRequest)
}
// mitigateHandleError handles the Mitigate error response.
func (client *DataBoxManagementClient) mitigateHandleError(resp *http.Response) error {
body, err := runtime.Payload(resp)
if err != nil {
return runtime.NewResponseError(err, resp)
}
errType := APIError{raw: string(body)}
if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil {
return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp)
}
return runtime.NewResponseError(&errType, resp)
}

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -10,7 +10,6 @@ package armdatabox
import (
"context"
"fmt"
"github.com/Azure/azure-sdk-for-go/sdk/azcore"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime"
@ -22,40 +21,47 @@ import (
// OperationsClient contains the methods for the Operations group.
// Don't use this type directly, use NewOperationsClient() instead.
type OperationsClient struct {
ep string
pl runtime.Pipeline
host string
pl runtime.Pipeline
}
// NewOperationsClient creates a new instance of OperationsClient with the specified values.
// credential - used to authorize requests. Usually a credential from azidentity.
// options - pass nil to accept the default values.
func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientOptions) *OperationsClient {
cp := arm.ClientOptions{}
if options != nil {
cp = *options
if options == nil {
options = &arm.ClientOptions{}
}
if len(cp.Host) == 0 {
cp.Host = arm.AzurePublicCloud
ep := options.Endpoint
if len(ep) == 0 {
ep = arm.AzurePublicCloud
}
return &OperationsClient{ep: string(cp.Host), pl: armruntime.NewPipeline(module, version, credential, &cp)}
client := &OperationsClient{
host: string(ep),
pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options),
}
return client
}
// List - This method gets all the operations.
// If the operation fails it returns the *APIError error type.
func (client *OperationsClient) List(options *OperationsListOptions) *OperationsListPager {
return &OperationsListPager{
// If the operation fails it returns an *azcore.ResponseError type.
// options - OperationsClientListOptions contains the optional parameters for the OperationsClient.List method.
func (client *OperationsClient) List(options *OperationsClientListOptions) *OperationsClientListPager {
return &OperationsClientListPager{
client: client,
requester: func(ctx context.Context) (*policy.Request, error) {
return client.listCreateRequest(ctx, options)
},
advancer: func(ctx context.Context, resp OperationsListResponse) (*policy.Request, error) {
advancer: func(ctx context.Context, resp OperationsClientListResponse) (*policy.Request, error) {
return runtime.NewRequest(ctx, http.MethodGet, *resp.OperationList.NextLink)
},
}
}
// listCreateRequest creates the List request.
func (client *OperationsClient) listCreateRequest(ctx context.Context, options *OperationsListOptions) (*policy.Request, error) {
func (client *OperationsClient) listCreateRequest(ctx context.Context, options *OperationsClientListOptions) (*policy.Request, error) {
urlPath := "/providers/Microsoft.DataBox/operations"
req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.ep, urlPath))
req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath))
if err != nil {
return nil, err
}
@ -67,23 +73,10 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options *
}
// listHandleResponse handles the List response.
func (client *OperationsClient) listHandleResponse(resp *http.Response) (OperationsListResponse, error) {
result := OperationsListResponse{RawResponse: resp}
func (client *OperationsClient) listHandleResponse(resp *http.Response) (OperationsClientListResponse, error) {
result := OperationsClientListResponse{RawResponse: resp}
if err := runtime.UnmarshalAsJSON(resp, &result.OperationList); err != nil {
return OperationsListResponse{}, runtime.NewResponseError(err, resp)
return OperationsClientListResponse{}, err
}
return result, nil
}
// listHandleError handles the List error response.
func (client *OperationsClient) listHandleError(resp *http.Response) error {
body, err := runtime.Payload(resp)
if err != nil {
return runtime.NewResponseError(err, resp)
}
errType := APIError{raw: string(body)}
if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil {
return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp)
}
return runtime.NewResponseError(&errType, resp)
}

Просмотреть файл

@ -16,23 +16,23 @@ import (
"reflect"
)
// JobsListByResourceGroupPager provides operations for iterating over paged responses.
type JobsListByResourceGroupPager struct {
// JobsClientListByResourceGroupPager provides operations for iterating over paged responses.
type JobsClientListByResourceGroupPager struct {
client *JobsClient
current JobsListByResourceGroupResponse
current JobsClientListByResourceGroupResponse
err error
requester func(context.Context) (*policy.Request, error)
advancer func(context.Context, JobsListByResourceGroupResponse) (*policy.Request, error)
advancer func(context.Context, JobsClientListByResourceGroupResponse) (*policy.Request, error)
}
// Err returns the last error encountered while paging.
func (p *JobsListByResourceGroupPager) Err() error {
func (p *JobsClientListByResourceGroupPager) Err() error {
return p.err
}
// NextPage returns true if the pager advanced to the next page.
// Returns false if there are no more pages or an error occurred.
func (p *JobsListByResourceGroupPager) NextPage(ctx context.Context) bool {
func (p *JobsClientListByResourceGroupPager) NextPage(ctx context.Context) bool {
var req *policy.Request
var err error
if !reflect.ValueOf(p.current).IsZero() {
@ -53,7 +53,7 @@ func (p *JobsListByResourceGroupPager) NextPage(ctx context.Context) bool {
return false
}
if !runtime.HasStatusCode(resp, http.StatusOK) {
p.err = p.client.listByResourceGroupHandleError(resp)
p.err = runtime.NewResponseError(resp)
return false
}
result, err := p.client.listByResourceGroupHandleResponse(resp)
@ -65,28 +65,28 @@ func (p *JobsListByResourceGroupPager) NextPage(ctx context.Context) bool {
return true
}
// PageResponse returns the current JobsListByResourceGroupResponse page.
func (p *JobsListByResourceGroupPager) PageResponse() JobsListByResourceGroupResponse {
// PageResponse returns the current JobsClientListByResourceGroupResponse page.
func (p *JobsClientListByResourceGroupPager) PageResponse() JobsClientListByResourceGroupResponse {
return p.current
}
// JobsListPager provides operations for iterating over paged responses.
type JobsListPager struct {
// JobsClientListPager provides operations for iterating over paged responses.
type JobsClientListPager struct {
client *JobsClient
current JobsListResponse
current JobsClientListResponse
err error
requester func(context.Context) (*policy.Request, error)
advancer func(context.Context, JobsListResponse) (*policy.Request, error)
advancer func(context.Context, JobsClientListResponse) (*policy.Request, error)
}
// Err returns the last error encountered while paging.
func (p *JobsListPager) Err() error {
func (p *JobsClientListPager) Err() error {
return p.err
}
// NextPage returns true if the pager advanced to the next page.
// Returns false if there are no more pages or an error occurred.
func (p *JobsListPager) NextPage(ctx context.Context) bool {
func (p *JobsClientListPager) NextPage(ctx context.Context) bool {
var req *policy.Request
var err error
if !reflect.ValueOf(p.current).IsZero() {
@ -107,7 +107,7 @@ func (p *JobsListPager) NextPage(ctx context.Context) bool {
return false
}
if !runtime.HasStatusCode(resp, http.StatusOK) {
p.err = p.client.listHandleError(resp)
p.err = runtime.NewResponseError(resp)
return false
}
result, err := p.client.listHandleResponse(resp)
@ -119,28 +119,28 @@ func (p *JobsListPager) NextPage(ctx context.Context) bool {
return true
}
// PageResponse returns the current JobsListResponse page.
func (p *JobsListPager) PageResponse() JobsListResponse {
// PageResponse returns the current JobsClientListResponse page.
func (p *JobsClientListPager) PageResponse() JobsClientListResponse {
return p.current
}
// OperationsListPager provides operations for iterating over paged responses.
type OperationsListPager struct {
// OperationsClientListPager provides operations for iterating over paged responses.
type OperationsClientListPager struct {
client *OperationsClient
current OperationsListResponse
current OperationsClientListResponse
err error
requester func(context.Context) (*policy.Request, error)
advancer func(context.Context, OperationsListResponse) (*policy.Request, error)
advancer func(context.Context, OperationsClientListResponse) (*policy.Request, error)
}
// Err returns the last error encountered while paging.
func (p *OperationsListPager) Err() error {
func (p *OperationsClientListPager) Err() error {
return p.err
}
// NextPage returns true if the pager advanced to the next page.
// Returns false if there are no more pages or an error occurred.
func (p *OperationsListPager) NextPage(ctx context.Context) bool {
func (p *OperationsClientListPager) NextPage(ctx context.Context) bool {
var req *policy.Request
var err error
if !reflect.ValueOf(p.current).IsZero() {
@ -161,7 +161,7 @@ func (p *OperationsListPager) NextPage(ctx context.Context) bool {
return false
}
if !runtime.HasStatusCode(resp, http.StatusOK) {
p.err = p.client.listHandleError(resp)
p.err = runtime.NewResponseError(resp)
return false
}
result, err := p.client.listHandleResponse(resp)
@ -173,28 +173,28 @@ func (p *OperationsListPager) NextPage(ctx context.Context) bool {
return true
}
// PageResponse returns the current OperationsListResponse page.
func (p *OperationsListPager) PageResponse() OperationsListResponse {
// PageResponse returns the current OperationsClientListResponse page.
func (p *OperationsClientListPager) PageResponse() OperationsClientListResponse {
return p.current
}
// ServiceListAvailableSKUsByResourceGroupPager provides operations for iterating over paged responses.
type ServiceListAvailableSKUsByResourceGroupPager struct {
// ServiceClientListAvailableSKUsByResourceGroupPager provides operations for iterating over paged responses.
type ServiceClientListAvailableSKUsByResourceGroupPager struct {
client *ServiceClient
current ServiceListAvailableSKUsByResourceGroupResponse
current ServiceClientListAvailableSKUsByResourceGroupResponse
err error
requester func(context.Context) (*policy.Request, error)
advancer func(context.Context, ServiceListAvailableSKUsByResourceGroupResponse) (*policy.Request, error)
advancer func(context.Context, ServiceClientListAvailableSKUsByResourceGroupResponse) (*policy.Request, error)
}
// Err returns the last error encountered while paging.
func (p *ServiceListAvailableSKUsByResourceGroupPager) Err() error {
func (p *ServiceClientListAvailableSKUsByResourceGroupPager) Err() error {
return p.err
}
// NextPage returns true if the pager advanced to the next page.
// Returns false if there are no more pages or an error occurred.
func (p *ServiceListAvailableSKUsByResourceGroupPager) NextPage(ctx context.Context) bool {
func (p *ServiceClientListAvailableSKUsByResourceGroupPager) NextPage(ctx context.Context) bool {
var req *policy.Request
var err error
if !reflect.ValueOf(p.current).IsZero() {
@ -215,7 +215,7 @@ func (p *ServiceListAvailableSKUsByResourceGroupPager) NextPage(ctx context.Cont
return false
}
if !runtime.HasStatusCode(resp, http.StatusOK) {
p.err = p.client.listAvailableSKUsByResourceGroupHandleError(resp)
p.err = runtime.NewResponseError(resp)
return false
}
result, err := p.client.listAvailableSKUsByResourceGroupHandleResponse(resp)
@ -227,7 +227,7 @@ func (p *ServiceListAvailableSKUsByResourceGroupPager) NextPage(ctx context.Cont
return true
}
// PageResponse returns the current ServiceListAvailableSKUsByResourceGroupResponse page.
func (p *ServiceListAvailableSKUsByResourceGroupPager) PageResponse() ServiceListAvailableSKUsByResourceGroupResponse {
// PageResponse returns the current ServiceClientListAvailableSKUsByResourceGroupResponse page.
func (p *ServiceClientListAvailableSKUsByResourceGroupPager) PageResponse() ServiceClientListAvailableSKUsByResourceGroupResponse {
return p.current
}

Просмотреть файл

@ -14,13 +14,13 @@ import (
"net/http"
)
// JobsCreatePoller provides polling facilities until the operation reaches a terminal state.
type JobsCreatePoller struct {
// JobsClientCreatePoller provides polling facilities until the operation reaches a terminal state.
type JobsClientCreatePoller struct {
pt *azcore.Poller
}
// Done returns true if the LRO has reached a terminal state.
func (p *JobsCreatePoller) Done() bool {
func (p *JobsClientCreatePoller) Done() bool {
return p.pt.Done()
}
@ -34,18 +34,18 @@ func (p *JobsCreatePoller) Done() bool {
// If Poll fails, the poller's state is unmodified and the error is returned.
// Calling Poll on an LRO that has reached a terminal state will return the final
// HTTP response or error.
func (p *JobsCreatePoller) Poll(ctx context.Context) (*http.Response, error) {
func (p *JobsClientCreatePoller) Poll(ctx context.Context) (*http.Response, error) {
return p.pt.Poll(ctx)
}
// FinalResponse performs a final GET to the service and returns the final response
// for the polling operation. If there is an error performing the final GET then an error is returned.
// If the final GET succeeded then the final JobsCreateResponse will be returned.
func (p *JobsCreatePoller) FinalResponse(ctx context.Context) (JobsCreateResponse, error) {
respType := JobsCreateResponse{}
// If the final GET succeeded then the final JobsClientCreateResponse will be returned.
func (p *JobsClientCreatePoller) FinalResponse(ctx context.Context) (JobsClientCreateResponse, error) {
respType := JobsClientCreateResponse{}
resp, err := p.pt.FinalResponse(ctx, &respType.JobResource)
if err != nil {
return JobsCreateResponse{}, err
return JobsClientCreateResponse{}, err
}
respType.RawResponse = resp
return respType, nil
@ -53,17 +53,17 @@ func (p *JobsCreatePoller) FinalResponse(ctx context.Context) (JobsCreateRespons
// ResumeToken returns a value representing the poller that can be used to resume
// the LRO at a later time. ResumeTokens are unique per service operation.
func (p *JobsCreatePoller) ResumeToken() (string, error) {
func (p *JobsClientCreatePoller) ResumeToken() (string, error) {
return p.pt.ResumeToken()
}
// JobsDeletePoller provides polling facilities until the operation reaches a terminal state.
type JobsDeletePoller struct {
// JobsClientDeletePoller provides polling facilities until the operation reaches a terminal state.
type JobsClientDeletePoller struct {
pt *azcore.Poller
}
// Done returns true if the LRO has reached a terminal state.
func (p *JobsDeletePoller) Done() bool {
func (p *JobsClientDeletePoller) Done() bool {
return p.pt.Done()
}
@ -77,18 +77,18 @@ func (p *JobsDeletePoller) Done() bool {
// If Poll fails, the poller's state is unmodified and the error is returned.
// Calling Poll on an LRO that has reached a terminal state will return the final
// HTTP response or error.
func (p *JobsDeletePoller) Poll(ctx context.Context) (*http.Response, error) {
func (p *JobsClientDeletePoller) Poll(ctx context.Context) (*http.Response, error) {
return p.pt.Poll(ctx)
}
// FinalResponse performs a final GET to the service and returns the final response
// for the polling operation. If there is an error performing the final GET then an error is returned.
// If the final GET succeeded then the final JobsDeleteResponse will be returned.
func (p *JobsDeletePoller) FinalResponse(ctx context.Context) (JobsDeleteResponse, error) {
respType := JobsDeleteResponse{}
// If the final GET succeeded then the final JobsClientDeleteResponse will be returned.
func (p *JobsClientDeletePoller) FinalResponse(ctx context.Context) (JobsClientDeleteResponse, error) {
respType := JobsClientDeleteResponse{}
resp, err := p.pt.FinalResponse(ctx, nil)
if err != nil {
return JobsDeleteResponse{}, err
return JobsClientDeleteResponse{}, err
}
respType.RawResponse = resp
return respType, nil
@ -96,17 +96,17 @@ func (p *JobsDeletePoller) FinalResponse(ctx context.Context) (JobsDeleteRespons
// ResumeToken returns a value representing the poller that can be used to resume
// the LRO at a later time. ResumeTokens are unique per service operation.
func (p *JobsDeletePoller) ResumeToken() (string, error) {
func (p *JobsClientDeletePoller) ResumeToken() (string, error) {
return p.pt.ResumeToken()
}
// JobsUpdatePoller provides polling facilities until the operation reaches a terminal state.
type JobsUpdatePoller struct {
// JobsClientUpdatePoller provides polling facilities until the operation reaches a terminal state.
type JobsClientUpdatePoller struct {
pt *azcore.Poller
}
// Done returns true if the LRO has reached a terminal state.
func (p *JobsUpdatePoller) Done() bool {
func (p *JobsClientUpdatePoller) Done() bool {
return p.pt.Done()
}
@ -120,18 +120,18 @@ func (p *JobsUpdatePoller) Done() bool {
// If Poll fails, the poller's state is unmodified and the error is returned.
// Calling Poll on an LRO that has reached a terminal state will return the final
// HTTP response or error.
func (p *JobsUpdatePoller) Poll(ctx context.Context) (*http.Response, error) {
func (p *JobsClientUpdatePoller) Poll(ctx context.Context) (*http.Response, error) {
return p.pt.Poll(ctx)
}
// FinalResponse performs a final GET to the service and returns the final response
// for the polling operation. If there is an error performing the final GET then an error is returned.
// If the final GET succeeded then the final JobsUpdateResponse will be returned.
func (p *JobsUpdatePoller) FinalResponse(ctx context.Context) (JobsUpdateResponse, error) {
respType := JobsUpdateResponse{}
// If the final GET succeeded then the final JobsClientUpdateResponse will be returned.
func (p *JobsClientUpdatePoller) FinalResponse(ctx context.Context) (JobsClientUpdateResponse, error) {
respType := JobsClientUpdateResponse{}
resp, err := p.pt.FinalResponse(ctx, &respType.JobResource)
if err != nil {
return JobsUpdateResponse{}, err
return JobsClientUpdateResponse{}, err
}
respType.RawResponse = resp
return respType, nil
@ -139,6 +139,6 @@ func (p *JobsUpdatePoller) FinalResponse(ctx context.Context) (JobsUpdateRespons
// ResumeToken returns a value representing the poller that can be used to resume
// the LRO at a later time. ResumeTokens are unique per service operation.
func (p *JobsUpdatePoller) ResumeToken() (string, error) {
func (p *JobsClientUpdatePoller) ResumeToken() (string, error) {
return p.pt.ResumeToken()
}

Просмотреть файл

@ -10,6 +10,76 @@ package armdatabox
import "encoding/json"
func unmarshalCommonJobDetailsClassification(rawMsg json.RawMessage) (CommonJobDetailsClassification, error) {
if rawMsg == nil {
return nil, nil
}
var m map[string]interface{}
if err := json.Unmarshal(rawMsg, &m); err != nil {
return nil, err
}
var b CommonJobDetailsClassification
switch m["jobDetailsType"] {
case string(ClassDiscriminatorDataBox):
b = &JobDetails{}
case string(ClassDiscriminatorDataBoxCustomerDisk):
b = &CustomerDiskJobDetails{}
case string(ClassDiscriminatorDataBoxDisk):
b = &DiskJobDetails{}
case string(ClassDiscriminatorDataBoxHeavy):
b = &HeavyJobDetails{}
default:
b = &CommonJobDetails{}
}
return b, json.Unmarshal(rawMsg, b)
}
func unmarshalCommonJobSecretsClassification(rawMsg json.RawMessage) (CommonJobSecretsClassification, error) {
if rawMsg == nil {
return nil, nil
}
var m map[string]interface{}
if err := json.Unmarshal(rawMsg, &m); err != nil {
return nil, err
}
var b CommonJobSecretsClassification
switch m["jobSecretsType"] {
case string(ClassDiscriminatorDataBox):
b = &JobSecrets{}
case string(ClassDiscriminatorDataBoxCustomerDisk):
b = &CustomerDiskJobSecrets{}
case string(ClassDiscriminatorDataBoxDisk):
b = &DiskJobSecrets{}
case string(ClassDiscriminatorDataBoxHeavy):
b = &HeavyJobSecrets{}
default:
b = &CommonJobSecrets{}
}
return b, json.Unmarshal(rawMsg, b)
}
func unmarshalCommonScheduleAvailabilityRequestClassification(rawMsg json.RawMessage) (CommonScheduleAvailabilityRequestClassification, error) {
if rawMsg == nil {
return nil, nil
}
var m map[string]interface{}
if err := json.Unmarshal(rawMsg, &m); err != nil {
return nil, err
}
var b CommonScheduleAvailabilityRequestClassification
switch m["skuName"] {
case string(SKUNameDataBox):
b = &ScheduleAvailabilityRequest{}
case string(SKUNameDataBoxDisk):
b = &DiskScheduleAvailabilityRequest{}
case string(SKUNameDataBoxHeavy):
b = &HeavyScheduleAvailabilityRequest{}
default:
b = &CommonScheduleAvailabilityRequest{}
}
return b, json.Unmarshal(rawMsg, b)
}
func unmarshalCopyLogDetailsClassification(rawMsg json.RawMessage) (CopyLogDetailsClassification, error) {
if rawMsg == nil {
return nil, nil
@ -21,13 +91,13 @@ func unmarshalCopyLogDetailsClassification(rawMsg json.RawMessage) (CopyLogDetai
var b CopyLogDetailsClassification
switch m["copyLogDetailsType"] {
case string(ClassDiscriminatorDataBox):
b = &DataBoxAccountCopyLogDetails{}
b = &AccountCopyLogDetails{}
case string(ClassDiscriminatorDataBoxCustomerDisk):
b = &DataBoxCustomerDiskCopyLogDetails{}
b = &CustomerDiskCopyLogDetails{}
case string(ClassDiscriminatorDataBoxDisk):
b = &DataBoxDiskCopyLogDetails{}
b = &DiskCopyLogDetails{}
case string(ClassDiscriminatorDataBoxHeavy):
b = &DataBoxHeavyAccountCopyLogDetails{}
b = &HeavyAccountCopyLogDetails{}
default:
b = &CopyLogDetails{}
}
@ -53,25 +123,6 @@ func unmarshalCopyLogDetailsClassificationArray(rawMsg json.RawMessage) ([]CopyL
return fArray, nil
}
func unmarshalCopyLogDetailsClassificationMap(rawMsg json.RawMessage) (map[string]CopyLogDetailsClassification, error) {
if rawMsg == nil {
return nil, nil
}
var rawMessages map[string]json.RawMessage
if err := json.Unmarshal(rawMsg, &rawMessages); err != nil {
return nil, err
}
fMap := make(map[string]CopyLogDetailsClassification, len(rawMessages))
for key, rawMessage := range rawMessages {
f, err := unmarshalCopyLogDetailsClassification(rawMessage)
if err != nil {
return nil, err
}
fMap[key] = f
}
return fMap, nil
}
func unmarshalDataAccountDetailsClassification(rawMsg json.RawMessage) (DataAccountDetailsClassification, error) {
if rawMsg == nil {
return nil, nil
@ -92,44 +143,6 @@ func unmarshalDataAccountDetailsClassification(rawMsg json.RawMessage) (DataAcco
return b, json.Unmarshal(rawMsg, b)
}
func unmarshalDataAccountDetailsClassificationArray(rawMsg json.RawMessage) ([]DataAccountDetailsClassification, error) {
if rawMsg == nil {
return nil, nil
}
var rawMessages []json.RawMessage
if err := json.Unmarshal(rawMsg, &rawMessages); err != nil {
return nil, err
}
fArray := make([]DataAccountDetailsClassification, len(rawMessages))
for index, rawMessage := range rawMessages {
f, err := unmarshalDataAccountDetailsClassification(rawMessage)
if err != nil {
return nil, err
}
fArray[index] = f
}
return fArray, nil
}
func unmarshalDataAccountDetailsClassificationMap(rawMsg json.RawMessage) (map[string]DataAccountDetailsClassification, error) {
if rawMsg == nil {
return nil, nil
}
var rawMessages map[string]json.RawMessage
if err := json.Unmarshal(rawMsg, &rawMessages); err != nil {
return nil, err
}
fMap := make(map[string]DataAccountDetailsClassification, len(rawMessages))
for key, rawMessage := range rawMessages {
f, err := unmarshalDataAccountDetailsClassification(rawMessage)
if err != nil {
return nil, err
}
fMap[key] = f
}
return fMap, nil
}
func unmarshalDatacenterAddressResponseClassification(rawMsg json.RawMessage) (DatacenterAddressResponseClassification, error) {
if rawMsg == nil {
return nil, nil
@ -150,228 +163,6 @@ func unmarshalDatacenterAddressResponseClassification(rawMsg json.RawMessage) (D
return b, json.Unmarshal(rawMsg, b)
}
func unmarshalDatacenterAddressResponseClassificationArray(rawMsg json.RawMessage) ([]DatacenterAddressResponseClassification, error) {
if rawMsg == nil {
return nil, nil
}
var rawMessages []json.RawMessage
if err := json.Unmarshal(rawMsg, &rawMessages); err != nil {
return nil, err
}
fArray := make([]DatacenterAddressResponseClassification, len(rawMessages))
for index, rawMessage := range rawMessages {
f, err := unmarshalDatacenterAddressResponseClassification(rawMessage)
if err != nil {
return nil, err
}
fArray[index] = f
}
return fArray, nil
}
func unmarshalDatacenterAddressResponseClassificationMap(rawMsg json.RawMessage) (map[string]DatacenterAddressResponseClassification, error) {
if rawMsg == nil {
return nil, nil
}
var rawMessages map[string]json.RawMessage
if err := json.Unmarshal(rawMsg, &rawMessages); err != nil {
return nil, err
}
fMap := make(map[string]DatacenterAddressResponseClassification, len(rawMessages))
for key, rawMessage := range rawMessages {
f, err := unmarshalDatacenterAddressResponseClassification(rawMessage)
if err != nil {
return nil, err
}
fMap[key] = f
}
return fMap, nil
}
func unmarshalJobDetailsClassification(rawMsg json.RawMessage) (JobDetailsClassification, error) {
if rawMsg == nil {
return nil, nil
}
var m map[string]interface{}
if err := json.Unmarshal(rawMsg, &m); err != nil {
return nil, err
}
var b JobDetailsClassification
switch m["jobDetailsType"] {
case string(ClassDiscriminatorDataBox):
b = &DataBoxJobDetails{}
case string(ClassDiscriminatorDataBoxCustomerDisk):
b = &DataBoxCustomerDiskJobDetails{}
case string(ClassDiscriminatorDataBoxDisk):
b = &DataBoxDiskJobDetails{}
case string(ClassDiscriminatorDataBoxHeavy):
b = &DataBoxHeavyJobDetails{}
default:
b = &JobDetails{}
}
return b, json.Unmarshal(rawMsg, b)
}
func unmarshalJobDetailsClassificationArray(rawMsg json.RawMessage) ([]JobDetailsClassification, error) {
if rawMsg == nil {
return nil, nil
}
var rawMessages []json.RawMessage
if err := json.Unmarshal(rawMsg, &rawMessages); err != nil {
return nil, err
}
fArray := make([]JobDetailsClassification, len(rawMessages))
for index, rawMessage := range rawMessages {
f, err := unmarshalJobDetailsClassification(rawMessage)
if err != nil {
return nil, err
}
fArray[index] = f
}
return fArray, nil
}
func unmarshalJobDetailsClassificationMap(rawMsg json.RawMessage) (map[string]JobDetailsClassification, error) {
if rawMsg == nil {
return nil, nil
}
var rawMessages map[string]json.RawMessage
if err := json.Unmarshal(rawMsg, &rawMessages); err != nil {
return nil, err
}
fMap := make(map[string]JobDetailsClassification, len(rawMessages))
for key, rawMessage := range rawMessages {
f, err := unmarshalJobDetailsClassification(rawMessage)
if err != nil {
return nil, err
}
fMap[key] = f
}
return fMap, nil
}
func unmarshalJobSecretsClassification(rawMsg json.RawMessage) (JobSecretsClassification, error) {
if rawMsg == nil {
return nil, nil
}
var m map[string]interface{}
if err := json.Unmarshal(rawMsg, &m); err != nil {
return nil, err
}
var b JobSecretsClassification
switch m["jobSecretsType"] {
case string(ClassDiscriminatorDataBox):
b = &DataboxJobSecrets{}
case string(ClassDiscriminatorDataBoxCustomerDisk):
b = &CustomerDiskJobSecrets{}
case string(ClassDiscriminatorDataBoxDisk):
b = &DataBoxDiskJobSecrets{}
case string(ClassDiscriminatorDataBoxHeavy):
b = &DataBoxHeavyJobSecrets{}
default:
b = &JobSecrets{}
}
return b, json.Unmarshal(rawMsg, b)
}
func unmarshalJobSecretsClassificationArray(rawMsg json.RawMessage) ([]JobSecretsClassification, error) {
if rawMsg == nil {
return nil, nil
}
var rawMessages []json.RawMessage
if err := json.Unmarshal(rawMsg, &rawMessages); err != nil {
return nil, err
}
fArray := make([]JobSecretsClassification, len(rawMessages))
for index, rawMessage := range rawMessages {
f, err := unmarshalJobSecretsClassification(rawMessage)
if err != nil {
return nil, err
}
fArray[index] = f
}
return fArray, nil
}
func unmarshalJobSecretsClassificationMap(rawMsg json.RawMessage) (map[string]JobSecretsClassification, error) {
if rawMsg == nil {
return nil, nil
}
var rawMessages map[string]json.RawMessage
if err := json.Unmarshal(rawMsg, &rawMessages); err != nil {
return nil, err
}
fMap := make(map[string]JobSecretsClassification, len(rawMessages))
for key, rawMessage := range rawMessages {
f, err := unmarshalJobSecretsClassification(rawMessage)
if err != nil {
return nil, err
}
fMap[key] = f
}
return fMap, nil
}
func unmarshalScheduleAvailabilityRequestClassification(rawMsg json.RawMessage) (ScheduleAvailabilityRequestClassification, error) {
if rawMsg == nil {
return nil, nil
}
var m map[string]interface{}
if err := json.Unmarshal(rawMsg, &m); err != nil {
return nil, err
}
var b ScheduleAvailabilityRequestClassification
switch m["skuName"] {
case string(SKUNameDataBox):
b = &DataBoxScheduleAvailabilityRequest{}
case string(SKUNameDataBoxDisk):
b = &DiskScheduleAvailabilityRequest{}
case string(SKUNameDataBoxHeavy):
b = &HeavyScheduleAvailabilityRequest{}
default:
b = &ScheduleAvailabilityRequest{}
}
return b, json.Unmarshal(rawMsg, b)
}
func unmarshalScheduleAvailabilityRequestClassificationArray(rawMsg json.RawMessage) ([]ScheduleAvailabilityRequestClassification, error) {
if rawMsg == nil {
return nil, nil
}
var rawMessages []json.RawMessage
if err := json.Unmarshal(rawMsg, &rawMessages); err != nil {
return nil, err
}
fArray := make([]ScheduleAvailabilityRequestClassification, len(rawMessages))
for index, rawMessage := range rawMessages {
f, err := unmarshalScheduleAvailabilityRequestClassification(rawMessage)
if err != nil {
return nil, err
}
fArray[index] = f
}
return fArray, nil
}
func unmarshalScheduleAvailabilityRequestClassificationMap(rawMsg json.RawMessage) (map[string]ScheduleAvailabilityRequestClassification, error) {
if rawMsg == nil {
return nil, nil
}
var rawMessages map[string]json.RawMessage
if err := json.Unmarshal(rawMsg, &rawMessages); err != nil {
return nil, err
}
fMap := make(map[string]ScheduleAvailabilityRequestClassification, len(rawMessages))
for key, rawMessage := range rawMessages {
f, err := unmarshalScheduleAvailabilityRequestClassification(rawMessage)
if err != nil {
return nil, err
}
fMap[key] = f
}
return fMap, nil
}
func unmarshalValidationInputRequestClassification(rawMsg json.RawMessage) (ValidationInputRequestClassification, error) {
if rawMsg == nil {
return nil, nil
@ -419,25 +210,6 @@ func unmarshalValidationInputRequestClassificationArray(rawMsg json.RawMessage)
return fArray, nil
}
func unmarshalValidationInputRequestClassificationMap(rawMsg json.RawMessage) (map[string]ValidationInputRequestClassification, error) {
if rawMsg == nil {
return nil, nil
}
var rawMessages map[string]json.RawMessage
if err := json.Unmarshal(rawMsg, &rawMessages); err != nil {
return nil, err
}
fMap := make(map[string]ValidationInputRequestClassification, len(rawMessages))
for key, rawMessage := range rawMessages {
f, err := unmarshalValidationInputRequestClassification(rawMessage)
if err != nil {
return nil, err
}
fMap[key] = f
}
return fMap, nil
}
func unmarshalValidationInputResponseClassification(rawMsg json.RawMessage) (ValidationInputResponseClassification, error) {
if rawMsg == nil {
return nil, nil
@ -484,78 +256,3 @@ func unmarshalValidationInputResponseClassificationArray(rawMsg json.RawMessage)
}
return fArray, nil
}
func unmarshalValidationInputResponseClassificationMap(rawMsg json.RawMessage) (map[string]ValidationInputResponseClassification, error) {
if rawMsg == nil {
return nil, nil
}
var rawMessages map[string]json.RawMessage
if err := json.Unmarshal(rawMsg, &rawMessages); err != nil {
return nil, err
}
fMap := make(map[string]ValidationInputResponseClassification, len(rawMessages))
for key, rawMessage := range rawMessages {
f, err := unmarshalValidationInputResponseClassification(rawMessage)
if err != nil {
return nil, err
}
fMap[key] = f
}
return fMap, nil
}
func unmarshalValidationRequestClassification(rawMsg json.RawMessage) (ValidationRequestClassification, error) {
if rawMsg == nil {
return nil, nil
}
var m map[string]interface{}
if err := json.Unmarshal(rawMsg, &m); err != nil {
return nil, err
}
var b ValidationRequestClassification
switch m["validationCategory"] {
case "JobCreationValidation":
b = &CreateJobValidations{}
default:
b = &ValidationRequest{}
}
return b, json.Unmarshal(rawMsg, b)
}
func unmarshalValidationRequestClassificationArray(rawMsg json.RawMessage) ([]ValidationRequestClassification, error) {
if rawMsg == nil {
return nil, nil
}
var rawMessages []json.RawMessage
if err := json.Unmarshal(rawMsg, &rawMessages); err != nil {
return nil, err
}
fArray := make([]ValidationRequestClassification, len(rawMessages))
for index, rawMessage := range rawMessages {
f, err := unmarshalValidationRequestClassification(rawMessage)
if err != nil {
return nil, err
}
fArray[index] = f
}
return fArray, nil
}
func unmarshalValidationRequestClassificationMap(rawMsg json.RawMessage) (map[string]ValidationRequestClassification, error) {
if rawMsg == nil {
return nil, nil
}
var rawMessages map[string]json.RawMessage
if err := json.Unmarshal(rawMsg, &rawMessages); err != nil {
return nil, err
}
fMap := make(map[string]ValidationRequestClassification, len(rawMessages))
for key, rawMessage := range rawMessages {
f, err := unmarshalValidationRequestClassification(rawMessage)
if err != nil {
return nil, err
}
fMap[key] = f
}
return fMap, nil
}

Просмотреть файл

@ -15,34 +15,28 @@ import (
"time"
)
// DataBoxManagementClientMitigateResponse contains the response from method DataBoxManagementClient.Mitigate.
type DataBoxManagementClientMitigateResponse struct {
// JobsClientBookShipmentPickUpResponse contains the response from method JobsClient.BookShipmentPickUp.
type JobsClientBookShipmentPickUpResponse struct {
JobsClientBookShipmentPickUpResult
// RawResponse contains the underlying HTTP response.
RawResponse *http.Response
}
// JobsBookShipmentPickUpResponse contains the response from method Jobs.BookShipmentPickUp.
type JobsBookShipmentPickUpResponse struct {
JobsBookShipmentPickUpResult
// RawResponse contains the underlying HTTP response.
RawResponse *http.Response
}
// JobsBookShipmentPickUpResult contains the result from method Jobs.BookShipmentPickUp.
type JobsBookShipmentPickUpResult struct {
// JobsClientBookShipmentPickUpResult contains the result from method JobsClient.BookShipmentPickUp.
type JobsClientBookShipmentPickUpResult struct {
ShipmentPickUpResponse
}
// JobsCancelResponse contains the response from method Jobs.Cancel.
type JobsCancelResponse struct {
// JobsClientCancelResponse contains the response from method JobsClient.Cancel.
type JobsClientCancelResponse struct {
// RawResponse contains the underlying HTTP response.
RawResponse *http.Response
}
// JobsCreatePollerResponse contains the response from method Jobs.Create.
type JobsCreatePollerResponse struct {
// JobsClientCreatePollerResponse contains the response from method JobsClient.Create.
type JobsClientCreatePollerResponse struct {
// Poller contains an initialized poller.
Poller *JobsCreatePoller
Poller *JobsClientCreatePoller
// RawResponse contains the underlying HTTP response.
RawResponse *http.Response
@ -51,8 +45,8 @@ type JobsCreatePollerResponse struct {
// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received.
// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second.
// A good starting value is 30 seconds. Note that some resources might benefit from a different value.
func (l JobsCreatePollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (JobsCreateResponse, error) {
respType := JobsCreateResponse{}
func (l JobsClientCreatePollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (JobsClientCreateResponse, error) {
respType := JobsClientCreateResponse{}
resp, err := l.Poller.pt.PollUntilDone(ctx, freq, &respType.JobResource)
if err != nil {
return respType, err
@ -61,13 +55,13 @@ func (l JobsCreatePollerResponse) PollUntilDone(ctx context.Context, freq time.D
return respType, nil
}
// Resume rehydrates a JobsCreatePollerResponse from the provided client and resume token.
func (l *JobsCreatePollerResponse) Resume(ctx context.Context, client *JobsClient, token string) error {
pt, err := armruntime.NewPollerFromResumeToken("JobsClient.Create", token, client.pl, client.createHandleError)
// Resume rehydrates a JobsClientCreatePollerResponse from the provided client and resume token.
func (l *JobsClientCreatePollerResponse) Resume(ctx context.Context, client *JobsClient, token string) error {
pt, err := armruntime.NewPollerFromResumeToken("JobsClient.Create", token, client.pl)
if err != nil {
return err
}
poller := &JobsCreatePoller{
poller := &JobsClientCreatePoller{
pt: pt,
}
resp, err := poller.Poll(ctx)
@ -79,22 +73,22 @@ func (l *JobsCreatePollerResponse) Resume(ctx context.Context, client *JobsClien
return nil
}
// JobsCreateResponse contains the response from method Jobs.Create.
type JobsCreateResponse struct {
JobsCreateResult
// JobsClientCreateResponse contains the response from method JobsClient.Create.
type JobsClientCreateResponse struct {
JobsClientCreateResult
// RawResponse contains the underlying HTTP response.
RawResponse *http.Response
}
// JobsCreateResult contains the result from method Jobs.Create.
type JobsCreateResult struct {
// JobsClientCreateResult contains the result from method JobsClient.Create.
type JobsClientCreateResult struct {
JobResource
}
// JobsDeletePollerResponse contains the response from method Jobs.Delete.
type JobsDeletePollerResponse struct {
// JobsClientDeletePollerResponse contains the response from method JobsClient.Delete.
type JobsClientDeletePollerResponse struct {
// Poller contains an initialized poller.
Poller *JobsDeletePoller
Poller *JobsClientDeletePoller
// RawResponse contains the underlying HTTP response.
RawResponse *http.Response
@ -103,8 +97,8 @@ type JobsDeletePollerResponse struct {
// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received.
// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second.
// A good starting value is 30 seconds. Note that some resources might benefit from a different value.
func (l JobsDeletePollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (JobsDeleteResponse, error) {
respType := JobsDeleteResponse{}
func (l JobsClientDeletePollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (JobsClientDeleteResponse, error) {
respType := JobsClientDeleteResponse{}
resp, err := l.Poller.pt.PollUntilDone(ctx, freq, nil)
if err != nil {
return respType, err
@ -113,13 +107,13 @@ func (l JobsDeletePollerResponse) PollUntilDone(ctx context.Context, freq time.D
return respType, nil
}
// Resume rehydrates a JobsDeletePollerResponse from the provided client and resume token.
func (l *JobsDeletePollerResponse) Resume(ctx context.Context, client *JobsClient, token string) error {
pt, err := armruntime.NewPollerFromResumeToken("JobsClient.Delete", token, client.pl, client.deleteHandleError)
// Resume rehydrates a JobsClientDeletePollerResponse from the provided client and resume token.
func (l *JobsClientDeletePollerResponse) Resume(ctx context.Context, client *JobsClient, token string) error {
pt, err := armruntime.NewPollerFromResumeToken("JobsClient.Delete", token, client.pl)
if err != nil {
return err
}
poller := &JobsDeletePoller{
poller := &JobsClientDeletePoller{
pt: pt,
}
resp, err := poller.Poll(ctx)
@ -131,70 +125,70 @@ func (l *JobsDeletePollerResponse) Resume(ctx context.Context, client *JobsClien
return nil
}
// JobsDeleteResponse contains the response from method Jobs.Delete.
type JobsDeleteResponse struct {
// JobsClientDeleteResponse contains the response from method JobsClient.Delete.
type JobsClientDeleteResponse struct {
// RawResponse contains the underlying HTTP response.
RawResponse *http.Response
}
// JobsGetResponse contains the response from method Jobs.Get.
type JobsGetResponse struct {
JobsGetResult
// JobsClientGetResponse contains the response from method JobsClient.Get.
type JobsClientGetResponse struct {
JobsClientGetResult
// RawResponse contains the underlying HTTP response.
RawResponse *http.Response
}
// JobsGetResult contains the result from method Jobs.Get.
type JobsGetResult struct {
// JobsClientGetResult contains the result from method JobsClient.Get.
type JobsClientGetResult struct {
JobResource
}
// JobsListByResourceGroupResponse contains the response from method Jobs.ListByResourceGroup.
type JobsListByResourceGroupResponse struct {
JobsListByResourceGroupResult
// JobsClientListByResourceGroupResponse contains the response from method JobsClient.ListByResourceGroup.
type JobsClientListByResourceGroupResponse struct {
JobsClientListByResourceGroupResult
// RawResponse contains the underlying HTTP response.
RawResponse *http.Response
}
// JobsListByResourceGroupResult contains the result from method Jobs.ListByResourceGroup.
type JobsListByResourceGroupResult struct {
// JobsClientListByResourceGroupResult contains the result from method JobsClient.ListByResourceGroup.
type JobsClientListByResourceGroupResult struct {
JobResourceList
}
// JobsListCredentialsResponse contains the response from method Jobs.ListCredentials.
type JobsListCredentialsResponse struct {
JobsListCredentialsResult
// JobsClientListCredentialsResponse contains the response from method JobsClient.ListCredentials.
type JobsClientListCredentialsResponse struct {
JobsClientListCredentialsResult
// RawResponse contains the underlying HTTP response.
RawResponse *http.Response
}
// JobsListCredentialsResult contains the result from method Jobs.ListCredentials.
type JobsListCredentialsResult struct {
// JobsClientListCredentialsResult contains the result from method JobsClient.ListCredentials.
type JobsClientListCredentialsResult struct {
UnencryptedCredentialsList
}
// JobsListResponse contains the response from method Jobs.List.
type JobsListResponse struct {
JobsListResult
// JobsClientListResponse contains the response from method JobsClient.List.
type JobsClientListResponse struct {
JobsClientListResult
// RawResponse contains the underlying HTTP response.
RawResponse *http.Response
}
// JobsListResult contains the result from method Jobs.List.
type JobsListResult struct {
// JobsClientListResult contains the result from method JobsClient.List.
type JobsClientListResult struct {
JobResourceList
}
// JobsMarkDevicesShippedResponse contains the response from method Jobs.MarkDevicesShipped.
type JobsMarkDevicesShippedResponse struct {
// JobsClientMarkDevicesShippedResponse contains the response from method JobsClient.MarkDevicesShipped.
type JobsClientMarkDevicesShippedResponse struct {
// RawResponse contains the underlying HTTP response.
RawResponse *http.Response
}
// JobsUpdatePollerResponse contains the response from method Jobs.Update.
type JobsUpdatePollerResponse struct {
// JobsClientUpdatePollerResponse contains the response from method JobsClient.Update.
type JobsClientUpdatePollerResponse struct {
// Poller contains an initialized poller.
Poller *JobsUpdatePoller
Poller *JobsClientUpdatePoller
// RawResponse contains the underlying HTTP response.
RawResponse *http.Response
@ -203,8 +197,8 @@ type JobsUpdatePollerResponse struct {
// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received.
// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second.
// A good starting value is 30 seconds. Note that some resources might benefit from a different value.
func (l JobsUpdatePollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (JobsUpdateResponse, error) {
respType := JobsUpdateResponse{}
func (l JobsClientUpdatePollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (JobsClientUpdateResponse, error) {
respType := JobsClientUpdateResponse{}
resp, err := l.Poller.pt.PollUntilDone(ctx, freq, &respType.JobResource)
if err != nil {
return respType, err
@ -213,13 +207,13 @@ func (l JobsUpdatePollerResponse) PollUntilDone(ctx context.Context, freq time.D
return respType, nil
}
// Resume rehydrates a JobsUpdatePollerResponse from the provided client and resume token.
func (l *JobsUpdatePollerResponse) Resume(ctx context.Context, client *JobsClient, token string) error {
pt, err := armruntime.NewPollerFromResumeToken("JobsClient.Update", token, client.pl, client.updateHandleError)
// Resume rehydrates a JobsClientUpdatePollerResponse from the provided client and resume token.
func (l *JobsClientUpdatePollerResponse) Resume(ctx context.Context, client *JobsClient, token string) error {
pt, err := armruntime.NewPollerFromResumeToken("JobsClient.Update", token, client.pl)
if err != nil {
return err
}
poller := &JobsUpdatePoller{
poller := &JobsClientUpdatePoller{
pt: pt,
}
resp, err := poller.Poll(ctx)
@ -231,98 +225,104 @@ func (l *JobsUpdatePollerResponse) Resume(ctx context.Context, client *JobsClien
return nil
}
// JobsUpdateResponse contains the response from method Jobs.Update.
type JobsUpdateResponse struct {
JobsUpdateResult
// JobsClientUpdateResponse contains the response from method JobsClient.Update.
type JobsClientUpdateResponse struct {
JobsClientUpdateResult
// RawResponse contains the underlying HTTP response.
RawResponse *http.Response
}
// JobsUpdateResult contains the result from method Jobs.Update.
type JobsUpdateResult struct {
// JobsClientUpdateResult contains the result from method JobsClient.Update.
type JobsClientUpdateResult struct {
JobResource
}
// OperationsListResponse contains the response from method Operations.List.
type OperationsListResponse struct {
OperationsListResult
// ManagementClientMitigateResponse contains the response from method ManagementClient.Mitigate.
type ManagementClientMitigateResponse struct {
// RawResponse contains the underlying HTTP response.
RawResponse *http.Response
}
// OperationsListResult contains the result from method Operations.List.
type OperationsListResult struct {
// OperationsClientListResponse contains the response from method OperationsClient.List.
type OperationsClientListResponse struct {
OperationsClientListResult
// RawResponse contains the underlying HTTP response.
RawResponse *http.Response
}
// OperationsClientListResult contains the result from method OperationsClient.List.
type OperationsClientListResult struct {
OperationList
}
// ServiceListAvailableSKUsByResourceGroupResponse contains the response from method Service.ListAvailableSKUsByResourceGroup.
type ServiceListAvailableSKUsByResourceGroupResponse struct {
ServiceListAvailableSKUsByResourceGroupResult
// ServiceClientListAvailableSKUsByResourceGroupResponse contains the response from method ServiceClient.ListAvailableSKUsByResourceGroup.
type ServiceClientListAvailableSKUsByResourceGroupResponse struct {
ServiceClientListAvailableSKUsByResourceGroupResult
// RawResponse contains the underlying HTTP response.
RawResponse *http.Response
}
// ServiceListAvailableSKUsByResourceGroupResult contains the result from method Service.ListAvailableSKUsByResourceGroup.
type ServiceListAvailableSKUsByResourceGroupResult struct {
// ServiceClientListAvailableSKUsByResourceGroupResult contains the result from method ServiceClient.ListAvailableSKUsByResourceGroup.
type ServiceClientListAvailableSKUsByResourceGroupResult struct {
AvailableSKUsResult
}
// ServiceRegionConfigurationByResourceGroupResponse contains the response from method Service.RegionConfigurationByResourceGroup.
type ServiceRegionConfigurationByResourceGroupResponse struct {
ServiceRegionConfigurationByResourceGroupResult
// ServiceClientRegionConfigurationByResourceGroupResponse contains the response from method ServiceClient.RegionConfigurationByResourceGroup.
type ServiceClientRegionConfigurationByResourceGroupResponse struct {
ServiceClientRegionConfigurationByResourceGroupResult
// RawResponse contains the underlying HTTP response.
RawResponse *http.Response
}
// ServiceRegionConfigurationByResourceGroupResult contains the result from method Service.RegionConfigurationByResourceGroup.
type ServiceRegionConfigurationByResourceGroupResult struct {
// ServiceClientRegionConfigurationByResourceGroupResult contains the result from method ServiceClient.RegionConfigurationByResourceGroup.
type ServiceClientRegionConfigurationByResourceGroupResult struct {
RegionConfigurationResponse
}
// ServiceRegionConfigurationResponse contains the response from method Service.RegionConfiguration.
type ServiceRegionConfigurationResponse struct {
ServiceRegionConfigurationResult
// ServiceClientRegionConfigurationResponse contains the response from method ServiceClient.RegionConfiguration.
type ServiceClientRegionConfigurationResponse struct {
ServiceClientRegionConfigurationResult
// RawResponse contains the underlying HTTP response.
RawResponse *http.Response
}
// ServiceRegionConfigurationResult contains the result from method Service.RegionConfiguration.
type ServiceRegionConfigurationResult struct {
// ServiceClientRegionConfigurationResult contains the result from method ServiceClient.RegionConfiguration.
type ServiceClientRegionConfigurationResult struct {
RegionConfigurationResponse
}
// ServiceValidateAddressResponse contains the response from method Service.ValidateAddress.
type ServiceValidateAddressResponse struct {
ServiceValidateAddressResult
// ServiceClientValidateAddressResponse contains the response from method ServiceClient.ValidateAddress.
type ServiceClientValidateAddressResponse struct {
ServiceClientValidateAddressResult
// RawResponse contains the underlying HTTP response.
RawResponse *http.Response
}
// ServiceValidateAddressResult contains the result from method Service.ValidateAddress.
type ServiceValidateAddressResult struct {
// ServiceClientValidateAddressResult contains the result from method ServiceClient.ValidateAddress.
type ServiceClientValidateAddressResult struct {
AddressValidationOutput
}
// ServiceValidateInputsByResourceGroupResponse contains the response from method Service.ValidateInputsByResourceGroup.
type ServiceValidateInputsByResourceGroupResponse struct {
ServiceValidateInputsByResourceGroupResult
// ServiceClientValidateInputsByResourceGroupResponse contains the response from method ServiceClient.ValidateInputsByResourceGroup.
type ServiceClientValidateInputsByResourceGroupResponse struct {
ServiceClientValidateInputsByResourceGroupResult
// RawResponse contains the underlying HTTP response.
RawResponse *http.Response
}
// ServiceValidateInputsByResourceGroupResult contains the result from method Service.ValidateInputsByResourceGroup.
type ServiceValidateInputsByResourceGroupResult struct {
// ServiceClientValidateInputsByResourceGroupResult contains the result from method ServiceClient.ValidateInputsByResourceGroup.
type ServiceClientValidateInputsByResourceGroupResult struct {
ValidationResponse
}
// ServiceValidateInputsResponse contains the response from method Service.ValidateInputs.
type ServiceValidateInputsResponse struct {
ServiceValidateInputsResult
// ServiceClientValidateInputsResponse contains the response from method ServiceClient.ValidateInputs.
type ServiceClientValidateInputsResponse struct {
ServiceClientValidateInputsResult
// RawResponse contains the underlying HTTP response.
RawResponse *http.Response
}
// ServiceValidateInputsResult contains the result from method Service.ValidateInputs.
type ServiceValidateInputsResult struct {
// ServiceClientValidateInputsResult contains the result from method ServiceClient.ValidateInputs.
type ServiceClientValidateInputsResult struct {
ValidationResponse
}

Просмотреть файл

@ -11,7 +11,6 @@ package armdatabox
import (
"context"
"errors"
"fmt"
"github.com/Azure/azure-sdk-for-go/sdk/azcore"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime"
@ -25,39 +24,53 @@ import (
// ServiceClient contains the methods for the Service group.
// Don't use this type directly, use NewServiceClient() instead.
type ServiceClient struct {
ep string
pl runtime.Pipeline
host string
subscriptionID string
pl runtime.Pipeline
}
// NewServiceClient creates a new instance of ServiceClient with the specified values.
// subscriptionID - The Subscription Id
// credential - used to authorize requests. Usually a credential from azidentity.
// options - pass nil to accept the default values.
func NewServiceClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *ServiceClient {
cp := arm.ClientOptions{}
if options != nil {
cp = *options
if options == nil {
options = &arm.ClientOptions{}
}
if len(cp.Host) == 0 {
cp.Host = arm.AzurePublicCloud
ep := options.Endpoint
if len(ep) == 0 {
ep = arm.AzurePublicCloud
}
return &ServiceClient{subscriptionID: subscriptionID, ep: string(cp.Host), pl: armruntime.NewPipeline(module, version, credential, &cp)}
client := &ServiceClient{
subscriptionID: subscriptionID,
host: string(ep),
pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options),
}
return client
}
// ListAvailableSKUsByResourceGroup - This method provides the list of available skus for the given subscription, resource group and location.
// If the operation fails it returns the *APIError error type.
func (client *ServiceClient) ListAvailableSKUsByResourceGroup(resourceGroupName string, location string, availableSKURequest AvailableSKURequest, options *ServiceListAvailableSKUsByResourceGroupOptions) *ServiceListAvailableSKUsByResourceGroupPager {
return &ServiceListAvailableSKUsByResourceGroupPager{
// ListAvailableSKUsByResourceGroup - This method provides the list of available skus for the given subscription, resource
// group and location.
// If the operation fails it returns an *azcore.ResponseError type.
// resourceGroupName - The Resource Group Name
// location - The location of the resource
// availableSKURequest - Filters for showing the available skus.
// options - ServiceClientListAvailableSKUsByResourceGroupOptions contains the optional parameters for the ServiceClient.ListAvailableSKUsByResourceGroup
// method.
func (client *ServiceClient) ListAvailableSKUsByResourceGroup(resourceGroupName string, location string, availableSKURequest AvailableSKURequest, options *ServiceClientListAvailableSKUsByResourceGroupOptions) *ServiceClientListAvailableSKUsByResourceGroupPager {
return &ServiceClientListAvailableSKUsByResourceGroupPager{
client: client,
requester: func(ctx context.Context) (*policy.Request, error) {
return client.listAvailableSKUsByResourceGroupCreateRequest(ctx, resourceGroupName, location, availableSKURequest, options)
},
advancer: func(ctx context.Context, resp ServiceListAvailableSKUsByResourceGroupResponse) (*policy.Request, error) {
advancer: func(ctx context.Context, resp ServiceClientListAvailableSKUsByResourceGroupResponse) (*policy.Request, error) {
return runtime.NewRequest(ctx, http.MethodGet, *resp.AvailableSKUsResult.NextLink)
},
}
}
// listAvailableSKUsByResourceGroupCreateRequest creates the ListAvailableSKUsByResourceGroup request.
func (client *ServiceClient) listAvailableSKUsByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, location string, availableSKURequest AvailableSKURequest, options *ServiceListAvailableSKUsByResourceGroupOptions) (*policy.Request, error) {
func (client *ServiceClient) listAvailableSKUsByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, location string, availableSKURequest AvailableSKURequest, options *ServiceClientListAvailableSKUsByResourceGroupOptions) (*policy.Request, error) {
urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/availableSkus"
if client.subscriptionID == "" {
return nil, errors.New("parameter client.subscriptionID cannot be empty")
@ -71,7 +84,7 @@ func (client *ServiceClient) listAvailableSKUsByResourceGroupCreateRequest(ctx c
return nil, errors.New("parameter location cannot be empty")
}
urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location))
req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath))
req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath))
if err != nil {
return nil, err
}
@ -83,46 +96,37 @@ func (client *ServiceClient) listAvailableSKUsByResourceGroupCreateRequest(ctx c
}
// listAvailableSKUsByResourceGroupHandleResponse handles the ListAvailableSKUsByResourceGroup response.
func (client *ServiceClient) listAvailableSKUsByResourceGroupHandleResponse(resp *http.Response) (ServiceListAvailableSKUsByResourceGroupResponse, error) {
result := ServiceListAvailableSKUsByResourceGroupResponse{RawResponse: resp}
func (client *ServiceClient) listAvailableSKUsByResourceGroupHandleResponse(resp *http.Response) (ServiceClientListAvailableSKUsByResourceGroupResponse, error) {
result := ServiceClientListAvailableSKUsByResourceGroupResponse{RawResponse: resp}
if err := runtime.UnmarshalAsJSON(resp, &result.AvailableSKUsResult); err != nil {
return ServiceListAvailableSKUsByResourceGroupResponse{}, runtime.NewResponseError(err, resp)
return ServiceClientListAvailableSKUsByResourceGroupResponse{}, err
}
return result, nil
}
// listAvailableSKUsByResourceGroupHandleError handles the ListAvailableSKUsByResourceGroup error response.
func (client *ServiceClient) listAvailableSKUsByResourceGroupHandleError(resp *http.Response) error {
body, err := runtime.Payload(resp)
if err != nil {
return runtime.NewResponseError(err, resp)
}
errType := APIError{raw: string(body)}
if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil {
return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp)
}
return runtime.NewResponseError(&errType, resp)
}
// RegionConfiguration - This API provides configuration details specific to given region/location at Subscription level.
// If the operation fails it returns the *APIError error type.
func (client *ServiceClient) RegionConfiguration(ctx context.Context, location string, regionConfigurationRequest RegionConfigurationRequest, options *ServiceRegionConfigurationOptions) (ServiceRegionConfigurationResponse, error) {
// If the operation fails it returns an *azcore.ResponseError type.
// location - The location of the resource
// regionConfigurationRequest - Request body to get the configuration for the region.
// options - ServiceClientRegionConfigurationOptions contains the optional parameters for the ServiceClient.RegionConfiguration
// method.
func (client *ServiceClient) RegionConfiguration(ctx context.Context, location string, regionConfigurationRequest RegionConfigurationRequest, options *ServiceClientRegionConfigurationOptions) (ServiceClientRegionConfigurationResponse, error) {
req, err := client.regionConfigurationCreateRequest(ctx, location, regionConfigurationRequest, options)
if err != nil {
return ServiceRegionConfigurationResponse{}, err
return ServiceClientRegionConfigurationResponse{}, err
}
resp, err := client.pl.Do(req)
if err != nil {
return ServiceRegionConfigurationResponse{}, err
return ServiceClientRegionConfigurationResponse{}, err
}
if !runtime.HasStatusCode(resp, http.StatusOK) {
return ServiceRegionConfigurationResponse{}, client.regionConfigurationHandleError(resp)
return ServiceClientRegionConfigurationResponse{}, runtime.NewResponseError(resp)
}
return client.regionConfigurationHandleResponse(resp)
}
// regionConfigurationCreateRequest creates the RegionConfiguration request.
func (client *ServiceClient) regionConfigurationCreateRequest(ctx context.Context, location string, regionConfigurationRequest RegionConfigurationRequest, options *ServiceRegionConfigurationOptions) (*policy.Request, error) {
func (client *ServiceClient) regionConfigurationCreateRequest(ctx context.Context, location string, regionConfigurationRequest RegionConfigurationRequest, options *ServiceClientRegionConfigurationOptions) (*policy.Request, error) {
urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/regionConfiguration"
if client.subscriptionID == "" {
return nil, errors.New("parameter client.subscriptionID cannot be empty")
@ -132,7 +136,7 @@ func (client *ServiceClient) regionConfigurationCreateRequest(ctx context.Contex
return nil, errors.New("parameter location cannot be empty")
}
urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location))
req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath))
req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath))
if err != nil {
return nil, err
}
@ -144,46 +148,39 @@ func (client *ServiceClient) regionConfigurationCreateRequest(ctx context.Contex
}
// regionConfigurationHandleResponse handles the RegionConfiguration response.
func (client *ServiceClient) regionConfigurationHandleResponse(resp *http.Response) (ServiceRegionConfigurationResponse, error) {
result := ServiceRegionConfigurationResponse{RawResponse: resp}
func (client *ServiceClient) regionConfigurationHandleResponse(resp *http.Response) (ServiceClientRegionConfigurationResponse, error) {
result := ServiceClientRegionConfigurationResponse{RawResponse: resp}
if err := runtime.UnmarshalAsJSON(resp, &result.RegionConfigurationResponse); err != nil {
return ServiceRegionConfigurationResponse{}, runtime.NewResponseError(err, resp)
return ServiceClientRegionConfigurationResponse{}, err
}
return result, nil
}
// regionConfigurationHandleError handles the RegionConfiguration error response.
func (client *ServiceClient) regionConfigurationHandleError(resp *http.Response) error {
body, err := runtime.Payload(resp)
if err != nil {
return runtime.NewResponseError(err, resp)
}
errType := APIError{raw: string(body)}
if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil {
return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp)
}
return runtime.NewResponseError(&errType, resp)
}
// RegionConfigurationByResourceGroup - This API provides configuration details specific to given region/location at Resource group level.
// If the operation fails it returns the *APIError error type.
func (client *ServiceClient) RegionConfigurationByResourceGroup(ctx context.Context, resourceGroupName string, location string, regionConfigurationRequest RegionConfigurationRequest, options *ServiceRegionConfigurationByResourceGroupOptions) (ServiceRegionConfigurationByResourceGroupResponse, error) {
// RegionConfigurationByResourceGroup - This API provides configuration details specific to given region/location at Resource
// group level.
// If the operation fails it returns an *azcore.ResponseError type.
// resourceGroupName - The Resource Group Name
// location - The location of the resource
// regionConfigurationRequest - Request body to get the configuration for the region at resource group level.
// options - ServiceClientRegionConfigurationByResourceGroupOptions contains the optional parameters for the ServiceClient.RegionConfigurationByResourceGroup
// method.
func (client *ServiceClient) RegionConfigurationByResourceGroup(ctx context.Context, resourceGroupName string, location string, regionConfigurationRequest RegionConfigurationRequest, options *ServiceClientRegionConfigurationByResourceGroupOptions) (ServiceClientRegionConfigurationByResourceGroupResponse, error) {
req, err := client.regionConfigurationByResourceGroupCreateRequest(ctx, resourceGroupName, location, regionConfigurationRequest, options)
if err != nil {
return ServiceRegionConfigurationByResourceGroupResponse{}, err
return ServiceClientRegionConfigurationByResourceGroupResponse{}, err
}
resp, err := client.pl.Do(req)
if err != nil {
return ServiceRegionConfigurationByResourceGroupResponse{}, err
return ServiceClientRegionConfigurationByResourceGroupResponse{}, err
}
if !runtime.HasStatusCode(resp, http.StatusOK) {
return ServiceRegionConfigurationByResourceGroupResponse{}, client.regionConfigurationByResourceGroupHandleError(resp)
return ServiceClientRegionConfigurationByResourceGroupResponse{}, runtime.NewResponseError(resp)
}
return client.regionConfigurationByResourceGroupHandleResponse(resp)
}
// regionConfigurationByResourceGroupCreateRequest creates the RegionConfigurationByResourceGroup request.
func (client *ServiceClient) regionConfigurationByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, location string, regionConfigurationRequest RegionConfigurationRequest, options *ServiceRegionConfigurationByResourceGroupOptions) (*policy.Request, error) {
func (client *ServiceClient) regionConfigurationByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, location string, regionConfigurationRequest RegionConfigurationRequest, options *ServiceClientRegionConfigurationByResourceGroupOptions) (*policy.Request, error) {
urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/regionConfiguration"
if client.subscriptionID == "" {
return nil, errors.New("parameter client.subscriptionID cannot be empty")
@ -197,7 +194,7 @@ func (client *ServiceClient) regionConfigurationByResourceGroupCreateRequest(ctx
return nil, errors.New("parameter location cannot be empty")
}
urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location))
req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath))
req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath))
if err != nil {
return nil, err
}
@ -209,47 +206,37 @@ func (client *ServiceClient) regionConfigurationByResourceGroupCreateRequest(ctx
}
// regionConfigurationByResourceGroupHandleResponse handles the RegionConfigurationByResourceGroup response.
func (client *ServiceClient) regionConfigurationByResourceGroupHandleResponse(resp *http.Response) (ServiceRegionConfigurationByResourceGroupResponse, error) {
result := ServiceRegionConfigurationByResourceGroupResponse{RawResponse: resp}
func (client *ServiceClient) regionConfigurationByResourceGroupHandleResponse(resp *http.Response) (ServiceClientRegionConfigurationByResourceGroupResponse, error) {
result := ServiceClientRegionConfigurationByResourceGroupResponse{RawResponse: resp}
if err := runtime.UnmarshalAsJSON(resp, &result.RegionConfigurationResponse); err != nil {
return ServiceRegionConfigurationByResourceGroupResponse{}, runtime.NewResponseError(err, resp)
return ServiceClientRegionConfigurationByResourceGroupResponse{}, err
}
return result, nil
}
// regionConfigurationByResourceGroupHandleError handles the RegionConfigurationByResourceGroup error response.
func (client *ServiceClient) regionConfigurationByResourceGroupHandleError(resp *http.Response) error {
body, err := runtime.Payload(resp)
if err != nil {
return runtime.NewResponseError(err, resp)
}
errType := APIError{raw: string(body)}
if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil {
return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp)
}
return runtime.NewResponseError(&errType, resp)
}
// ValidateAddress - [DEPRECATED NOTICE: This operation will soon be removed]. This method validates the customer shipping address and provide alternate
// addresses if any.
// If the operation fails it returns the *APIError error type.
func (client *ServiceClient) ValidateAddress(ctx context.Context, location string, validateAddress ValidateAddress, options *ServiceValidateAddressOptions) (ServiceValidateAddressResponse, error) {
// ValidateAddress - [DEPRECATED NOTICE: This operation will soon be removed]. This method validates the customer shipping
// address and provide alternate addresses if any.
// If the operation fails it returns an *azcore.ResponseError type.
// location - The location of the resource
// validateAddress - Shipping address of the customer.
// options - ServiceClientValidateAddressOptions contains the optional parameters for the ServiceClient.ValidateAddress method.
func (client *ServiceClient) ValidateAddress(ctx context.Context, location string, validateAddress ValidateAddress, options *ServiceClientValidateAddressOptions) (ServiceClientValidateAddressResponse, error) {
req, err := client.validateAddressCreateRequest(ctx, location, validateAddress, options)
if err != nil {
return ServiceValidateAddressResponse{}, err
return ServiceClientValidateAddressResponse{}, err
}
resp, err := client.pl.Do(req)
if err != nil {
return ServiceValidateAddressResponse{}, err
return ServiceClientValidateAddressResponse{}, err
}
if !runtime.HasStatusCode(resp, http.StatusOK) {
return ServiceValidateAddressResponse{}, client.validateAddressHandleError(resp)
return ServiceClientValidateAddressResponse{}, runtime.NewResponseError(resp)
}
return client.validateAddressHandleResponse(resp)
}
// validateAddressCreateRequest creates the ValidateAddress request.
func (client *ServiceClient) validateAddressCreateRequest(ctx context.Context, location string, validateAddress ValidateAddress, options *ServiceValidateAddressOptions) (*policy.Request, error) {
func (client *ServiceClient) validateAddressCreateRequest(ctx context.Context, location string, validateAddress ValidateAddress, options *ServiceClientValidateAddressOptions) (*policy.Request, error) {
urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateAddress"
if client.subscriptionID == "" {
return nil, errors.New("parameter client.subscriptionID cannot be empty")
@ -259,7 +246,7 @@ func (client *ServiceClient) validateAddressCreateRequest(ctx context.Context, l
return nil, errors.New("parameter location cannot be empty")
}
urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location))
req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath))
req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath))
if err != nil {
return nil, err
}
@ -271,46 +258,36 @@ func (client *ServiceClient) validateAddressCreateRequest(ctx context.Context, l
}
// validateAddressHandleResponse handles the ValidateAddress response.
func (client *ServiceClient) validateAddressHandleResponse(resp *http.Response) (ServiceValidateAddressResponse, error) {
result := ServiceValidateAddressResponse{RawResponse: resp}
func (client *ServiceClient) validateAddressHandleResponse(resp *http.Response) (ServiceClientValidateAddressResponse, error) {
result := ServiceClientValidateAddressResponse{RawResponse: resp}
if err := runtime.UnmarshalAsJSON(resp, &result.AddressValidationOutput); err != nil {
return ServiceValidateAddressResponse{}, runtime.NewResponseError(err, resp)
return ServiceClientValidateAddressResponse{}, err
}
return result, nil
}
// validateAddressHandleError handles the ValidateAddress error response.
func (client *ServiceClient) validateAddressHandleError(resp *http.Response) error {
body, err := runtime.Payload(resp)
if err != nil {
return runtime.NewResponseError(err, resp)
}
errType := APIError{raw: string(body)}
if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil {
return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp)
}
return runtime.NewResponseError(&errType, resp)
}
// ValidateInputs - This method does all necessary pre-job creation validation under subscription.
// If the operation fails it returns the *APIError error type.
func (client *ServiceClient) ValidateInputs(ctx context.Context, location string, validationRequest ValidationRequestClassification, options *ServiceValidateInputsOptions) (ServiceValidateInputsResponse, error) {
// If the operation fails it returns an *azcore.ResponseError type.
// location - The location of the resource
// validationRequest - Inputs of the customer.
// options - ServiceClientValidateInputsOptions contains the optional parameters for the ServiceClient.ValidateInputs method.
func (client *ServiceClient) ValidateInputs(ctx context.Context, location string, validationRequest ValidationRequestClassification, options *ServiceClientValidateInputsOptions) (ServiceClientValidateInputsResponse, error) {
req, err := client.validateInputsCreateRequest(ctx, location, validationRequest, options)
if err != nil {
return ServiceValidateInputsResponse{}, err
return ServiceClientValidateInputsResponse{}, err
}
resp, err := client.pl.Do(req)
if err != nil {
return ServiceValidateInputsResponse{}, err
return ServiceClientValidateInputsResponse{}, err
}
if !runtime.HasStatusCode(resp, http.StatusOK) {
return ServiceValidateInputsResponse{}, client.validateInputsHandleError(resp)
return ServiceClientValidateInputsResponse{}, runtime.NewResponseError(resp)
}
return client.validateInputsHandleResponse(resp)
}
// validateInputsCreateRequest creates the ValidateInputs request.
func (client *ServiceClient) validateInputsCreateRequest(ctx context.Context, location string, validationRequest ValidationRequestClassification, options *ServiceValidateInputsOptions) (*policy.Request, error) {
func (client *ServiceClient) validateInputsCreateRequest(ctx context.Context, location string, validationRequest ValidationRequestClassification, options *ServiceClientValidateInputsOptions) (*policy.Request, error) {
urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateInputs"
if client.subscriptionID == "" {
return nil, errors.New("parameter client.subscriptionID cannot be empty")
@ -320,7 +297,7 @@ func (client *ServiceClient) validateInputsCreateRequest(ctx context.Context, lo
return nil, errors.New("parameter location cannot be empty")
}
urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location))
req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath))
req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath))
if err != nil {
return nil, err
}
@ -332,46 +309,38 @@ func (client *ServiceClient) validateInputsCreateRequest(ctx context.Context, lo
}
// validateInputsHandleResponse handles the ValidateInputs response.
func (client *ServiceClient) validateInputsHandleResponse(resp *http.Response) (ServiceValidateInputsResponse, error) {
result := ServiceValidateInputsResponse{RawResponse: resp}
func (client *ServiceClient) validateInputsHandleResponse(resp *http.Response) (ServiceClientValidateInputsResponse, error) {
result := ServiceClientValidateInputsResponse{RawResponse: resp}
if err := runtime.UnmarshalAsJSON(resp, &result.ValidationResponse); err != nil {
return ServiceValidateInputsResponse{}, runtime.NewResponseError(err, resp)
return ServiceClientValidateInputsResponse{}, err
}
return result, nil
}
// validateInputsHandleError handles the ValidateInputs error response.
func (client *ServiceClient) validateInputsHandleError(resp *http.Response) error {
body, err := runtime.Payload(resp)
if err != nil {
return runtime.NewResponseError(err, resp)
}
errType := APIError{raw: string(body)}
if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil {
return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp)
}
return runtime.NewResponseError(&errType, resp)
}
// ValidateInputsByResourceGroup - This method does all necessary pre-job creation validation under resource group.
// If the operation fails it returns the *APIError error type.
func (client *ServiceClient) ValidateInputsByResourceGroup(ctx context.Context, resourceGroupName string, location string, validationRequest ValidationRequestClassification, options *ServiceValidateInputsByResourceGroupOptions) (ServiceValidateInputsByResourceGroupResponse, error) {
// If the operation fails it returns an *azcore.ResponseError type.
// resourceGroupName - The Resource Group Name
// location - The location of the resource
// validationRequest - Inputs of the customer.
// options - ServiceClientValidateInputsByResourceGroupOptions contains the optional parameters for the ServiceClient.ValidateInputsByResourceGroup
// method.
func (client *ServiceClient) ValidateInputsByResourceGroup(ctx context.Context, resourceGroupName string, location string, validationRequest ValidationRequestClassification, options *ServiceClientValidateInputsByResourceGroupOptions) (ServiceClientValidateInputsByResourceGroupResponse, error) {
req, err := client.validateInputsByResourceGroupCreateRequest(ctx, resourceGroupName, location, validationRequest, options)
if err != nil {
return ServiceValidateInputsByResourceGroupResponse{}, err
return ServiceClientValidateInputsByResourceGroupResponse{}, err
}
resp, err := client.pl.Do(req)
if err != nil {
return ServiceValidateInputsByResourceGroupResponse{}, err
return ServiceClientValidateInputsByResourceGroupResponse{}, err
}
if !runtime.HasStatusCode(resp, http.StatusOK) {
return ServiceValidateInputsByResourceGroupResponse{}, client.validateInputsByResourceGroupHandleError(resp)
return ServiceClientValidateInputsByResourceGroupResponse{}, runtime.NewResponseError(resp)
}
return client.validateInputsByResourceGroupHandleResponse(resp)
}
// validateInputsByResourceGroupCreateRequest creates the ValidateInputsByResourceGroup request.
func (client *ServiceClient) validateInputsByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, location string, validationRequest ValidationRequestClassification, options *ServiceValidateInputsByResourceGroupOptions) (*policy.Request, error) {
func (client *ServiceClient) validateInputsByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, location string, validationRequest ValidationRequestClassification, options *ServiceClientValidateInputsByResourceGroupOptions) (*policy.Request, error) {
urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/validateInputs"
if client.subscriptionID == "" {
return nil, errors.New("parameter client.subscriptionID cannot be empty")
@ -385,7 +354,7 @@ func (client *ServiceClient) validateInputsByResourceGroupCreateRequest(ctx cont
return nil, errors.New("parameter location cannot be empty")
}
urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location))
req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.ep, urlPath))
req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath))
if err != nil {
return nil, err
}
@ -397,23 +366,10 @@ func (client *ServiceClient) validateInputsByResourceGroupCreateRequest(ctx cont
}
// validateInputsByResourceGroupHandleResponse handles the ValidateInputsByResourceGroup response.
func (client *ServiceClient) validateInputsByResourceGroupHandleResponse(resp *http.Response) (ServiceValidateInputsByResourceGroupResponse, error) {
result := ServiceValidateInputsByResourceGroupResponse{RawResponse: resp}
func (client *ServiceClient) validateInputsByResourceGroupHandleResponse(resp *http.Response) (ServiceClientValidateInputsByResourceGroupResponse, error) {
result := ServiceClientValidateInputsByResourceGroupResponse{RawResponse: resp}
if err := runtime.UnmarshalAsJSON(resp, &result.ValidationResponse); err != nil {
return ServiceValidateInputsByResourceGroupResponse{}, runtime.NewResponseError(err, resp)
return ServiceClientValidateInputsByResourceGroupResponse{}, err
}
return result, nil
}
// validateInputsByResourceGroupHandleError handles the ValidateInputsByResourceGroup error response.
func (client *ServiceClient) validateInputsByResourceGroupHandleError(resp *http.Response) error {
body, err := runtime.Payload(resp)
if err != nil {
return runtime.NewResponseError(err, resp)
}
errType := APIError{raw: string(body)}
if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil {
return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp)
}
return runtime.NewResponseError(&errType, resp)
}