From bbd6a1bdb64bce740f4abc00a73152d9e2e6b75b Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 25 Jul 2023 12:11:41 +0000 Subject: [PATCH] CodeGen from PR 24857 in Azure/azure-rest-api-specs Merge a5902fa08f2ca5f9d31556b0b7508266af5f3499 into 7c50841aadb4bfc241de3f09146e1f97ce3583b2 --- .../databox/armdatabox/CHANGELOG.md | 10 + .../databox/armdatabox/autorest.md | 7 +- .../databox/armdatabox/client_factory.go | 13 +- .../databox/armdatabox/constants.go | 271 +- sdk/resourcemanager/databox/armdatabox/go.mod | 20 +- sdk/resourcemanager/databox/armdatabox/go.sum | 38 +- .../databox/armdatabox/interfaces.go | 102 + .../databox/armdatabox/jobs_client.go | 151 +- .../armdatabox/jobs_client_example_test.go | 2327 ----------------- .../databox/armdatabox/management_client.go | 20 +- .../management_client_example_test.go | 41 - .../databox/armdatabox/models.go | 379 +-- .../databox/armdatabox/models_serde.go | 54 +- .../databox/armdatabox/operations_client.go | 7 +- .../operations_client_example_test.go | 250 -- .../databox/armdatabox/options.go | 111 + .../databox/armdatabox/polymorphic_helpers.go | 43 +- .../databox/armdatabox/response_types.go | 17 +- .../databox/armdatabox/service_client.go | 112 +- .../armdatabox/service_client_example_test.go | 769 ------ .../databox/armdatabox/time_rfc3339.go | 3 +- 21 files changed, 789 insertions(+), 3956 deletions(-) create mode 100644 sdk/resourcemanager/databox/armdatabox/interfaces.go delete mode 100644 sdk/resourcemanager/databox/armdatabox/jobs_client_example_test.go delete mode 100644 sdk/resourcemanager/databox/armdatabox/management_client_example_test.go delete mode 100644 sdk/resourcemanager/databox/armdatabox/operations_client_example_test.go create mode 100644 sdk/resourcemanager/databox/armdatabox/options.go delete mode 100644 sdk/resourcemanager/databox/armdatabox/service_client_example_test.go diff --git a/sdk/resourcemanager/databox/armdatabox/CHANGELOG.md b/sdk/resourcemanager/databox/armdatabox/CHANGELOG.md index 75268c878d94..bb0989f43d80 100644 --- a/sdk/resourcemanager/databox/armdatabox/CHANGELOG.md +++ b/sdk/resourcemanager/databox/armdatabox/CHANGELOG.md @@ -1,5 +1,15 @@ # Release History +## 2.1.0 (2023-07-25) +### Features Added + +- New enum type `DelayNotificationStatus` with values `DelayNotificationStatusActive`, `DelayNotificationStatusResolved` +- New enum type `PortalDelayErrorCode` with values `PortalDelayErrorCodeActiveOrderLimitBreachedDelay`, `PortalDelayErrorCodeInternalIssueDelay` +- New struct `JobDelayDetails` +- New field `DelayedStage` in struct `JobProperties` +- New field `DelayInformation` in struct `JobStages` + + ## 2.0.0 (2023-05-26) ### Breaking Changes diff --git a/sdk/resourcemanager/databox/armdatabox/autorest.md b/sdk/resourcemanager/databox/armdatabox/autorest.md index bb7028c01367..6a9ff2f3aa3e 100644 --- a/sdk/resourcemanager/databox/armdatabox/autorest.md +++ b/sdk/resourcemanager/databox/armdatabox/autorest.md @@ -5,9 +5,8 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/databox/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/databox/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/databox/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/databox/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 2.0.0 -tag: package-2022-12 +module-version: 2.1.0 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/databox/armdatabox/client_factory.go b/sdk/resourcemanager/databox/armdatabox/client_factory.go index 7f87c055794e..70fad1eaf9f3 100644 --- a/sdk/resourcemanager/databox/armdatabox/client_factory.go +++ b/sdk/resourcemanager/databox/armdatabox/client_factory.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armdatabox @@ -38,11 +37,6 @@ func NewClientFactory(subscriptionID string, credential azcore.TokenCredential, }, nil } -func (c *ClientFactory) NewOperationsClient() *OperationsClient { - subClient, _ := NewOperationsClient(c.credential, c.options) - return subClient -} - func (c *ClientFactory) NewJobsClient() *JobsClient { subClient, _ := NewJobsClient(c.subscriptionID, c.credential, c.options) return subClient @@ -53,6 +47,11 @@ func (c *ClientFactory) NewManagementClient() *ManagementClient { return subClient } +func (c *ClientFactory) NewOperationsClient() *OperationsClient { + subClient, _ := NewOperationsClient(c.credential, c.options) + return subClient +} + func (c *ClientFactory) NewServiceClient() *ServiceClient { subClient, _ := NewServiceClient(c.subscriptionID, c.credential, c.options) return subClient diff --git a/sdk/resourcemanager/databox/armdatabox/constants.go b/sdk/resourcemanager/databox/armdatabox/constants.go index 7d18da0505b4..864cabcab0d2 100644 --- a/sdk/resourcemanager/databox/armdatabox/constants.go +++ b/sdk/resourcemanager/databox/armdatabox/constants.go @@ -3,31 +3,30 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armdatabox const ( moduleName = "armdatabox" - moduleVersion = "v2.0.0" + moduleVersion = "v2.1.0" ) type AccessProtocol string const ( - // AccessProtocolSMB - Server Message Block protocol(SMB). - AccessProtocolSMB AccessProtocol = "SMB" // AccessProtocolNFS - Network File System protocol(NFS). AccessProtocolNFS AccessProtocol = "NFS" + // AccessProtocolSMB - Server Message Block protocol(SMB). + AccessProtocolSMB AccessProtocol = "SMB" ) // PossibleAccessProtocolValues returns the possible values for the AccessProtocol const type. func PossibleAccessProtocolValues() []AccessProtocol { return []AccessProtocol{ - AccessProtocolSMB, AccessProtocolNFS, + AccessProtocolSMB, } } @@ -35,20 +34,20 @@ func PossibleAccessProtocolValues() []AccessProtocol { type AddressType string const ( + // AddressTypeCommercial - Commercial Address. + AddressTypeCommercial AddressType = "Commercial" // AddressTypeNone - Address type not known. AddressTypeNone AddressType = "None" // AddressTypeResidential - Residential Address. AddressTypeResidential AddressType = "Residential" - // AddressTypeCommercial - Commercial Address. - AddressTypeCommercial AddressType = "Commercial" ) // PossibleAddressTypeValues returns the possible values for the AddressType const type. func PossibleAddressTypeValues() []AddressType { return []AddressType{ + AddressTypeCommercial, AddressTypeNone, AddressTypeResidential, - AddressTypeCommercial, } } @@ -56,20 +55,20 @@ func PossibleAddressTypeValues() []AddressType { type AddressValidationStatus string const ( - // AddressValidationStatusValid - Address provided is valid. - AddressValidationStatusValid AddressValidationStatus = "Valid" - // AddressValidationStatusInvalid - Address provided is invalid or not supported. - AddressValidationStatusInvalid AddressValidationStatus = "Invalid" // AddressValidationStatusAmbiguous - Address provided is ambiguous, please choose one of the alternate addresses returned. AddressValidationStatusAmbiguous AddressValidationStatus = "Ambiguous" + // AddressValidationStatusInvalid - Address provided is invalid or not supported. + AddressValidationStatusInvalid AddressValidationStatus = "Invalid" + // AddressValidationStatusValid - Address provided is valid. + AddressValidationStatusValid AddressValidationStatus = "Valid" ) // PossibleAddressValidationStatusValues returns the possible values for the AddressValidationStatus const type. func PossibleAddressValidationStatusValues() []AddressValidationStatus { return []AddressValidationStatus{ - AddressValidationStatusValid, - AddressValidationStatusInvalid, AddressValidationStatusAmbiguous, + AddressValidationStatusInvalid, + AddressValidationStatusValid, } } @@ -79,21 +78,21 @@ type ClassDiscriminator string const ( // ClassDiscriminatorDataBox - Data Box orders. ClassDiscriminatorDataBox ClassDiscriminator = "DataBox" + // ClassDiscriminatorDataBoxCustomerDisk - Data Box Customer Disk orders. + ClassDiscriminatorDataBoxCustomerDisk ClassDiscriminator = "DataBoxCustomerDisk" // ClassDiscriminatorDataBoxDisk - Data Box Disk orders. ClassDiscriminatorDataBoxDisk ClassDiscriminator = "DataBoxDisk" // ClassDiscriminatorDataBoxHeavy - Data Box Heavy orders. ClassDiscriminatorDataBoxHeavy ClassDiscriminator = "DataBoxHeavy" - // ClassDiscriminatorDataBoxCustomerDisk - Data Box Customer Disk orders. - ClassDiscriminatorDataBoxCustomerDisk ClassDiscriminator = "DataBoxCustomerDisk" ) // PossibleClassDiscriminatorValues returns the possible values for the ClassDiscriminator const type. func PossibleClassDiscriminatorValues() []ClassDiscriminator { return []ClassDiscriminator{ ClassDiscriminatorDataBox, + ClassDiscriminatorDataBoxCustomerDisk, ClassDiscriminatorDataBoxDisk, ClassDiscriminatorDataBoxHeavy, - ClassDiscriminatorDataBoxCustomerDisk, } } @@ -166,26 +165,26 @@ func PossibleCopyStatusValues() []CopyStatus { type CustomerResolutionCode string const ( - // CustomerResolutionCodeNone - No Resolution Yet - CustomerResolutionCodeNone CustomerResolutionCode = "None" // CustomerResolutionCodeMoveToCleanUpDevice - Clean the device CustomerResolutionCodeMoveToCleanUpDevice CustomerResolutionCode = "MoveToCleanUpDevice" - // CustomerResolutionCodeResume - Resume the job to same stage - CustomerResolutionCodeResume CustomerResolutionCode = "Resume" - // CustomerResolutionCodeRestart - Restart whole action. - CustomerResolutionCodeRestart CustomerResolutionCode = "Restart" + // CustomerResolutionCodeNone - No Resolution Yet + CustomerResolutionCodeNone CustomerResolutionCode = "None" // CustomerResolutionCodeReachOutToOperation - Reach out to operation for further action. CustomerResolutionCodeReachOutToOperation CustomerResolutionCode = "ReachOutToOperation" + // CustomerResolutionCodeRestart - Restart whole action. + CustomerResolutionCodeRestart CustomerResolutionCode = "Restart" + // CustomerResolutionCodeResume - Resume the job to same stage + CustomerResolutionCodeResume CustomerResolutionCode = "Resume" ) // PossibleCustomerResolutionCodeValues returns the possible values for the CustomerResolutionCode const type. func PossibleCustomerResolutionCodeValues() []CustomerResolutionCode { return []CustomerResolutionCode{ - CustomerResolutionCodeNone, CustomerResolutionCodeMoveToCleanUpDevice, - CustomerResolutionCodeResume, - CustomerResolutionCodeRestart, + CustomerResolutionCodeNone, CustomerResolutionCodeReachOutToOperation, + CustomerResolutionCodeRestart, + CustomerResolutionCodeResume, } } @@ -193,17 +192,17 @@ func PossibleCustomerResolutionCodeValues() []CustomerResolutionCode { type DataAccountType string const ( - // DataAccountTypeStorageAccount - Storage Accounts . - DataAccountTypeStorageAccount DataAccountType = "StorageAccount" // DataAccountTypeManagedDisk - Azure Managed disk storage. DataAccountTypeManagedDisk DataAccountType = "ManagedDisk" + // DataAccountTypeStorageAccount - Storage Accounts . + DataAccountTypeStorageAccount DataAccountType = "StorageAccount" ) // PossibleDataAccountTypeValues returns the possible values for the DataAccountType const type. func PossibleDataAccountTypeValues() []DataAccountType { return []DataAccountType{ - DataAccountTypeStorageAccount, DataAccountTypeManagedDisk, + DataAccountTypeStorageAccount, } } @@ -341,17 +340,35 @@ func PossibleDataCenterCodeValues() []DataCenterCode { type DatacenterAddressType string const ( - // DatacenterAddressTypeDatacenterAddressLocation - Data center address location. - DatacenterAddressTypeDatacenterAddressLocation DatacenterAddressType = "DatacenterAddressLocation" // DatacenterAddressTypeDatacenterAddressInstruction - Data center address instruction. DatacenterAddressTypeDatacenterAddressInstruction DatacenterAddressType = "DatacenterAddressInstruction" + // DatacenterAddressTypeDatacenterAddressLocation - Data center address location. + DatacenterAddressTypeDatacenterAddressLocation DatacenterAddressType = "DatacenterAddressLocation" ) // PossibleDatacenterAddressTypeValues returns the possible values for the DatacenterAddressType const type. func PossibleDatacenterAddressTypeValues() []DatacenterAddressType { return []DatacenterAddressType{ - DatacenterAddressTypeDatacenterAddressLocation, DatacenterAddressTypeDatacenterAddressInstruction, + DatacenterAddressTypeDatacenterAddressLocation, + } +} + +// DelayNotificationStatus - Status of notification +type DelayNotificationStatus string + +const ( + // DelayNotificationStatusActive - Delay is still active + DelayNotificationStatusActive DelayNotificationStatus = "Active" + // DelayNotificationStatusResolved - Delay has been resolved + DelayNotificationStatusResolved DelayNotificationStatus = "Resolved" +) + +// PossibleDelayNotificationStatusValues returns the possible values for the DelayNotificationStatus const type. +func PossibleDelayNotificationStatusValues() []DelayNotificationStatus { + return []DelayNotificationStatus{ + DelayNotificationStatusActive, + DelayNotificationStatusResolved, } } @@ -359,17 +376,17 @@ func PossibleDatacenterAddressTypeValues() []DatacenterAddressType { type DoubleEncryption string const ( - // DoubleEncryptionEnabled - Software-based encryption is enabled. - DoubleEncryptionEnabled DoubleEncryption = "Enabled" // DoubleEncryptionDisabled - Software-based encryption is disabled. DoubleEncryptionDisabled DoubleEncryption = "Disabled" + // DoubleEncryptionEnabled - Software-based encryption is enabled. + DoubleEncryptionEnabled DoubleEncryption = "Enabled" ) // PossibleDoubleEncryptionValues returns the possible values for the DoubleEncryption const type. func PossibleDoubleEncryptionValues() []DoubleEncryption { return []DoubleEncryption{ - DoubleEncryptionEnabled, DoubleEncryptionDisabled, + DoubleEncryptionEnabled, } } @@ -395,17 +412,17 @@ func PossibleFilterFileTypeValues() []FilterFileType { type HardwareEncryption string const ( - // HardwareEncryptionEnabled - Hardware-based encryption is enabled. - HardwareEncryptionEnabled HardwareEncryption = "Enabled" // HardwareEncryptionDisabled - Hardware-based encryption is enabled. HardwareEncryptionDisabled HardwareEncryption = "Disabled" + // HardwareEncryptionEnabled - Hardware-based encryption is enabled. + HardwareEncryptionEnabled HardwareEncryption = "Enabled" ) // PossibleHardwareEncryptionValues returns the possible values for the HardwareEncryption const type. func PossibleHardwareEncryptionValues() []HardwareEncryption { return []HardwareEncryption{ - HardwareEncryptionEnabled, HardwareEncryptionDisabled, + HardwareEncryptionEnabled, } } @@ -431,17 +448,17 @@ func PossibleJobDeliveryTypeValues() []JobDeliveryType { type KekType string const ( - // KekTypeMicrosoftManaged - Key encryption key is managed by Microsoft. - KekTypeMicrosoftManaged KekType = "MicrosoftManaged" // KekTypeCustomerManaged - Key encryption key is managed by the Customer. KekTypeCustomerManaged KekType = "CustomerManaged" + // KekTypeMicrosoftManaged - Key encryption key is managed by Microsoft. + KekTypeMicrosoftManaged KekType = "MicrosoftManaged" ) // PossibleKekTypeValues returns the possible values for the KekType const type. func PossibleKekTypeValues() []KekType { return []KekType{ - KekTypeMicrosoftManaged, KekTypeCustomerManaged, + KekTypeMicrosoftManaged, } } @@ -505,18 +522,42 @@ type OverallValidationStatus string const ( // OverallValidationStatusAllValidToProceed - Every input request is valid. OverallValidationStatusAllValidToProceed OverallValidationStatus = "AllValidToProceed" - // OverallValidationStatusInputsRevisitRequired - Some input requests are not valid. - OverallValidationStatusInputsRevisitRequired OverallValidationStatus = "InputsRevisitRequired" // OverallValidationStatusCertainInputValidationsSkipped - Certain input validations skipped. OverallValidationStatusCertainInputValidationsSkipped OverallValidationStatus = "CertainInputValidationsSkipped" + // OverallValidationStatusInputsRevisitRequired - Some input requests are not valid. + OverallValidationStatusInputsRevisitRequired OverallValidationStatus = "InputsRevisitRequired" ) // PossibleOverallValidationStatusValues returns the possible values for the OverallValidationStatus const type. func PossibleOverallValidationStatusValues() []OverallValidationStatus { return []OverallValidationStatus{ OverallValidationStatusAllValidToProceed, - OverallValidationStatusInputsRevisitRequired, OverallValidationStatusCertainInputValidationsSkipped, + OverallValidationStatusInputsRevisitRequired, + } +} + +// PortalDelayErrorCode - Delay Error code +type PortalDelayErrorCode string + +const ( + // PortalDelayErrorCodeActiveOrderLimitBreachedDelay - Active Order limit breached. + PortalDelayErrorCodeActiveOrderLimitBreachedDelay PortalDelayErrorCode = "ActiveOrderLimitBreachedDelay" + // PortalDelayErrorCodeActiveOrderLimitBreachedDelay - High demand + PortalDelayErrorCodeActiveOrderLimitBreachedDelay PortalDelayErrorCode = "ActiveOrderLimitBreachedDelay" + // PortalDelayErrorCodeActiveOrderLimitBreachedDelay - Slow copy due to large number of files + PortalDelayErrorCodeActiveOrderLimitBreachedDelay PortalDelayErrorCode = "ActiveOrderLimitBreachedDelay" + // PortalDelayErrorCodeInternalIssueDelay - Delay due to any internal reasons + PortalDelayErrorCodeInternalIssueDelay PortalDelayErrorCode = "InternalIssueDelay" +) + +// PossiblePortalDelayErrorCodeValues returns the possible values for the PortalDelayErrorCode const type. +func PossiblePortalDelayErrorCodeValues() []PortalDelayErrorCode { + return []PortalDelayErrorCode{ + PortalDelayErrorCodeActiveOrderLimitBreachedDelay, + PortalDelayErrorCodeActiveOrderLimitBreachedDelay, + PortalDelayErrorCodeActiveOrderLimitBreachedDelay, + PortalDelayErrorCodeInternalIssueDelay, } } @@ -524,10 +565,10 @@ func PossibleOverallValidationStatusValues() []OverallValidationStatus { type ReverseShippingDetailsEditStatus string const ( - // ReverseShippingDetailsEditStatusEnabled - Reverse shipping details can be edited. - ReverseShippingDetailsEditStatusEnabled ReverseShippingDetailsEditStatus = "Enabled" // ReverseShippingDetailsEditStatusDisabled - Edit is disabled for Reverse shipping details. ReverseShippingDetailsEditStatusDisabled ReverseShippingDetailsEditStatus = "Disabled" + // ReverseShippingDetailsEditStatusEnabled - Reverse shipping details can be edited. + ReverseShippingDetailsEditStatusEnabled ReverseShippingDetailsEditStatus = "Enabled" // ReverseShippingDetailsEditStatusNotSupported - Edit is not supported for Reverse shipping details. Either subscription // feature is not available or SKU doesn't support this feature. ReverseShippingDetailsEditStatusNotSupported ReverseShippingDetailsEditStatus = "NotSupported" @@ -536,8 +577,8 @@ const ( // PossibleReverseShippingDetailsEditStatusValues returns the possible values for the ReverseShippingDetailsEditStatus const type. func PossibleReverseShippingDetailsEditStatusValues() []ReverseShippingDetailsEditStatus { return []ReverseShippingDetailsEditStatus{ - ReverseShippingDetailsEditStatusEnabled, ReverseShippingDetailsEditStatusDisabled, + ReverseShippingDetailsEditStatusEnabled, ReverseShippingDetailsEditStatusNotSupported, } } @@ -546,10 +587,10 @@ func PossibleReverseShippingDetailsEditStatusValues() []ReverseShippingDetailsEd type ReverseTransportPreferenceEditStatus string const ( - // ReverseTransportPreferenceEditStatusEnabled - Reverse Transport Preferences can be edited. - ReverseTransportPreferenceEditStatusEnabled ReverseTransportPreferenceEditStatus = "Enabled" // ReverseTransportPreferenceEditStatusDisabled - Edit is disabled for Reverse Transport Preferences. ReverseTransportPreferenceEditStatusDisabled ReverseTransportPreferenceEditStatus = "Disabled" + // ReverseTransportPreferenceEditStatusEnabled - Reverse Transport Preferences can be edited. + ReverseTransportPreferenceEditStatusEnabled ReverseTransportPreferenceEditStatus = "Enabled" // ReverseTransportPreferenceEditStatusNotSupported - Edit is not supported for Reverse Transport Preferences. Either subscription // feature is not available or SKU doesn't support this feature. ReverseTransportPreferenceEditStatusNotSupported ReverseTransportPreferenceEditStatus = "NotSupported" @@ -558,8 +599,8 @@ const ( // PossibleReverseTransportPreferenceEditStatusValues returns the possible values for the ReverseTransportPreferenceEditStatus const type. func PossibleReverseTransportPreferenceEditStatusValues() []ReverseTransportPreferenceEditStatus { return []ReverseTransportPreferenceEditStatus{ - ReverseTransportPreferenceEditStatusEnabled, ReverseTransportPreferenceEditStatusDisabled, + ReverseTransportPreferenceEditStatusEnabled, ReverseTransportPreferenceEditStatusNotSupported, } } @@ -568,30 +609,30 @@ func PossibleReverseTransportPreferenceEditStatusValues() []ReverseTransportPref type SKUDisabledReason string const ( - // SKUDisabledReasonNone - SKU is not disabled. - SKUDisabledReasonNone SKUDisabledReason = "None" // SKUDisabledReasonCountry - SKU is not available in the requested country. SKUDisabledReasonCountry SKUDisabledReason = "Country" - // SKUDisabledReasonRegion - SKU is not available to push data to the requested Azure region. - SKUDisabledReasonRegion SKUDisabledReason = "Region" // SKUDisabledReasonFeature - Required features are not enabled for the SKU. 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 SKUDisabledReason = "NoSubscriptionInfo" + // SKUDisabledReasonNone - SKU is not disabled. + SKUDisabledReasonNone SKUDisabledReason = "None" + // SKUDisabledReasonOfferType - Subscription does not have required offer types for the SKU. + SKUDisabledReasonOfferType SKUDisabledReason = "OfferType" + // SKUDisabledReasonRegion - SKU is not available to push data to the requested Azure region. + SKUDisabledReasonRegion SKUDisabledReason = "Region" ) // PossibleSKUDisabledReasonValues returns the possible values for the SKUDisabledReason const type. func PossibleSKUDisabledReasonValues() []SKUDisabledReason { return []SKUDisabledReason{ - SKUDisabledReasonNone, SKUDisabledReasonCountry, - SKUDisabledReasonRegion, SKUDisabledReasonFeature, - SKUDisabledReasonOfferType, SKUDisabledReasonNoSubscriptionInfo, + SKUDisabledReasonNone, + SKUDisabledReasonOfferType, + SKUDisabledReasonRegion, } } @@ -600,21 +641,21 @@ type SKUName string const ( // SKUNameDataBox - Data Box. SKUNameDataBox SKUName = "DataBox" + // SKUNameDataBoxCustomerDisk - Data Box Customer Disk + SKUNameDataBoxCustomerDisk SKUName = "DataBoxCustomerDisk" // SKUNameDataBoxDisk - Data Box Disk. SKUNameDataBoxDisk SKUName = "DataBoxDisk" // SKUNameDataBoxHeavy - Data Box Heavy. SKUNameDataBoxHeavy SKUName = "DataBoxHeavy" - // SKUNameDataBoxCustomerDisk - Data Box Customer Disk - SKUNameDataBoxCustomerDisk SKUName = "DataBoxCustomerDisk" ) // PossibleSKUNameValues returns the possible values for the SKUName const type. func PossibleSKUNameValues() []SKUName { return []SKUName{ SKUNameDataBox, + SKUNameDataBoxCustomerDisk, SKUNameDataBoxDisk, SKUNameDataBoxHeavy, - SKUNameDataBoxCustomerDisk, } } @@ -622,29 +663,29 @@ func PossibleSKUNameValues() []SKUName { type ShareDestinationFormatType string const ( - // ShareDestinationFormatTypeUnknownType - Unknown format. - ShareDestinationFormatTypeUnknownType ShareDestinationFormatType = "UnknownType" - // ShareDestinationFormatTypeHCS - Storsimple data format. - ShareDestinationFormatTypeHCS ShareDestinationFormatType = "HCS" - // ShareDestinationFormatTypeBlockBlob - Azure storage block blob format. - ShareDestinationFormatTypeBlockBlob ShareDestinationFormatType = "BlockBlob" - // ShareDestinationFormatTypePageBlob - Azure storage page blob format. - ShareDestinationFormatTypePageBlob ShareDestinationFormatType = "PageBlob" // ShareDestinationFormatTypeAzureFile - Azure storage file format. ShareDestinationFormatTypeAzureFile ShareDestinationFormatType = "AzureFile" + // ShareDestinationFormatTypeBlockBlob - Azure storage block blob format. + ShareDestinationFormatTypeBlockBlob ShareDestinationFormatType = "BlockBlob" + // ShareDestinationFormatTypeHCS - Storsimple data format. + ShareDestinationFormatTypeHCS ShareDestinationFormatType = "HCS" // ShareDestinationFormatTypeManagedDisk - Azure Compute Disk. ShareDestinationFormatTypeManagedDisk ShareDestinationFormatType = "ManagedDisk" + // ShareDestinationFormatTypePageBlob - Azure storage page blob format. + ShareDestinationFormatTypePageBlob ShareDestinationFormatType = "PageBlob" + // ShareDestinationFormatTypeUnknownType - Unknown format. + ShareDestinationFormatTypeUnknownType ShareDestinationFormatType = "UnknownType" ) // PossibleShareDestinationFormatTypeValues returns the possible values for the ShareDestinationFormatType const type. func PossibleShareDestinationFormatTypeValues() []ShareDestinationFormatType { return []ShareDestinationFormatType{ - ShareDestinationFormatTypeUnknownType, - ShareDestinationFormatTypeHCS, - ShareDestinationFormatTypeBlockBlob, - ShareDestinationFormatTypePageBlob, ShareDestinationFormatTypeAzureFile, + ShareDestinationFormatTypeBlockBlob, + ShareDestinationFormatTypeHCS, ShareDestinationFormatTypeManagedDisk, + ShareDestinationFormatTypePageBlob, + ShareDestinationFormatTypeUnknownType, } } @@ -727,50 +768,50 @@ func PossibleStageNameValues() []StageName { type StageStatus string const ( - // StageStatusNone - No status available yet. - StageStatusNone StageStatus = "None" - // StageStatusInProgress - Stage is in progress. - StageStatusInProgress StageStatus = "InProgress" - // StageStatusSucceeded - Stage has succeeded. - StageStatusSucceeded StageStatus = "Succeeded" - // StageStatusFailed - Stage has failed. - StageStatusFailed StageStatus = "Failed" // StageStatusCancelled - Stage has been cancelled. StageStatusCancelled StageStatus = "Cancelled" // StageStatusCancelling - Stage is cancelling. StageStatusCancelling StageStatus = "Cancelling" + // StageStatusCustomerActionPerformed - Stage has performed customer action for clean up. + StageStatusCustomerActionPerformed StageStatus = "CustomerActionPerformed" + // StageStatusCustomerActionPerformedForCleanUp - Stage has performed customer action for clean up. + StageStatusCustomerActionPerformedForCleanUp StageStatus = "CustomerActionPerformedForCleanUp" + // StageStatusFailed - Stage has failed. + StageStatusFailed StageStatus = "Failed" + // StageStatusInProgress - Stage is in progress. + StageStatusInProgress StageStatus = "InProgress" + // StageStatusNone - No status available yet. + StageStatusNone StageStatus = "None" + // StageStatusSucceeded - Stage has succeeded. + StageStatusSucceeded StageStatus = "Succeeded" // StageStatusSucceededWithErrors - Stage has succeeded with errors. StageStatusSucceededWithErrors StageStatus = "SucceededWithErrors" - // StageStatusWaitingForCustomerAction - Stage is stuck until customer takes some action. - StageStatusWaitingForCustomerAction StageStatus = "WaitingForCustomerAction" // StageStatusSucceededWithWarnings - Stage has succeeded with warnings. StageStatusSucceededWithWarnings StageStatus = "SucceededWithWarnings" - // StageStatusWaitingForCustomerActionForKek - Stage is waiting for customer action for kek action items. - StageStatusWaitingForCustomerActionForKek StageStatus = "WaitingForCustomerActionForKek" + // StageStatusWaitingForCustomerAction - Stage is stuck until customer takes some action. + StageStatusWaitingForCustomerAction StageStatus = "WaitingForCustomerAction" // StageStatusWaitingForCustomerActionForCleanUp - Stage is waiting for customer action for clean up. StageStatusWaitingForCustomerActionForCleanUp StageStatus = "WaitingForCustomerActionForCleanUp" - // StageStatusCustomerActionPerformedForCleanUp - Stage has performed customer action for clean up. - StageStatusCustomerActionPerformedForCleanUp StageStatus = "CustomerActionPerformedForCleanUp" - // StageStatusCustomerActionPerformed - Stage has performed customer action for clean up. - StageStatusCustomerActionPerformed StageStatus = "CustomerActionPerformed" + // StageStatusWaitingForCustomerActionForKek - Stage is waiting for customer action for kek action items. + StageStatusWaitingForCustomerActionForKek StageStatus = "WaitingForCustomerActionForKek" ) // PossibleStageStatusValues returns the possible values for the StageStatus const type. func PossibleStageStatusValues() []StageStatus { return []StageStatus{ - StageStatusNone, - StageStatusInProgress, - StageStatusSucceeded, - StageStatusFailed, StageStatusCancelled, StageStatusCancelling, + StageStatusCustomerActionPerformed, + StageStatusCustomerActionPerformedForCleanUp, + StageStatusFailed, + StageStatusInProgress, + StageStatusNone, + StageStatusSucceeded, StageStatusSucceededWithErrors, - StageStatusWaitingForCustomerAction, StageStatusSucceededWithWarnings, - StageStatusWaitingForCustomerActionForKek, + StageStatusWaitingForCustomerAction, StageStatusWaitingForCustomerActionForCleanUp, - StageStatusCustomerActionPerformedForCleanUp, - StageStatusCustomerActionPerformed, + StageStatusWaitingForCustomerActionForKek, } } @@ -796,17 +837,17 @@ func PossibleTransferConfigurationTypeValues() []TransferConfigurationType { type TransferType string const ( - // TransferTypeImportToAzure - Import data to azure. - TransferTypeImportToAzure TransferType = "ImportToAzure" // TransferTypeExportFromAzure - Export data from azure. TransferTypeExportFromAzure TransferType = "ExportFromAzure" + // TransferTypeImportToAzure - Import data to azure. + TransferTypeImportToAzure TransferType = "ImportToAzure" ) // PossibleTransferTypeValues returns the possible values for the TransferType const type. func PossibleTransferTypeValues() []TransferType { return []TransferType{ - TransferTypeImportToAzure, TransferTypeExportFromAzure, + TransferTypeImportToAzure, } } @@ -834,29 +875,29 @@ 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 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 ValidationInputDiscriminator = "ValidateCreateOrderLimit" - // ValidationInputDiscriminatorValidateSKUAvailability - Identify request and response of active job limit for sku availability. - ValidationInputDiscriminatorValidateSKUAvailability ValidationInputDiscriminator = "ValidateSkuAvailability" // ValidationInputDiscriminatorValidateDataTransferDetails - Identify request and response of data transfer details validation. ValidationInputDiscriminatorValidateDataTransferDetails ValidationInputDiscriminator = "ValidateDataTransferDetails" + // ValidationInputDiscriminatorValidatePreferences - Identify request and response of preference validation. + ValidationInputDiscriminatorValidatePreferences ValidationInputDiscriminator = "ValidatePreferences" + // ValidationInputDiscriminatorValidateSKUAvailability - Identify request and response of active job limit for sku availability. + ValidationInputDiscriminatorValidateSKUAvailability ValidationInputDiscriminator = "ValidateSkuAvailability" + // ValidationInputDiscriminatorValidateSubscriptionIsAllowedToCreateJob - Identify request and response for validation of + // subscription permission to create job. + ValidationInputDiscriminatorValidateSubscriptionIsAllowedToCreateJob ValidationInputDiscriminator = "ValidateSubscriptionIsAllowedToCreateJob" ) // PossibleValidationInputDiscriminatorValues returns the possible values for the ValidationInputDiscriminator const type. func PossibleValidationInputDiscriminatorValues() []ValidationInputDiscriminator { return []ValidationInputDiscriminator{ ValidationInputDiscriminatorValidateAddress, - ValidationInputDiscriminatorValidateSubscriptionIsAllowedToCreateJob, - ValidationInputDiscriminatorValidatePreferences, ValidationInputDiscriminatorValidateCreateOrderLimit, - ValidationInputDiscriminatorValidateSKUAvailability, ValidationInputDiscriminatorValidateDataTransferDetails, + ValidationInputDiscriminatorValidatePreferences, + ValidationInputDiscriminatorValidateSKUAvailability, + ValidationInputDiscriminatorValidateSubscriptionIsAllowedToCreateJob, } } @@ -864,19 +905,19 @@ func PossibleValidationInputDiscriminatorValues() []ValidationInputDiscriminator type ValidationStatus string const ( - // ValidationStatusValid - Validation is successful - ValidationStatusValid ValidationStatus = "Valid" // ValidationStatusInvalid - Validation is not successful ValidationStatusInvalid ValidationStatus = "Invalid" // ValidationStatusSkipped - Validation is skipped ValidationStatusSkipped ValidationStatus = "Skipped" + // ValidationStatusValid - Validation is successful + ValidationStatusValid ValidationStatus = "Valid" ) // PossibleValidationStatusValues returns the possible values for the ValidationStatus const type. func PossibleValidationStatusValues() []ValidationStatus { return []ValidationStatus{ - ValidationStatusValid, ValidationStatusInvalid, ValidationStatusSkipped, + ValidationStatusValid, } } diff --git a/sdk/resourcemanager/databox/armdatabox/go.mod b/sdk/resourcemanager/databox/armdatabox/go.mod index 98c3fd836f8a..3a774427003e 100644 --- a/sdk/resourcemanager/databox/armdatabox/go.mod +++ b/sdk/resourcemanager/databox/armdatabox/go.mod @@ -2,20 +2,12 @@ module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/databox/armdatabox/ go 1.18 -require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.2 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.6.1 require ( - github.com/Azure/azure-sdk-for-go/sdk/internal v1.2.0 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v0.9.0 // indirect - github.com/golang-jwt/jwt/v4 v4.5.0 // indirect - github.com/google/uuid v1.3.0 // indirect - github.com/kylelemons/godebug v1.1.0 // indirect - github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 // indirect - golang.org/x/crypto v0.6.0 // indirect - golang.org/x/net v0.7.0 // indirect - golang.org/x/sys v0.5.0 // indirect - golang.org/x/text v0.7.0 // indirect + github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect + golang.org/x/net v0.8.0 // indirect + golang.org/x/text v0.8.0 // indirect + gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect ) diff --git a/sdk/resourcemanager/databox/armdatabox/go.sum b/sdk/resourcemanager/databox/armdatabox/go.sum index 8ba445a8c4da..5c6bee428364 100644 --- a/sdk/resourcemanager/databox/armdatabox/go.sum +++ b/sdk/resourcemanager/databox/armdatabox/go.sum @@ -1,31 +1,15 @@ -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0 h1:rTnT/Jrcm+figWlYz4Ixzt0SJVR2cMC8lvZcimipiEY= -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0/go.mod h1:ON4tFdPTwRcgWEaVDrN3584Ef+b7GgSJaXxe5fW9t4M= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.2 h1:uqM+VoHjVH6zdlkLF2b6O0ZANcHoj3rO0PoQ3jglUJA= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.2/go.mod h1:twTKAa1E6hLmSDjLhaCkbTMQKc7p/rNLU40rLxGEOCI= -github.com/Azure/azure-sdk-for-go/sdk/internal v1.2.0 h1:leh5DwKv6Ihwi+h60uHtn6UWAxBbZ0q8DwQVMzf61zw= -github.com/Azure/azure-sdk-for-go/sdk/internal v1.2.0/go.mod h1:eWRD7oawr1Mu1sLCawqVc0CUiF43ia3qQMxLscsKQ9w= -github.com/AzureAD/microsoft-authentication-library-for-go v0.9.0 h1:UE9n9rkJF62ArLb1F3DEjRt8O3jLwMWdSoypKV4f3MU= -github.com/AzureAD/microsoft-authentication-library-for-go v0.9.0/go.mod h1:kgDmCTgBzIEPFElEF+FK0SdjAor06dRq2Go927dnQ6o= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.6.1 h1:SEy2xmstIphdPwNBUi7uhvjyjhVKISfwjfOJmuy7kg4= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.6.1/go.mod h1:bjGvMhVMb+EEm3VRNQawDMUyMMjo+S5ewNjflkep/0Q= +github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0 h1:sXr+ck84g/ZlZUOZiNELInmMgOsuGwdjjVkEIde0OtY= +github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0/go.mod h1:okt5dMMTOFjX/aovMlrjvvXoPMBVSPzk9185BT0+eZM= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/dnaeon/go-vcr v1.1.0 h1:ReYa/UBrRyQdant9B4fNHGoCNKw6qh6P0fsdGmZpR7c= -github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg= -github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= -github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= -github.com/google/uuid v1.3.0/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/pkg/browser v0.0.0-20210911075715-681adbf594b8 h1:KoWmjvw+nsYOo29YJK9vDA65RGE3NrOnUtO7a+RF9HU= -github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8/go.mod h1:HKlIX3XHQyzLZPlr7++PzdhaXEj94dEiJgZDTsxEqUI= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= -golang.org/x/crypto v0.6.0 h1:qfktjS5LUO+fFKeJXZ+ikTRijMmljikvG68fpMMruSc= -golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= -golang.org/x/net v0.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g= -golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/sys v0.0.0-20210616045830-e2b7044e8c71/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU= -golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/text v0.7.0 h1:4BRB4x83lYWy72KwLD/qYDuTu7q9PjSagHvijDw7cLo= -golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +golang.org/x/net v0.8.0 h1:Zrh2ngAOFYneWTAIAPethzeaQLuHwhuBkuV6ZiRnUaQ= +golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= +golang.org/x/text v0.8.0 h1:57P1ETyNKtuIjB4SRd15iJxuhj8Gc416Y78H3qgMh68= +golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/sdk/resourcemanager/databox/armdatabox/interfaces.go b/sdk/resourcemanager/databox/armdatabox/interfaces.go new file mode 100644 index 000000000000..c85fbd0518e9 --- /dev/null +++ b/sdk/resourcemanager/databox/armdatabox/interfaces.go @@ -0,0 +1,102 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armdatabox + +// CommonJobDetailsClassification provides polymorphic access to related types. +// Call the interface's GetCommonJobDetails() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *CommonJobDetails, *CustomerDiskJobDetails, *DiskJobDetails, *HeavyJobDetails, *JobDetails +type CommonJobDetailsClassification interface { + // GetCommonJobDetails returns the CommonJobDetails content of the underlying type. + GetCommonJobDetails() *CommonJobDetails +} + +// CommonJobSecretsClassification provides polymorphic access to related types. +// Call the interface's GetCommonJobSecrets() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *CommonJobSecrets, *CustomerDiskJobSecrets, *DiskJobSecrets, *HeavyJobSecrets, *JobSecrets +type CommonJobSecretsClassification interface { + // GetCommonJobSecrets returns the CommonJobSecrets content of the underlying type. + GetCommonJobSecrets() *CommonJobSecrets +} + +// CommonScheduleAvailabilityRequestClassification provides polymorphic access to related types. +// Call the interface's GetCommonScheduleAvailabilityRequest() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *CommonScheduleAvailabilityRequest, *DiskScheduleAvailabilityRequest, *HeavyScheduleAvailabilityRequest, *ScheduleAvailabilityRequest +type CommonScheduleAvailabilityRequestClassification interface { + // GetCommonScheduleAvailabilityRequest returns the CommonScheduleAvailabilityRequest content of the underlying type. + GetCommonScheduleAvailabilityRequest() *CommonScheduleAvailabilityRequest +} + +// CopyLogDetailsClassification provides polymorphic access to related types. +// Call the interface's GetCopyLogDetails() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *AccountCopyLogDetails, *CopyLogDetails, *CustomerDiskCopyLogDetails, *DiskCopyLogDetails, *HeavyAccountCopyLogDetails +type CopyLogDetailsClassification interface { + // GetCopyLogDetails returns the CopyLogDetails content of the underlying type. + GetCopyLogDetails() *CopyLogDetails +} + +// DataAccountDetailsClassification provides polymorphic access to related types. +// Call the interface's GetDataAccountDetails() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *DataAccountDetails, *ManagedDiskDetails, *StorageAccountDetails +type DataAccountDetailsClassification interface { + // GetDataAccountDetails returns the DataAccountDetails content of the underlying type. + GetDataAccountDetails() *DataAccountDetails +} + +// DatacenterAddressResponseClassification provides polymorphic access to related types. +// Call the interface's GetDatacenterAddressResponse() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *DatacenterAddressInstructionResponse, *DatacenterAddressLocationResponse, *DatacenterAddressResponse +type DatacenterAddressResponseClassification interface { + // GetDatacenterAddressResponse returns the DatacenterAddressResponse content of the underlying type. + GetDatacenterAddressResponse() *DatacenterAddressResponse +} + +// GranularCopyLogDetailsClassification provides polymorphic access to related types. +// Call the interface's GetGranularCopyLogDetails() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *DiskGranularCopyLogDetails, *GranularCopyLogDetails +type GranularCopyLogDetailsClassification interface { + // GetGranularCopyLogDetails returns the GranularCopyLogDetails content of the underlying type. + GetGranularCopyLogDetails() *GranularCopyLogDetails +} + +// ValidationInputRequestClassification provides polymorphic access to related types. +// Call the interface's GetValidationInputRequest() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *CreateOrderLimitForSubscriptionValidationRequest, *DataTransferDetailsValidationRequest, *PreferencesValidationRequest, +// - *SKUAvailabilityValidationRequest, *SubscriptionIsAllowedToCreateJobValidationRequest, *ValidateAddress, *ValidationInputRequest +type ValidationInputRequestClassification interface { + // GetValidationInputRequest returns the ValidationInputRequest content of the underlying type. + GetValidationInputRequest() *ValidationInputRequest +} + +// ValidationInputResponseClassification provides polymorphic access to related types. +// Call the interface's GetValidationInputResponse() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *AddressValidationProperties, *CreateOrderLimitForSubscriptionValidationResponseProperties, *DataTransferDetailsValidationResponseProperties, +// - *PreferencesValidationResponseProperties, *SKUAvailabilityValidationResponseProperties, *SubscriptionIsAllowedToCreateJobValidationResponseProperties, +// - *ValidationInputResponse +type ValidationInputResponseClassification interface { + // GetValidationInputResponse returns the ValidationInputResponse content of the underlying type. + GetValidationInputResponse() *ValidationInputResponse +} + +// ValidationRequestClassification provides polymorphic access to related types. +// Call the interface's GetValidationRequest() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *CreateJobValidations, *ValidationRequest +type ValidationRequestClassification interface { + // GetValidationRequest returns the ValidationRequest content of the underlying type. + GetValidationRequest() *ValidationRequest +} diff --git a/sdk/resourcemanager/databox/armdatabox/jobs_client.go b/sdk/resourcemanager/databox/armdatabox/jobs_client.go index 16819c5d9dfa..4b5481531646 100644 --- a/sdk/resourcemanager/databox/armdatabox/jobs_client.go +++ b/sdk/resourcemanager/databox/armdatabox/jobs_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armdatabox @@ -47,25 +46,28 @@ func NewJobsClient(subscriptionID string, credential azcore.TokenCredential, opt // BookShipmentPickUp - Book shipment pick up. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-01 +// Generated from API version 2023-03-01 // - 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) { + var err error req, err := client.bookShipmentPickUpCreateRequest(ctx, resourceGroupName, jobName, shipmentPickUpRequest, options) if err != nil { return JobsClientBookShipmentPickUpResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return JobsClientBookShipmentPickUpResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return JobsClientBookShipmentPickUpResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return JobsClientBookShipmentPickUpResponse{}, err } - return client.bookShipmentPickUpHandleResponse(resp) + resp, err := client.bookShipmentPickUpHandleResponse(httpResp) + return resp, err } // bookShipmentPickUpCreateRequest creates the BookShipmentPickUp request. @@ -88,10 +90,13 @@ func (client *JobsClient) bookShipmentPickUpCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-01") + reqQP.Set("api-version", "2023-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, shipmentPickUpRequest) + if err := runtime.MarshalAsJSON(req, shipmentPickUpRequest); err != nil { + return nil, err + } + return req, nil } // bookShipmentPickUpHandleResponse handles the BookShipmentPickUp response. @@ -106,23 +111,25 @@ func (client *JobsClient) bookShipmentPickUpHandleResponse(resp *http.Response) // Cancel - CancelJob. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-01 +// Generated from API version 2023-03-01 // - 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) { + var err error req, err := client.cancelCreateRequest(ctx, resourceGroupName, jobName, cancellationReason, options) if err != nil { return JobsClientCancelResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return JobsClientCancelResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusNoContent) { - return JobsClientCancelResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return JobsClientCancelResponse{}, err } return JobsClientCancelResponse{}, nil } @@ -147,17 +154,20 @@ func (client *JobsClient) cancelCreateRequest(ctx context.Context, resourceGroup return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-01") + reqQP.Set("api-version", "2023-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, cancellationReason) + if err := runtime.MarshalAsJSON(req, cancellationReason); err != nil { + return nil, err + } + return req, nil } // 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. // -// Generated from API version 2022-12-01 +// Generated from API version 2023-03-01 // - 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 @@ -169,7 +179,8 @@ func (client *JobsClient) BeginCreate(ctx context.Context, resourceGroupName str if err != nil { return nil, err } - return runtime.NewPoller[JobsClientCreateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[JobsClientCreateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[JobsClientCreateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -179,20 +190,22 @@ func (client *JobsClient) BeginCreate(ctx context.Context, resourceGroupName str // be updated with the Update job API. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-01 +// Generated from API version 2023-03-01 func (client *JobsClient) create(ctx context.Context, resourceGroupName string, jobName string, jobResource JobResource, options *JobsClientBeginCreateOptions) (*http.Response, error) { + var err error req, err := client.createCreateRequest(ctx, resourceGroupName, jobName, jobResource, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createCreateRequest creates the Create request. @@ -215,16 +228,19 @@ func (client *JobsClient) createCreateRequest(ctx context.Context, resourceGroup return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-01") + reqQP.Set("api-version", "2023-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, jobResource) + if err := runtime.MarshalAsJSON(req, jobResource); err != nil { + return nil, err + } + return req, nil } // BeginDelete - Deletes a job. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-01 +// Generated from API version 2023-03-01 // - 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 @@ -235,7 +251,8 @@ func (client *JobsClient) BeginDelete(ctx context.Context, resourceGroupName str if err != nil { return nil, err } - return runtime.NewPoller[JobsClientDeleteResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[JobsClientDeleteResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[JobsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -244,20 +261,22 @@ func (client *JobsClient) BeginDelete(ctx context.Context, resourceGroupName str // Delete - Deletes a job. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-01 +// Generated from API version 2023-03-01 func (client *JobsClient) deleteOperation(ctx context.Context, resourceGroupName string, jobName string, options *JobsClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, jobName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -280,7 +299,7 @@ func (client *JobsClient) deleteCreateRequest(ctx context.Context, resourceGroup return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-01") + reqQP.Set("api-version", "2023-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -289,24 +308,27 @@ func (client *JobsClient) deleteCreateRequest(ctx context.Context, resourceGroup // Get - Gets information about the specified job. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-01 +// Generated from API version 2023-03-01 // - 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) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, jobName, options) if err != nil { return JobsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return JobsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return JobsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return JobsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -329,7 +351,7 @@ func (client *JobsClient) getCreateRequest(ctx context.Context, resourceGroupNam return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-01") + reqQP.Set("api-version", "2023-03-01") if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } @@ -349,7 +371,7 @@ func (client *JobsClient) getHandleResponse(resp *http.Response) (JobsClientGetR // NewListPager - Lists all the jobs available under the subscription. // -// Generated from API version 2022-12-01 +// Generated from API version 2023-03-01 // - options - JobsClientListOptions contains the optional parameters for the JobsClient.NewListPager method. func (client *JobsClient) NewListPager(options *JobsClientListOptions) *runtime.Pager[JobsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[JobsClientListResponse]{ @@ -391,7 +413,7 @@ func (client *JobsClient) listCreateRequest(ctx context.Context, options *JobsCl return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-01") + reqQP.Set("api-version", "2023-03-01") if options != nil && options.SkipToken != nil { reqQP.Set("$skipToken", *options.SkipToken) } @@ -411,7 +433,7 @@ func (client *JobsClient) listHandleResponse(resp *http.Response) (JobsClientLis // NewListByResourceGroupPager - Lists all the jobs available under the given resource group. // -// Generated from API version 2022-12-01 +// Generated from API version 2023-03-01 // - resourceGroupName - The Resource Group Name // - options - JobsClientListByResourceGroupOptions contains the optional parameters for the JobsClient.NewListByResourceGroupPager // method. @@ -459,7 +481,7 @@ func (client *JobsClient) listByResourceGroupCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-01") + reqQP.Set("api-version", "2023-03-01") if options != nil && options.SkipToken != nil { reqQP.Set("$skipToken", *options.SkipToken) } @@ -479,7 +501,7 @@ func (client *JobsClient) listByResourceGroupHandleResponse(resp *http.Response) // NewListCredentialsPager - This method gets the unencrypted secrets related to the job. // -// Generated from API version 2022-12-01 +// Generated from API version 2023-03-01 // - 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 @@ -527,7 +549,7 @@ func (client *JobsClient) listCredentialsCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-01") + reqQP.Set("api-version", "2023-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -545,23 +567,25 @@ func (client *JobsClient) listCredentialsHandleResponse(resp *http.Response) (Jo // MarkDevicesShipped - Request to mark devices for a given job as shipped // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-01 +// Generated from API version 2023-03-01 // - 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) { + var err error req, err := client.markDevicesShippedCreateRequest(ctx, jobName, resourceGroupName, markDevicesShippedRequest, options) if err != nil { return JobsClientMarkDevicesShippedResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return JobsClientMarkDevicesShippedResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusNoContent) { - return JobsClientMarkDevicesShippedResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return JobsClientMarkDevicesShippedResponse{}, err } return JobsClientMarkDevicesShippedResponse{}, nil } @@ -586,16 +610,19 @@ func (client *JobsClient) markDevicesShippedCreateRequest(ctx context.Context, j return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-01") + reqQP.Set("api-version", "2023-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, markDevicesShippedRequest) + if err := runtime.MarshalAsJSON(req, markDevicesShippedRequest); err != nil { + return nil, err + } + return req, nil } // BeginUpdate - Updates the properties of an existing job. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-01 +// Generated from API version 2023-03-01 // - 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 @@ -607,7 +634,8 @@ func (client *JobsClient) BeginUpdate(ctx context.Context, resourceGroupName str if err != nil { return nil, err } - return runtime.NewPoller[JobsClientUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[JobsClientUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[JobsClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -616,20 +644,22 @@ func (client *JobsClient) BeginUpdate(ctx context.Context, resourceGroupName str // Update - Updates the properties of an existing job. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-01 +// Generated from API version 2023-03-01 func (client *JobsClient) update(ctx context.Context, resourceGroupName string, jobName string, jobResourceUpdateParameter JobResourceUpdateParameter, options *JobsClientBeginUpdateOptions) (*http.Response, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, jobName, jobResourceUpdateParameter, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updateCreateRequest creates the Update request. @@ -652,11 +682,14 @@ func (client *JobsClient) updateCreateRequest(ctx context.Context, resourceGroup return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-01") + reqQP.Set("api-version", "2023-03-01") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} } req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, jobResourceUpdateParameter) + if err := runtime.MarshalAsJSON(req, jobResourceUpdateParameter); err != nil { + return nil, err + } + return req, nil } diff --git a/sdk/resourcemanager/databox/armdatabox/jobs_client_example_test.go b/sdk/resourcemanager/databox/armdatabox/jobs_client_example_test.go deleted file mode 100644 index 7ce115e9d5b3..000000000000 --- a/sdk/resourcemanager/databox/armdatabox/jobs_client_example_test.go +++ /dev/null @@ -1,2327 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armdatabox_test - -import ( - "context" - "log" - - "time" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/databox/armdatabox/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/databox/resource-manager/Microsoft.DataBox/stable/2022-12-01/examples/JobsList.json -func ExampleJobsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdatabox.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewJobsClient().NewListPager(&armdatabox.JobsClientListOptions{SkipToken: nil}) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.JobResourceList = armdatabox.JobResourceList{ - // Value: []*armdatabox.JobResource{ - // { - // Identity: &armdatabox.ResourceIdentity{ - // Type: to.Ptr("None"), - // }, - // Location: to.Ptr("australiaeast"), - // SKU: &armdatabox.SKU{ - // Name: to.Ptr(armdatabox.SKUNameDataBoxDisk), - // }, - // Tags: map[string]*string{ - // }, - // Name: to.Ptr("TestJobName1"), - // Type: to.Ptr("Microsoft.DataBox/jobs"), - // ID: to.Ptr("/subscriptions/YourSubscriptionId/resourcegroups/TestResourceGroupName/providers/Microsoft.DataBox/jobs/TestJobName1"), - // Properties: &armdatabox.JobProperties{ - // CancellationReason: to.Ptr("Old job which is still in ordered state cancelled by the service"), - // DeliveryInfo: &armdatabox.JobDeliveryInfo{ - // ScheduledDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "0001-01-01T05:30:00+05:30"); return t}()), - // }, - // DeliveryType: to.Ptr(armdatabox.JobDeliveryTypeNonScheduled), - // IsCancellable: to.Ptr(false), - // IsCancellableWithoutFee: to.Ptr(false), - // IsDeletable: to.Ptr(true), - // IsPrepareToShipEnabled: to.Ptr(false), - // IsShippingAddressEditable: to.Ptr(false), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-08-30T14:44:39.77401+05:30"); return t}()), - // Status: to.Ptr(armdatabox.StageNameCancelled), - // TransferType: to.Ptr(armdatabox.TransferTypeImportToAzure), - // }, - // }, - // { - // Identity: &armdatabox.ResourceIdentity{ - // Type: to.Ptr("None"), - // }, - // Location: to.Ptr("australiaeast"), - // SKU: &armdatabox.SKU{ - // Name: to.Ptr(armdatabox.SKUNameDataBoxDisk), - // }, - // Tags: map[string]*string{ - // }, - // Name: to.Ptr("TestJobName2"), - // Type: to.Ptr("Microsoft.DataBox/jobs"), - // ID: to.Ptr("/subscriptions/YourSubscriptionId/resourcegroups/TestResourceGroupName/providers/Microsoft.DataBox/jobs/TestJobName2"), - // Properties: &armdatabox.JobProperties{ - // CancellationReason: to.Ptr("Old job which is still in ordered state cancelled by the service"), - // DeliveryInfo: &armdatabox.JobDeliveryInfo{ - // ScheduledDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "0001-01-01T05:30:00+05:30"); return t}()), - // }, - // DeliveryType: to.Ptr(armdatabox.JobDeliveryTypeNonScheduled), - // IsCancellable: to.Ptr(false), - // IsCancellableWithoutFee: to.Ptr(false), - // IsDeletable: to.Ptr(true), - // IsPrepareToShipEnabled: to.Ptr(false), - // IsShippingAddressEditable: to.Ptr(false), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-09-10T18:03:22.2578238+05:30"); return t}()), - // Status: to.Ptr(armdatabox.StageNameCancelled), - // TransferType: to.Ptr(armdatabox.TransferTypeImportToAzure), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/databox/resource-manager/Microsoft.DataBox/stable/2022-12-01/examples/MarkDevicesShipped.json -func ExampleJobsClient_MarkDevicesShipped() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdatabox.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewJobsClient().MarkDevicesShipped(ctx, "TestJobName1", "YourResourceGroupName", armdatabox.MarkDevicesShippedRequest{ - DeliverToDcPackageDetails: &armdatabox.PackageCarrierInfo{ - CarrierName: to.Ptr("testCarrier"), - TrackingID: to.Ptr("000000"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/databox/resource-manager/Microsoft.DataBox/stable/2022-12-01/examples/JobsListByResourceGroup.json -func ExampleJobsClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdatabox.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewJobsClient().NewListByResourceGroupPager("YourResourceGroupName", &armdatabox.JobsClientListByResourceGroupOptions{SkipToken: nil}) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.JobResourceList = armdatabox.JobResourceList{ - // Value: []*armdatabox.JobResource{ - // { - // Identity: &armdatabox.ResourceIdentity{ - // Type: to.Ptr("SystemAssigned"), - // PrincipalID: to.Ptr("xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"), - // TenantID: to.Ptr("xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"), - // }, - // Location: to.Ptr("westus"), - // SKU: &armdatabox.SKU{ - // Name: to.Ptr(armdatabox.SKUNameDataBox), - // }, - // Tags: map[string]*string{ - // }, - // Name: to.Ptr("TestJobName1"), - // Type: to.Ptr("Microsoft.DataBox/jobs"), - // ID: to.Ptr("/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.DataBox/jobs/TestJobName1"), - // Properties: &armdatabox.JobProperties{ - // DeliveryInfo: &armdatabox.JobDeliveryInfo{ - // ScheduledDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "0001-01-01T05:30:00+05:30"); return t}()), - // }, - // DeliveryType: to.Ptr(armdatabox.JobDeliveryTypeNonScheduled), - // IsCancellable: to.Ptr(true), - // IsCancellableWithoutFee: to.Ptr(true), - // IsDeletable: to.Ptr(false), - // IsPrepareToShipEnabled: to.Ptr(true), - // IsShippingAddressEditable: to.Ptr(true), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-07-03T11:55:54.463792+05:30"); return t}()), - // Status: to.Ptr(armdatabox.StageNameDeviceOrdered), - // TransferType: to.Ptr(armdatabox.TransferTypeImportToAzure), - // }, - // }, - // { - // Identity: &armdatabox.ResourceIdentity{ - // Type: to.Ptr("None"), - // }, - // Location: to.Ptr("westus"), - // SKU: &armdatabox.SKU{ - // Name: to.Ptr(armdatabox.SKUNameDataBox), - // }, - // Tags: map[string]*string{ - // }, - // Name: to.Ptr("TestJobName2"), - // Type: to.Ptr("Microsoft.DataBox/jobs"), - // ID: to.Ptr("/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.DataBox/jobs/TestJobName2"), - // Properties: &armdatabox.JobProperties{ - // DeliveryInfo: &armdatabox.JobDeliveryInfo{ - // ScheduledDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "0001-01-01T05:30:00+05:30"); return t}()), - // }, - // DeliveryType: to.Ptr(armdatabox.JobDeliveryTypeNonScheduled), - // IsCancellable: to.Ptr(true), - // IsCancellableWithoutFee: to.Ptr(true), - // IsDeletable: to.Ptr(false), - // IsPrepareToShipEnabled: to.Ptr(true), - // IsShippingAddressEditable: to.Ptr(true), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-08-07T10:50:36.3341513+05:30"); return t}()), - // Status: to.Ptr(armdatabox.StageNameDeviceOrdered), - // TransferType: to.Ptr(armdatabox.TransferTypeImportToAzure), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/databox/resource-manager/Microsoft.DataBox/stable/2022-12-01/examples/JobsGet.json -func ExampleJobsClient_Get_jobsGet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdatabox.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewJobsClient().Get(ctx, "YourResourceGroupName", "TestJobName1", &armdatabox.JobsClientGetOptions{Expand: to.Ptr("details")}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.JobResource = armdatabox.JobResource{ - // Identity: &armdatabox.ResourceIdentity{ - // Type: to.Ptr("None"), - // }, - // Location: to.Ptr("westus"), - // SKU: &armdatabox.SKU{ - // Name: to.Ptr(armdatabox.SKUNameDataBox), - // }, - // Tags: map[string]*string{ - // }, - // Name: to.Ptr("TestJobName1"), - // Type: to.Ptr("Microsoft.DataBox/jobs"), - // ID: to.Ptr("/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.DataBox/jobs/TestJobName1"), - // Properties: &armdatabox.JobProperties{ - // DeliveryInfo: &armdatabox.JobDeliveryInfo{ - // ScheduledDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "0001-01-01T05:30:00+05:30"); return t}()), - // }, - // DeliveryType: to.Ptr(armdatabox.JobDeliveryTypeNonScheduled), - // IsCancellable: to.Ptr(true), - // IsCancellableWithoutFee: to.Ptr(true), - // IsDeletable: to.Ptr(false), - // IsPrepareToShipEnabled: to.Ptr(true), - // IsShippingAddressEditable: to.Ptr(true), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-08-07T10:50:36.3341513+05:30"); return t}()), - // Status: to.Ptr(armdatabox.StageNameDeviceOrdered), - // TransferType: to.Ptr(armdatabox.TransferTypeImportToAzure), - // Details: &armdatabox.JobDetails{ - // ContactDetails: &armdatabox.ContactDetails{ - // ContactName: to.Ptr("XXXX XXXX"), - // EmailList: []*string{ - // to.Ptr("xxxx@xxxx.xxx")}, - // NotificationPreference: []*armdatabox.NotificationPreference{ - // { - // SendNotification: to.Ptr(true), - // StageName: to.Ptr(armdatabox.NotificationStageNameDevicePrepared), - // }, - // { - // SendNotification: to.Ptr(true), - // StageName: to.Ptr(armdatabox.NotificationStageNameDispatched), - // }, - // { - // SendNotification: to.Ptr(true), - // StageName: to.Ptr(armdatabox.NotificationStageNameDelivered), - // }, - // { - // SendNotification: to.Ptr(true), - // StageName: to.Ptr(armdatabox.NotificationStageNamePickedUp), - // }, - // { - // SendNotification: to.Ptr(true), - // StageName: to.Ptr(armdatabox.NotificationStageNameAtAzureDC), - // }, - // { - // SendNotification: to.Ptr(true), - // StageName: to.Ptr(armdatabox.NotificationStageNameDataCopy), - // }}, - // Phone: to.Ptr("0000000000"), - // PhoneExtension: to.Ptr(""), - // }, - // CopyLogDetails: []armdatabox.CopyLogDetailsClassification{ - // }, - // DataImportDetails: []*armdatabox.DataImportDetails{ - // { - // AccountDetails: &armdatabox.StorageAccountDetails{ - // DataAccountType: to.Ptr(armdatabox.DataAccountTypeStorageAccount), - // StorageAccountID: to.Ptr("/subscriptions/YourSubscriptionId/resourcegroups/YourResourceGroupName/providers/Microsoft.Storage/storageAccounts/YourStorageAccountName"), - // }, - // }}, - // DeliveryPackage: &armdatabox.PackageShippingDetails{ - // CarrierName: to.Ptr(""), - // TrackingID: to.Ptr(""), - // TrackingURL: to.Ptr(""), - // }, - // JobDetailsType: to.Ptr(armdatabox.ClassDiscriminatorDataBox), - // JobStages: []*armdatabox.JobStages{ - // { - // DisplayName: to.Ptr("Ordered"), - // StageName: to.Ptr(armdatabox.StageNameDeviceOrdered), - // StageStatus: to.Ptr(armdatabox.StageStatusSucceeded), - // StageTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-08-07T10:50:40.1872217+05:30"); return t}()), - // }, - // { - // DisplayName: to.Ptr("Processed"), - // StageName: to.Ptr(armdatabox.StageNameDevicePrepared), - // StageStatus: to.Ptr(armdatabox.StageStatusNone), - // }, - // { - // DisplayName: to.Ptr("Dispatched"), - // StageName: to.Ptr(armdatabox.StageNameDispatched), - // StageStatus: to.Ptr(armdatabox.StageStatusNone), - // }, - // { - // DisplayName: to.Ptr("Delivered"), - // StageName: to.Ptr(armdatabox.StageNameDelivered), - // StageStatus: to.Ptr(armdatabox.StageStatusNone), - // }, - // { - // DisplayName: to.Ptr("Picked up"), - // StageName: to.Ptr(armdatabox.StageNamePickedUp), - // StageStatus: to.Ptr(armdatabox.StageStatusNone), - // }, - // { - // DisplayName: to.Ptr("Received"), - // StageName: to.Ptr(armdatabox.StageNameAtAzureDC), - // StageStatus: to.Ptr(armdatabox.StageStatusNone), - // }, - // { - // DisplayName: to.Ptr("Data copy in progress"), - // StageName: to.Ptr(armdatabox.StageNameDataCopy), - // StageStatus: to.Ptr(armdatabox.StageStatusNone), - // }, - // { - // DisplayName: to.Ptr("Completed"), - // StageName: to.Ptr(armdatabox.StageNameCompleted), - // StageStatus: to.Ptr(armdatabox.StageStatusNone), - // }}, - // KeyEncryptionKey: &armdatabox.KeyEncryptionKey{ - // KekType: to.Ptr(armdatabox.KekTypeMicrosoftManaged), - // }, - // ReturnPackage: &armdatabox.PackageShippingDetails{ - // CarrierName: to.Ptr(""), - // TrackingID: to.Ptr(""), - // TrackingURL: to.Ptr(""), - // }, - // ReverseShipmentLabelSasKey: to.Ptr("https://xxx.xxx.xx"), - // ShippingAddress: &armdatabox.ShippingAddress{ - // AddressType: to.Ptr(armdatabox.AddressTypeCommercial), - // City: to.Ptr("XXXX XXXX"), - // CompanyName: to.Ptr("XXXX XXXX"), - // Country: to.Ptr("XX"), - // PostalCode: to.Ptr("00000"), - // StateOrProvince: to.Ptr("XX"), - // StreetAddress1: to.Ptr("XXXX XXXX"), - // StreetAddress2: to.Ptr("XXXX XXXX"), - // }, - // CopyProgress: []*armdatabox.CopyProgress{ - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/databox/resource-manager/Microsoft.DataBox/stable/2022-12-01/examples/JobsGetCmk.json -func ExampleJobsClient_Get_jobsGetCmk() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdatabox.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewJobsClient().Get(ctx, "YourResourceGroupName", "TestJobName1", &armdatabox.JobsClientGetOptions{Expand: to.Ptr("details")}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.JobResource = armdatabox.JobResource{ - // Identity: &armdatabox.ResourceIdentity{ - // Type: to.Ptr("SystemAssigned"), - // PrincipalID: to.Ptr("xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"), - // TenantID: to.Ptr("xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"), - // }, - // Location: to.Ptr("westus"), - // SKU: &armdatabox.SKU{ - // Name: to.Ptr(armdatabox.SKUNameDataBox), - // }, - // Tags: map[string]*string{ - // }, - // Name: to.Ptr("TestJobName1"), - // Type: to.Ptr("Microsoft.DataBox/jobs"), - // ID: to.Ptr("/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.DataBox/jobs/TestJobName1"), - // Properties: &armdatabox.JobProperties{ - // DeliveryInfo: &armdatabox.JobDeliveryInfo{ - // ScheduledDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "0001-01-01T05:30:00+05:30"); return t}()), - // }, - // DeliveryType: to.Ptr(armdatabox.JobDeliveryTypeNonScheduled), - // IsCancellable: to.Ptr(true), - // IsCancellableWithoutFee: to.Ptr(true), - // IsDeletable: to.Ptr(false), - // IsPrepareToShipEnabled: to.Ptr(true), - // IsShippingAddressEditable: to.Ptr(true), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-08-07T10:47:42.0009935+05:30"); return t}()), - // Status: to.Ptr(armdatabox.StageNameDeviceOrdered), - // TransferType: to.Ptr(armdatabox.TransferTypeImportToAzure), - // Details: &armdatabox.JobDetails{ - // ContactDetails: &armdatabox.ContactDetails{ - // ContactName: to.Ptr("XXXX XXXX"), - // EmailList: []*string{ - // to.Ptr("xxxx@xxxx.xxx")}, - // NotificationPreference: []*armdatabox.NotificationPreference{ - // { - // SendNotification: to.Ptr(true), - // StageName: to.Ptr(armdatabox.NotificationStageNameDevicePrepared), - // }, - // { - // SendNotification: to.Ptr(true), - // StageName: to.Ptr(armdatabox.NotificationStageNameDispatched), - // }, - // { - // SendNotification: to.Ptr(true), - // StageName: to.Ptr(armdatabox.NotificationStageNameDelivered), - // }, - // { - // SendNotification: to.Ptr(true), - // StageName: to.Ptr(armdatabox.NotificationStageNamePickedUp), - // }, - // { - // SendNotification: to.Ptr(true), - // StageName: to.Ptr(armdatabox.NotificationStageNameAtAzureDC), - // }, - // { - // SendNotification: to.Ptr(true), - // StageName: to.Ptr(armdatabox.NotificationStageNameDataCopy), - // }}, - // Phone: to.Ptr("0000000000"), - // PhoneExtension: to.Ptr(""), - // }, - // CopyLogDetails: []armdatabox.CopyLogDetailsClassification{ - // }, - // DataImportDetails: []*armdatabox.DataImportDetails{ - // { - // AccountDetails: &armdatabox.StorageAccountDetails{ - // DataAccountType: to.Ptr(armdatabox.DataAccountTypeStorageAccount), - // StorageAccountID: to.Ptr("/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Storage/storageAccounts/YourStorageAccountName"), - // }, - // }}, - // DeliveryPackage: &armdatabox.PackageShippingDetails{ - // CarrierName: to.Ptr(""), - // TrackingID: to.Ptr(""), - // TrackingURL: to.Ptr(""), - // }, - // JobDetailsType: to.Ptr(armdatabox.ClassDiscriminatorDataBox), - // JobStages: []*armdatabox.JobStages{ - // { - // DisplayName: to.Ptr("Ordered"), - // StageName: to.Ptr(armdatabox.StageNameDeviceOrdered), - // StageStatus: to.Ptr(armdatabox.StageStatusSucceeded), - // StageTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-08-07T10:47:44.8736499+05:30"); return t}()), - // }, - // { - // DisplayName: to.Ptr("Processed"), - // StageName: to.Ptr(armdatabox.StageNameDevicePrepared), - // StageStatus: to.Ptr(armdatabox.StageStatusNone), - // }, - // { - // DisplayName: to.Ptr("Dispatched"), - // StageName: to.Ptr(armdatabox.StageNameDispatched), - // StageStatus: to.Ptr(armdatabox.StageStatusNone), - // }, - // { - // DisplayName: to.Ptr("Delivered"), - // StageName: to.Ptr(armdatabox.StageNameDelivered), - // StageStatus: to.Ptr(armdatabox.StageStatusNone), - // }, - // { - // DisplayName: to.Ptr("Picked up"), - // StageName: to.Ptr(armdatabox.StageNamePickedUp), - // StageStatus: to.Ptr(armdatabox.StageStatusNone), - // }, - // { - // DisplayName: to.Ptr("Received"), - // StageName: to.Ptr(armdatabox.StageNameAtAzureDC), - // StageStatus: to.Ptr(armdatabox.StageStatusNone), - // }, - // { - // DisplayName: to.Ptr("Data copy in progress"), - // StageName: to.Ptr(armdatabox.StageNameDataCopy), - // StageStatus: to.Ptr(armdatabox.StageStatusNone), - // }, - // { - // DisplayName: to.Ptr("Completed"), - // StageName: to.Ptr(armdatabox.StageNameCompleted), - // StageStatus: to.Ptr(armdatabox.StageStatusNone), - // }}, - // KeyEncryptionKey: &armdatabox.KeyEncryptionKey{ - // KekType: to.Ptr(armdatabox.KekTypeCustomerManaged), - // KekURL: to.Ptr("https://xxx.xxx.xx"), - // KekVaultResourceID: to.Ptr("/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.KeyVault/vaults/YourKeyVaultName"), - // }, - // ReturnPackage: &armdatabox.PackageShippingDetails{ - // CarrierName: to.Ptr(""), - // TrackingID: to.Ptr(""), - // TrackingURL: to.Ptr(""), - // }, - // ReverseShipmentLabelSasKey: to.Ptr("https://xxx.xxx.xx"), - // ShippingAddress: &armdatabox.ShippingAddress{ - // AddressType: to.Ptr(armdatabox.AddressTypeCommercial), - // City: to.Ptr("XXXX XXXX"), - // CompanyName: to.Ptr("XXXX XXXX"), - // Country: to.Ptr("XX"), - // PostalCode: to.Ptr("00000"), - // StateOrProvince: to.Ptr("XX"), - // StreetAddress1: to.Ptr("XXXX XXXX"), - // StreetAddress2: to.Ptr("XXXX XXXX"), - // }, - // CopyProgress: []*armdatabox.CopyProgress{ - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/databox/resource-manager/Microsoft.DataBox/stable/2022-12-01/examples/JobsGetCopyStuck.json -func ExampleJobsClient_Get_jobsGetCopyStuck() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdatabox.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewJobsClient().Get(ctx, "YourResourceGroupName", "TestJobName1", &armdatabox.JobsClientGetOptions{Expand: to.Ptr("details")}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.JobResource = armdatabox.JobResource{ - // Identity: &armdatabox.ResourceIdentity{ - // Type: to.Ptr("None"), - // }, - // Location: to.Ptr("westus"), - // SKU: &armdatabox.SKU{ - // Name: to.Ptr(armdatabox.SKUNameDataBox), - // }, - // Tags: map[string]*string{ - // "defaultTagsKey": to.Ptr("defaultTagsValue"), - // }, - // Name: to.Ptr("TestJobName1"), - // Type: to.Ptr("Microsoft.DataBox/jobs"), - // ID: to.Ptr("/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.DataBox/jobs/TestJobName1"), - // Properties: &armdatabox.JobProperties{ - // DeliveryType: to.Ptr(armdatabox.JobDeliveryTypeNonScheduled), - // IsCancellable: to.Ptr(false), - // IsCancellableWithoutFee: to.Ptr(false), - // IsDeletable: to.Ptr(true), - // IsPrepareToShipEnabled: to.Ptr(true), - // IsShippingAddressEditable: to.Ptr(false), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-03-05T12:56:12.6384315+05:30"); return t}()), - // Status: to.Ptr(armdatabox.StageNameCompletedWithWarnings), - // TransferType: to.Ptr(armdatabox.TransferTypeImportToAzure), - // Details: &armdatabox.JobDetails{ - // Actions: []*armdatabox.CustomerResolutionCode{ - // }, - // ContactDetails: &armdatabox.ContactDetails{ - // ContactName: to.Ptr("XXXX XXXX"), - // EmailList: []*string{ - // to.Ptr("xxxx@xxxx.xxx")}, - // NotificationPreference: []*armdatabox.NotificationPreference{ - // { - // SendNotification: to.Ptr(true), - // StageName: to.Ptr(armdatabox.NotificationStageNameDevicePrepared), - // }, - // { - // SendNotification: to.Ptr(true), - // StageName: to.Ptr(armdatabox.NotificationStageNameDispatched), - // }, - // { - // SendNotification: to.Ptr(true), - // StageName: to.Ptr(armdatabox.NotificationStageNameDelivered), - // }, - // { - // SendNotification: to.Ptr(true), - // StageName: to.Ptr(armdatabox.NotificationStageNamePickedUp), - // }, - // { - // SendNotification: to.Ptr(true), - // StageName: to.Ptr(armdatabox.NotificationStageNameAtAzureDC), - // }, - // { - // SendNotification: to.Ptr(true), - // StageName: to.Ptr(armdatabox.NotificationStageNameDataCopy), - // }}, - // Phone: to.Ptr("0000000000"), - // PhoneExtension: to.Ptr(""), - // }, - // CopyLogDetails: []armdatabox.CopyLogDetailsClassification{ - // &armdatabox.AccountCopyLogDetails{ - // CopyLogDetailsType: to.Ptr(armdatabox.ClassDiscriminatorDataBox), - // AccountName: to.Ptr("YourStorageAccountName"), - // CopyLogLink: to.Ptr("databoxcopylog/xxx.xml"), - // }}, - // DataImportDetails: []*armdatabox.DataImportDetails{ - // { - // AccountDetails: &armdatabox.StorageAccountDetails{ - // DataAccountType: to.Ptr(armdatabox.DataAccountTypeStorageAccount), - // StorageAccountID: to.Ptr("/subscriptions/YourSubscriptionId/resourcegroups/YourResourceGroupName/providers/Microsoft.Storage/storageAccounts/YourStorageAccountName"), - // }, - // }}, - // DeliveryPackage: &armdatabox.PackageShippingDetails{ - // CarrierName: to.Ptr("Ups"), - // TrackingID: to.Ptr("5fb6965e-0b80-4f38-b21a-32673fed2d84"), - // TrackingURL: to.Ptr("https://xxx.xxx.xx"), - // }, - // ExpectedDataSizeInTeraBytes: to.Ptr[int32](0), - // JobDetailsType: to.Ptr(armdatabox.ClassDiscriminatorDataBox), - // JobStages: []*armdatabox.JobStages{ - // { - // DisplayName: to.Ptr("Ordered"), - // StageName: to.Ptr(armdatabox.StageNameDeviceOrdered), - // StageStatus: to.Ptr(armdatabox.StageStatusSucceeded), - // StageTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-03-05T12:56:25.3911023+05:30"); return t}()), - // }, - // { - // DisplayName: to.Ptr("Processed"), - // StageName: to.Ptr(armdatabox.StageNameDevicePrepared), - // StageStatus: to.Ptr(armdatabox.StageStatusSucceeded), - // StageTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-03-05T13:07:49.676421+05:30"); return t}()), - // }, - // { - // DisplayName: to.Ptr("Dispatched"), - // StageName: to.Ptr(armdatabox.StageNameDispatched), - // StageStatus: to.Ptr(armdatabox.StageStatusSucceeded), - // StageTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-03-05T02:21:06+05:30"); return t}()), - // }, - // { - // DisplayName: to.Ptr("Delivered"), - // StageName: to.Ptr(armdatabox.StageNameDelivered), - // StageStatus: to.Ptr(armdatabox.StageStatusSucceeded), - // StageTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-03-05T02:21:13+05:30"); return t}()), - // }, - // { - // DisplayName: to.Ptr("Picked up"), - // StageName: to.Ptr(armdatabox.StageNamePickedUp), - // StageStatus: to.Ptr(armdatabox.StageStatusSucceeded), - // StageTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-03-05T02:23:10+05:30"); return t}()), - // }, - // { - // DisplayName: to.Ptr("Received"), - // StageName: to.Ptr(armdatabox.StageNameAtAzureDC), - // StageStatus: to.Ptr(armdatabox.StageStatusSucceeded), - // StageTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-03-05T02:23:17+05:30"); return t}()), - // }, - // { - // DisplayName: to.Ptr("Data copy in progress"), - // StageName: to.Ptr(armdatabox.StageNameDataCopy), - // StageStatus: to.Ptr(armdatabox.StageStatusSucceeded), - // StageTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-03-05T13:34:20.1497635+05:30"); return t}()), - // }, - // { - // StageName: to.Ptr(armdatabox.StageNameCompletedWithWarnings), - // StageStatus: to.Ptr(armdatabox.StageStatusSucceeded), - // StageTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-03-05T14:08:38.250614+05:30"); return t}()), - // }}, - // KeyEncryptionKey: &armdatabox.KeyEncryptionKey{ - // KekType: to.Ptr(armdatabox.KekTypeMicrosoftManaged), - // }, - // LastMitigationActionOnJob: &armdatabox.LastMitigationActionOnJob{ - // ActionDateTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-03-05T08:28:18.8107951Z"); return t}()), - // CustomerResolution: to.Ptr(armdatabox.CustomerResolutionCodeMoveToCleanUpDevice), - // IsPerformedByCustomer: to.Ptr(true), - // }, - // Preferences: &armdatabox.Preferences{ - // }, - // ReturnPackage: &armdatabox.PackageShippingDetails{ - // CarrierName: to.Ptr("Ups"), - // TrackingID: to.Ptr("b3875a34-aad6-4dbe-83a9-3f39cb21b0e8"), - // TrackingURL: to.Ptr("https://xxx.xxx.xx"), - // }, - // ReverseShipmentLabelSasKey: to.Ptr("http://xxx.xxx.xxx"), - // ShippingAddress: &armdatabox.ShippingAddress{ - // AddressType: to.Ptr(armdatabox.AddressTypeNone), - // City: to.Ptr("XXXX XXXX"), - // CompanyName: to.Ptr("XXXX XXXX"), - // Country: to.Ptr("XX"), - // PostalCode: to.Ptr("00000"), - // StateOrProvince: to.Ptr("XX"), - // StreetAddress1: to.Ptr("164 TOWNSEND ST"), - // StreetAddress2: to.Ptr("XXXX XXXX"), - // }, - // CopyProgress: []*armdatabox.CopyProgress{ - // { - // AccountID: to.Ptr("/subscriptions/YourSubscriptionId/resourcegroups/YourResourceGroupName/providers/Microsoft.Storage/storageAccounts/YourStorageAccountName"), - // BytesProcessed: to.Ptr[int64](2000), - // DataAccountType: to.Ptr(armdatabox.DataAccountTypeStorageAccount), - // DirectoriesErroredOut: to.Ptr[int64](0), - // FilesErroredOut: to.Ptr[int64](0), - // FilesProcessed: to.Ptr[int64](100), - // InvalidDirectoriesProcessed: to.Ptr[int64](0), - // InvalidFileBytesUploaded: to.Ptr[int64](10), - // InvalidFilesProcessed: to.Ptr[int64](10), - // IsEnumerationInProgress: to.Ptr(false), - // RenamedContainerCount: to.Ptr[int64](60), - // StorageAccountName: to.Ptr("YourStorageAccountName"), - // TotalBytesToProcess: to.Ptr[int64](2000), - // TotalFilesToProcess: to.Ptr[int64](110), - // TransferType: to.Ptr(armdatabox.TransferTypeImportToAzure), - // }}, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/databox/resource-manager/Microsoft.DataBox/stable/2022-12-01/examples/JobsGetExport.json -func ExampleJobsClient_Get_jobsGetExport() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdatabox.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewJobsClient().Get(ctx, "YourResourceGroupName", "TestJobName1", &armdatabox.JobsClientGetOptions{Expand: to.Ptr("details")}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.JobResource = armdatabox.JobResource{ - // Identity: &armdatabox.ResourceIdentity{ - // Type: to.Ptr("None"), - // }, - // Location: to.Ptr("westus"), - // SKU: &armdatabox.SKU{ - // Name: to.Ptr(armdatabox.SKUNameDataBox), - // }, - // Tags: map[string]*string{ - // }, - // Name: to.Ptr("TestJobName1"), - // Type: to.Ptr("Microsoft.DataBox/jobs"), - // ID: to.Ptr("/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.DataBox/jobs/TestJobName1"), - // Properties: &armdatabox.JobProperties{ - // CancellationReason: to.Ptr("CancelTest"), - // DeliveryInfo: &armdatabox.JobDeliveryInfo{ - // ScheduledDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "0001-01-01T05:30:00+05:30"); return t}()), - // }, - // DeliveryType: to.Ptr(armdatabox.JobDeliveryTypeNonScheduled), - // IsCancellable: to.Ptr(false), - // IsCancellableWithoutFee: to.Ptr(false), - // IsDeletable: to.Ptr(true), - // IsPrepareToShipEnabled: to.Ptr(true), - // IsShippingAddressEditable: to.Ptr(false), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-08-07T10:49:08.7195419+05:30"); return t}()), - // Status: to.Ptr(armdatabox.StageNameCancelled), - // TransferType: to.Ptr(armdatabox.TransferTypeExportFromAzure), - // Details: &armdatabox.JobDetails{ - // ChainOfCustodySasKey: to.Ptr("https://xxx.xxx.xx"), - // ContactDetails: &armdatabox.ContactDetails{ - // ContactName: to.Ptr(" "), - // EmailList: []*string{ - // }, - // NotificationPreference: []*armdatabox.NotificationPreference{ - // }, - // Phone: to.Ptr("0000000000"), - // PhoneExtension: to.Ptr(""), - // }, - // CopyLogDetails: []armdatabox.CopyLogDetailsClassification{ - // }, - // DataExportDetails: []*armdatabox.DataExportDetails{ - // { - // AccountDetails: &armdatabox.StorageAccountDetails{ - // DataAccountType: to.Ptr(armdatabox.DataAccountTypeStorageAccount), - // StorageAccountID: to.Ptr("/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Storage/storageAccounts/YourStorageAccountName"), - // }, - // LogCollectionLevel: to.Ptr(armdatabox.LogCollectionLevelError), - // TransferConfiguration: &armdatabox.TransferConfiguration{ - // TransferAllDetails: &armdatabox.TransferConfigurationTransferAllDetails{ - // Include: &armdatabox.TransferAllDetails{ - // DataAccountType: to.Ptr(armdatabox.DataAccountTypeStorageAccount), - // TransferAllBlobs: to.Ptr(true), - // TransferAllFiles: to.Ptr(true), - // }, - // }, - // TransferConfigurationType: to.Ptr(armdatabox.TransferConfigurationTypeTransferAll), - // TransferFilterDetails: &armdatabox.TransferConfigurationTransferFilterDetails{ - // }, - // }, - // }}, - // DataImportDetails: []*armdatabox.DataImportDetails{ - // }, - // DeliveryPackage: &armdatabox.PackageShippingDetails{ - // CarrierName: to.Ptr(""), - // TrackingID: to.Ptr(""), - // TrackingURL: to.Ptr(""), - // }, - // JobDetailsType: to.Ptr(armdatabox.ClassDiscriminatorDataBox), - // JobStages: []*armdatabox.JobStages{ - // { - // DisplayName: to.Ptr("Ordered"), - // StageName: to.Ptr(armdatabox.StageNameDeviceOrdered), - // StageStatus: to.Ptr(armdatabox.StageStatusSucceeded), - // StageTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-08-07T10:49:12.7675644+05:30"); return t}()), - // }, - // { - // DisplayName: to.Ptr("Canceled"), - // StageName: to.Ptr(armdatabox.StageNameCancelled), - // StageStatus: to.Ptr(armdatabox.StageStatusSucceeded), - // StageTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-08-07T10:49:57.2572438+05:30"); return t}()), - // }}, - // KeyEncryptionKey: &armdatabox.KeyEncryptionKey{ - // KekType: to.Ptr(armdatabox.KekTypeMicrosoftManaged), - // }, - // ReturnPackage: &armdatabox.PackageShippingDetails{ - // CarrierName: to.Ptr(""), - // TrackingID: to.Ptr(""), - // TrackingURL: to.Ptr(""), - // }, - // ReverseShipmentLabelSasKey: to.Ptr("https://xxx.xxx.xx"), - // ShippingAddress: &armdatabox.ShippingAddress{ - // AddressType: to.Ptr(armdatabox.AddressTypeCommercial), - // City: to.Ptr("XXXX XXXX"), - // CompanyName: to.Ptr("XXXX XXXX"), - // Country: to.Ptr("XX"), - // PostalCode: to.Ptr("00000"), - // StateOrProvince: to.Ptr("XX"), - // StreetAddress1: to.Ptr("XXXX XXXX"), - // StreetAddress2: to.Ptr("XXXX XXXX"), - // }, - // CopyProgress: []*armdatabox.CopyProgress{ - // { - // AccountID: to.Ptr("/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Storage/storageAccounts/YourStorageAccountName"), - // BytesProcessed: to.Ptr[int64](0), - // DataAccountType: to.Ptr(armdatabox.DataAccountTypeStorageAccount), - // IsEnumerationInProgress: to.Ptr(false), - // StorageAccountName: to.Ptr("YourStorageAccountName"), - // TotalBytesToProcess: to.Ptr[int64](0), - // TransferType: to.Ptr(armdatabox.TransferTypeExportFromAzure), - // }}, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/databox/resource-manager/Microsoft.DataBox/stable/2022-12-01/examples/JobsGetWaitingForAction.json -func ExampleJobsClient_Get_jobsGetWaitingForAction() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdatabox.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewJobsClient().Get(ctx, "YourResourceGroupName", "TestJobName1", &armdatabox.JobsClientGetOptions{Expand: to.Ptr("details")}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.JobResource = armdatabox.JobResource{ - // Identity: &armdatabox.ResourceIdentity{ - // Type: to.Ptr("None"), - // }, - // Location: to.Ptr("westus"), - // SKU: &armdatabox.SKU{ - // Name: to.Ptr(armdatabox.SKUNameDataBox), - // }, - // Tags: map[string]*string{ - // "defaultTagsKey": to.Ptr("defaultTagsValue"), - // }, - // Name: to.Ptr("TestJobName1"), - // Type: to.Ptr("Microsoft.DataBox/jobs"), - // ID: to.Ptr("/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.DataBox/jobs/TestJobName1"), - // Properties: &armdatabox.JobProperties{ - // DeliveryType: to.Ptr(armdatabox.JobDeliveryTypeNonScheduled), - // Error: &armdatabox.CloudError{ - // AdditionalInfo: []*armdatabox.AdditionalErrorInfo{ - // }, - // Code: to.Ptr("SsemUserCopyErrorWaitingForAction"), - // Message: to.Ptr("Job has an error in copy stage and is waiting for customer action. Please review the error and select one of the actions provided in the job's properties.details.actions"), - // Target: to.Ptr("CopyIntervention"), - // Details: []*armdatabox.CloudError{ - // }, - // }, - // IsCancellable: to.Ptr(false), - // IsCancellableWithoutFee: to.Ptr(false), - // IsDeletable: to.Ptr(false), - // IsPrepareToShipEnabled: to.Ptr(true), - // IsShippingAddressEditable: to.Ptr(false), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-03-14T23:49:49.5177298+00:00"); return t}()), - // Status: to.Ptr(armdatabox.StageNameDataCopy), - // TransferType: to.Ptr(armdatabox.TransferTypeImportToAzure), - // Details: &armdatabox.JobDetails{ - // Actions: []*armdatabox.CustomerResolutionCode{ - // to.Ptr(armdatabox.CustomerResolutionCodeMoveToCleanUpDevice)}, - // ContactDetails: &armdatabox.ContactDetails{ - // ContactName: to.Ptr("XXXX XXXX"), - // EmailList: []*string{ - // to.Ptr("xxxx@xxxx.xxx")}, - // NotificationPreference: []*armdatabox.NotificationPreference{ - // { - // SendNotification: to.Ptr(true), - // StageName: to.Ptr(armdatabox.NotificationStageNameDevicePrepared), - // }, - // { - // SendNotification: to.Ptr(true), - // StageName: to.Ptr(armdatabox.NotificationStageNameDispatched), - // }, - // { - // SendNotification: to.Ptr(true), - // StageName: to.Ptr(armdatabox.NotificationStageNameDelivered), - // }, - // { - // SendNotification: to.Ptr(true), - // StageName: to.Ptr(armdatabox.NotificationStageNamePickedUp), - // }, - // { - // SendNotification: to.Ptr(true), - // StageName: to.Ptr(armdatabox.NotificationStageNameAtAzureDC), - // }, - // { - // SendNotification: to.Ptr(true), - // StageName: to.Ptr(armdatabox.NotificationStageNameDataCopy), - // }}, - // Phone: to.Ptr("0000000000"), - // PhoneExtension: to.Ptr(""), - // }, - // CopyLogDetails: []armdatabox.CopyLogDetailsClassification{ - // &armdatabox.AccountCopyLogDetails{ - // CopyLogDetailsType: to.Ptr(armdatabox.ClassDiscriminatorDataBox), - // AccountName: to.Ptr("YourStorageAccountName"), - // CopyLogLink: to.Ptr("databoxcopylog/xxx.xml"), - // }, - // &armdatabox.AccountCopyLogDetails{ - // CopyLogDetailsType: to.Ptr(armdatabox.ClassDiscriminatorDataBox), - // AccountName: to.Ptr("YourResourceGroupName"), - // CopyLogLink: to.Ptr("databoxcopylog/xxx.xml"), - // }}, - // DataImportDetails: []*armdatabox.DataImportDetails{ - // { - // AccountDetails: &armdatabox.StorageAccountDetails{ - // DataAccountType: to.Ptr(armdatabox.DataAccountTypeStorageAccount), - // StorageAccountID: to.Ptr("/subscriptions/YourSubscriptionId/resourcegroups/YourResourceGroupName/providers/Microsoft.Storage/storageAccounts/YourStorageAccountName"), - // }, - // }, - // { - // AccountDetails: &armdatabox.ManagedDiskDetails{ - // DataAccountType: to.Ptr(armdatabox.DataAccountTypeManagedDisk), - // ResourceGroupID: to.Ptr("/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName"), - // StagingStorageAccountID: to.Ptr("/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Storage/storageAccounts/YourStorageAccountName"), - // }, - // }}, - // DeliveryPackage: &armdatabox.PackageShippingDetails{ - // CarrierName: to.Ptr("Ups"), - // TrackingID: to.Ptr("xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"), - // TrackingURL: to.Ptr("https://xxx.xxx.xx"), - // }, - // ExpectedDataSizeInTeraBytes: to.Ptr[int32](0), - // JobDetailsType: to.Ptr(armdatabox.ClassDiscriminatorDataBox), - // JobStages: []*armdatabox.JobStages{ - // { - // DisplayName: to.Ptr("Ordered"), - // StageName: to.Ptr(armdatabox.StageNameDeviceOrdered), - // StageStatus: to.Ptr(armdatabox.StageStatusSucceeded), - // StageTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-03-14T23:49:53.81509+00:00"); return t}()), - // }, - // { - // DisplayName: to.Ptr("Processed"), - // StageName: to.Ptr(armdatabox.StageNameDevicePrepared), - // StageStatus: to.Ptr(armdatabox.StageStatusSucceeded), - // StageTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-03-15T00:05:18.7350971+00:00"); return t}()), - // }, - // { - // DisplayName: to.Ptr("Dispatched"), - // StageName: to.Ptr(armdatabox.StageNameDispatched), - // StageStatus: to.Ptr(armdatabox.StageStatusSucceeded), - // StageTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-03-15T00:25:19+00:00"); return t}()), - // }, - // { - // DisplayName: to.Ptr("Delivered"), - // StageName: to.Ptr(armdatabox.StageNameDelivered), - // StageStatus: to.Ptr(armdatabox.StageStatusSucceeded), - // StageTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-03-15T00:25:26+00:00"); return t}()), - // }, - // { - // DisplayName: to.Ptr("Picked up"), - // StageName: to.Ptr(armdatabox.StageNamePickedUp), - // StageStatus: to.Ptr(armdatabox.StageStatusSucceeded), - // StageTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-03-15T00:30:22+00:00"); return t}()), - // }, - // { - // DisplayName: to.Ptr("Received"), - // StageName: to.Ptr(armdatabox.StageNameAtAzureDC), - // StageStatus: to.Ptr(armdatabox.StageStatusSucceeded), - // StageTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-03-15T00:30:29+00:00"); return t}()), - // }, - // { - // DisplayName: to.Ptr("Data copy in progress"), - // StageName: to.Ptr(armdatabox.StageNameDataCopy), - // StageStatus: to.Ptr(armdatabox.StageStatusWaitingForCustomerAction), - // StageTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-03-15T00:45:26.2679756+00:00"); return t}()), - // }, - // { - // DisplayName: to.Ptr("Completed"), - // StageName: to.Ptr(armdatabox.StageNameCompleted), - // StageStatus: to.Ptr(armdatabox.StageStatusNone), - // }}, - // KeyEncryptionKey: &armdatabox.KeyEncryptionKey{ - // KekType: to.Ptr(armdatabox.KekTypeMicrosoftManaged), - // }, - // LastMitigationActionOnJob: &armdatabox.LastMitigationActionOnJob{ - // ActionDateTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-12T05:00:22.5047578Z"); return t}()), - // CustomerResolution: to.Ptr(armdatabox.CustomerResolutionCodeMoveToCleanUpDevice), - // IsPerformedByCustomer: to.Ptr(true), - // }, - // Preferences: &armdatabox.Preferences{ - // EncryptionPreferences: &armdatabox.EncryptionPreferences{ - // DoubleEncryption: to.Ptr(armdatabox.DoubleEncryptionDisabled), - // }, - // }, - // ReturnPackage: &armdatabox.PackageShippingDetails{ - // CarrierName: to.Ptr("Ups"), - // TrackingID: to.Ptr("xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"), - // TrackingURL: to.Ptr("https://xxx.xxx.xx"), - // }, - // ReverseShipmentLabelSasKey: to.Ptr("https://xxx.xxx.xx"), - // ShippingAddress: &armdatabox.ShippingAddress{ - // AddressType: to.Ptr(armdatabox.AddressTypeNone), - // City: to.Ptr("XXXX XXXX"), - // CompanyName: to.Ptr("XXXX XXXX"), - // Country: to.Ptr("XX"), - // PostalCode: to.Ptr("00000"), - // StateOrProvince: to.Ptr("XX"), - // StreetAddress1: to.Ptr("164 TOWNSEND ST"), - // StreetAddress2: to.Ptr("XXXX XXXX"), - // }, - // CopyProgress: []*armdatabox.CopyProgress{ - // { - // AccountID: to.Ptr("/subscriptions/YourSubscriptionId/resourcegroups/YourResourceGroupName/providers/Microsoft.Storage/storageAccounts/YourStorageAccountName"), - // BytesProcessed: to.Ptr[int64](2000), - // DataAccountType: to.Ptr(armdatabox.DataAccountTypeStorageAccount), - // DirectoriesErroredOut: to.Ptr[int64](0), - // FilesErroredOut: to.Ptr[int64](0), - // FilesProcessed: to.Ptr[int64](100), - // InvalidDirectoriesProcessed: to.Ptr[int64](0), - // InvalidFileBytesUploaded: to.Ptr[int64](10), - // InvalidFilesProcessed: to.Ptr[int64](10), - // IsEnumerationInProgress: to.Ptr(false), - // RenamedContainerCount: to.Ptr[int64](60), - // StorageAccountName: to.Ptr("YourStorageAccountName"), - // TotalBytesToProcess: to.Ptr[int64](2000), - // TotalFilesToProcess: to.Ptr[int64](110), - // TransferType: to.Ptr(armdatabox.TransferTypeImportToAzure), - // }, - // { - // AccountID: to.Ptr("/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName"), - // BytesProcessed: to.Ptr[int64](2000), - // DataAccountType: to.Ptr(armdatabox.DataAccountTypeManagedDisk), - // DirectoriesErroredOut: to.Ptr[int64](0), - // FilesErroredOut: to.Ptr[int64](0), - // FilesProcessed: to.Ptr[int64](100), - // InvalidDirectoriesProcessed: to.Ptr[int64](0), - // InvalidFileBytesUploaded: to.Ptr[int64](10), - // InvalidFilesProcessed: to.Ptr[int64](10), - // IsEnumerationInProgress: to.Ptr(false), - // RenamedContainerCount: to.Ptr[int64](60), - // TotalBytesToProcess: to.Ptr[int64](2000), - // TotalFilesToProcess: to.Ptr[int64](110), - // TransferType: to.Ptr(armdatabox.TransferTypeImportToAzure), - // }}, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/databox/resource-manager/Microsoft.DataBox/stable/2022-12-01/examples/JobsCreate.json -func ExampleJobsClient_BeginCreate_jobsCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdatabox.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewJobsClient().BeginCreate(ctx, "YourResourceGroupName", "TestJobName1", armdatabox.JobResource{ - Location: to.Ptr("westus"), - SKU: &armdatabox.SKU{ - Name: to.Ptr(armdatabox.SKUNameDataBox), - }, - Properties: &armdatabox.JobProperties{ - TransferType: to.Ptr(armdatabox.TransferTypeImportToAzure), - Details: &armdatabox.JobDetails{ - ContactDetails: &armdatabox.ContactDetails{ - ContactName: to.Ptr("XXXX XXXX"), - EmailList: []*string{ - to.Ptr("xxxx@xxxx.xxx")}, - Phone: to.Ptr("0000000000"), - PhoneExtension: to.Ptr(""), - }, - DataImportDetails: []*armdatabox.DataImportDetails{ - { - AccountDetails: &armdatabox.StorageAccountDetails{ - DataAccountType: to.Ptr(armdatabox.DataAccountTypeStorageAccount), - StorageAccountID: to.Ptr("/subscriptions/YourSubscriptionId/resourcegroups/YourResourceGroupName/providers/Microsoft.Storage/storageAccounts/YourStorageAccountName"), - }, - }}, - JobDetailsType: to.Ptr(armdatabox.ClassDiscriminatorDataBox), - ShippingAddress: &armdatabox.ShippingAddress{ - AddressType: to.Ptr(armdatabox.AddressTypeCommercial), - City: to.Ptr("XXXX XXXX"), - CompanyName: to.Ptr("XXXX XXXX"), - Country: to.Ptr("XX"), - PostalCode: to.Ptr("00000"), - StateOrProvince: to.Ptr("XX"), - StreetAddress1: to.Ptr("XXXX XXXX"), - StreetAddress2: to.Ptr("XXXX XXXX"), - }, - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.JobResource = armdatabox.JobResource{ - // Location: to.Ptr("westus"), - // SKU: &armdatabox.SKU{ - // Name: to.Ptr(armdatabox.SKUNameDataBox), - // }, - // Tags: map[string]*string{ - // }, - // Name: to.Ptr("TestJobName1"), - // Type: to.Ptr("Microsoft.DataBox/jobs"), - // ID: to.Ptr("/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.DataBox/jobs/TestJobName1"), - // Properties: &armdatabox.JobProperties{ - // DeliveryInfo: &armdatabox.JobDeliveryInfo{ - // ScheduledDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "0001-01-01T05:30:00+05:30"); return t}()), - // }, - // DeliveryType: to.Ptr(armdatabox.JobDeliveryTypeNonScheduled), - // IsCancellable: to.Ptr(true), - // IsCancellableWithoutFee: to.Ptr(true), - // IsDeletable: to.Ptr(false), - // IsShippingAddressEditable: to.Ptr(true), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-09-21T14:49:49.0027611+05:30"); return t}()), - // Status: to.Ptr(armdatabox.StageNameDeviceOrdered), - // TransferType: to.Ptr(armdatabox.TransferTypeImportToAzure), - // Details: &armdatabox.JobDetails{ - // ContactDetails: &armdatabox.ContactDetails{ - // ContactName: to.Ptr("XXXX XXXX"), - // EmailList: []*string{ - // to.Ptr("xxxx@xxxx.xxx")}, - // NotificationPreference: []*armdatabox.NotificationPreference{ - // { - // SendNotification: to.Ptr(true), - // StageName: to.Ptr(armdatabox.NotificationStageNameDevicePrepared), - // }, - // { - // SendNotification: to.Ptr(true), - // StageName: to.Ptr(armdatabox.NotificationStageNameDispatched), - // }, - // { - // SendNotification: to.Ptr(true), - // StageName: to.Ptr(armdatabox.NotificationStageNameDelivered), - // }, - // { - // SendNotification: to.Ptr(true), - // StageName: to.Ptr(armdatabox.NotificationStageNamePickedUp), - // }, - // { - // SendNotification: to.Ptr(true), - // StageName: to.Ptr(armdatabox.NotificationStageNameAtAzureDC), - // }, - // { - // SendNotification: to.Ptr(true), - // StageName: to.Ptr(armdatabox.NotificationStageNameDataCopy), - // }}, - // Phone: to.Ptr("0000000000"), - // PhoneExtension: to.Ptr(""), - // }, - // CopyLogDetails: []armdatabox.CopyLogDetailsClassification{ - // }, - // JobDetailsType: to.Ptr(armdatabox.ClassDiscriminatorDataBox), - // JobStages: []*armdatabox.JobStages{ - // { - // DisplayName: to.Ptr("Ordered"), - // StageName: to.Ptr(armdatabox.StageNameDeviceOrdered), - // StageStatus: to.Ptr(armdatabox.StageStatusSucceeded), - // StageTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-09-21T14:49:52.3995743+05:30"); return t}()), - // }, - // { - // DisplayName: to.Ptr("Processed"), - // StageName: to.Ptr(armdatabox.StageNameDevicePrepared), - // StageStatus: to.Ptr(armdatabox.StageStatusNone), - // }, - // { - // DisplayName: to.Ptr("Dispatched"), - // StageName: to.Ptr(armdatabox.StageNameDispatched), - // StageStatus: to.Ptr(armdatabox.StageStatusNone), - // }, - // { - // DisplayName: to.Ptr("Delivered"), - // StageName: to.Ptr(armdatabox.StageNameDelivered), - // StageStatus: to.Ptr(armdatabox.StageStatusNone), - // }, - // { - // DisplayName: to.Ptr("Picked up"), - // StageName: to.Ptr(armdatabox.StageNamePickedUp), - // StageStatus: to.Ptr(armdatabox.StageStatusNone), - // }, - // { - // DisplayName: to.Ptr("Received"), - // StageName: to.Ptr(armdatabox.StageNameAtAzureDC), - // StageStatus: to.Ptr(armdatabox.StageStatusNone), - // }, - // { - // DisplayName: to.Ptr("Data copy in progress"), - // StageName: to.Ptr(armdatabox.StageNameDataCopy), - // StageStatus: to.Ptr(armdatabox.StageStatusNone), - // }, - // { - // DisplayName: to.Ptr("Completed"), - // StageName: to.Ptr(armdatabox.StageNameCompleted), - // StageStatus: to.Ptr(armdatabox.StageStatusNone), - // }}, - // ShippingAddress: &armdatabox.ShippingAddress{ - // AddressType: to.Ptr(armdatabox.AddressTypeCommercial), - // City: to.Ptr("XXXX XXXX"), - // CompanyName: to.Ptr("XXXX XXXX"), - // Country: to.Ptr("XX"), - // PostalCode: to.Ptr("00000"), - // StateOrProvince: to.Ptr("XX"), - // StreetAddress1: to.Ptr("XXXX XXXX"), - // StreetAddress2: to.Ptr("XXXX XXXX"), - // }, - // CopyProgress: []*armdatabox.CopyProgress{ - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/databox/resource-manager/Microsoft.DataBox/stable/2022-12-01/examples/JobsCreateDevicePassword.json -func ExampleJobsClient_BeginCreate_jobsCreateDevicePassword() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdatabox.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewJobsClient().BeginCreate(ctx, "YourResourceGroupName", "TestJobName1", armdatabox.JobResource{ - Location: to.Ptr("westus"), - SKU: &armdatabox.SKU{ - Name: to.Ptr(armdatabox.SKUNameDataBox), - }, - Properties: &armdatabox.JobProperties{ - TransferType: to.Ptr(armdatabox.TransferTypeImportToAzure), - Details: &armdatabox.JobDetails{ - ContactDetails: &armdatabox.ContactDetails{ - ContactName: to.Ptr("XXXX XXXX"), - EmailList: []*string{ - to.Ptr("xxxx@xxxx.xxx")}, - Phone: to.Ptr("0000000000"), - PhoneExtension: to.Ptr(""), - }, - DataImportDetails: []*armdatabox.DataImportDetails{ - { - AccountDetails: &armdatabox.StorageAccountDetails{ - DataAccountType: to.Ptr(armdatabox.DataAccountTypeStorageAccount), - SharePassword: to.Ptr(""), - StorageAccountID: to.Ptr("/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Storage/storageAccounts/YourStorageAccountName"), - }, - }}, - JobDetailsType: to.Ptr(armdatabox.ClassDiscriminatorDataBox), - ShippingAddress: &armdatabox.ShippingAddress{ - AddressType: to.Ptr(armdatabox.AddressTypeCommercial), - City: to.Ptr("XXXX XXXX"), - CompanyName: to.Ptr("XXXX XXXX"), - Country: to.Ptr("XX"), - PostalCode: to.Ptr("00000"), - StateOrProvince: to.Ptr("XX"), - StreetAddress1: to.Ptr("XXXX XXXX"), - StreetAddress2: to.Ptr("XXXX XXXX"), - }, - DevicePassword: to.Ptr(""), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.JobResource = armdatabox.JobResource{ - // Location: to.Ptr("westus"), - // SKU: &armdatabox.SKU{ - // Name: to.Ptr(armdatabox.SKUNameDataBox), - // }, - // Tags: map[string]*string{ - // }, - // Name: to.Ptr("TestJobName1"), - // Type: to.Ptr("Microsoft.DataBox/jobs"), - // ID: to.Ptr("/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.DataBox/jobs/TestJobName1"), - // Properties: &armdatabox.JobProperties{ - // DeliveryInfo: &armdatabox.JobDeliveryInfo{ - // ScheduledDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "0001-01-01T05:30:00+05:30"); return t}()), - // }, - // DeliveryType: to.Ptr(armdatabox.JobDeliveryTypeNonScheduled), - // IsCancellable: to.Ptr(true), - // IsCancellableWithoutFee: to.Ptr(true), - // IsDeletable: to.Ptr(false), - // IsShippingAddressEditable: to.Ptr(true), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-09-21T14:49:49.0027611+05:30"); return t}()), - // Status: to.Ptr(armdatabox.StageNameDeviceOrdered), - // TransferType: to.Ptr(armdatabox.TransferTypeImportToAzure), - // Details: &armdatabox.JobDetails{ - // ContactDetails: &armdatabox.ContactDetails{ - // ContactName: to.Ptr("XXXX XXXX"), - // EmailList: []*string{ - // to.Ptr("xxxx@xxxx.xxx")}, - // NotificationPreference: []*armdatabox.NotificationPreference{ - // { - // SendNotification: to.Ptr(true), - // StageName: to.Ptr(armdatabox.NotificationStageNameDevicePrepared), - // }, - // { - // SendNotification: to.Ptr(true), - // StageName: to.Ptr(armdatabox.NotificationStageNameDispatched), - // }, - // { - // SendNotification: to.Ptr(true), - // StageName: to.Ptr(armdatabox.NotificationStageNameDelivered), - // }, - // { - // SendNotification: to.Ptr(true), - // StageName: to.Ptr(armdatabox.NotificationStageNamePickedUp), - // }, - // { - // SendNotification: to.Ptr(true), - // StageName: to.Ptr(armdatabox.NotificationStageNameAtAzureDC), - // }, - // { - // SendNotification: to.Ptr(true), - // StageName: to.Ptr(armdatabox.NotificationStageNameDataCopy), - // }}, - // Phone: to.Ptr("0000000000"), - // PhoneExtension: to.Ptr(""), - // }, - // CopyLogDetails: []armdatabox.CopyLogDetailsClassification{ - // }, - // JobDetailsType: to.Ptr(armdatabox.ClassDiscriminatorDataBox), - // JobStages: []*armdatabox.JobStages{ - // { - // DisplayName: to.Ptr("Ordered"), - // StageName: to.Ptr(armdatabox.StageNameDeviceOrdered), - // StageStatus: to.Ptr(armdatabox.StageStatusSucceeded), - // StageTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-09-21T14:49:52.3995743+05:30"); return t}()), - // }, - // { - // DisplayName: to.Ptr("Processed"), - // StageName: to.Ptr(armdatabox.StageNameDevicePrepared), - // StageStatus: to.Ptr(armdatabox.StageStatusNone), - // }, - // { - // DisplayName: to.Ptr("Dispatched"), - // StageName: to.Ptr(armdatabox.StageNameDispatched), - // StageStatus: to.Ptr(armdatabox.StageStatusNone), - // }, - // { - // DisplayName: to.Ptr("Delivered"), - // StageName: to.Ptr(armdatabox.StageNameDelivered), - // StageStatus: to.Ptr(armdatabox.StageStatusNone), - // }, - // { - // DisplayName: to.Ptr("Picked up"), - // StageName: to.Ptr(armdatabox.StageNamePickedUp), - // StageStatus: to.Ptr(armdatabox.StageStatusNone), - // }, - // { - // DisplayName: to.Ptr("Received"), - // StageName: to.Ptr(armdatabox.StageNameAtAzureDC), - // StageStatus: to.Ptr(armdatabox.StageStatusNone), - // }, - // { - // DisplayName: to.Ptr("Data copy in progress"), - // StageName: to.Ptr(armdatabox.StageNameDataCopy), - // StageStatus: to.Ptr(armdatabox.StageStatusNone), - // }, - // { - // DisplayName: to.Ptr("Completed"), - // StageName: to.Ptr(armdatabox.StageNameCompleted), - // StageStatus: to.Ptr(armdatabox.StageStatusNone), - // }}, - // ShippingAddress: &armdatabox.ShippingAddress{ - // AddressType: to.Ptr(armdatabox.AddressTypeCommercial), - // City: to.Ptr("XXXX XXXX"), - // CompanyName: to.Ptr("XXXX XXXX"), - // Country: to.Ptr("XX"), - // PostalCode: to.Ptr("00000"), - // StateOrProvince: to.Ptr("XX"), - // StreetAddress1: to.Ptr("XXXX XXXX"), - // StreetAddress2: to.Ptr("XXXX XXXX"), - // }, - // CopyProgress: []*armdatabox.CopyProgress{ - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/databox/resource-manager/Microsoft.DataBox/stable/2022-12-01/examples/JobsCreateDoubleEncryption.json -func ExampleJobsClient_BeginCreate_jobsCreateDoubleEncryption() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdatabox.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewJobsClient().BeginCreate(ctx, "YourResourceGroupName", "TestJobName1", armdatabox.JobResource{ - Location: to.Ptr("westus"), - SKU: &armdatabox.SKU{ - Name: to.Ptr(armdatabox.SKUNameDataBox), - }, - Properties: &armdatabox.JobProperties{ - TransferType: to.Ptr(armdatabox.TransferTypeImportToAzure), - Details: &armdatabox.JobDetails{ - ContactDetails: &armdatabox.ContactDetails{ - ContactName: to.Ptr("XXXX XXXX"), - EmailList: []*string{ - to.Ptr("xxxx@xxxx.xxx")}, - Phone: to.Ptr("0000000000"), - PhoneExtension: to.Ptr(""), - }, - DataImportDetails: []*armdatabox.DataImportDetails{ - { - AccountDetails: &armdatabox.StorageAccountDetails{ - DataAccountType: to.Ptr(armdatabox.DataAccountTypeStorageAccount), - StorageAccountID: to.Ptr("/subscriptions/YourSubscriptionId/resourcegroups/YourResourceGroupName/providers/Microsoft.Storage/storageAccounts/YourStorageAccountName"), - }, - }}, - JobDetailsType: to.Ptr(armdatabox.ClassDiscriminatorDataBox), - Preferences: &armdatabox.Preferences{ - EncryptionPreferences: &armdatabox.EncryptionPreferences{ - DoubleEncryption: to.Ptr(armdatabox.DoubleEncryptionEnabled), - }, - }, - ShippingAddress: &armdatabox.ShippingAddress{ - AddressType: to.Ptr(armdatabox.AddressTypeCommercial), - City: to.Ptr("XXXX XXXX"), - CompanyName: to.Ptr("XXXX XXXX"), - Country: to.Ptr("XX"), - PostalCode: to.Ptr("00000"), - StateOrProvince: to.Ptr("XX"), - StreetAddress1: to.Ptr("XXXX XXXX"), - StreetAddress2: to.Ptr("XXXX XXXX"), - }, - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.JobResource = armdatabox.JobResource{ - // Location: to.Ptr("westus"), - // SKU: &armdatabox.SKU{ - // Name: to.Ptr(armdatabox.SKUNameDataBox), - // }, - // Tags: map[string]*string{ - // }, - // Name: to.Ptr("TestJobName1"), - // Type: to.Ptr("Microsoft.DataBox/jobs"), - // ID: to.Ptr("/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.DataBox/jobs/TestJobName1"), - // Properties: &armdatabox.JobProperties{ - // DeliveryInfo: &armdatabox.JobDeliveryInfo{ - // ScheduledDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "0001-01-01T05:30:00+05:30"); return t}()), - // }, - // DeliveryType: to.Ptr(armdatabox.JobDeliveryTypeNonScheduled), - // IsCancellable: to.Ptr(true), - // IsCancellableWithoutFee: to.Ptr(true), - // IsDeletable: to.Ptr(false), - // IsShippingAddressEditable: to.Ptr(true), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-09-21T14:49:49.0027611+05:30"); return t}()), - // Status: to.Ptr(armdatabox.StageNameDeviceOrdered), - // TransferType: to.Ptr(armdatabox.TransferTypeExportFromAzure), - // Details: &armdatabox.JobDetails{ - // ContactDetails: &armdatabox.ContactDetails{ - // ContactName: to.Ptr("XXXX XXXX"), - // EmailList: []*string{ - // to.Ptr("xxxx@xxxx.xxx")}, - // NotificationPreference: []*armdatabox.NotificationPreference{ - // { - // SendNotification: to.Ptr(true), - // StageName: to.Ptr(armdatabox.NotificationStageNameDevicePrepared), - // }, - // { - // SendNotification: to.Ptr(true), - // StageName: to.Ptr(armdatabox.NotificationStageNameDataCopy), - // }, - // { - // SendNotification: to.Ptr(true), - // StageName: to.Ptr(armdatabox.NotificationStageNameDispatched), - // }, - // { - // SendNotification: to.Ptr(true), - // StageName: to.Ptr(armdatabox.NotificationStageNameDelivered), - // }, - // { - // SendNotification: to.Ptr(true), - // StageName: to.Ptr(armdatabox.NotificationStageNamePickedUp), - // }, - // { - // SendNotification: to.Ptr(true), - // StageName: to.Ptr(armdatabox.NotificationStageNameAtAzureDC), - // }}, - // Phone: to.Ptr("0000000000"), - // PhoneExtension: to.Ptr(""), - // }, - // CopyLogDetails: []armdatabox.CopyLogDetailsClassification{ - // }, - // JobDetailsType: to.Ptr(armdatabox.ClassDiscriminatorDataBox), - // JobStages: []*armdatabox.JobStages{ - // { - // DisplayName: to.Ptr("Ordered"), - // StageName: to.Ptr(armdatabox.StageNameDeviceOrdered), - // StageStatus: to.Ptr(armdatabox.StageStatusSucceeded), - // StageTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-09-21T14:49:52.3995743+05:30"); return t}()), - // }, - // { - // DisplayName: to.Ptr("Processed"), - // StageName: to.Ptr(armdatabox.StageNameDevicePrepared), - // StageStatus: to.Ptr(armdatabox.StageStatusNone), - // }, - // { - // DisplayName: to.Ptr("Data copy in progress"), - // StageName: to.Ptr(armdatabox.StageNameDataCopy), - // StageStatus: to.Ptr(armdatabox.StageStatusNone), - // }, - // { - // DisplayName: to.Ptr("Dispatched"), - // StageName: to.Ptr(armdatabox.StageNameDispatched), - // StageStatus: to.Ptr(armdatabox.StageStatusNone), - // }, - // { - // DisplayName: to.Ptr("Delivered"), - // StageName: to.Ptr(armdatabox.StageNameDelivered), - // StageStatus: to.Ptr(armdatabox.StageStatusNone), - // }, - // { - // DisplayName: to.Ptr("Picked up"), - // StageName: to.Ptr(armdatabox.StageNamePickedUp), - // StageStatus: to.Ptr(armdatabox.StageStatusNone), - // }, - // { - // DisplayName: to.Ptr("Received"), - // StageName: to.Ptr(armdatabox.StageNameAtAzureDC), - // StageStatus: to.Ptr(armdatabox.StageStatusNone), - // }, - // { - // DisplayName: to.Ptr("Completed"), - // StageName: to.Ptr(armdatabox.StageNameCompleted), - // StageStatus: to.Ptr(armdatabox.StageStatusNone), - // }}, - // ShippingAddress: &armdatabox.ShippingAddress{ - // AddressType: to.Ptr(armdatabox.AddressTypeCommercial), - // City: to.Ptr("XXXX XXXX"), - // CompanyName: to.Ptr("XXXX XXXX"), - // Country: to.Ptr("XX"), - // PostalCode: to.Ptr("00000"), - // StateOrProvince: to.Ptr("XX"), - // StreetAddress1: to.Ptr("XXXX XXXX"), - // StreetAddress2: to.Ptr("XXXX XXXX"), - // }, - // CopyProgress: []*armdatabox.CopyProgress{ - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/databox/resource-manager/Microsoft.DataBox/stable/2022-12-01/examples/JobsCreateExport.json -func ExampleJobsClient_BeginCreate_jobsCreateExport() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdatabox.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewJobsClient().BeginCreate(ctx, "YourResourceGroupName", "TestJobName1", armdatabox.JobResource{ - Location: to.Ptr("westus"), - SKU: &armdatabox.SKU{ - Name: to.Ptr(armdatabox.SKUNameDataBox), - }, - Properties: &armdatabox.JobProperties{ - TransferType: to.Ptr(armdatabox.TransferTypeExportFromAzure), - Details: &armdatabox.JobDetails{ - ContactDetails: &armdatabox.ContactDetails{ - ContactName: to.Ptr("XXXX XXXX"), - EmailList: []*string{ - to.Ptr("xxxx@xxxx.xxx")}, - Phone: to.Ptr("0000000000"), - PhoneExtension: to.Ptr(""), - }, - DataExportDetails: []*armdatabox.DataExportDetails{ - { - AccountDetails: &armdatabox.StorageAccountDetails{ - DataAccountType: to.Ptr(armdatabox.DataAccountTypeStorageAccount), - StorageAccountID: to.Ptr("/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Storage/storageAccounts/YourStorageAccountName"), - }, - TransferConfiguration: &armdatabox.TransferConfiguration{ - TransferAllDetails: &armdatabox.TransferConfigurationTransferAllDetails{ - Include: &armdatabox.TransferAllDetails{ - DataAccountType: to.Ptr(armdatabox.DataAccountTypeStorageAccount), - TransferAllBlobs: to.Ptr(true), - TransferAllFiles: to.Ptr(true), - }, - }, - TransferConfigurationType: to.Ptr(armdatabox.TransferConfigurationTypeTransferAll), - }, - }}, - JobDetailsType: to.Ptr(armdatabox.ClassDiscriminatorDataBox), - ShippingAddress: &armdatabox.ShippingAddress{ - AddressType: to.Ptr(armdatabox.AddressTypeCommercial), - City: to.Ptr("XXXX XXXX"), - CompanyName: to.Ptr("XXXX XXXX"), - Country: to.Ptr("XX"), - PostalCode: to.Ptr("00000"), - StateOrProvince: to.Ptr("XX"), - StreetAddress1: to.Ptr("XXXX XXXX"), - StreetAddress2: to.Ptr("XXXX XXXX"), - }, - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.JobResource = armdatabox.JobResource{ - // Location: to.Ptr("westus"), - // SKU: &armdatabox.SKU{ - // Name: to.Ptr(armdatabox.SKUNameDataBox), - // }, - // Tags: map[string]*string{ - // }, - // Name: to.Ptr("TestJobName1"), - // Type: to.Ptr("Microsoft.DataBox/jobs"), - // ID: to.Ptr("/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.DataBox/jobs/TestJobName1"), - // Properties: &armdatabox.JobProperties{ - // DeliveryInfo: &armdatabox.JobDeliveryInfo{ - // ScheduledDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "0001-01-01T05:30:00+05:30"); return t}()), - // }, - // DeliveryType: to.Ptr(armdatabox.JobDeliveryTypeNonScheduled), - // IsCancellable: to.Ptr(true), - // IsCancellableWithoutFee: to.Ptr(true), - // IsDeletable: to.Ptr(false), - // IsShippingAddressEditable: to.Ptr(true), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-09-21T14:49:49.0027611+05:30"); return t}()), - // Status: to.Ptr(armdatabox.StageNameDeviceOrdered), - // TransferType: to.Ptr(armdatabox.TransferTypeExportFromAzure), - // Details: &armdatabox.JobDetails{ - // ContactDetails: &armdatabox.ContactDetails{ - // ContactName: to.Ptr("XXXX XXXX"), - // EmailList: []*string{ - // to.Ptr("xxxx@xxxx.xxx")}, - // NotificationPreference: []*armdatabox.NotificationPreference{ - // { - // SendNotification: to.Ptr(true), - // StageName: to.Ptr(armdatabox.NotificationStageNameDevicePrepared), - // }, - // { - // SendNotification: to.Ptr(true), - // StageName: to.Ptr(armdatabox.NotificationStageNameDataCopy), - // }, - // { - // SendNotification: to.Ptr(true), - // StageName: to.Ptr(armdatabox.NotificationStageNameDispatched), - // }, - // { - // SendNotification: to.Ptr(true), - // StageName: to.Ptr(armdatabox.NotificationStageNameDelivered), - // }, - // { - // SendNotification: to.Ptr(true), - // StageName: to.Ptr(armdatabox.NotificationStageNamePickedUp), - // }, - // { - // SendNotification: to.Ptr(true), - // StageName: to.Ptr(armdatabox.NotificationStageNameAtAzureDC), - // }}, - // Phone: to.Ptr("0000000000"), - // PhoneExtension: to.Ptr(""), - // }, - // CopyLogDetails: []armdatabox.CopyLogDetailsClassification{ - // }, - // JobDetailsType: to.Ptr(armdatabox.ClassDiscriminatorDataBox), - // JobStages: []*armdatabox.JobStages{ - // { - // DisplayName: to.Ptr("Ordered"), - // StageName: to.Ptr(armdatabox.StageNameDeviceOrdered), - // StageStatus: to.Ptr(armdatabox.StageStatusSucceeded), - // StageTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-09-21T14:49:52.3995743+05:30"); return t}()), - // }, - // { - // DisplayName: to.Ptr("Processed"), - // StageName: to.Ptr(armdatabox.StageNameDevicePrepared), - // StageStatus: to.Ptr(armdatabox.StageStatusNone), - // }, - // { - // DisplayName: to.Ptr("Data copy in progress"), - // StageName: to.Ptr(armdatabox.StageNameDataCopy), - // StageStatus: to.Ptr(armdatabox.StageStatusNone), - // }, - // { - // DisplayName: to.Ptr("Dispatched"), - // StageName: to.Ptr(armdatabox.StageNameDispatched), - // StageStatus: to.Ptr(armdatabox.StageStatusNone), - // }, - // { - // DisplayName: to.Ptr("Delivered"), - // StageName: to.Ptr(armdatabox.StageNameDelivered), - // StageStatus: to.Ptr(armdatabox.StageStatusNone), - // }, - // { - // DisplayName: to.Ptr("Picked up"), - // StageName: to.Ptr(armdatabox.StageNamePickedUp), - // StageStatus: to.Ptr(armdatabox.StageStatusNone), - // }, - // { - // DisplayName: to.Ptr("Received"), - // StageName: to.Ptr(armdatabox.StageNameAtAzureDC), - // StageStatus: to.Ptr(armdatabox.StageStatusNone), - // }, - // { - // DisplayName: to.Ptr("Completed"), - // StageName: to.Ptr(armdatabox.StageNameCompleted), - // StageStatus: to.Ptr(armdatabox.StageStatusNone), - // }}, - // ShippingAddress: &armdatabox.ShippingAddress{ - // AddressType: to.Ptr(armdatabox.AddressTypeCommercial), - // City: to.Ptr("XXXX XXXX"), - // CompanyName: to.Ptr("XXXX XXXX"), - // Country: to.Ptr("XX"), - // PostalCode: to.Ptr("00000"), - // StateOrProvince: to.Ptr("XX"), - // StreetAddress1: to.Ptr("XXXX XXXX"), - // StreetAddress2: to.Ptr("XXXX XXXX"), - // }, - // CopyProgress: []*armdatabox.CopyProgress{ - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/databox/resource-manager/Microsoft.DataBox/stable/2022-12-01/examples/JobsCreateWithUserAssignedIdentity.json -func ExampleJobsClient_BeginCreate_jobsCreateWithUserAssignedIdentity() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdatabox.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewJobsClient().BeginCreate(ctx, "YourResourceGroupName", "TestJobName1", armdatabox.JobResource{ - Identity: &armdatabox.ResourceIdentity{ - Type: to.Ptr("UserAssigned"), - UserAssignedIdentities: map[string]*armdatabox.UserAssignedIdentity{ - "/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testIdentity": {}, - }, - }, - Location: to.Ptr("westus"), - SKU: &armdatabox.SKU{ - Name: to.Ptr(armdatabox.SKUNameDataBox), - }, - Properties: &armdatabox.JobProperties{ - TransferType: to.Ptr(armdatabox.TransferTypeImportToAzure), - Details: &armdatabox.JobDetails{ - ContactDetails: &armdatabox.ContactDetails{ - ContactName: to.Ptr("XXXX XXXX"), - EmailList: []*string{ - to.Ptr("xxxx@xxxx.xxx")}, - Phone: to.Ptr("0000000000"), - PhoneExtension: to.Ptr(""), - }, - DataImportDetails: []*armdatabox.DataImportDetails{ - { - AccountDetails: &armdatabox.StorageAccountDetails{ - DataAccountType: to.Ptr(armdatabox.DataAccountTypeStorageAccount), - StorageAccountID: to.Ptr("/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Storage/storageAccounts/YourStorageAccountName"), - }, - }}, - JobDetailsType: to.Ptr(armdatabox.ClassDiscriminatorDataBox), - ShippingAddress: &armdatabox.ShippingAddress{ - AddressType: to.Ptr(armdatabox.AddressTypeCommercial), - City: to.Ptr("XXXX XXXX"), - CompanyName: to.Ptr("XXXX XXXX"), - Country: to.Ptr("XX"), - PostalCode: to.Ptr("00000"), - StateOrProvince: to.Ptr("XX"), - StreetAddress1: to.Ptr("XXXX XXXX"), - StreetAddress2: to.Ptr("XXXX XXXX"), - }, - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.JobResource = armdatabox.JobResource{ - // Location: to.Ptr("westus"), - // SKU: &armdatabox.SKU{ - // Name: to.Ptr(armdatabox.SKUNameDataBox), - // }, - // Tags: map[string]*string{ - // }, - // Name: to.Ptr("TestJobName1"), - // Type: to.Ptr("Microsoft.DataBox/jobs"), - // ID: to.Ptr("/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.DataBox/jobs/TestJobName1"), - // Properties: &armdatabox.JobProperties{ - // DeliveryInfo: &armdatabox.JobDeliveryInfo{ - // ScheduledDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "0001-01-01T05:30:00+05:30"); return t}()), - // }, - // DeliveryType: to.Ptr(armdatabox.JobDeliveryTypeNonScheduled), - // IsCancellable: to.Ptr(true), - // IsCancellableWithoutFee: to.Ptr(true), - // IsDeletable: to.Ptr(false), - // IsShippingAddressEditable: to.Ptr(true), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-09-21T14:49:49.0027611+05:30"); return t}()), - // Status: to.Ptr(armdatabox.StageNameDeviceOrdered), - // TransferType: to.Ptr(armdatabox.TransferTypeExportFromAzure), - // Details: &armdatabox.JobDetails{ - // ContactDetails: &armdatabox.ContactDetails{ - // ContactName: to.Ptr("XXXX XXXX"), - // EmailList: []*string{ - // to.Ptr("xxxx@xxxx.xxx")}, - // NotificationPreference: []*armdatabox.NotificationPreference{ - // { - // SendNotification: to.Ptr(true), - // StageName: to.Ptr(armdatabox.NotificationStageNameDevicePrepared), - // }, - // { - // SendNotification: to.Ptr(true), - // StageName: to.Ptr(armdatabox.NotificationStageNameDataCopy), - // }, - // { - // SendNotification: to.Ptr(true), - // StageName: to.Ptr(armdatabox.NotificationStageNameDispatched), - // }, - // { - // SendNotification: to.Ptr(true), - // StageName: to.Ptr(armdatabox.NotificationStageNameDelivered), - // }, - // { - // SendNotification: to.Ptr(true), - // StageName: to.Ptr(armdatabox.NotificationStageNamePickedUp), - // }, - // { - // SendNotification: to.Ptr(true), - // StageName: to.Ptr(armdatabox.NotificationStageNameAtAzureDC), - // }}, - // Phone: to.Ptr("0000000000"), - // PhoneExtension: to.Ptr(""), - // }, - // CopyLogDetails: []armdatabox.CopyLogDetailsClassification{ - // }, - // JobDetailsType: to.Ptr(armdatabox.ClassDiscriminatorDataBox), - // JobStages: []*armdatabox.JobStages{ - // { - // DisplayName: to.Ptr("Ordered"), - // StageName: to.Ptr(armdatabox.StageNameDeviceOrdered), - // StageStatus: to.Ptr(armdatabox.StageStatusSucceeded), - // StageTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-09-21T14:49:52.3995743+05:30"); return t}()), - // }, - // { - // DisplayName: to.Ptr("Processed"), - // StageName: to.Ptr(armdatabox.StageNameDevicePrepared), - // StageStatus: to.Ptr(armdatabox.StageStatusNone), - // }, - // { - // DisplayName: to.Ptr("Data copy in progress"), - // StageName: to.Ptr(armdatabox.StageNameDataCopy), - // StageStatus: to.Ptr(armdatabox.StageStatusNone), - // }, - // { - // DisplayName: to.Ptr("Dispatched"), - // StageName: to.Ptr(armdatabox.StageNameDispatched), - // StageStatus: to.Ptr(armdatabox.StageStatusNone), - // }, - // { - // DisplayName: to.Ptr("Delivered"), - // StageName: to.Ptr(armdatabox.StageNameDelivered), - // StageStatus: to.Ptr(armdatabox.StageStatusNone), - // }, - // { - // DisplayName: to.Ptr("Picked up"), - // StageName: to.Ptr(armdatabox.StageNamePickedUp), - // StageStatus: to.Ptr(armdatabox.StageStatusNone), - // }, - // { - // DisplayName: to.Ptr("Received"), - // StageName: to.Ptr(armdatabox.StageNameAtAzureDC), - // StageStatus: to.Ptr(armdatabox.StageStatusNone), - // }, - // { - // DisplayName: to.Ptr("Completed"), - // StageName: to.Ptr(armdatabox.StageNameCompleted), - // StageStatus: to.Ptr(armdatabox.StageStatusNone), - // }}, - // ShippingAddress: &armdatabox.ShippingAddress{ - // AddressType: to.Ptr(armdatabox.AddressTypeCommercial), - // City: to.Ptr("XXXX XXXX"), - // CompanyName: to.Ptr("XXXX XXXX"), - // Country: to.Ptr("XX"), - // PostalCode: to.Ptr("00000"), - // StateOrProvince: to.Ptr("XX"), - // StreetAddress1: to.Ptr("XXXX XXXX"), - // StreetAddress2: to.Ptr("XXXX XXXX"), - // }, - // CopyProgress: []*armdatabox.CopyProgress{ - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/databox/resource-manager/Microsoft.DataBox/stable/2022-12-01/examples/JobsDelete.json -func ExampleJobsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdatabox.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewJobsClient().BeginDelete(ctx, "YourResourceGroupName", "TestJobName1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/databox/resource-manager/Microsoft.DataBox/stable/2022-12-01/examples/JobsPatch.json -func ExampleJobsClient_BeginUpdate_jobsPatch() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdatabox.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewJobsClient().BeginUpdate(ctx, "YourResourceGroupName", "TestJobName1", armdatabox.JobResourceUpdateParameter{ - Properties: &armdatabox.UpdateJobProperties{ - Details: &armdatabox.UpdateJobDetails{ - ContactDetails: &armdatabox.ContactDetails{ - ContactName: to.Ptr("XXXX XXXX"), - EmailList: []*string{ - to.Ptr("xxxx@xxxx.xxx")}, - Phone: to.Ptr("0000000000"), - PhoneExtension: to.Ptr(""), - }, - ShippingAddress: &armdatabox.ShippingAddress{ - AddressType: to.Ptr(armdatabox.AddressTypeCommercial), - City: to.Ptr("XXXX XXXX"), - CompanyName: to.Ptr("XXXX XXXX"), - Country: to.Ptr("XX"), - PostalCode: to.Ptr("00000"), - StateOrProvince: to.Ptr("XX"), - StreetAddress1: to.Ptr("XXXX XXXX"), - StreetAddress2: to.Ptr("XXXX XXXX"), - }, - }, - }, - }, &armdatabox.JobsClientBeginUpdateOptions{IfMatch: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.JobResource = armdatabox.JobResource{ - // Location: to.Ptr("westus"), - // SKU: &armdatabox.SKU{ - // Name: to.Ptr(armdatabox.SKUNameDataBox), - // }, - // Tags: map[string]*string{ - // }, - // Name: to.Ptr("TestJobName1"), - // Type: to.Ptr("Microsoft.DataBox/jobs"), - // ID: to.Ptr("/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.DataBox/jobs/TestJobName1"), - // Properties: &armdatabox.JobProperties{ - // IsCancellable: to.Ptr(true), - // IsShippingAddressEditable: to.Ptr(true), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-04-13T16:28:38.9999793+05:30"); return t}()), - // Status: to.Ptr(armdatabox.StageNameDeviceOrdered), - // TransferType: to.Ptr(armdatabox.TransferTypeImportToAzure), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/databox/resource-manager/Microsoft.DataBox/stable/2022-12-01/examples/JobsPatchCmk.json -func ExampleJobsClient_BeginUpdate_jobsPatchCmk() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdatabox.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewJobsClient().BeginUpdate(ctx, "YourResourceGroupName", "TestJobName1", armdatabox.JobResourceUpdateParameter{ - Properties: &armdatabox.UpdateJobProperties{ - Details: &armdatabox.UpdateJobDetails{ - KeyEncryptionKey: &armdatabox.KeyEncryptionKey{ - KekType: to.Ptr(armdatabox.KekTypeCustomerManaged), - KekURL: to.Ptr("https://xxx.xxx.xx"), - KekVaultResourceID: to.Ptr("/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.KeyVault/vaults/YourKeyVaultName"), - }, - }, - }, - }, &armdatabox.JobsClientBeginUpdateOptions{IfMatch: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.JobResource = armdatabox.JobResource{ - // Location: to.Ptr("westus"), - // SKU: &armdatabox.SKU{ - // Name: to.Ptr(armdatabox.SKUNameDataBox), - // }, - // Tags: map[string]*string{ - // }, - // Name: to.Ptr("TestJobName1"), - // Type: to.Ptr("Microsoft.DataBox/jobs"), - // ID: to.Ptr("/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.DataBox/jobs/TestJobName1"), - // Properties: &armdatabox.JobProperties{ - // IsCancellable: to.Ptr(true), - // IsShippingAddressEditable: to.Ptr(true), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-04-13T16:28:38.9999793+05:30"); return t}()), - // Status: to.Ptr(armdatabox.StageNameDeviceOrdered), - // TransferType: to.Ptr(armdatabox.TransferTypeImportToAzure), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/databox/resource-manager/Microsoft.DataBox/stable/2022-12-01/examples/JobsPatchSystemAssignedToUserAssigned.json -func ExampleJobsClient_BeginUpdate_jobsPatchSystemAssignedToUserAssigned() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdatabox.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewJobsClient().BeginUpdate(ctx, "YourResourceGroupName", "TestJobName1", armdatabox.JobResourceUpdateParameter{ - Identity: &armdatabox.ResourceIdentity{ - Type: to.Ptr("SystemAssigned,UserAssigned"), - UserAssignedIdentities: map[string]*armdatabox.UserAssignedIdentity{ - "/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testIdentity": {}, - }, - }, - Properties: &armdatabox.UpdateJobProperties{ - Details: &armdatabox.UpdateJobDetails{ - KeyEncryptionKey: &armdatabox.KeyEncryptionKey{ - IdentityProperties: &armdatabox.IdentityProperties{ - Type: to.Ptr("UserAssigned"), - UserAssigned: &armdatabox.UserAssignedProperties{ - ResourceID: to.Ptr("/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testIdentity"), - }, - }, - KekType: to.Ptr(armdatabox.KekTypeCustomerManaged), - KekURL: to.Ptr("https://xxx.xxx.xx"), - KekVaultResourceID: to.Ptr("/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.KeyVault/vaults/YourKeyVaultName"), - }, - }, - }, - }, &armdatabox.JobsClientBeginUpdateOptions{IfMatch: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.JobResource = armdatabox.JobResource{ - // Location: to.Ptr("westus"), - // SKU: &armdatabox.SKU{ - // Name: to.Ptr(armdatabox.SKUNameDataBox), - // }, - // Tags: map[string]*string{ - // }, - // Name: to.Ptr("TestJobName1"), - // Type: to.Ptr("Microsoft.DataBox/jobs"), - // ID: to.Ptr("/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.DataBox/jobs/TestJobName1"), - // Properties: &armdatabox.JobProperties{ - // IsCancellable: to.Ptr(true), - // IsShippingAddressEditable: to.Ptr(true), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-04-13T16:28:38.9999793+05:30"); return t}()), - // Status: to.Ptr(armdatabox.StageNameDeviceOrdered), - // TransferType: to.Ptr(armdatabox.TransferTypeImportToAzure), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/databox/resource-manager/Microsoft.DataBox/stable/2022-12-01/examples/BookShipmentPickupPost.json -func ExampleJobsClient_BookShipmentPickUp() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdatabox.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewJobsClient().BookShipmentPickUp(ctx, "YourResourceGroupName", "TestJobName1", armdatabox.ShipmentPickUpRequest{ - EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-09-22T18:30:00Z"); return t }()), - ShipmentLocation: to.Ptr("Front desk"), - StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-09-20T18:30:00Z"); return t }()), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ShipmentPickUpResponse = armdatabox.ShipmentPickUpResponse{ - // ConfirmationNumber: to.Ptr("XXXXXXXXXXX"), - // ReadyByTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-09-20T18:30:00Z"); return t}()), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/databox/resource-manager/Microsoft.DataBox/stable/2022-12-01/examples/JobsCancelPost.json -func ExampleJobsClient_Cancel() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdatabox.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewJobsClient().Cancel(ctx, "YourResourceGroupName", "TestJobName1", armdatabox.CancellationReason{ - Reason: to.Ptr("CancelTest"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/databox/resource-manager/Microsoft.DataBox/stable/2022-12-01/examples/JobsListCredentials.json -func ExampleJobsClient_NewListCredentialsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdatabox.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewJobsClient().NewListCredentialsPager("YourResourceGroupName", "TestJobName1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.UnencryptedCredentialsList = armdatabox.UnencryptedCredentialsList{ - // Value: []*armdatabox.UnencryptedCredentials{ - // { - // JobName: to.Ptr("TestJobName1"), - // JobSecrets: &armdatabox.JobSecrets{ - // DcAccessSecurityCode: &armdatabox.DcAccessSecurityCode{ - // }, - // JobSecretsType: to.Ptr(armdatabox.ClassDiscriminatorDataBox), - // PodSecrets: []*armdatabox.Secret{ - // { - // AccountCredentialDetails: []*armdatabox.AccountCredentialDetails{ - // { - // AccountConnectionString: to.Ptr(""), - // AccountName: to.Ptr("YourStorageAccountName"), - // DataAccountType: to.Ptr(armdatabox.DataAccountTypeStorageAccount), - // ShareCredentialDetails: []*armdatabox.ShareCredentialDetails{ - // { - // Password: to.Ptr(""), - // ShareName: to.Ptr("testsharename_PageBlob"), - // ShareType: to.Ptr(armdatabox.ShareDestinationFormatTypePageBlob), - // SupportedAccessProtocols: []*armdatabox.AccessProtocol{ - // to.Ptr(armdatabox.AccessProtocolSMB)}, - // UserName: to.Ptr("testusername"), - // }, - // { - // Password: to.Ptr(""), - // ShareName: to.Ptr("testsharename_BlockBlob"), - // ShareType: to.Ptr(armdatabox.ShareDestinationFormatTypeBlockBlob), - // SupportedAccessProtocols: []*armdatabox.AccessProtocol{ - // to.Ptr(armdatabox.AccessProtocolSMB)}, - // UserName: to.Ptr("testusername"), - // }, - // { - // Password: to.Ptr(""), - // ShareName: to.Ptr("testsharename_AzFile"), - // ShareType: to.Ptr(armdatabox.ShareDestinationFormatTypeAzureFile), - // SupportedAccessProtocols: []*armdatabox.AccessProtocol{ - // to.Ptr(armdatabox.AccessProtocolSMB)}, - // UserName: to.Ptr("testusername"), - // }}, - // }}, - // DevicePassword: to.Ptr(""), - // DeviceSerialNumber: to.Ptr("testserialnumber"), - // EncodedValidationCertPubKey: to.Ptr("xxxxxxxxxx"), - // NetworkConfigurations: []*armdatabox.ApplianceNetworkConfiguration{ - // { - // Name: to.Ptr("DataPort3"), - // MacAddress: to.Ptr("XXXXXXXXXXXX"), - // }, - // { - // Name: to.Ptr("DataPort1"), - // MacAddress: to.Ptr("XXXXXXXXXXXX"), - // }, - // { - // Name: to.Ptr("DataPort2"), - // MacAddress: to.Ptr("XXXXXXXXXXXX"), - // }}, - // }}, - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/databox/armdatabox/management_client.go b/sdk/resourcemanager/databox/armdatabox/management_client.go index 0e655cd95a85..2e869f9d5a4a 100644 --- a/sdk/resourcemanager/databox/armdatabox/management_client.go +++ b/sdk/resourcemanager/databox/armdatabox/management_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armdatabox @@ -47,23 +46,25 @@ func NewManagementClient(subscriptionID string, credential azcore.TokenCredentia // Mitigate - Request to mitigate for a given job // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-01 +// Generated from API version 2023-03-01 // - 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) { + var err error req, err := client.mitigateCreateRequest(ctx, jobName, resourceGroupName, mitigateJobRequest, options) if err != nil { return ManagementClientMitigateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ManagementClientMitigateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusNoContent) { - return ManagementClientMitigateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return ManagementClientMitigateResponse{}, err } return ManagementClientMitigateResponse{}, nil } @@ -88,8 +89,11 @@ func (client *ManagementClient) mitigateCreateRequest(ctx context.Context, jobNa return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-01") + reqQP.Set("api-version", "2023-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, mitigateJobRequest) + if err := runtime.MarshalAsJSON(req, mitigateJobRequest); err != nil { + return nil, err + } + return req, nil } diff --git a/sdk/resourcemanager/databox/armdatabox/management_client_example_test.go b/sdk/resourcemanager/databox/armdatabox/management_client_example_test.go deleted file mode 100644 index 1a2eb802c1fd..000000000000 --- a/sdk/resourcemanager/databox/armdatabox/management_client_example_test.go +++ /dev/null @@ -1,41 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armdatabox_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/databox/armdatabox/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/databox/resource-manager/Microsoft.DataBox/stable/2022-12-01/examples/JobMitigate.json -func ExampleManagementClient_Mitigate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdatabox.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewManagementClient().Mitigate(ctx, "TestJobName1", "YourResourceGroupName", armdatabox.MitigateJobRequest{ - SerialNumberCustomerResolutionMap: map[string]*armdatabox.CustomerResolutionCode{ - "testDISK-1": to.Ptr(armdatabox.CustomerResolutionCodeMoveToCleanUpDevice), - "testDISK-2": to.Ptr(armdatabox.CustomerResolutionCodeResume), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/databox/armdatabox/models.go b/sdk/resourcemanager/databox/armdatabox/models.go index 10d24e9c3070..7f13b3e22291 100644 --- a/sdk/resourcemanager/databox/armdatabox/models.go +++ b/sdk/resourcemanager/databox/armdatabox/models.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armdatabox @@ -86,8 +85,8 @@ type AddressValidationProperties struct { // GetValidationInputResponse implements the ValidationInputResponseClassification interface for type AddressValidationProperties. func (a *AddressValidationProperties) GetValidationInputResponse() *ValidationInputResponse { return &ValidationInputResponse{ - ValidationType: a.ValidationType, Error: a.Error, + ValidationType: a.ValidationType, } } @@ -184,15 +183,6 @@ type CloudError struct { Details []*CloudError } -// CommonJobDetailsClassification provides polymorphic access to related types. -// Call the interface's GetCommonJobDetails() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *CommonJobDetails, *CustomerDiskJobDetails, *DiskJobDetails, *HeavyJobDetails, *JobDetails -type CommonJobDetailsClassification interface { - // GetCommonJobDetails returns the CommonJobDetails content of the underlying type. - GetCommonJobDetails() *CommonJobDetails -} - // CommonJobDetails - Job details. type CommonJobDetails struct { // REQUIRED; Contact details for notification and shipping. @@ -259,15 +249,6 @@ type CommonJobDetails struct { // GetCommonJobDetails implements the CommonJobDetailsClassification interface for type CommonJobDetails. func (c *CommonJobDetails) GetCommonJobDetails() *CommonJobDetails { return c } -// CommonJobSecretsClassification provides polymorphic access to related types. -// Call the interface's GetCommonJobSecrets() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *CommonJobSecrets, *CustomerDiskJobSecrets, *DiskJobSecrets, *HeavyJobSecrets, *JobSecrets -type CommonJobSecretsClassification interface { - // GetCommonJobSecrets returns the CommonJobSecrets content of the underlying type. - GetCommonJobSecrets() *CommonJobSecrets -} - // CommonJobSecrets - The base class for the secrets type CommonJobSecrets struct { // REQUIRED; Used to indicate what type of job secrets object. @@ -283,15 +264,6 @@ type CommonJobSecrets struct { // GetCommonJobSecrets implements the CommonJobSecretsClassification interface for type CommonJobSecrets. func (c *CommonJobSecrets) GetCommonJobSecrets() *CommonJobSecrets { return c } -// CommonScheduleAvailabilityRequestClassification provides polymorphic access to related types. -// Call the interface's GetCommonScheduleAvailabilityRequest() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *CommonScheduleAvailabilityRequest, *DiskScheduleAvailabilityRequest, *HeavyScheduleAvailabilityRequest, *ScheduleAvailabilityRequest -type CommonScheduleAvailabilityRequestClassification interface { - // GetCommonScheduleAvailabilityRequest returns the CommonScheduleAvailabilityRequest content of the underlying type. - GetCommonScheduleAvailabilityRequest() *CommonScheduleAvailabilityRequest -} - // CommonScheduleAvailabilityRequest - Request body to get the availability for scheduling orders. type CommonScheduleAvailabilityRequest struct { // REQUIRED; Sku Name for which the order is to be scheduled. @@ -346,15 +318,6 @@ type ContactInfo struct { PhoneExtension *string } -// CopyLogDetailsClassification provides polymorphic access to related types. -// Call the interface's GetCopyLogDetails() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *AccountCopyLogDetails, *CopyLogDetails, *CustomerDiskCopyLogDetails, *DiskCopyLogDetails, *HeavyAccountCopyLogDetails -type CopyLogDetailsClassification interface { - // GetCopyLogDetails returns the CopyLogDetails content of the underlying type. - GetCopyLogDetails() *CopyLogDetails -} - // CopyLogDetails - Details for log generated during copy. type CopyLogDetails struct { // REQUIRED; Indicates the type of job details. @@ -431,8 +394,8 @@ type CreateJobValidations struct { // GetValidationRequest implements the ValidationRequestClassification interface for type CreateJobValidations. func (c *CreateJobValidations) GetValidationRequest() *ValidationRequest { return &ValidationRequest{ - ValidationCategory: c.ValidationCategory, IndividualRequestDetails: c.IndividualRequestDetails, + ValidationCategory: c.ValidationCategory, } } @@ -468,8 +431,8 @@ type CreateOrderLimitForSubscriptionValidationResponseProperties struct { // GetValidationInputResponse implements the ValidationInputResponseClassification interface for type CreateOrderLimitForSubscriptionValidationResponseProperties. func (c *CreateOrderLimitForSubscriptionValidationResponseProperties) GetValidationInputResponse() *ValidationInputResponse { return &ValidationInputResponse{ - ValidationType: c.ValidationType, Error: c.Error, + ValidationType: c.ValidationType, } } @@ -639,26 +602,26 @@ type CustomerDiskJobDetails struct { // GetCommonJobDetails implements the CommonJobDetailsClassification interface for type CustomerDiskJobDetails. func (c *CustomerDiskJobDetails) GetCommonJobDetails() *CommonJobDetails { return &CommonJobDetails{ - JobStages: c.JobStages, + Actions: c.Actions, + ChainOfCustodySasKey: c.ChainOfCustodySasKey, ContactDetails: c.ContactDetails, - ShippingAddress: c.ShippingAddress, - DeliveryPackage: c.DeliveryPackage, - ReturnPackage: c.ReturnPackage, - DataImportDetails: c.DataImportDetails, - DataExportDetails: c.DataExportDetails, - JobDetailsType: c.JobDetailsType, - Preferences: c.Preferences, - ReverseShippingDetails: c.ReverseShippingDetails, CopyLogDetails: c.CopyLogDetails, - ReverseShipmentLabelSasKey: c.ReverseShipmentLabelSasKey, - ChainOfCustodySasKey: c.ChainOfCustodySasKey, + DataCenterCode: c.DataCenterCode, + DataExportDetails: c.DataExportDetails, + DataImportDetails: c.DataImportDetails, + DatacenterAddress: c.DatacenterAddress, + DeliveryPackage: c.DeliveryPackage, DeviceErasureDetails: c.DeviceErasureDetails, - KeyEncryptionKey: c.KeyEncryptionKey, ExpectedDataSizeInTeraBytes: c.ExpectedDataSizeInTeraBytes, - Actions: c.Actions, + JobDetailsType: c.JobDetailsType, + JobStages: c.JobStages, + KeyEncryptionKey: c.KeyEncryptionKey, LastMitigationActionOnJob: c.LastMitigationActionOnJob, - DatacenterAddress: c.DatacenterAddress, - DataCenterCode: c.DataCenterCode, + Preferences: c.Preferences, + ReturnPackage: c.ReturnPackage, + ReverseShipmentLabelSasKey: c.ReverseShipmentLabelSasKey, + ReverseShippingDetails: c.ReverseShippingDetails, + ShippingAddress: c.ShippingAddress, } } @@ -683,21 +646,12 @@ type CustomerDiskJobSecrets struct { // GetCommonJobSecrets implements the CommonJobSecretsClassification interface for type CustomerDiskJobSecrets. func (c *CustomerDiskJobSecrets) GetCommonJobSecrets() *CommonJobSecrets { return &CommonJobSecrets{ - JobSecretsType: c.JobSecretsType, DcAccessSecurityCode: c.DcAccessSecurityCode, Error: c.Error, + JobSecretsType: c.JobSecretsType, } } -// DataAccountDetailsClassification provides polymorphic access to related types. -// Call the interface's GetDataAccountDetails() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *DataAccountDetails, *ManagedDiskDetails, *StorageAccountDetails -type DataAccountDetailsClassification interface { - // GetDataAccountDetails returns the DataAccountDetails content of the underlying type. - GetDataAccountDetails() *DataAccountDetails -} - // DataAccountDetails - Account details of the data to be transferred type DataAccountDetails struct { // REQUIRED; Account Type of the data to be transferred. @@ -785,8 +739,8 @@ type DataTransferDetailsValidationResponseProperties struct { // GetValidationInputResponse implements the ValidationInputResponseClassification interface for type DataTransferDetailsValidationResponseProperties. func (d *DataTransferDetailsValidationResponseProperties) GetValidationInputResponse() *ValidationInputResponse { return &ValidationInputResponse{ - ValidationType: d.ValidationType, Error: d.Error, + ValidationType: d.ValidationType, } } @@ -808,9 +762,9 @@ type DatacenterAddressInstructionResponse struct { // GetDatacenterAddressResponse implements the DatacenterAddressResponseClassification interface for type DatacenterAddressInstructionResponse. func (d *DatacenterAddressInstructionResponse) GetDatacenterAddressResponse() *DatacenterAddressResponse { return &DatacenterAddressResponse{ + DataCenterAzureLocation: d.DataCenterAzureLocation, DatacenterAddressType: d.DatacenterAddressType, SupportedCarriersForReturnShipment: d.SupportedCarriersForReturnShipment, - DataCenterAzureLocation: d.DataCenterAzureLocation, } } @@ -868,9 +822,9 @@ type DatacenterAddressLocationResponse struct { // GetDatacenterAddressResponse implements the DatacenterAddressResponseClassification interface for type DatacenterAddressLocationResponse. func (d *DatacenterAddressLocationResponse) GetDatacenterAddressResponse() *DatacenterAddressResponse { return &DatacenterAddressResponse{ + DataCenterAzureLocation: d.DataCenterAzureLocation, DatacenterAddressType: d.DatacenterAddressType, SupportedCarriersForReturnShipment: d.SupportedCarriersForReturnShipment, - DataCenterAzureLocation: d.DataCenterAzureLocation, } } @@ -883,15 +837,6 @@ type DatacenterAddressRequest struct { StorageLocation *string } -// DatacenterAddressResponseClassification provides polymorphic access to related types. -// Call the interface's GetDatacenterAddressResponse() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *DatacenterAddressInstructionResponse, *DatacenterAddressLocationResponse, *DatacenterAddressResponse -type DatacenterAddressResponseClassification interface { - // GetDatacenterAddressResponse returns the DatacenterAddressResponse content of the underlying type. - GetDatacenterAddressResponse() *DatacenterAddressResponse -} - // DatacenterAddressResponse - Datacenter address for given storage location. type DatacenterAddressResponse struct { // REQUIRED; Data center address type @@ -1149,26 +1094,26 @@ type DiskJobDetails struct { // GetCommonJobDetails implements the CommonJobDetailsClassification interface for type DiskJobDetails. func (d *DiskJobDetails) GetCommonJobDetails() *CommonJobDetails { return &CommonJobDetails{ - JobStages: d.JobStages, + Actions: d.Actions, + ChainOfCustodySasKey: d.ChainOfCustodySasKey, ContactDetails: d.ContactDetails, - ShippingAddress: d.ShippingAddress, - DeliveryPackage: d.DeliveryPackage, - ReturnPackage: d.ReturnPackage, - DataImportDetails: d.DataImportDetails, - DataExportDetails: d.DataExportDetails, - JobDetailsType: d.JobDetailsType, - Preferences: d.Preferences, - ReverseShippingDetails: d.ReverseShippingDetails, CopyLogDetails: d.CopyLogDetails, - ReverseShipmentLabelSasKey: d.ReverseShipmentLabelSasKey, - ChainOfCustodySasKey: d.ChainOfCustodySasKey, + DataCenterCode: d.DataCenterCode, + DataExportDetails: d.DataExportDetails, + DataImportDetails: d.DataImportDetails, + DatacenterAddress: d.DatacenterAddress, + DeliveryPackage: d.DeliveryPackage, DeviceErasureDetails: d.DeviceErasureDetails, - KeyEncryptionKey: d.KeyEncryptionKey, ExpectedDataSizeInTeraBytes: d.ExpectedDataSizeInTeraBytes, - Actions: d.Actions, + JobDetailsType: d.JobDetailsType, + JobStages: d.JobStages, + KeyEncryptionKey: d.KeyEncryptionKey, LastMitigationActionOnJob: d.LastMitigationActionOnJob, - DatacenterAddress: d.DatacenterAddress, - DataCenterCode: d.DataCenterCode, + Preferences: d.Preferences, + ReturnPackage: d.ReturnPackage, + ReverseShipmentLabelSasKey: d.ReverseShipmentLabelSasKey, + ReverseShippingDetails: d.ReverseShippingDetails, + ShippingAddress: d.ShippingAddress, } } @@ -1196,9 +1141,9 @@ type DiskJobSecrets struct { // GetCommonJobSecrets implements the CommonJobSecretsClassification interface for type DiskJobSecrets. func (d *DiskJobSecrets) GetCommonJobSecrets() *CommonJobSecrets { return &CommonJobSecrets{ - JobSecretsType: d.JobSecretsType, DcAccessSecurityCode: d.DcAccessSecurityCode, Error: d.Error, + JobSecretsType: d.JobSecretsType, } } @@ -1221,9 +1166,9 @@ type DiskScheduleAvailabilityRequest struct { // DiskScheduleAvailabilityRequest. func (d *DiskScheduleAvailabilityRequest) GetCommonScheduleAvailabilityRequest() *CommonScheduleAvailabilityRequest { return &CommonScheduleAvailabilityRequest{ - StorageLocation: d.StorageLocation, - SKUName: d.SKUName, Country: d.Country, + SKUName: d.SKUName, + StorageLocation: d.StorageLocation, } } @@ -1276,15 +1221,6 @@ type FilterFileDetails struct { FilterFileType *FilterFileType } -// GranularCopyLogDetailsClassification provides polymorphic access to related types. -// Call the interface's GetGranularCopyLogDetails() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *DiskGranularCopyLogDetails, *GranularCopyLogDetails -type GranularCopyLogDetailsClassification interface { - // GetGranularCopyLogDetails returns the GranularCopyLogDetails content of the underlying type. - GetGranularCopyLogDetails() *GranularCopyLogDetails -} - // GranularCopyLogDetails - Granular Details for log generated during copy. type GranularCopyLogDetails struct { // REQUIRED; Indicates the type of job details. @@ -1446,26 +1382,26 @@ type HeavyJobDetails struct { // GetCommonJobDetails implements the CommonJobDetailsClassification interface for type HeavyJobDetails. func (h *HeavyJobDetails) GetCommonJobDetails() *CommonJobDetails { return &CommonJobDetails{ - JobStages: h.JobStages, + Actions: h.Actions, + ChainOfCustodySasKey: h.ChainOfCustodySasKey, ContactDetails: h.ContactDetails, - ShippingAddress: h.ShippingAddress, - DeliveryPackage: h.DeliveryPackage, - ReturnPackage: h.ReturnPackage, - DataImportDetails: h.DataImportDetails, - DataExportDetails: h.DataExportDetails, - JobDetailsType: h.JobDetailsType, - Preferences: h.Preferences, - ReverseShippingDetails: h.ReverseShippingDetails, CopyLogDetails: h.CopyLogDetails, - ReverseShipmentLabelSasKey: h.ReverseShipmentLabelSasKey, - ChainOfCustodySasKey: h.ChainOfCustodySasKey, + DataCenterCode: h.DataCenterCode, + DataExportDetails: h.DataExportDetails, + DataImportDetails: h.DataImportDetails, + DatacenterAddress: h.DatacenterAddress, + DeliveryPackage: h.DeliveryPackage, DeviceErasureDetails: h.DeviceErasureDetails, - KeyEncryptionKey: h.KeyEncryptionKey, ExpectedDataSizeInTeraBytes: h.ExpectedDataSizeInTeraBytes, - Actions: h.Actions, + JobDetailsType: h.JobDetailsType, + JobStages: h.JobStages, + KeyEncryptionKey: h.KeyEncryptionKey, LastMitigationActionOnJob: h.LastMitigationActionOnJob, - DatacenterAddress: h.DatacenterAddress, - DataCenterCode: h.DataCenterCode, + Preferences: h.Preferences, + ReturnPackage: h.ReturnPackage, + ReverseShipmentLabelSasKey: h.ReverseShipmentLabelSasKey, + ReverseShippingDetails: h.ReverseShippingDetails, + ShippingAddress: h.ShippingAddress, } } @@ -1487,9 +1423,9 @@ type HeavyJobSecrets struct { // GetCommonJobSecrets implements the CommonJobSecretsClassification interface for type HeavyJobSecrets. func (h *HeavyJobSecrets) GetCommonJobSecrets() *CommonJobSecrets { return &CommonJobSecrets{ - JobSecretsType: h.JobSecretsType, DcAccessSecurityCode: h.DcAccessSecurityCode, Error: h.Error, + JobSecretsType: h.JobSecretsType, } } @@ -1509,9 +1445,9 @@ type HeavyScheduleAvailabilityRequest struct { // HeavyScheduleAvailabilityRequest. func (h *HeavyScheduleAvailabilityRequest) GetCommonScheduleAvailabilityRequest() *CommonScheduleAvailabilityRequest { return &CommonScheduleAvailabilityRequest{ - StorageLocation: h.StorageLocation, - SKUName: h.SKUName, Country: h.Country, + SKUName: h.SKUName, + StorageLocation: h.StorageLocation, } } @@ -1557,6 +1493,24 @@ type ImportDiskDetails struct { BackupManifestCloudPath *string } +// JobDelayDetails - Job Delay Notification details +type JobDelayDetails struct { + // READ-ONLY; Description of the delay. + Description *string + + // READ-ONLY; Delay Error code + ErrorCode *PortalDelayErrorCode + + // READ-ONLY; Timestamp when the delay notification was resolved. + ResolutionTime *time.Time + + // READ-ONLY; Timestamp when the delay notification was created. + StartTime *time.Time + + // READ-ONLY; Status of notification + Status *DelayNotificationStatus +} + // JobDeliveryInfo - Additional delivery info. type JobDeliveryInfo struct { // Scheduled date time. @@ -1639,26 +1593,26 @@ type JobDetails struct { // GetCommonJobDetails implements the CommonJobDetailsClassification interface for type JobDetails. func (j *JobDetails) GetCommonJobDetails() *CommonJobDetails { return &CommonJobDetails{ - JobStages: j.JobStages, + Actions: j.Actions, + ChainOfCustodySasKey: j.ChainOfCustodySasKey, ContactDetails: j.ContactDetails, - ShippingAddress: j.ShippingAddress, - DeliveryPackage: j.DeliveryPackage, - ReturnPackage: j.ReturnPackage, - DataImportDetails: j.DataImportDetails, - DataExportDetails: j.DataExportDetails, - JobDetailsType: j.JobDetailsType, - Preferences: j.Preferences, - ReverseShippingDetails: j.ReverseShippingDetails, CopyLogDetails: j.CopyLogDetails, - ReverseShipmentLabelSasKey: j.ReverseShipmentLabelSasKey, - ChainOfCustodySasKey: j.ChainOfCustodySasKey, + DataCenterCode: j.DataCenterCode, + DataExportDetails: j.DataExportDetails, + DataImportDetails: j.DataImportDetails, + DatacenterAddress: j.DatacenterAddress, + DeliveryPackage: j.DeliveryPackage, DeviceErasureDetails: j.DeviceErasureDetails, - KeyEncryptionKey: j.KeyEncryptionKey, ExpectedDataSizeInTeraBytes: j.ExpectedDataSizeInTeraBytes, - Actions: j.Actions, + JobDetailsType: j.JobDetailsType, + JobStages: j.JobStages, + KeyEncryptionKey: j.KeyEncryptionKey, LastMitigationActionOnJob: j.LastMitigationActionOnJob, - DatacenterAddress: j.DatacenterAddress, - DataCenterCode: j.DataCenterCode, + Preferences: j.Preferences, + ReturnPackage: j.ReturnPackage, + ReverseShipmentLabelSasKey: j.ReverseShipmentLabelSasKey, + ReverseShippingDetails: j.ReverseShippingDetails, + ShippingAddress: j.ShippingAddress, } } @@ -1679,6 +1633,9 @@ type JobProperties struct { // READ-ONLY; Reason for cancellation. CancellationReason *string + // READ-ONLY; Name of the stage where delay might be present. + DelayedStage *StageName + // READ-ONLY; Top level error for the job. Error *CloudError @@ -1783,14 +1740,17 @@ type JobSecrets struct { // GetCommonJobSecrets implements the CommonJobSecretsClassification interface for type JobSecrets. func (j *JobSecrets) GetCommonJobSecrets() *CommonJobSecrets { return &CommonJobSecrets{ - JobSecretsType: j.JobSecretsType, DcAccessSecurityCode: j.DcAccessSecurityCode, Error: j.Error, + JobSecretsType: j.JobSecretsType, } } // JobStages - Job stages. type JobStages struct { + // READ-ONLY; Delay information for the job stages. + DelayInformation []*JobDelayDetails + // READ-ONLY; Display name of the job stage. DisplayName *string @@ -1807,64 +1767,6 @@ type JobStages struct { StageTime *time.Time } -// JobsClientBeginCreateOptions contains the optional parameters for the JobsClient.BeginCreate method. -type JobsClientBeginCreateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// JobsClientBeginDeleteOptions contains the optional parameters for the JobsClient.BeginDelete method. -type JobsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// JobsClientBeginUpdateOptions contains the optional parameters for the JobsClient.BeginUpdate method. -type JobsClientBeginUpdateOptions struct { - // Defines the If-Match condition. The patch will be performed only if the ETag of the job on the server matches this value. - IfMatch *string - // Resumes the LRO from the provided token. - ResumeToken string -} - -// JobsClientBookShipmentPickUpOptions contains the optional parameters for the JobsClient.BookShipmentPickUp method. -type JobsClientBookShipmentPickUpOptions struct { - // placeholder for future optional parameters -} - -// JobsClientCancelOptions contains the optional parameters for the JobsClient.Cancel method. -type JobsClientCancelOptions struct { - // placeholder for future optional parameters -} - -// JobsClientGetOptions contains the optional parameters for the JobsClient.Get method. -type JobsClientGetOptions struct { - // $expand is supported on details parameter for job, which provides details on the job stages. - Expand *string -} - -// JobsClientListByResourceGroupOptions contains the optional parameters for the JobsClient.NewListByResourceGroupPager method. -type JobsClientListByResourceGroupOptions struct { - // $skipToken is supported on Get list of jobs, which provides the next page in the list of jobs. - SkipToken *string -} - -// JobsClientListCredentialsOptions contains the optional parameters for the JobsClient.NewListCredentialsPager method. -type JobsClientListCredentialsOptions struct { - // placeholder for future optional parameters -} - -// JobsClientListOptions contains the optional parameters for the JobsClient.NewListPager method. -type JobsClientListOptions struct { - // $skipToken is supported on Get list of jobs, which provides the next page in the list of jobs. - SkipToken *string -} - -// JobsClientMarkDevicesShippedOptions contains the optional parameters for the JobsClient.MarkDevicesShipped method. -type JobsClientMarkDevicesShippedOptions struct { - // placeholder for future optional parameters -} - // KeyEncryptionKey - Encryption key containing details about key to encrypt different keys. type KeyEncryptionKey struct { // REQUIRED; Type of encryption key used for key encryption. @@ -1920,11 +1822,6 @@ func (m *ManagedDiskDetails) GetDataAccountDetails() *DataAccountDetails { } } -// ManagementClientMitigateOptions contains the optional parameters for the ManagementClient.Mitigate method. -type ManagementClientMitigateOptions struct { - // placeholder for future optional parameters -} - // MarkDevicesShippedRequest - The request body to provide the delivery package details of job type MarkDevicesShippedRequest struct { // REQUIRED; Delivery package details @@ -1991,11 +1888,6 @@ type OperationList struct { Value []*Operation } -// OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. -type OperationsClientListOptions struct { - // placeholder for future optional parameters -} - // PackageCarrierDetails - Package carrier details. type PackageCarrierDetails struct { // Carrier Account Number of customer for customer disk. @@ -2081,8 +1973,8 @@ type PreferencesValidationResponseProperties struct { // GetValidationInputResponse implements the ValidationInputResponseClassification interface for type PreferencesValidationResponseProperties. func (p *PreferencesValidationResponseProperties) GetValidationInputResponse() *ValidationInputResponse { return &ValidationInputResponse{ - ValidationType: p.ValidationType, Error: p.Error, + ValidationType: p.ValidationType, } } @@ -2208,8 +2100,8 @@ type SKUAvailabilityValidationResponseProperties struct { // GetValidationInputResponse implements the ValidationInputResponseClassification interface for type SKUAvailabilityValidationResponseProperties. func (s *SKUAvailabilityValidationResponseProperties) GetValidationInputResponse() *ValidationInputResponse { return &ValidationInputResponse{ - ValidationType: s.ValidationType, Error: s.Error, + ValidationType: s.ValidationType, } } @@ -2290,9 +2182,9 @@ type ScheduleAvailabilityRequest struct { // ScheduleAvailabilityRequest. func (s *ScheduleAvailabilityRequest) GetCommonScheduleAvailabilityRequest() *CommonScheduleAvailabilityRequest { return &CommonScheduleAvailabilityRequest{ - StorageLocation: s.StorageLocation, - SKUName: s.SKUName, Country: s.Country, + SKUName: s.SKUName, + StorageLocation: s.StorageLocation, } } @@ -2320,39 +2212,6 @@ type Secret struct { NetworkConfigurations []*ApplianceNetworkConfiguration } -// ServiceClientListAvailableSKUsByResourceGroupOptions contains the optional parameters for the ServiceClient.NewListAvailableSKUsByResourceGroupPager -// method. -type ServiceClientListAvailableSKUsByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// ServiceClientRegionConfigurationByResourceGroupOptions contains the optional parameters for the ServiceClient.RegionConfigurationByResourceGroup -// method. -type ServiceClientRegionConfigurationByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// ServiceClientRegionConfigurationOptions contains the optional parameters for the ServiceClient.RegionConfiguration method. -type ServiceClientRegionConfigurationOptions struct { - // placeholder for future optional parameters -} - -// ServiceClientValidateAddressOptions contains the optional parameters for the ServiceClient.ValidateAddress method. -type ServiceClientValidateAddressOptions struct { - // placeholder for future optional parameters -} - -// ServiceClientValidateInputsByResourceGroupOptions contains the optional parameters for the ServiceClient.ValidateInputsByResourceGroup -// method. -type ServiceClientValidateInputsByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// ServiceClientValidateInputsOptions contains the optional parameters for the ServiceClient.ValidateInputs method. -type ServiceClientValidateInputsOptions struct { - // placeholder for future optional parameters -} - // ShareCredentialDetails - Credential details of the shares in account. type ShareCredentialDetails struct { // READ-ONLY; Password for the share. @@ -2485,8 +2344,8 @@ type SubscriptionIsAllowedToCreateJobValidationResponseProperties struct { // GetValidationInputResponse implements the ValidationInputResponseClassification interface for type SubscriptionIsAllowedToCreateJobValidationResponseProperties. func (s *SubscriptionIsAllowedToCreateJobValidationResponseProperties) GetValidationInputResponse() *ValidationInputResponse { return &ValidationInputResponse{ - ValidationType: s.ValidationType, Error: s.Error, + ValidationType: s.ValidationType, } } @@ -2675,16 +2534,6 @@ func (v *ValidateAddress) GetValidationInputRequest() *ValidationInputRequest { } } -// ValidationInputRequestClassification provides polymorphic access to related types. -// Call the interface's GetValidationInputRequest() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *CreateOrderLimitForSubscriptionValidationRequest, *DataTransferDetailsValidationRequest, *PreferencesValidationRequest, -// - *SKUAvailabilityValidationRequest, *SubscriptionIsAllowedToCreateJobValidationRequest, *ValidateAddress, *ValidationInputRequest -type ValidationInputRequestClassification interface { - // GetValidationInputRequest returns the ValidationInputRequest content of the underlying type. - GetValidationInputRequest() *ValidationInputRequest -} - // ValidationInputRequest - Minimum fields that must be present in any type of validation request. type ValidationInputRequest struct { // REQUIRED; Identifies the type of validation request. @@ -2694,17 +2543,6 @@ type ValidationInputRequest struct { // GetValidationInputRequest implements the ValidationInputRequestClassification interface for type ValidationInputRequest. func (v *ValidationInputRequest) GetValidationInputRequest() *ValidationInputRequest { return v } -// ValidationInputResponseClassification provides polymorphic access to related types. -// Call the interface's GetValidationInputResponse() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *AddressValidationProperties, *CreateOrderLimitForSubscriptionValidationResponseProperties, *DataTransferDetailsValidationResponseProperties, -// - *PreferencesValidationResponseProperties, *SKUAvailabilityValidationResponseProperties, *SubscriptionIsAllowedToCreateJobValidationResponseProperties, -// - *ValidationInputResponse -type ValidationInputResponseClassification interface { - // GetValidationInputResponse returns the ValidationInputResponse content of the underlying type. - GetValidationInputResponse() *ValidationInputResponse -} - // ValidationInputResponse - Minimum properties that should be present in each individual validation response. type ValidationInputResponse struct { // REQUIRED; Identifies the type of validation response. @@ -2717,15 +2555,6 @@ type ValidationInputResponse struct { // GetValidationInputResponse implements the ValidationInputResponseClassification interface for type ValidationInputResponse. func (v *ValidationInputResponse) GetValidationInputResponse() *ValidationInputResponse { return v } -// ValidationRequestClassification provides polymorphic access to related types. -// Call the interface's GetValidationRequest() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *CreateJobValidations, *ValidationRequest -type ValidationRequestClassification interface { - // GetValidationRequest returns the ValidationRequest content of the underlying type. - GetValidationRequest() *ValidationRequest -} - // ValidationRequest - Minimum request requirement of any validation category. type ValidationRequest struct { // REQUIRED; List of request details contain validationType and its request as key and value respectively. diff --git a/sdk/resourcemanager/databox/armdatabox/models_serde.go b/sdk/resourcemanager/databox/armdatabox/models_serde.go index 9ade0e73e326..8b27ec30742e 100644 --- a/sdk/resourcemanager/databox/armdatabox/models_serde.go +++ b/sdk/resourcemanager/databox/armdatabox/models_serde.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armdatabox @@ -2831,6 +2830,49 @@ func (i *ImportDiskDetails) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type JobDelayDetails. +func (j JobDelayDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "description", j.Description) + populate(objectMap, "errorCode", j.ErrorCode) + populateTimeRFC3339(objectMap, "resolutionTime", j.ResolutionTime) + populateTimeRFC3339(objectMap, "startTime", j.StartTime) + populate(objectMap, "status", j.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type JobDelayDetails. +func (j *JobDelayDetails) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "description": + err = unpopulate(val, "Description", &j.Description) + delete(rawMsg, key) + case "errorCode": + err = unpopulate(val, "ErrorCode", &j.ErrorCode) + delete(rawMsg, key) + case "resolutionTime": + err = unpopulateTimeRFC3339(val, "ResolutionTime", &j.ResolutionTime) + delete(rawMsg, key) + case "startTime": + err = unpopulateTimeRFC3339(val, "StartTime", &j.StartTime) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &j.Status) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type JobDeliveryInfo. func (j JobDeliveryInfo) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -2973,6 +3015,7 @@ func (j *JobDetails) UnmarshalJSON(data []byte) error { func (j JobProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "cancellationReason", j.CancellationReason) + populate(objectMap, "delayedStage", j.DelayedStage) populate(objectMap, "deliveryInfo", j.DeliveryInfo) populate(objectMap, "deliveryType", j.DeliveryType) populate(objectMap, "details", j.Details) @@ -3002,6 +3045,9 @@ func (j *JobProperties) UnmarshalJSON(data []byte) error { case "cancellationReason": err = unpopulate(val, "CancellationReason", &j.CancellationReason) delete(rawMsg, key) + case "delayedStage": + err = unpopulate(val, "DelayedStage", &j.DelayedStage) + delete(rawMsg, key) case "deliveryInfo": err = unpopulate(val, "DeliveryInfo", &j.DeliveryInfo) delete(rawMsg, key) @@ -3219,6 +3265,7 @@ func (j *JobSecrets) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type JobStages. func (j JobStages) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "delayInformation", j.DelayInformation) populate(objectMap, "displayName", j.DisplayName) populateAny(objectMap, "jobStageDetails", j.JobStageDetails) populate(objectMap, "stageName", j.StageName) @@ -3236,6 +3283,9 @@ func (j *JobStages) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "delayInformation": + err = unpopulate(val, "DelayInformation", &j.DelayInformation) + delete(rawMsg, key) case "displayName": err = unpopulate(val, "DisplayName", &j.DisplayName) delete(rawMsg, key) diff --git a/sdk/resourcemanager/databox/armdatabox/operations_client.go b/sdk/resourcemanager/databox/armdatabox/operations_client.go index c8218335c4d5..5b32e7d3d1bc 100644 --- a/sdk/resourcemanager/databox/armdatabox/operations_client.go +++ b/sdk/resourcemanager/databox/armdatabox/operations_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armdatabox @@ -40,7 +39,7 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO // NewListPager - This method gets all the operations. // -// Generated from API version 2022-12-01 +// Generated from API version 2023-03-01 // - options - OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ @@ -78,7 +77,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-01") + reqQP.Set("api-version", "2023-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/databox/armdatabox/operations_client_example_test.go b/sdk/resourcemanager/databox/armdatabox/operations_client_example_test.go deleted file mode 100644 index 0a7a8fb81eff..000000000000 --- a/sdk/resourcemanager/databox/armdatabox/operations_client_example_test.go +++ /dev/null @@ -1,250 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armdatabox_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/databox/armdatabox/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/databox/resource-manager/Microsoft.DataBox/stable/2022-12-01/examples/OperationsGet.json -func ExampleOperationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdatabox.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewOperationsClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.OperationList = armdatabox.OperationList{ - // Value: []*armdatabox.Operation{ - // { - // Name: to.Ptr("Microsoft.DataBox/locations/operationResults/read"), - // Display: &armdatabox.OperationDisplay{ - // Description: to.Ptr("List or get the Operation Results"), - // Operation: to.Ptr("List Operation Results"), - // Provider: to.Ptr("Azure Data Box"), - // Resource: to.Ptr("Operation Results"), - // }, - // Origin: to.Ptr("user"), - // Properties: map[string]any{ - // }, - // }, - // { - // Name: to.Ptr("Microsoft.DataBox/jobs/cancel/action"), - // Display: &armdatabox.OperationDisplay{ - // Description: to.Ptr("Cancels an order in progress."), - // Operation: to.Ptr("Cancel"), - // Provider: to.Ptr("Azure Data Box"), - // Resource: to.Ptr("Orders"), - // }, - // Origin: to.Ptr("user"), - // Properties: map[string]any{ - // }, - // }, - // { - // Name: to.Ptr("Microsoft.DataBox/jobs/bookShipmentPickUp/action"), - // Display: &armdatabox.OperationDisplay{ - // Description: to.Ptr("Allows to book a pick up for return shipments."), - // Operation: to.Ptr("Book Shipment Pick Up"), - // Provider: to.Ptr("Azure Data Box"), - // Resource: to.Ptr("Orders"), - // }, - // Origin: to.Ptr("user"), - // Properties: map[string]any{ - // }, - // }, - // { - // Name: to.Ptr("Microsoft.DataBox/jobs/read"), - // Display: &armdatabox.OperationDisplay{ - // Description: to.Ptr("List or get the Orders"), - // Operation: to.Ptr("List Orders"), - // Provider: to.Ptr("Azure Data Box"), - // Resource: to.Ptr("Orders"), - // }, - // Origin: to.Ptr("user"), - // Properties: map[string]any{ - // }, - // }, - // { - // Name: to.Ptr("Microsoft.DataBox/jobs/delete"), - // Display: &armdatabox.OperationDisplay{ - // Description: to.Ptr("Delete the Orders"), - // Operation: to.Ptr("Delete Orders"), - // Provider: to.Ptr("Azure Data Box"), - // Resource: to.Ptr("Orders"), - // }, - // Origin: to.Ptr("user"), - // Properties: map[string]any{ - // }, - // }, - // { - // Name: to.Ptr("Microsoft.DataBox/jobs/write"), - // Display: &armdatabox.OperationDisplay{ - // Description: to.Ptr("Create or update the Orders"), - // Operation: to.Ptr("Create or Update Orders"), - // Provider: to.Ptr("Azure Data Box"), - // Resource: to.Ptr("Orders"), - // }, - // Origin: to.Ptr("user"), - // Properties: map[string]any{ - // }, - // }, - // { - // Name: to.Ptr("Microsoft.DataBox/jobs/listCredentials/action"), - // Display: &armdatabox.OperationDisplay{ - // Description: to.Ptr("Lists the unencrypted credentials related to the order."), - // Operation: to.Ptr("List Credentials"), - // Provider: to.Ptr("Azure Data Box"), - // Resource: to.Ptr("Orders"), - // }, - // Origin: to.Ptr("user"), - // Properties: map[string]any{ - // }, - // }, - // { - // Name: to.Ptr("Microsoft.DataBox/locations/validateInputs/action"), - // Display: &armdatabox.OperationDisplay{ - // Description: to.Ptr("This method does all type of validations."), - // Operation: to.Ptr("Validate Inputs"), - // Provider: to.Ptr("Azure Data Box"), - // Resource: to.Ptr("Validate Inputs"), - // }, - // Origin: to.Ptr("user"), - // Properties: map[string]any{ - // }, - // }, - // { - // Name: to.Ptr("Microsoft.DataBox/locations/validateAddress/action"), - // Display: &armdatabox.OperationDisplay{ - // Description: to.Ptr("Validates the shipping address and provides alternate addresses if any."), - // Operation: to.Ptr("Validate Address"), - // Provider: to.Ptr("Azure Data Box"), - // Resource: to.Ptr("Validate Address"), - // }, - // Origin: to.Ptr("user"), - // Properties: map[string]any{ - // }, - // }, - // { - // Name: to.Ptr("Microsoft.DataBox/subscriptions/resourceGroups/moveResources/action"), - // Display: &armdatabox.OperationDisplay{ - // Description: to.Ptr("This method performs the resource move."), - // Operation: to.Ptr("Move Resource"), - // Provider: to.Ptr("Azure Data Box"), - // Resource: to.Ptr("Move Resource"), - // }, - // Origin: to.Ptr("user"), - // Properties: map[string]any{ - // }, - // }, - // { - // Name: to.Ptr("Microsoft.DataBox/subscriptions/resourceGroups/validateMoveResources/action"), - // Display: &armdatabox.OperationDisplay{ - // Description: to.Ptr("This method validates whether resource move is allowed or not."), - // Operation: to.Ptr("Validate Move Resource Request"), - // Provider: to.Ptr("Azure Data Box"), - // Resource: to.Ptr("Move Resource"), - // }, - // Origin: to.Ptr("user"), - // Properties: map[string]any{ - // }, - // }, - // { - // Name: to.Ptr("Microsoft.DataBox/locations/availableSkus/action"), - // Display: &armdatabox.OperationDisplay{ - // Description: to.Ptr("This method returns the list of available skus."), - // Operation: to.Ptr("Availabe Skus"), - // Provider: to.Ptr("Azure Data Box"), - // Resource: to.Ptr("Available Skus"), - // }, - // Origin: to.Ptr("user"), - // Properties: map[string]any{ - // }, - // }, - // { - // Name: to.Ptr("Microsoft.DataBox/locations/regionConfiguration/action"), - // Display: &armdatabox.OperationDisplay{ - // Description: to.Ptr("This method returns the configurations for the region."), - // Operation: to.Ptr("Region Configuration"), - // Provider: to.Ptr("Azure Data Box"), - // Resource: to.Ptr("Region Configuration"), - // }, - // Origin: to.Ptr("user"), - // Properties: map[string]any{ - // }, - // }, - // { - // Name: to.Ptr("Microsoft.DataBox/locations/availableSkus/read"), - // Display: &armdatabox.OperationDisplay{ - // Description: to.Ptr("List or get the Available Skus"), - // Operation: to.Ptr("List Available Skus"), - // Provider: to.Ptr("Azure Data Box"), - // Resource: to.Ptr("Available Skus"), - // }, - // Origin: to.Ptr("user"), - // Properties: map[string]any{ - // }, - // }, - // { - // Name: to.Ptr("Microsoft.DataBox/register/action"), - // Display: &armdatabox.OperationDisplay{ - // Description: to.Ptr("Register Provider Microsoft.Databox"), - // Operation: to.Ptr("Register Microsoft.Databox"), - // Provider: to.Ptr("Azure Data Box"), - // Resource: to.Ptr("Register Microsoft.Databox"), - // }, - // Origin: to.Ptr("user"), - // Properties: map[string]any{ - // }, - // }, - // { - // Name: to.Ptr("Microsoft.DataBox/unregister/action"), - // Display: &armdatabox.OperationDisplay{ - // Description: to.Ptr("Un-Register Provider Microsoft.Databox"), - // Operation: to.Ptr("Un-Register Microsoft.Databox"), - // Provider: to.Ptr("Azure Data Box"), - // Resource: to.Ptr("Register Microsoft.Databox"), - // }, - // Origin: to.Ptr("user"), - // Properties: map[string]any{ - // }, - // }, - // { - // Name: to.Ptr("Microsoft.DataBox/operations/read"), - // Display: &armdatabox.OperationDisplay{ - // Description: to.Ptr("List or get the Operations"), - // Operation: to.Ptr("List Operations"), - // Provider: to.Ptr("Azure Data Box"), - // Resource: to.Ptr("Operations"), - // }, - // Origin: to.Ptr("user"), - // Properties: map[string]any{ - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/databox/armdatabox/options.go b/sdk/resourcemanager/databox/armdatabox/options.go new file mode 100644 index 000000000000..dbceaf7e61c4 --- /dev/null +++ b/sdk/resourcemanager/databox/armdatabox/options.go @@ -0,0 +1,111 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armdatabox + +// JobsClientBeginCreateOptions contains the optional parameters for the JobsClient.BeginCreate method. +type JobsClientBeginCreateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// JobsClientBeginDeleteOptions contains the optional parameters for the JobsClient.BeginDelete method. +type JobsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// JobsClientBeginUpdateOptions contains the optional parameters for the JobsClient.BeginUpdate method. +type JobsClientBeginUpdateOptions struct { + // Defines the If-Match condition. The patch will be performed only if the ETag of the job on the server matches this value. + IfMatch *string + + // Resumes the LRO from the provided token. + ResumeToken string +} + +// JobsClientBookShipmentPickUpOptions contains the optional parameters for the JobsClient.BookShipmentPickUp method. +type JobsClientBookShipmentPickUpOptions struct { + // placeholder for future optional parameters +} + +// JobsClientCancelOptions contains the optional parameters for the JobsClient.Cancel method. +type JobsClientCancelOptions struct { + // placeholder for future optional parameters +} + +// JobsClientGetOptions contains the optional parameters for the JobsClient.Get method. +type JobsClientGetOptions struct { + // $expand is supported on details parameter for job, which provides details on the job stages. + Expand *string +} + +// JobsClientListByResourceGroupOptions contains the optional parameters for the JobsClient.NewListByResourceGroupPager method. +type JobsClientListByResourceGroupOptions struct { + // $skipToken is supported on Get list of jobs, which provides the next page in the list of jobs. + SkipToken *string +} + +// JobsClientListCredentialsOptions contains the optional parameters for the JobsClient.NewListCredentialsPager method. +type JobsClientListCredentialsOptions struct { + // placeholder for future optional parameters +} + +// JobsClientListOptions contains the optional parameters for the JobsClient.NewListPager method. +type JobsClientListOptions struct { + // $skipToken is supported on Get list of jobs, which provides the next page in the list of jobs. + SkipToken *string +} + +// JobsClientMarkDevicesShippedOptions contains the optional parameters for the JobsClient.MarkDevicesShipped method. +type JobsClientMarkDevicesShippedOptions struct { + // placeholder for future optional parameters +} + +// ManagementClientMitigateOptions contains the optional parameters for the ManagementClient.Mitigate method. +type ManagementClientMitigateOptions struct { + // placeholder for future optional parameters +} + +// OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. +type OperationsClientListOptions struct { + // placeholder for future optional parameters +} + +// ServiceClientListAvailableSKUsByResourceGroupOptions contains the optional parameters for the ServiceClient.NewListAvailableSKUsByResourceGroupPager +// method. +type ServiceClientListAvailableSKUsByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// ServiceClientRegionConfigurationByResourceGroupOptions contains the optional parameters for the ServiceClient.RegionConfigurationByResourceGroup +// method. +type ServiceClientRegionConfigurationByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// ServiceClientRegionConfigurationOptions contains the optional parameters for the ServiceClient.RegionConfiguration method. +type ServiceClientRegionConfigurationOptions struct { + // placeholder for future optional parameters +} + +// ServiceClientValidateAddressOptions contains the optional parameters for the ServiceClient.ValidateAddress method. +type ServiceClientValidateAddressOptions struct { + // placeholder for future optional parameters +} + +// ServiceClientValidateInputsByResourceGroupOptions contains the optional parameters for the ServiceClient.ValidateInputsByResourceGroup +// method. +type ServiceClientValidateInputsByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// ServiceClientValidateInputsOptions contains the optional parameters for the ServiceClient.ValidateInputs method. +type ServiceClientValidateInputsOptions struct { + // placeholder for future optional parameters +} diff --git a/sdk/resourcemanager/databox/armdatabox/polymorphic_helpers.go b/sdk/resourcemanager/databox/armdatabox/polymorphic_helpers.go index bf437628bcb7..66222098b7f7 100644 --- a/sdk/resourcemanager/databox/armdatabox/polymorphic_helpers.go +++ b/sdk/resourcemanager/databox/armdatabox/polymorphic_helpers.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armdatabox @@ -32,7 +31,10 @@ func unmarshalCommonJobDetailsClassification(rawMsg json.RawMessage) (CommonJobD default: b = &CommonJobDetails{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalCommonJobSecretsClassification(rawMsg json.RawMessage) (CommonJobSecretsClassification, error) { @@ -56,7 +58,10 @@ func unmarshalCommonJobSecretsClassification(rawMsg json.RawMessage) (CommonJobS default: b = &CommonJobSecrets{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalCommonScheduleAvailabilityRequestClassification(rawMsg json.RawMessage) (CommonScheduleAvailabilityRequestClassification, error) { @@ -78,7 +83,10 @@ func unmarshalCommonScheduleAvailabilityRequestClassification(rawMsg json.RawMes default: b = &CommonScheduleAvailabilityRequest{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalCopyLogDetailsClassification(rawMsg json.RawMessage) (CopyLogDetailsClassification, error) { @@ -102,7 +110,10 @@ func unmarshalCopyLogDetailsClassification(rawMsg json.RawMessage) (CopyLogDetai default: b = &CopyLogDetails{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalCopyLogDetailsClassificationArray(rawMsg json.RawMessage) ([]CopyLogDetailsClassification, error) { @@ -141,7 +152,10 @@ func unmarshalDataAccountDetailsClassification(rawMsg json.RawMessage) (DataAcco default: b = &DataAccountDetails{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalDatacenterAddressResponseClassification(rawMsg json.RawMessage) (DatacenterAddressResponseClassification, error) { @@ -161,7 +175,10 @@ func unmarshalDatacenterAddressResponseClassification(rawMsg json.RawMessage) (D default: b = &DatacenterAddressResponse{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalValidationInputRequestClassification(rawMsg json.RawMessage) (ValidationInputRequestClassification, error) { @@ -189,7 +206,10 @@ func unmarshalValidationInputRequestClassification(rawMsg json.RawMessage) (Vali default: b = &ValidationInputRequest{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalValidationInputRequestClassificationArray(rawMsg json.RawMessage) ([]ValidationInputRequestClassification, error) { @@ -236,7 +256,10 @@ func unmarshalValidationInputResponseClassification(rawMsg json.RawMessage) (Val default: b = &ValidationInputResponse{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalValidationInputResponseClassificationArray(rawMsg json.RawMessage) ([]ValidationInputResponseClassification, error) { diff --git a/sdk/resourcemanager/databox/armdatabox/response_types.go b/sdk/resourcemanager/databox/armdatabox/response_types.go index 5a61842153cd..05a7f4dabe4c 100644 --- a/sdk/resourcemanager/databox/armdatabox/response_types.go +++ b/sdk/resourcemanager/databox/armdatabox/response_types.go @@ -3,14 +3,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armdatabox // JobsClientBookShipmentPickUpResponse contains the response from method JobsClient.BookShipmentPickUp. type JobsClientBookShipmentPickUpResponse struct { + // Shipment pick up response. ShipmentPickUpResponse } @@ -21,6 +21,7 @@ type JobsClientCancelResponse struct { // JobsClientCreateResponse contains the response from method JobsClient.BeginCreate. type JobsClientCreateResponse struct { + // Job Resource. JobResource } @@ -31,21 +32,25 @@ type JobsClientDeleteResponse struct { // JobsClientGetResponse contains the response from method JobsClient.Get. type JobsClientGetResponse struct { + // Job Resource. JobResource } // JobsClientListByResourceGroupResponse contains the response from method JobsClient.NewListByResourceGroupPager. type JobsClientListByResourceGroupResponse struct { + // Job Resource Collection JobResourceList } // JobsClientListCredentialsResponse contains the response from method JobsClient.NewListCredentialsPager. type JobsClientListCredentialsResponse struct { + // List of unencrypted credentials for accessing device. UnencryptedCredentialsList } // JobsClientListResponse contains the response from method JobsClient.NewListPager. type JobsClientListResponse struct { + // Job Resource Collection JobResourceList } @@ -56,6 +61,7 @@ type JobsClientMarkDevicesShippedResponse struct { // JobsClientUpdateResponse contains the response from method JobsClient.BeginUpdate. type JobsClientUpdateResponse struct { + // Job Resource. JobResource } @@ -66,35 +72,42 @@ type ManagementClientMitigateResponse struct { // OperationsClientListResponse contains the response from method OperationsClient.NewListPager. type OperationsClientListResponse struct { + // Operation Collection. OperationList } // ServiceClientListAvailableSKUsByResourceGroupResponse contains the response from method ServiceClient.NewListAvailableSKUsByResourceGroupPager. type ServiceClientListAvailableSKUsByResourceGroupResponse struct { + // The available skus operation response. AvailableSKUsResult } // ServiceClientRegionConfigurationByResourceGroupResponse contains the response from method ServiceClient.RegionConfigurationByResourceGroup. type ServiceClientRegionConfigurationByResourceGroupResponse struct { + // Configuration response specific to a region. RegionConfigurationResponse } // ServiceClientRegionConfigurationResponse contains the response from method ServiceClient.RegionConfiguration. type ServiceClientRegionConfigurationResponse struct { + // Configuration response specific to a region. RegionConfigurationResponse } // ServiceClientValidateAddressResponse contains the response from method ServiceClient.ValidateAddress. type ServiceClientValidateAddressResponse struct { + // Output of the address validation api. AddressValidationOutput } // ServiceClientValidateInputsByResourceGroupResponse contains the response from method ServiceClient.ValidateInputsByResourceGroup. type ServiceClientValidateInputsByResourceGroupResponse struct { + // Response of pre job creation validations. ValidationResponse } // ServiceClientValidateInputsResponse contains the response from method ServiceClient.ValidateInputs. type ServiceClientValidateInputsResponse struct { + // Response of pre job creation validations. ValidationResponse } diff --git a/sdk/resourcemanager/databox/armdatabox/service_client.go b/sdk/resourcemanager/databox/armdatabox/service_client.go index cd151434e166..ce4e837cf81a 100644 --- a/sdk/resourcemanager/databox/armdatabox/service_client.go +++ b/sdk/resourcemanager/databox/armdatabox/service_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armdatabox @@ -47,7 +46,7 @@ func NewServiceClient(subscriptionID string, credential azcore.TokenCredential, // NewListAvailableSKUsByResourceGroupPager - This method provides the list of available skus for the given subscription, // resource group and location. // -// Generated from API version 2022-12-01 +// Generated from API version 2023-03-01 // - resourceGroupName - The Resource Group Name // - location - The location of the resource // - availableSKURequest - Filters for showing the available skus. @@ -101,10 +100,13 @@ func (client *ServiceClient) listAvailableSKUsByResourceGroupCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-01") + reqQP.Set("api-version", "2023-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, availableSKURequest) + if err := runtime.MarshalAsJSON(req, availableSKURequest); err != nil { + return nil, err + } + return req, nil } // listAvailableSKUsByResourceGroupHandleResponse handles the ListAvailableSKUsByResourceGroup response. @@ -119,24 +121,27 @@ func (client *ServiceClient) listAvailableSKUsByResourceGroupHandleResponse(resp // RegionConfiguration - This API provides configuration details specific to given region/location at Subscription level. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-01 +// Generated from API version 2023-03-01 // - 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) { + var err error req, err := client.regionConfigurationCreateRequest(ctx, location, regionConfigurationRequest, options) if err != nil { return ServiceClientRegionConfigurationResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ServiceClientRegionConfigurationResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ServiceClientRegionConfigurationResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ServiceClientRegionConfigurationResponse{}, err } - return client.regionConfigurationHandleResponse(resp) + resp, err := client.regionConfigurationHandleResponse(httpResp) + return resp, err } // regionConfigurationCreateRequest creates the RegionConfiguration request. @@ -155,10 +160,13 @@ func (client *ServiceClient) regionConfigurationCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-01") + reqQP.Set("api-version", "2023-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, regionConfigurationRequest) + if err := runtime.MarshalAsJSON(req, regionConfigurationRequest); err != nil { + return nil, err + } + return req, nil } // regionConfigurationHandleResponse handles the RegionConfiguration response. @@ -174,25 +182,28 @@ func (client *ServiceClient) regionConfigurationHandleResponse(resp *http.Respon // group level. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-01 +// Generated from API version 2023-03-01 // - 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) { + var err error req, err := client.regionConfigurationByResourceGroupCreateRequest(ctx, resourceGroupName, location, regionConfigurationRequest, options) if err != nil { return ServiceClientRegionConfigurationByResourceGroupResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ServiceClientRegionConfigurationByResourceGroupResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ServiceClientRegionConfigurationByResourceGroupResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ServiceClientRegionConfigurationByResourceGroupResponse{}, err } - return client.regionConfigurationByResourceGroupHandleResponse(resp) + resp, err := client.regionConfigurationByResourceGroupHandleResponse(httpResp) + return resp, err } // regionConfigurationByResourceGroupCreateRequest creates the RegionConfigurationByResourceGroup request. @@ -215,10 +226,13 @@ func (client *ServiceClient) regionConfigurationByResourceGroupCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-01") + reqQP.Set("api-version", "2023-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, regionConfigurationRequest) + if err := runtime.MarshalAsJSON(req, regionConfigurationRequest); err != nil { + return nil, err + } + return req, nil } // regionConfigurationByResourceGroupHandleResponse handles the RegionConfigurationByResourceGroup response. @@ -234,23 +248,26 @@ func (client *ServiceClient) regionConfigurationByResourceGroupHandleResponse(re // address and provide alternate addresses if any. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-01 +// Generated from API version 2023-03-01 // - 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) { + var err error req, err := client.validateAddressCreateRequest(ctx, location, validateAddress, options) if err != nil { return ServiceClientValidateAddressResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ServiceClientValidateAddressResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ServiceClientValidateAddressResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ServiceClientValidateAddressResponse{}, err } - return client.validateAddressHandleResponse(resp) + resp, err := client.validateAddressHandleResponse(httpResp) + return resp, err } // validateAddressCreateRequest creates the ValidateAddress request. @@ -269,10 +286,13 @@ func (client *ServiceClient) validateAddressCreateRequest(ctx context.Context, l return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-01") + reqQP.Set("api-version", "2023-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, validateAddress) + if err := runtime.MarshalAsJSON(req, validateAddress); err != nil { + return nil, err + } + return req, nil } // validateAddressHandleResponse handles the ValidateAddress response. @@ -287,23 +307,26 @@ func (client *ServiceClient) validateAddressHandleResponse(resp *http.Response) // ValidateInputs - This method does all necessary pre-job creation validation under subscription. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-01 +// Generated from API version 2023-03-01 // - 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) { + var err error req, err := client.validateInputsCreateRequest(ctx, location, validationRequest, options) if err != nil { return ServiceClientValidateInputsResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ServiceClientValidateInputsResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ServiceClientValidateInputsResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ServiceClientValidateInputsResponse{}, err } - return client.validateInputsHandleResponse(resp) + resp, err := client.validateInputsHandleResponse(httpResp) + return resp, err } // validateInputsCreateRequest creates the ValidateInputs request. @@ -322,10 +345,13 @@ func (client *ServiceClient) validateInputsCreateRequest(ctx context.Context, lo return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-01") + reqQP.Set("api-version", "2023-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, validationRequest) + if err := runtime.MarshalAsJSON(req, validationRequest); err != nil { + return nil, err + } + return req, nil } // validateInputsHandleResponse handles the ValidateInputs response. @@ -340,25 +366,28 @@ func (client *ServiceClient) validateInputsHandleResponse(resp *http.Response) ( // ValidateInputsByResourceGroup - This method does all necessary pre-job creation validation under resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-01 +// Generated from API version 2023-03-01 // - 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) { + var err error req, err := client.validateInputsByResourceGroupCreateRequest(ctx, resourceGroupName, location, validationRequest, options) if err != nil { return ServiceClientValidateInputsByResourceGroupResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ServiceClientValidateInputsByResourceGroupResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ServiceClientValidateInputsByResourceGroupResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ServiceClientValidateInputsByResourceGroupResponse{}, err } - return client.validateInputsByResourceGroupHandleResponse(resp) + resp, err := client.validateInputsByResourceGroupHandleResponse(httpResp) + return resp, err } // validateInputsByResourceGroupCreateRequest creates the ValidateInputsByResourceGroup request. @@ -381,10 +410,13 @@ func (client *ServiceClient) validateInputsByResourceGroupCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-01") + reqQP.Set("api-version", "2023-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, validationRequest) + if err := runtime.MarshalAsJSON(req, validationRequest); err != nil { + return nil, err + } + return req, nil } // validateInputsByResourceGroupHandleResponse handles the ValidateInputsByResourceGroup response. diff --git a/sdk/resourcemanager/databox/armdatabox/service_client_example_test.go b/sdk/resourcemanager/databox/armdatabox/service_client_example_test.go deleted file mode 100644 index c018d4a7ef3b..000000000000 --- a/sdk/resourcemanager/databox/armdatabox/service_client_example_test.go +++ /dev/null @@ -1,769 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armdatabox_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/databox/armdatabox/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/databox/resource-manager/Microsoft.DataBox/stable/2022-12-01/examples/AvailableSkusPost.json -func ExampleServiceClient_NewListAvailableSKUsByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdatabox.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewServiceClient().NewListAvailableSKUsByResourceGroupPager("YourResourceGroupName", "westus", armdatabox.AvailableSKURequest{ - Country: to.Ptr("XX"), - Location: to.Ptr("westus"), - TransferType: to.Ptr(armdatabox.TransferTypeImportToAzure), - }, nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.AvailableSKUsResult = armdatabox.AvailableSKUsResult{ - // Value: []*armdatabox.SKUInformation{ - // { - // Enabled: to.Ptr(true), - // Properties: &armdatabox.SKUProperties{ - // APIVersions: []*string{ - // to.Ptr("2018-01-01")}, - // Capacity: &armdatabox.SKUCapacity{ - // Maximum: to.Ptr("100"), - // Usable: to.Ptr("80"), - // }, - // Costs: []*armdatabox.SKUCost{ - // { - // MeterID: to.Ptr("0cf23ffc-0b64-49e6-9bdd-1db885349042"), - // MeterType: to.Ptr("DataBoxServiceFee"), - // Multiplier: to.Ptr[float64](1), - // }, - // { - // MeterID: to.Ptr("a701f058-119b-4713-a923-bed7da4b7801"), - // MeterType: to.Ptr("DataBoxShippingFee"), - // Multiplier: to.Ptr[float64](1), - // }, - // { - // MeterID: to.Ptr("049fa331-0a48-4a81-9991-a6bef3c79fed"), - // MeterType: to.Ptr("DataBoxExtraDayFee"), - // Multiplier: to.Ptr[float64](1), - // }, - // { - // MeterID: to.Ptr("c3ea978d-6a0a-4632-b094-4fffcafcb057"), - // MeterType: to.Ptr("DataBoxLostOrDamagedDeviceFee"), - // Multiplier: to.Ptr[float64](1), - // }}, - // CountriesWithinCommerceBoundary: []*string{ - // to.Ptr("XX")}, - // DataLocationToServiceLocationMap: []*armdatabox.DataLocationToServiceLocationMap{ - // { - // DataLocation: to.Ptr("westus"), - // ServiceLocation: to.Ptr("westus"), - // }, - // { - // DataLocation: to.Ptr("centralus"), - // ServiceLocation: to.Ptr("westus"), - // }, - // { - // DataLocation: to.Ptr("eastus"), - // ServiceLocation: to.Ptr("westus"), - // }, - // { - // DataLocation: to.Ptr("eastus2"), - // ServiceLocation: to.Ptr("westus"), - // }, - // { - // DataLocation: to.Ptr("northcentralus"), - // ServiceLocation: to.Ptr("westus"), - // }, - // { - // DataLocation: to.Ptr("southcentralus"), - // ServiceLocation: to.Ptr("westus"), - // }, - // { - // DataLocation: to.Ptr("westcentralus"), - // ServiceLocation: to.Ptr("westus"), - // }, - // { - // DataLocation: to.Ptr("westus2"), - // ServiceLocation: to.Ptr("westus"), - // }, - // { - // DataLocation: to.Ptr("centraluseuap"), - // ServiceLocation: to.Ptr("centraluseuap"), - // }, - // { - // DataLocation: to.Ptr("eastus2euap"), - // ServiceLocation: to.Ptr("eastus2euap"), - // }}, - // DisabledReason: to.Ptr(armdatabox.SKUDisabledReasonNone), - // }, - // SKU: &armdatabox.SKU{ - // Name: to.Ptr(armdatabox.SKUNameDataBox), - // }, - // }, - // { - // Enabled: to.Ptr(true), - // Properties: &armdatabox.SKUProperties{ - // APIVersions: []*string{ - // to.Ptr("2018-01-01")}, - // Capacity: &armdatabox.SKUCapacity{ - // Maximum: to.Ptr("40"), - // Usable: to.Ptr("35"), - // }, - // Costs: []*armdatabox.SKUCost{ - // { - // MeterID: to.Ptr("d95cd8b5-b6f1-4cd9-ae86-a016d1945d6f"), - // MeterType: to.Ptr("DataBoxDiskServiceFee"), - // Multiplier: to.Ptr[float64](1), - // }, - // { - // MeterID: to.Ptr("4b8cf572-cb04-4ef3-9528-2cda4e9b544e"), - // MeterType: to.Ptr("DataBoxDiskShippingFee"), - // Multiplier: to.Ptr[float64](1), - // }, - // { - // MeterID: to.Ptr("b6ae9bbf-815d-49dd-bb2b-77c497b72ba4"), - // MeterType: to.Ptr("DataBoxDiskDailyUsageFee"), - // Multiplier: to.Ptr[float64](1), - // }, - // { - // MeterID: to.Ptr("08bc0ea1-6c82-421b-b953-2a7a65810d2e"), - // MeterType: to.Ptr("DataBoxDiskLostDeviceFee"), - // Multiplier: to.Ptr[float64](1), - // }}, - // CountriesWithinCommerceBoundary: []*string{ - // to.Ptr("XX")}, - // DataLocationToServiceLocationMap: []*armdatabox.DataLocationToServiceLocationMap{ - // { - // DataLocation: to.Ptr("westus"), - // ServiceLocation: to.Ptr("westus"), - // }, - // { - // DataLocation: to.Ptr("centralus"), - // ServiceLocation: to.Ptr("westus"), - // }, - // { - // DataLocation: to.Ptr("eastus"), - // ServiceLocation: to.Ptr("westus"), - // }, - // { - // DataLocation: to.Ptr("eastus2"), - // ServiceLocation: to.Ptr("westus"), - // }, - // { - // DataLocation: to.Ptr("northcentralus"), - // ServiceLocation: to.Ptr("westus"), - // }, - // { - // DataLocation: to.Ptr("southcentralus"), - // ServiceLocation: to.Ptr("westus"), - // }, - // { - // DataLocation: to.Ptr("westcentralus"), - // ServiceLocation: to.Ptr("westus"), - // }, - // { - // DataLocation: to.Ptr("westus2"), - // ServiceLocation: to.Ptr("westus"), - // }, - // { - // DataLocation: to.Ptr("centraluseuap"), - // ServiceLocation: to.Ptr("centraluseuap"), - // }, - // { - // DataLocation: to.Ptr("eastus2euap"), - // ServiceLocation: to.Ptr("eastus2euap"), - // }}, - // DisabledReason: to.Ptr(armdatabox.SKUDisabledReasonNone), - // }, - // SKU: &armdatabox.SKU{ - // Name: to.Ptr(armdatabox.SKUNameDataBoxDisk), - // }, - // }, - // { - // Enabled: to.Ptr(true), - // Properties: &armdatabox.SKUProperties{ - // APIVersions: []*string{ - // to.Ptr("2018-01-01")}, - // Capacity: &armdatabox.SKUCapacity{ - // Maximum: to.Ptr("1000"), - // Usable: to.Ptr("800"), - // }, - // Costs: []*armdatabox.SKUCost{ - // { - // MeterID: to.Ptr("d0dccaaf-3de9-4c7a-ba97-f83551b90126"), - // MeterType: to.Ptr("DataBoxHeavyServiceFee"), - // Multiplier: to.Ptr[float64](1), - // }, - // { - // MeterID: to.Ptr("7b49d11f-d4f7-4029-a197-04998fd282f9"), - // MeterType: to.Ptr("DataBoxHeavyShippingFee"), - // Multiplier: to.Ptr[float64](1), - // }, - // { - // MeterID: to.Ptr("c2c66d53-11b4-4f11-9642-43c7c336f0b7"), - // MeterType: to.Ptr("DataBoxHeavyExtraDayFee"), - // Multiplier: to.Ptr[float64](1), - // }, - // { - // MeterID: to.Ptr("188dcd7e-fbd7-4a41-aa42-162b81b0510f"), - // MeterType: to.Ptr("DataBoxHeavyLostOrDamagedDeviceFee"), - // Multiplier: to.Ptr[float64](1), - // }}, - // CountriesWithinCommerceBoundary: []*string{ - // to.Ptr("XX")}, - // DataLocationToServiceLocationMap: []*armdatabox.DataLocationToServiceLocationMap{ - // { - // DataLocation: to.Ptr("westus"), - // ServiceLocation: to.Ptr("westus"), - // }, - // { - // DataLocation: to.Ptr("centralus"), - // ServiceLocation: to.Ptr("westus"), - // }, - // { - // DataLocation: to.Ptr("eastus"), - // ServiceLocation: to.Ptr("westus"), - // }, - // { - // DataLocation: to.Ptr("eastus2"), - // ServiceLocation: to.Ptr("westus"), - // }, - // { - // DataLocation: to.Ptr("northcentralus"), - // ServiceLocation: to.Ptr("westus"), - // }, - // { - // DataLocation: to.Ptr("southcentralus"), - // ServiceLocation: to.Ptr("westus"), - // }, - // { - // DataLocation: to.Ptr("westcentralus"), - // ServiceLocation: to.Ptr("westus"), - // }, - // { - // DataLocation: to.Ptr("westus2"), - // ServiceLocation: to.Ptr("westus"), - // }, - // { - // DataLocation: to.Ptr("centraluseuap"), - // ServiceLocation: to.Ptr("centraluseuap"), - // }, - // { - // DataLocation: to.Ptr("eastus2euap"), - // ServiceLocation: to.Ptr("eastus2euap"), - // }}, - // DisabledReason: to.Ptr(armdatabox.SKUDisabledReasonNone), - // RequiredFeature: to.Ptr("HeavyCreateAccess"), - // }, - // SKU: &armdatabox.SKU{ - // Name: to.Ptr(armdatabox.SKUNameDataBoxHeavy), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/databox/resource-manager/Microsoft.DataBox/stable/2022-12-01/examples/ValidateAddressPost.json -func ExampleServiceClient_ValidateAddress() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdatabox.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewServiceClient().ValidateAddress(ctx, "westus", armdatabox.ValidateAddress{ - ValidationType: to.Ptr(armdatabox.ValidationInputDiscriminatorValidateAddress), - DeviceType: to.Ptr(armdatabox.SKUNameDataBox), - ShippingAddress: &armdatabox.ShippingAddress{ - AddressType: to.Ptr(armdatabox.AddressTypeCommercial), - City: to.Ptr("XXXX XXXX"), - CompanyName: to.Ptr("XXXX XXXX"), - Country: to.Ptr("XX"), - PostalCode: to.Ptr("00000"), - StateOrProvince: to.Ptr("XX"), - StreetAddress1: to.Ptr("XXXX XXXX"), - StreetAddress2: to.Ptr("XXXX XXXX"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AddressValidationOutput = armdatabox.AddressValidationOutput{ - // Properties: &armdatabox.AddressValidationProperties{ - // ValidationType: to.Ptr(armdatabox.ValidationInputDiscriminatorValidateAddress), - // AlternateAddresses: []*armdatabox.ShippingAddress{ - // { - // AddressType: to.Ptr(armdatabox.AddressTypeNone), - // City: to.Ptr("XXXX XXXX"), - // Country: to.Ptr("XX"), - // PostalCode: to.Ptr("00000"), - // StateOrProvince: to.Ptr("XX"), - // StreetAddress1: to.Ptr("XXXX XXXX"), - // StreetAddress2: to.Ptr("XXXX XXXX"), - // StreetAddress3: to.Ptr(""), - // }}, - // ValidationStatus: to.Ptr(armdatabox.AddressValidationStatusValid), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/databox/resource-manager/Microsoft.DataBox/stable/2022-12-01/examples/ValidateInputsByResourceGroup.json -func ExampleServiceClient_ValidateInputsByResourceGroup() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdatabox.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewServiceClient().ValidateInputsByResourceGroup(ctx, "YourResourceGroupName", "westus", &armdatabox.CreateJobValidations{ - IndividualRequestDetails: []armdatabox.ValidationInputRequestClassification{ - &armdatabox.DataTransferDetailsValidationRequest{ - ValidationType: to.Ptr(armdatabox.ValidationInputDiscriminatorValidateDataTransferDetails), - DataImportDetails: []*armdatabox.DataImportDetails{ - { - AccountDetails: &armdatabox.StorageAccountDetails{ - DataAccountType: to.Ptr(armdatabox.DataAccountTypeStorageAccount), - StorageAccountID: to.Ptr("/subscriptions/YourSubscriptionId/resourcegroups/YourResourceGroupName/providers/Microsoft.Storage/storageAccounts/YourStorageAccountName"), - }, - }}, - DeviceType: to.Ptr(armdatabox.SKUNameDataBox), - TransferType: to.Ptr(armdatabox.TransferTypeImportToAzure), - }, - &armdatabox.ValidateAddress{ - ValidationType: to.Ptr(armdatabox.ValidationInputDiscriminatorValidateAddress), - DeviceType: to.Ptr(armdatabox.SKUNameDataBox), - ShippingAddress: &armdatabox.ShippingAddress{ - AddressType: to.Ptr(armdatabox.AddressTypeCommercial), - City: to.Ptr("XXXX XXXX"), - CompanyName: to.Ptr("XXXX XXXX"), - Country: to.Ptr("XX"), - PostalCode: to.Ptr("00000"), - StateOrProvince: to.Ptr("XX"), - StreetAddress1: to.Ptr("XXXX XXXX"), - StreetAddress2: to.Ptr("XXXX XXXX"), - }, - TransportPreferences: &armdatabox.TransportPreferences{ - PreferredShipmentType: to.Ptr(armdatabox.TransportShipmentTypesMicrosoftManaged), - }, - }, - &armdatabox.SubscriptionIsAllowedToCreateJobValidationRequest{ - ValidationType: to.Ptr(armdatabox.ValidationInputDiscriminatorValidateSubscriptionIsAllowedToCreateJob), - }, - &armdatabox.SKUAvailabilityValidationRequest{ - ValidationType: to.Ptr(armdatabox.ValidationInputDiscriminatorValidateSKUAvailability), - Country: to.Ptr("XX"), - DeviceType: to.Ptr(armdatabox.SKUNameDataBox), - Location: to.Ptr("westus"), - TransferType: to.Ptr(armdatabox.TransferTypeImportToAzure), - }, - &armdatabox.CreateOrderLimitForSubscriptionValidationRequest{ - ValidationType: to.Ptr(armdatabox.ValidationInputDiscriminatorValidateCreateOrderLimit), - DeviceType: to.Ptr(armdatabox.SKUNameDataBox), - }, - &armdatabox.PreferencesValidationRequest{ - ValidationType: to.Ptr(armdatabox.ValidationInputDiscriminatorValidatePreferences), - DeviceType: to.Ptr(armdatabox.SKUNameDataBox), - Preference: &armdatabox.Preferences{ - TransportPreferences: &armdatabox.TransportPreferences{ - PreferredShipmentType: to.Ptr(armdatabox.TransportShipmentTypesMicrosoftManaged), - }, - }, - }}, - ValidationCategory: to.Ptr("JobCreationValidation"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ValidationResponse = armdatabox.ValidationResponse{ - // Properties: &armdatabox.ValidationResponseProperties{ - // IndividualResponseDetails: []armdatabox.ValidationInputResponseClassification{ - // &armdatabox.DataTransferDetailsValidationResponseProperties{ - // Error: &armdatabox.CloudError{ - // AdditionalInfo: []*armdatabox.AdditionalErrorInfo{ - // }, - // Code: to.Ptr("Success"), - // Target: to.Ptr("KeyEncryptionKey"), - // Details: []*armdatabox.CloudError{ - // }, - // }, - // ValidationType: to.Ptr(armdatabox.ValidationInputDiscriminatorValidateDataTransferDetails), - // Status: to.Ptr(armdatabox.ValidationStatusValid), - // }, - // &armdatabox.AddressValidationProperties{ - // Error: &armdatabox.CloudError{ - // AdditionalInfo: []*armdatabox.AdditionalErrorInfo{ - // }, - // Code: to.Ptr("Success"), - // Target: to.Ptr("KeyEncryptionKey"), - // Details: []*armdatabox.CloudError{ - // }, - // }, - // ValidationType: to.Ptr(armdatabox.ValidationInputDiscriminatorValidateAddress), - // AlternateAddresses: []*armdatabox.ShippingAddress{ - // { - // AddressType: to.Ptr(armdatabox.AddressTypeNone), - // City: to.Ptr("XXXX XXXX"), - // Country: to.Ptr("XX"), - // PostalCode: to.Ptr("00000"), - // StateOrProvince: to.Ptr("XX"), - // StreetAddress1: to.Ptr("XXXX XXXX"), - // StreetAddress2: to.Ptr("XXXX XXXX"), - // StreetAddress3: to.Ptr(""), - // }}, - // ValidationStatus: to.Ptr(armdatabox.AddressValidationStatusValid), - // }, - // &armdatabox.SubscriptionIsAllowedToCreateJobValidationResponseProperties{ - // Error: &armdatabox.CloudError{ - // AdditionalInfo: []*armdatabox.AdditionalErrorInfo{ - // }, - // Code: to.Ptr("Success"), - // Target: to.Ptr("KeyEncryptionKey"), - // Details: []*armdatabox.CloudError{ - // }, - // }, - // ValidationType: to.Ptr(armdatabox.ValidationInputDiscriminatorValidateSubscriptionIsAllowedToCreateJob), - // Status: to.Ptr(armdatabox.ValidationStatusValid), - // }, - // &armdatabox.SKUAvailabilityValidationResponseProperties{ - // Error: &armdatabox.CloudError{ - // AdditionalInfo: []*armdatabox.AdditionalErrorInfo{ - // }, - // Code: to.Ptr("Success"), - // Target: to.Ptr("KeyEncryptionKey"), - // Details: []*armdatabox.CloudError{ - // }, - // }, - // ValidationType: to.Ptr(armdatabox.ValidationInputDiscriminatorValidateSKUAvailability), - // Status: to.Ptr(armdatabox.ValidationStatusValid), - // }, - // &armdatabox.CreateOrderLimitForSubscriptionValidationResponseProperties{ - // Error: &armdatabox.CloudError{ - // AdditionalInfo: []*armdatabox.AdditionalErrorInfo{ - // }, - // Code: to.Ptr("Success"), - // Target: to.Ptr("KeyEncryptionKey"), - // Details: []*armdatabox.CloudError{ - // }, - // }, - // ValidationType: to.Ptr(armdatabox.ValidationInputDiscriminatorValidateCreateOrderLimit), - // Status: to.Ptr(armdatabox.ValidationStatusValid), - // }, - // &armdatabox.PreferencesValidationResponseProperties{ - // Error: &armdatabox.CloudError{ - // AdditionalInfo: []*armdatabox.AdditionalErrorInfo{ - // }, - // Code: to.Ptr("Success"), - // Target: to.Ptr("KeyEncryptionKey"), - // Details: []*armdatabox.CloudError{ - // }, - // }, - // ValidationType: to.Ptr(armdatabox.ValidationInputDiscriminatorValidatePreferences), - // Status: to.Ptr(armdatabox.ValidationStatusValid), - // }}, - // Status: to.Ptr(armdatabox.OverallValidationStatusAllValidToProceed), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/databox/resource-manager/Microsoft.DataBox/stable/2022-12-01/examples/ValidateInputs.json -func ExampleServiceClient_ValidateInputs() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdatabox.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewServiceClient().ValidateInputs(ctx, "westus", &armdatabox.CreateJobValidations{ - IndividualRequestDetails: []armdatabox.ValidationInputRequestClassification{ - &armdatabox.DataTransferDetailsValidationRequest{ - ValidationType: to.Ptr(armdatabox.ValidationInputDiscriminatorValidateDataTransferDetails), - DataImportDetails: []*armdatabox.DataImportDetails{ - { - AccountDetails: &armdatabox.StorageAccountDetails{ - DataAccountType: to.Ptr(armdatabox.DataAccountTypeStorageAccount), - StorageAccountID: to.Ptr("/subscriptions/YourSubscriptionId/resourcegroups/YourResourceGroupName/providers/Microsoft.Storage/storageAccounts/YourStorageAccountName"), - }, - }}, - DeviceType: to.Ptr(armdatabox.SKUNameDataBox), - TransferType: to.Ptr(armdatabox.TransferTypeImportToAzure), - }, - &armdatabox.ValidateAddress{ - ValidationType: to.Ptr(armdatabox.ValidationInputDiscriminatorValidateAddress), - DeviceType: to.Ptr(armdatabox.SKUNameDataBox), - ShippingAddress: &armdatabox.ShippingAddress{ - AddressType: to.Ptr(armdatabox.AddressTypeCommercial), - City: to.Ptr("XXXX XXXX"), - CompanyName: to.Ptr("XXXX XXXX"), - Country: to.Ptr("XX"), - PostalCode: to.Ptr("00000"), - StateOrProvince: to.Ptr("XX"), - StreetAddress1: to.Ptr("XXXX XXXX"), - StreetAddress2: to.Ptr("XXXX XXXX"), - }, - TransportPreferences: &armdatabox.TransportPreferences{ - PreferredShipmentType: to.Ptr(armdatabox.TransportShipmentTypesMicrosoftManaged), - }, - }, - &armdatabox.SubscriptionIsAllowedToCreateJobValidationRequest{ - ValidationType: to.Ptr(armdatabox.ValidationInputDiscriminatorValidateSubscriptionIsAllowedToCreateJob), - }, - &armdatabox.SKUAvailabilityValidationRequest{ - ValidationType: to.Ptr(armdatabox.ValidationInputDiscriminatorValidateSKUAvailability), - Country: to.Ptr("XX"), - DeviceType: to.Ptr(armdatabox.SKUNameDataBox), - Location: to.Ptr("westus"), - TransferType: to.Ptr(armdatabox.TransferTypeImportToAzure), - }, - &armdatabox.CreateOrderLimitForSubscriptionValidationRequest{ - ValidationType: to.Ptr(armdatabox.ValidationInputDiscriminatorValidateCreateOrderLimit), - DeviceType: to.Ptr(armdatabox.SKUNameDataBox), - }, - &armdatabox.PreferencesValidationRequest{ - ValidationType: to.Ptr(armdatabox.ValidationInputDiscriminatorValidatePreferences), - DeviceType: to.Ptr(armdatabox.SKUNameDataBox), - Preference: &armdatabox.Preferences{ - TransportPreferences: &armdatabox.TransportPreferences{ - PreferredShipmentType: to.Ptr(armdatabox.TransportShipmentTypesMicrosoftManaged), - }, - }, - }}, - ValidationCategory: to.Ptr("JobCreationValidation"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ValidationResponse = armdatabox.ValidationResponse{ - // Properties: &armdatabox.ValidationResponseProperties{ - // IndividualResponseDetails: []armdatabox.ValidationInputResponseClassification{ - // &armdatabox.DataTransferDetailsValidationResponseProperties{ - // Error: &armdatabox.CloudError{ - // AdditionalInfo: []*armdatabox.AdditionalErrorInfo{ - // }, - // Code: to.Ptr("Success"), - // Target: to.Ptr("KeyEncryptionKey"), - // Details: []*armdatabox.CloudError{ - // }, - // }, - // ValidationType: to.Ptr(armdatabox.ValidationInputDiscriminatorValidateDataTransferDetails), - // Status: to.Ptr(armdatabox.ValidationStatusValid), - // }, - // &armdatabox.AddressValidationProperties{ - // Error: &armdatabox.CloudError{ - // AdditionalInfo: []*armdatabox.AdditionalErrorInfo{ - // }, - // Code: to.Ptr("Success"), - // Target: to.Ptr("KeyEncryptionKey"), - // Details: []*armdatabox.CloudError{ - // }, - // }, - // ValidationType: to.Ptr(armdatabox.ValidationInputDiscriminatorValidateAddress), - // AlternateAddresses: []*armdatabox.ShippingAddress{ - // { - // AddressType: to.Ptr(armdatabox.AddressTypeNone), - // City: to.Ptr("XXXX XXXX"), - // Country: to.Ptr("XX"), - // PostalCode: to.Ptr("00000"), - // StateOrProvince: to.Ptr("XX"), - // StreetAddress1: to.Ptr("XXXX XXXX"), - // StreetAddress2: to.Ptr("XXXX XXXX"), - // StreetAddress3: to.Ptr(""), - // }}, - // ValidationStatus: to.Ptr(armdatabox.AddressValidationStatusValid), - // }, - // &armdatabox.SubscriptionIsAllowedToCreateJobValidationResponseProperties{ - // Error: &armdatabox.CloudError{ - // AdditionalInfo: []*armdatabox.AdditionalErrorInfo{ - // }, - // Code: to.Ptr("Success"), - // Target: to.Ptr("KeyEncryptionKey"), - // Details: []*armdatabox.CloudError{ - // }, - // }, - // ValidationType: to.Ptr(armdatabox.ValidationInputDiscriminatorValidateSubscriptionIsAllowedToCreateJob), - // Status: to.Ptr(armdatabox.ValidationStatusValid), - // }, - // &armdatabox.SKUAvailabilityValidationResponseProperties{ - // Error: &armdatabox.CloudError{ - // AdditionalInfo: []*armdatabox.AdditionalErrorInfo{ - // }, - // Code: to.Ptr("Success"), - // Target: to.Ptr("KeyEncryptionKey"), - // Details: []*armdatabox.CloudError{ - // }, - // }, - // ValidationType: to.Ptr(armdatabox.ValidationInputDiscriminatorValidateSKUAvailability), - // Status: to.Ptr(armdatabox.ValidationStatusValid), - // }, - // &armdatabox.CreateOrderLimitForSubscriptionValidationResponseProperties{ - // Error: &armdatabox.CloudError{ - // AdditionalInfo: []*armdatabox.AdditionalErrorInfo{ - // }, - // Code: to.Ptr("Success"), - // Target: to.Ptr("KeyEncryptionKey"), - // Details: []*armdatabox.CloudError{ - // }, - // }, - // ValidationType: to.Ptr(armdatabox.ValidationInputDiscriminatorValidateCreateOrderLimit), - // Status: to.Ptr(armdatabox.ValidationStatusValid), - // }, - // &armdatabox.PreferencesValidationResponseProperties{ - // Error: &armdatabox.CloudError{ - // AdditionalInfo: []*armdatabox.AdditionalErrorInfo{ - // }, - // Code: to.Ptr("Success"), - // Target: to.Ptr("KeyEncryptionKey"), - // Details: []*armdatabox.CloudError{ - // }, - // }, - // ValidationType: to.Ptr(armdatabox.ValidationInputDiscriminatorValidatePreferences), - // Status: to.Ptr(armdatabox.ValidationStatusValid), - // }}, - // Status: to.Ptr(armdatabox.OverallValidationStatusAllValidToProceed), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/databox/resource-manager/Microsoft.DataBox/stable/2022-12-01/examples/RegionConfiguration.json -func ExampleServiceClient_RegionConfiguration() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdatabox.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewServiceClient().RegionConfiguration(ctx, "westus", armdatabox.RegionConfigurationRequest{ - ScheduleAvailabilityRequest: &armdatabox.ScheduleAvailabilityRequest{ - SKUName: to.Ptr(armdatabox.SKUNameDataBox), - StorageLocation: to.Ptr("westus"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.RegionConfigurationResponse = armdatabox.RegionConfigurationResponse{ - // ScheduleAvailabilityResponse: &armdatabox.ScheduleAvailabilityResponse{ - // AvailableDates: []*time.Time{ - // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-07-11T00:00:00+00:00"); return t}()), - // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-07-12T00:00:00+00:00"); return t}()), - // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-07-13T00:00:00+00:00"); return t}()), - // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-07-14T00:00:00+00:00"); return t}()), - // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-07-15T00:00:00+00:00"); return t}()), - // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-07-16T00:00:00+00:00"); return t}()), - // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-07-17T00:00:00+00:00"); return t}()), - // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-07-18T00:00:00+00:00"); return t}()), - // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-07-19T00:00:00+00:00"); return t}()), - // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-07-20T00:00:00+00:00"); return t}()), - // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-07-21T00:00:00+00:00"); return t}()), - // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-07-22T00:00:00+00:00"); return t}()), - // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-07-23T00:00:00+00:00"); return t}()), - // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-07-24T00:00:00+00:00"); return t}()), - // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-07-25T00:00:00+00:00"); return t}()), - // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-07-26T00:00:00+00:00"); return t}()), - // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-07-27T00:00:00+00:00"); return t}()), - // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-07-28T00:00:00+00:00"); return t}()), - // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-07-29T00:00:00+00:00"); return t}()), - // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-07-30T00:00:00+00:00"); return t}()), - // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-07-31T00:00:00+00:00"); return t}())}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/databox/resource-manager/Microsoft.DataBox/stable/2022-12-01/examples/RegionConfigurationByResourceGroup.json -func ExampleServiceClient_RegionConfigurationByResourceGroup() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armdatabox.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewServiceClient().RegionConfigurationByResourceGroup(ctx, "YourResourceGroupName", "westus", armdatabox.RegionConfigurationRequest{ - ScheduleAvailabilityRequest: &armdatabox.ScheduleAvailabilityRequest{ - SKUName: to.Ptr(armdatabox.SKUNameDataBox), - StorageLocation: to.Ptr("westus"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.RegionConfigurationResponse = armdatabox.RegionConfigurationResponse{ - // ScheduleAvailabilityResponse: &armdatabox.ScheduleAvailabilityResponse{ - // AvailableDates: []*time.Time{ - // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-07-11T00:00:00+00:00"); return t}()), - // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-07-12T00:00:00+00:00"); return t}()), - // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-07-13T00:00:00+00:00"); return t}()), - // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-07-14T00:00:00+00:00"); return t}()), - // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-07-15T00:00:00+00:00"); return t}()), - // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-07-16T00:00:00+00:00"); return t}()), - // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-07-17T00:00:00+00:00"); return t}()), - // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-07-18T00:00:00+00:00"); return t}()), - // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-07-19T00:00:00+00:00"); return t}()), - // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-07-20T00:00:00+00:00"); return t}()), - // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-07-21T00:00:00+00:00"); return t}()), - // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-07-22T00:00:00+00:00"); return t}()), - // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-07-23T00:00:00+00:00"); return t}()), - // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-07-24T00:00:00+00:00"); return t}()), - // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-07-25T00:00:00+00:00"); return t}()), - // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-07-26T00:00:00+00:00"); return t}()), - // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-07-27T00:00:00+00:00"); return t}()), - // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-07-28T00:00:00+00:00"); return t}()), - // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-07-29T00:00:00+00:00"); return t}()), - // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-07-30T00:00:00+00:00"); return t}()), - // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-07-31T00:00:00+00:00"); return t}())}, - // }, - // } -} diff --git a/sdk/resourcemanager/databox/armdatabox/time_rfc3339.go b/sdk/resourcemanager/databox/armdatabox/time_rfc3339.go index 4f654fbff4cf..af112161e1cb 100644 --- a/sdk/resourcemanager/databox/armdatabox/time_rfc3339.go +++ b/sdk/resourcemanager/databox/armdatabox/time_rfc3339.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armdatabox