From 590425f36f5b10134f5d827fc9c249164487af08 Mon Sep 17 00:00:00 2001 From: SDK Automation Date: Fri, 16 Oct 2020 09:38:43 +0000 Subject: [PATCH] Generated from fe8321f89cad17d70f0da2f3d3a1a4d05f1a8ac1 --- sdk/databoxedge/mgmt-v2019_03_01/pom.xml | 135 + .../databoxedge/v2019_03_01/ARMBaseModel.java | 17 + .../databoxedge/v2019_03_01/AccountType.java | 41 + .../databoxedge/v2019_03_01/Address.java | 199 ++ .../databoxedge/v2019_03_01/Alert.java | 74 + .../v2019_03_01/AlertErrorDetails.java | 62 + .../v2019_03_01/AlertSeverity.java | 44 + .../databoxedge/v2019_03_01/Alerts.java | 40 + .../AsymmetricEncryptedSecret.java | 97 + .../v2019_03_01/Authentication.java | 43 + .../v2019_03_01/AuthenticationType.java | 41 + .../v2019_03_01/AzureContainerDataFormat.java | 44 + .../v2019_03_01/AzureContainerInfo.java | 97 + .../v2019_03_01/BandwidthSchedule.java | 157 ++ .../v2019_03_01/BandwidthSchedules.java | 53 + .../v2019_03_01/ClientAccessRight.java | 71 + .../v2019_03_01/ClientPermissionType.java | 44 + .../v2019_03_01/ContactDetails.java | 122 + .../v2019_03_01/DataBoxEdgeDevice.java | 288 ++ .../DataBoxEdgeDeviceExtendedInfo.java | 50 + .../v2019_03_01/DataBoxEdgeDeviceJob.java | 103 + .../DataBoxEdgeDeviceJobModel.java | 103 + .../v2019_03_01/DataBoxEdgeDevicePatch.java | 44 + .../v2019_03_01/DataBoxEdgeDeviceStatus.java | 53 + .../databoxedge/v2019_03_01/DataPolicy.java | 41 + .../databoxedge/v2019_03_01/DayOfWeek.java | 56 + .../databoxedge/v2019_03_01/DeviceType.java | 38 + .../databoxedge/v2019_03_01/Devices.java | 145 ++ .../v2019_03_01/DownloadPhase.java | 47 + .../v2019_03_01/EncryptionAlgorithm.java | 44 + .../v2019_03_01/FileEventTrigger.java | 105 + .../v2019_03_01/FileSourceInfo.java | 43 + .../v2019_03_01/InstallRebootBehavior.java | 44 + .../v2019_03_01/IoTDeviceInfo.java | 95 + .../databoxedge/v2019_03_01/IoTRole.java | 156 ++ .../databoxedge/v2019_03_01/Ipv4Config.java | 62 + .../databoxedge/v2019_03_01/Ipv6Config.java | 62 + .../v2019_03_01/JobErrorDetails.java | 63 + .../databoxedge/v2019_03_01/JobErrorItem.java | 63 + .../databoxedge/v2019_03_01/JobStatus.java | 56 + .../databoxedge/v2019_03_01/JobType.java | 50 + .../databoxedge/v2019_03_01/Jobs.java | 30 + .../v2019_03_01/MetricAggregationType.java | 56 + .../v2019_03_01/MetricCategory.java | 41 + .../v2019_03_01/MetricDimensionV1.java | 95 + .../v2019_03_01/MetricSpecificationV1.java | 307 +++ .../databoxedge/v2019_03_01/MetricUnit.java | 59 + .../v2019_03_01/MonitoringStatus.java | 41 + .../v2019_03_01/MountPointMap.java | 89 + .../v2019_03_01/NetworkAdapter.java | 268 ++ .../v2019_03_01/NetworkAdapterDHCPStatus.java | 41 + .../v2019_03_01/NetworkAdapterPosition.java | 47 + .../v2019_03_01/NetworkAdapterRDMAStatus.java | 41 + .../v2019_03_01/NetworkAdapterStatus.java | 41 + .../databoxedge/v2019_03_01/NetworkGroup.java | 44 + .../v2019_03_01/NetworkSettings.java | 41 + .../databoxedge/v2019_03_01/Operation.java | 40 + .../v2019_03_01/OperationDisplay.java | 121 + .../databoxedge/v2019_03_01/Operations.java | 27 + .../v2019_03_01/OperationsStatus.java | 30 + .../databoxedge/v2019_03_01/Order.java | 71 + .../databoxedge/v2019_03_01/OrderState.java | 77 + .../databoxedge/v2019_03_01/OrderStatus.java | 89 + .../databoxedge/v2019_03_01/Orders.java | 62 + .../PeriodicTimerEventTrigger.java | 105 + .../v2019_03_01/PeriodicTimerSourceInfo.java | 100 + .../databoxedge/v2019_03_01/PlatformType.java | 41 + .../v2019_03_01/RefreshDetails.java | 128 + .../databoxedge/v2019_03_01/Role.java | 88 + .../databoxedge/v2019_03_01/RoleSinkInfo.java | 43 + .../databoxedge/v2019_03_01/RoleStatus.java | 41 + .../databoxedge/v2019_03_01/RoleTypes.java | 47 + .../databoxedge/v2019_03_01/Roles.java | 53 + .../databoxedge/v2019_03_01/SSLStatus.java | 41 + .../v2019_03_01/SecuritySettings.java | 48 + .../v2019_03_01/ServiceSpecification.java | 44 + .../databoxedge/v2019_03_01/Share.java | 319 +++ .../v2019_03_01/ShareAccessProtocol.java | 41 + .../v2019_03_01/ShareAccessRight.java | 71 + .../v2019_03_01/ShareAccessType.java | 44 + .../databoxedge/v2019_03_01/ShareStatus.java | 41 + .../databoxedge/v2019_03_01/Shares.java | 64 + .../databoxedge/v2019_03_01/Sku.java | 70 + .../databoxedge/v2019_03_01/SkuName.java | 41 + .../databoxedge/v2019_03_01/SkuTier.java | 38 + .../v2019_03_01/StorageAccountCredential.java | 255 ++ .../StorageAccountCredentials.java | 53 + .../databoxedge/v2019_03_01/SymmetricKey.java | 43 + .../databoxedge/v2019_03_01/TimeGrain.java | 59 + .../databoxedge/v2019_03_01/TrackingInfo.java | 121 + .../databoxedge/v2019_03_01/Trigger.java | 88 + .../databoxedge/v2019_03_01/Triggers.java | 53 + .../v2019_03_01/UpdateDownloadProgress.java | 108 + .../v2019_03_01/UpdateInstallProgress.java | 62 + .../v2019_03_01/UpdateOperation.java | 47 + .../v2019_03_01/UpdateOperationStage.java | 86 + .../v2019_03_01/UpdateSummary.java | 122 + .../v2019_03_01/UploadCertificateRequest.java | 72 + .../UploadCertificateResponse.java | 55 + .../databoxedge/v2019_03_01/User.java | 147 ++ .../v2019_03_01/UserAccessRight.java | 70 + .../databoxedge/v2019_03_01/Users.java | 53 + .../v2019_03_01/implementation/AlertImpl.java | 97 + .../implementation/AlertInner.java | 130 + .../implementation/AlertsImpl.java | 69 + .../implementation/AlertsInner.java | 401 +++ .../implementation/BandwidthScheduleImpl.java | 140 + .../BandwidthScheduleInner.java | 126 + .../BandwidthSchedulesImpl.java | 85 + .../BandwidthSchedulesInner.java | 776 ++++++ .../DataBoxEdgeDeviceExtendedInfoImpl.java | 56 + .../DataBoxEdgeDeviceExtendedInfoInner.java | 88 + .../implementation/DataBoxEdgeDeviceImpl.java | 162 ++ .../DataBoxEdgeDeviceInner.java | 377 +++ .../DataBoxEdgeDeviceJobImpl.java | 130 + .../DataBoxEdgeDeviceJobModelImpl.java | 130 + .../DataBoxEdgeManagementClientImpl.java | 350 +++ .../implementation/DataBoxEdgeManager.java | 231 ++ .../implementation/DevicesImpl.java | 183 ++ .../implementation/DevicesInner.java | 2316 +++++++++++++++++ .../implementation/IdParsingUtils.java | 57 + .../v2019_03_01/implementation/JobInner.java | 285 ++ .../v2019_03_01/implementation/JobsImpl.java | 50 + .../v2019_03_01/implementation/JobsInner.java | 153 ++ .../implementation/NetworkSettingsImpl.java | 48 + .../implementation/NetworkSettingsInner.java | 37 + .../implementation/OperationImpl.java | 48 + .../implementation/OperationInner.java | 125 + .../implementation/OperationsImpl.java | 49 + .../implementation/OperationsInner.java | 283 ++ .../implementation/OperationsStatusImpl.java | 50 + .../implementation/OperationsStatusInner.java | 153 ++ .../v2019_03_01/implementation/OrderImpl.java | 85 + .../implementation/OrderInner.java | 165 ++ .../implementation/OrdersImpl.java | 84 + .../implementation/OrdersInner.java | 742 ++++++ .../v2019_03_01/implementation/PageImpl.java | 75 + .../v2019_03_01/implementation/RoleImpl.java | 94 + .../v2019_03_01/implementation/RoleInner.java | 25 + .../v2019_03_01/implementation/RolesImpl.java | 85 + .../implementation/RolesInner.java | 776 ++++++ .../v2019_03_01/implementation/ShareImpl.java | 208 ++ .../implementation/ShareInner.java | 284 ++ .../implementation/SharesImpl.java | 91 + .../implementation/SharesInner.java | 953 +++++++ .../StorageAccountCredentialImpl.java | 174 ++ .../StorageAccountCredentialInner.java | 208 ++ .../StorageAccountCredentialsImpl.java | 85 + .../StorageAccountCredentialsInner.java | 776 ++++++ .../implementation/TriggerImpl.java | 94 + .../implementation/TriggerInner.java | 26 + .../implementation/TriggersImpl.java | 85 + .../implementation/TriggersInner.java | 898 +++++++ .../implementation/UpdateSummaryImpl.java | 130 + .../implementation/UpdateSummaryInner.java | 330 +++ .../UploadCertificateResponseImpl.java | 62 + .../UploadCertificateResponseInner.java | 201 ++ .../v2019_03_01/implementation/UserImpl.java | 119 + .../v2019_03_01/implementation/UserInner.java | 77 + .../v2019_03_01/implementation/UsersImpl.java | 85 + .../implementation/UsersInner.java | 776 ++++++ .../implementation/package-info.java | 10 + .../databoxedge/v2019_03_01/package-info.java | 10 + 163 files changed, 22950 insertions(+) create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/pom.xml create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/ARMBaseModel.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/AccountType.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/Address.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/Alert.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/AlertErrorDetails.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/AlertSeverity.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/Alerts.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/AsymmetricEncryptedSecret.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/Authentication.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/AuthenticationType.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/AzureContainerDataFormat.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/AzureContainerInfo.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/BandwidthSchedule.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/BandwidthSchedules.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/ClientAccessRight.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/ClientPermissionType.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/ContactDetails.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/DataBoxEdgeDevice.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/DataBoxEdgeDeviceExtendedInfo.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/DataBoxEdgeDeviceJob.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/DataBoxEdgeDeviceJobModel.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/DataBoxEdgeDevicePatch.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/DataBoxEdgeDeviceStatus.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/DataPolicy.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/DayOfWeek.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/DeviceType.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/Devices.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/DownloadPhase.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/EncryptionAlgorithm.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/FileEventTrigger.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/FileSourceInfo.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/InstallRebootBehavior.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/IoTDeviceInfo.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/IoTRole.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/Ipv4Config.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/Ipv6Config.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/JobErrorDetails.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/JobErrorItem.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/JobStatus.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/JobType.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/Jobs.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/MetricAggregationType.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/MetricCategory.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/MetricDimensionV1.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/MetricSpecificationV1.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/MetricUnit.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/MonitoringStatus.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/MountPointMap.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/NetworkAdapter.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/NetworkAdapterDHCPStatus.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/NetworkAdapterPosition.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/NetworkAdapterRDMAStatus.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/NetworkAdapterStatus.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/NetworkGroup.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/NetworkSettings.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/Operation.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/OperationDisplay.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/Operations.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/OperationsStatus.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/Order.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/OrderState.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/OrderStatus.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/Orders.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/PeriodicTimerEventTrigger.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/PeriodicTimerSourceInfo.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/PlatformType.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/RefreshDetails.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/Role.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/RoleSinkInfo.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/RoleStatus.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/RoleTypes.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/Roles.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/SSLStatus.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/SecuritySettings.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/ServiceSpecification.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/Share.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/ShareAccessProtocol.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/ShareAccessRight.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/ShareAccessType.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/ShareStatus.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/Shares.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/Sku.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/SkuName.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/SkuTier.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/StorageAccountCredential.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/StorageAccountCredentials.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/SymmetricKey.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/TimeGrain.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/TrackingInfo.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/Trigger.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/Triggers.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/UpdateDownloadProgress.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/UpdateInstallProgress.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/UpdateOperation.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/UpdateOperationStage.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/UpdateSummary.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/UploadCertificateRequest.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/UploadCertificateResponse.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/User.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/UserAccessRight.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/Users.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/AlertImpl.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/AlertInner.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/AlertsImpl.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/AlertsInner.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/BandwidthScheduleImpl.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/BandwidthScheduleInner.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/BandwidthSchedulesImpl.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/BandwidthSchedulesInner.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/DataBoxEdgeDeviceExtendedInfoImpl.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/DataBoxEdgeDeviceExtendedInfoInner.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/DataBoxEdgeDeviceImpl.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/DataBoxEdgeDeviceInner.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/DataBoxEdgeDeviceJobImpl.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/DataBoxEdgeDeviceJobModelImpl.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/DataBoxEdgeManagementClientImpl.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/DataBoxEdgeManager.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/DevicesImpl.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/DevicesInner.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/IdParsingUtils.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/JobInner.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/JobsImpl.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/JobsInner.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/NetworkSettingsImpl.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/NetworkSettingsInner.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/OperationImpl.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/OperationInner.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/OperationsImpl.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/OperationsInner.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/OperationsStatusImpl.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/OperationsStatusInner.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/OrderImpl.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/OrderInner.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/OrdersImpl.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/OrdersInner.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/PageImpl.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/RoleImpl.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/RoleInner.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/RolesImpl.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/RolesInner.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/ShareImpl.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/ShareInner.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/SharesImpl.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/SharesInner.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/StorageAccountCredentialImpl.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/StorageAccountCredentialInner.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/StorageAccountCredentialsImpl.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/StorageAccountCredentialsInner.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/TriggerImpl.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/TriggerInner.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/TriggersImpl.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/TriggersInner.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/UpdateSummaryImpl.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/UpdateSummaryInner.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/UploadCertificateResponseImpl.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/UploadCertificateResponseInner.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/UserImpl.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/UserInner.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/UsersImpl.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/UsersInner.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/package-info.java create mode 100644 sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/package-info.java diff --git a/sdk/databoxedge/mgmt-v2019_03_01/pom.xml b/sdk/databoxedge/mgmt-v2019_03_01/pom.xml new file mode 100644 index 0000000000000..006a2dc52a329 --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/pom.xml @@ -0,0 +1,135 @@ + + + 4.0.0 + com.microsoft.azure.databoxedge.v2019_03_01 + + com.microsoft.azure + azure-arm-parent + 1.1.0 + ../../../pom.management.xml + + azure-mgmt-databoxedge + 1.0.0-beta + jar + Microsoft Azure SDK for DataBoxEdge Management + This package contains Microsoft DataBoxEdge Management SDK. + https://github.com/Azure/azure-sdk-for-java + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + scm:git:https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + UTF-8 + + + + + microsoft + Microsoft + + + + + com.microsoft.azure + azure-client-runtime + + + com.microsoft.azure + azure-arm-client-runtime + + + junit + junit + test + + + com.microsoft.azure + azure-client-authentication + test + + + com.microsoft.azure + azure-mgmt-resources + test + + + com.microsoft.azure + azure-arm-client-runtime + test-jar + test + + 1.6.5 + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + true + true + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.7 + 1.7 + + + com.microsoft.azure.management.apigeneration.LangDefinitionProcessor + + + true + true + + true + true + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.8 + + *.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.search + + + /** +
* Copyright (c) Microsoft Corporation. All rights reserved. +
* Licensed under the MIT License. See License.txt in the project root for +
* license information. +
*/ + ]]> +
+
+
+
+
+
diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/ARMBaseModel.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/ARMBaseModel.java new file mode 100644 index 0000000000000..916bc3c70a4ed --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/ARMBaseModel.java @@ -0,0 +1,17 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01; + +import com.microsoft.azure.ProxyResource; + +/** + * Represents the base class for all object models. + */ +public class ARMBaseModel extends ProxyResource { +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/AccountType.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/AccountType.java new file mode 100644 index 0000000000000..0b87203bca496 --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/AccountType.java @@ -0,0 +1,41 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for AccountType. + */ +public final class AccountType extends ExpandableStringEnum { + /** Static value GeneralPurposeStorage for AccountType. */ + public static final AccountType GENERAL_PURPOSE_STORAGE = fromString("GeneralPurposeStorage"); + + /** Static value BlobStorage for AccountType. */ + public static final AccountType BLOB_STORAGE = fromString("BlobStorage"); + + /** + * Creates or finds a AccountType from its string representation. + * @param name a name to look for + * @return the corresponding AccountType + */ + @JsonCreator + public static AccountType fromString(String name) { + return fromString(name, AccountType.class); + } + + /** + * @return known AccountType values + */ + public static Collection values() { + return values(AccountType.class); + } +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/Address.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/Address.java new file mode 100644 index 0000000000000..de9e8116ba86d --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/Address.java @@ -0,0 +1,199 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The shipping address of the customer. + */ +public class Address { + /** + * The address line1. + */ + @JsonProperty(value = "addressLine1", required = true) + private String addressLine1; + + /** + * The address line2. + */ + @JsonProperty(value = "addressLine2") + private String addressLine2; + + /** + * The address line3. + */ + @JsonProperty(value = "addressLine3") + private String addressLine3; + + /** + * The postal code. + */ + @JsonProperty(value = "postalCode", required = true) + private String postalCode; + + /** + * The city name. + */ + @JsonProperty(value = "city", required = true) + private String city; + + /** + * The state name. + */ + @JsonProperty(value = "state", required = true) + private String state; + + /** + * The country name. + */ + @JsonProperty(value = "country", required = true) + private String country; + + /** + * Get the address line1. + * + * @return the addressLine1 value + */ + public String addressLine1() { + return this.addressLine1; + } + + /** + * Set the address line1. + * + * @param addressLine1 the addressLine1 value to set + * @return the Address object itself. + */ + public Address withAddressLine1(String addressLine1) { + this.addressLine1 = addressLine1; + return this; + } + + /** + * Get the address line2. + * + * @return the addressLine2 value + */ + public String addressLine2() { + return this.addressLine2; + } + + /** + * Set the address line2. + * + * @param addressLine2 the addressLine2 value to set + * @return the Address object itself. + */ + public Address withAddressLine2(String addressLine2) { + this.addressLine2 = addressLine2; + return this; + } + + /** + * Get the address line3. + * + * @return the addressLine3 value + */ + public String addressLine3() { + return this.addressLine3; + } + + /** + * Set the address line3. + * + * @param addressLine3 the addressLine3 value to set + * @return the Address object itself. + */ + public Address withAddressLine3(String addressLine3) { + this.addressLine3 = addressLine3; + return this; + } + + /** + * Get the postal code. + * + * @return the postalCode value + */ + public String postalCode() { + return this.postalCode; + } + + /** + * Set the postal code. + * + * @param postalCode the postalCode value to set + * @return the Address object itself. + */ + public Address withPostalCode(String postalCode) { + this.postalCode = postalCode; + return this; + } + + /** + * Get the city name. + * + * @return the city value + */ + public String city() { + return this.city; + } + + /** + * Set the city name. + * + * @param city the city value to set + * @return the Address object itself. + */ + public Address withCity(String city) { + this.city = city; + return this; + } + + /** + * Get the state name. + * + * @return the state value + */ + public String state() { + return this.state; + } + + /** + * Set the state name. + * + * @param state the state value to set + * @return the Address object itself. + */ + public Address withState(String state) { + this.state = state; + return this; + } + + /** + * Get the country name. + * + * @return the country value + */ + public String country() { + return this.country; + } + + /** + * Set the country name. + * + * @param country the country value to set + * @return the Address object itself. + */ + public Address withCountry(String country) { + this.country = country; + return this; + } + +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/Alert.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/Alert.java new file mode 100644 index 0000000000000..2c89b94b4e695 --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/Alert.java @@ -0,0 +1,74 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.databoxedge.v2019_03_01.implementation.AlertInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.databoxedge.v2019_03_01.implementation.DataBoxEdgeManager; +import org.joda.time.DateTime; +import java.util.Map; + +/** + * Type representing Alert. + */ +public interface Alert extends HasInner, Indexable, Refreshable, HasManager { + /** + * @return the alertType value. + */ + String alertType(); + + /** + * @return the appearedAtDateTime value. + */ + DateTime appearedAtDateTime(); + + /** + * @return the detailedInformation value. + */ + Map detailedInformation(); + + /** + * @return the errorDetails value. + */ + AlertErrorDetails errorDetails(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the recommendation value. + */ + String recommendation(); + + /** + * @return the severity value. + */ + AlertSeverity severity(); + + /** + * @return the title value. + */ + String title(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/AlertErrorDetails.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/AlertErrorDetails.java new file mode 100644 index 0000000000000..9097d919ac785 --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/AlertErrorDetails.java @@ -0,0 +1,62 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Error details for the alert. + */ +public class AlertErrorDetails { + /** + * Error code. + */ + @JsonProperty(value = "errorCode", access = JsonProperty.Access.WRITE_ONLY) + private String errorCode; + + /** + * Error Message. + */ + @JsonProperty(value = "errorMessage", access = JsonProperty.Access.WRITE_ONLY) + private String errorMessage; + + /** + * Number of occurrences. + */ + @JsonProperty(value = "occurrences", access = JsonProperty.Access.WRITE_ONLY) + private Integer occurrences; + + /** + * Get error code. + * + * @return the errorCode value + */ + public String errorCode() { + return this.errorCode; + } + + /** + * Get error Message. + * + * @return the errorMessage value + */ + public String errorMessage() { + return this.errorMessage; + } + + /** + * Get number of occurrences. + * + * @return the occurrences value + */ + public Integer occurrences() { + return this.occurrences; + } + +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/AlertSeverity.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/AlertSeverity.java new file mode 100644 index 0000000000000..64345991f8b33 --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/AlertSeverity.java @@ -0,0 +1,44 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for AlertSeverity. + */ +public final class AlertSeverity extends ExpandableStringEnum { + /** Static value Informational for AlertSeverity. */ + public static final AlertSeverity INFORMATIONAL = fromString("Informational"); + + /** Static value Warning for AlertSeverity. */ + public static final AlertSeverity WARNING = fromString("Warning"); + + /** Static value Critical for AlertSeverity. */ + public static final AlertSeverity CRITICAL = fromString("Critical"); + + /** + * Creates or finds a AlertSeverity from its string representation. + * @param name a name to look for + * @return the corresponding AlertSeverity + */ + @JsonCreator + public static AlertSeverity fromString(String name) { + return fromString(name, AlertSeverity.class); + } + + /** + * @return known AlertSeverity values + */ + public static Collection values() { + return values(AlertSeverity.class); + } +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/Alerts.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/Alerts.java new file mode 100644 index 0000000000000..7ce8a6f72ab6e --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/Alerts.java @@ -0,0 +1,40 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01; + +import rx.Observable; +import com.microsoft.azure.management.databoxedge.v2019_03_01.implementation.AlertsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Alerts. + */ +public interface Alerts extends HasInner { + /** + * Gets an alert by name. + * + * @param deviceName The device name. + * @param name The alert name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String deviceName, String name, String resourceGroupName); + + /** + * Gets all the alerts for a data box edge/gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByDataBoxEdgeDeviceAsync(final String deviceName, final String resourceGroupName); + +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/AsymmetricEncryptedSecret.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/AsymmetricEncryptedSecret.java new file mode 100644 index 0000000000000..ccea574db55db --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/AsymmetricEncryptedSecret.java @@ -0,0 +1,97 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Represent the secrets intended for encryption with asymmetric key pair. + */ +public class AsymmetricEncryptedSecret { + /** + * The value of the secret. + */ + @JsonProperty(value = "value", required = true) + private String value; + + /** + * Thumbprint certificate used to encrypt \"Value\". If the value is + * unencrypted, it will be null. + */ + @JsonProperty(value = "encryptionCertThumbprint") + private String encryptionCertThumbprint; + + /** + * The algorithm used to encrypt "Value". Possible values include: 'None', + * 'AES256', 'RSAES_PKCS1_v_1_5'. + */ + @JsonProperty(value = "encryptionAlgorithm", required = true) + private EncryptionAlgorithm encryptionAlgorithm; + + /** + * Get the value of the secret. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Set the value of the secret. + * + * @param value the value value to set + * @return the AsymmetricEncryptedSecret object itself. + */ + public AsymmetricEncryptedSecret withValue(String value) { + this.value = value; + return this; + } + + /** + * Get thumbprint certificate used to encrypt \"Value\". If the value is unencrypted, it will be null. + * + * @return the encryptionCertThumbprint value + */ + public String encryptionCertThumbprint() { + return this.encryptionCertThumbprint; + } + + /** + * Set thumbprint certificate used to encrypt \"Value\". If the value is unencrypted, it will be null. + * + * @param encryptionCertThumbprint the encryptionCertThumbprint value to set + * @return the AsymmetricEncryptedSecret object itself. + */ + public AsymmetricEncryptedSecret withEncryptionCertThumbprint(String encryptionCertThumbprint) { + this.encryptionCertThumbprint = encryptionCertThumbprint; + return this; + } + + /** + * Get the algorithm used to encrypt "Value". Possible values include: 'None', 'AES256', 'RSAES_PKCS1_v_1_5'. + * + * @return the encryptionAlgorithm value + */ + public EncryptionAlgorithm encryptionAlgorithm() { + return this.encryptionAlgorithm; + } + + /** + * Set the algorithm used to encrypt "Value". Possible values include: 'None', 'AES256', 'RSAES_PKCS1_v_1_5'. + * + * @param encryptionAlgorithm the encryptionAlgorithm value to set + * @return the AsymmetricEncryptedSecret object itself. + */ + public AsymmetricEncryptedSecret withEncryptionAlgorithm(EncryptionAlgorithm encryptionAlgorithm) { + this.encryptionAlgorithm = encryptionAlgorithm; + return this; + } + +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/Authentication.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/Authentication.java new file mode 100644 index 0000000000000..2bfb53b9d8a8a --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/Authentication.java @@ -0,0 +1,43 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Authentication mechanism for IoT devices. + */ +public class Authentication { + /** + * Symmetric key for authentication. + */ + @JsonProperty(value = "symmetricKey") + private SymmetricKey symmetricKey; + + /** + * Get symmetric key for authentication. + * + * @return the symmetricKey value + */ + public SymmetricKey symmetricKey() { + return this.symmetricKey; + } + + /** + * Set symmetric key for authentication. + * + * @param symmetricKey the symmetricKey value to set + * @return the Authentication object itself. + */ + public Authentication withSymmetricKey(SymmetricKey symmetricKey) { + this.symmetricKey = symmetricKey; + return this; + } + +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/AuthenticationType.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/AuthenticationType.java new file mode 100644 index 0000000000000..6f32a076cba49 --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/AuthenticationType.java @@ -0,0 +1,41 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for AuthenticationType. + */ +public final class AuthenticationType extends ExpandableStringEnum { + /** Static value Invalid for AuthenticationType. */ + public static final AuthenticationType INVALID = fromString("Invalid"); + + /** Static value AzureActiveDirectory for AuthenticationType. */ + public static final AuthenticationType AZURE_ACTIVE_DIRECTORY = fromString("AzureActiveDirectory"); + + /** + * Creates or finds a AuthenticationType from its string representation. + * @param name a name to look for + * @return the corresponding AuthenticationType + */ + @JsonCreator + public static AuthenticationType fromString(String name) { + return fromString(name, AuthenticationType.class); + } + + /** + * @return known AuthenticationType values + */ + public static Collection values() { + return values(AuthenticationType.class); + } +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/AzureContainerDataFormat.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/AzureContainerDataFormat.java new file mode 100644 index 0000000000000..29c686ed6c5ba --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/AzureContainerDataFormat.java @@ -0,0 +1,44 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for AzureContainerDataFormat. + */ +public final class AzureContainerDataFormat extends ExpandableStringEnum { + /** Static value BlockBlob for AzureContainerDataFormat. */ + public static final AzureContainerDataFormat BLOCK_BLOB = fromString("BlockBlob"); + + /** Static value PageBlob for AzureContainerDataFormat. */ + public static final AzureContainerDataFormat PAGE_BLOB = fromString("PageBlob"); + + /** Static value AzureFile for AzureContainerDataFormat. */ + public static final AzureContainerDataFormat AZURE_FILE = fromString("AzureFile"); + + /** + * Creates or finds a AzureContainerDataFormat from its string representation. + * @param name a name to look for + * @return the corresponding AzureContainerDataFormat + */ + @JsonCreator + public static AzureContainerDataFormat fromString(String name) { + return fromString(name, AzureContainerDataFormat.class); + } + + /** + * @return known AzureContainerDataFormat values + */ + public static Collection values() { + return values(AzureContainerDataFormat.class); + } +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/AzureContainerInfo.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/AzureContainerInfo.java new file mode 100644 index 0000000000000..17e5cb584a8ff --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/AzureContainerInfo.java @@ -0,0 +1,97 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Azure container mapping of the endpoint. + */ +public class AzureContainerInfo { + /** + * ID of the storage account credential used to access storage. + */ + @JsonProperty(value = "storageAccountCredentialId", required = true) + private String storageAccountCredentialId; + + /** + * Container name (Based on the data format specified, this represents the + * name of Azure Files/Page blob/Block blob). + */ + @JsonProperty(value = "containerName", required = true) + private String containerName; + + /** + * Storage format used for the file represented by the share. Possible + * values include: 'BlockBlob', 'PageBlob', 'AzureFile'. + */ + @JsonProperty(value = "dataFormat", required = true) + private AzureContainerDataFormat dataFormat; + + /** + * Get iD of the storage account credential used to access storage. + * + * @return the storageAccountCredentialId value + */ + public String storageAccountCredentialId() { + return this.storageAccountCredentialId; + } + + /** + * Set iD of the storage account credential used to access storage. + * + * @param storageAccountCredentialId the storageAccountCredentialId value to set + * @return the AzureContainerInfo object itself. + */ + public AzureContainerInfo withStorageAccountCredentialId(String storageAccountCredentialId) { + this.storageAccountCredentialId = storageAccountCredentialId; + return this; + } + + /** + * Get container name (Based on the data format specified, this represents the name of Azure Files/Page blob/Block blob). + * + * @return the containerName value + */ + public String containerName() { + return this.containerName; + } + + /** + * Set container name (Based on the data format specified, this represents the name of Azure Files/Page blob/Block blob). + * + * @param containerName the containerName value to set + * @return the AzureContainerInfo object itself. + */ + public AzureContainerInfo withContainerName(String containerName) { + this.containerName = containerName; + return this; + } + + /** + * Get storage format used for the file represented by the share. Possible values include: 'BlockBlob', 'PageBlob', 'AzureFile'. + * + * @return the dataFormat value + */ + public AzureContainerDataFormat dataFormat() { + return this.dataFormat; + } + + /** + * Set storage format used for the file represented by the share. Possible values include: 'BlockBlob', 'PageBlob', 'AzureFile'. + * + * @param dataFormat the dataFormat value to set + * @return the AzureContainerInfo object itself. + */ + public AzureContainerInfo withDataFormat(AzureContainerDataFormat dataFormat) { + this.dataFormat = dataFormat; + return this; + } + +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/BandwidthSchedule.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/BandwidthSchedule.java new file mode 100644 index 0000000000000..409e01244bf2b --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/BandwidthSchedule.java @@ -0,0 +1,157 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.databoxedge.v2019_03_01.implementation.BandwidthScheduleInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.databoxedge.v2019_03_01.implementation.DataBoxEdgeManager; +import java.util.List; + +/** + * Type representing BandwidthSchedule. + */ +public interface BandwidthSchedule extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the days value. + */ + List days(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the rateInMbps value. + */ + int rateInMbps(); + + /** + * @return the start value. + */ + String start(); + + /** + * @return the stop value. + */ + String stop(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the BandwidthSchedule definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithDataBoxEdgeDevice, DefinitionStages.WithDays, DefinitionStages.WithRateInMbps, DefinitionStages.WithStart, DefinitionStages.WithStop, DefinitionStages.WithCreate { + } + + /** + * Grouping of BandwidthSchedule definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a BandwidthSchedule definition. + */ + interface Blank extends WithDataBoxEdgeDevice { + } + + /** + * The stage of the bandwidthschedule definition allowing to specify DataBoxEdgeDevice. + */ + interface WithDataBoxEdgeDevice { + /** + * Specifies deviceName, resourceGroupName. + * @param deviceName The device name + * @param resourceGroupName The resource group name + * @return the next definition stage + */ + WithDays withExistingDataBoxEdgeDevice(String deviceName, String resourceGroupName); + } + + /** + * The stage of the bandwidthschedule definition allowing to specify Days. + */ + interface WithDays { + /** + * Specifies days. + * @param days The days of the week when this schedule is applicable + * @return the next definition stage + */ + WithRateInMbps withDays(List days); + } + + /** + * The stage of the bandwidthschedule definition allowing to specify RateInMbps. + */ + interface WithRateInMbps { + /** + * Specifies rateInMbps. + * @param rateInMbps The bandwidth rate in Mbps + * @return the next definition stage + */ + WithStart withRateInMbps(int rateInMbps); + } + + /** + * The stage of the bandwidthschedule definition allowing to specify Start. + */ + interface WithStart { + /** + * Specifies start. + * @param start The start time of the schedule in UTC + * @return the next definition stage + */ + WithStop withStart(String start); + } + + /** + * The stage of the bandwidthschedule definition allowing to specify Stop. + */ + interface WithStop { + /** + * Specifies stop. + * @param stop The stop time of the schedule in UTC + * @return the next definition stage + */ + WithCreate withStop(String stop); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable { + } + } + /** + * The template for a BandwidthSchedule update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable { + } + + /** + * Grouping of BandwidthSchedule update stages. + */ + interface UpdateStages { + } +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/BandwidthSchedules.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/BandwidthSchedules.java new file mode 100644 index 0000000000000..8f40449c6cae5 --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/BandwidthSchedules.java @@ -0,0 +1,53 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.databoxedge.v2019_03_01.implementation.BandwidthSchedulesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing BandwidthSchedules. + */ +public interface BandwidthSchedules extends SupportsCreating, HasInner { + /** + * Gets the properties of the specified bandwidth schedule. + * + * @param deviceName The device name. + * @param name The bandwidth schedule name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String deviceName, String name, String resourceGroupName); + + /** + * Gets all the bandwidth schedules for a data box edge/gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByDataBoxEdgeDeviceAsync(final String deviceName, final String resourceGroupName); + + /** + * Deletes the specified bandwidth schedule. + * + * @param deviceName The device name. + * @param name The bandwidth schedule name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String deviceName, String name, String resourceGroupName); + +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/ClientAccessRight.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/ClientAccessRight.java new file mode 100644 index 0000000000000..f3f350bdcff99 --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/ClientAccessRight.java @@ -0,0 +1,71 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The mapping between a particular client IP and the type of access client has + * on the NFS share. + */ +public class ClientAccessRight { + /** + * IP of the client. + */ + @JsonProperty(value = "client", required = true) + private String client; + + /** + * Type of access to be allowed for the client. Possible values include: + * 'NoAccess', 'ReadOnly', 'ReadWrite'. + */ + @JsonProperty(value = "accessPermission", required = true) + private ClientPermissionType accessPermission; + + /** + * Get iP of the client. + * + * @return the client value + */ + public String client() { + return this.client; + } + + /** + * Set iP of the client. + * + * @param client the client value to set + * @return the ClientAccessRight object itself. + */ + public ClientAccessRight withClient(String client) { + this.client = client; + return this; + } + + /** + * Get type of access to be allowed for the client. Possible values include: 'NoAccess', 'ReadOnly', 'ReadWrite'. + * + * @return the accessPermission value + */ + public ClientPermissionType accessPermission() { + return this.accessPermission; + } + + /** + * Set type of access to be allowed for the client. Possible values include: 'NoAccess', 'ReadOnly', 'ReadWrite'. + * + * @param accessPermission the accessPermission value to set + * @return the ClientAccessRight object itself. + */ + public ClientAccessRight withAccessPermission(ClientPermissionType accessPermission) { + this.accessPermission = accessPermission; + return this; + } + +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/ClientPermissionType.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/ClientPermissionType.java new file mode 100644 index 0000000000000..52244f41879c2 --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/ClientPermissionType.java @@ -0,0 +1,44 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ClientPermissionType. + */ +public final class ClientPermissionType extends ExpandableStringEnum { + /** Static value NoAccess for ClientPermissionType. */ + public static final ClientPermissionType NO_ACCESS = fromString("NoAccess"); + + /** Static value ReadOnly for ClientPermissionType. */ + public static final ClientPermissionType READ_ONLY = fromString("ReadOnly"); + + /** Static value ReadWrite for ClientPermissionType. */ + public static final ClientPermissionType READ_WRITE = fromString("ReadWrite"); + + /** + * Creates or finds a ClientPermissionType from its string representation. + * @param name a name to look for + * @return the corresponding ClientPermissionType + */ + @JsonCreator + public static ClientPermissionType fromString(String name) { + return fromString(name, ClientPermissionType.class); + } + + /** + * @return known ClientPermissionType values + */ + public static Collection values() { + return values(ClientPermissionType.class); + } +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/ContactDetails.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/ContactDetails.java new file mode 100644 index 0000000000000..7d4fd52fd7145 --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/ContactDetails.java @@ -0,0 +1,122 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Contains all the contact details of the customer. + */ +public class ContactDetails { + /** + * The contact person name. + */ + @JsonProperty(value = "contactPerson", required = true) + private String contactPerson; + + /** + * The name of the company. + */ + @JsonProperty(value = "companyName", required = true) + private String companyName; + + /** + * The phone number. + */ + @JsonProperty(value = "phone", required = true) + private String phone; + + /** + * The email list. + */ + @JsonProperty(value = "emailList", required = true) + private List emailList; + + /** + * Get the contact person name. + * + * @return the contactPerson value + */ + public String contactPerson() { + return this.contactPerson; + } + + /** + * Set the contact person name. + * + * @param contactPerson the contactPerson value to set + * @return the ContactDetails object itself. + */ + public ContactDetails withContactPerson(String contactPerson) { + this.contactPerson = contactPerson; + return this; + } + + /** + * Get the name of the company. + * + * @return the companyName value + */ + public String companyName() { + return this.companyName; + } + + /** + * Set the name of the company. + * + * @param companyName the companyName value to set + * @return the ContactDetails object itself. + */ + public ContactDetails withCompanyName(String companyName) { + this.companyName = companyName; + return this; + } + + /** + * Get the phone number. + * + * @return the phone value + */ + public String phone() { + return this.phone; + } + + /** + * Set the phone number. + * + * @param phone the phone value to set + * @return the ContactDetails object itself. + */ + public ContactDetails withPhone(String phone) { + this.phone = phone; + return this; + } + + /** + * Get the email list. + * + * @return the emailList value + */ + public List emailList() { + return this.emailList; + } + + /** + * Set the email list. + * + * @param emailList the emailList value to set + * @return the ContactDetails object itself. + */ + public ContactDetails withEmailList(List emailList) { + this.emailList = emailList; + return this; + } + +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/DataBoxEdgeDevice.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/DataBoxEdgeDevice.java new file mode 100644 index 0000000000000..abf618c83e5c3 --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/DataBoxEdgeDevice.java @@ -0,0 +1,288 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.databoxedge.v2019_03_01.implementation.DataBoxEdgeManager; +import java.util.List; +import com.microsoft.azure.management.databoxedge.v2019_03_01.implementation.DataBoxEdgeDeviceInner; + +/** + * Type representing DataBoxEdgeDevice. + */ +public interface DataBoxEdgeDevice extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the configuredRoleTypes value. + */ + List configuredRoleTypes(); + + /** + * @return the culture value. + */ + String culture(); + + /** + * @return the dataBoxEdgeDeviceStatus value. + */ + DataBoxEdgeDeviceStatus dataBoxEdgeDeviceStatus(); + + /** + * @return the description value. + */ + String description(); + + /** + * @return the deviceHcsVersion value. + */ + String deviceHcsVersion(); + + /** + * @return the deviceLocalCapacity value. + */ + Long deviceLocalCapacity(); + + /** + * @return the deviceModel value. + */ + String deviceModel(); + + /** + * @return the deviceSoftwareVersion value. + */ + String deviceSoftwareVersion(); + + /** + * @return the deviceType value. + */ + DeviceType deviceType(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the friendlyName value. + */ + String friendlyName(); + + /** + * @return the modelDescription value. + */ + String modelDescription(); + + /** + * @return the serialNumber value. + */ + String serialNumber(); + + /** + * @return the sku value. + */ + Sku sku(); + + /** + * @return the timeZone value. + */ + String timeZone(); + + /** + * The entirety of the DataBoxEdgeDevice definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of DataBoxEdgeDevice definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a DataBoxEdgeDevice definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the DataBoxEdgeDevice definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the databoxedgedevice definition allowing to specify DataBoxEdgeDeviceStatus. + */ + interface WithDataBoxEdgeDeviceStatus { + /** + * Specifies dataBoxEdgeDeviceStatus. + * @param dataBoxEdgeDeviceStatus The status of the Data Box Edge/Gateway device. Possible values include: 'ReadyToSetup', 'Online', 'Offline', 'NeedsAttention', 'Disconnected', 'PartiallyDisconnected' + * @return the next definition stage + */ + WithCreate withDataBoxEdgeDeviceStatus(DataBoxEdgeDeviceStatus dataBoxEdgeDeviceStatus); + } + + /** + * The stage of the databoxedgedevice definition allowing to specify Description. + */ + interface WithDescription { + /** + * Specifies description. + * @param description The Description of the Data Box Edge/Gateway device + * @return the next definition stage + */ + WithCreate withDescription(String description); + } + + /** + * The stage of the databoxedgedevice definition allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag The etag for the devices + * @return the next definition stage + */ + WithCreate withEtag(String etag); + } + + /** + * The stage of the databoxedgedevice definition allowing to specify FriendlyName. + */ + interface WithFriendlyName { + /** + * Specifies friendlyName. + * @param friendlyName The Data Box Edge/Gateway device name + * @return the next definition stage + */ + WithCreate withFriendlyName(String friendlyName); + } + + /** + * The stage of the databoxedgedevice definition allowing to specify ModelDescription. + */ + interface WithModelDescription { + /** + * Specifies modelDescription. + * @param modelDescription The description of the Data Box Edge/Gateway device model + * @return the next definition stage + */ + WithCreate withModelDescription(String modelDescription); + } + + /** + * The stage of the databoxedgedevice definition allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + * @param sku The SKU type + * @return the next definition stage + */ + WithCreate withSku(Sku sku); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithDataBoxEdgeDeviceStatus, DefinitionStages.WithDescription, DefinitionStages.WithEtag, DefinitionStages.WithFriendlyName, DefinitionStages.WithModelDescription, DefinitionStages.WithSku { + } + } + /** + * The template for a DataBoxEdgeDevice update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithDataBoxEdgeDeviceStatus, UpdateStages.WithDescription, UpdateStages.WithEtag, UpdateStages.WithFriendlyName, UpdateStages.WithModelDescription, UpdateStages.WithSku { + } + + /** + * Grouping of DataBoxEdgeDevice update stages. + */ + interface UpdateStages { + /** + * The stage of the databoxedgedevice update allowing to specify DataBoxEdgeDeviceStatus. + */ + interface WithDataBoxEdgeDeviceStatus { + /** + * Specifies dataBoxEdgeDeviceStatus. + * @param dataBoxEdgeDeviceStatus The status of the Data Box Edge/Gateway device. Possible values include: 'ReadyToSetup', 'Online', 'Offline', 'NeedsAttention', 'Disconnected', 'PartiallyDisconnected' + * @return the next update stage + */ + Update withDataBoxEdgeDeviceStatus(DataBoxEdgeDeviceStatus dataBoxEdgeDeviceStatus); + } + + /** + * The stage of the databoxedgedevice update allowing to specify Description. + */ + interface WithDescription { + /** + * Specifies description. + * @param description The Description of the Data Box Edge/Gateway device + * @return the next update stage + */ + Update withDescription(String description); + } + + /** + * The stage of the databoxedgedevice update allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag The etag for the devices + * @return the next update stage + */ + Update withEtag(String etag); + } + + /** + * The stage of the databoxedgedevice update allowing to specify FriendlyName. + */ + interface WithFriendlyName { + /** + * Specifies friendlyName. + * @param friendlyName The Data Box Edge/Gateway device name + * @return the next update stage + */ + Update withFriendlyName(String friendlyName); + } + + /** + * The stage of the databoxedgedevice update allowing to specify ModelDescription. + */ + interface WithModelDescription { + /** + * Specifies modelDescription. + * @param modelDescription The description of the Data Box Edge/Gateway device model + * @return the next update stage + */ + Update withModelDescription(String modelDescription); + } + + /** + * The stage of the databoxedgedevice update allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + * @param sku The SKU type + * @return the next update stage + */ + Update withSku(Sku sku); + } + + } +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/DataBoxEdgeDeviceExtendedInfo.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/DataBoxEdgeDeviceExtendedInfo.java new file mode 100644 index 0000000000000..78ca4c6f237de --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/DataBoxEdgeDeviceExtendedInfo.java @@ -0,0 +1,50 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.databoxedge.v2019_03_01.implementation.DataBoxEdgeManager; +import com.microsoft.azure.management.databoxedge.v2019_03_01.implementation.DataBoxEdgeDeviceExtendedInfoInner; + +/** + * Type representing DataBoxEdgeDeviceExtendedInfo. + */ +public interface DataBoxEdgeDeviceExtendedInfo extends HasInner, HasManager { + /** + * @return the encryptionKey value. + */ + String encryptionKey(); + + /** + * @return the encryptionKeyThumbprint value. + */ + String encryptionKeyThumbprint(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the resourceKey value. + */ + String resourceKey(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/DataBoxEdgeDeviceJob.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/DataBoxEdgeDeviceJob.java new file mode 100644 index 0000000000000..e44f2136b60f0 --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/DataBoxEdgeDeviceJob.java @@ -0,0 +1,103 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.databoxedge.v2019_03_01.implementation.JobInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.databoxedge.v2019_03_01.implementation.DataBoxEdgeManager; +import org.joda.time.DateTime; + +/** + * Type representing DataBoxEdgeDeviceJob. + */ +public interface DataBoxEdgeDeviceJob extends HasInner, Indexable, Refreshable, HasManager { + /** + * @return the currentStage value. + */ + UpdateOperationStage currentStage(); + + /** + * @return the downloadProgress value. + */ + UpdateDownloadProgress downloadProgress(); + + /** + * @return the endTime value. + */ + DateTime endTime(); + + /** + * @return the error value. + */ + JobErrorDetails error(); + + /** + * @return the errorManifestFile value. + */ + String errorManifestFile(); + + /** + * @return the folder value. + */ + String folder(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the installProgress value. + */ + UpdateInstallProgress installProgress(); + + /** + * @return the jobType value. + */ + JobType jobType(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the percentComplete value. + */ + Integer percentComplete(); + + /** + * @return the shareId value. + */ + String shareId(); + + /** + * @return the startTime value. + */ + DateTime startTime(); + + /** + * @return the status value. + */ + JobStatus status(); + + /** + * @return the totalRefreshErrors value. + */ + Integer totalRefreshErrors(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/DataBoxEdgeDeviceJobModel.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/DataBoxEdgeDeviceJobModel.java new file mode 100644 index 0000000000000..6a0d0388ba9b1 --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/DataBoxEdgeDeviceJobModel.java @@ -0,0 +1,103 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.databoxedge.v2019_03_01.implementation.JobInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.databoxedge.v2019_03_01.implementation.DataBoxEdgeManager; +import org.joda.time.DateTime; + +/** + * Type representing DataBoxEdgeDeviceJobModel. + */ +public interface DataBoxEdgeDeviceJobModel extends HasInner, Indexable, Refreshable, HasManager { + /** + * @return the currentStage value. + */ + UpdateOperationStage currentStage(); + + /** + * @return the downloadProgress value. + */ + UpdateDownloadProgress downloadProgress(); + + /** + * @return the endTime value. + */ + DateTime endTime(); + + /** + * @return the error value. + */ + JobErrorDetails error(); + + /** + * @return the errorManifestFile value. + */ + String errorManifestFile(); + + /** + * @return the folder value. + */ + String folder(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the installProgress value. + */ + UpdateInstallProgress installProgress(); + + /** + * @return the jobType value. + */ + JobType jobType(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the percentComplete value. + */ + Integer percentComplete(); + + /** + * @return the shareId value. + */ + String shareId(); + + /** + * @return the startTime value. + */ + DateTime startTime(); + + /** + * @return the status value. + */ + JobStatus status(); + + /** + * @return the totalRefreshErrors value. + */ + Integer totalRefreshErrors(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/DataBoxEdgeDevicePatch.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/DataBoxEdgeDevicePatch.java new file mode 100644 index 0000000000000..0b1f59772d698 --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/DataBoxEdgeDevicePatch.java @@ -0,0 +1,44 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Data Box Edge/Gateway device patch. + */ +public class DataBoxEdgeDevicePatch { + /** + * The tags attached to the Data Box Edge/Gateway resource. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Get the tags attached to the Data Box Edge/Gateway resource. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags attached to the Data Box Edge/Gateway resource. + * + * @param tags the tags value to set + * @return the DataBoxEdgeDevicePatch object itself. + */ + public DataBoxEdgeDevicePatch withTags(Map tags) { + this.tags = tags; + return this; + } + +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/DataBoxEdgeDeviceStatus.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/DataBoxEdgeDeviceStatus.java new file mode 100644 index 0000000000000..10693b697dbca --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/DataBoxEdgeDeviceStatus.java @@ -0,0 +1,53 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for DataBoxEdgeDeviceStatus. + */ +public final class DataBoxEdgeDeviceStatus extends ExpandableStringEnum { + /** Static value ReadyToSetup for DataBoxEdgeDeviceStatus. */ + public static final DataBoxEdgeDeviceStatus READY_TO_SETUP = fromString("ReadyToSetup"); + + /** Static value Online for DataBoxEdgeDeviceStatus. */ + public static final DataBoxEdgeDeviceStatus ONLINE = fromString("Online"); + + /** Static value Offline for DataBoxEdgeDeviceStatus. */ + public static final DataBoxEdgeDeviceStatus OFFLINE = fromString("Offline"); + + /** Static value NeedsAttention for DataBoxEdgeDeviceStatus. */ + public static final DataBoxEdgeDeviceStatus NEEDS_ATTENTION = fromString("NeedsAttention"); + + /** Static value Disconnected for DataBoxEdgeDeviceStatus. */ + public static final DataBoxEdgeDeviceStatus DISCONNECTED = fromString("Disconnected"); + + /** Static value PartiallyDisconnected for DataBoxEdgeDeviceStatus. */ + public static final DataBoxEdgeDeviceStatus PARTIALLY_DISCONNECTED = fromString("PartiallyDisconnected"); + + /** + * Creates or finds a DataBoxEdgeDeviceStatus from its string representation. + * @param name a name to look for + * @return the corresponding DataBoxEdgeDeviceStatus + */ + @JsonCreator + public static DataBoxEdgeDeviceStatus fromString(String name) { + return fromString(name, DataBoxEdgeDeviceStatus.class); + } + + /** + * @return known DataBoxEdgeDeviceStatus values + */ + public static Collection values() { + return values(DataBoxEdgeDeviceStatus.class); + } +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/DataPolicy.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/DataPolicy.java new file mode 100644 index 0000000000000..97285618a1c0d --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/DataPolicy.java @@ -0,0 +1,41 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for DataPolicy. + */ +public final class DataPolicy extends ExpandableStringEnum { + /** Static value Cloud for DataPolicy. */ + public static final DataPolicy CLOUD = fromString("Cloud"); + + /** Static value Local for DataPolicy. */ + public static final DataPolicy LOCAL = fromString("Local"); + + /** + * Creates or finds a DataPolicy from its string representation. + * @param name a name to look for + * @return the corresponding DataPolicy + */ + @JsonCreator + public static DataPolicy fromString(String name) { + return fromString(name, DataPolicy.class); + } + + /** + * @return known DataPolicy values + */ + public static Collection values() { + return values(DataPolicy.class); + } +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/DayOfWeek.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/DayOfWeek.java new file mode 100644 index 0000000000000..232f1e7db646e --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/DayOfWeek.java @@ -0,0 +1,56 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for DayOfWeek. + */ +public final class DayOfWeek extends ExpandableStringEnum { + /** Static value Sunday for DayOfWeek. */ + public static final DayOfWeek SUNDAY = fromString("Sunday"); + + /** Static value Monday for DayOfWeek. */ + public static final DayOfWeek MONDAY = fromString("Monday"); + + /** Static value Tuesday for DayOfWeek. */ + public static final DayOfWeek TUESDAY = fromString("Tuesday"); + + /** Static value Wednesday for DayOfWeek. */ + public static final DayOfWeek WEDNESDAY = fromString("Wednesday"); + + /** Static value Thursday for DayOfWeek. */ + public static final DayOfWeek THURSDAY = fromString("Thursday"); + + /** Static value Friday for DayOfWeek. */ + public static final DayOfWeek FRIDAY = fromString("Friday"); + + /** Static value Saturday for DayOfWeek. */ + public static final DayOfWeek SATURDAY = fromString("Saturday"); + + /** + * Creates or finds a DayOfWeek from its string representation. + * @param name a name to look for + * @return the corresponding DayOfWeek + */ + @JsonCreator + public static DayOfWeek fromString(String name) { + return fromString(name, DayOfWeek.class); + } + + /** + * @return known DayOfWeek values + */ + public static Collection values() { + return values(DayOfWeek.class); + } +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/DeviceType.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/DeviceType.java new file mode 100644 index 0000000000000..bf3ead48af5b5 --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/DeviceType.java @@ -0,0 +1,38 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for DeviceType. + */ +public final class DeviceType extends ExpandableStringEnum { + /** Static value DataBoxEdgeDevice for DeviceType. */ + public static final DeviceType DATA_BOX_EDGE_DEVICE = fromString("DataBoxEdgeDevice"); + + /** + * Creates or finds a DeviceType from its string representation. + * @param name a name to look for + * @return the corresponding DeviceType + */ + @JsonCreator + public static DeviceType fromString(String name) { + return fromString(name, DeviceType.class); + } + + /** + * @return known DeviceType values + */ + public static Collection values() { + return values(DeviceType.class); + } +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/Devices.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/Devices.java new file mode 100644 index 0000000000000..7e772209458c4 --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/Devices.java @@ -0,0 +1,145 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01; + +import rx.Observable; +import com.microsoft.azure.management.databoxedge.v2019_03_01.DataBoxEdgeDevice; +import rx.Completable; + +/** + * Type representing Devices. + */ +public interface Devices { + /** + * Begins definition for a new DataBoxEdgeDevice resource. + * @param name resource name. + * @return the first stage of the new DataBoxEdgeDevice definition. + */ + DataBoxEdgeDevice.DefinitionStages.Blank defineDataBoxEdgeDevice(String name); + + /** + * Gets the properties of the data box edge/gateway device. + * + * @param resourceGroupName resource group name + * @param name resource name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getByResourceGroupAsync(String resourceGroupName, String name); + + /** + * Gets all the data box edge/gateway devices in a resource group. + * + * @param resourceGroupName resource group name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByResourceGroupAsync(String resourceGroupName); + + /** + * Gets all the data box edge/gateway devices in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(); + + /** + * Deletes the data box edge/gateway device. + * + * @param resourceGroupName resource group name + * @param name resource name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String name); + + /** + * Downloads the updates on a data box edge/gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable downloadUpdatesAsync(String deviceName, String resourceGroupName); + + /** + * Gets additional information for the specified data box edge/gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getExtendedInformationAsync(String deviceName, String resourceGroupName); + + /** + * Installs the updates on the data box edge/gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable installUpdatesAsync(String deviceName, String resourceGroupName); + + /** + * Scans for updates on a data box edge/gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable scanForUpdatesAsync(String deviceName, String resourceGroupName); + + /** + * Gets information about the availability of updates based on the last scan of the device. It also gets information about any ongoing download or install jobs on the device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getUpdateSummaryAsync(String deviceName, String resourceGroupName); + + /** + * Uploads registration certificate for the device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param parameters The upload certificate request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable uploadCertificateAsync(String deviceName, String resourceGroupName, UploadCertificateRequest parameters); + + /** + * Gets the network settings of the specified data box edge/gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getNetworkSettingsAsync(String deviceName, String resourceGroupName); + + /** + * Updates the security settings on a data box edge/gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param securitySettings The security settings. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable createOrUpdateSecuritySettingsAsync(String deviceName, String resourceGroupName, SecuritySettings securitySettings); + +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/DownloadPhase.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/DownloadPhase.java new file mode 100644 index 0000000000000..4baf033146322 --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/DownloadPhase.java @@ -0,0 +1,47 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for DownloadPhase. + */ +public final class DownloadPhase extends ExpandableStringEnum { + /** Static value Unknown for DownloadPhase. */ + public static final DownloadPhase UNKNOWN = fromString("Unknown"); + + /** Static value Initializing for DownloadPhase. */ + public static final DownloadPhase INITIALIZING = fromString("Initializing"); + + /** Static value Downloading for DownloadPhase. */ + public static final DownloadPhase DOWNLOADING = fromString("Downloading"); + + /** Static value Verifying for DownloadPhase. */ + public static final DownloadPhase VERIFYING = fromString("Verifying"); + + /** + * Creates or finds a DownloadPhase from its string representation. + * @param name a name to look for + * @return the corresponding DownloadPhase + */ + @JsonCreator + public static DownloadPhase fromString(String name) { + return fromString(name, DownloadPhase.class); + } + + /** + * @return known DownloadPhase values + */ + public static Collection values() { + return values(DownloadPhase.class); + } +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/EncryptionAlgorithm.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/EncryptionAlgorithm.java new file mode 100644 index 0000000000000..be1ecbefd7508 --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/EncryptionAlgorithm.java @@ -0,0 +1,44 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for EncryptionAlgorithm. + */ +public final class EncryptionAlgorithm extends ExpandableStringEnum { + /** Static value None for EncryptionAlgorithm. */ + public static final EncryptionAlgorithm NONE = fromString("None"); + + /** Static value AES256 for EncryptionAlgorithm. */ + public static final EncryptionAlgorithm AES256 = fromString("AES256"); + + /** Static value RSAES_PKCS1_v_1_5 for EncryptionAlgorithm. */ + public static final EncryptionAlgorithm RSAES_PKCS1_V_1_5 = fromString("RSAES_PKCS1_v_1_5"); + + /** + * Creates or finds a EncryptionAlgorithm from its string representation. + * @param name a name to look for + * @return the corresponding EncryptionAlgorithm + */ + @JsonCreator + public static EncryptionAlgorithm fromString(String name) { + return fromString(name, EncryptionAlgorithm.class); + } + + /** + * @return known EncryptionAlgorithm values + */ + public static Collection values() { + return values(EncryptionAlgorithm.class); + } +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/FileEventTrigger.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/FileEventTrigger.java new file mode 100644 index 0000000000000..9cf7274aeb1fb --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/FileEventTrigger.java @@ -0,0 +1,105 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.management.databoxedge.v2019_03_01.implementation.TriggerInner; + +/** + * Trigger details. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind", defaultImpl = FileEventTrigger.class) +@JsonTypeName("FileEvent") +@JsonFlatten +public class FileEventTrigger extends TriggerInner { + /** + * File event source details. + */ + @JsonProperty(value = "properties.sourceInfo", required = true) + private FileSourceInfo sourceInfo; + + /** + * Role sink info. + */ + @JsonProperty(value = "properties.sinkInfo", required = true) + private RoleSinkInfo sinkInfo; + + /** + * A custom context tag typically used to correlate the trigger against its + * usage. For example, if a periodic timer trigger is intended for certain + * specific IoT modules in the device, the tag can be the name or the image + * URL of the module. + */ + @JsonProperty(value = "properties.customContextTag") + private String customContextTag; + + /** + * Get file event source details. + * + * @return the sourceInfo value + */ + public FileSourceInfo sourceInfo() { + return this.sourceInfo; + } + + /** + * Set file event source details. + * + * @param sourceInfo the sourceInfo value to set + * @return the FileEventTrigger object itself. + */ + public FileEventTrigger withSourceInfo(FileSourceInfo sourceInfo) { + this.sourceInfo = sourceInfo; + return this; + } + + /** + * Get role sink info. + * + * @return the sinkInfo value + */ + public RoleSinkInfo sinkInfo() { + return this.sinkInfo; + } + + /** + * Set role sink info. + * + * @param sinkInfo the sinkInfo value to set + * @return the FileEventTrigger object itself. + */ + public FileEventTrigger withSinkInfo(RoleSinkInfo sinkInfo) { + this.sinkInfo = sinkInfo; + return this; + } + + /** + * Get a custom context tag typically used to correlate the trigger against its usage. For example, if a periodic timer trigger is intended for certain specific IoT modules in the device, the tag can be the name or the image URL of the module. + * + * @return the customContextTag value + */ + public String customContextTag() { + return this.customContextTag; + } + + /** + * Set a custom context tag typically used to correlate the trigger against its usage. For example, if a periodic timer trigger is intended for certain specific IoT modules in the device, the tag can be the name or the image URL of the module. + * + * @param customContextTag the customContextTag value to set + * @return the FileEventTrigger object itself. + */ + public FileEventTrigger withCustomContextTag(String customContextTag) { + this.customContextTag = customContextTag; + return this; + } + +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/FileSourceInfo.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/FileSourceInfo.java new file mode 100644 index 0000000000000..c11f3c1729aa6 --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/FileSourceInfo.java @@ -0,0 +1,43 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * File source details. + */ +public class FileSourceInfo { + /** + * File share ID. + */ + @JsonProperty(value = "shareId", required = true) + private String shareId; + + /** + * Get file share ID. + * + * @return the shareId value + */ + public String shareId() { + return this.shareId; + } + + /** + * Set file share ID. + * + * @param shareId the shareId value to set + * @return the FileSourceInfo object itself. + */ + public FileSourceInfo withShareId(String shareId) { + this.shareId = shareId; + return this; + } + +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/InstallRebootBehavior.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/InstallRebootBehavior.java new file mode 100644 index 0000000000000..2b4d76b7e0d9b --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/InstallRebootBehavior.java @@ -0,0 +1,44 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for InstallRebootBehavior. + */ +public final class InstallRebootBehavior extends ExpandableStringEnum { + /** Static value NeverReboots for InstallRebootBehavior. */ + public static final InstallRebootBehavior NEVER_REBOOTS = fromString("NeverReboots"); + + /** Static value RequiresReboot for InstallRebootBehavior. */ + public static final InstallRebootBehavior REQUIRES_REBOOT = fromString("RequiresReboot"); + + /** Static value RequestReboot for InstallRebootBehavior. */ + public static final InstallRebootBehavior REQUEST_REBOOT = fromString("RequestReboot"); + + /** + * Creates or finds a InstallRebootBehavior from its string representation. + * @param name a name to look for + * @return the corresponding InstallRebootBehavior + */ + @JsonCreator + public static InstallRebootBehavior fromString(String name) { + return fromString(name, InstallRebootBehavior.class); + } + + /** + * @return known InstallRebootBehavior values + */ + public static Collection values() { + return values(InstallRebootBehavior.class); + } +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/IoTDeviceInfo.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/IoTDeviceInfo.java new file mode 100644 index 0000000000000..ee9ed60303248 --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/IoTDeviceInfo.java @@ -0,0 +1,95 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Metadata of IoT device/IoT Edge device to be configured. + */ +public class IoTDeviceInfo { + /** + * ID of the IoT device/edge device. + */ + @JsonProperty(value = "deviceId", required = true) + private String deviceId; + + /** + * Host name for the IoT hub associated to the device. + */ + @JsonProperty(value = "ioTHostHub", required = true) + private String ioTHostHub; + + /** + * IoT device authentication info. + */ + @JsonProperty(value = "authentication") + private Authentication authentication; + + /** + * Get iD of the IoT device/edge device. + * + * @return the deviceId value + */ + public String deviceId() { + return this.deviceId; + } + + /** + * Set iD of the IoT device/edge device. + * + * @param deviceId the deviceId value to set + * @return the IoTDeviceInfo object itself. + */ + public IoTDeviceInfo withDeviceId(String deviceId) { + this.deviceId = deviceId; + return this; + } + + /** + * Get host name for the IoT hub associated to the device. + * + * @return the ioTHostHub value + */ + public String ioTHostHub() { + return this.ioTHostHub; + } + + /** + * Set host name for the IoT hub associated to the device. + * + * @param ioTHostHub the ioTHostHub value to set + * @return the IoTDeviceInfo object itself. + */ + public IoTDeviceInfo withIoTHostHub(String ioTHostHub) { + this.ioTHostHub = ioTHostHub; + return this; + } + + /** + * Get ioT device authentication info. + * + * @return the authentication value + */ + public Authentication authentication() { + return this.authentication; + } + + /** + * Set ioT device authentication info. + * + * @param authentication the authentication value to set + * @return the IoTDeviceInfo object itself. + */ + public IoTDeviceInfo withAuthentication(Authentication authentication) { + this.authentication = authentication; + return this; + } + +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/IoTRole.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/IoTRole.java new file mode 100644 index 0000000000000..75c96a7f07027 --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/IoTRole.java @@ -0,0 +1,156 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.management.databoxedge.v2019_03_01.implementation.RoleInner; + +/** + * Compute role. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind", defaultImpl = IoTRole.class) +@JsonTypeName("IOT") +@JsonFlatten +public class IoTRole extends RoleInner { + /** + * Host OS supported by the IoT role. Possible values include: 'Windows', + * 'Linux'. + */ + @JsonProperty(value = "properties.hostPlatform", required = true) + private PlatformType hostPlatform; + + /** + * IoT device metadata to which data box edge device needs to be connected. + */ + @JsonProperty(value = "properties.ioTDeviceDetails", required = true) + private IoTDeviceInfo ioTDeviceDetails; + + /** + * IoT edge device to which the IoT role needs to be configured. + */ + @JsonProperty(value = "properties.ioTEdgeDeviceDetails", required = true) + private IoTDeviceInfo ioTEdgeDeviceDetails; + + /** + * Mount points of shares in role(s). + */ + @JsonProperty(value = "properties.shareMappings") + private List shareMappings; + + /** + * Role status. Possible values include: 'Enabled', 'Disabled'. + */ + @JsonProperty(value = "properties.roleStatus", required = true) + private RoleStatus roleStatus; + + /** + * Get host OS supported by the IoT role. Possible values include: 'Windows', 'Linux'. + * + * @return the hostPlatform value + */ + public PlatformType hostPlatform() { + return this.hostPlatform; + } + + /** + * Set host OS supported by the IoT role. Possible values include: 'Windows', 'Linux'. + * + * @param hostPlatform the hostPlatform value to set + * @return the IoTRole object itself. + */ + public IoTRole withHostPlatform(PlatformType hostPlatform) { + this.hostPlatform = hostPlatform; + return this; + } + + /** + * Get ioT device metadata to which data box edge device needs to be connected. + * + * @return the ioTDeviceDetails value + */ + public IoTDeviceInfo ioTDeviceDetails() { + return this.ioTDeviceDetails; + } + + /** + * Set ioT device metadata to which data box edge device needs to be connected. + * + * @param ioTDeviceDetails the ioTDeviceDetails value to set + * @return the IoTRole object itself. + */ + public IoTRole withIoTDeviceDetails(IoTDeviceInfo ioTDeviceDetails) { + this.ioTDeviceDetails = ioTDeviceDetails; + return this; + } + + /** + * Get ioT edge device to which the IoT role needs to be configured. + * + * @return the ioTEdgeDeviceDetails value + */ + public IoTDeviceInfo ioTEdgeDeviceDetails() { + return this.ioTEdgeDeviceDetails; + } + + /** + * Set ioT edge device to which the IoT role needs to be configured. + * + * @param ioTEdgeDeviceDetails the ioTEdgeDeviceDetails value to set + * @return the IoTRole object itself. + */ + public IoTRole withIoTEdgeDeviceDetails(IoTDeviceInfo ioTEdgeDeviceDetails) { + this.ioTEdgeDeviceDetails = ioTEdgeDeviceDetails; + return this; + } + + /** + * Get mount points of shares in role(s). + * + * @return the shareMappings value + */ + public List shareMappings() { + return this.shareMappings; + } + + /** + * Set mount points of shares in role(s). + * + * @param shareMappings the shareMappings value to set + * @return the IoTRole object itself. + */ + public IoTRole withShareMappings(List shareMappings) { + this.shareMappings = shareMappings; + return this; + } + + /** + * Get role status. Possible values include: 'Enabled', 'Disabled'. + * + * @return the roleStatus value + */ + public RoleStatus roleStatus() { + return this.roleStatus; + } + + /** + * Set role status. Possible values include: 'Enabled', 'Disabled'. + * + * @param roleStatus the roleStatus value to set + * @return the IoTRole object itself. + */ + public IoTRole withRoleStatus(RoleStatus roleStatus) { + this.roleStatus = roleStatus; + return this; + } + +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/Ipv4Config.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/Ipv4Config.java new file mode 100644 index 0000000000000..4b6a593c64760 --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/Ipv4Config.java @@ -0,0 +1,62 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Details related to the IPv4 address configuration. + */ +public class Ipv4Config { + /** + * The IPv4 address of the network adapter. + */ + @JsonProperty(value = "ipAddress", access = JsonProperty.Access.WRITE_ONLY) + private String ipAddress; + + /** + * The IPv4 subnet of the network adapter. + */ + @JsonProperty(value = "subnet", access = JsonProperty.Access.WRITE_ONLY) + private String subnet; + + /** + * The IPv4 gateway of the network adapter. + */ + @JsonProperty(value = "gateway", access = JsonProperty.Access.WRITE_ONLY) + private String gateway; + + /** + * Get the IPv4 address of the network adapter. + * + * @return the ipAddress value + */ + public String ipAddress() { + return this.ipAddress; + } + + /** + * Get the IPv4 subnet of the network adapter. + * + * @return the subnet value + */ + public String subnet() { + return this.subnet; + } + + /** + * Get the IPv4 gateway of the network adapter. + * + * @return the gateway value + */ + public String gateway() { + return this.gateway; + } + +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/Ipv6Config.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/Ipv6Config.java new file mode 100644 index 0000000000000..c769d2da3eca5 --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/Ipv6Config.java @@ -0,0 +1,62 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Details related to the IPv6 address configuration. + */ +public class Ipv6Config { + /** + * The IPv6 address of the network adapter. + */ + @JsonProperty(value = "ipAddress", access = JsonProperty.Access.WRITE_ONLY) + private String ipAddress; + + /** + * The IPv6 prefix of the network adapter. + */ + @JsonProperty(value = "prefixLength", access = JsonProperty.Access.WRITE_ONLY) + private Integer prefixLength; + + /** + * The IPv6 gateway of the network adapter. + */ + @JsonProperty(value = "gateway", access = JsonProperty.Access.WRITE_ONLY) + private String gateway; + + /** + * Get the IPv6 address of the network adapter. + * + * @return the ipAddress value + */ + public String ipAddress() { + return this.ipAddress; + } + + /** + * Get the IPv6 prefix of the network adapter. + * + * @return the prefixLength value + */ + public Integer prefixLength() { + return this.prefixLength; + } + + /** + * Get the IPv6 gateway of the network adapter. + * + * @return the gateway value + */ + public String gateway() { + return this.gateway; + } + +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/JobErrorDetails.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/JobErrorDetails.java new file mode 100644 index 0000000000000..9c1a5656bb1ec --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/JobErrorDetails.java @@ -0,0 +1,63 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The job error information containing the list of job errors. + */ +public class JobErrorDetails { + /** + * The error details. + */ + @JsonProperty(value = "errorDetails", access = JsonProperty.Access.WRITE_ONLY) + private List errorDetails; + + /** + * The code intended for programmatic access. + */ + @JsonProperty(value = "code", access = JsonProperty.Access.WRITE_ONLY) + private String code; + + /** + * The message that describes the error in detail. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /** + * Get the error details. + * + * @return the errorDetails value + */ + public List errorDetails() { + return this.errorDetails; + } + + /** + * Get the code intended for programmatic access. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Get the message that describes the error in detail. + * + * @return the message value + */ + public String message() { + return this.message; + } + +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/JobErrorItem.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/JobErrorItem.java new file mode 100644 index 0000000000000..6a8836cd05804 --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/JobErrorItem.java @@ -0,0 +1,63 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The job error items. + */ +public class JobErrorItem { + /** + * The recommended actions. + */ + @JsonProperty(value = "recommendations", access = JsonProperty.Access.WRITE_ONLY) + private List recommendations; + + /** + * The code intended for programmatic access. + */ + @JsonProperty(value = "code", access = JsonProperty.Access.WRITE_ONLY) + private String code; + + /** + * The message that describes the error in detail. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /** + * Get the recommended actions. + * + * @return the recommendations value + */ + public List recommendations() { + return this.recommendations; + } + + /** + * Get the code intended for programmatic access. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Get the message that describes the error in detail. + * + * @return the message value + */ + public String message() { + return this.message; + } + +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/JobStatus.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/JobStatus.java new file mode 100644 index 0000000000000..6640c5e3d3223 --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/JobStatus.java @@ -0,0 +1,56 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for JobStatus. + */ +public final class JobStatus extends ExpandableStringEnum { + /** Static value Invalid for JobStatus. */ + public static final JobStatus INVALID = fromString("Invalid"); + + /** Static value Running for JobStatus. */ + public static final JobStatus RUNNING = fromString("Running"); + + /** Static value Succeeded for JobStatus. */ + public static final JobStatus SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for JobStatus. */ + public static final JobStatus FAILED = fromString("Failed"); + + /** Static value Canceled for JobStatus. */ + public static final JobStatus CANCELED = fromString("Canceled"); + + /** Static value Paused for JobStatus. */ + public static final JobStatus PAUSED = fromString("Paused"); + + /** Static value Scheduled for JobStatus. */ + public static final JobStatus SCHEDULED = fromString("Scheduled"); + + /** + * Creates or finds a JobStatus from its string representation. + * @param name a name to look for + * @return the corresponding JobStatus + */ + @JsonCreator + public static JobStatus fromString(String name) { + return fromString(name, JobStatus.class); + } + + /** + * @return known JobStatus values + */ + public static Collection values() { + return values(JobStatus.class); + } +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/JobType.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/JobType.java new file mode 100644 index 0000000000000..e78a82074770f --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/JobType.java @@ -0,0 +1,50 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for JobType. + */ +public final class JobType extends ExpandableStringEnum { + /** Static value Invalid for JobType. */ + public static final JobType INVALID = fromString("Invalid"); + + /** Static value ScanForUpdates for JobType. */ + public static final JobType SCAN_FOR_UPDATES = fromString("ScanForUpdates"); + + /** Static value DownloadUpdates for JobType. */ + public static final JobType DOWNLOAD_UPDATES = fromString("DownloadUpdates"); + + /** Static value InstallUpdates for JobType. */ + public static final JobType INSTALL_UPDATES = fromString("InstallUpdates"); + + /** Static value RefreshShare for JobType. */ + public static final JobType REFRESH_SHARE = fromString("RefreshShare"); + + /** + * Creates or finds a JobType from its string representation. + * @param name a name to look for + * @return the corresponding JobType + */ + @JsonCreator + public static JobType fromString(String name) { + return fromString(name, JobType.class); + } + + /** + * @return known JobType values + */ + public static Collection values() { + return values(JobType.class); + } +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/Jobs.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/Jobs.java new file mode 100644 index 0000000000000..b17cafbaef302 --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/Jobs.java @@ -0,0 +1,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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01; + +import rx.Observable; +import com.microsoft.azure.management.databoxedge.v2019_03_01.implementation.JobsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Jobs. + */ +public interface Jobs extends HasInner { + /** + * Gets the details of a specified job on a data box edge/gateway device. + * + * @param deviceName The device name. + * @param name The job name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String deviceName, String name, String resourceGroupName); + +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/MetricAggregationType.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/MetricAggregationType.java new file mode 100644 index 0000000000000..e7e5a37fb61fa --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/MetricAggregationType.java @@ -0,0 +1,56 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for MetricAggregationType. + */ +public final class MetricAggregationType extends ExpandableStringEnum { + /** Static value NotSpecified for MetricAggregationType. */ + public static final MetricAggregationType NOT_SPECIFIED = fromString("NotSpecified"); + + /** Static value None for MetricAggregationType. */ + public static final MetricAggregationType NONE = fromString("None"); + + /** Static value Average for MetricAggregationType. */ + public static final MetricAggregationType AVERAGE = fromString("Average"); + + /** Static value Minimum for MetricAggregationType. */ + public static final MetricAggregationType MINIMUM = fromString("Minimum"); + + /** Static value Maximum for MetricAggregationType. */ + public static final MetricAggregationType MAXIMUM = fromString("Maximum"); + + /** Static value Total for MetricAggregationType. */ + public static final MetricAggregationType TOTAL = fromString("Total"); + + /** Static value Count for MetricAggregationType. */ + public static final MetricAggregationType COUNT = fromString("Count"); + + /** + * Creates or finds a MetricAggregationType from its string representation. + * @param name a name to look for + * @return the corresponding MetricAggregationType + */ + @JsonCreator + public static MetricAggregationType fromString(String name) { + return fromString(name, MetricAggregationType.class); + } + + /** + * @return known MetricAggregationType values + */ + public static Collection values() { + return values(MetricAggregationType.class); + } +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/MetricCategory.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/MetricCategory.java new file mode 100644 index 0000000000000..559afe1576a8a --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/MetricCategory.java @@ -0,0 +1,41 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for MetricCategory. + */ +public final class MetricCategory extends ExpandableStringEnum { + /** Static value Capacity for MetricCategory. */ + public static final MetricCategory CAPACITY = fromString("Capacity"); + + /** Static value Transaction for MetricCategory. */ + public static final MetricCategory TRANSACTION = fromString("Transaction"); + + /** + * Creates or finds a MetricCategory from its string representation. + * @param name a name to look for + * @return the corresponding MetricCategory + */ + @JsonCreator + public static MetricCategory fromString(String name) { + return fromString(name, MetricCategory.class); + } + + /** + * @return known MetricCategory values + */ + public static Collection values() { + return values(MetricCategory.class); + } +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/MetricDimensionV1.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/MetricDimensionV1.java new file mode 100644 index 0000000000000..cab4da8b4f7fe --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/MetricDimensionV1.java @@ -0,0 +1,95 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Metric Dimension v1. + */ +public class MetricDimensionV1 { + /** + * Name of the metrics dimension. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Display name of the metrics dimension. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /** + * To be exported to shoe box. + */ + @JsonProperty(value = "toBeExportedForShoebox") + private Boolean toBeExportedForShoebox; + + /** + * Get name of the metrics dimension. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the metrics dimension. + * + * @param name the name value to set + * @return the MetricDimensionV1 object itself. + */ + public MetricDimensionV1 withName(String name) { + this.name = name; + return this; + } + + /** + * Get display name of the metrics dimension. + * + * @return the displayName value + */ + public String displayName() { + return this.displayName; + } + + /** + * Set display name of the metrics dimension. + * + * @param displayName the displayName value to set + * @return the MetricDimensionV1 object itself. + */ + public MetricDimensionV1 withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get to be exported to shoe box. + * + * @return the toBeExportedForShoebox value + */ + public Boolean toBeExportedForShoebox() { + return this.toBeExportedForShoebox; + } + + /** + * Set to be exported to shoe box. + * + * @param toBeExportedForShoebox the toBeExportedForShoebox value to set + * @return the MetricDimensionV1 object itself. + */ + public MetricDimensionV1 withToBeExportedForShoebox(Boolean toBeExportedForShoebox) { + this.toBeExportedForShoebox = toBeExportedForShoebox; + return this; + } + +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/MetricSpecificationV1.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/MetricSpecificationV1.java new file mode 100644 index 0000000000000..e8751fd90cddf --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/MetricSpecificationV1.java @@ -0,0 +1,307 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Metric specification version 1. + */ +public class MetricSpecificationV1 { + /** + * Name of the metric. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Display name of the metric. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /** + * Description of the metric to be displayed. + */ + @JsonProperty(value = "displayDescription") + private String displayDescription; + + /** + * Metric units. Possible values include: 'NotSpecified', 'Percent', + * 'Count', 'Seconds', 'Milliseconds', 'Bytes', 'BytesPerSecond', + * 'CountPerSecond'. + */ + @JsonProperty(value = "unit") + private MetricUnit unit; + + /** + * Metric aggregation type. Possible values include: 'NotSpecified', + * 'None', 'Average', 'Minimum', 'Maximum', 'Total', 'Count'. + */ + @JsonProperty(value = "aggregationType") + private MetricAggregationType aggregationType; + + /** + * Metric dimensions, other than default dimension which is resource. + */ + @JsonProperty(value = "dimensions") + private List dimensions; + + /** + * Set true to fill the gaps with zero. + */ + @JsonProperty(value = "fillGapWithZero") + private Boolean fillGapWithZero; + + /** + * Metric category. Possible values include: 'Capacity', 'Transaction'. + */ + @JsonProperty(value = "category") + private MetricCategory category; + + /** + * Resource name override. + */ + @JsonProperty(value = "resourceIdDimensionNameOverride") + private String resourceIdDimensionNameOverride; + + /** + * Support granularity of metrics. + */ + @JsonProperty(value = "supportedTimeGrainTypes") + private List supportedTimeGrainTypes; + + /** + * Support metric aggregation type. + */ + @JsonProperty(value = "supportedAggregationTypes") + private List supportedAggregationTypes; + + /** + * Get name of the metric. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the metric. + * + * @param name the name value to set + * @return the MetricSpecificationV1 object itself. + */ + public MetricSpecificationV1 withName(String name) { + this.name = name; + return this; + } + + /** + * Get display name of the metric. + * + * @return the displayName value + */ + public String displayName() { + return this.displayName; + } + + /** + * Set display name of the metric. + * + * @param displayName the displayName value to set + * @return the MetricSpecificationV1 object itself. + */ + public MetricSpecificationV1 withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get description of the metric to be displayed. + * + * @return the displayDescription value + */ + public String displayDescription() { + return this.displayDescription; + } + + /** + * Set description of the metric to be displayed. + * + * @param displayDescription the displayDescription value to set + * @return the MetricSpecificationV1 object itself. + */ + public MetricSpecificationV1 withDisplayDescription(String displayDescription) { + this.displayDescription = displayDescription; + return this; + } + + /** + * Get metric units. Possible values include: 'NotSpecified', 'Percent', 'Count', 'Seconds', 'Milliseconds', 'Bytes', 'BytesPerSecond', 'CountPerSecond'. + * + * @return the unit value + */ + public MetricUnit unit() { + return this.unit; + } + + /** + * Set metric units. Possible values include: 'NotSpecified', 'Percent', 'Count', 'Seconds', 'Milliseconds', 'Bytes', 'BytesPerSecond', 'CountPerSecond'. + * + * @param unit the unit value to set + * @return the MetricSpecificationV1 object itself. + */ + public MetricSpecificationV1 withUnit(MetricUnit unit) { + this.unit = unit; + return this; + } + + /** + * Get metric aggregation type. Possible values include: 'NotSpecified', 'None', 'Average', 'Minimum', 'Maximum', 'Total', 'Count'. + * + * @return the aggregationType value + */ + public MetricAggregationType aggregationType() { + return this.aggregationType; + } + + /** + * Set metric aggregation type. Possible values include: 'NotSpecified', 'None', 'Average', 'Minimum', 'Maximum', 'Total', 'Count'. + * + * @param aggregationType the aggregationType value to set + * @return the MetricSpecificationV1 object itself. + */ + public MetricSpecificationV1 withAggregationType(MetricAggregationType aggregationType) { + this.aggregationType = aggregationType; + return this; + } + + /** + * Get metric dimensions, other than default dimension which is resource. + * + * @return the dimensions value + */ + public List dimensions() { + return this.dimensions; + } + + /** + * Set metric dimensions, other than default dimension which is resource. + * + * @param dimensions the dimensions value to set + * @return the MetricSpecificationV1 object itself. + */ + public MetricSpecificationV1 withDimensions(List dimensions) { + this.dimensions = dimensions; + return this; + } + + /** + * Get set true to fill the gaps with zero. + * + * @return the fillGapWithZero value + */ + public Boolean fillGapWithZero() { + return this.fillGapWithZero; + } + + /** + * Set set true to fill the gaps with zero. + * + * @param fillGapWithZero the fillGapWithZero value to set + * @return the MetricSpecificationV1 object itself. + */ + public MetricSpecificationV1 withFillGapWithZero(Boolean fillGapWithZero) { + this.fillGapWithZero = fillGapWithZero; + return this; + } + + /** + * Get metric category. Possible values include: 'Capacity', 'Transaction'. + * + * @return the category value + */ + public MetricCategory category() { + return this.category; + } + + /** + * Set metric category. Possible values include: 'Capacity', 'Transaction'. + * + * @param category the category value to set + * @return the MetricSpecificationV1 object itself. + */ + public MetricSpecificationV1 withCategory(MetricCategory category) { + this.category = category; + return this; + } + + /** + * Get resource name override. + * + * @return the resourceIdDimensionNameOverride value + */ + public String resourceIdDimensionNameOverride() { + return this.resourceIdDimensionNameOverride; + } + + /** + * Set resource name override. + * + * @param resourceIdDimensionNameOverride the resourceIdDimensionNameOverride value to set + * @return the MetricSpecificationV1 object itself. + */ + public MetricSpecificationV1 withResourceIdDimensionNameOverride(String resourceIdDimensionNameOverride) { + this.resourceIdDimensionNameOverride = resourceIdDimensionNameOverride; + return this; + } + + /** + * Get support granularity of metrics. + * + * @return the supportedTimeGrainTypes value + */ + public List supportedTimeGrainTypes() { + return this.supportedTimeGrainTypes; + } + + /** + * Set support granularity of metrics. + * + * @param supportedTimeGrainTypes the supportedTimeGrainTypes value to set + * @return the MetricSpecificationV1 object itself. + */ + public MetricSpecificationV1 withSupportedTimeGrainTypes(List supportedTimeGrainTypes) { + this.supportedTimeGrainTypes = supportedTimeGrainTypes; + return this; + } + + /** + * Get support metric aggregation type. + * + * @return the supportedAggregationTypes value + */ + public List supportedAggregationTypes() { + return this.supportedAggregationTypes; + } + + /** + * Set support metric aggregation type. + * + * @param supportedAggregationTypes the supportedAggregationTypes value to set + * @return the MetricSpecificationV1 object itself. + */ + public MetricSpecificationV1 withSupportedAggregationTypes(List supportedAggregationTypes) { + this.supportedAggregationTypes = supportedAggregationTypes; + return this; + } + +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/MetricUnit.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/MetricUnit.java new file mode 100644 index 0000000000000..db4351d85054d --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/MetricUnit.java @@ -0,0 +1,59 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for MetricUnit. + */ +public final class MetricUnit extends ExpandableStringEnum { + /** Static value NotSpecified for MetricUnit. */ + public static final MetricUnit NOT_SPECIFIED = fromString("NotSpecified"); + + /** Static value Percent for MetricUnit. */ + public static final MetricUnit PERCENT = fromString("Percent"); + + /** Static value Count for MetricUnit. */ + public static final MetricUnit COUNT = fromString("Count"); + + /** Static value Seconds for MetricUnit. */ + public static final MetricUnit SECONDS = fromString("Seconds"); + + /** Static value Milliseconds for MetricUnit. */ + public static final MetricUnit MILLISECONDS = fromString("Milliseconds"); + + /** Static value Bytes for MetricUnit. */ + public static final MetricUnit BYTES = fromString("Bytes"); + + /** Static value BytesPerSecond for MetricUnit. */ + public static final MetricUnit BYTES_PER_SECOND = fromString("BytesPerSecond"); + + /** Static value CountPerSecond for MetricUnit. */ + public static final MetricUnit COUNT_PER_SECOND = fromString("CountPerSecond"); + + /** + * Creates or finds a MetricUnit from its string representation. + * @param name a name to look for + * @return the corresponding MetricUnit + */ + @JsonCreator + public static MetricUnit fromString(String name) { + return fromString(name, MetricUnit.class); + } + + /** + * @return known MetricUnit values + */ + public static Collection values() { + return values(MetricUnit.class); + } +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/MonitoringStatus.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/MonitoringStatus.java new file mode 100644 index 0000000000000..55800cf0ea9f0 --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/MonitoringStatus.java @@ -0,0 +1,41 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for MonitoringStatus. + */ +public final class MonitoringStatus extends ExpandableStringEnum { + /** Static value Enabled for MonitoringStatus. */ + public static final MonitoringStatus ENABLED = fromString("Enabled"); + + /** Static value Disabled for MonitoringStatus. */ + public static final MonitoringStatus DISABLED = fromString("Disabled"); + + /** + * Creates or finds a MonitoringStatus from its string representation. + * @param name a name to look for + * @return the corresponding MonitoringStatus + */ + @JsonCreator + public static MonitoringStatus fromString(String name) { + return fromString(name, MonitoringStatus.class); + } + + /** + * @return known MonitoringStatus values + */ + public static Collection values() { + return values(MonitoringStatus.class); + } +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/MountPointMap.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/MountPointMap.java new file mode 100644 index 0000000000000..7eca94b1b684d --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/MountPointMap.java @@ -0,0 +1,89 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The share mount point. + */ +public class MountPointMap { + /** + * ID of the share mounted to the role VM. + */ + @JsonProperty(value = "shareId", required = true) + private String shareId; + + /** + * ID of the role to which share is mounted. + */ + @JsonProperty(value = "roleId", access = JsonProperty.Access.WRITE_ONLY) + private String roleId; + + /** + * Mount point for the share. + */ + @JsonProperty(value = "mountPoint", access = JsonProperty.Access.WRITE_ONLY) + private String mountPoint; + + /** + * Role type. Possible values include: 'IOT', 'ASA', 'Functions', + * 'Cognitive'. + */ + @JsonProperty(value = "roleType", access = JsonProperty.Access.WRITE_ONLY) + private RoleTypes roleType; + + /** + * Get iD of the share mounted to the role VM. + * + * @return the shareId value + */ + public String shareId() { + return this.shareId; + } + + /** + * Set iD of the share mounted to the role VM. + * + * @param shareId the shareId value to set + * @return the MountPointMap object itself. + */ + public MountPointMap withShareId(String shareId) { + this.shareId = shareId; + return this; + } + + /** + * Get iD of the role to which share is mounted. + * + * @return the roleId value + */ + public String roleId() { + return this.roleId; + } + + /** + * Get mount point for the share. + * + * @return the mountPoint value + */ + public String mountPoint() { + return this.mountPoint; + } + + /** + * Get role type. Possible values include: 'IOT', 'ASA', 'Functions', 'Cognitive'. + * + * @return the roleType value + */ + public RoleTypes roleType() { + return this.roleType; + } + +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/NetworkAdapter.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/NetworkAdapter.java new file mode 100644 index 0000000000000..3a78c87e41062 --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/NetworkAdapter.java @@ -0,0 +1,268 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Represents the networkAdapter on a device. + */ +public class NetworkAdapter { + /** + * Instance ID of network adapter. + */ + @JsonProperty(value = "adapterId", access = JsonProperty.Access.WRITE_ONLY) + private String adapterId; + + /** + * Hardware position of network adapter. + */ + @JsonProperty(value = "adapterPosition", access = JsonProperty.Access.WRITE_ONLY) + private NetworkAdapterPosition adapterPosition; + + /** + * Logical index of the adapter. + */ + @JsonProperty(value = "index", access = JsonProperty.Access.WRITE_ONLY) + private Integer index; + + /** + * Node ID of the network adapter. + */ + @JsonProperty(value = "nodeId", access = JsonProperty.Access.WRITE_ONLY) + private String nodeId; + + /** + * Network adapter name. + */ + @JsonProperty(value = "networkAdapterName", access = JsonProperty.Access.WRITE_ONLY) + private String networkAdapterName; + + /** + * Hardware label for the adapter. + */ + @JsonProperty(value = "label", access = JsonProperty.Access.WRITE_ONLY) + private String label; + + /** + * MAC address. + */ + @JsonProperty(value = "macAddress", access = JsonProperty.Access.WRITE_ONLY) + private String macAddress; + + /** + * Link speed. + */ + @JsonProperty(value = "linkSpeed", access = JsonProperty.Access.WRITE_ONLY) + private Long linkSpeed; + + /** + * Value indicating whether this adapter is valid. Possible values include: + * 'Inactive', 'Active'. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private NetworkAdapterStatus status; + + /** + * Value indicating whether this adapter is RDMA capable. Possible values + * include: 'Incapable', 'Capable'. + */ + @JsonProperty(value = "rdmaStatus") + private NetworkAdapterRDMAStatus rdmaStatus; + + /** + * Value indicating whether this adapter has DHCP enabled. Possible values + * include: 'Disabled', 'Enabled'. + */ + @JsonProperty(value = "dhcpStatus") + private NetworkAdapterDHCPStatus dhcpStatus; + + /** + * The IPv4 configuration of the network adapter. + */ + @JsonProperty(value = "ipv4Configuration", access = JsonProperty.Access.WRITE_ONLY) + private Ipv4Config ipv4Configuration; + + /** + * The IPv6 configuration of the network adapter. + */ + @JsonProperty(value = "ipv6Configuration", access = JsonProperty.Access.WRITE_ONLY) + private Ipv6Config ipv6Configuration; + + /** + * The IPv6 local address. + */ + @JsonProperty(value = "ipv6LinkLocalAddress", access = JsonProperty.Access.WRITE_ONLY) + private String ipv6LinkLocalAddress; + + /** + * The list of DNS Servers of the device. + */ + @JsonProperty(value = "dnsServers", access = JsonProperty.Access.WRITE_ONLY) + private List dnsServers; + + /** + * Get instance ID of network adapter. + * + * @return the adapterId value + */ + public String adapterId() { + return this.adapterId; + } + + /** + * Get hardware position of network adapter. + * + * @return the adapterPosition value + */ + public NetworkAdapterPosition adapterPosition() { + return this.adapterPosition; + } + + /** + * Get logical index of the adapter. + * + * @return the index value + */ + public Integer index() { + return this.index; + } + + /** + * Get node ID of the network adapter. + * + * @return the nodeId value + */ + public String nodeId() { + return this.nodeId; + } + + /** + * Get network adapter name. + * + * @return the networkAdapterName value + */ + public String networkAdapterName() { + return this.networkAdapterName; + } + + /** + * Get hardware label for the adapter. + * + * @return the label value + */ + public String label() { + return this.label; + } + + /** + * Get mAC address. + * + * @return the macAddress value + */ + public String macAddress() { + return this.macAddress; + } + + /** + * Get link speed. + * + * @return the linkSpeed value + */ + public Long linkSpeed() { + return this.linkSpeed; + } + + /** + * Get value indicating whether this adapter is valid. Possible values include: 'Inactive', 'Active'. + * + * @return the status value + */ + public NetworkAdapterStatus status() { + return this.status; + } + + /** + * Get value indicating whether this adapter is RDMA capable. Possible values include: 'Incapable', 'Capable'. + * + * @return the rdmaStatus value + */ + public NetworkAdapterRDMAStatus rdmaStatus() { + return this.rdmaStatus; + } + + /** + * Set value indicating whether this adapter is RDMA capable. Possible values include: 'Incapable', 'Capable'. + * + * @param rdmaStatus the rdmaStatus value to set + * @return the NetworkAdapter object itself. + */ + public NetworkAdapter withRdmaStatus(NetworkAdapterRDMAStatus rdmaStatus) { + this.rdmaStatus = rdmaStatus; + return this; + } + + /** + * Get value indicating whether this adapter has DHCP enabled. Possible values include: 'Disabled', 'Enabled'. + * + * @return the dhcpStatus value + */ + public NetworkAdapterDHCPStatus dhcpStatus() { + return this.dhcpStatus; + } + + /** + * Set value indicating whether this adapter has DHCP enabled. Possible values include: 'Disabled', 'Enabled'. + * + * @param dhcpStatus the dhcpStatus value to set + * @return the NetworkAdapter object itself. + */ + public NetworkAdapter withDhcpStatus(NetworkAdapterDHCPStatus dhcpStatus) { + this.dhcpStatus = dhcpStatus; + return this; + } + + /** + * Get the IPv4 configuration of the network adapter. + * + * @return the ipv4Configuration value + */ + public Ipv4Config ipv4Configuration() { + return this.ipv4Configuration; + } + + /** + * Get the IPv6 configuration of the network adapter. + * + * @return the ipv6Configuration value + */ + public Ipv6Config ipv6Configuration() { + return this.ipv6Configuration; + } + + /** + * Get the IPv6 local address. + * + * @return the ipv6LinkLocalAddress value + */ + public String ipv6LinkLocalAddress() { + return this.ipv6LinkLocalAddress; + } + + /** + * Get the list of DNS Servers of the device. + * + * @return the dnsServers value + */ + public List dnsServers() { + return this.dnsServers; + } + +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/NetworkAdapterDHCPStatus.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/NetworkAdapterDHCPStatus.java new file mode 100644 index 0000000000000..0410e24787da3 --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/NetworkAdapterDHCPStatus.java @@ -0,0 +1,41 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for NetworkAdapterDHCPStatus. + */ +public final class NetworkAdapterDHCPStatus extends ExpandableStringEnum { + /** Static value Disabled for NetworkAdapterDHCPStatus. */ + public static final NetworkAdapterDHCPStatus DISABLED = fromString("Disabled"); + + /** Static value Enabled for NetworkAdapterDHCPStatus. */ + public static final NetworkAdapterDHCPStatus ENABLED = fromString("Enabled"); + + /** + * Creates or finds a NetworkAdapterDHCPStatus from its string representation. + * @param name a name to look for + * @return the corresponding NetworkAdapterDHCPStatus + */ + @JsonCreator + public static NetworkAdapterDHCPStatus fromString(String name) { + return fromString(name, NetworkAdapterDHCPStatus.class); + } + + /** + * @return known NetworkAdapterDHCPStatus values + */ + public static Collection values() { + return values(NetworkAdapterDHCPStatus.class); + } +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/NetworkAdapterPosition.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/NetworkAdapterPosition.java new file mode 100644 index 0000000000000..0981a9b751d69 --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/NetworkAdapterPosition.java @@ -0,0 +1,47 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The network adapter position. + */ +public class NetworkAdapterPosition { + /** + * The network group. Possible values include: 'None', 'NonRDMA', 'RDMA'. + */ + @JsonProperty(value = "networkGroup", access = JsonProperty.Access.WRITE_ONLY) + private NetworkGroup networkGroup; + + /** + * The port. + */ + @JsonProperty(value = "port", access = JsonProperty.Access.WRITE_ONLY) + private Integer port; + + /** + * Get the network group. Possible values include: 'None', 'NonRDMA', 'RDMA'. + * + * @return the networkGroup value + */ + public NetworkGroup networkGroup() { + return this.networkGroup; + } + + /** + * Get the port. + * + * @return the port value + */ + public Integer port() { + return this.port; + } + +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/NetworkAdapterRDMAStatus.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/NetworkAdapterRDMAStatus.java new file mode 100644 index 0000000000000..b3fb119d1941e --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/NetworkAdapterRDMAStatus.java @@ -0,0 +1,41 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for NetworkAdapterRDMAStatus. + */ +public final class NetworkAdapterRDMAStatus extends ExpandableStringEnum { + /** Static value Incapable for NetworkAdapterRDMAStatus. */ + public static final NetworkAdapterRDMAStatus INCAPABLE = fromString("Incapable"); + + /** Static value Capable for NetworkAdapterRDMAStatus. */ + public static final NetworkAdapterRDMAStatus CAPABLE = fromString("Capable"); + + /** + * Creates or finds a NetworkAdapterRDMAStatus from its string representation. + * @param name a name to look for + * @return the corresponding NetworkAdapterRDMAStatus + */ + @JsonCreator + public static NetworkAdapterRDMAStatus fromString(String name) { + return fromString(name, NetworkAdapterRDMAStatus.class); + } + + /** + * @return known NetworkAdapterRDMAStatus values + */ + public static Collection values() { + return values(NetworkAdapterRDMAStatus.class); + } +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/NetworkAdapterStatus.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/NetworkAdapterStatus.java new file mode 100644 index 0000000000000..9a488cc503460 --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/NetworkAdapterStatus.java @@ -0,0 +1,41 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for NetworkAdapterStatus. + */ +public final class NetworkAdapterStatus extends ExpandableStringEnum { + /** Static value Inactive for NetworkAdapterStatus. */ + public static final NetworkAdapterStatus INACTIVE = fromString("Inactive"); + + /** Static value Active for NetworkAdapterStatus. */ + public static final NetworkAdapterStatus ACTIVE = fromString("Active"); + + /** + * Creates or finds a NetworkAdapterStatus from its string representation. + * @param name a name to look for + * @return the corresponding NetworkAdapterStatus + */ + @JsonCreator + public static NetworkAdapterStatus fromString(String name) { + return fromString(name, NetworkAdapterStatus.class); + } + + /** + * @return known NetworkAdapterStatus values + */ + public static Collection values() { + return values(NetworkAdapterStatus.class); + } +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/NetworkGroup.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/NetworkGroup.java new file mode 100644 index 0000000000000..0cd747d1f9a8d --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/NetworkGroup.java @@ -0,0 +1,44 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for NetworkGroup. + */ +public final class NetworkGroup extends ExpandableStringEnum { + /** Static value None for NetworkGroup. */ + public static final NetworkGroup NONE = fromString("None"); + + /** Static value NonRDMA for NetworkGroup. */ + public static final NetworkGroup NON_RDMA = fromString("NonRDMA"); + + /** Static value RDMA for NetworkGroup. */ + public static final NetworkGroup RDMA = fromString("RDMA"); + + /** + * Creates or finds a NetworkGroup from its string representation. + * @param name a name to look for + * @return the corresponding NetworkGroup + */ + @JsonCreator + public static NetworkGroup fromString(String name) { + return fromString(name, NetworkGroup.class); + } + + /** + * @return known NetworkGroup values + */ + public static Collection values() { + return values(NetworkGroup.class); + } +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/NetworkSettings.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/NetworkSettings.java new file mode 100644 index 0000000000000..0056d8568468c --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/NetworkSettings.java @@ -0,0 +1,41 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.databoxedge.v2019_03_01.implementation.DataBoxEdgeManager; +import com.microsoft.azure.management.databoxedge.v2019_03_01.implementation.NetworkSettingsInner; +import java.util.List; + +/** + * Type representing NetworkSettings. + */ +public interface NetworkSettings extends HasInner, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the networkAdapters value. + */ + List networkAdapters(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/Operation.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/Operation.java new file mode 100644 index 0000000000000..930c9050667d5 --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/Operation.java @@ -0,0 +1,40 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.databoxedge.v2019_03_01.implementation.DataBoxEdgeManager; +import com.microsoft.azure.management.databoxedge.v2019_03_01.implementation.OperationInner; + +/** + * Type representing Operation. + */ +public interface Operation extends HasInner, HasManager { + /** + * @return the display value. + */ + OperationDisplay display(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the origin value. + */ + String origin(); + + /** + * @return the serviceSpecification value. + */ + ServiceSpecification serviceSpecification(); + +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/OperationDisplay.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/OperationDisplay.java new file mode 100644 index 0000000000000..9eb5357f43697 --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/OperationDisplay.java @@ -0,0 +1,121 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Operation display properties. + */ +public class OperationDisplay { + /** + * Provider name. + */ + @JsonProperty(value = "provider") + private String provider; + + /** + * The type of resource in which the operation is performed. + */ + @JsonProperty(value = "resource") + private String resource; + + /** + * Operation to be performed on the resource. + */ + @JsonProperty(value = "operation") + private String operation; + + /** + * Description of the operation to be performed. + */ + @JsonProperty(value = "description") + private String description; + + /** + * Get provider name. + * + * @return the provider value + */ + public String provider() { + return this.provider; + } + + /** + * Set provider name. + * + * @param provider the provider value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get the type of resource in which the operation is performed. + * + * @return the resource value + */ + public String resource() { + return this.resource; + } + + /** + * Set the type of resource in which the operation is performed. + * + * @param resource the resource value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withResource(String resource) { + this.resource = resource; + return this; + } + + /** + * Get operation to be performed on the resource. + * + * @return the operation value + */ + public String operation() { + return this.operation; + } + + /** + * Set operation to be performed on the resource. + * + * @param operation the operation value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withOperation(String operation) { + this.operation = operation; + return this; + } + + /** + * Get description of the operation to be performed. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set description of the operation to be performed. + * + * @param description the description value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withDescription(String description) { + this.description = description; + return this; + } + +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/Operations.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/Operations.java new file mode 100644 index 0000000000000..2cef0c5906761 --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/Operations.java @@ -0,0 +1,27 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01; + +import rx.Observable; +import com.microsoft.azure.management.databoxedge.v2019_03_01.implementation.OperationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Operations. + */ +public interface Operations extends HasInner { + /** + * List all the supported operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(); + +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/OperationsStatus.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/OperationsStatus.java new file mode 100644 index 0000000000000..ad17b377c586a --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/OperationsStatus.java @@ -0,0 +1,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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01; + +import rx.Observable; +import com.microsoft.azure.management.databoxedge.v2019_03_01.implementation.OperationsStatusInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing OperationsStatus. + */ +public interface OperationsStatus extends HasInner { + /** + * Gets the details of a specified job on a data box edge/gateway device. + * + * @param deviceName The device name. + * @param name The job name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String deviceName, String name, String resourceGroupName); + +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/Order.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/Order.java new file mode 100644 index 0000000000000..cc5ad1af90edf --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/Order.java @@ -0,0 +1,71 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.databoxedge.v2019_03_01.implementation.OrderInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.databoxedge.v2019_03_01.implementation.DataBoxEdgeManager; +import java.util.List; + +/** + * Type representing Order. + */ +public interface Order extends HasInner, HasManager { + /** + * @return the contactInformation value. + */ + ContactDetails contactInformation(); + + /** + * @return the currentStatus value. + */ + OrderStatus currentStatus(); + + /** + * @return the deliveryTrackingInfo value. + */ + List deliveryTrackingInfo(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the orderHistory value. + */ + List orderHistory(); + + /** + * @return the returnTrackingInfo value. + */ + List returnTrackingInfo(); + + /** + * @return the serialNumber value. + */ + String serialNumber(); + + /** + * @return the shippingAddress value. + */ + Address shippingAddress(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/OrderState.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/OrderState.java new file mode 100644 index 0000000000000..235c6df09fad3 --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/OrderState.java @@ -0,0 +1,77 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for OrderState. + */ +public final class OrderState extends ExpandableStringEnum { + /** Static value Untracked for OrderState. */ + public static final OrderState UNTRACKED = fromString("Untracked"); + + /** Static value AwaitingFulfilment for OrderState. */ + public static final OrderState AWAITING_FULFILMENT = fromString("AwaitingFulfilment"); + + /** Static value AwaitingPreparation for OrderState. */ + public static final OrderState AWAITING_PREPARATION = fromString("AwaitingPreparation"); + + /** Static value AwaitingShipment for OrderState. */ + public static final OrderState AWAITING_SHIPMENT = fromString("AwaitingShipment"); + + /** Static value Shipped for OrderState. */ + public static final OrderState SHIPPED = fromString("Shipped"); + + /** Static value Arriving for OrderState. */ + public static final OrderState ARRIVING = fromString("Arriving"); + + /** Static value Delivered for OrderState. */ + public static final OrderState DELIVERED = fromString("Delivered"); + + /** Static value ReplacementRequested for OrderState. */ + public static final OrderState REPLACEMENT_REQUESTED = fromString("ReplacementRequested"); + + /** Static value LostDevice for OrderState. */ + public static final OrderState LOST_DEVICE = fromString("LostDevice"); + + /** Static value Declined for OrderState. */ + public static final OrderState DECLINED = fromString("Declined"); + + /** Static value ReturnInitiated for OrderState. */ + public static final OrderState RETURN_INITIATED = fromString("ReturnInitiated"); + + /** Static value AwaitingReturnShipment for OrderState. */ + public static final OrderState AWAITING_RETURN_SHIPMENT = fromString("AwaitingReturnShipment"); + + /** Static value ShippedBack for OrderState. */ + public static final OrderState SHIPPED_BACK = fromString("ShippedBack"); + + /** Static value CollectedAtMicrosoft for OrderState. */ + public static final OrderState COLLECTED_AT_MICROSOFT = fromString("CollectedAtMicrosoft"); + + /** + * Creates or finds a OrderState from its string representation. + * @param name a name to look for + * @return the corresponding OrderState + */ + @JsonCreator + public static OrderState fromString(String name) { + return fromString(name, OrderState.class); + } + + /** + * @return known OrderState values + */ + public static Collection values() { + return values(OrderState.class); + } +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/OrderStatus.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/OrderStatus.java new file mode 100644 index 0000000000000..9232a51753386 --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/OrderStatus.java @@ -0,0 +1,89 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Represents a single status change. + */ +public class OrderStatus { + /** + * Status of the order as per the allowed status types. Possible values + * include: 'Untracked', 'AwaitingFulfilment', 'AwaitingPreparation', + * 'AwaitingShipment', 'Shipped', 'Arriving', 'Delivered', + * 'ReplacementRequested', 'LostDevice', 'Declined', 'ReturnInitiated', + * 'AwaitingReturnShipment', 'ShippedBack', 'CollectedAtMicrosoft'. + */ + @JsonProperty(value = "status", required = true) + private OrderState status; + + /** + * Time of status update. + */ + @JsonProperty(value = "updateDateTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime updateDateTime; + + /** + * Comments related to this status change. + */ + @JsonProperty(value = "comments") + private String comments; + + /** + * Get status of the order as per the allowed status types. Possible values include: 'Untracked', 'AwaitingFulfilment', 'AwaitingPreparation', 'AwaitingShipment', 'Shipped', 'Arriving', 'Delivered', 'ReplacementRequested', 'LostDevice', 'Declined', 'ReturnInitiated', 'AwaitingReturnShipment', 'ShippedBack', 'CollectedAtMicrosoft'. + * + * @return the status value + */ + public OrderState status() { + return this.status; + } + + /** + * Set status of the order as per the allowed status types. Possible values include: 'Untracked', 'AwaitingFulfilment', 'AwaitingPreparation', 'AwaitingShipment', 'Shipped', 'Arriving', 'Delivered', 'ReplacementRequested', 'LostDevice', 'Declined', 'ReturnInitiated', 'AwaitingReturnShipment', 'ShippedBack', 'CollectedAtMicrosoft'. + * + * @param status the status value to set + * @return the OrderStatus object itself. + */ + public OrderStatus withStatus(OrderState status) { + this.status = status; + return this; + } + + /** + * Get time of status update. + * + * @return the updateDateTime value + */ + public DateTime updateDateTime() { + return this.updateDateTime; + } + + /** + * Get comments related to this status change. + * + * @return the comments value + */ + public String comments() { + return this.comments; + } + + /** + * Set comments related to this status change. + * + * @param comments the comments value to set + * @return the OrderStatus object itself. + */ + public OrderStatus withComments(String comments) { + this.comments = comments; + return this; + } + +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/Orders.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/Orders.java new file mode 100644 index 0000000000000..9b80bcf4b0bae --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/Orders.java @@ -0,0 +1,62 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01; + +import rx.Observable; +import rx.Completable; +import com.microsoft.azure.management.databoxedge.v2019_03_01.implementation.OrderInner; +import com.microsoft.azure.management.databoxedge.v2019_03_01.implementation.OrdersInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Orders. + */ +public interface Orders extends HasInner { + /** + * Gets a specific order by name. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String deviceName, String resourceGroupName); + + /** + * Creates or updates an order. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param order The order to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable createOrUpdateAsync(String deviceName, String resourceGroupName, OrderInner order); + + /** + * Deletes the order related to the device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String deviceName, String resourceGroupName); + + /** + * Lists all the orders related to a data box edge/gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByDataBoxEdgeDeviceAsync(final String deviceName, final String resourceGroupName); + +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/PeriodicTimerEventTrigger.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/PeriodicTimerEventTrigger.java new file mode 100644 index 0000000000000..b47c29e59d923 --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/PeriodicTimerEventTrigger.java @@ -0,0 +1,105 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.management.databoxedge.v2019_03_01.implementation.TriggerInner; + +/** + * Trigger details. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind", defaultImpl = PeriodicTimerEventTrigger.class) +@JsonTypeName("PeriodicTimerEvent") +@JsonFlatten +public class PeriodicTimerEventTrigger extends TriggerInner { + /** + * Periodic timer details. + */ + @JsonProperty(value = "properties.sourceInfo", required = true) + private PeriodicTimerSourceInfo sourceInfo; + + /** + * Role Sink information. + */ + @JsonProperty(value = "properties.sinkInfo", required = true) + private RoleSinkInfo sinkInfo; + + /** + * A custom context tag typically used to correlate the trigger against its + * usage. For example, if a periodic timer trigger is intended for certain + * specific IoT modules in the device, the tag can be the name or the image + * URL of the module. + */ + @JsonProperty(value = "properties.customContextTag") + private String customContextTag; + + /** + * Get periodic timer details. + * + * @return the sourceInfo value + */ + public PeriodicTimerSourceInfo sourceInfo() { + return this.sourceInfo; + } + + /** + * Set periodic timer details. + * + * @param sourceInfo the sourceInfo value to set + * @return the PeriodicTimerEventTrigger object itself. + */ + public PeriodicTimerEventTrigger withSourceInfo(PeriodicTimerSourceInfo sourceInfo) { + this.sourceInfo = sourceInfo; + return this; + } + + /** + * Get role Sink information. + * + * @return the sinkInfo value + */ + public RoleSinkInfo sinkInfo() { + return this.sinkInfo; + } + + /** + * Set role Sink information. + * + * @param sinkInfo the sinkInfo value to set + * @return the PeriodicTimerEventTrigger object itself. + */ + public PeriodicTimerEventTrigger withSinkInfo(RoleSinkInfo sinkInfo) { + this.sinkInfo = sinkInfo; + return this; + } + + /** + * Get a custom context tag typically used to correlate the trigger against its usage. For example, if a periodic timer trigger is intended for certain specific IoT modules in the device, the tag can be the name or the image URL of the module. + * + * @return the customContextTag value + */ + public String customContextTag() { + return this.customContextTag; + } + + /** + * Set a custom context tag typically used to correlate the trigger against its usage. For example, if a periodic timer trigger is intended for certain specific IoT modules in the device, the tag can be the name or the image URL of the module. + * + * @param customContextTag the customContextTag value to set + * @return the PeriodicTimerEventTrigger object itself. + */ + public PeriodicTimerEventTrigger withCustomContextTag(String customContextTag) { + this.customContextTag = customContextTag; + return this; + } + +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/PeriodicTimerSourceInfo.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/PeriodicTimerSourceInfo.java new file mode 100644 index 0000000000000..4085a00659f86 --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/PeriodicTimerSourceInfo.java @@ -0,0 +1,100 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Periodic timer event source. + */ +public class PeriodicTimerSourceInfo { + /** + * The time of the day that results in a valid trigger. Schedule is + * computed with reference to the time specified up to seconds. If timezone + * is not specified the time will considered to be in device timezone. The + * value will always be returned as UTC time. + */ + @JsonProperty(value = "startTime", required = true) + private DateTime startTime; + + /** + * Periodic frequency at which timer event needs to be raised. Supports + * daily, hourly, minutes, and seconds. + */ + @JsonProperty(value = "schedule", required = true) + private String schedule; + + /** + * Topic where periodic events are published to IoT device. + */ + @JsonProperty(value = "topic") + private String topic; + + /** + * Get the time of the day that results in a valid trigger. Schedule is computed with reference to the time specified up to seconds. If timezone is not specified the time will considered to be in device timezone. The value will always be returned as UTC time. + * + * @return the startTime value + */ + public DateTime startTime() { + return this.startTime; + } + + /** + * Set the time of the day that results in a valid trigger. Schedule is computed with reference to the time specified up to seconds. If timezone is not specified the time will considered to be in device timezone. The value will always be returned as UTC time. + * + * @param startTime the startTime value to set + * @return the PeriodicTimerSourceInfo object itself. + */ + public PeriodicTimerSourceInfo withStartTime(DateTime startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get periodic frequency at which timer event needs to be raised. Supports daily, hourly, minutes, and seconds. + * + * @return the schedule value + */ + public String schedule() { + return this.schedule; + } + + /** + * Set periodic frequency at which timer event needs to be raised. Supports daily, hourly, minutes, and seconds. + * + * @param schedule the schedule value to set + * @return the PeriodicTimerSourceInfo object itself. + */ + public PeriodicTimerSourceInfo withSchedule(String schedule) { + this.schedule = schedule; + return this; + } + + /** + * Get topic where periodic events are published to IoT device. + * + * @return the topic value + */ + public String topic() { + return this.topic; + } + + /** + * Set topic where periodic events are published to IoT device. + * + * @param topic the topic value to set + * @return the PeriodicTimerSourceInfo object itself. + */ + public PeriodicTimerSourceInfo withTopic(String topic) { + this.topic = topic; + return this; + } + +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/PlatformType.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/PlatformType.java new file mode 100644 index 0000000000000..4acd162300294 --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/PlatformType.java @@ -0,0 +1,41 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for PlatformType. + */ +public final class PlatformType extends ExpandableStringEnum { + /** Static value Windows for PlatformType. */ + public static final PlatformType WINDOWS = fromString("Windows"); + + /** Static value Linux for PlatformType. */ + public static final PlatformType LINUX = fromString("Linux"); + + /** + * Creates or finds a PlatformType from its string representation. + * @param name a name to look for + * @return the corresponding PlatformType + */ + @JsonCreator + public static PlatformType fromString(String name) { + return fromString(name, PlatformType.class); + } + + /** + * @return known PlatformType values + */ + public static Collection values() { + return values(PlatformType.class); + } +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/RefreshDetails.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/RefreshDetails.java new file mode 100644 index 0000000000000..92ef22fd87520 --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/RefreshDetails.java @@ -0,0 +1,128 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Fields for tracking refresh job on the share. + */ +public class RefreshDetails { + /** + * If a refresh share job is currently in progress on this share, this + * field indicates the ARM resource ID of that job. The field is empty if + * no job is in progress. + */ + @JsonProperty(value = "inProgressRefreshJobId") + private String inProgressRefreshJobId; + + /** + * Indicates the completed time for the last refresh job on this particular + * share, if any.This could be a failed job or a successful job. + */ + @JsonProperty(value = "lastCompletedRefreshJobTimeInUTC") + private DateTime lastCompletedRefreshJobTimeInUTC; + + /** + * Indicates the relative path of the error xml for the last refresh job on + * this particular share, if any. This could be a failed job or a + * successful job. + */ + @JsonProperty(value = "errorManifestFile") + private String errorManifestFile; + + /** + * Indicates the id of the last refresh job on this particular share,if + * any. This could be a failed job or a successful job. + */ + @JsonProperty(value = "lastJob") + private String lastJob; + + /** + * Get if a refresh share job is currently in progress on this share, this field indicates the ARM resource ID of that job. The field is empty if no job is in progress. + * + * @return the inProgressRefreshJobId value + */ + public String inProgressRefreshJobId() { + return this.inProgressRefreshJobId; + } + + /** + * Set if a refresh share job is currently in progress on this share, this field indicates the ARM resource ID of that job. The field is empty if no job is in progress. + * + * @param inProgressRefreshJobId the inProgressRefreshJobId value to set + * @return the RefreshDetails object itself. + */ + public RefreshDetails withInProgressRefreshJobId(String inProgressRefreshJobId) { + this.inProgressRefreshJobId = inProgressRefreshJobId; + return this; + } + + /** + * Get indicates the completed time for the last refresh job on this particular share, if any.This could be a failed job or a successful job. + * + * @return the lastCompletedRefreshJobTimeInUTC value + */ + public DateTime lastCompletedRefreshJobTimeInUTC() { + return this.lastCompletedRefreshJobTimeInUTC; + } + + /** + * Set indicates the completed time for the last refresh job on this particular share, if any.This could be a failed job or a successful job. + * + * @param lastCompletedRefreshJobTimeInUTC the lastCompletedRefreshJobTimeInUTC value to set + * @return the RefreshDetails object itself. + */ + public RefreshDetails withLastCompletedRefreshJobTimeInUTC(DateTime lastCompletedRefreshJobTimeInUTC) { + this.lastCompletedRefreshJobTimeInUTC = lastCompletedRefreshJobTimeInUTC; + return this; + } + + /** + * Get indicates the relative path of the error xml for the last refresh job on this particular share, if any. This could be a failed job or a successful job. + * + * @return the errorManifestFile value + */ + public String errorManifestFile() { + return this.errorManifestFile; + } + + /** + * Set indicates the relative path of the error xml for the last refresh job on this particular share, if any. This could be a failed job or a successful job. + * + * @param errorManifestFile the errorManifestFile value to set + * @return the RefreshDetails object itself. + */ + public RefreshDetails withErrorManifestFile(String errorManifestFile) { + this.errorManifestFile = errorManifestFile; + return this; + } + + /** + * Get indicates the id of the last refresh job on this particular share,if any. This could be a failed job or a successful job. + * + * @return the lastJob value + */ + public String lastJob() { + return this.lastJob; + } + + /** + * Set indicates the id of the last refresh job on this particular share,if any. This could be a failed job or a successful job. + * + * @param lastJob the lastJob value to set + * @return the RefreshDetails object itself. + */ + public RefreshDetails withLastJob(String lastJob) { + this.lastJob = lastJob; + return this; + } + +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/Role.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/Role.java new file mode 100644 index 0000000000000..24cbad3792dbe --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/Role.java @@ -0,0 +1,88 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.databoxedge.v2019_03_01.implementation.RoleInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.databoxedge.v2019_03_01.implementation.DataBoxEdgeManager; + +/** + * Type representing Role. + */ +public interface Role extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the Role definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithDataBoxEdgeDevice, DefinitionStages.WithCreate { + } + + /** + * Grouping of Role definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a Role definition. + */ + interface Blank extends WithDataBoxEdgeDevice { + } + + /** + * The stage of the role definition allowing to specify DataBoxEdgeDevice. + */ + interface WithDataBoxEdgeDevice { + /** + * Specifies deviceName, resourceGroupName. + * @param deviceName The device name + * @param resourceGroupName The resource group name + * @return the next definition stage + */ + WithCreate withExistingDataBoxEdgeDevice(String deviceName, String resourceGroupName); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable { + } + } + /** + * The template for a Role update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable { + } + + /** + * Grouping of Role update stages. + */ + interface UpdateStages { + } +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/RoleSinkInfo.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/RoleSinkInfo.java new file mode 100644 index 0000000000000..badb896f6491e --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/RoleSinkInfo.java @@ -0,0 +1,43 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Compute role against which events will be raised. + */ +public class RoleSinkInfo { + /** + * Compute role ID. + */ + @JsonProperty(value = "roleId", required = true) + private String roleId; + + /** + * Get compute role ID. + * + * @return the roleId value + */ + public String roleId() { + return this.roleId; + } + + /** + * Set compute role ID. + * + * @param roleId the roleId value to set + * @return the RoleSinkInfo object itself. + */ + public RoleSinkInfo withRoleId(String roleId) { + this.roleId = roleId; + return this; + } + +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/RoleStatus.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/RoleStatus.java new file mode 100644 index 0000000000000..b9f73cf58470b --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/RoleStatus.java @@ -0,0 +1,41 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for RoleStatus. + */ +public final class RoleStatus extends ExpandableStringEnum { + /** Static value Enabled for RoleStatus. */ + public static final RoleStatus ENABLED = fromString("Enabled"); + + /** Static value Disabled for RoleStatus. */ + public static final RoleStatus DISABLED = fromString("Disabled"); + + /** + * Creates or finds a RoleStatus from its string representation. + * @param name a name to look for + * @return the corresponding RoleStatus + */ + @JsonCreator + public static RoleStatus fromString(String name) { + return fromString(name, RoleStatus.class); + } + + /** + * @return known RoleStatus values + */ + public static Collection values() { + return values(RoleStatus.class); + } +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/RoleTypes.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/RoleTypes.java new file mode 100644 index 0000000000000..58fb0902bcc40 --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/RoleTypes.java @@ -0,0 +1,47 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for RoleTypes. + */ +public final class RoleTypes extends ExpandableStringEnum { + /** Static value IOT for RoleTypes. */ + public static final RoleTypes IOT = fromString("IOT"); + + /** Static value ASA for RoleTypes. */ + public static final RoleTypes ASA = fromString("ASA"); + + /** Static value Functions for RoleTypes. */ + public static final RoleTypes FUNCTIONS = fromString("Functions"); + + /** Static value Cognitive for RoleTypes. */ + public static final RoleTypes COGNITIVE = fromString("Cognitive"); + + /** + * Creates or finds a RoleTypes from its string representation. + * @param name a name to look for + * @return the corresponding RoleTypes + */ + @JsonCreator + public static RoleTypes fromString(String name) { + return fromString(name, RoleTypes.class); + } + + /** + * @return known RoleTypes values + */ + public static Collection values() { + return values(RoleTypes.class); + } +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/Roles.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/Roles.java new file mode 100644 index 0000000000000..b030c0128db12 --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/Roles.java @@ -0,0 +1,53 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.databoxedge.v2019_03_01.implementation.RolesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Roles. + */ +public interface Roles extends SupportsCreating, HasInner { + /** + * Gets a specific role by name. + * + * @param deviceName The device name. + * @param name The role name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String deviceName, String name, String resourceGroupName); + + /** + * Lists all the roles configured in a data box edge/gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByDataBoxEdgeDeviceAsync(final String deviceName, final String resourceGroupName); + + /** + * Deletes the role on the data box edge device. + * + * @param deviceName The device name. + * @param name The role name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String deviceName, String name, String resourceGroupName); + +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/SSLStatus.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/SSLStatus.java new file mode 100644 index 0000000000000..9a2a23b93ce5a --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/SSLStatus.java @@ -0,0 +1,41 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for SSLStatus. + */ +public final class SSLStatus extends ExpandableStringEnum { + /** Static value Enabled for SSLStatus. */ + public static final SSLStatus ENABLED = fromString("Enabled"); + + /** Static value Disabled for SSLStatus. */ + public static final SSLStatus DISABLED = fromString("Disabled"); + + /** + * Creates or finds a SSLStatus from its string representation. + * @param name a name to look for + * @return the corresponding SSLStatus + */ + @JsonCreator + public static SSLStatus fromString(String name) { + return fromString(name, SSLStatus.class); + } + + /** + * @return known SSLStatus values + */ + public static Collection values() { + return values(SSLStatus.class); + } +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/SecuritySettings.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/SecuritySettings.java new file mode 100644 index 0000000000000..1b3149ca6ffd5 --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/SecuritySettings.java @@ -0,0 +1,48 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * The security settings of a device. + */ +@JsonFlatten +public class SecuritySettings extends ARMBaseModel { + /** + * Device administrator password as an encrypted string (encrypted using + * RSA PKCS #1) is used to sign into the local web UI of the device. The + * Actual password should have at least 8 characters that are a combination + * of uppercase, lowercase, numeric, and special characters. + */ + @JsonProperty(value = "properties.deviceAdminPassword", required = true) + private AsymmetricEncryptedSecret deviceAdminPassword; + + /** + * Get device administrator password as an encrypted string (encrypted using RSA PKCS #1) is used to sign into the local web UI of the device. The Actual password should have at least 8 characters that are a combination of uppercase, lowercase, numeric, and special characters. + * + * @return the deviceAdminPassword value + */ + public AsymmetricEncryptedSecret deviceAdminPassword() { + return this.deviceAdminPassword; + } + + /** + * Set device administrator password as an encrypted string (encrypted using RSA PKCS #1) is used to sign into the local web UI of the device. The Actual password should have at least 8 characters that are a combination of uppercase, lowercase, numeric, and special characters. + * + * @param deviceAdminPassword the deviceAdminPassword value to set + * @return the SecuritySettings object itself. + */ + public SecuritySettings withDeviceAdminPassword(AsymmetricEncryptedSecret deviceAdminPassword) { + this.deviceAdminPassword = deviceAdminPassword; + return this; + } + +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/ServiceSpecification.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/ServiceSpecification.java new file mode 100644 index 0000000000000..4714e82c1be6b --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/ServiceSpecification.java @@ -0,0 +1,44 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Service specification. + */ +public class ServiceSpecification { + /** + * Metric specification as defined by shoebox. + */ + @JsonProperty(value = "metricSpecifications") + private List metricSpecifications; + + /** + * Get metric specification as defined by shoebox. + * + * @return the metricSpecifications value + */ + public List metricSpecifications() { + return this.metricSpecifications; + } + + /** + * Set metric specification as defined by shoebox. + * + * @param metricSpecifications the metricSpecifications value to set + * @return the ServiceSpecification object itself. + */ + public ServiceSpecification withMetricSpecifications(List metricSpecifications) { + this.metricSpecifications = metricSpecifications; + return this; + } + +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/Share.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/Share.java new file mode 100644 index 0000000000000..777bfa7f97f68 --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/Share.java @@ -0,0 +1,319 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.databoxedge.v2019_03_01.implementation.ShareInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.databoxedge.v2019_03_01.implementation.DataBoxEdgeManager; +import java.util.List; + +/** + * Type representing Share. + */ +public interface Share extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the accessProtocol value. + */ + ShareAccessProtocol accessProtocol(); + + /** + * @return the azureContainerInfo value. + */ + AzureContainerInfo azureContainerInfo(); + + /** + * @return the clientAccessRights value. + */ + List clientAccessRights(); + + /** + * @return the dataPolicy value. + */ + DataPolicy dataPolicy(); + + /** + * @return the description value. + */ + String description(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the monitoringStatus value. + */ + MonitoringStatus monitoringStatus(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the refreshDetails value. + */ + RefreshDetails refreshDetails(); + + /** + * @return the shareMappings value. + */ + List shareMappings(); + + /** + * @return the shareStatus value. + */ + ShareStatus shareStatus(); + + /** + * @return the type value. + */ + String type(); + + /** + * @return the userAccessRights value. + */ + List userAccessRights(); + + /** + * The entirety of the Share definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithDataBoxEdgeDevice, DefinitionStages.WithAccessProtocol, DefinitionStages.WithMonitoringStatus, DefinitionStages.WithShareStatus, DefinitionStages.WithCreate { + } + + /** + * Grouping of Share definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a Share definition. + */ + interface Blank extends WithDataBoxEdgeDevice { + } + + /** + * The stage of the share definition allowing to specify DataBoxEdgeDevice. + */ + interface WithDataBoxEdgeDevice { + /** + * Specifies deviceName, resourceGroupName. + * @param deviceName The device name + * @param resourceGroupName The resource group name + * @return the next definition stage + */ + WithAccessProtocol withExistingDataBoxEdgeDevice(String deviceName, String resourceGroupName); + } + + /** + * The stage of the share definition allowing to specify AccessProtocol. + */ + interface WithAccessProtocol { + /** + * Specifies accessProtocol. + * @param accessProtocol Access protocol to be used by the share. Possible values include: 'SMB', 'NFS' + * @return the next definition stage + */ + WithMonitoringStatus withAccessProtocol(ShareAccessProtocol accessProtocol); + } + + /** + * The stage of the share definition allowing to specify MonitoringStatus. + */ + interface WithMonitoringStatus { + /** + * Specifies monitoringStatus. + * @param monitoringStatus Current monitoring status of the share. Possible values include: 'Enabled', 'Disabled' + * @return the next definition stage + */ + WithShareStatus withMonitoringStatus(MonitoringStatus monitoringStatus); + } + + /** + * The stage of the share definition allowing to specify ShareStatus. + */ + interface WithShareStatus { + /** + * Specifies shareStatus. + * @param shareStatus Current status of the share. Possible values include: 'Online', 'Offline' + * @return the next definition stage + */ + WithCreate withShareStatus(ShareStatus shareStatus); + } + + /** + * The stage of the share definition allowing to specify AzureContainerInfo. + */ + interface WithAzureContainerInfo { + /** + * Specifies azureContainerInfo. + * @param azureContainerInfo Azure container mapping for the share + * @return the next definition stage + */ + WithCreate withAzureContainerInfo(AzureContainerInfo azureContainerInfo); + } + + /** + * The stage of the share definition allowing to specify ClientAccessRights. + */ + interface WithClientAccessRights { + /** + * Specifies clientAccessRights. + * @param clientAccessRights List of IP addresses and corresponding access rights on the share(required for NFS protocol) + * @return the next definition stage + */ + WithCreate withClientAccessRights(List clientAccessRights); + } + + /** + * The stage of the share definition allowing to specify DataPolicy. + */ + interface WithDataPolicy { + /** + * Specifies dataPolicy. + * @param dataPolicy Data policy of the share. Possible values include: 'Cloud', 'Local' + * @return the next definition stage + */ + WithCreate withDataPolicy(DataPolicy dataPolicy); + } + + /** + * The stage of the share definition allowing to specify Description. + */ + interface WithDescription { + /** + * Specifies description. + * @param description Description for the share + * @return the next definition stage + */ + WithCreate withDescription(String description); + } + + /** + * The stage of the share definition allowing to specify RefreshDetails. + */ + interface WithRefreshDetails { + /** + * Specifies refreshDetails. + * @param refreshDetails Details of the refresh job on this share + * @return the next definition stage + */ + WithCreate withRefreshDetails(RefreshDetails refreshDetails); + } + + /** + * The stage of the share definition allowing to specify UserAccessRights. + */ + interface WithUserAccessRights { + /** + * Specifies userAccessRights. + * @param userAccessRights Mapping of users and corresponding access rights on the share (required for SMB protocol) + * @return the next definition stage + */ + WithCreate withUserAccessRights(List userAccessRights); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithAzureContainerInfo, DefinitionStages.WithClientAccessRights, DefinitionStages.WithDataPolicy, DefinitionStages.WithDescription, DefinitionStages.WithRefreshDetails, DefinitionStages.WithUserAccessRights { + } + } + /** + * The template for a Share update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithAzureContainerInfo, UpdateStages.WithClientAccessRights, UpdateStages.WithDataPolicy, UpdateStages.WithDescription, UpdateStages.WithRefreshDetails, UpdateStages.WithUserAccessRights { + } + + /** + * Grouping of Share update stages. + */ + interface UpdateStages { + /** + * The stage of the share update allowing to specify AzureContainerInfo. + */ + interface WithAzureContainerInfo { + /** + * Specifies azureContainerInfo. + * @param azureContainerInfo Azure container mapping for the share + * @return the next update stage + */ + Update withAzureContainerInfo(AzureContainerInfo azureContainerInfo); + } + + /** + * The stage of the share update allowing to specify ClientAccessRights. + */ + interface WithClientAccessRights { + /** + * Specifies clientAccessRights. + * @param clientAccessRights List of IP addresses and corresponding access rights on the share(required for NFS protocol) + * @return the next update stage + */ + Update withClientAccessRights(List clientAccessRights); + } + + /** + * The stage of the share update allowing to specify DataPolicy. + */ + interface WithDataPolicy { + /** + * Specifies dataPolicy. + * @param dataPolicy Data policy of the share. Possible values include: 'Cloud', 'Local' + * @return the next update stage + */ + Update withDataPolicy(DataPolicy dataPolicy); + } + + /** + * The stage of the share update allowing to specify Description. + */ + interface WithDescription { + /** + * Specifies description. + * @param description Description for the share + * @return the next update stage + */ + Update withDescription(String description); + } + + /** + * The stage of the share update allowing to specify RefreshDetails. + */ + interface WithRefreshDetails { + /** + * Specifies refreshDetails. + * @param refreshDetails Details of the refresh job on this share + * @return the next update stage + */ + Update withRefreshDetails(RefreshDetails refreshDetails); + } + + /** + * The stage of the share update allowing to specify UserAccessRights. + */ + interface WithUserAccessRights { + /** + * Specifies userAccessRights. + * @param userAccessRights Mapping of users and corresponding access rights on the share (required for SMB protocol) + * @return the next update stage + */ + Update withUserAccessRights(List userAccessRights); + } + + } +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/ShareAccessProtocol.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/ShareAccessProtocol.java new file mode 100644 index 0000000000000..6e5b5687c6ae7 --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/ShareAccessProtocol.java @@ -0,0 +1,41 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ShareAccessProtocol. + */ +public final class ShareAccessProtocol extends ExpandableStringEnum { + /** Static value SMB for ShareAccessProtocol. */ + public static final ShareAccessProtocol SMB = fromString("SMB"); + + /** Static value NFS for ShareAccessProtocol. */ + public static final ShareAccessProtocol NFS = fromString("NFS"); + + /** + * Creates or finds a ShareAccessProtocol from its string representation. + * @param name a name to look for + * @return the corresponding ShareAccessProtocol + */ + @JsonCreator + public static ShareAccessProtocol fromString(String name) { + return fromString(name, ShareAccessProtocol.class); + } + + /** + * @return known ShareAccessProtocol values + */ + public static Collection values() { + return values(ShareAccessProtocol.class); + } +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/ShareAccessRight.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/ShareAccessRight.java new file mode 100644 index 0000000000000..59643b216313b --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/ShareAccessRight.java @@ -0,0 +1,71 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Specifies the mapping between this particular user and the type of access he + * has on shares on this device. + */ +public class ShareAccessRight { + /** + * The share ID. + */ + @JsonProperty(value = "shareId", required = true) + private String shareId; + + /** + * Type of access to be allowed on the share for this user. Possible values + * include: 'Change', 'Read', 'Custom'. + */ + @JsonProperty(value = "accessType", required = true) + private ShareAccessType accessType; + + /** + * Get the share ID. + * + * @return the shareId value + */ + public String shareId() { + return this.shareId; + } + + /** + * Set the share ID. + * + * @param shareId the shareId value to set + * @return the ShareAccessRight object itself. + */ + public ShareAccessRight withShareId(String shareId) { + this.shareId = shareId; + return this; + } + + /** + * Get type of access to be allowed on the share for this user. Possible values include: 'Change', 'Read', 'Custom'. + * + * @return the accessType value + */ + public ShareAccessType accessType() { + return this.accessType; + } + + /** + * Set type of access to be allowed on the share for this user. Possible values include: 'Change', 'Read', 'Custom'. + * + * @param accessType the accessType value to set + * @return the ShareAccessRight object itself. + */ + public ShareAccessRight withAccessType(ShareAccessType accessType) { + this.accessType = accessType; + return this; + } + +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/ShareAccessType.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/ShareAccessType.java new file mode 100644 index 0000000000000..d2945b15a16fe --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/ShareAccessType.java @@ -0,0 +1,44 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ShareAccessType. + */ +public final class ShareAccessType extends ExpandableStringEnum { + /** Static value Change for ShareAccessType. */ + public static final ShareAccessType CHANGE = fromString("Change"); + + /** Static value Read for ShareAccessType. */ + public static final ShareAccessType READ = fromString("Read"); + + /** Static value Custom for ShareAccessType. */ + public static final ShareAccessType CUSTOM = fromString("Custom"); + + /** + * Creates or finds a ShareAccessType from its string representation. + * @param name a name to look for + * @return the corresponding ShareAccessType + */ + @JsonCreator + public static ShareAccessType fromString(String name) { + return fromString(name, ShareAccessType.class); + } + + /** + * @return known ShareAccessType values + */ + public static Collection values() { + return values(ShareAccessType.class); + } +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/ShareStatus.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/ShareStatus.java new file mode 100644 index 0000000000000..c94dedd91ebbd --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/ShareStatus.java @@ -0,0 +1,41 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ShareStatus. + */ +public final class ShareStatus extends ExpandableStringEnum { + /** Static value Online for ShareStatus. */ + public static final ShareStatus ONLINE = fromString("Online"); + + /** Static value Offline for ShareStatus. */ + public static final ShareStatus OFFLINE = fromString("Offline"); + + /** + * Creates or finds a ShareStatus from its string representation. + * @param name a name to look for + * @return the corresponding ShareStatus + */ + @JsonCreator + public static ShareStatus fromString(String name) { + return fromString(name, ShareStatus.class); + } + + /** + * @return known ShareStatus values + */ + public static Collection values() { + return values(ShareStatus.class); + } +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/Shares.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/Shares.java new file mode 100644 index 0000000000000..8d3ee97c2ff84 --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/Shares.java @@ -0,0 +1,64 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.databoxedge.v2019_03_01.implementation.SharesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Shares. + */ +public interface Shares extends SupportsCreating, HasInner { + /** + * Refreshes the share metadata with the data from the cloud. + * + * @param deviceName The device name. + * @param name The share name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable refreshAsync(String deviceName, String name, String resourceGroupName); + + /** + * Gets a share by name. + * + * @param deviceName The device name. + * @param name The share name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String deviceName, String name, String resourceGroupName); + + /** + * Lists all the shares in a data box edge/gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByDataBoxEdgeDeviceAsync(final String deviceName, final String resourceGroupName); + + /** + * Deletes the share on the data box edge/gateway device. + * + * @param deviceName The device name. + * @param name The share name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String deviceName, String name, String resourceGroupName); + +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/Sku.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/Sku.java new file mode 100644 index 0000000000000..7ba7efe4d09bb --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/Sku.java @@ -0,0 +1,70 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The SKU type. + */ +public class Sku { + /** + * SKU name. Possible values include: 'Gateway', 'Edge'. + */ + @JsonProperty(value = "name") + private SkuName name; + + /** + * The SKU tier. This is based on the SKU name. Possible values include: + * 'Standard'. + */ + @JsonProperty(value = "tier") + private SkuTier tier; + + /** + * Get sKU name. Possible values include: 'Gateway', 'Edge'. + * + * @return the name value + */ + public SkuName name() { + return this.name; + } + + /** + * Set sKU name. Possible values include: 'Gateway', 'Edge'. + * + * @param name the name value to set + * @return the Sku object itself. + */ + public Sku withName(SkuName name) { + this.name = name; + return this; + } + + /** + * Get the SKU tier. This is based on the SKU name. Possible values include: 'Standard'. + * + * @return the tier value + */ + public SkuTier tier() { + return this.tier; + } + + /** + * Set the SKU tier. This is based on the SKU name. Possible values include: 'Standard'. + * + * @param tier the tier value to set + * @return the Sku object itself. + */ + public Sku withTier(SkuTier tier) { + this.tier = tier; + return this; + } + +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/SkuName.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/SkuName.java new file mode 100644 index 0000000000000..5d4f7f61324e0 --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/SkuName.java @@ -0,0 +1,41 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for SkuName. + */ +public final class SkuName extends ExpandableStringEnum { + /** Static value Gateway for SkuName. */ + public static final SkuName GATEWAY = fromString("Gateway"); + + /** Static value Edge for SkuName. */ + public static final SkuName EDGE = fromString("Edge"); + + /** + * Creates or finds a SkuName from its string representation. + * @param name a name to look for + * @return the corresponding SkuName + */ + @JsonCreator + public static SkuName fromString(String name) { + return fromString(name, SkuName.class); + } + + /** + * @return known SkuName values + */ + public static Collection values() { + return values(SkuName.class); + } +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/SkuTier.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/SkuTier.java new file mode 100644 index 0000000000000..3b2a1a75e060e --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/SkuTier.java @@ -0,0 +1,38 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for SkuTier. + */ +public final class SkuTier extends ExpandableStringEnum { + /** Static value Standard for SkuTier. */ + public static final SkuTier STANDARD = fromString("Standard"); + + /** + * Creates or finds a SkuTier from its string representation. + * @param name a name to look for + * @return the corresponding SkuTier + */ + @JsonCreator + public static SkuTier fromString(String name) { + return fromString(name, SkuTier.class); + } + + /** + * @return known SkuTier values + */ + public static Collection values() { + return values(SkuTier.class); + } +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/StorageAccountCredential.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/StorageAccountCredential.java new file mode 100644 index 0000000000000..1cae5ede4e481 --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/StorageAccountCredential.java @@ -0,0 +1,255 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.databoxedge.v2019_03_01.implementation.StorageAccountCredentialInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.databoxedge.v2019_03_01.implementation.DataBoxEdgeManager; + +/** + * Type representing StorageAccountCredential. + */ +public interface StorageAccountCredential extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the accountKey value. + */ + AsymmetricEncryptedSecret accountKey(); + + /** + * @return the accountType value. + */ + AccountType accountType(); + + /** + * @return the alias value. + */ + String alias(); + + /** + * @return the blobDomainName value. + */ + String blobDomainName(); + + /** + * @return the connectionString value. + */ + String connectionString(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the sslStatus value. + */ + SSLStatus sslStatus(); + + /** + * @return the type value. + */ + String type(); + + /** + * @return the userName value. + */ + String userName(); + + /** + * The entirety of the StorageAccountCredential definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithDataBoxEdgeDevice, DefinitionStages.WithAccountType, DefinitionStages.WithAlias, DefinitionStages.WithSslStatus, DefinitionStages.WithCreate { + } + + /** + * Grouping of StorageAccountCredential definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a StorageAccountCredential definition. + */ + interface Blank extends WithDataBoxEdgeDevice { + } + + /** + * The stage of the storageaccountcredential definition allowing to specify DataBoxEdgeDevice. + */ + interface WithDataBoxEdgeDevice { + /** + * Specifies deviceName, resourceGroupName. + * @param deviceName The device name + * @param resourceGroupName The resource group name + * @return the next definition stage + */ + WithAccountType withExistingDataBoxEdgeDevice(String deviceName, String resourceGroupName); + } + + /** + * The stage of the storageaccountcredential definition allowing to specify AccountType. + */ + interface WithAccountType { + /** + * Specifies accountType. + * @param accountType Type of storage accessed on the storage account. Possible values include: 'GeneralPurposeStorage', 'BlobStorage' + * @return the next definition stage + */ + WithAlias withAccountType(AccountType accountType); + } + + /** + * The stage of the storageaccountcredential definition allowing to specify Alias. + */ + interface WithAlias { + /** + * Specifies alias. + * @param alias Alias for the storage account + * @return the next definition stage + */ + WithSslStatus withAlias(String alias); + } + + /** + * The stage of the storageaccountcredential definition allowing to specify SslStatus. + */ + interface WithSslStatus { + /** + * Specifies sslStatus. + * @param sslStatus Signifies whether SSL needs to be enabled or not. Possible values include: 'Enabled', 'Disabled' + * @return the next definition stage + */ + WithCreate withSslStatus(SSLStatus sslStatus); + } + + /** + * The stage of the storageaccountcredential definition allowing to specify AccountKey. + */ + interface WithAccountKey { + /** + * Specifies accountKey. + * @param accountKey Encrypted storage key + * @return the next definition stage + */ + WithCreate withAccountKey(AsymmetricEncryptedSecret accountKey); + } + + /** + * The stage of the storageaccountcredential definition allowing to specify BlobDomainName. + */ + interface WithBlobDomainName { + /** + * Specifies blobDomainName. + * @param blobDomainName Blob end point for private clouds + * @return the next definition stage + */ + WithCreate withBlobDomainName(String blobDomainName); + } + + /** + * The stage of the storageaccountcredential definition allowing to specify ConnectionString. + */ + interface WithConnectionString { + /** + * Specifies connectionString. + * @param connectionString Connection string for the storage account. Use this string if username and account key are not specified + * @return the next definition stage + */ + WithCreate withConnectionString(String connectionString); + } + + /** + * The stage of the storageaccountcredential definition allowing to specify UserName. + */ + interface WithUserName { + /** + * Specifies userName. + * @param userName Username for the storage account + * @return the next definition stage + */ + WithCreate withUserName(String userName); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithAccountKey, DefinitionStages.WithBlobDomainName, DefinitionStages.WithConnectionString, DefinitionStages.WithUserName { + } + } + /** + * The template for a StorageAccountCredential update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithAccountKey, UpdateStages.WithBlobDomainName, UpdateStages.WithConnectionString, UpdateStages.WithUserName { + } + + /** + * Grouping of StorageAccountCredential update stages. + */ + interface UpdateStages { + /** + * The stage of the storageaccountcredential update allowing to specify AccountKey. + */ + interface WithAccountKey { + /** + * Specifies accountKey. + * @param accountKey Encrypted storage key + * @return the next update stage + */ + Update withAccountKey(AsymmetricEncryptedSecret accountKey); + } + + /** + * The stage of the storageaccountcredential update allowing to specify BlobDomainName. + */ + interface WithBlobDomainName { + /** + * Specifies blobDomainName. + * @param blobDomainName Blob end point for private clouds + * @return the next update stage + */ + Update withBlobDomainName(String blobDomainName); + } + + /** + * The stage of the storageaccountcredential update allowing to specify ConnectionString. + */ + interface WithConnectionString { + /** + * Specifies connectionString. + * @param connectionString Connection string for the storage account. Use this string if username and account key are not specified + * @return the next update stage + */ + Update withConnectionString(String connectionString); + } + + /** + * The stage of the storageaccountcredential update allowing to specify UserName. + */ + interface WithUserName { + /** + * Specifies userName. + * @param userName Username for the storage account + * @return the next update stage + */ + Update withUserName(String userName); + } + + } +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/StorageAccountCredentials.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/StorageAccountCredentials.java new file mode 100644 index 0000000000000..2aafd7ca600bc --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/StorageAccountCredentials.java @@ -0,0 +1,53 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.databoxedge.v2019_03_01.implementation.StorageAccountCredentialsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing StorageAccountCredentials. + */ +public interface StorageAccountCredentials extends SupportsCreating, HasInner { + /** + * Gets the properties of the specified storage account credential. + * + * @param deviceName The device name. + * @param name The storage account credential name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String deviceName, String name, String resourceGroupName); + + /** + * Gets all the storage account credentials in a data box edge/gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByDataBoxEdgeDeviceAsync(final String deviceName, final String resourceGroupName); + + /** + * Deletes the storage account credential. + * + * @param deviceName The device name. + * @param name The storage account credential name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String deviceName, String name, String resourceGroupName); + +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/SymmetricKey.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/SymmetricKey.java new file mode 100644 index 0000000000000..3c68ac910d360 --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/SymmetricKey.java @@ -0,0 +1,43 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Symmetric key for authentication. + */ +public class SymmetricKey { + /** + * Connection string based on the symmetric key. + */ + @JsonProperty(value = "connectionString") + private AsymmetricEncryptedSecret connectionString; + + /** + * Get connection string based on the symmetric key. + * + * @return the connectionString value + */ + public AsymmetricEncryptedSecret connectionString() { + return this.connectionString; + } + + /** + * Set connection string based on the symmetric key. + * + * @param connectionString the connectionString value to set + * @return the SymmetricKey object itself. + */ + public SymmetricKey withConnectionString(AsymmetricEncryptedSecret connectionString) { + this.connectionString = connectionString; + return this; + } + +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/TimeGrain.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/TimeGrain.java new file mode 100644 index 0000000000000..bda08574c55c6 --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/TimeGrain.java @@ -0,0 +1,59 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for TimeGrain. + */ +public final class TimeGrain extends ExpandableStringEnum { + /** Static value PT1M for TimeGrain. */ + public static final TimeGrain PT1M = fromString("PT1M"); + + /** Static value PT5M for TimeGrain. */ + public static final TimeGrain PT5M = fromString("PT5M"); + + /** Static value PT15M for TimeGrain. */ + public static final TimeGrain PT15M = fromString("PT15M"); + + /** Static value PT30M for TimeGrain. */ + public static final TimeGrain PT30M = fromString("PT30M"); + + /** Static value PT1H for TimeGrain. */ + public static final TimeGrain PT1H = fromString("PT1H"); + + /** Static value PT6H for TimeGrain. */ + public static final TimeGrain PT6H = fromString("PT6H"); + + /** Static value PT12H for TimeGrain. */ + public static final TimeGrain PT12H = fromString("PT12H"); + + /** Static value PT1D for TimeGrain. */ + public static final TimeGrain PT1D = fromString("PT1D"); + + /** + * Creates or finds a TimeGrain from its string representation. + * @param name a name to look for + * @return the corresponding TimeGrain + */ + @JsonCreator + public static TimeGrain fromString(String name) { + return fromString(name, TimeGrain.class); + } + + /** + * @return known TimeGrain values + */ + public static Collection values() { + return values(TimeGrain.class); + } +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/TrackingInfo.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/TrackingInfo.java new file mode 100644 index 0000000000000..29f36d15f56e9 --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/TrackingInfo.java @@ -0,0 +1,121 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Tracking courier information. + */ +public class TrackingInfo { + /** + * Serial number of the device being tracked. + */ + @JsonProperty(value = "serialNumber") + private String serialNumber; + + /** + * Name of the carrier used in the delivery. + */ + @JsonProperty(value = "carrierName") + private String carrierName; + + /** + * Tracking ID of the shipment. + */ + @JsonProperty(value = "trackingId") + private String trackingId; + + /** + * Tracking URL of the shipment. + */ + @JsonProperty(value = "trackingUrl") + private String trackingUrl; + + /** + * Get serial number of the device being tracked. + * + * @return the serialNumber value + */ + public String serialNumber() { + return this.serialNumber; + } + + /** + * Set serial number of the device being tracked. + * + * @param serialNumber the serialNumber value to set + * @return the TrackingInfo object itself. + */ + public TrackingInfo withSerialNumber(String serialNumber) { + this.serialNumber = serialNumber; + return this; + } + + /** + * Get name of the carrier used in the delivery. + * + * @return the carrierName value + */ + public String carrierName() { + return this.carrierName; + } + + /** + * Set name of the carrier used in the delivery. + * + * @param carrierName the carrierName value to set + * @return the TrackingInfo object itself. + */ + public TrackingInfo withCarrierName(String carrierName) { + this.carrierName = carrierName; + return this; + } + + /** + * Get tracking ID of the shipment. + * + * @return the trackingId value + */ + public String trackingId() { + return this.trackingId; + } + + /** + * Set tracking ID of the shipment. + * + * @param trackingId the trackingId value to set + * @return the TrackingInfo object itself. + */ + public TrackingInfo withTrackingId(String trackingId) { + this.trackingId = trackingId; + return this; + } + + /** + * Get tracking URL of the shipment. + * + * @return the trackingUrl value + */ + public String trackingUrl() { + return this.trackingUrl; + } + + /** + * Set tracking URL of the shipment. + * + * @param trackingUrl the trackingUrl value to set + * @return the TrackingInfo object itself. + */ + public TrackingInfo withTrackingUrl(String trackingUrl) { + this.trackingUrl = trackingUrl; + return this; + } + +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/Trigger.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/Trigger.java new file mode 100644 index 0000000000000..78b3fc5578ed2 --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/Trigger.java @@ -0,0 +1,88 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.databoxedge.v2019_03_01.implementation.TriggerInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.databoxedge.v2019_03_01.implementation.DataBoxEdgeManager; + +/** + * Type representing Trigger. + */ +public interface Trigger extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the Trigger definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithDataBoxEdgeDevice, DefinitionStages.WithCreate { + } + + /** + * Grouping of Trigger definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a Trigger definition. + */ + interface Blank extends WithDataBoxEdgeDevice { + } + + /** + * The stage of the trigger definition allowing to specify DataBoxEdgeDevice. + */ + interface WithDataBoxEdgeDevice { + /** + * Specifies deviceName, resourceGroupName. + * @param deviceName Creates or updates a trigger + * @param resourceGroupName The resource group name + * @return the next definition stage + */ + WithCreate withExistingDataBoxEdgeDevice(String deviceName, String resourceGroupName); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable { + } + } + /** + * The template for a Trigger update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable { + } + + /** + * Grouping of Trigger update stages. + */ + interface UpdateStages { + } +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/Triggers.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/Triggers.java new file mode 100644 index 0000000000000..93684e7c13274 --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/Triggers.java @@ -0,0 +1,53 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.databoxedge.v2019_03_01.implementation.TriggersInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Triggers. + */ +public interface Triggers extends SupportsCreating, HasInner { + /** + * Get a specific trigger by name. + * + * @param deviceName The device name. + * @param name The trigger name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String deviceName, String name, String resourceGroupName); + + /** + * Lists all the triggers configured in the device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByDataBoxEdgeDeviceAsync(final String deviceName, final String resourceGroupName); + + /** + * Deletes the trigger on the gateway device. + * + * @param deviceName The device name. + * @param name The trigger name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String deviceName, String name, String resourceGroupName); + +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/UpdateDownloadProgress.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/UpdateDownloadProgress.java new file mode 100644 index 0000000000000..584349cc311e8 --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/UpdateDownloadProgress.java @@ -0,0 +1,108 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Details about the download progress of update. + */ +public class UpdateDownloadProgress { + /** + * The download phase. Possible values include: 'Unknown', 'Initializing', + * 'Downloading', 'Verifying'. + */ + @JsonProperty(value = "downloadPhase", access = JsonProperty.Access.WRITE_ONLY) + private DownloadPhase downloadPhase; + + /** + * Percentage of completion. + */ + @JsonProperty(value = "percentComplete", access = JsonProperty.Access.WRITE_ONLY) + private Integer percentComplete; + + /** + * Total bytes to download. + */ + @JsonProperty(value = "totalBytesToDownload", access = JsonProperty.Access.WRITE_ONLY) + private Double totalBytesToDownload; + + /** + * Total bytes downloaded. + */ + @JsonProperty(value = "totalBytesDownloaded", access = JsonProperty.Access.WRITE_ONLY) + private Double totalBytesDownloaded; + + /** + * Number of updates to download. + */ + @JsonProperty(value = "numberOfUpdatesToDownload", access = JsonProperty.Access.WRITE_ONLY) + private Integer numberOfUpdatesToDownload; + + /** + * Number of updates downloaded. + */ + @JsonProperty(value = "numberOfUpdatesDownloaded", access = JsonProperty.Access.WRITE_ONLY) + private Integer numberOfUpdatesDownloaded; + + /** + * Get the download phase. Possible values include: 'Unknown', 'Initializing', 'Downloading', 'Verifying'. + * + * @return the downloadPhase value + */ + public DownloadPhase downloadPhase() { + return this.downloadPhase; + } + + /** + * Get percentage of completion. + * + * @return the percentComplete value + */ + public Integer percentComplete() { + return this.percentComplete; + } + + /** + * Get total bytes to download. + * + * @return the totalBytesToDownload value + */ + public Double totalBytesToDownload() { + return this.totalBytesToDownload; + } + + /** + * Get total bytes downloaded. + * + * @return the totalBytesDownloaded value + */ + public Double totalBytesDownloaded() { + return this.totalBytesDownloaded; + } + + /** + * Get number of updates to download. + * + * @return the numberOfUpdatesToDownload value + */ + public Integer numberOfUpdatesToDownload() { + return this.numberOfUpdatesToDownload; + } + + /** + * Get number of updates downloaded. + * + * @return the numberOfUpdatesDownloaded value + */ + public Integer numberOfUpdatesDownloaded() { + return this.numberOfUpdatesDownloaded; + } + +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/UpdateInstallProgress.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/UpdateInstallProgress.java new file mode 100644 index 0000000000000..294f000469061 --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/UpdateInstallProgress.java @@ -0,0 +1,62 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Progress details during installation of updates. + */ +public class UpdateInstallProgress { + /** + * Percentage completed. + */ + @JsonProperty(value = "percentComplete", access = JsonProperty.Access.WRITE_ONLY) + private Integer percentComplete; + + /** + * Number of updates to install. + */ + @JsonProperty(value = "numberOfUpdatesToInstall", access = JsonProperty.Access.WRITE_ONLY) + private Integer numberOfUpdatesToInstall; + + /** + * Number of updates installed. + */ + @JsonProperty(value = "numberOfUpdatesInstalled", access = JsonProperty.Access.WRITE_ONLY) + private Integer numberOfUpdatesInstalled; + + /** + * Get percentage completed. + * + * @return the percentComplete value + */ + public Integer percentComplete() { + return this.percentComplete; + } + + /** + * Get number of updates to install. + * + * @return the numberOfUpdatesToInstall value + */ + public Integer numberOfUpdatesToInstall() { + return this.numberOfUpdatesToInstall; + } + + /** + * Get number of updates installed. + * + * @return the numberOfUpdatesInstalled value + */ + public Integer numberOfUpdatesInstalled() { + return this.numberOfUpdatesInstalled; + } + +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/UpdateOperation.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/UpdateOperation.java new file mode 100644 index 0000000000000..0d282d2b51206 --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/UpdateOperation.java @@ -0,0 +1,47 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for UpdateOperation. + */ +public final class UpdateOperation extends ExpandableStringEnum { + /** Static value None for UpdateOperation. */ + public static final UpdateOperation NONE = fromString("None"); + + /** Static value Scan for UpdateOperation. */ + public static final UpdateOperation SCAN = fromString("Scan"); + + /** Static value Download for UpdateOperation. */ + public static final UpdateOperation DOWNLOAD = fromString("Download"); + + /** Static value Install for UpdateOperation. */ + public static final UpdateOperation INSTALL = fromString("Install"); + + /** + * Creates or finds a UpdateOperation from its string representation. + * @param name a name to look for + * @return the corresponding UpdateOperation + */ + @JsonCreator + public static UpdateOperation fromString(String name) { + return fromString(name, UpdateOperation.class); + } + + /** + * @return known UpdateOperation values + */ + public static Collection values() { + return values(UpdateOperation.class); + } +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/UpdateOperationStage.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/UpdateOperationStage.java new file mode 100644 index 0000000000000..16137e259a7ea --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/UpdateOperationStage.java @@ -0,0 +1,86 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for UpdateOperationStage. + */ +public final class UpdateOperationStage extends ExpandableStringEnum { + /** Static value Unknown for UpdateOperationStage. */ + public static final UpdateOperationStage UNKNOWN = fromString("Unknown"); + + /** Static value Initial for UpdateOperationStage. */ + public static final UpdateOperationStage INITIAL = fromString("Initial"); + + /** Static value ScanStarted for UpdateOperationStage. */ + public static final UpdateOperationStage SCAN_STARTED = fromString("ScanStarted"); + + /** Static value ScanComplete for UpdateOperationStage. */ + public static final UpdateOperationStage SCAN_COMPLETE = fromString("ScanComplete"); + + /** Static value ScanFailed for UpdateOperationStage. */ + public static final UpdateOperationStage SCAN_FAILED = fromString("ScanFailed"); + + /** Static value DownloadStarted for UpdateOperationStage. */ + public static final UpdateOperationStage DOWNLOAD_STARTED = fromString("DownloadStarted"); + + /** Static value DownloadComplete for UpdateOperationStage. */ + public static final UpdateOperationStage DOWNLOAD_COMPLETE = fromString("DownloadComplete"); + + /** Static value DownloadFailed for UpdateOperationStage. */ + public static final UpdateOperationStage DOWNLOAD_FAILED = fromString("DownloadFailed"); + + /** Static value InstallStarted for UpdateOperationStage. */ + public static final UpdateOperationStage INSTALL_STARTED = fromString("InstallStarted"); + + /** Static value InstallComplete for UpdateOperationStage. */ + public static final UpdateOperationStage INSTALL_COMPLETE = fromString("InstallComplete"); + + /** Static value InstallFailed for UpdateOperationStage. */ + public static final UpdateOperationStage INSTALL_FAILED = fromString("InstallFailed"); + + /** Static value RebootInitiated for UpdateOperationStage. */ + public static final UpdateOperationStage REBOOT_INITIATED = fromString("RebootInitiated"); + + /** Static value Success for UpdateOperationStage. */ + public static final UpdateOperationStage SUCCESS = fromString("Success"); + + /** Static value Failure for UpdateOperationStage. */ + public static final UpdateOperationStage FAILURE = fromString("Failure"); + + /** Static value RescanStarted for UpdateOperationStage. */ + public static final UpdateOperationStage RESCAN_STARTED = fromString("RescanStarted"); + + /** Static value RescanComplete for UpdateOperationStage. */ + public static final UpdateOperationStage RESCAN_COMPLETE = fromString("RescanComplete"); + + /** Static value RescanFailed for UpdateOperationStage. */ + public static final UpdateOperationStage RESCAN_FAILED = fromString("RescanFailed"); + + /** + * Creates or finds a UpdateOperationStage from its string representation. + * @param name a name to look for + * @return the corresponding UpdateOperationStage + */ + @JsonCreator + public static UpdateOperationStage fromString(String name) { + return fromString(name, UpdateOperationStage.class); + } + + /** + * @return known UpdateOperationStage values + */ + public static Collection values() { + return values(UpdateOperationStage.class); + } +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/UpdateSummary.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/UpdateSummary.java new file mode 100644 index 0000000000000..9ad35ddd3f7ab --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/UpdateSummary.java @@ -0,0 +1,122 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.databoxedge.v2019_03_01.implementation.DataBoxEdgeManager; +import com.microsoft.azure.management.databoxedge.v2019_03_01.implementation.UpdateSummaryInner; +import org.joda.time.DateTime; +import java.util.List; + +/** + * Type representing UpdateSummary. + */ +public interface UpdateSummary extends HasInner, HasManager { + /** + * @return the deviceLastScannedDateTime value. + */ + DateTime deviceLastScannedDateTime(); + + /** + * @return the deviceVersionNumber value. + */ + String deviceVersionNumber(); + + /** + * @return the friendlyDeviceVersionName value. + */ + String friendlyDeviceVersionName(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the inProgressDownloadJobId value. + */ + String inProgressDownloadJobId(); + + /** + * @return the inProgressDownloadJobStartedDateTime value. + */ + DateTime inProgressDownloadJobStartedDateTime(); + + /** + * @return the inProgressInstallJobId value. + */ + String inProgressInstallJobId(); + + /** + * @return the inProgressInstallJobStartedDateTime value. + */ + DateTime inProgressInstallJobStartedDateTime(); + + /** + * @return the lastCompletedDownloadJobDateTime value. + */ + DateTime lastCompletedDownloadJobDateTime(); + + /** + * @return the lastCompletedInstallJobDateTime value. + */ + DateTime lastCompletedInstallJobDateTime(); + + /** + * @return the lastCompletedScanJobDateTime value. + */ + DateTime lastCompletedScanJobDateTime(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the ongoingUpdateOperation value. + */ + UpdateOperation ongoingUpdateOperation(); + + /** + * @return the rebootBehavior value. + */ + InstallRebootBehavior rebootBehavior(); + + /** + * @return the totalNumberOfUpdatesAvailable value. + */ + Integer totalNumberOfUpdatesAvailable(); + + /** + * @return the totalNumberOfUpdatesPendingDownload value. + */ + Integer totalNumberOfUpdatesPendingDownload(); + + /** + * @return the totalNumberOfUpdatesPendingInstall value. + */ + Integer totalNumberOfUpdatesPendingInstall(); + + /** + * @return the totalUpdateSizeInBytes value. + */ + Double totalUpdateSizeInBytes(); + + /** + * @return the type value. + */ + String type(); + + /** + * @return the updateTitles value. + */ + List updateTitles(); + +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/UploadCertificateRequest.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/UploadCertificateRequest.java new file mode 100644 index 0000000000000..4ccc08d955fd6 --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/UploadCertificateRequest.java @@ -0,0 +1,72 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * The upload certificate request. + */ +@JsonFlatten +public class UploadCertificateRequest { + /** + * The authentication type. Possible values include: 'Invalid', + * 'AzureActiveDirectory'. + */ + @JsonProperty(value = "properties.authenticationType") + private AuthenticationType authenticationType; + + /** + * The base64 encoded certificate raw data. + */ + @JsonProperty(value = "properties.certificate", required = true) + private String certificate; + + /** + * Get the authentication type. Possible values include: 'Invalid', 'AzureActiveDirectory'. + * + * @return the authenticationType value + */ + public AuthenticationType authenticationType() { + return this.authenticationType; + } + + /** + * Set the authentication type. Possible values include: 'Invalid', 'AzureActiveDirectory'. + * + * @param authenticationType the authenticationType value to set + * @return the UploadCertificateRequest object itself. + */ + public UploadCertificateRequest withAuthenticationType(AuthenticationType authenticationType) { + this.authenticationType = authenticationType; + return this; + } + + /** + * Get the base64 encoded certificate raw data. + * + * @return the certificate value + */ + public String certificate() { + return this.certificate; + } + + /** + * Set the base64 encoded certificate raw data. + * + * @param certificate the certificate value to set + * @return the UploadCertificateRequest object itself. + */ + public UploadCertificateRequest withCertificate(String certificate) { + this.certificate = certificate; + return this; + } + +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/UploadCertificateResponse.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/UploadCertificateResponse.java new file mode 100644 index 0000000000000..c950e6590304d --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/UploadCertificateResponse.java @@ -0,0 +1,55 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.databoxedge.v2019_03_01.implementation.DataBoxEdgeManager; +import com.microsoft.azure.management.databoxedge.v2019_03_01.implementation.UploadCertificateResponseInner; + +/** + * Type representing UploadCertificateResponse. + */ +public interface UploadCertificateResponse extends HasInner, HasManager { + /** + * @return the aadAuthority value. + */ + String aadAuthority(); + + /** + * @return the aadTenantId value. + */ + String aadTenantId(); + + /** + * @return the authType value. + */ + AuthenticationType authType(); + + /** + * @return the azureManagementEndpointAudience value. + */ + String azureManagementEndpointAudience(); + + /** + * @return the resourceId value. + */ + String resourceId(); + + /** + * @return the servicePrincipalClientId value. + */ + String servicePrincipalClientId(); + + /** + * @return the servicePrincipalObjectId value. + */ + String servicePrincipalObjectId(); + +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/User.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/User.java new file mode 100644 index 0000000000000..718663a9d1c15 --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/User.java @@ -0,0 +1,147 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.databoxedge.v2019_03_01.implementation.UserInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.databoxedge.v2019_03_01.implementation.DataBoxEdgeManager; +import java.util.List; + +/** + * Type representing User. + */ +public interface User extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the encryptedPassword value. + */ + AsymmetricEncryptedSecret encryptedPassword(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the shareAccessRights value. + */ + List shareAccessRights(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the User definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithDataBoxEdgeDevice, DefinitionStages.WithCreate { + } + + /** + * Grouping of User definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a User definition. + */ + interface Blank extends WithDataBoxEdgeDevice { + } + + /** + * The stage of the user definition allowing to specify DataBoxEdgeDevice. + */ + interface WithDataBoxEdgeDevice { + /** + * Specifies deviceName, resourceGroupName. + * @param deviceName The device name + * @param resourceGroupName The resource group name + * @return the next definition stage + */ + WithCreate withExistingDataBoxEdgeDevice(String deviceName, String resourceGroupName); + } + + /** + * The stage of the user definition allowing to specify EncryptedPassword. + */ + interface WithEncryptedPassword { + /** + * Specifies encryptedPassword. + * @param encryptedPassword The password details + * @return the next definition stage + */ + WithCreate withEncryptedPassword(AsymmetricEncryptedSecret encryptedPassword); + } + + /** + * The stage of the user definition allowing to specify ShareAccessRights. + */ + interface WithShareAccessRights { + /** + * Specifies shareAccessRights. + * @param shareAccessRights List of shares that the user has rights on. This field should not be specified during user creation + * @return the next definition stage + */ + WithCreate withShareAccessRights(List shareAccessRights); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithEncryptedPassword, DefinitionStages.WithShareAccessRights { + } + } + /** + * The template for a User update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithEncryptedPassword, UpdateStages.WithShareAccessRights { + } + + /** + * Grouping of User update stages. + */ + interface UpdateStages { + /** + * The stage of the user update allowing to specify EncryptedPassword. + */ + interface WithEncryptedPassword { + /** + * Specifies encryptedPassword. + * @param encryptedPassword The password details + * @return the next update stage + */ + Update withEncryptedPassword(AsymmetricEncryptedSecret encryptedPassword); + } + + /** + * The stage of the user update allowing to specify ShareAccessRights. + */ + interface WithShareAccessRights { + /** + * Specifies shareAccessRights. + * @param shareAccessRights List of shares that the user has rights on. This field should not be specified during user creation + * @return the next update stage + */ + Update withShareAccessRights(List shareAccessRights); + } + + } +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/UserAccessRight.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/UserAccessRight.java new file mode 100644 index 0000000000000..d7bdc453f7bdf --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/UserAccessRight.java @@ -0,0 +1,70 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The mapping between a particular user and the access type on the SMB share. + */ +public class UserAccessRight { + /** + * User ID (already existing in the device). + */ + @JsonProperty(value = "userId", required = true) + private String userId; + + /** + * Type of access to be allowed for the user. Possible values include: + * 'Change', 'Read', 'Custom'. + */ + @JsonProperty(value = "accessType", required = true) + private ShareAccessType accessType; + + /** + * Get user ID (already existing in the device). + * + * @return the userId value + */ + public String userId() { + return this.userId; + } + + /** + * Set user ID (already existing in the device). + * + * @param userId the userId value to set + * @return the UserAccessRight object itself. + */ + public UserAccessRight withUserId(String userId) { + this.userId = userId; + return this; + } + + /** + * Get type of access to be allowed for the user. Possible values include: 'Change', 'Read', 'Custom'. + * + * @return the accessType value + */ + public ShareAccessType accessType() { + return this.accessType; + } + + /** + * Set type of access to be allowed for the user. Possible values include: 'Change', 'Read', 'Custom'. + * + * @param accessType the accessType value to set + * @return the UserAccessRight object itself. + */ + public UserAccessRight withAccessType(ShareAccessType accessType) { + this.accessType = accessType; + return this; + } + +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/Users.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/Users.java new file mode 100644 index 0000000000000..6c7fe62569a0d --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/Users.java @@ -0,0 +1,53 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.databoxedge.v2019_03_01.implementation.UsersInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Users. + */ +public interface Users extends SupportsCreating, HasInner { + /** + * Gets the properties of the specified user. + * + * @param deviceName The device name. + * @param name The user name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String deviceName, String name, String resourceGroupName); + + /** + * Gets all the users registered on a data box edge/gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByDataBoxEdgeDeviceAsync(final String deviceName, final String resourceGroupName); + + /** + * Deletes the user on a databox edge/gateway device. + * + * @param deviceName The device name. + * @param name The user name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String deviceName, String name, String resourceGroupName); + +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/AlertImpl.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/AlertImpl.java new file mode 100644 index 0000000000000..203729e39a97b --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/AlertImpl.java @@ -0,0 +1,97 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01.implementation; + +import com.microsoft.azure.management.databoxedge.v2019_03_01.Alert; +import com.microsoft.azure.arm.model.implementation.IndexableRefreshableWrapperImpl; +import rx.Observable; +import org.joda.time.DateTime; +import java.util.Map; +import com.microsoft.azure.management.databoxedge.v2019_03_01.AlertErrorDetails; +import com.microsoft.azure.management.databoxedge.v2019_03_01.AlertSeverity; + +class AlertImpl extends IndexableRefreshableWrapperImpl implements Alert { + private final DataBoxEdgeManager manager; + private String deviceName; + private String name; + private String resourceGroupName; + + AlertImpl(AlertInner inner, DataBoxEdgeManager manager) { + super(null, inner); + this.manager = manager; + // set resource ancestor and positional variables + this.deviceName = IdParsingUtils.getValueFromIdByName(inner.id(), "dataBoxEdgeDevices"); + this.name = IdParsingUtils.getValueFromIdByName(inner.id(), "alerts"); + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + } + + @Override + public DataBoxEdgeManager manager() { + return this.manager; + } + + @Override + protected Observable getInnerAsync() { + AlertsInner client = this.manager().inner().alerts(); + return client.getAsync(this.deviceName, this.name, this.resourceGroupName); + } + + + + @Override + public String alertType() { + return this.inner().alertType(); + } + + @Override + public DateTime appearedAtDateTime() { + return this.inner().appearedAtDateTime(); + } + + @Override + public Map detailedInformation() { + return this.inner().detailedInformation(); + } + + @Override + public AlertErrorDetails errorDetails() { + return this.inner().errorDetails(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String recommendation() { + return this.inner().recommendation(); + } + + @Override + public AlertSeverity severity() { + return this.inner().severity(); + } + + @Override + public String title() { + return this.inner().title(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/AlertInner.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/AlertInner.java new file mode 100644 index 0000000000000..4adac3dd28d1c --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/AlertInner.java @@ -0,0 +1,130 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01.implementation; + +import org.joda.time.DateTime; +import com.microsoft.azure.management.databoxedge.v2019_03_01.AlertSeverity; +import com.microsoft.azure.management.databoxedge.v2019_03_01.AlertErrorDetails; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.management.databoxedge.v2019_03_01.ARMBaseModel; + +/** + * Alert on the data box edge/gateway device. + */ +@JsonFlatten +public class AlertInner extends ARMBaseModel { + /** + * Alert title. + */ + @JsonProperty(value = "properties.title", access = JsonProperty.Access.WRITE_ONLY) + private String title; + + /** + * Alert type. + */ + @JsonProperty(value = "properties.alertType", access = JsonProperty.Access.WRITE_ONLY) + private String alertType; + + /** + * UTC time when the alert appeared. + */ + @JsonProperty(value = "properties.appearedAtDateTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime appearedAtDateTime; + + /** + * Alert recommendation. + */ + @JsonProperty(value = "properties.recommendation", access = JsonProperty.Access.WRITE_ONLY) + private String recommendation; + + /** + * Severity of the alert. Possible values include: 'Informational', + * 'Warning', 'Critical'. + */ + @JsonProperty(value = "properties.severity", access = JsonProperty.Access.WRITE_ONLY) + private AlertSeverity severity; + + /** + * Error details of the alert. + */ + @JsonProperty(value = "properties.errorDetails", access = JsonProperty.Access.WRITE_ONLY) + private AlertErrorDetails errorDetails; + + /** + * Alert details. + */ + @JsonProperty(value = "properties.detailedInformation", access = JsonProperty.Access.WRITE_ONLY) + private Map detailedInformation; + + /** + * Get alert title. + * + * @return the title value + */ + public String title() { + return this.title; + } + + /** + * Get alert type. + * + * @return the alertType value + */ + public String alertType() { + return this.alertType; + } + + /** + * Get uTC time when the alert appeared. + * + * @return the appearedAtDateTime value + */ + public DateTime appearedAtDateTime() { + return this.appearedAtDateTime; + } + + /** + * Get alert recommendation. + * + * @return the recommendation value + */ + public String recommendation() { + return this.recommendation; + } + + /** + * Get severity of the alert. Possible values include: 'Informational', 'Warning', 'Critical'. + * + * @return the severity value + */ + public AlertSeverity severity() { + return this.severity; + } + + /** + * Get error details of the alert. + * + * @return the errorDetails value + */ + public AlertErrorDetails errorDetails() { + return this.errorDetails; + } + + /** + * Get alert details. + * + * @return the detailedInformation value + */ + public Map detailedInformation() { + return this.detailedInformation; + } + +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/AlertsImpl.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/AlertsImpl.java new file mode 100644 index 0000000000000..fba43e9fe8fe3 --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/AlertsImpl.java @@ -0,0 +1,69 @@ +/** + * 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. + * + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.databoxedge.v2019_03_01.Alerts; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.databoxedge.v2019_03_01.Alert; + +class AlertsImpl extends WrapperImpl implements Alerts { + private final DataBoxEdgeManager manager; + + AlertsImpl(DataBoxEdgeManager manager) { + super(manager.inner().alerts()); + this.manager = manager; + } + + public DataBoxEdgeManager manager() { + return this.manager; + } + + private AlertImpl wrapModel(AlertInner inner) { + return new AlertImpl(inner, manager()); + } + + @Override + public Observable listByDataBoxEdgeDeviceAsync(final String deviceName, final String resourceGroupName) { + AlertsInner client = this.inner(); + return client.listByDataBoxEdgeDeviceAsync(deviceName, resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Alert call(AlertInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String deviceName, String name, String resourceGroupName) { + AlertsInner client = this.inner(); + return client.getAsync(deviceName, name, resourceGroupName) + .flatMap(new Func1>() { + @Override + public Observable call(AlertInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((Alert)wrapModel(inner)); + } + } + }); + } + +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/AlertsInner.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/AlertsInner.java new file mode 100644 index 0000000000000..ba9865571741c --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/AlertsInner.java @@ -0,0 +1,401 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Alerts. + */ +public class AlertsInner { + /** The Retrofit service to perform REST calls. */ + private AlertsService service; + /** The service client containing this operation class. */ + private DataBoxEdgeManagementClientImpl client; + + /** + * Initializes an instance of AlertsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public AlertsInner(Retrofit retrofit, DataBoxEdgeManagementClientImpl client) { + this.service = retrofit.create(AlertsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Alerts to be + * used by Retrofit to perform actually REST calls. + */ + interface AlertsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.databoxedge.v2019_03_01.Alerts listByDataBoxEdgeDevice" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/alerts") + Observable> listByDataBoxEdgeDevice(@Path("deviceName") String deviceName, @Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.databoxedge.v2019_03_01.Alerts get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/alerts/{name}") + Observable> get(@Path("deviceName") String deviceName, @Path("name") String name, @Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.databoxedge.v2019_03_01.Alerts listByDataBoxEdgeDeviceNext" }) + @GET + Observable> listByDataBoxEdgeDeviceNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets all the alerts for a data box edge/gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<AlertInner> object if successful. + */ + public PagedList listByDataBoxEdgeDevice(final String deviceName, final String resourceGroupName) { + ServiceResponse> response = listByDataBoxEdgeDeviceSinglePageAsync(deviceName, resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByDataBoxEdgeDeviceNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the alerts for a data box edge/gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByDataBoxEdgeDeviceAsync(final String deviceName, final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByDataBoxEdgeDeviceSinglePageAsync(deviceName, resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByDataBoxEdgeDeviceNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the alerts for a data box edge/gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AlertInner> object + */ + public Observable> listByDataBoxEdgeDeviceAsync(final String deviceName, final String resourceGroupName) { + return listByDataBoxEdgeDeviceWithServiceResponseAsync(deviceName, resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the alerts for a data box edge/gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AlertInner> object + */ + public Observable>> listByDataBoxEdgeDeviceWithServiceResponseAsync(final String deviceName, final String resourceGroupName) { + return listByDataBoxEdgeDeviceSinglePageAsync(deviceName, resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByDataBoxEdgeDeviceNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the alerts for a data box edge/gateway device. + * + ServiceResponse> * @param deviceName The device name. + ServiceResponse> * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<AlertInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByDataBoxEdgeDeviceSinglePageAsync(final String deviceName, final String resourceGroupName) { + if (deviceName == null) { + throw new IllegalArgumentException("Parameter deviceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByDataBoxEdgeDevice(deviceName, this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByDataBoxEdgeDeviceDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByDataBoxEdgeDeviceDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets an alert by name. + * + * @param deviceName The device name. + * @param name The alert name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the AlertInner object if successful. + */ + public AlertInner get(String deviceName, String name, String resourceGroupName) { + return getWithServiceResponseAsync(deviceName, name, resourceGroupName).toBlocking().single().body(); + } + + /** + * Gets an alert by name. + * + * @param deviceName The device name. + * @param name The alert name. + * @param resourceGroupName The resource group name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String deviceName, String name, String resourceGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(deviceName, name, resourceGroupName), serviceCallback); + } + + /** + * Gets an alert by name. + * + * @param deviceName The device name. + * @param name The alert name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AlertInner object + */ + public Observable getAsync(String deviceName, String name, String resourceGroupName) { + return getWithServiceResponseAsync(deviceName, name, resourceGroupName).map(new Func1, AlertInner>() { + @Override + public AlertInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets an alert by name. + * + * @param deviceName The device name. + * @param name The alert name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AlertInner object + */ + public Observable> getWithServiceResponseAsync(String deviceName, String name, String resourceGroupName) { + if (deviceName == null) { + throw new IllegalArgumentException("Parameter deviceName is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(deviceName, name, this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the alerts for a data box edge/gateway device. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<AlertInner> object if successful. + */ + public PagedList listByDataBoxEdgeDeviceNext(final String nextPageLink) { + ServiceResponse> response = listByDataBoxEdgeDeviceNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByDataBoxEdgeDeviceNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the alerts for a data box edge/gateway device. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByDataBoxEdgeDeviceNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByDataBoxEdgeDeviceNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByDataBoxEdgeDeviceNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the alerts for a data box edge/gateway device. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AlertInner> object + */ + public Observable> listByDataBoxEdgeDeviceNextAsync(final String nextPageLink) { + return listByDataBoxEdgeDeviceNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the alerts for a data box edge/gateway device. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AlertInner> object + */ + public Observable>> listByDataBoxEdgeDeviceNextWithServiceResponseAsync(final String nextPageLink) { + return listByDataBoxEdgeDeviceNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByDataBoxEdgeDeviceNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the alerts for a data box edge/gateway device. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<AlertInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByDataBoxEdgeDeviceNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByDataBoxEdgeDeviceNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByDataBoxEdgeDeviceNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByDataBoxEdgeDeviceNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/BandwidthScheduleImpl.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/BandwidthScheduleImpl.java new file mode 100644 index 0000000000000..b15c9c74644d2 --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/BandwidthScheduleImpl.java @@ -0,0 +1,140 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01.implementation; + +import com.microsoft.azure.management.databoxedge.v2019_03_01.BandwidthSchedule; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.management.databoxedge.v2019_03_01.DayOfWeek; + +class BandwidthScheduleImpl extends CreatableUpdatableImpl implements BandwidthSchedule, BandwidthSchedule.Definition, BandwidthSchedule.Update { + private final DataBoxEdgeManager manager; + private String deviceName; + private String name; + private String resourceGroupName; + + BandwidthScheduleImpl(String name, DataBoxEdgeManager manager) { + super(name, new BandwidthScheduleInner()); + this.manager = manager; + // Set resource name + this.name = name; + // + } + + BandwidthScheduleImpl(BandwidthScheduleInner inner, DataBoxEdgeManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.name = inner.name(); + // set resource ancestor and positional variables + this.deviceName = IdParsingUtils.getValueFromIdByName(inner.id(), "dataBoxEdgeDevices"); + this.name = IdParsingUtils.getValueFromIdByName(inner.id(), "bandwidthSchedules"); + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + // + } + + @Override + public DataBoxEdgeManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + BandwidthSchedulesInner client = this.manager().inner().bandwidthSchedules(); + return client.createOrUpdateAsync(this.deviceName, this.name, this.resourceGroupName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + BandwidthSchedulesInner client = this.manager().inner().bandwidthSchedules(); + return client.createOrUpdateAsync(this.deviceName, this.name, this.resourceGroupName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + BandwidthSchedulesInner client = this.manager().inner().bandwidthSchedules(); + return client.getAsync(this.deviceName, this.name, this.resourceGroupName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public List days() { + return this.inner().days(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public int rateInMbps() { + return this.inner().rateInMbps(); + } + + @Override + public String start() { + return this.inner().start(); + } + + @Override + public String stop() { + return this.inner().stop(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public BandwidthScheduleImpl withExistingDataBoxEdgeDevice(String deviceName, String resourceGroupName) { + this.deviceName = deviceName; + this.resourceGroupName = resourceGroupName; + return this; + } + + @Override + public BandwidthScheduleImpl withDays(List days) { + this.inner().withDays(days); + return this; + } + + @Override + public BandwidthScheduleImpl withRateInMbps(int rateInMbps) { + this.inner().withRateInMbps(rateInMbps); + return this; + } + + @Override + public BandwidthScheduleImpl withStart(String start) { + this.inner().withStart(start); + return this; + } + + @Override + public BandwidthScheduleImpl withStop(String stop) { + this.inner().withStop(stop); + return this; + } + +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/BandwidthScheduleInner.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/BandwidthScheduleInner.java new file mode 100644 index 0000000000000..47a271fc8fbb9 --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/BandwidthScheduleInner.java @@ -0,0 +1,126 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.databoxedge.v2019_03_01.DayOfWeek; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.management.databoxedge.v2019_03_01.ARMBaseModel; + +/** + * The bandwidth schedule details. + */ +@JsonFlatten +public class BandwidthScheduleInner extends ARMBaseModel { + /** + * The start time of the schedule in UTC. + */ + @JsonProperty(value = "properties.start", required = true) + private String start; + + /** + * The stop time of the schedule in UTC. + */ + @JsonProperty(value = "properties.stop", required = true) + private String stop; + + /** + * The bandwidth rate in Mbps. + */ + @JsonProperty(value = "properties.rateInMbps", required = true) + private int rateInMbps; + + /** + * The days of the week when this schedule is applicable. + */ + @JsonProperty(value = "properties.days", required = true) + private List days; + + /** + * Get the start time of the schedule in UTC. + * + * @return the start value + */ + public String start() { + return this.start; + } + + /** + * Set the start time of the schedule in UTC. + * + * @param start the start value to set + * @return the BandwidthScheduleInner object itself. + */ + public BandwidthScheduleInner withStart(String start) { + this.start = start; + return this; + } + + /** + * Get the stop time of the schedule in UTC. + * + * @return the stop value + */ + public String stop() { + return this.stop; + } + + /** + * Set the stop time of the schedule in UTC. + * + * @param stop the stop value to set + * @return the BandwidthScheduleInner object itself. + */ + public BandwidthScheduleInner withStop(String stop) { + this.stop = stop; + return this; + } + + /** + * Get the bandwidth rate in Mbps. + * + * @return the rateInMbps value + */ + public int rateInMbps() { + return this.rateInMbps; + } + + /** + * Set the bandwidth rate in Mbps. + * + * @param rateInMbps the rateInMbps value to set + * @return the BandwidthScheduleInner object itself. + */ + public BandwidthScheduleInner withRateInMbps(int rateInMbps) { + this.rateInMbps = rateInMbps; + return this; + } + + /** + * Get the days of the week when this schedule is applicable. + * + * @return the days value + */ + public List days() { + return this.days; + } + + /** + * Set the days of the week when this schedule is applicable. + * + * @param days the days value to set + * @return the BandwidthScheduleInner object itself. + */ + public BandwidthScheduleInner withDays(List days) { + this.days = days; + return this; + } + +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/BandwidthSchedulesImpl.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/BandwidthSchedulesImpl.java new file mode 100644 index 0000000000000..c844f03199d11 --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/BandwidthSchedulesImpl.java @@ -0,0 +1,85 @@ +/** + * 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. + * + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.databoxedge.v2019_03_01.BandwidthSchedules; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.databoxedge.v2019_03_01.BandwidthSchedule; + +class BandwidthSchedulesImpl extends WrapperImpl implements BandwidthSchedules { + private final DataBoxEdgeManager manager; + + BandwidthSchedulesImpl(DataBoxEdgeManager manager) { + super(manager.inner().bandwidthSchedules()); + this.manager = manager; + } + + public DataBoxEdgeManager manager() { + return this.manager; + } + + @Override + public BandwidthScheduleImpl define(String name) { + return wrapModel(name); + } + + private BandwidthScheduleImpl wrapModel(BandwidthScheduleInner inner) { + return new BandwidthScheduleImpl(inner, manager()); + } + + private BandwidthScheduleImpl wrapModel(String name) { + return new BandwidthScheduleImpl(name, this.manager()); + } + + @Override + public Observable listByDataBoxEdgeDeviceAsync(final String deviceName, final String resourceGroupName) { + BandwidthSchedulesInner client = this.inner(); + return client.listByDataBoxEdgeDeviceAsync(deviceName, resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public BandwidthSchedule call(BandwidthScheduleInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String deviceName, String name, String resourceGroupName) { + BandwidthSchedulesInner client = this.inner(); + return client.getAsync(deviceName, name, resourceGroupName) + .flatMap(new Func1>() { + @Override + public Observable call(BandwidthScheduleInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((BandwidthSchedule)wrapModel(inner)); + } + } + }); + } + + @Override + public Completable deleteAsync(String deviceName, String name, String resourceGroupName) { + BandwidthSchedulesInner client = this.inner(); + return client.deleteAsync(deviceName, name, resourceGroupName).toCompletable(); + } + +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/BandwidthSchedulesInner.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/BandwidthSchedulesInner.java new file mode 100644 index 0000000000000..8c2d8891414d8 --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/BandwidthSchedulesInner.java @@ -0,0 +1,776 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in BandwidthSchedules. + */ +public class BandwidthSchedulesInner { + /** The Retrofit service to perform REST calls. */ + private BandwidthSchedulesService service; + /** The service client containing this operation class. */ + private DataBoxEdgeManagementClientImpl client; + + /** + * Initializes an instance of BandwidthSchedulesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public BandwidthSchedulesInner(Retrofit retrofit, DataBoxEdgeManagementClientImpl client) { + this.service = retrofit.create(BandwidthSchedulesService.class); + this.client = client; + } + + /** + * The interface defining all the services for BandwidthSchedules to be + * used by Retrofit to perform actually REST calls. + */ + interface BandwidthSchedulesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.databoxedge.v2019_03_01.BandwidthSchedules listByDataBoxEdgeDevice" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/bandwidthSchedules") + Observable> listByDataBoxEdgeDevice(@Path("deviceName") String deviceName, @Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.databoxedge.v2019_03_01.BandwidthSchedules get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/bandwidthSchedules/{name}") + Observable> get(@Path("deviceName") String deviceName, @Path("name") String name, @Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.databoxedge.v2019_03_01.BandwidthSchedules createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/bandwidthSchedules/{name}") + Observable> createOrUpdate(@Path("deviceName") String deviceName, @Path("name") String name, @Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Body BandwidthScheduleInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.databoxedge.v2019_03_01.BandwidthSchedules beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/bandwidthSchedules/{name}") + Observable> beginCreateOrUpdate(@Path("deviceName") String deviceName, @Path("name") String name, @Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Body BandwidthScheduleInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.databoxedge.v2019_03_01.BandwidthSchedules delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/bandwidthSchedules/{name}", method = "DELETE", hasBody = true) + Observable> delete(@Path("deviceName") String deviceName, @Path("name") String name, @Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.databoxedge.v2019_03_01.BandwidthSchedules beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/bandwidthSchedules/{name}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("deviceName") String deviceName, @Path("name") String name, @Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.databoxedge.v2019_03_01.BandwidthSchedules listByDataBoxEdgeDeviceNext" }) + @GET + Observable> listByDataBoxEdgeDeviceNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets all the bandwidth schedules for a data box edge/gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<BandwidthScheduleInner> object if successful. + */ + public PagedList listByDataBoxEdgeDevice(final String deviceName, final String resourceGroupName) { + ServiceResponse> response = listByDataBoxEdgeDeviceSinglePageAsync(deviceName, resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByDataBoxEdgeDeviceNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the bandwidth schedules for a data box edge/gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByDataBoxEdgeDeviceAsync(final String deviceName, final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByDataBoxEdgeDeviceSinglePageAsync(deviceName, resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByDataBoxEdgeDeviceNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the bandwidth schedules for a data box edge/gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<BandwidthScheduleInner> object + */ + public Observable> listByDataBoxEdgeDeviceAsync(final String deviceName, final String resourceGroupName) { + return listByDataBoxEdgeDeviceWithServiceResponseAsync(deviceName, resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the bandwidth schedules for a data box edge/gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<BandwidthScheduleInner> object + */ + public Observable>> listByDataBoxEdgeDeviceWithServiceResponseAsync(final String deviceName, final String resourceGroupName) { + return listByDataBoxEdgeDeviceSinglePageAsync(deviceName, resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByDataBoxEdgeDeviceNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the bandwidth schedules for a data box edge/gateway device. + * + ServiceResponse> * @param deviceName The device name. + ServiceResponse> * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<BandwidthScheduleInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByDataBoxEdgeDeviceSinglePageAsync(final String deviceName, final String resourceGroupName) { + if (deviceName == null) { + throw new IllegalArgumentException("Parameter deviceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByDataBoxEdgeDevice(deviceName, this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByDataBoxEdgeDeviceDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByDataBoxEdgeDeviceDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the properties of the specified bandwidth schedule. + * + * @param deviceName The device name. + * @param name The bandwidth schedule name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the BandwidthScheduleInner object if successful. + */ + public BandwidthScheduleInner get(String deviceName, String name, String resourceGroupName) { + return getWithServiceResponseAsync(deviceName, name, resourceGroupName).toBlocking().single().body(); + } + + /** + * Gets the properties of the specified bandwidth schedule. + * + * @param deviceName The device name. + * @param name The bandwidth schedule name. + * @param resourceGroupName The resource group name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String deviceName, String name, String resourceGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(deviceName, name, resourceGroupName), serviceCallback); + } + + /** + * Gets the properties of the specified bandwidth schedule. + * + * @param deviceName The device name. + * @param name The bandwidth schedule name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BandwidthScheduleInner object + */ + public Observable getAsync(String deviceName, String name, String resourceGroupName) { + return getWithServiceResponseAsync(deviceName, name, resourceGroupName).map(new Func1, BandwidthScheduleInner>() { + @Override + public BandwidthScheduleInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the properties of the specified bandwidth schedule. + * + * @param deviceName The device name. + * @param name The bandwidth schedule name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BandwidthScheduleInner object + */ + public Observable> getWithServiceResponseAsync(String deviceName, String name, String resourceGroupName) { + if (deviceName == null) { + throw new IllegalArgumentException("Parameter deviceName is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(deviceName, name, this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates or updates a bandwidth schedule. + * + * @param deviceName The device name. + * @param name The bandwidth schedule name which needs to be added/updated. + * @param resourceGroupName The resource group name. + * @param parameters The bandwidth schedule to be added or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the BandwidthScheduleInner object if successful. + */ + public BandwidthScheduleInner createOrUpdate(String deviceName, String name, String resourceGroupName, BandwidthScheduleInner parameters) { + return createOrUpdateWithServiceResponseAsync(deviceName, name, resourceGroupName, parameters).toBlocking().last().body(); + } + + /** + * Creates or updates a bandwidth schedule. + * + * @param deviceName The device name. + * @param name The bandwidth schedule name which needs to be added/updated. + * @param resourceGroupName The resource group name. + * @param parameters The bandwidth schedule to be added or updated. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String deviceName, String name, String resourceGroupName, BandwidthScheduleInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(deviceName, name, resourceGroupName, parameters), serviceCallback); + } + + /** + * Creates or updates a bandwidth schedule. + * + * @param deviceName The device name. + * @param name The bandwidth schedule name which needs to be added/updated. + * @param resourceGroupName The resource group name. + * @param parameters The bandwidth schedule to be added or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String deviceName, String name, String resourceGroupName, BandwidthScheduleInner parameters) { + return createOrUpdateWithServiceResponseAsync(deviceName, name, resourceGroupName, parameters).map(new Func1, BandwidthScheduleInner>() { + @Override + public BandwidthScheduleInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a bandwidth schedule. + * + * @param deviceName The device name. + * @param name The bandwidth schedule name which needs to be added/updated. + * @param resourceGroupName The resource group name. + * @param parameters The bandwidth schedule to be added or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String deviceName, String name, String resourceGroupName, BandwidthScheduleInner parameters) { + if (deviceName == null) { + throw new IllegalArgumentException("Parameter deviceName is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + Observable> observable = service.createOrUpdate(deviceName, name, this.client.subscriptionId(), resourceGroupName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates or updates a bandwidth schedule. + * + * @param deviceName The device name. + * @param name The bandwidth schedule name which needs to be added/updated. + * @param resourceGroupName The resource group name. + * @param parameters The bandwidth schedule to be added or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the BandwidthScheduleInner object if successful. + */ + public BandwidthScheduleInner beginCreateOrUpdate(String deviceName, String name, String resourceGroupName, BandwidthScheduleInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(deviceName, name, resourceGroupName, parameters).toBlocking().single().body(); + } + + /** + * Creates or updates a bandwidth schedule. + * + * @param deviceName The device name. + * @param name The bandwidth schedule name which needs to be added/updated. + * @param resourceGroupName The resource group name. + * @param parameters The bandwidth schedule to be added or updated. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String deviceName, String name, String resourceGroupName, BandwidthScheduleInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(deviceName, name, resourceGroupName, parameters), serviceCallback); + } + + /** + * Creates or updates a bandwidth schedule. + * + * @param deviceName The device name. + * @param name The bandwidth schedule name which needs to be added/updated. + * @param resourceGroupName The resource group name. + * @param parameters The bandwidth schedule to be added or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BandwidthScheduleInner object + */ + public Observable beginCreateOrUpdateAsync(String deviceName, String name, String resourceGroupName, BandwidthScheduleInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(deviceName, name, resourceGroupName, parameters).map(new Func1, BandwidthScheduleInner>() { + @Override + public BandwidthScheduleInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a bandwidth schedule. + * + * @param deviceName The device name. + * @param name The bandwidth schedule name which needs to be added/updated. + * @param resourceGroupName The resource group name. + * @param parameters The bandwidth schedule to be added or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BandwidthScheduleInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String deviceName, String name, String resourceGroupName, BandwidthScheduleInner parameters) { + if (deviceName == null) { + throw new IllegalArgumentException("Parameter deviceName is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.beginCreateOrUpdate(deviceName, name, this.client.subscriptionId(), resourceGroupName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes the specified bandwidth schedule. + * + * @param deviceName The device name. + * @param name The bandwidth schedule name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String deviceName, String name, String resourceGroupName) { + deleteWithServiceResponseAsync(deviceName, name, resourceGroupName).toBlocking().last().body(); + } + + /** + * Deletes the specified bandwidth schedule. + * + * @param deviceName The device name. + * @param name The bandwidth schedule name. + * @param resourceGroupName The resource group name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String deviceName, String name, String resourceGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(deviceName, name, resourceGroupName), serviceCallback); + } + + /** + * Deletes the specified bandwidth schedule. + * + * @param deviceName The device name. + * @param name The bandwidth schedule name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String deviceName, String name, String resourceGroupName) { + return deleteWithServiceResponseAsync(deviceName, name, resourceGroupName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified bandwidth schedule. + * + * @param deviceName The device name. + * @param name The bandwidth schedule name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String deviceName, String name, String resourceGroupName) { + if (deviceName == null) { + throw new IllegalArgumentException("Parameter deviceName is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.delete(deviceName, name, this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the specified bandwidth schedule. + * + * @param deviceName The device name. + * @param name The bandwidth schedule name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String deviceName, String name, String resourceGroupName) { + beginDeleteWithServiceResponseAsync(deviceName, name, resourceGroupName).toBlocking().single().body(); + } + + /** + * Deletes the specified bandwidth schedule. + * + * @param deviceName The device name. + * @param name The bandwidth schedule name. + * @param resourceGroupName The resource group name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String deviceName, String name, String resourceGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(deviceName, name, resourceGroupName), serviceCallback); + } + + /** + * Deletes the specified bandwidth schedule. + * + * @param deviceName The device name. + * @param name The bandwidth schedule name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String deviceName, String name, String resourceGroupName) { + return beginDeleteWithServiceResponseAsync(deviceName, name, resourceGroupName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified bandwidth schedule. + * + * @param deviceName The device name. + * @param name The bandwidth schedule name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String deviceName, String name, String resourceGroupName) { + if (deviceName == null) { + throw new IllegalArgumentException("Parameter deviceName is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDelete(deviceName, name, this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the bandwidth schedules for a data box edge/gateway device. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<BandwidthScheduleInner> object if successful. + */ + public PagedList listByDataBoxEdgeDeviceNext(final String nextPageLink) { + ServiceResponse> response = listByDataBoxEdgeDeviceNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByDataBoxEdgeDeviceNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the bandwidth schedules for a data box edge/gateway device. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByDataBoxEdgeDeviceNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByDataBoxEdgeDeviceNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByDataBoxEdgeDeviceNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the bandwidth schedules for a data box edge/gateway device. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<BandwidthScheduleInner> object + */ + public Observable> listByDataBoxEdgeDeviceNextAsync(final String nextPageLink) { + return listByDataBoxEdgeDeviceNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the bandwidth schedules for a data box edge/gateway device. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<BandwidthScheduleInner> object + */ + public Observable>> listByDataBoxEdgeDeviceNextWithServiceResponseAsync(final String nextPageLink) { + return listByDataBoxEdgeDeviceNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByDataBoxEdgeDeviceNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the bandwidth schedules for a data box edge/gateway device. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<BandwidthScheduleInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByDataBoxEdgeDeviceNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByDataBoxEdgeDeviceNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByDataBoxEdgeDeviceNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByDataBoxEdgeDeviceNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/DataBoxEdgeDeviceExtendedInfoImpl.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/DataBoxEdgeDeviceExtendedInfoImpl.java new file mode 100644 index 0000000000000..cc8be0d2f9ade --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/DataBoxEdgeDeviceExtendedInfoImpl.java @@ -0,0 +1,56 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01.implementation; + +import com.microsoft.azure.management.databoxedge.v2019_03_01.DataBoxEdgeDeviceExtendedInfo; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class DataBoxEdgeDeviceExtendedInfoImpl extends WrapperImpl implements DataBoxEdgeDeviceExtendedInfo { + private final DataBoxEdgeManager manager; + DataBoxEdgeDeviceExtendedInfoImpl(DataBoxEdgeDeviceExtendedInfoInner inner, DataBoxEdgeManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public DataBoxEdgeManager manager() { + return this.manager; + } + + @Override + public String encryptionKey() { + return this.inner().encryptionKey(); + } + + @Override + public String encryptionKeyThumbprint() { + return this.inner().encryptionKeyThumbprint(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String resourceKey() { + return this.inner().resourceKey(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/DataBoxEdgeDeviceExtendedInfoInner.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/DataBoxEdgeDeviceExtendedInfoInner.java new file mode 100644 index 0000000000000..1aa539ad02057 --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/DataBoxEdgeDeviceExtendedInfoInner.java @@ -0,0 +1,88 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.management.databoxedge.v2019_03_01.ARMBaseModel; + +/** + * The extended Info of the Data Box Edge/Gateway device. + */ +@JsonFlatten +public class DataBoxEdgeDeviceExtendedInfoInner extends ARMBaseModel { + /** + * The digital signature of encrypted certificate. + */ + @JsonProperty(value = "properties.encryptionKeyThumbprint") + private String encryptionKeyThumbprint; + + /** + * The public part of the encryption certificate. Client uses this to + * encrypt any secret. + */ + @JsonProperty(value = "properties.encryptionKey") + private String encryptionKey; + + /** + * The Resource ID of the Resource. + */ + @JsonProperty(value = "properties.resourceKey", access = JsonProperty.Access.WRITE_ONLY) + private String resourceKey; + + /** + * Get the digital signature of encrypted certificate. + * + * @return the encryptionKeyThumbprint value + */ + public String encryptionKeyThumbprint() { + return this.encryptionKeyThumbprint; + } + + /** + * Set the digital signature of encrypted certificate. + * + * @param encryptionKeyThumbprint the encryptionKeyThumbprint value to set + * @return the DataBoxEdgeDeviceExtendedInfoInner object itself. + */ + public DataBoxEdgeDeviceExtendedInfoInner withEncryptionKeyThumbprint(String encryptionKeyThumbprint) { + this.encryptionKeyThumbprint = encryptionKeyThumbprint; + return this; + } + + /** + * Get the public part of the encryption certificate. Client uses this to encrypt any secret. + * + * @return the encryptionKey value + */ + public String encryptionKey() { + return this.encryptionKey; + } + + /** + * Set the public part of the encryption certificate. Client uses this to encrypt any secret. + * + * @param encryptionKey the encryptionKey value to set + * @return the DataBoxEdgeDeviceExtendedInfoInner object itself. + */ + public DataBoxEdgeDeviceExtendedInfoInner withEncryptionKey(String encryptionKey) { + this.encryptionKey = encryptionKey; + return this; + } + + /** + * Get the Resource ID of the Resource. + * + * @return the resourceKey value + */ + public String resourceKey() { + return this.resourceKey; + } + +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/DataBoxEdgeDeviceImpl.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/DataBoxEdgeDeviceImpl.java new file mode 100644 index 0000000000000..631b87d6dd382 --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/DataBoxEdgeDeviceImpl.java @@ -0,0 +1,162 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.databoxedge.v2019_03_01.DataBoxEdgeDevice; +import rx.Observable; +import com.microsoft.azure.management.databoxedge.v2019_03_01.Sku; +import com.microsoft.azure.management.databoxedge.v2019_03_01.DataBoxEdgeDeviceStatus; +import com.microsoft.azure.management.databoxedge.v2019_03_01.DeviceType; +import java.util.List; +import com.microsoft.azure.management.databoxedge.v2019_03_01.RoleTypes; + +class DataBoxEdgeDeviceImpl extends GroupableResourceCoreImpl implements DataBoxEdgeDevice, DataBoxEdgeDevice.Definition, DataBoxEdgeDevice.Update { + DataBoxEdgeDeviceImpl(String name, DataBoxEdgeDeviceInner inner, DataBoxEdgeManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + DevicesInner client = this.manager().inner().devices(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + DevicesInner client = this.manager().inner().devices(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + DevicesInner client = this.manager().inner().devices(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public List configuredRoleTypes() { + return this.inner().configuredRoleTypes(); + } + + @Override + public String culture() { + return this.inner().culture(); + } + + @Override + public DataBoxEdgeDeviceStatus dataBoxEdgeDeviceStatus() { + return this.inner().dataBoxEdgeDeviceStatus(); + } + + @Override + public String description() { + return this.inner().description(); + } + + @Override + public String deviceHcsVersion() { + return this.inner().deviceHcsVersion(); + } + + @Override + public Long deviceLocalCapacity() { + return this.inner().deviceLocalCapacity(); + } + + @Override + public String deviceModel() { + return this.inner().deviceModel(); + } + + @Override + public String deviceSoftwareVersion() { + return this.inner().deviceSoftwareVersion(); + } + + @Override + public DeviceType deviceType() { + return this.inner().deviceType(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String friendlyName() { + return this.inner().friendlyName(); + } + + @Override + public String modelDescription() { + return this.inner().modelDescription(); + } + + @Override + public String serialNumber() { + return this.inner().serialNumber(); + } + + @Override + public Sku sku() { + return this.inner().sku(); + } + + @Override + public String timeZone() { + return this.inner().timeZone(); + } + + @Override + public DataBoxEdgeDeviceImpl withDataBoxEdgeDeviceStatus(DataBoxEdgeDeviceStatus dataBoxEdgeDeviceStatus) { + this.inner().withDataBoxEdgeDeviceStatus(dataBoxEdgeDeviceStatus); + return this; + } + + @Override + public DataBoxEdgeDeviceImpl withDescription(String description) { + this.inner().withDescription(description); + return this; + } + + @Override + public DataBoxEdgeDeviceImpl withEtag(String etag) { + this.inner().withEtag(etag); + return this; + } + + @Override + public DataBoxEdgeDeviceImpl withFriendlyName(String friendlyName) { + this.inner().withFriendlyName(friendlyName); + return this; + } + + @Override + public DataBoxEdgeDeviceImpl withModelDescription(String modelDescription) { + this.inner().withModelDescription(modelDescription); + return this; + } + + @Override + public DataBoxEdgeDeviceImpl withSku(Sku sku) { + this.inner().withSku(sku); + return this; + } + +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/DataBoxEdgeDeviceInner.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/DataBoxEdgeDeviceInner.java new file mode 100644 index 0000000000000..d41211de64f49 --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/DataBoxEdgeDeviceInner.java @@ -0,0 +1,377 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01.implementation; + +import java.util.Map; +import com.microsoft.azure.management.databoxedge.v2019_03_01.Sku; +import com.microsoft.azure.management.databoxedge.v2019_03_01.DataBoxEdgeDeviceStatus; +import com.microsoft.azure.management.databoxedge.v2019_03_01.DeviceType; +import java.util.List; +import com.microsoft.azure.management.databoxedge.v2019_03_01.RoleTypes; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.management.databoxedge.v2019_03_01.ARMBaseModel; + +/** + * The Data Box Edge/Gateway device. + */ +@JsonFlatten +public class DataBoxEdgeDeviceInner extends ARMBaseModel { + /** + * The location of the device. This is a supported and registered Azure + * geographical region (for example, West US, East US, or Southeast Asia). + * The geographical region of a device cannot be changed once it is + * created, but if an identical geographical region is specified on update, + * the request will succeed. + */ + @JsonProperty(value = "location", required = true) + private String location; + + /** + * The list of tags that describe the device. These tags can be used to + * view and group this device (across resource groups). + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * The SKU type. + */ + @JsonProperty(value = "sku") + private Sku sku; + + /** + * The etag for the devices. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * The status of the Data Box Edge/Gateway device. Possible values include: + * 'ReadyToSetup', 'Online', 'Offline', 'NeedsAttention', 'Disconnected', + * 'PartiallyDisconnected'. + */ + @JsonProperty(value = "properties.dataBoxEdgeDeviceStatus") + private DataBoxEdgeDeviceStatus dataBoxEdgeDeviceStatus; + + /** + * The Serial Number of Data Box Edge/Gateway device. + */ + @JsonProperty(value = "properties.serialNumber", access = JsonProperty.Access.WRITE_ONLY) + private String serialNumber; + + /** + * The Description of the Data Box Edge/Gateway device. + */ + @JsonProperty(value = "properties.description") + private String description; + + /** + * The description of the Data Box Edge/Gateway device model. + */ + @JsonProperty(value = "properties.modelDescription") + private String modelDescription; + + /** + * The type of the Data Box Edge/Gateway device. Possible values include: + * 'DataBoxEdgeDevice'. + */ + @JsonProperty(value = "properties.deviceType", access = JsonProperty.Access.WRITE_ONLY) + private DeviceType deviceType; + + /** + * The Data Box Edge/Gateway device name. + */ + @JsonProperty(value = "properties.friendlyName") + private String friendlyName; + + /** + * The Data Box Edge/Gateway device culture. + */ + @JsonProperty(value = "properties.culture", access = JsonProperty.Access.WRITE_ONLY) + private String culture; + + /** + * The Data Box Edge/Gateway device model. + */ + @JsonProperty(value = "properties.deviceModel", access = JsonProperty.Access.WRITE_ONLY) + private String deviceModel; + + /** + * The Data Box Edge/Gateway device software version. + */ + @JsonProperty(value = "properties.deviceSoftwareVersion", access = JsonProperty.Access.WRITE_ONLY) + private String deviceSoftwareVersion; + + /** + * The Data Box Edge/Gateway device local capacity in MB. + */ + @JsonProperty(value = "properties.deviceLocalCapacity", access = JsonProperty.Access.WRITE_ONLY) + private Long deviceLocalCapacity; + + /** + * The Data Box Edge/Gateway device timezone. + */ + @JsonProperty(value = "properties.timeZone", access = JsonProperty.Access.WRITE_ONLY) + private String timeZone; + + /** + * The device software version number of the device (eg: 1.2.18105.6). + */ + @JsonProperty(value = "properties.deviceHcsVersion", access = JsonProperty.Access.WRITE_ONLY) + private String deviceHcsVersion; + + /** + * Type of compute roles configured. + */ + @JsonProperty(value = "properties.configuredRoleTypes", access = JsonProperty.Access.WRITE_ONLY) + private List configuredRoleTypes; + + /** + * Get the location of the device. This is a supported and registered Azure geographical region (for example, West US, East US, or Southeast Asia). The geographical region of a device cannot be changed once it is created, but if an identical geographical region is specified on update, the request will succeed. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location of the device. This is a supported and registered Azure geographical region (for example, West US, East US, or Southeast Asia). The geographical region of a device cannot be changed once it is created, but if an identical geographical region is specified on update, the request will succeed. + * + * @param location the location value to set + * @return the DataBoxEdgeDeviceInner object itself. + */ + public DataBoxEdgeDeviceInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the list of tags that describe the device. These tags can be used to view and group this device (across resource groups). + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set the list of tags that describe the device. These tags can be used to view and group this device (across resource groups). + * + * @param tags the tags value to set + * @return the DataBoxEdgeDeviceInner object itself. + */ + public DataBoxEdgeDeviceInner withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the SKU type. + * + * @return the sku value + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the SKU type. + * + * @param sku the sku value to set + * @return the DataBoxEdgeDeviceInner object itself. + */ + public DataBoxEdgeDeviceInner withSku(Sku sku) { + this.sku = sku; + return this; + } + + /** + * Get the etag for the devices. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag for the devices. + * + * @param etag the etag value to set + * @return the DataBoxEdgeDeviceInner object itself. + */ + public DataBoxEdgeDeviceInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get the status of the Data Box Edge/Gateway device. Possible values include: 'ReadyToSetup', 'Online', 'Offline', 'NeedsAttention', 'Disconnected', 'PartiallyDisconnected'. + * + * @return the dataBoxEdgeDeviceStatus value + */ + public DataBoxEdgeDeviceStatus dataBoxEdgeDeviceStatus() { + return this.dataBoxEdgeDeviceStatus; + } + + /** + * Set the status of the Data Box Edge/Gateway device. Possible values include: 'ReadyToSetup', 'Online', 'Offline', 'NeedsAttention', 'Disconnected', 'PartiallyDisconnected'. + * + * @param dataBoxEdgeDeviceStatus the dataBoxEdgeDeviceStatus value to set + * @return the DataBoxEdgeDeviceInner object itself. + */ + public DataBoxEdgeDeviceInner withDataBoxEdgeDeviceStatus(DataBoxEdgeDeviceStatus dataBoxEdgeDeviceStatus) { + this.dataBoxEdgeDeviceStatus = dataBoxEdgeDeviceStatus; + return this; + } + + /** + * Get the Serial Number of Data Box Edge/Gateway device. + * + * @return the serialNumber value + */ + public String serialNumber() { + return this.serialNumber; + } + + /** + * Get the Description of the Data Box Edge/Gateway device. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set the Description of the Data Box Edge/Gateway device. + * + * @param description the description value to set + * @return the DataBoxEdgeDeviceInner object itself. + */ + public DataBoxEdgeDeviceInner withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the description of the Data Box Edge/Gateway device model. + * + * @return the modelDescription value + */ + public String modelDescription() { + return this.modelDescription; + } + + /** + * Set the description of the Data Box Edge/Gateway device model. + * + * @param modelDescription the modelDescription value to set + * @return the DataBoxEdgeDeviceInner object itself. + */ + public DataBoxEdgeDeviceInner withModelDescription(String modelDescription) { + this.modelDescription = modelDescription; + return this; + } + + /** + * Get the type of the Data Box Edge/Gateway device. Possible values include: 'DataBoxEdgeDevice'. + * + * @return the deviceType value + */ + public DeviceType deviceType() { + return this.deviceType; + } + + /** + * Get the Data Box Edge/Gateway device name. + * + * @return the friendlyName value + */ + public String friendlyName() { + return this.friendlyName; + } + + /** + * Set the Data Box Edge/Gateway device name. + * + * @param friendlyName the friendlyName value to set + * @return the DataBoxEdgeDeviceInner object itself. + */ + public DataBoxEdgeDeviceInner withFriendlyName(String friendlyName) { + this.friendlyName = friendlyName; + return this; + } + + /** + * Get the Data Box Edge/Gateway device culture. + * + * @return the culture value + */ + public String culture() { + return this.culture; + } + + /** + * Get the Data Box Edge/Gateway device model. + * + * @return the deviceModel value + */ + public String deviceModel() { + return this.deviceModel; + } + + /** + * Get the Data Box Edge/Gateway device software version. + * + * @return the deviceSoftwareVersion value + */ + public String deviceSoftwareVersion() { + return this.deviceSoftwareVersion; + } + + /** + * Get the Data Box Edge/Gateway device local capacity in MB. + * + * @return the deviceLocalCapacity value + */ + public Long deviceLocalCapacity() { + return this.deviceLocalCapacity; + } + + /** + * Get the Data Box Edge/Gateway device timezone. + * + * @return the timeZone value + */ + public String timeZone() { + return this.timeZone; + } + + /** + * Get the device software version number of the device (eg: 1.2.18105.6). + * + * @return the deviceHcsVersion value + */ + public String deviceHcsVersion() { + return this.deviceHcsVersion; + } + + /** + * Get type of compute roles configured. + * + * @return the configuredRoleTypes value + */ + public List configuredRoleTypes() { + return this.configuredRoleTypes; + } + +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/DataBoxEdgeDeviceJobImpl.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/DataBoxEdgeDeviceJobImpl.java new file mode 100644 index 0000000000000..a130a6ada354d --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/DataBoxEdgeDeviceJobImpl.java @@ -0,0 +1,130 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01.implementation; + +import com.microsoft.azure.management.databoxedge.v2019_03_01.DataBoxEdgeDeviceJob; +import com.microsoft.azure.arm.model.implementation.IndexableRefreshableWrapperImpl; +import rx.Observable; +import com.microsoft.azure.management.databoxedge.v2019_03_01.UpdateOperationStage; +import com.microsoft.azure.management.databoxedge.v2019_03_01.UpdateDownloadProgress; +import org.joda.time.DateTime; +import com.microsoft.azure.management.databoxedge.v2019_03_01.JobErrorDetails; +import com.microsoft.azure.management.databoxedge.v2019_03_01.UpdateInstallProgress; +import com.microsoft.azure.management.databoxedge.v2019_03_01.JobType; +import com.microsoft.azure.management.databoxedge.v2019_03_01.JobStatus; + +class DataBoxEdgeDeviceJobImpl extends IndexableRefreshableWrapperImpl implements DataBoxEdgeDeviceJob { + private final DataBoxEdgeManager manager; + private String deviceName; + private String name; + private String resourceGroupName; + + DataBoxEdgeDeviceJobImpl(JobInner inner, DataBoxEdgeManager manager) { + super(null, inner); + this.manager = manager; + // set resource ancestor and positional variables + this.deviceName = IdParsingUtils.getValueFromIdByName(inner.id(), "dataBoxEdgeDevices"); + this.name = IdParsingUtils.getValueFromIdByName(inner.id(), "jobs"); + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + } + + @Override + public DataBoxEdgeManager manager() { + return this.manager; + } + + @Override + protected Observable getInnerAsync() { + JobsInner client = this.manager().inner().jobs(); + return client.getAsync(this.deviceName, this.name, this.resourceGroupName); + } + + + + @Override + public UpdateOperationStage currentStage() { + return this.inner().currentStage(); + } + + @Override + public UpdateDownloadProgress downloadProgress() { + return this.inner().downloadProgress(); + } + + @Override + public DateTime endTime() { + return this.inner().endTime(); + } + + @Override + public JobErrorDetails error() { + return this.inner().error(); + } + + @Override + public String errorManifestFile() { + return this.inner().errorManifestFile(); + } + + @Override + public String folder() { + return this.inner().folder(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public UpdateInstallProgress installProgress() { + return this.inner().installProgress(); + } + + @Override + public JobType jobType() { + return this.inner().jobType(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public Integer percentComplete() { + return this.inner().percentComplete(); + } + + @Override + public String shareId() { + return this.inner().shareId(); + } + + @Override + public DateTime startTime() { + return this.inner().startTime(); + } + + @Override + public JobStatus status() { + return this.inner().status(); + } + + @Override + public Integer totalRefreshErrors() { + return this.inner().totalRefreshErrors(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/DataBoxEdgeDeviceJobModelImpl.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/DataBoxEdgeDeviceJobModelImpl.java new file mode 100644 index 0000000000000..2b7ad8628593a --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/DataBoxEdgeDeviceJobModelImpl.java @@ -0,0 +1,130 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01.implementation; + +import com.microsoft.azure.management.databoxedge.v2019_03_01.DataBoxEdgeDeviceJobModel; +import com.microsoft.azure.arm.model.implementation.IndexableRefreshableWrapperImpl; +import rx.Observable; +import com.microsoft.azure.management.databoxedge.v2019_03_01.UpdateOperationStage; +import com.microsoft.azure.management.databoxedge.v2019_03_01.UpdateDownloadProgress; +import org.joda.time.DateTime; +import com.microsoft.azure.management.databoxedge.v2019_03_01.JobErrorDetails; +import com.microsoft.azure.management.databoxedge.v2019_03_01.UpdateInstallProgress; +import com.microsoft.azure.management.databoxedge.v2019_03_01.JobType; +import com.microsoft.azure.management.databoxedge.v2019_03_01.JobStatus; + +class DataBoxEdgeDeviceJobModelImpl extends IndexableRefreshableWrapperImpl implements DataBoxEdgeDeviceJobModel { + private final DataBoxEdgeManager manager; + private String deviceName; + private String name; + private String resourceGroupName; + + DataBoxEdgeDeviceJobModelImpl(JobInner inner, DataBoxEdgeManager manager) { + super(null, inner); + this.manager = manager; + // set resource ancestor and positional variables + this.deviceName = IdParsingUtils.getValueFromIdByName(inner.id(), "dataBoxEdgeDevices"); + this.name = IdParsingUtils.getValueFromIdByName(inner.id(), "operationsStatus"); + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + } + + @Override + public DataBoxEdgeManager manager() { + return this.manager; + } + + @Override + protected Observable getInnerAsync() { + OperationsStatusInner client = this.manager().inner().operationsStatus(); + return client.getAsync(this.deviceName, this.name, this.resourceGroupName); + } + + + + @Override + public UpdateOperationStage currentStage() { + return this.inner().currentStage(); + } + + @Override + public UpdateDownloadProgress downloadProgress() { + return this.inner().downloadProgress(); + } + + @Override + public DateTime endTime() { + return this.inner().endTime(); + } + + @Override + public JobErrorDetails error() { + return this.inner().error(); + } + + @Override + public String errorManifestFile() { + return this.inner().errorManifestFile(); + } + + @Override + public String folder() { + return this.inner().folder(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public UpdateInstallProgress installProgress() { + return this.inner().installProgress(); + } + + @Override + public JobType jobType() { + return this.inner().jobType(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public Integer percentComplete() { + return this.inner().percentComplete(); + } + + @Override + public String shareId() { + return this.inner().shareId(); + } + + @Override + public DateTime startTime() { + return this.inner().startTime(); + } + + @Override + public JobStatus status() { + return this.inner().status(); + } + + @Override + public Integer totalRefreshErrors() { + return this.inner().totalRefreshErrors(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/DataBoxEdgeManagementClientImpl.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/DataBoxEdgeManagementClientImpl.java new file mode 100644 index 0000000000000..d7565006d74aa --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/DataBoxEdgeManagementClientImpl.java @@ -0,0 +1,350 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01.implementation; + +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.RestClient; + +/** + * Initializes a new instance of the DataBoxEdgeManagementClientImpl class. + */ +public class DataBoxEdgeManagementClientImpl extends AzureServiceClient { + /** the {@link AzureClient} used for long running operations. */ + private AzureClient azureClient; + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + public AzureClient getAzureClient() { + return this.azureClient; + } + + /** The API version. */ + private String apiVersion; + + /** + * Gets The API version. + * + * @return the apiVersion value. + */ + public String apiVersion() { + return this.apiVersion; + } + + /** The subscription ID. */ + private String subscriptionId; + + /** + * Gets The subscription ID. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Sets The subscription ID. + * + * @param subscriptionId the subscriptionId value. + * @return the service client itself + */ + public DataBoxEdgeManagementClientImpl withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** The preferred language for the response. */ + private String acceptLanguage; + + /** + * Gets The preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets The preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + public DataBoxEdgeManagementClientImpl withAcceptLanguage(String acceptLanguage) { + this.acceptLanguage = acceptLanguage; + return this; + } + + /** The retry timeout in seconds for Long Running Operations. Default value is 30. */ + private int longRunningOperationRetryTimeout; + + /** + * Gets The retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @return the longRunningOperationRetryTimeout value. + */ + public int longRunningOperationRetryTimeout() { + return this.longRunningOperationRetryTimeout; + } + + /** + * Sets The retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + public DataBoxEdgeManagementClientImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { + this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; + return this; + } + + /** Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ + private boolean generateClientRequestId; + + /** + * Gets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @return the generateClientRequestId value. + */ + public boolean generateClientRequestId() { + return this.generateClientRequestId; + } + + /** + * Sets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + public DataBoxEdgeManagementClientImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * The OperationsInner object to access its operations. + */ + private OperationsInner operations; + + /** + * Gets the OperationsInner object to access its operations. + * @return the OperationsInner object. + */ + public OperationsInner operations() { + return this.operations; + } + + /** + * The DevicesInner object to access its operations. + */ + private DevicesInner devices; + + /** + * Gets the DevicesInner object to access its operations. + * @return the DevicesInner object. + */ + public DevicesInner devices() { + return this.devices; + } + + /** + * The AlertsInner object to access its operations. + */ + private AlertsInner alerts; + + /** + * Gets the AlertsInner object to access its operations. + * @return the AlertsInner object. + */ + public AlertsInner alerts() { + return this.alerts; + } + + /** + * The BandwidthSchedulesInner object to access its operations. + */ + private BandwidthSchedulesInner bandwidthSchedules; + + /** + * Gets the BandwidthSchedulesInner object to access its operations. + * @return the BandwidthSchedulesInner object. + */ + public BandwidthSchedulesInner bandwidthSchedules() { + return this.bandwidthSchedules; + } + + /** + * The JobsInner object to access its operations. + */ + private JobsInner jobs; + + /** + * Gets the JobsInner object to access its operations. + * @return the JobsInner object. + */ + public JobsInner jobs() { + return this.jobs; + } + + /** + * The OperationsStatusInner object to access its operations. + */ + private OperationsStatusInner operationsStatus; + + /** + * Gets the OperationsStatusInner object to access its operations. + * @return the OperationsStatusInner object. + */ + public OperationsStatusInner operationsStatus() { + return this.operationsStatus; + } + + /** + * The OrdersInner object to access its operations. + */ + private OrdersInner orders; + + /** + * Gets the OrdersInner object to access its operations. + * @return the OrdersInner object. + */ + public OrdersInner orders() { + return this.orders; + } + + /** + * The RolesInner object to access its operations. + */ + private RolesInner roles; + + /** + * Gets the RolesInner object to access its operations. + * @return the RolesInner object. + */ + public RolesInner roles() { + return this.roles; + } + + /** + * The SharesInner object to access its operations. + */ + private SharesInner shares; + + /** + * Gets the SharesInner object to access its operations. + * @return the SharesInner object. + */ + public SharesInner shares() { + return this.shares; + } + + /** + * The StorageAccountCredentialsInner object to access its operations. + */ + private StorageAccountCredentialsInner storageAccountCredentials; + + /** + * Gets the StorageAccountCredentialsInner object to access its operations. + * @return the StorageAccountCredentialsInner object. + */ + public StorageAccountCredentialsInner storageAccountCredentials() { + return this.storageAccountCredentials; + } + + /** + * The TriggersInner object to access its operations. + */ + private TriggersInner triggers; + + /** + * Gets the TriggersInner object to access its operations. + * @return the TriggersInner object. + */ + public TriggersInner triggers() { + return this.triggers; + } + + /** + * The UsersInner object to access its operations. + */ + private UsersInner users; + + /** + * Gets the UsersInner object to access its operations. + * @return the UsersInner object. + */ + public UsersInner users() { + return this.users; + } + + /** + * Initializes an instance of DataBoxEdgeManagementClient client. + * + * @param credentials the management credentials for Azure + */ + public DataBoxEdgeManagementClientImpl(ServiceClientCredentials credentials) { + this("https://management.azure.com", credentials); + } + + /** + * Initializes an instance of DataBoxEdgeManagementClient client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public DataBoxEdgeManagementClientImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of DataBoxEdgeManagementClient client. + * + * @param restClient the REST client to connect to Azure. + */ + public DataBoxEdgeManagementClientImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.apiVersion = "2019-03-01"; + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.operations = new OperationsInner(restClient().retrofit(), this); + this.devices = new DevicesInner(restClient().retrofit(), this); + this.alerts = new AlertsInner(restClient().retrofit(), this); + this.bandwidthSchedules = new BandwidthSchedulesInner(restClient().retrofit(), this); + this.jobs = new JobsInner(restClient().retrofit(), this); + this.operationsStatus = new OperationsStatusInner(restClient().retrofit(), this); + this.orders = new OrdersInner(restClient().retrofit(), this); + this.roles = new RolesInner(restClient().retrofit(), this); + this.shares = new SharesInner(restClient().retrofit(), this); + this.storageAccountCredentials = new StorageAccountCredentialsInner(restClient().retrofit(), this); + this.triggers = new TriggersInner(restClient().retrofit(), this); + this.users = new UsersInner(restClient().retrofit(), this); + this.azureClient = new AzureClient(this); + } + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + @Override + public String userAgent() { + return String.format("%s (%s, %s, auto-generated)", super.userAgent(), "DataBoxEdgeManagementClient", "2019-03-01"); + } +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/DataBoxEdgeManager.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/DataBoxEdgeManager.java new file mode 100644 index 0000000000000..c73bbe93724e1 --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/DataBoxEdgeManager.java @@ -0,0 +1,231 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01.implementation; + +import com.microsoft.azure.AzureEnvironment; +import com.microsoft.azure.AzureResponseBuilder; +import com.microsoft.azure.credentials.AzureTokenCredentials; +import com.microsoft.azure.management.apigeneration.Beta; +import com.microsoft.azure.management.apigeneration.Beta.SinceVersion; +import com.microsoft.azure.arm.resources.AzureConfigurable; +import com.microsoft.azure.serializer.AzureJacksonAdapter; +import com.microsoft.rest.RestClient; +import com.microsoft.azure.management.databoxedge.v2019_03_01.Operations; +import com.microsoft.azure.management.databoxedge.v2019_03_01.Devices; +import com.microsoft.azure.management.databoxedge.v2019_03_01.Alerts; +import com.microsoft.azure.management.databoxedge.v2019_03_01.BandwidthSchedules; +import com.microsoft.azure.management.databoxedge.v2019_03_01.Jobs; +import com.microsoft.azure.management.databoxedge.v2019_03_01.OperationsStatus; +import com.microsoft.azure.management.databoxedge.v2019_03_01.Orders; +import com.microsoft.azure.management.databoxedge.v2019_03_01.Roles; +import com.microsoft.azure.management.databoxedge.v2019_03_01.Shares; +import com.microsoft.azure.management.databoxedge.v2019_03_01.StorageAccountCredentials; +import com.microsoft.azure.management.databoxedge.v2019_03_01.Triggers; +import com.microsoft.azure.management.databoxedge.v2019_03_01.Users; +import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; +import com.microsoft.azure.arm.resources.implementation.ManagerCore; + +/** + * Entry point to Azure DataBoxEdge resource management. + */ +public final class DataBoxEdgeManager extends ManagerCore { + private Operations operations; + private Devices devices; + private Alerts alerts; + private BandwidthSchedules bandwidthSchedules; + private Jobs jobs; + private OperationsStatus operationsStatus; + private Orders orders; + private Roles roles; + private Shares shares; + private StorageAccountCredentials storageAccountCredentials; + private Triggers triggers; + private Users users; + /** + * Get a Configurable instance that can be used to create DataBoxEdgeManager with optional configuration. + * + * @return the instance allowing configurations + */ + public static Configurable configure() { + return new DataBoxEdgeManager.ConfigurableImpl(); + } + /** + * Creates an instance of DataBoxEdgeManager that exposes DataBoxEdge resource management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the DataBoxEdgeManager + */ + public static DataBoxEdgeManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return new DataBoxEdgeManager(new RestClient.Builder() + .withBaseUrl(credentials.environment(), AzureEnvironment.Endpoint.RESOURCE_MANAGER) + .withCredentials(credentials) + .withSerializerAdapter(new AzureJacksonAdapter()) + .withResponseBuilderFactory(new AzureResponseBuilder.Factory()) + .build(), subscriptionId); + } + /** + * Creates an instance of DataBoxEdgeManager that exposes DataBoxEdge resource management API entry points. + * + * @param restClient the RestClient to be used for API calls. + * @param subscriptionId the subscription UUID + * @return the DataBoxEdgeManager + */ + public static DataBoxEdgeManager authenticate(RestClient restClient, String subscriptionId) { + return new DataBoxEdgeManager(restClient, subscriptionId); + } + /** + * The interface allowing configurations to be set. + */ + public interface Configurable extends AzureConfigurable { + /** + * Creates an instance of DataBoxEdgeManager that exposes DataBoxEdge management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the interface exposing DataBoxEdge management API entry points that work across subscriptions + */ + DataBoxEdgeManager authenticate(AzureTokenCredentials credentials, String subscriptionId); + } + + /** + * @return Entry point to manage Operations. + */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(this); + } + return this.operations; + } + + /** + * @return Entry point to manage Devices. + */ + public Devices devices() { + if (this.devices == null) { + this.devices = new DevicesImpl(this); + } + return this.devices; + } + + /** + * @return Entry point to manage Alerts. + */ + public Alerts alerts() { + if (this.alerts == null) { + this.alerts = new AlertsImpl(this); + } + return this.alerts; + } + + /** + * @return Entry point to manage BandwidthSchedules. + */ + public BandwidthSchedules bandwidthSchedules() { + if (this.bandwidthSchedules == null) { + this.bandwidthSchedules = new BandwidthSchedulesImpl(this); + } + return this.bandwidthSchedules; + } + + /** + * @return Entry point to manage Jobs. + */ + public Jobs jobs() { + if (this.jobs == null) { + this.jobs = new JobsImpl(this); + } + return this.jobs; + } + + /** + * @return Entry point to manage OperationsStatus. + */ + public OperationsStatus operationsStatus() { + if (this.operationsStatus == null) { + this.operationsStatus = new OperationsStatusImpl(this); + } + return this.operationsStatus; + } + + /** + * @return Entry point to manage Orders. + */ + public Orders orders() { + if (this.orders == null) { + this.orders = new OrdersImpl(this); + } + return this.orders; + } + + /** + * @return Entry point to manage Roles. + */ + public Roles roles() { + if (this.roles == null) { + this.roles = new RolesImpl(this); + } + return this.roles; + } + + /** + * @return Entry point to manage Shares. + */ + public Shares shares() { + if (this.shares == null) { + this.shares = new SharesImpl(this); + } + return this.shares; + } + + /** + * @return Entry point to manage StorageAccountCredentials. + */ + public StorageAccountCredentials storageAccountCredentials() { + if (this.storageAccountCredentials == null) { + this.storageAccountCredentials = new StorageAccountCredentialsImpl(this); + } + return this.storageAccountCredentials; + } + + /** + * @return Entry point to manage Triggers. + */ + public Triggers triggers() { + if (this.triggers == null) { + this.triggers = new TriggersImpl(this); + } + return this.triggers; + } + + /** + * @return Entry point to manage Users. + */ + public Users users() { + if (this.users == null) { + this.users = new UsersImpl(this); + } + return this.users; + } + + /** + * The implementation for Configurable interface. + */ + private static final class ConfigurableImpl extends AzureConfigurableCoreImpl implements Configurable { + public DataBoxEdgeManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return DataBoxEdgeManager.authenticate(buildRestClient(credentials), subscriptionId); + } + } + private DataBoxEdgeManager(RestClient restClient, String subscriptionId) { + super( + restClient, + subscriptionId, + new DataBoxEdgeManagementClientImpl(restClient).withSubscriptionId(subscriptionId)); + } +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/DevicesImpl.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/DevicesImpl.java new file mode 100644 index 0000000000000..652defef54c18 --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/DevicesImpl.java @@ -0,0 +1,183 @@ +/** + * 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. + * abc + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.databoxedge.v2019_03_01.Devices; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.management.databoxedge.v2019_03_01.DataBoxEdgeDevice; +import com.microsoft.azure.Page; +import rx.Completable; +import com.microsoft.azure.management.databoxedge.v2019_03_01.DataBoxEdgeDeviceExtendedInfo; +import com.microsoft.azure.management.databoxedge.v2019_03_01.UpdateSummary; +import com.microsoft.azure.management.databoxedge.v2019_03_01.UploadCertificateResponse; +import com.microsoft.azure.management.databoxedge.v2019_03_01.UploadCertificateRequest; +import com.microsoft.azure.management.databoxedge.v2019_03_01.NetworkSettings; +import com.microsoft.azure.management.databoxedge.v2019_03_01.SecuritySettings; + +class DevicesImpl extends WrapperImpl implements Devices { + private final DataBoxEdgeManager manager; + + DevicesImpl(DataBoxEdgeManager manager) { + super(manager.inner().devices()); + this.manager = manager; + } + + public DataBoxEdgeManager manager() { + return this.manager; + } + + @Override + public DataBoxEdgeDeviceImpl defineDataBoxEdgeDevice(String name) { + return wrapDataBoxEdgeDeviceModel(name); + } + + private DataBoxEdgeDeviceImpl wrapDataBoxEdgeDeviceModel(String name) { + return new DataBoxEdgeDeviceImpl(name, new DataBoxEdgeDeviceInner(), this.manager()); + } + + private DataBoxEdgeDeviceImpl wrapDataBoxEdgeDeviceModel(DataBoxEdgeDeviceInner inner) { + return new DataBoxEdgeDeviceImpl(inner.name(), inner, manager()); + } + + private Observable getDataBoxEdgeDeviceInnerUsingDevicesInnerAsync(String resourceGroupName, String name) { + DevicesInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + public Observable getByResourceGroupAsync(String resourceGroupName, String name) { + return this.getDataBoxEdgeDeviceInnerUsingDevicesInnerAsync(resourceGroupName, name).flatMap(new Func1> () { + @Override + public Observable call(DataBoxEdgeDeviceInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((DataBoxEdgeDevice)wrapDataBoxEdgeDeviceModel(inner)); + } + } + }); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + DevicesInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public DataBoxEdgeDevice call(DataBoxEdgeDeviceInner inner) { + return wrapDataBoxEdgeDeviceModel(inner); + } + }); + } + + @Override + public Observable listAsync() { + DevicesInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public DataBoxEdgeDevice call(DataBoxEdgeDeviceInner inner) { + return wrapDataBoxEdgeDeviceModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String name) { + return this.inner().deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Completable downloadUpdatesAsync(String deviceName, String resourceGroupName) { + DevicesInner client = this.inner(); + return client.downloadUpdatesAsync(deviceName, resourceGroupName).toCompletable(); + } + + @Override + public Observable getExtendedInformationAsync(String deviceName, String resourceGroupName) { + DevicesInner client = this.inner(); + return client.getExtendedInformationAsync(deviceName, resourceGroupName) + .map(new Func1() { + @Override + public DataBoxEdgeDeviceExtendedInfo call(DataBoxEdgeDeviceExtendedInfoInner inner) { + return new DataBoxEdgeDeviceExtendedInfoImpl(inner, manager()); + } + }); + } + + @Override + public Completable installUpdatesAsync(String deviceName, String resourceGroupName) { + DevicesInner client = this.inner(); + return client.installUpdatesAsync(deviceName, resourceGroupName).toCompletable(); + } + + @Override + public Completable scanForUpdatesAsync(String deviceName, String resourceGroupName) { + DevicesInner client = this.inner(); + return client.scanForUpdatesAsync(deviceName, resourceGroupName).toCompletable(); + } + + @Override + public Observable getUpdateSummaryAsync(String deviceName, String resourceGroupName) { + DevicesInner client = this.inner(); + return client.getUpdateSummaryAsync(deviceName, resourceGroupName) + .map(new Func1() { + @Override + public UpdateSummary call(UpdateSummaryInner inner) { + return new UpdateSummaryImpl(inner, manager()); + } + }); + } + + @Override + public Observable uploadCertificateAsync(String deviceName, String resourceGroupName, UploadCertificateRequest parameters) { + DevicesInner client = this.inner(); + return client.uploadCertificateAsync(deviceName, resourceGroupName, parameters) + .map(new Func1() { + @Override + public UploadCertificateResponse call(UploadCertificateResponseInner inner) { + return new UploadCertificateResponseImpl(inner, manager()); + } + }); + } + + @Override + public Observable getNetworkSettingsAsync(String deviceName, String resourceGroupName) { + DevicesInner client = this.inner(); + return client.getNetworkSettingsAsync(deviceName, resourceGroupName) + .map(new Func1() { + @Override + public NetworkSettings call(NetworkSettingsInner inner) { + return new NetworkSettingsImpl(inner, manager()); + } + }); + } + + @Override + public Completable createOrUpdateSecuritySettingsAsync(String deviceName, String resourceGroupName, SecuritySettings securitySettings) { + DevicesInner client = this.inner(); + return client.createOrUpdateSecuritySettingsAsync(deviceName, resourceGroupName, securitySettings).toCompletable(); + } + +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/DevicesInner.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/DevicesInner.java new file mode 100644 index 0000000000000..60e325abae345 --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/DevicesInner.java @@ -0,0 +1,2316 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.databoxedge.v2019_03_01.DataBoxEdgeDevicePatch; +import com.microsoft.azure.management.databoxedge.v2019_03_01.SecuritySettings; +import com.microsoft.azure.management.databoxedge.v2019_03_01.UploadCertificateRequest; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Devices. + */ +public class DevicesInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private DevicesService service; + /** The service client containing this operation class. */ + private DataBoxEdgeManagementClientImpl client; + + /** + * Initializes an instance of DevicesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public DevicesInner(Retrofit retrofit, DataBoxEdgeManagementClientImpl client) { + this.service = retrofit.create(DevicesService.class); + this.client = client; + } + + /** + * The interface defining all the services for Devices to be + * used by Retrofit to perform actually REST calls. + */ + interface DevicesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.databoxedge.v2019_03_01.Devices list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$expand") String expand, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.databoxedge.v2019_03_01.Devices listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices") + Observable> listByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Query("$expand") String expand, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.databoxedge.v2019_03_01.Devices getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}") + Observable> getByResourceGroup(@Path("deviceName") String deviceName, @Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.databoxedge.v2019_03_01.Devices createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}") + Observable> createOrUpdate(@Path("deviceName") String deviceName, @Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Body DataBoxEdgeDeviceInner dataBoxEdgeDevice, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.databoxedge.v2019_03_01.Devices beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}") + Observable> beginCreateOrUpdate(@Path("deviceName") String deviceName, @Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Body DataBoxEdgeDeviceInner dataBoxEdgeDevice, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.databoxedge.v2019_03_01.Devices delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("deviceName") String deviceName, @Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.databoxedge.v2019_03_01.Devices beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("deviceName") String deviceName, @Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.databoxedge.v2019_03_01.Devices update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}") + Observable> update(@Path("deviceName") String deviceName, @Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Body DataBoxEdgeDevicePatch parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.databoxedge.v2019_03_01.Devices downloadUpdates" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/downloadUpdates") + Observable> downloadUpdates(@Path("deviceName") String deviceName, @Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.databoxedge.v2019_03_01.Devices beginDownloadUpdates" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/downloadUpdates") + Observable> beginDownloadUpdates(@Path("deviceName") String deviceName, @Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.databoxedge.v2019_03_01.Devices getExtendedInformation" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/getExtendedInformation") + Observable> getExtendedInformation(@Path("deviceName") String deviceName, @Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.databoxedge.v2019_03_01.Devices installUpdates" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/installUpdates") + Observable> installUpdates(@Path("deviceName") String deviceName, @Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.databoxedge.v2019_03_01.Devices beginInstallUpdates" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/installUpdates") + Observable> beginInstallUpdates(@Path("deviceName") String deviceName, @Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.databoxedge.v2019_03_01.Devices getNetworkSettings" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/networkSettings/default") + Observable> getNetworkSettings(@Path("deviceName") String deviceName, @Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.databoxedge.v2019_03_01.Devices scanForUpdates" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/scanForUpdates") + Observable> scanForUpdates(@Path("deviceName") String deviceName, @Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.databoxedge.v2019_03_01.Devices beginScanForUpdates" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/scanForUpdates") + Observable> beginScanForUpdates(@Path("deviceName") String deviceName, @Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.databoxedge.v2019_03_01.Devices createOrUpdateSecuritySettings" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/securitySettings/default/update") + Observable> createOrUpdateSecuritySettings(@Path("deviceName") String deviceName, @Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Body SecuritySettings securitySettings, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.databoxedge.v2019_03_01.Devices beginCreateOrUpdateSecuritySettings" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/securitySettings/default/update") + Observable> beginCreateOrUpdateSecuritySettings(@Path("deviceName") String deviceName, @Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Body SecuritySettings securitySettings, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.databoxedge.v2019_03_01.Devices getUpdateSummary" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/updateSummary/default") + Observable> getUpdateSummary(@Path("deviceName") String deviceName, @Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.databoxedge.v2019_03_01.Devices uploadCertificate" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/uploadCertificate") + Observable> uploadCertificate(@Path("deviceName") String deviceName, @Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Body UploadCertificateRequest parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.databoxedge.v2019_03_01.Devices listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.databoxedge.v2019_03_01.Devices listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets all the data box edge/gateway devices in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DataBoxEdgeDeviceInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the data box edge/gateway devices in a subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the data box edge/gateway devices in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DataBoxEdgeDeviceInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the data box edge/gateway devices in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DataBoxEdgeDeviceInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the data box edge/gateway devices in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DataBoxEdgeDeviceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String expand = null; + return service.list(this.client.subscriptionId(), this.client.apiVersion(), expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets all the data box edge/gateway devices in a subscription. + * + * @param expand Specify $expand=details to populate additional fields related to the resource or Specify $skipToken=<token> to populate the next page in the list. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DataBoxEdgeDeviceInner> object if successful. + */ + public PagedList list(final String expand) { + ServiceResponse> response = listSinglePageAsync(expand).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the data box edge/gateway devices in a subscription. + * + * @param expand Specify $expand=details to populate additional fields related to the resource or Specify $skipToken=<token> to populate the next page in the list. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String expand, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(expand), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the data box edge/gateway devices in a subscription. + * + * @param expand Specify $expand=details to populate additional fields related to the resource or Specify $skipToken=<token> to populate the next page in the list. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DataBoxEdgeDeviceInner> object + */ + public Observable> listAsync(final String expand) { + return listWithServiceResponseAsync(expand) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the data box edge/gateway devices in a subscription. + * + * @param expand Specify $expand=details to populate additional fields related to the resource or Specify $skipToken=<token> to populate the next page in the list. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DataBoxEdgeDeviceInner> object + */ + public Observable>> listWithServiceResponseAsync(final String expand) { + return listSinglePageAsync(expand) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the data box edge/gateway devices in a subscription. + * + ServiceResponse> * @param expand Specify $expand=details to populate additional fields related to the resource or Specify $skipToken=<token> to populate the next page in the list. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DataBoxEdgeDeviceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String expand) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), this.client.apiVersion(), expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the data box edge/gateway devices in a resource group. + * + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DataBoxEdgeDeviceInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the data box edge/gateway devices in a resource group. + * + * @param resourceGroupName The resource group name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the data box edge/gateway devices in a resource group. + * + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DataBoxEdgeDeviceInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the data box edge/gateway devices in a resource group. + * + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DataBoxEdgeDeviceInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the data box edge/gateway devices in a resource group. + * + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DataBoxEdgeDeviceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String expand = null; + return service.listByResourceGroup(this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets all the data box edge/gateway devices in a resource group. + * + * @param resourceGroupName The resource group name. + * @param expand Specify $expand=details to populate additional fields related to the resource or Specify $skipToken=<token> to populate the next page in the list. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DataBoxEdgeDeviceInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName, final String expand) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName, expand).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the data box edge/gateway devices in a resource group. + * + * @param resourceGroupName The resource group name. + * @param expand Specify $expand=details to populate additional fields related to the resource or Specify $skipToken=<token> to populate the next page in the list. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final String expand, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName, expand), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the data box edge/gateway devices in a resource group. + * + * @param resourceGroupName The resource group name. + * @param expand Specify $expand=details to populate additional fields related to the resource or Specify $skipToken=<token> to populate the next page in the list. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DataBoxEdgeDeviceInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName, final String expand) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName, expand) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the data box edge/gateway devices in a resource group. + * + * @param resourceGroupName The resource group name. + * @param expand Specify $expand=details to populate additional fields related to the resource or Specify $skipToken=<token> to populate the next page in the list. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DataBoxEdgeDeviceInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName, final String expand) { + return listByResourceGroupSinglePageAsync(resourceGroupName, expand) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the data box edge/gateway devices in a resource group. + * + ServiceResponse> * @param resourceGroupName The resource group name. + ServiceResponse> * @param expand Specify $expand=details to populate additional fields related to the resource or Specify $skipToken=<token> to populate the next page in the list. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DataBoxEdgeDeviceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName, final String expand) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByResourceGroup(this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the properties of the data box edge/gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DataBoxEdgeDeviceInner object if successful. + */ + public DataBoxEdgeDeviceInner getByResourceGroup(String deviceName, String resourceGroupName) { + return getByResourceGroupWithServiceResponseAsync(deviceName, resourceGroupName).toBlocking().single().body(); + } + + /** + * Gets the properties of the data box edge/gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String deviceName, String resourceGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(deviceName, resourceGroupName), serviceCallback); + } + + /** + * Gets the properties of the data box edge/gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DataBoxEdgeDeviceInner object + */ + public Observable getByResourceGroupAsync(String deviceName, String resourceGroupName) { + return getByResourceGroupWithServiceResponseAsync(deviceName, resourceGroupName).map(new Func1, DataBoxEdgeDeviceInner>() { + @Override + public DataBoxEdgeDeviceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the properties of the data box edge/gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DataBoxEdgeDeviceInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String deviceName, String resourceGroupName) { + if (deviceName == null) { + throw new IllegalArgumentException("Parameter deviceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getByResourceGroup(deviceName, this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates or updates a Data Box Edge/Gateway resource. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param dataBoxEdgeDevice The resource object. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DataBoxEdgeDeviceInner object if successful. + */ + public DataBoxEdgeDeviceInner createOrUpdate(String deviceName, String resourceGroupName, DataBoxEdgeDeviceInner dataBoxEdgeDevice) { + return createOrUpdateWithServiceResponseAsync(deviceName, resourceGroupName, dataBoxEdgeDevice).toBlocking().last().body(); + } + + /** + * Creates or updates a Data Box Edge/Gateway resource. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param dataBoxEdgeDevice The resource object. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String deviceName, String resourceGroupName, DataBoxEdgeDeviceInner dataBoxEdgeDevice, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(deviceName, resourceGroupName, dataBoxEdgeDevice), serviceCallback); + } + + /** + * Creates or updates a Data Box Edge/Gateway resource. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param dataBoxEdgeDevice The resource object. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String deviceName, String resourceGroupName, DataBoxEdgeDeviceInner dataBoxEdgeDevice) { + return createOrUpdateWithServiceResponseAsync(deviceName, resourceGroupName, dataBoxEdgeDevice).map(new Func1, DataBoxEdgeDeviceInner>() { + @Override + public DataBoxEdgeDeviceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a Data Box Edge/Gateway resource. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param dataBoxEdgeDevice The resource object. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String deviceName, String resourceGroupName, DataBoxEdgeDeviceInner dataBoxEdgeDevice) { + if (deviceName == null) { + throw new IllegalArgumentException("Parameter deviceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (dataBoxEdgeDevice == null) { + throw new IllegalArgumentException("Parameter dataBoxEdgeDevice is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(dataBoxEdgeDevice); + Observable> observable = service.createOrUpdate(deviceName, this.client.subscriptionId(), resourceGroupName, dataBoxEdgeDevice, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates or updates a Data Box Edge/Gateway resource. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param dataBoxEdgeDevice The resource object. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DataBoxEdgeDeviceInner object if successful. + */ + public DataBoxEdgeDeviceInner beginCreateOrUpdate(String deviceName, String resourceGroupName, DataBoxEdgeDeviceInner dataBoxEdgeDevice) { + return beginCreateOrUpdateWithServiceResponseAsync(deviceName, resourceGroupName, dataBoxEdgeDevice).toBlocking().single().body(); + } + + /** + * Creates or updates a Data Box Edge/Gateway resource. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param dataBoxEdgeDevice The resource object. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String deviceName, String resourceGroupName, DataBoxEdgeDeviceInner dataBoxEdgeDevice, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(deviceName, resourceGroupName, dataBoxEdgeDevice), serviceCallback); + } + + /** + * Creates or updates a Data Box Edge/Gateway resource. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param dataBoxEdgeDevice The resource object. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DataBoxEdgeDeviceInner object + */ + public Observable beginCreateOrUpdateAsync(String deviceName, String resourceGroupName, DataBoxEdgeDeviceInner dataBoxEdgeDevice) { + return beginCreateOrUpdateWithServiceResponseAsync(deviceName, resourceGroupName, dataBoxEdgeDevice).map(new Func1, DataBoxEdgeDeviceInner>() { + @Override + public DataBoxEdgeDeviceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a Data Box Edge/Gateway resource. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param dataBoxEdgeDevice The resource object. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DataBoxEdgeDeviceInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String deviceName, String resourceGroupName, DataBoxEdgeDeviceInner dataBoxEdgeDevice) { + if (deviceName == null) { + throw new IllegalArgumentException("Parameter deviceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (dataBoxEdgeDevice == null) { + throw new IllegalArgumentException("Parameter dataBoxEdgeDevice is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(dataBoxEdgeDevice); + return service.beginCreateOrUpdate(deviceName, this.client.subscriptionId(), resourceGroupName, dataBoxEdgeDevice, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes the data box edge/gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String deviceName, String resourceGroupName) { + deleteWithServiceResponseAsync(deviceName, resourceGroupName).toBlocking().last().body(); + } + + /** + * Deletes the data box edge/gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String deviceName, String resourceGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(deviceName, resourceGroupName), serviceCallback); + } + + /** + * Deletes the data box edge/gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String deviceName, String resourceGroupName) { + return deleteWithServiceResponseAsync(deviceName, resourceGroupName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the data box edge/gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String deviceName, String resourceGroupName) { + if (deviceName == null) { + throw new IllegalArgumentException("Parameter deviceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.delete(deviceName, this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the data box edge/gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String deviceName, String resourceGroupName) { + beginDeleteWithServiceResponseAsync(deviceName, resourceGroupName).toBlocking().single().body(); + } + + /** + * Deletes the data box edge/gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String deviceName, String resourceGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(deviceName, resourceGroupName), serviceCallback); + } + + /** + * Deletes the data box edge/gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String deviceName, String resourceGroupName) { + return beginDeleteWithServiceResponseAsync(deviceName, resourceGroupName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the data box edge/gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String deviceName, String resourceGroupName) { + if (deviceName == null) { + throw new IllegalArgumentException("Parameter deviceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDelete(deviceName, this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Modifies a Data Box Edge/Gateway resource. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param parameters The resource parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DataBoxEdgeDeviceInner object if successful. + */ + public DataBoxEdgeDeviceInner update(String deviceName, String resourceGroupName, DataBoxEdgeDevicePatch parameters) { + return updateWithServiceResponseAsync(deviceName, resourceGroupName, parameters).toBlocking().single().body(); + } + + /** + * Modifies a Data Box Edge/Gateway resource. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param parameters The resource parameters. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String deviceName, String resourceGroupName, DataBoxEdgeDevicePatch parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(deviceName, resourceGroupName, parameters), serviceCallback); + } + + /** + * Modifies a Data Box Edge/Gateway resource. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param parameters The resource parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DataBoxEdgeDeviceInner object + */ + public Observable updateAsync(String deviceName, String resourceGroupName, DataBoxEdgeDevicePatch parameters) { + return updateWithServiceResponseAsync(deviceName, resourceGroupName, parameters).map(new Func1, DataBoxEdgeDeviceInner>() { + @Override + public DataBoxEdgeDeviceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Modifies a Data Box Edge/Gateway resource. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param parameters The resource parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DataBoxEdgeDeviceInner object + */ + public Observable> updateWithServiceResponseAsync(String deviceName, String resourceGroupName, DataBoxEdgeDevicePatch parameters) { + if (deviceName == null) { + throw new IllegalArgumentException("Parameter deviceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.update(deviceName, this.client.subscriptionId(), resourceGroupName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Downloads the updates on a data box edge/gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void downloadUpdates(String deviceName, String resourceGroupName) { + downloadUpdatesWithServiceResponseAsync(deviceName, resourceGroupName).toBlocking().last().body(); + } + + /** + * Downloads the updates on a data box edge/gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture downloadUpdatesAsync(String deviceName, String resourceGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(downloadUpdatesWithServiceResponseAsync(deviceName, resourceGroupName), serviceCallback); + } + + /** + * Downloads the updates on a data box edge/gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable downloadUpdatesAsync(String deviceName, String resourceGroupName) { + return downloadUpdatesWithServiceResponseAsync(deviceName, resourceGroupName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Downloads the updates on a data box edge/gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> downloadUpdatesWithServiceResponseAsync(String deviceName, String resourceGroupName) { + if (deviceName == null) { + throw new IllegalArgumentException("Parameter deviceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.downloadUpdates(deviceName, this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Downloads the updates on a data box edge/gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDownloadUpdates(String deviceName, String resourceGroupName) { + beginDownloadUpdatesWithServiceResponseAsync(deviceName, resourceGroupName).toBlocking().single().body(); + } + + /** + * Downloads the updates on a data box edge/gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDownloadUpdatesAsync(String deviceName, String resourceGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDownloadUpdatesWithServiceResponseAsync(deviceName, resourceGroupName), serviceCallback); + } + + /** + * Downloads the updates on a data box edge/gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDownloadUpdatesAsync(String deviceName, String resourceGroupName) { + return beginDownloadUpdatesWithServiceResponseAsync(deviceName, resourceGroupName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Downloads the updates on a data box edge/gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDownloadUpdatesWithServiceResponseAsync(String deviceName, String resourceGroupName) { + if (deviceName == null) { + throw new IllegalArgumentException("Parameter deviceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDownloadUpdates(deviceName, this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDownloadUpdatesDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDownloadUpdatesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets additional information for the specified data box edge/gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DataBoxEdgeDeviceExtendedInfoInner object if successful. + */ + public DataBoxEdgeDeviceExtendedInfoInner getExtendedInformation(String deviceName, String resourceGroupName) { + return getExtendedInformationWithServiceResponseAsync(deviceName, resourceGroupName).toBlocking().single().body(); + } + + /** + * Gets additional information for the specified data box edge/gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getExtendedInformationAsync(String deviceName, String resourceGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getExtendedInformationWithServiceResponseAsync(deviceName, resourceGroupName), serviceCallback); + } + + /** + * Gets additional information for the specified data box edge/gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DataBoxEdgeDeviceExtendedInfoInner object + */ + public Observable getExtendedInformationAsync(String deviceName, String resourceGroupName) { + return getExtendedInformationWithServiceResponseAsync(deviceName, resourceGroupName).map(new Func1, DataBoxEdgeDeviceExtendedInfoInner>() { + @Override + public DataBoxEdgeDeviceExtendedInfoInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets additional information for the specified data box edge/gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DataBoxEdgeDeviceExtendedInfoInner object + */ + public Observable> getExtendedInformationWithServiceResponseAsync(String deviceName, String resourceGroupName) { + if (deviceName == null) { + throw new IllegalArgumentException("Parameter deviceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getExtendedInformation(deviceName, this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getExtendedInformationDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getExtendedInformationDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Installs the updates on the data box edge/gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void installUpdates(String deviceName, String resourceGroupName) { + installUpdatesWithServiceResponseAsync(deviceName, resourceGroupName).toBlocking().last().body(); + } + + /** + * Installs the updates on the data box edge/gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture installUpdatesAsync(String deviceName, String resourceGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(installUpdatesWithServiceResponseAsync(deviceName, resourceGroupName), serviceCallback); + } + + /** + * Installs the updates on the data box edge/gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable installUpdatesAsync(String deviceName, String resourceGroupName) { + return installUpdatesWithServiceResponseAsync(deviceName, resourceGroupName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Installs the updates on the data box edge/gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> installUpdatesWithServiceResponseAsync(String deviceName, String resourceGroupName) { + if (deviceName == null) { + throw new IllegalArgumentException("Parameter deviceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.installUpdates(deviceName, this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Installs the updates on the data box edge/gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginInstallUpdates(String deviceName, String resourceGroupName) { + beginInstallUpdatesWithServiceResponseAsync(deviceName, resourceGroupName).toBlocking().single().body(); + } + + /** + * Installs the updates on the data box edge/gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginInstallUpdatesAsync(String deviceName, String resourceGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginInstallUpdatesWithServiceResponseAsync(deviceName, resourceGroupName), serviceCallback); + } + + /** + * Installs the updates on the data box edge/gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginInstallUpdatesAsync(String deviceName, String resourceGroupName) { + return beginInstallUpdatesWithServiceResponseAsync(deviceName, resourceGroupName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Installs the updates on the data box edge/gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginInstallUpdatesWithServiceResponseAsync(String deviceName, String resourceGroupName) { + if (deviceName == null) { + throw new IllegalArgumentException("Parameter deviceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginInstallUpdates(deviceName, this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginInstallUpdatesDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginInstallUpdatesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the network settings of the specified data box edge/gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkSettingsInner object if successful. + */ + public NetworkSettingsInner getNetworkSettings(String deviceName, String resourceGroupName) { + return getNetworkSettingsWithServiceResponseAsync(deviceName, resourceGroupName).toBlocking().single().body(); + } + + /** + * Gets the network settings of the specified data box edge/gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getNetworkSettingsAsync(String deviceName, String resourceGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getNetworkSettingsWithServiceResponseAsync(deviceName, resourceGroupName), serviceCallback); + } + + /** + * Gets the network settings of the specified data box edge/gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkSettingsInner object + */ + public Observable getNetworkSettingsAsync(String deviceName, String resourceGroupName) { + return getNetworkSettingsWithServiceResponseAsync(deviceName, resourceGroupName).map(new Func1, NetworkSettingsInner>() { + @Override + public NetworkSettingsInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the network settings of the specified data box edge/gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkSettingsInner object + */ + public Observable> getNetworkSettingsWithServiceResponseAsync(String deviceName, String resourceGroupName) { + if (deviceName == null) { + throw new IllegalArgumentException("Parameter deviceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getNetworkSettings(deviceName, this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getNetworkSettingsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getNetworkSettingsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Scans for updates on a data box edge/gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void scanForUpdates(String deviceName, String resourceGroupName) { + scanForUpdatesWithServiceResponseAsync(deviceName, resourceGroupName).toBlocking().last().body(); + } + + /** + * Scans for updates on a data box edge/gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture scanForUpdatesAsync(String deviceName, String resourceGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(scanForUpdatesWithServiceResponseAsync(deviceName, resourceGroupName), serviceCallback); + } + + /** + * Scans for updates on a data box edge/gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable scanForUpdatesAsync(String deviceName, String resourceGroupName) { + return scanForUpdatesWithServiceResponseAsync(deviceName, resourceGroupName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Scans for updates on a data box edge/gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> scanForUpdatesWithServiceResponseAsync(String deviceName, String resourceGroupName) { + if (deviceName == null) { + throw new IllegalArgumentException("Parameter deviceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.scanForUpdates(deviceName, this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Scans for updates on a data box edge/gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginScanForUpdates(String deviceName, String resourceGroupName) { + beginScanForUpdatesWithServiceResponseAsync(deviceName, resourceGroupName).toBlocking().single().body(); + } + + /** + * Scans for updates on a data box edge/gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginScanForUpdatesAsync(String deviceName, String resourceGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginScanForUpdatesWithServiceResponseAsync(deviceName, resourceGroupName), serviceCallback); + } + + /** + * Scans for updates on a data box edge/gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginScanForUpdatesAsync(String deviceName, String resourceGroupName) { + return beginScanForUpdatesWithServiceResponseAsync(deviceName, resourceGroupName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Scans for updates on a data box edge/gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginScanForUpdatesWithServiceResponseAsync(String deviceName, String resourceGroupName) { + if (deviceName == null) { + throw new IllegalArgumentException("Parameter deviceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginScanForUpdates(deviceName, this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginScanForUpdatesDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginScanForUpdatesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Updates the security settings on a data box edge/gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param securitySettings The security settings. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void createOrUpdateSecuritySettings(String deviceName, String resourceGroupName, SecuritySettings securitySettings) { + createOrUpdateSecuritySettingsWithServiceResponseAsync(deviceName, resourceGroupName, securitySettings).toBlocking().last().body(); + } + + /** + * Updates the security settings on a data box edge/gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param securitySettings The security settings. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateSecuritySettingsAsync(String deviceName, String resourceGroupName, SecuritySettings securitySettings, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateSecuritySettingsWithServiceResponseAsync(deviceName, resourceGroupName, securitySettings), serviceCallback); + } + + /** + * Updates the security settings on a data box edge/gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param securitySettings The security settings. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateSecuritySettingsAsync(String deviceName, String resourceGroupName, SecuritySettings securitySettings) { + return createOrUpdateSecuritySettingsWithServiceResponseAsync(deviceName, resourceGroupName, securitySettings).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates the security settings on a data box edge/gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param securitySettings The security settings. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateSecuritySettingsWithServiceResponseAsync(String deviceName, String resourceGroupName, SecuritySettings securitySettings) { + if (deviceName == null) { + throw new IllegalArgumentException("Parameter deviceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (securitySettings == null) { + throw new IllegalArgumentException("Parameter securitySettings is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(securitySettings); + Observable> observable = service.createOrUpdateSecuritySettings(deviceName, this.client.subscriptionId(), resourceGroupName, securitySettings, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates the security settings on a data box edge/gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param securitySettings The security settings. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginCreateOrUpdateSecuritySettings(String deviceName, String resourceGroupName, SecuritySettings securitySettings) { + beginCreateOrUpdateSecuritySettingsWithServiceResponseAsync(deviceName, resourceGroupName, securitySettings).toBlocking().single().body(); + } + + /** + * Updates the security settings on a data box edge/gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param securitySettings The security settings. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateSecuritySettingsAsync(String deviceName, String resourceGroupName, SecuritySettings securitySettings, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateSecuritySettingsWithServiceResponseAsync(deviceName, resourceGroupName, securitySettings), serviceCallback); + } + + /** + * Updates the security settings on a data box edge/gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param securitySettings The security settings. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginCreateOrUpdateSecuritySettingsAsync(String deviceName, String resourceGroupName, SecuritySettings securitySettings) { + return beginCreateOrUpdateSecuritySettingsWithServiceResponseAsync(deviceName, resourceGroupName, securitySettings).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates the security settings on a data box edge/gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param securitySettings The security settings. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginCreateOrUpdateSecuritySettingsWithServiceResponseAsync(String deviceName, String resourceGroupName, SecuritySettings securitySettings) { + if (deviceName == null) { + throw new IllegalArgumentException("Parameter deviceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (securitySettings == null) { + throw new IllegalArgumentException("Parameter securitySettings is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(securitySettings); + return service.beginCreateOrUpdateSecuritySettings(deviceName, this.client.subscriptionId(), resourceGroupName, securitySettings, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateSecuritySettingsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateSecuritySettingsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets information about the availability of updates based on the last scan of the device. It also gets information about any ongoing download or install jobs on the device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the UpdateSummaryInner object if successful. + */ + public UpdateSummaryInner getUpdateSummary(String deviceName, String resourceGroupName) { + return getUpdateSummaryWithServiceResponseAsync(deviceName, resourceGroupName).toBlocking().single().body(); + } + + /** + * Gets information about the availability of updates based on the last scan of the device. It also gets information about any ongoing download or install jobs on the device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getUpdateSummaryAsync(String deviceName, String resourceGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getUpdateSummaryWithServiceResponseAsync(deviceName, resourceGroupName), serviceCallback); + } + + /** + * Gets information about the availability of updates based on the last scan of the device. It also gets information about any ongoing download or install jobs on the device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the UpdateSummaryInner object + */ + public Observable getUpdateSummaryAsync(String deviceName, String resourceGroupName) { + return getUpdateSummaryWithServiceResponseAsync(deviceName, resourceGroupName).map(new Func1, UpdateSummaryInner>() { + @Override + public UpdateSummaryInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets information about the availability of updates based on the last scan of the device. It also gets information about any ongoing download or install jobs on the device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the UpdateSummaryInner object + */ + public Observable> getUpdateSummaryWithServiceResponseAsync(String deviceName, String resourceGroupName) { + if (deviceName == null) { + throw new IllegalArgumentException("Parameter deviceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getUpdateSummary(deviceName, this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getUpdateSummaryDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getUpdateSummaryDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Uploads registration certificate for the device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param parameters The upload certificate request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the UploadCertificateResponseInner object if successful. + */ + public UploadCertificateResponseInner uploadCertificate(String deviceName, String resourceGroupName, UploadCertificateRequest parameters) { + return uploadCertificateWithServiceResponseAsync(deviceName, resourceGroupName, parameters).toBlocking().single().body(); + } + + /** + * Uploads registration certificate for the device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param parameters The upload certificate request. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture uploadCertificateAsync(String deviceName, String resourceGroupName, UploadCertificateRequest parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(uploadCertificateWithServiceResponseAsync(deviceName, resourceGroupName, parameters), serviceCallback); + } + + /** + * Uploads registration certificate for the device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param parameters The upload certificate request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the UploadCertificateResponseInner object + */ + public Observable uploadCertificateAsync(String deviceName, String resourceGroupName, UploadCertificateRequest parameters) { + return uploadCertificateWithServiceResponseAsync(deviceName, resourceGroupName, parameters).map(new Func1, UploadCertificateResponseInner>() { + @Override + public UploadCertificateResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Uploads registration certificate for the device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param parameters The upload certificate request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the UploadCertificateResponseInner object + */ + public Observable> uploadCertificateWithServiceResponseAsync(String deviceName, String resourceGroupName, UploadCertificateRequest parameters) { + if (deviceName == null) { + throw new IllegalArgumentException("Parameter deviceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.uploadCertificate(deviceName, this.client.subscriptionId(), resourceGroupName, parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = uploadCertificateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse uploadCertificateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the data box edge/gateway devices in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DataBoxEdgeDeviceInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the data box edge/gateway devices in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the data box edge/gateway devices in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DataBoxEdgeDeviceInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the data box edge/gateway devices in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DataBoxEdgeDeviceInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the data box edge/gateway devices in a subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DataBoxEdgeDeviceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the data box edge/gateway devices in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DataBoxEdgeDeviceInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the data box edge/gateway devices in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the data box edge/gateway devices in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DataBoxEdgeDeviceInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the data box edge/gateway devices in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DataBoxEdgeDeviceInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the data box edge/gateway devices in a resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DataBoxEdgeDeviceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/IdParsingUtils.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/IdParsingUtils.java new file mode 100644 index 0000000000000..b534eed896bb5 --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/IdParsingUtils.java @@ -0,0 +1,57 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01.implementation; +import java.util.Arrays; +import java.util.Iterator; + +class IdParsingUtils { + public static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + public static String getValueFromIdByPosition(String id, int pos) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + int index = 0; + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (index == pos) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + index++; + } + return null; + } +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/JobInner.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/JobInner.java new file mode 100644 index 0000000000000..b308b927b4c3e --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/JobInner.java @@ -0,0 +1,285 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01.implementation; + +import com.microsoft.azure.management.databoxedge.v2019_03_01.JobStatus; +import org.joda.time.DateTime; +import com.microsoft.azure.management.databoxedge.v2019_03_01.JobErrorDetails; +import com.microsoft.azure.management.databoxedge.v2019_03_01.JobType; +import com.microsoft.azure.management.databoxedge.v2019_03_01.UpdateOperationStage; +import com.microsoft.azure.management.databoxedge.v2019_03_01.UpdateDownloadProgress; +import com.microsoft.azure.management.databoxedge.v2019_03_01.UpdateInstallProgress; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * A device job. + */ +@JsonFlatten +public class JobInner { + /** + * The path ID that uniquely identifies the object. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * The name of the object. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * The hierarchical type of the object. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** + * The current status of the job. Possible values include: 'Invalid', + * 'Running', 'Succeeded', 'Failed', 'Canceled', 'Paused', 'Scheduled'. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private JobStatus status; + + /** + * The UTC date and time at which the job started. + */ + @JsonProperty(value = "startTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime startTime; + + /** + * The UTC date and time at which the job completed. + */ + @JsonProperty(value = "endTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime endTime; + + /** + * The percentage of the job that is complete. + */ + @JsonProperty(value = "percentComplete", access = JsonProperty.Access.WRITE_ONLY) + private Integer percentComplete; + + /** + * The error details. + */ + @JsonProperty(value = "error", access = JsonProperty.Access.WRITE_ONLY) + private JobErrorDetails error; + + /** + * The type of the job. Possible values include: 'Invalid', + * 'ScanForUpdates', 'DownloadUpdates', 'InstallUpdates', 'RefreshShare'. + */ + @JsonProperty(value = "properties.jobType", access = JsonProperty.Access.WRITE_ONLY) + private JobType jobType; + + /** + * Current stage of the update operation. Possible values include: + * 'Unknown', 'Initial', 'ScanStarted', 'ScanComplete', 'ScanFailed', + * 'DownloadStarted', 'DownloadComplete', 'DownloadFailed', + * 'InstallStarted', 'InstallComplete', 'InstallFailed', 'RebootInitiated', + * 'Success', 'Failure', 'RescanStarted', 'RescanComplete', 'RescanFailed'. + */ + @JsonProperty(value = "properties.currentStage", access = JsonProperty.Access.WRITE_ONLY) + private UpdateOperationStage currentStage; + + /** + * The download progress. + */ + @JsonProperty(value = "properties.downloadProgress", access = JsonProperty.Access.WRITE_ONLY) + private UpdateDownloadProgress downloadProgress; + + /** + * The install progress. + */ + @JsonProperty(value = "properties.installProgress", access = JsonProperty.Access.WRITE_ONLY) + private UpdateInstallProgress installProgress; + + /** + * Total number of errors encountered during the refresh process. + */ + @JsonProperty(value = "properties.totalRefreshErrors", access = JsonProperty.Access.WRITE_ONLY) + private Integer totalRefreshErrors; + + /** + * Local share/remote container relative path to the error manifest file of + * the refresh. + */ + @JsonProperty(value = "properties.errorManifestFile", access = JsonProperty.Access.WRITE_ONLY) + private String errorManifestFile; + + /** + * ARM ID of the share that was refreshed. + */ + @JsonProperty(value = "properties.shareId", access = JsonProperty.Access.WRITE_ONLY) + private String shareId; + + /** + * If only subfolders need to be refreshed, then the subfolder path inside + * the share. (The path is empty if there are no subfolders.). + */ + @JsonProperty(value = "properties.folder") + private String folder; + + /** + * Get the path ID that uniquely identifies the object. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Get the name of the object. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get the hierarchical type of the object. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Get the current status of the job. Possible values include: 'Invalid', 'Running', 'Succeeded', 'Failed', 'Canceled', 'Paused', 'Scheduled'. + * + * @return the status value + */ + public JobStatus status() { + return this.status; + } + + /** + * Get the UTC date and time at which the job started. + * + * @return the startTime value + */ + public DateTime startTime() { + return this.startTime; + } + + /** + * Get the UTC date and time at which the job completed. + * + * @return the endTime value + */ + public DateTime endTime() { + return this.endTime; + } + + /** + * Get the percentage of the job that is complete. + * + * @return the percentComplete value + */ + public Integer percentComplete() { + return this.percentComplete; + } + + /** + * Get the error details. + * + * @return the error value + */ + public JobErrorDetails error() { + return this.error; + } + + /** + * Get the type of the job. Possible values include: 'Invalid', 'ScanForUpdates', 'DownloadUpdates', 'InstallUpdates', 'RefreshShare'. + * + * @return the jobType value + */ + public JobType jobType() { + return this.jobType; + } + + /** + * Get current stage of the update operation. Possible values include: 'Unknown', 'Initial', 'ScanStarted', 'ScanComplete', 'ScanFailed', 'DownloadStarted', 'DownloadComplete', 'DownloadFailed', 'InstallStarted', 'InstallComplete', 'InstallFailed', 'RebootInitiated', 'Success', 'Failure', 'RescanStarted', 'RescanComplete', 'RescanFailed'. + * + * @return the currentStage value + */ + public UpdateOperationStage currentStage() { + return this.currentStage; + } + + /** + * Get the download progress. + * + * @return the downloadProgress value + */ + public UpdateDownloadProgress downloadProgress() { + return this.downloadProgress; + } + + /** + * Get the install progress. + * + * @return the installProgress value + */ + public UpdateInstallProgress installProgress() { + return this.installProgress; + } + + /** + * Get total number of errors encountered during the refresh process. + * + * @return the totalRefreshErrors value + */ + public Integer totalRefreshErrors() { + return this.totalRefreshErrors; + } + + /** + * Get local share/remote container relative path to the error manifest file of the refresh. + * + * @return the errorManifestFile value + */ + public String errorManifestFile() { + return this.errorManifestFile; + } + + /** + * Get aRM ID of the share that was refreshed. + * + * @return the shareId value + */ + public String shareId() { + return this.shareId; + } + + /** + * Get if only subfolders need to be refreshed, then the subfolder path inside the share. (The path is empty if there are no subfolders.). + * + * @return the folder value + */ + public String folder() { + return this.folder; + } + + /** + * Set if only subfolders need to be refreshed, then the subfolder path inside the share. (The path is empty if there are no subfolders.). + * + * @param folder the folder value to set + * @return the JobInner object itself. + */ + public JobInner withFolder(String folder) { + this.folder = folder; + return this; + } + +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/JobsImpl.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/JobsImpl.java new file mode 100644 index 0000000000000..c2b8b97ce345b --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/JobsImpl.java @@ -0,0 +1,50 @@ +/** + * 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. + * + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.databoxedge.v2019_03_01.Jobs; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.management.databoxedge.v2019_03_01.DataBoxEdgeDeviceJob; + +class JobsImpl extends WrapperImpl implements Jobs { + private final DataBoxEdgeManager manager; + + JobsImpl(DataBoxEdgeManager manager) { + super(manager.inner().jobs()); + this.manager = manager; + } + + public DataBoxEdgeManager manager() { + return this.manager; + } + + private DataBoxEdgeDeviceJobImpl wrapModel(JobInner inner) { + return new DataBoxEdgeDeviceJobImpl(inner, manager()); + } + + @Override + public Observable getAsync(String deviceName, String name, String resourceGroupName) { + JobsInner client = this.inner(); + return client.getAsync(deviceName, name, resourceGroupName) + .flatMap(new Func1>() { + @Override + public Observable call(JobInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((DataBoxEdgeDeviceJob)wrapModel(inner)); + } + } + }); + } + +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/JobsInner.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/JobsInner.java new file mode 100644 index 0000000000000..20c7cb604923a --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/JobsInner.java @@ -0,0 +1,153 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Jobs. + */ +public class JobsInner { + /** The Retrofit service to perform REST calls. */ + private JobsService service; + /** The service client containing this operation class. */ + private DataBoxEdgeManagementClientImpl client; + + /** + * Initializes an instance of JobsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public JobsInner(Retrofit retrofit, DataBoxEdgeManagementClientImpl client) { + this.service = retrofit.create(JobsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Jobs to be + * used by Retrofit to perform actually REST calls. + */ + interface JobsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.databoxedge.v2019_03_01.Jobs get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/jobs/{name}") + Observable> get(@Path("deviceName") String deviceName, @Path("name") String name, @Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets the details of a specified job on a data box edge/gateway device. + * + * @param deviceName The device name. + * @param name The job name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the JobInner object if successful. + */ + public JobInner get(String deviceName, String name, String resourceGroupName) { + return getWithServiceResponseAsync(deviceName, name, resourceGroupName).toBlocking().single().body(); + } + + /** + * Gets the details of a specified job on a data box edge/gateway device. + * + * @param deviceName The device name. + * @param name The job name. + * @param resourceGroupName The resource group name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String deviceName, String name, String resourceGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(deviceName, name, resourceGroupName), serviceCallback); + } + + /** + * Gets the details of a specified job on a data box edge/gateway device. + * + * @param deviceName The device name. + * @param name The job name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the JobInner object + */ + public Observable getAsync(String deviceName, String name, String resourceGroupName) { + return getWithServiceResponseAsync(deviceName, name, resourceGroupName).map(new Func1, JobInner>() { + @Override + public JobInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the details of a specified job on a data box edge/gateway device. + * + * @param deviceName The device name. + * @param name The job name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the JobInner object + */ + public Observable> getWithServiceResponseAsync(String deviceName, String name, String resourceGroupName) { + if (deviceName == null) { + throw new IllegalArgumentException("Parameter deviceName is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(deviceName, name, this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/NetworkSettingsImpl.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/NetworkSettingsImpl.java new file mode 100644 index 0000000000000..b21b57c71949c --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/NetworkSettingsImpl.java @@ -0,0 +1,48 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01.implementation; + +import com.microsoft.azure.management.databoxedge.v2019_03_01.NetworkSettings; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.databoxedge.v2019_03_01.NetworkAdapter; + +class NetworkSettingsImpl extends WrapperImpl implements NetworkSettings { + private final DataBoxEdgeManager manager; + NetworkSettingsImpl(NetworkSettingsInner inner, DataBoxEdgeManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public DataBoxEdgeManager manager() { + return this.manager; + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public List networkAdapters() { + return this.inner().networkAdapters(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/NetworkSettingsInner.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/NetworkSettingsInner.java new file mode 100644 index 0000000000000..d1b100924ef4e --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/NetworkSettingsInner.java @@ -0,0 +1,37 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.databoxedge.v2019_03_01.NetworkAdapter; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.management.databoxedge.v2019_03_01.ARMBaseModel; + +/** + * The network settings of a device. + */ +@JsonFlatten +public class NetworkSettingsInner extends ARMBaseModel { + /** + * The network adapter list on the device. + */ + @JsonProperty(value = "properties.networkAdapters", access = JsonProperty.Access.WRITE_ONLY) + private List networkAdapters; + + /** + * Get the network adapter list on the device. + * + * @return the networkAdapters value + */ + public List networkAdapters() { + return this.networkAdapters; + } + +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/OperationImpl.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/OperationImpl.java new file mode 100644 index 0000000000000..46a8786a90e30 --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/OperationImpl.java @@ -0,0 +1,48 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01.implementation; + +import com.microsoft.azure.management.databoxedge.v2019_03_01.Operation; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.databoxedge.v2019_03_01.OperationDisplay; +import com.microsoft.azure.management.databoxedge.v2019_03_01.ServiceSpecification; + +class OperationImpl extends WrapperImpl implements Operation { + private final DataBoxEdgeManager manager; + OperationImpl(OperationInner inner, DataBoxEdgeManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public DataBoxEdgeManager manager() { + return this.manager; + } + + @Override + public OperationDisplay display() { + return this.inner().display(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String origin() { + return this.inner().origin(); + } + + @Override + public ServiceSpecification serviceSpecification() { + return this.inner().serviceSpecification(); + } + +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/OperationInner.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/OperationInner.java new file mode 100644 index 0000000000000..67bed2e77caa5 --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/OperationInner.java @@ -0,0 +1,125 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01.implementation; + +import com.microsoft.azure.management.databoxedge.v2019_03_01.OperationDisplay; +import com.microsoft.azure.management.databoxedge.v2019_03_01.ServiceSpecification; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Operations. + */ +@JsonFlatten +public class OperationInner { + /** + * Name of the operation. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Properties displayed for the operation. + */ + @JsonProperty(value = "display") + private OperationDisplay display; + + /** + * Origin of the operation. + */ + @JsonProperty(value = "origin") + private String origin; + + /** + * Service specification. + */ + @JsonProperty(value = "properties.serviceSpecification") + private ServiceSpecification serviceSpecification; + + /** + * Get name of the operation. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the operation. + * + * @param name the name value to set + * @return the OperationInner object itself. + */ + public OperationInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get properties displayed for the operation. + * + * @return the display value + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Set properties displayed for the operation. + * + * @param display the display value to set + * @return the OperationInner object itself. + */ + public OperationInner withDisplay(OperationDisplay display) { + this.display = display; + return this; + } + + /** + * Get origin of the operation. + * + * @return the origin value + */ + public String origin() { + return this.origin; + } + + /** + * Set origin of the operation. + * + * @param origin the origin value to set + * @return the OperationInner object itself. + */ + public OperationInner withOrigin(String origin) { + this.origin = origin; + return this; + } + + /** + * Get service specification. + * + * @return the serviceSpecification value + */ + public ServiceSpecification serviceSpecification() { + return this.serviceSpecification; + } + + /** + * Set service specification. + * + * @param serviceSpecification the serviceSpecification value to set + * @return the OperationInner object itself. + */ + public OperationInner withServiceSpecification(ServiceSpecification serviceSpecification) { + this.serviceSpecification = serviceSpecification; + return this; + } + +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/OperationsImpl.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/OperationsImpl.java new file mode 100644 index 0000000000000..cb746f6c26536 --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/OperationsImpl.java @@ -0,0 +1,49 @@ +/** + * 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. + * abc + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.databoxedge.v2019_03_01.Operations; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.databoxedge.v2019_03_01.Operation; + +class OperationsImpl extends WrapperImpl implements Operations { + private final DataBoxEdgeManager manager; + + OperationsImpl(DataBoxEdgeManager manager) { + super(manager.inner().operations()); + this.manager = manager; + } + + public DataBoxEdgeManager manager() { + return this.manager; + } + + @Override + public Observable listAsync() { + OperationsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Operation call(OperationInner inner) { + return new OperationImpl(inner, manager()); + } + }); + } + +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/OperationsInner.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/OperationsInner.java new file mode 100644 index 0000000000000..ed18473e59ee8 --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/OperationsInner.java @@ -0,0 +1,283 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Operations. + */ +public class OperationsInner { + /** The Retrofit service to perform REST calls. */ + private OperationsService service; + /** The service client containing this operation class. */ + private DataBoxEdgeManagementClientImpl client; + + /** + * Initializes an instance of OperationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public OperationsInner(Retrofit retrofit, DataBoxEdgeManagementClientImpl client) { + this.service = retrofit.create(OperationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Operations to be + * used by Retrofit to perform actually REST calls. + */ + interface OperationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.databoxedge.v2019_03_01.Operations list" }) + @GET("providers/Microsoft.DataBoxEdge/operations") + Observable> list(@Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.databoxedge.v2019_03_01.Operations listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * List all the supported operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<OperationInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List all the supported operations. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List all the supported operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List all the supported operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List all the supported operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<OperationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List all the supported operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<OperationInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List all the supported operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List all the supported operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List all the supported operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List all the supported operations. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<OperationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/OperationsStatusImpl.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/OperationsStatusImpl.java new file mode 100644 index 0000000000000..8cbaaa300449c --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/OperationsStatusImpl.java @@ -0,0 +1,50 @@ +/** + * 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. + * + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.databoxedge.v2019_03_01.OperationsStatus; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.management.databoxedge.v2019_03_01.DataBoxEdgeDeviceJobModel; + +class OperationsStatusImpl extends WrapperImpl implements OperationsStatus { + private final DataBoxEdgeManager manager; + + OperationsStatusImpl(DataBoxEdgeManager manager) { + super(manager.inner().operationsStatus()); + this.manager = manager; + } + + public DataBoxEdgeManager manager() { + return this.manager; + } + + private DataBoxEdgeDeviceJobModelImpl wrapModel(JobInner inner) { + return new DataBoxEdgeDeviceJobModelImpl(inner, manager()); + } + + @Override + public Observable getAsync(String deviceName, String name, String resourceGroupName) { + OperationsStatusInner client = this.inner(); + return client.getAsync(deviceName, name, resourceGroupName) + .flatMap(new Func1>() { + @Override + public Observable call(JobInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((DataBoxEdgeDeviceJobModel)wrapModel(inner)); + } + } + }); + } + +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/OperationsStatusInner.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/OperationsStatusInner.java new file mode 100644 index 0000000000000..3ba64a00baf50 --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/OperationsStatusInner.java @@ -0,0 +1,153 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in OperationsStatus. + */ +public class OperationsStatusInner { + /** The Retrofit service to perform REST calls. */ + private OperationsStatusService service; + /** The service client containing this operation class. */ + private DataBoxEdgeManagementClientImpl client; + + /** + * Initializes an instance of OperationsStatusInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public OperationsStatusInner(Retrofit retrofit, DataBoxEdgeManagementClientImpl client) { + this.service = retrofit.create(OperationsStatusService.class); + this.client = client; + } + + /** + * The interface defining all the services for OperationsStatus to be + * used by Retrofit to perform actually REST calls. + */ + interface OperationsStatusService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.databoxedge.v2019_03_01.OperationsStatus get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/operationsStatus/{name}") + Observable> get(@Path("deviceName") String deviceName, @Path("name") String name, @Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets the details of a specified job on a data box edge/gateway device. + * + * @param deviceName The device name. + * @param name The job name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the JobInner object if successful. + */ + public JobInner get(String deviceName, String name, String resourceGroupName) { + return getWithServiceResponseAsync(deviceName, name, resourceGroupName).toBlocking().single().body(); + } + + /** + * Gets the details of a specified job on a data box edge/gateway device. + * + * @param deviceName The device name. + * @param name The job name. + * @param resourceGroupName The resource group name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String deviceName, String name, String resourceGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(deviceName, name, resourceGroupName), serviceCallback); + } + + /** + * Gets the details of a specified job on a data box edge/gateway device. + * + * @param deviceName The device name. + * @param name The job name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the JobInner object + */ + public Observable getAsync(String deviceName, String name, String resourceGroupName) { + return getWithServiceResponseAsync(deviceName, name, resourceGroupName).map(new Func1, JobInner>() { + @Override + public JobInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the details of a specified job on a data box edge/gateway device. + * + * @param deviceName The device name. + * @param name The job name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the JobInner object + */ + public Observable> getWithServiceResponseAsync(String deviceName, String name, String resourceGroupName) { + if (deviceName == null) { + throw new IllegalArgumentException("Parameter deviceName is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(deviceName, name, this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/OrderImpl.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/OrderImpl.java new file mode 100644 index 0000000000000..9e0f1ffbae582 --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/OrderImpl.java @@ -0,0 +1,85 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01.implementation; + +import com.microsoft.azure.management.databoxedge.v2019_03_01.Order; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; +import com.microsoft.azure.management.databoxedge.v2019_03_01.ContactDetails; +import com.microsoft.azure.management.databoxedge.v2019_03_01.OrderStatus; +import java.util.List; +import com.microsoft.azure.management.databoxedge.v2019_03_01.TrackingInfo; +import com.microsoft.azure.management.databoxedge.v2019_03_01.Address; + +class OrderImpl extends WrapperImpl implements Order { + private final DataBoxEdgeManager manager; + + OrderImpl(OrderInner inner, DataBoxEdgeManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public DataBoxEdgeManager manager() { + return this.manager; + } + + + + @Override + public ContactDetails contactInformation() { + return this.inner().contactInformation(); + } + + @Override + public OrderStatus currentStatus() { + return this.inner().currentStatus(); + } + + @Override + public List deliveryTrackingInfo() { + return this.inner().deliveryTrackingInfo(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public List orderHistory() { + return this.inner().orderHistory(); + } + + @Override + public List returnTrackingInfo() { + return this.inner().returnTrackingInfo(); + } + + @Override + public String serialNumber() { + return this.inner().serialNumber(); + } + + @Override + public Address shippingAddress() { + return this.inner().shippingAddress(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/OrderInner.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/OrderInner.java new file mode 100644 index 0000000000000..f644708b05aa9 --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/OrderInner.java @@ -0,0 +1,165 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01.implementation; + +import com.microsoft.azure.management.databoxedge.v2019_03_01.ContactDetails; +import com.microsoft.azure.management.databoxedge.v2019_03_01.Address; +import com.microsoft.azure.management.databoxedge.v2019_03_01.OrderStatus; +import java.util.List; +import com.microsoft.azure.management.databoxedge.v2019_03_01.TrackingInfo; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.management.databoxedge.v2019_03_01.ARMBaseModel; + +/** + * The order details. + */ +@JsonFlatten +public class OrderInner extends ARMBaseModel { + /** + * The contact details. + */ + @JsonProperty(value = "properties.contactInformation", required = true) + private ContactDetails contactInformation; + + /** + * The shipping address. + */ + @JsonProperty(value = "properties.shippingAddress", required = true) + private Address shippingAddress; + + /** + * Current status of the order. + */ + @JsonProperty(value = "properties.currentStatus") + private OrderStatus currentStatus; + + /** + * List of status changes in the order. + */ + @JsonProperty(value = "properties.orderHistory", access = JsonProperty.Access.WRITE_ONLY) + private List orderHistory; + + /** + * Serial number of the device. + */ + @JsonProperty(value = "properties.serialNumber", access = JsonProperty.Access.WRITE_ONLY) + private String serialNumber; + + /** + * Tracking information for the package delivered to the customer whether + * it has an original or a replacement device. + */ + @JsonProperty(value = "properties.deliveryTrackingInfo", access = JsonProperty.Access.WRITE_ONLY) + private List deliveryTrackingInfo; + + /** + * Tracking information for the package returned from the customer whether + * it has an original or a replacement device. + */ + @JsonProperty(value = "properties.returnTrackingInfo", access = JsonProperty.Access.WRITE_ONLY) + private List returnTrackingInfo; + + /** + * Get the contact details. + * + * @return the contactInformation value + */ + public ContactDetails contactInformation() { + return this.contactInformation; + } + + /** + * Set the contact details. + * + * @param contactInformation the contactInformation value to set + * @return the OrderInner object itself. + */ + public OrderInner withContactInformation(ContactDetails contactInformation) { + this.contactInformation = contactInformation; + return this; + } + + /** + * Get the shipping address. + * + * @return the shippingAddress value + */ + public Address shippingAddress() { + return this.shippingAddress; + } + + /** + * Set the shipping address. + * + * @param shippingAddress the shippingAddress value to set + * @return the OrderInner object itself. + */ + public OrderInner withShippingAddress(Address shippingAddress) { + this.shippingAddress = shippingAddress; + return this; + } + + /** + * Get current status of the order. + * + * @return the currentStatus value + */ + public OrderStatus currentStatus() { + return this.currentStatus; + } + + /** + * Set current status of the order. + * + * @param currentStatus the currentStatus value to set + * @return the OrderInner object itself. + */ + public OrderInner withCurrentStatus(OrderStatus currentStatus) { + this.currentStatus = currentStatus; + return this; + } + + /** + * Get list of status changes in the order. + * + * @return the orderHistory value + */ + public List orderHistory() { + return this.orderHistory; + } + + /** + * Get serial number of the device. + * + * @return the serialNumber value + */ + public String serialNumber() { + return this.serialNumber; + } + + /** + * Get tracking information for the package delivered to the customer whether it has an original or a replacement device. + * + * @return the deliveryTrackingInfo value + */ + public List deliveryTrackingInfo() { + return this.deliveryTrackingInfo; + } + + /** + * Get tracking information for the package returned from the customer whether it has an original or a replacement device. + * + * @return the returnTrackingInfo value + */ + public List returnTrackingInfo() { + return this.returnTrackingInfo; + } + +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/OrdersImpl.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/OrdersImpl.java new file mode 100644 index 0000000000000..84d68a221675a --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/OrdersImpl.java @@ -0,0 +1,84 @@ +/** + * 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. + * + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.databoxedge.v2019_03_01.Orders; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import rx.Completable; +import com.microsoft.azure.management.databoxedge.v2019_03_01.Order; + +class OrdersImpl extends WrapperImpl implements Orders { + private final DataBoxEdgeManager manager; + + OrdersImpl(DataBoxEdgeManager manager) { + super(manager.inner().orders()); + this.manager = manager; + } + + public DataBoxEdgeManager manager() { + return this.manager; + } + + private OrderImpl wrapModel(OrderInner inner) { + return new OrderImpl(inner, manager()); + } + + @Override + public Observable getAsync(String deviceName, String resourceGroupName) { + OrdersInner client = this.inner(); + return client.getAsync(deviceName, resourceGroupName) + .map(new Func1() { + @Override + public Order call(OrderInner inner) { + return new OrderImpl(inner, manager()); + } + }); + } + + @Override + public Observable createOrUpdateAsync(String deviceName, String resourceGroupName, OrderInner order) { + OrdersInner client = this.inner(); + return client.createOrUpdateAsync(deviceName, resourceGroupName, order) + .map(new Func1() { + @Override + public Order call(OrderInner inner) { + return new OrderImpl(inner, manager()); + } + }); + } + + @Override + public Completable deleteAsync(String deviceName, String resourceGroupName) { + OrdersInner client = this.inner(); + return client.deleteAsync(deviceName, resourceGroupName).toCompletable(); + } + + @Override + public Observable listByDataBoxEdgeDeviceAsync(final String deviceName, final String resourceGroupName) { + OrdersInner client = this.inner(); + return client.listByDataBoxEdgeDeviceAsync(deviceName, resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Order call(OrderInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/OrdersInner.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/OrdersInner.java new file mode 100644 index 0000000000000..f025336eab6d6 --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/OrdersInner.java @@ -0,0 +1,742 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Orders. + */ +public class OrdersInner implements InnerSupportsDelete { + /** The Retrofit service to perform REST calls. */ + private OrdersService service; + /** The service client containing this operation class. */ + private DataBoxEdgeManagementClientImpl client; + + /** + * Initializes an instance of OrdersInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public OrdersInner(Retrofit retrofit, DataBoxEdgeManagementClientImpl client) { + this.service = retrofit.create(OrdersService.class); + this.client = client; + } + + /** + * The interface defining all the services for Orders to be + * used by Retrofit to perform actually REST calls. + */ + interface OrdersService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.databoxedge.v2019_03_01.Orders listByDataBoxEdgeDevice" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/orders") + Observable> listByDataBoxEdgeDevice(@Path("deviceName") String deviceName, @Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.databoxedge.v2019_03_01.Orders get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/orders/default") + Observable> get(@Path("deviceName") String deviceName, @Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.databoxedge.v2019_03_01.Orders createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/orders/default") + Observable> createOrUpdate(@Path("deviceName") String deviceName, @Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Body OrderInner order, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.databoxedge.v2019_03_01.Orders beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/orders/default") + Observable> beginCreateOrUpdate(@Path("deviceName") String deviceName, @Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Body OrderInner order, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.databoxedge.v2019_03_01.Orders delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/orders/default", method = "DELETE", hasBody = true) + Observable> delete(@Path("deviceName") String deviceName, @Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.databoxedge.v2019_03_01.Orders beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/orders/default", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("deviceName") String deviceName, @Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.databoxedge.v2019_03_01.Orders listByDataBoxEdgeDeviceNext" }) + @GET + Observable> listByDataBoxEdgeDeviceNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists all the orders related to a data box edge/gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<OrderInner> object if successful. + */ + public PagedList listByDataBoxEdgeDevice(final String deviceName, final String resourceGroupName) { + ServiceResponse> response = listByDataBoxEdgeDeviceSinglePageAsync(deviceName, resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByDataBoxEdgeDeviceNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the orders related to a data box edge/gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByDataBoxEdgeDeviceAsync(final String deviceName, final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByDataBoxEdgeDeviceSinglePageAsync(deviceName, resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByDataBoxEdgeDeviceNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the orders related to a data box edge/gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OrderInner> object + */ + public Observable> listByDataBoxEdgeDeviceAsync(final String deviceName, final String resourceGroupName) { + return listByDataBoxEdgeDeviceWithServiceResponseAsync(deviceName, resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the orders related to a data box edge/gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OrderInner> object + */ + public Observable>> listByDataBoxEdgeDeviceWithServiceResponseAsync(final String deviceName, final String resourceGroupName) { + return listByDataBoxEdgeDeviceSinglePageAsync(deviceName, resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByDataBoxEdgeDeviceNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the orders related to a data box edge/gateway device. + * + ServiceResponse> * @param deviceName The device name. + ServiceResponse> * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<OrderInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByDataBoxEdgeDeviceSinglePageAsync(final String deviceName, final String resourceGroupName) { + if (deviceName == null) { + throw new IllegalArgumentException("Parameter deviceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByDataBoxEdgeDevice(deviceName, this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByDataBoxEdgeDeviceDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByDataBoxEdgeDeviceDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets a specific order by name. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the OrderInner object if successful. + */ + public OrderInner get(String deviceName, String resourceGroupName) { + return getWithServiceResponseAsync(deviceName, resourceGroupName).toBlocking().single().body(); + } + + /** + * Gets a specific order by name. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String deviceName, String resourceGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(deviceName, resourceGroupName), serviceCallback); + } + + /** + * Gets a specific order by name. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the OrderInner object + */ + public Observable getAsync(String deviceName, String resourceGroupName) { + return getWithServiceResponseAsync(deviceName, resourceGroupName).map(new Func1, OrderInner>() { + @Override + public OrderInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets a specific order by name. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the OrderInner object + */ + public Observable> getWithServiceResponseAsync(String deviceName, String resourceGroupName) { + if (deviceName == null) { + throw new IllegalArgumentException("Parameter deviceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(deviceName, this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates or updates an order. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param order The order to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the OrderInner object if successful. + */ + public OrderInner createOrUpdate(String deviceName, String resourceGroupName, OrderInner order) { + return createOrUpdateWithServiceResponseAsync(deviceName, resourceGroupName, order).toBlocking().last().body(); + } + + /** + * Creates or updates an order. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param order The order to be created or updated. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String deviceName, String resourceGroupName, OrderInner order, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(deviceName, resourceGroupName, order), serviceCallback); + } + + /** + * Creates or updates an order. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param order The order to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String deviceName, String resourceGroupName, OrderInner order) { + return createOrUpdateWithServiceResponseAsync(deviceName, resourceGroupName, order).map(new Func1, OrderInner>() { + @Override + public OrderInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates an order. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param order The order to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String deviceName, String resourceGroupName, OrderInner order) { + if (deviceName == null) { + throw new IllegalArgumentException("Parameter deviceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (order == null) { + throw new IllegalArgumentException("Parameter order is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(order); + Observable> observable = service.createOrUpdate(deviceName, this.client.subscriptionId(), resourceGroupName, order, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates or updates an order. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param order The order to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the OrderInner object if successful. + */ + public OrderInner beginCreateOrUpdate(String deviceName, String resourceGroupName, OrderInner order) { + return beginCreateOrUpdateWithServiceResponseAsync(deviceName, resourceGroupName, order).toBlocking().single().body(); + } + + /** + * Creates or updates an order. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param order The order to be created or updated. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String deviceName, String resourceGroupName, OrderInner order, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(deviceName, resourceGroupName, order), serviceCallback); + } + + /** + * Creates or updates an order. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param order The order to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the OrderInner object + */ + public Observable beginCreateOrUpdateAsync(String deviceName, String resourceGroupName, OrderInner order) { + return beginCreateOrUpdateWithServiceResponseAsync(deviceName, resourceGroupName, order).map(new Func1, OrderInner>() { + @Override + public OrderInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates an order. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param order The order to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the OrderInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String deviceName, String resourceGroupName, OrderInner order) { + if (deviceName == null) { + throw new IllegalArgumentException("Parameter deviceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (order == null) { + throw new IllegalArgumentException("Parameter order is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(order); + return service.beginCreateOrUpdate(deviceName, this.client.subscriptionId(), resourceGroupName, order, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes the order related to the device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String deviceName, String resourceGroupName) { + deleteWithServiceResponseAsync(deviceName, resourceGroupName).toBlocking().last().body(); + } + + /** + * Deletes the order related to the device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String deviceName, String resourceGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(deviceName, resourceGroupName), serviceCallback); + } + + /** + * Deletes the order related to the device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String deviceName, String resourceGroupName) { + return deleteWithServiceResponseAsync(deviceName, resourceGroupName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the order related to the device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String deviceName, String resourceGroupName) { + if (deviceName == null) { + throw new IllegalArgumentException("Parameter deviceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.delete(deviceName, this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the order related to the device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String deviceName, String resourceGroupName) { + beginDeleteWithServiceResponseAsync(deviceName, resourceGroupName).toBlocking().single().body(); + } + + /** + * Deletes the order related to the device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String deviceName, String resourceGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(deviceName, resourceGroupName), serviceCallback); + } + + /** + * Deletes the order related to the device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String deviceName, String resourceGroupName) { + return beginDeleteWithServiceResponseAsync(deviceName, resourceGroupName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the order related to the device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String deviceName, String resourceGroupName) { + if (deviceName == null) { + throw new IllegalArgumentException("Parameter deviceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDelete(deviceName, this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all the orders related to a data box edge/gateway device. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<OrderInner> object if successful. + */ + public PagedList listByDataBoxEdgeDeviceNext(final String nextPageLink) { + ServiceResponse> response = listByDataBoxEdgeDeviceNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByDataBoxEdgeDeviceNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the orders related to a data box edge/gateway device. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByDataBoxEdgeDeviceNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByDataBoxEdgeDeviceNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByDataBoxEdgeDeviceNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the orders related to a data box edge/gateway device. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OrderInner> object + */ + public Observable> listByDataBoxEdgeDeviceNextAsync(final String nextPageLink) { + return listByDataBoxEdgeDeviceNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the orders related to a data box edge/gateway device. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OrderInner> object + */ + public Observable>> listByDataBoxEdgeDeviceNextWithServiceResponseAsync(final String nextPageLink) { + return listByDataBoxEdgeDeviceNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByDataBoxEdgeDeviceNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the orders related to a data box edge/gateway device. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<OrderInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByDataBoxEdgeDeviceNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByDataBoxEdgeDeviceNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByDataBoxEdgeDeviceNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByDataBoxEdgeDeviceNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/PageImpl.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/PageImpl.java new file mode 100644 index 0000000000000..b99ce28ea1ef2 --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/PageImpl.java @@ -0,0 +1,75 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Page; +import java.util.List; + +/** + * An instance of this class defines a page of Azure resources and a link to + * get the next page of resources, if any. + * + * @param type of Azure resource + */ +public class PageImpl implements Page { + /** + * The link to the next page. + */ + @JsonProperty("nextLink") + private String nextPageLink; + + /** + * The list of items. + */ + @JsonProperty("value") + private List items; + + /** + * Gets the link to the next page. + * + * @return the link to the next page. + */ + @Override + public String nextPageLink() { + return this.nextPageLink; + } + + /** + * Gets the list of items. + * + * @return the list of items in {@link List}. + */ + @Override + public List items() { + return items; + } + + /** + * Sets the link to the next page. + * + * @param nextPageLink the link to the next page. + * @return this Page object itself. + */ + public PageImpl setNextPageLink(String nextPageLink) { + this.nextPageLink = nextPageLink; + return this; + } + + /** + * Sets the list of items. + * + * @param items the list of items in {@link List}. + * @return this Page object itself. + */ + public PageImpl setItems(List items) { + this.items = items; + return this; + } +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/RoleImpl.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/RoleImpl.java new file mode 100644 index 0000000000000..5ac130f7a1f28 --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/RoleImpl.java @@ -0,0 +1,94 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01.implementation; + +import com.microsoft.azure.management.databoxedge.v2019_03_01.Role; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; + +class RoleImpl extends CreatableUpdatableImpl implements Role, Role.Definition, Role.Update { + private final DataBoxEdgeManager manager; + private String deviceName; + private String name; + private String resourceGroupName; + + RoleImpl(String name, DataBoxEdgeManager manager) { + super(name, new RoleInner()); + this.manager = manager; + // Set resource name + this.name = name; + // + } + + RoleImpl(RoleInner inner, DataBoxEdgeManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.name = inner.name(); + // set resource ancestor and positional variables + this.deviceName = IdParsingUtils.getValueFromIdByName(inner.id(), "dataBoxEdgeDevices"); + this.name = IdParsingUtils.getValueFromIdByName(inner.id(), "roles"); + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + // + } + + @Override + public DataBoxEdgeManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + RolesInner client = this.manager().inner().roles(); + return client.createOrUpdateAsync(this.deviceName, this.name, this.resourceGroupName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + RolesInner client = this.manager().inner().roles(); + return client.createOrUpdateAsync(this.deviceName, this.name, this.resourceGroupName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + RolesInner client = this.manager().inner().roles(); + return client.getAsync(this.deviceName, this.name, this.resourceGroupName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public RoleImpl withExistingDataBoxEdgeDevice(String deviceName, String resourceGroupName) { + this.deviceName = deviceName; + this.resourceGroupName = resourceGroupName; + return this; + } + +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/RoleInner.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/RoleInner.java new file mode 100644 index 0000000000000..3a5972159414c --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/RoleInner.java @@ -0,0 +1,25 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01.implementation; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.microsoft.azure.management.databoxedge.v2019_03_01.ARMBaseModel; + +/** + * Compute role. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind", defaultImpl = RoleInner.class) +@JsonTypeName("Role") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "IOT", value = IoTRole.class) +}) +public class RoleInner extends ARMBaseModel { +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/RolesImpl.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/RolesImpl.java new file mode 100644 index 0000000000000..a1d15414ea4ba --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/RolesImpl.java @@ -0,0 +1,85 @@ +/** + * 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. + * + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.databoxedge.v2019_03_01.Roles; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.databoxedge.v2019_03_01.Role; + +class RolesImpl extends WrapperImpl implements Roles { + private final DataBoxEdgeManager manager; + + RolesImpl(DataBoxEdgeManager manager) { + super(manager.inner().roles()); + this.manager = manager; + } + + public DataBoxEdgeManager manager() { + return this.manager; + } + + @Override + public RoleImpl define(String name) { + return wrapModel(name); + } + + private RoleImpl wrapModel(RoleInner inner) { + return new RoleImpl(inner, manager()); + } + + private RoleImpl wrapModel(String name) { + return new RoleImpl(name, this.manager()); + } + + @Override + public Observable listByDataBoxEdgeDeviceAsync(final String deviceName, final String resourceGroupName) { + RolesInner client = this.inner(); + return client.listByDataBoxEdgeDeviceAsync(deviceName, resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Role call(RoleInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String deviceName, String name, String resourceGroupName) { + RolesInner client = this.inner(); + return client.getAsync(deviceName, name, resourceGroupName) + .flatMap(new Func1>() { + @Override + public Observable call(RoleInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((Role)wrapModel(inner)); + } + } + }); + } + + @Override + public Completable deleteAsync(String deviceName, String name, String resourceGroupName) { + RolesInner client = this.inner(); + return client.deleteAsync(deviceName, name, resourceGroupName).toCompletable(); + } + +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/RolesInner.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/RolesInner.java new file mode 100644 index 0000000000000..0d67d5e208f25 --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/RolesInner.java @@ -0,0 +1,776 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Roles. + */ +public class RolesInner { + /** The Retrofit service to perform REST calls. */ + private RolesService service; + /** The service client containing this operation class. */ + private DataBoxEdgeManagementClientImpl client; + + /** + * Initializes an instance of RolesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public RolesInner(Retrofit retrofit, DataBoxEdgeManagementClientImpl client) { + this.service = retrofit.create(RolesService.class); + this.client = client; + } + + /** + * The interface defining all the services for Roles to be + * used by Retrofit to perform actually REST calls. + */ + interface RolesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.databoxedge.v2019_03_01.Roles listByDataBoxEdgeDevice" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles") + Observable> listByDataBoxEdgeDevice(@Path("deviceName") String deviceName, @Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.databoxedge.v2019_03_01.Roles get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{name}") + Observable> get(@Path("deviceName") String deviceName, @Path("name") String name, @Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.databoxedge.v2019_03_01.Roles createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{name}") + Observable> createOrUpdate(@Path("deviceName") String deviceName, @Path("name") String name, @Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Body RoleInner role, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.databoxedge.v2019_03_01.Roles beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{name}") + Observable> beginCreateOrUpdate(@Path("deviceName") String deviceName, @Path("name") String name, @Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Body RoleInner role, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.databoxedge.v2019_03_01.Roles delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{name}", method = "DELETE", hasBody = true) + Observable> delete(@Path("deviceName") String deviceName, @Path("name") String name, @Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.databoxedge.v2019_03_01.Roles beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{name}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("deviceName") String deviceName, @Path("name") String name, @Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.databoxedge.v2019_03_01.Roles listByDataBoxEdgeDeviceNext" }) + @GET + Observable> listByDataBoxEdgeDeviceNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists all the roles configured in a data box edge/gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RoleInner> object if successful. + */ + public PagedList listByDataBoxEdgeDevice(final String deviceName, final String resourceGroupName) { + ServiceResponse> response = listByDataBoxEdgeDeviceSinglePageAsync(deviceName, resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByDataBoxEdgeDeviceNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the roles configured in a data box edge/gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByDataBoxEdgeDeviceAsync(final String deviceName, final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByDataBoxEdgeDeviceSinglePageAsync(deviceName, resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByDataBoxEdgeDeviceNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the roles configured in a data box edge/gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RoleInner> object + */ + public Observable> listByDataBoxEdgeDeviceAsync(final String deviceName, final String resourceGroupName) { + return listByDataBoxEdgeDeviceWithServiceResponseAsync(deviceName, resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the roles configured in a data box edge/gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RoleInner> object + */ + public Observable>> listByDataBoxEdgeDeviceWithServiceResponseAsync(final String deviceName, final String resourceGroupName) { + return listByDataBoxEdgeDeviceSinglePageAsync(deviceName, resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByDataBoxEdgeDeviceNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the roles configured in a data box edge/gateway device. + * + ServiceResponse> * @param deviceName The device name. + ServiceResponse> * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RoleInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByDataBoxEdgeDeviceSinglePageAsync(final String deviceName, final String resourceGroupName) { + if (deviceName == null) { + throw new IllegalArgumentException("Parameter deviceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByDataBoxEdgeDevice(deviceName, this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByDataBoxEdgeDeviceDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByDataBoxEdgeDeviceDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets a specific role by name. + * + * @param deviceName The device name. + * @param name The role name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RoleInner object if successful. + */ + public RoleInner get(String deviceName, String name, String resourceGroupName) { + return getWithServiceResponseAsync(deviceName, name, resourceGroupName).toBlocking().single().body(); + } + + /** + * Gets a specific role by name. + * + * @param deviceName The device name. + * @param name The role name. + * @param resourceGroupName The resource group name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String deviceName, String name, String resourceGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(deviceName, name, resourceGroupName), serviceCallback); + } + + /** + * Gets a specific role by name. + * + * @param deviceName The device name. + * @param name The role name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RoleInner object + */ + public Observable getAsync(String deviceName, String name, String resourceGroupName) { + return getWithServiceResponseAsync(deviceName, name, resourceGroupName).map(new Func1, RoleInner>() { + @Override + public RoleInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets a specific role by name. + * + * @param deviceName The device name. + * @param name The role name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RoleInner object + */ + public Observable> getWithServiceResponseAsync(String deviceName, String name, String resourceGroupName) { + if (deviceName == null) { + throw new IllegalArgumentException("Parameter deviceName is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(deviceName, name, this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Create or update a role. + * + * @param deviceName The device name. + * @param name The role name. + * @param resourceGroupName The resource group name. + * @param role The role properties. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RoleInner object if successful. + */ + public RoleInner createOrUpdate(String deviceName, String name, String resourceGroupName, RoleInner role) { + return createOrUpdateWithServiceResponseAsync(deviceName, name, resourceGroupName, role).toBlocking().last().body(); + } + + /** + * Create or update a role. + * + * @param deviceName The device name. + * @param name The role name. + * @param resourceGroupName The resource group name. + * @param role The role properties. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String deviceName, String name, String resourceGroupName, RoleInner role, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(deviceName, name, resourceGroupName, role), serviceCallback); + } + + /** + * Create or update a role. + * + * @param deviceName The device name. + * @param name The role name. + * @param resourceGroupName The resource group name. + * @param role The role properties. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String deviceName, String name, String resourceGroupName, RoleInner role) { + return createOrUpdateWithServiceResponseAsync(deviceName, name, resourceGroupName, role).map(new Func1, RoleInner>() { + @Override + public RoleInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update a role. + * + * @param deviceName The device name. + * @param name The role name. + * @param resourceGroupName The resource group name. + * @param role The role properties. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String deviceName, String name, String resourceGroupName, RoleInner role) { + if (deviceName == null) { + throw new IllegalArgumentException("Parameter deviceName is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (role == null) { + throw new IllegalArgumentException("Parameter role is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(role); + Observable> observable = service.createOrUpdate(deviceName, name, this.client.subscriptionId(), resourceGroupName, role, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Create or update a role. + * + * @param deviceName The device name. + * @param name The role name. + * @param resourceGroupName The resource group name. + * @param role The role properties. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RoleInner object if successful. + */ + public RoleInner beginCreateOrUpdate(String deviceName, String name, String resourceGroupName, RoleInner role) { + return beginCreateOrUpdateWithServiceResponseAsync(deviceName, name, resourceGroupName, role).toBlocking().single().body(); + } + + /** + * Create or update a role. + * + * @param deviceName The device name. + * @param name The role name. + * @param resourceGroupName The resource group name. + * @param role The role properties. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String deviceName, String name, String resourceGroupName, RoleInner role, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(deviceName, name, resourceGroupName, role), serviceCallback); + } + + /** + * Create or update a role. + * + * @param deviceName The device name. + * @param name The role name. + * @param resourceGroupName The resource group name. + * @param role The role properties. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RoleInner object + */ + public Observable beginCreateOrUpdateAsync(String deviceName, String name, String resourceGroupName, RoleInner role) { + return beginCreateOrUpdateWithServiceResponseAsync(deviceName, name, resourceGroupName, role).map(new Func1, RoleInner>() { + @Override + public RoleInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update a role. + * + * @param deviceName The device name. + * @param name The role name. + * @param resourceGroupName The resource group name. + * @param role The role properties. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RoleInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String deviceName, String name, String resourceGroupName, RoleInner role) { + if (deviceName == null) { + throw new IllegalArgumentException("Parameter deviceName is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (role == null) { + throw new IllegalArgumentException("Parameter role is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(role); + return service.beginCreateOrUpdate(deviceName, name, this.client.subscriptionId(), resourceGroupName, role, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes the role on the data box edge device. + * + * @param deviceName The device name. + * @param name The role name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String deviceName, String name, String resourceGroupName) { + deleteWithServiceResponseAsync(deviceName, name, resourceGroupName).toBlocking().last().body(); + } + + /** + * Deletes the role on the data box edge device. + * + * @param deviceName The device name. + * @param name The role name. + * @param resourceGroupName The resource group name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String deviceName, String name, String resourceGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(deviceName, name, resourceGroupName), serviceCallback); + } + + /** + * Deletes the role on the data box edge device. + * + * @param deviceName The device name. + * @param name The role name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String deviceName, String name, String resourceGroupName) { + return deleteWithServiceResponseAsync(deviceName, name, resourceGroupName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the role on the data box edge device. + * + * @param deviceName The device name. + * @param name The role name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String deviceName, String name, String resourceGroupName) { + if (deviceName == null) { + throw new IllegalArgumentException("Parameter deviceName is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.delete(deviceName, name, this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the role on the data box edge device. + * + * @param deviceName The device name. + * @param name The role name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String deviceName, String name, String resourceGroupName) { + beginDeleteWithServiceResponseAsync(deviceName, name, resourceGroupName).toBlocking().single().body(); + } + + /** + * Deletes the role on the data box edge device. + * + * @param deviceName The device name. + * @param name The role name. + * @param resourceGroupName The resource group name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String deviceName, String name, String resourceGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(deviceName, name, resourceGroupName), serviceCallback); + } + + /** + * Deletes the role on the data box edge device. + * + * @param deviceName The device name. + * @param name The role name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String deviceName, String name, String resourceGroupName) { + return beginDeleteWithServiceResponseAsync(deviceName, name, resourceGroupName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the role on the data box edge device. + * + * @param deviceName The device name. + * @param name The role name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String deviceName, String name, String resourceGroupName) { + if (deviceName == null) { + throw new IllegalArgumentException("Parameter deviceName is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDelete(deviceName, name, this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all the roles configured in a data box edge/gateway device. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RoleInner> object if successful. + */ + public PagedList listByDataBoxEdgeDeviceNext(final String nextPageLink) { + ServiceResponse> response = listByDataBoxEdgeDeviceNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByDataBoxEdgeDeviceNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the roles configured in a data box edge/gateway device. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByDataBoxEdgeDeviceNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByDataBoxEdgeDeviceNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByDataBoxEdgeDeviceNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the roles configured in a data box edge/gateway device. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RoleInner> object + */ + public Observable> listByDataBoxEdgeDeviceNextAsync(final String nextPageLink) { + return listByDataBoxEdgeDeviceNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the roles configured in a data box edge/gateway device. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RoleInner> object + */ + public Observable>> listByDataBoxEdgeDeviceNextWithServiceResponseAsync(final String nextPageLink) { + return listByDataBoxEdgeDeviceNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByDataBoxEdgeDeviceNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the roles configured in a data box edge/gateway device. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RoleInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByDataBoxEdgeDeviceNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByDataBoxEdgeDeviceNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByDataBoxEdgeDeviceNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByDataBoxEdgeDeviceNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/ShareImpl.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/ShareImpl.java new file mode 100644 index 0000000000000..85f7f7129a1bc --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/ShareImpl.java @@ -0,0 +1,208 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01.implementation; + +import com.microsoft.azure.management.databoxedge.v2019_03_01.Share; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.databoxedge.v2019_03_01.ShareStatus; +import com.microsoft.azure.management.databoxedge.v2019_03_01.MonitoringStatus; +import com.microsoft.azure.management.databoxedge.v2019_03_01.AzureContainerInfo; +import com.microsoft.azure.management.databoxedge.v2019_03_01.ShareAccessProtocol; +import java.util.List; +import com.microsoft.azure.management.databoxedge.v2019_03_01.UserAccessRight; +import com.microsoft.azure.management.databoxedge.v2019_03_01.ClientAccessRight; +import com.microsoft.azure.management.databoxedge.v2019_03_01.RefreshDetails; +import com.microsoft.azure.management.databoxedge.v2019_03_01.MountPointMap; +import com.microsoft.azure.management.databoxedge.v2019_03_01.DataPolicy; + +class ShareImpl extends CreatableUpdatableImpl implements Share, Share.Definition, Share.Update { + private final DataBoxEdgeManager manager; + private String deviceName; + private String name; + private String resourceGroupName; + + ShareImpl(String name, DataBoxEdgeManager manager) { + super(name, new ShareInner()); + this.manager = manager; + // Set resource name + this.name = name; + // + } + + ShareImpl(ShareInner inner, DataBoxEdgeManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.name = inner.name(); + // set resource ancestor and positional variables + this.deviceName = IdParsingUtils.getValueFromIdByName(inner.id(), "dataBoxEdgeDevices"); + this.name = IdParsingUtils.getValueFromIdByName(inner.id(), "shares"); + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + // + } + + @Override + public DataBoxEdgeManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + SharesInner client = this.manager().inner().shares(); + return client.createOrUpdateAsync(this.deviceName, this.name, this.resourceGroupName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + SharesInner client = this.manager().inner().shares(); + return client.createOrUpdateAsync(this.deviceName, this.name, this.resourceGroupName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + SharesInner client = this.manager().inner().shares(); + return client.getAsync(this.deviceName, this.name, this.resourceGroupName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public ShareAccessProtocol accessProtocol() { + return this.inner().accessProtocol(); + } + + @Override + public AzureContainerInfo azureContainerInfo() { + return this.inner().azureContainerInfo(); + } + + @Override + public List clientAccessRights() { + return this.inner().clientAccessRights(); + } + + @Override + public DataPolicy dataPolicy() { + return this.inner().dataPolicy(); + } + + @Override + public String description() { + return this.inner().description(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public MonitoringStatus monitoringStatus() { + return this.inner().monitoringStatus(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public RefreshDetails refreshDetails() { + return this.inner().refreshDetails(); + } + + @Override + public List shareMappings() { + return this.inner().shareMappings(); + } + + @Override + public ShareStatus shareStatus() { + return this.inner().shareStatus(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public List userAccessRights() { + return this.inner().userAccessRights(); + } + + @Override + public ShareImpl withExistingDataBoxEdgeDevice(String deviceName, String resourceGroupName) { + this.deviceName = deviceName; + this.resourceGroupName = resourceGroupName; + return this; + } + + @Override + public ShareImpl withAccessProtocol(ShareAccessProtocol accessProtocol) { + this.inner().withAccessProtocol(accessProtocol); + return this; + } + + @Override + public ShareImpl withMonitoringStatus(MonitoringStatus monitoringStatus) { + this.inner().withMonitoringStatus(monitoringStatus); + return this; + } + + @Override + public ShareImpl withShareStatus(ShareStatus shareStatus) { + this.inner().withShareStatus(shareStatus); + return this; + } + + @Override + public ShareImpl withAzureContainerInfo(AzureContainerInfo azureContainerInfo) { + this.inner().withAzureContainerInfo(azureContainerInfo); + return this; + } + + @Override + public ShareImpl withClientAccessRights(List clientAccessRights) { + this.inner().withClientAccessRights(clientAccessRights); + return this; + } + + @Override + public ShareImpl withDataPolicy(DataPolicy dataPolicy) { + this.inner().withDataPolicy(dataPolicy); + return this; + } + + @Override + public ShareImpl withDescription(String description) { + this.inner().withDescription(description); + return this; + } + + @Override + public ShareImpl withRefreshDetails(RefreshDetails refreshDetails) { + this.inner().withRefreshDetails(refreshDetails); + return this; + } + + @Override + public ShareImpl withUserAccessRights(List userAccessRights) { + this.inner().withUserAccessRights(userAccessRights); + return this; + } + +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/ShareInner.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/ShareInner.java new file mode 100644 index 0000000000000..7be28ca50e9f6 --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/ShareInner.java @@ -0,0 +1,284 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01.implementation; + +import com.microsoft.azure.management.databoxedge.v2019_03_01.ShareStatus; +import com.microsoft.azure.management.databoxedge.v2019_03_01.MonitoringStatus; +import com.microsoft.azure.management.databoxedge.v2019_03_01.AzureContainerInfo; +import com.microsoft.azure.management.databoxedge.v2019_03_01.ShareAccessProtocol; +import java.util.List; +import com.microsoft.azure.management.databoxedge.v2019_03_01.UserAccessRight; +import com.microsoft.azure.management.databoxedge.v2019_03_01.ClientAccessRight; +import com.microsoft.azure.management.databoxedge.v2019_03_01.RefreshDetails; +import com.microsoft.azure.management.databoxedge.v2019_03_01.MountPointMap; +import com.microsoft.azure.management.databoxedge.v2019_03_01.DataPolicy; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.management.databoxedge.v2019_03_01.ARMBaseModel; + +/** + * Represents a share on the Data Box Edge/Gateway device. + */ +@JsonFlatten +public class ShareInner extends ARMBaseModel { + /** + * Description for the share. + */ + @JsonProperty(value = "properties.description") + private String description; + + /** + * Current status of the share. Possible values include: 'Online', + * 'Offline'. + */ + @JsonProperty(value = "properties.shareStatus", required = true) + private ShareStatus shareStatus; + + /** + * Current monitoring status of the share. Possible values include: + * 'Enabled', 'Disabled'. + */ + @JsonProperty(value = "properties.monitoringStatus", required = true) + private MonitoringStatus monitoringStatus; + + /** + * Azure container mapping for the share. + */ + @JsonProperty(value = "properties.azureContainerInfo") + private AzureContainerInfo azureContainerInfo; + + /** + * Access protocol to be used by the share. Possible values include: 'SMB', + * 'NFS'. + */ + @JsonProperty(value = "properties.accessProtocol", required = true) + private ShareAccessProtocol accessProtocol; + + /** + * Mapping of users and corresponding access rights on the share (required + * for SMB protocol). + */ + @JsonProperty(value = "properties.userAccessRights") + private List userAccessRights; + + /** + * List of IP addresses and corresponding access rights on the + * share(required for NFS protocol). + */ + @JsonProperty(value = "properties.clientAccessRights") + private List clientAccessRights; + + /** + * Details of the refresh job on this share. + */ + @JsonProperty(value = "properties.refreshDetails") + private RefreshDetails refreshDetails; + + /** + * Share mount point to the role. + */ + @JsonProperty(value = "properties.shareMappings", access = JsonProperty.Access.WRITE_ONLY) + private List shareMappings; + + /** + * Data policy of the share. Possible values include: 'Cloud', 'Local'. + */ + @JsonProperty(value = "properties.dataPolicy") + private DataPolicy dataPolicy; + + /** + * Get description for the share. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set description for the share. + * + * @param description the description value to set + * @return the ShareInner object itself. + */ + public ShareInner withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get current status of the share. Possible values include: 'Online', 'Offline'. + * + * @return the shareStatus value + */ + public ShareStatus shareStatus() { + return this.shareStatus; + } + + /** + * Set current status of the share. Possible values include: 'Online', 'Offline'. + * + * @param shareStatus the shareStatus value to set + * @return the ShareInner object itself. + */ + public ShareInner withShareStatus(ShareStatus shareStatus) { + this.shareStatus = shareStatus; + return this; + } + + /** + * Get current monitoring status of the share. Possible values include: 'Enabled', 'Disabled'. + * + * @return the monitoringStatus value + */ + public MonitoringStatus monitoringStatus() { + return this.monitoringStatus; + } + + /** + * Set current monitoring status of the share. Possible values include: 'Enabled', 'Disabled'. + * + * @param monitoringStatus the monitoringStatus value to set + * @return the ShareInner object itself. + */ + public ShareInner withMonitoringStatus(MonitoringStatus monitoringStatus) { + this.monitoringStatus = monitoringStatus; + return this; + } + + /** + * Get azure container mapping for the share. + * + * @return the azureContainerInfo value + */ + public AzureContainerInfo azureContainerInfo() { + return this.azureContainerInfo; + } + + /** + * Set azure container mapping for the share. + * + * @param azureContainerInfo the azureContainerInfo value to set + * @return the ShareInner object itself. + */ + public ShareInner withAzureContainerInfo(AzureContainerInfo azureContainerInfo) { + this.azureContainerInfo = azureContainerInfo; + return this; + } + + /** + * Get access protocol to be used by the share. Possible values include: 'SMB', 'NFS'. + * + * @return the accessProtocol value + */ + public ShareAccessProtocol accessProtocol() { + return this.accessProtocol; + } + + /** + * Set access protocol to be used by the share. Possible values include: 'SMB', 'NFS'. + * + * @param accessProtocol the accessProtocol value to set + * @return the ShareInner object itself. + */ + public ShareInner withAccessProtocol(ShareAccessProtocol accessProtocol) { + this.accessProtocol = accessProtocol; + return this; + } + + /** + * Get mapping of users and corresponding access rights on the share (required for SMB protocol). + * + * @return the userAccessRights value + */ + public List userAccessRights() { + return this.userAccessRights; + } + + /** + * Set mapping of users and corresponding access rights on the share (required for SMB protocol). + * + * @param userAccessRights the userAccessRights value to set + * @return the ShareInner object itself. + */ + public ShareInner withUserAccessRights(List userAccessRights) { + this.userAccessRights = userAccessRights; + return this; + } + + /** + * Get list of IP addresses and corresponding access rights on the share(required for NFS protocol). + * + * @return the clientAccessRights value + */ + public List clientAccessRights() { + return this.clientAccessRights; + } + + /** + * Set list of IP addresses and corresponding access rights on the share(required for NFS protocol). + * + * @param clientAccessRights the clientAccessRights value to set + * @return the ShareInner object itself. + */ + public ShareInner withClientAccessRights(List clientAccessRights) { + this.clientAccessRights = clientAccessRights; + return this; + } + + /** + * Get details of the refresh job on this share. + * + * @return the refreshDetails value + */ + public RefreshDetails refreshDetails() { + return this.refreshDetails; + } + + /** + * Set details of the refresh job on this share. + * + * @param refreshDetails the refreshDetails value to set + * @return the ShareInner object itself. + */ + public ShareInner withRefreshDetails(RefreshDetails refreshDetails) { + this.refreshDetails = refreshDetails; + return this; + } + + /** + * Get share mount point to the role. + * + * @return the shareMappings value + */ + public List shareMappings() { + return this.shareMappings; + } + + /** + * Get data policy of the share. Possible values include: 'Cloud', 'Local'. + * + * @return the dataPolicy value + */ + public DataPolicy dataPolicy() { + return this.dataPolicy; + } + + /** + * Set data policy of the share. Possible values include: 'Cloud', 'Local'. + * + * @param dataPolicy the dataPolicy value to set + * @return the ShareInner object itself. + */ + public ShareInner withDataPolicy(DataPolicy dataPolicy) { + this.dataPolicy = dataPolicy; + return this; + } + +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/SharesImpl.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/SharesImpl.java new file mode 100644 index 0000000000000..1d46b8004d2b8 --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/SharesImpl.java @@ -0,0 +1,91 @@ +/** + * 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. + * + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.databoxedge.v2019_03_01.Shares; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.databoxedge.v2019_03_01.Share; + +class SharesImpl extends WrapperImpl implements Shares { + private final DataBoxEdgeManager manager; + + SharesImpl(DataBoxEdgeManager manager) { + super(manager.inner().shares()); + this.manager = manager; + } + + public DataBoxEdgeManager manager() { + return this.manager; + } + + @Override + public ShareImpl define(String name) { + return wrapModel(name); + } + + private ShareImpl wrapModel(ShareInner inner) { + return new ShareImpl(inner, manager()); + } + + private ShareImpl wrapModel(String name) { + return new ShareImpl(name, this.manager()); + } + + @Override + public Completable refreshAsync(String deviceName, String name, String resourceGroupName) { + SharesInner client = this.inner(); + return client.refreshAsync(deviceName, name, resourceGroupName).toCompletable(); + } + + @Override + public Observable listByDataBoxEdgeDeviceAsync(final String deviceName, final String resourceGroupName) { + SharesInner client = this.inner(); + return client.listByDataBoxEdgeDeviceAsync(deviceName, resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Share call(ShareInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String deviceName, String name, String resourceGroupName) { + SharesInner client = this.inner(); + return client.getAsync(deviceName, name, resourceGroupName) + .flatMap(new Func1>() { + @Override + public Observable call(ShareInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((Share)wrapModel(inner)); + } + } + }); + } + + @Override + public Completable deleteAsync(String deviceName, String name, String resourceGroupName) { + SharesInner client = this.inner(); + return client.deleteAsync(deviceName, name, resourceGroupName).toCompletable(); + } + +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/SharesInner.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/SharesInner.java new file mode 100644 index 0000000000000..4a1cadae38720 --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/SharesInner.java @@ -0,0 +1,953 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Shares. + */ +public class SharesInner { + /** The Retrofit service to perform REST calls. */ + private SharesService service; + /** The service client containing this operation class. */ + private DataBoxEdgeManagementClientImpl client; + + /** + * Initializes an instance of SharesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public SharesInner(Retrofit retrofit, DataBoxEdgeManagementClientImpl client) { + this.service = retrofit.create(SharesService.class); + this.client = client; + } + + /** + * The interface defining all the services for Shares to be + * used by Retrofit to perform actually REST calls. + */ + interface SharesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.databoxedge.v2019_03_01.Shares listByDataBoxEdgeDevice" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/shares") + Observable> listByDataBoxEdgeDevice(@Path("deviceName") String deviceName, @Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.databoxedge.v2019_03_01.Shares get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/shares/{name}") + Observable> get(@Path("deviceName") String deviceName, @Path("name") String name, @Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.databoxedge.v2019_03_01.Shares createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/shares/{name}") + Observable> createOrUpdate(@Path("deviceName") String deviceName, @Path("name") String name, @Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Body ShareInner share, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.databoxedge.v2019_03_01.Shares beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/shares/{name}") + Observable> beginCreateOrUpdate(@Path("deviceName") String deviceName, @Path("name") String name, @Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Body ShareInner share, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.databoxedge.v2019_03_01.Shares delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/shares/{name}", method = "DELETE", hasBody = true) + Observable> delete(@Path("deviceName") String deviceName, @Path("name") String name, @Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.databoxedge.v2019_03_01.Shares beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/shares/{name}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("deviceName") String deviceName, @Path("name") String name, @Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.databoxedge.v2019_03_01.Shares refresh" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/shares/{name}/refresh") + Observable> refresh(@Path("deviceName") String deviceName, @Path("name") String name, @Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.databoxedge.v2019_03_01.Shares beginRefresh" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/shares/{name}/refresh") + Observable> beginRefresh(@Path("deviceName") String deviceName, @Path("name") String name, @Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.databoxedge.v2019_03_01.Shares listByDataBoxEdgeDeviceNext" }) + @GET + Observable> listByDataBoxEdgeDeviceNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists all the shares in a data box edge/gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ShareInner> object if successful. + */ + public PagedList listByDataBoxEdgeDevice(final String deviceName, final String resourceGroupName) { + ServiceResponse> response = listByDataBoxEdgeDeviceSinglePageAsync(deviceName, resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByDataBoxEdgeDeviceNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the shares in a data box edge/gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByDataBoxEdgeDeviceAsync(final String deviceName, final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByDataBoxEdgeDeviceSinglePageAsync(deviceName, resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByDataBoxEdgeDeviceNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the shares in a data box edge/gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ShareInner> object + */ + public Observable> listByDataBoxEdgeDeviceAsync(final String deviceName, final String resourceGroupName) { + return listByDataBoxEdgeDeviceWithServiceResponseAsync(deviceName, resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the shares in a data box edge/gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ShareInner> object + */ + public Observable>> listByDataBoxEdgeDeviceWithServiceResponseAsync(final String deviceName, final String resourceGroupName) { + return listByDataBoxEdgeDeviceSinglePageAsync(deviceName, resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByDataBoxEdgeDeviceNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the shares in a data box edge/gateway device. + * + ServiceResponse> * @param deviceName The device name. + ServiceResponse> * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ShareInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByDataBoxEdgeDeviceSinglePageAsync(final String deviceName, final String resourceGroupName) { + if (deviceName == null) { + throw new IllegalArgumentException("Parameter deviceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByDataBoxEdgeDevice(deviceName, this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByDataBoxEdgeDeviceDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByDataBoxEdgeDeviceDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets a share by name. + * + * @param deviceName The device name. + * @param name The share name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ShareInner object if successful. + */ + public ShareInner get(String deviceName, String name, String resourceGroupName) { + return getWithServiceResponseAsync(deviceName, name, resourceGroupName).toBlocking().single().body(); + } + + /** + * Gets a share by name. + * + * @param deviceName The device name. + * @param name The share name. + * @param resourceGroupName The resource group name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String deviceName, String name, String resourceGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(deviceName, name, resourceGroupName), serviceCallback); + } + + /** + * Gets a share by name. + * + * @param deviceName The device name. + * @param name The share name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ShareInner object + */ + public Observable getAsync(String deviceName, String name, String resourceGroupName) { + return getWithServiceResponseAsync(deviceName, name, resourceGroupName).map(new Func1, ShareInner>() { + @Override + public ShareInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets a share by name. + * + * @param deviceName The device name. + * @param name The share name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ShareInner object + */ + public Observable> getWithServiceResponseAsync(String deviceName, String name, String resourceGroupName) { + if (deviceName == null) { + throw new IllegalArgumentException("Parameter deviceName is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(deviceName, name, this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates a new share or updates an existing share on the device. + * + * @param deviceName The device name. + * @param name The share name. + * @param resourceGroupName The resource group name. + * @param share The share properties. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ShareInner object if successful. + */ + public ShareInner createOrUpdate(String deviceName, String name, String resourceGroupName, ShareInner share) { + return createOrUpdateWithServiceResponseAsync(deviceName, name, resourceGroupName, share).toBlocking().last().body(); + } + + /** + * Creates a new share or updates an existing share on the device. + * + * @param deviceName The device name. + * @param name The share name. + * @param resourceGroupName The resource group name. + * @param share The share properties. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String deviceName, String name, String resourceGroupName, ShareInner share, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(deviceName, name, resourceGroupName, share), serviceCallback); + } + + /** + * Creates a new share or updates an existing share on the device. + * + * @param deviceName The device name. + * @param name The share name. + * @param resourceGroupName The resource group name. + * @param share The share properties. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String deviceName, String name, String resourceGroupName, ShareInner share) { + return createOrUpdateWithServiceResponseAsync(deviceName, name, resourceGroupName, share).map(new Func1, ShareInner>() { + @Override + public ShareInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a new share or updates an existing share on the device. + * + * @param deviceName The device name. + * @param name The share name. + * @param resourceGroupName The resource group name. + * @param share The share properties. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String deviceName, String name, String resourceGroupName, ShareInner share) { + if (deviceName == null) { + throw new IllegalArgumentException("Parameter deviceName is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (share == null) { + throw new IllegalArgumentException("Parameter share is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(share); + Observable> observable = service.createOrUpdate(deviceName, name, this.client.subscriptionId(), resourceGroupName, share, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates a new share or updates an existing share on the device. + * + * @param deviceName The device name. + * @param name The share name. + * @param resourceGroupName The resource group name. + * @param share The share properties. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ShareInner object if successful. + */ + public ShareInner beginCreateOrUpdate(String deviceName, String name, String resourceGroupName, ShareInner share) { + return beginCreateOrUpdateWithServiceResponseAsync(deviceName, name, resourceGroupName, share).toBlocking().single().body(); + } + + /** + * Creates a new share or updates an existing share on the device. + * + * @param deviceName The device name. + * @param name The share name. + * @param resourceGroupName The resource group name. + * @param share The share properties. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String deviceName, String name, String resourceGroupName, ShareInner share, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(deviceName, name, resourceGroupName, share), serviceCallback); + } + + /** + * Creates a new share or updates an existing share on the device. + * + * @param deviceName The device name. + * @param name The share name. + * @param resourceGroupName The resource group name. + * @param share The share properties. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ShareInner object + */ + public Observable beginCreateOrUpdateAsync(String deviceName, String name, String resourceGroupName, ShareInner share) { + return beginCreateOrUpdateWithServiceResponseAsync(deviceName, name, resourceGroupName, share).map(new Func1, ShareInner>() { + @Override + public ShareInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a new share or updates an existing share on the device. + * + * @param deviceName The device name. + * @param name The share name. + * @param resourceGroupName The resource group name. + * @param share The share properties. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ShareInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String deviceName, String name, String resourceGroupName, ShareInner share) { + if (deviceName == null) { + throw new IllegalArgumentException("Parameter deviceName is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (share == null) { + throw new IllegalArgumentException("Parameter share is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(share); + return service.beginCreateOrUpdate(deviceName, name, this.client.subscriptionId(), resourceGroupName, share, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes the share on the data box edge/gateway device. + * + * @param deviceName The device name. + * @param name The share name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String deviceName, String name, String resourceGroupName) { + deleteWithServiceResponseAsync(deviceName, name, resourceGroupName).toBlocking().last().body(); + } + + /** + * Deletes the share on the data box edge/gateway device. + * + * @param deviceName The device name. + * @param name The share name. + * @param resourceGroupName The resource group name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String deviceName, String name, String resourceGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(deviceName, name, resourceGroupName), serviceCallback); + } + + /** + * Deletes the share on the data box edge/gateway device. + * + * @param deviceName The device name. + * @param name The share name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String deviceName, String name, String resourceGroupName) { + return deleteWithServiceResponseAsync(deviceName, name, resourceGroupName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the share on the data box edge/gateway device. + * + * @param deviceName The device name. + * @param name The share name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String deviceName, String name, String resourceGroupName) { + if (deviceName == null) { + throw new IllegalArgumentException("Parameter deviceName is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.delete(deviceName, name, this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the share on the data box edge/gateway device. + * + * @param deviceName The device name. + * @param name The share name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String deviceName, String name, String resourceGroupName) { + beginDeleteWithServiceResponseAsync(deviceName, name, resourceGroupName).toBlocking().single().body(); + } + + /** + * Deletes the share on the data box edge/gateway device. + * + * @param deviceName The device name. + * @param name The share name. + * @param resourceGroupName The resource group name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String deviceName, String name, String resourceGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(deviceName, name, resourceGroupName), serviceCallback); + } + + /** + * Deletes the share on the data box edge/gateway device. + * + * @param deviceName The device name. + * @param name The share name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String deviceName, String name, String resourceGroupName) { + return beginDeleteWithServiceResponseAsync(deviceName, name, resourceGroupName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the share on the data box edge/gateway device. + * + * @param deviceName The device name. + * @param name The share name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String deviceName, String name, String resourceGroupName) { + if (deviceName == null) { + throw new IllegalArgumentException("Parameter deviceName is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDelete(deviceName, name, this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Refreshes the share metadata with the data from the cloud. + * + * @param deviceName The device name. + * @param name The share name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void refresh(String deviceName, String name, String resourceGroupName) { + refreshWithServiceResponseAsync(deviceName, name, resourceGroupName).toBlocking().last().body(); + } + + /** + * Refreshes the share metadata with the data from the cloud. + * + * @param deviceName The device name. + * @param name The share name. + * @param resourceGroupName The resource group name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture refreshAsync(String deviceName, String name, String resourceGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(refreshWithServiceResponseAsync(deviceName, name, resourceGroupName), serviceCallback); + } + + /** + * Refreshes the share metadata with the data from the cloud. + * + * @param deviceName The device name. + * @param name The share name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable refreshAsync(String deviceName, String name, String resourceGroupName) { + return refreshWithServiceResponseAsync(deviceName, name, resourceGroupName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Refreshes the share metadata with the data from the cloud. + * + * @param deviceName The device name. + * @param name The share name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> refreshWithServiceResponseAsync(String deviceName, String name, String resourceGroupName) { + if (deviceName == null) { + throw new IllegalArgumentException("Parameter deviceName is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.refresh(deviceName, name, this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Refreshes the share metadata with the data from the cloud. + * + * @param deviceName The device name. + * @param name The share name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginRefresh(String deviceName, String name, String resourceGroupName) { + beginRefreshWithServiceResponseAsync(deviceName, name, resourceGroupName).toBlocking().single().body(); + } + + /** + * Refreshes the share metadata with the data from the cloud. + * + * @param deviceName The device name. + * @param name The share name. + * @param resourceGroupName The resource group name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginRefreshAsync(String deviceName, String name, String resourceGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginRefreshWithServiceResponseAsync(deviceName, name, resourceGroupName), serviceCallback); + } + + /** + * Refreshes the share metadata with the data from the cloud. + * + * @param deviceName The device name. + * @param name The share name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginRefreshAsync(String deviceName, String name, String resourceGroupName) { + return beginRefreshWithServiceResponseAsync(deviceName, name, resourceGroupName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Refreshes the share metadata with the data from the cloud. + * + * @param deviceName The device name. + * @param name The share name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginRefreshWithServiceResponseAsync(String deviceName, String name, String resourceGroupName) { + if (deviceName == null) { + throw new IllegalArgumentException("Parameter deviceName is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginRefresh(deviceName, name, this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginRefreshDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginRefreshDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all the shares in a data box edge/gateway device. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ShareInner> object if successful. + */ + public PagedList listByDataBoxEdgeDeviceNext(final String nextPageLink) { + ServiceResponse> response = listByDataBoxEdgeDeviceNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByDataBoxEdgeDeviceNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the shares in a data box edge/gateway device. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByDataBoxEdgeDeviceNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByDataBoxEdgeDeviceNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByDataBoxEdgeDeviceNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the shares in a data box edge/gateway device. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ShareInner> object + */ + public Observable> listByDataBoxEdgeDeviceNextAsync(final String nextPageLink) { + return listByDataBoxEdgeDeviceNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the shares in a data box edge/gateway device. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ShareInner> object + */ + public Observable>> listByDataBoxEdgeDeviceNextWithServiceResponseAsync(final String nextPageLink) { + return listByDataBoxEdgeDeviceNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByDataBoxEdgeDeviceNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the shares in a data box edge/gateway device. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ShareInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByDataBoxEdgeDeviceNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByDataBoxEdgeDeviceNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByDataBoxEdgeDeviceNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByDataBoxEdgeDeviceNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/StorageAccountCredentialImpl.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/StorageAccountCredentialImpl.java new file mode 100644 index 0000000000000..6ff1767700860 --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/StorageAccountCredentialImpl.java @@ -0,0 +1,174 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01.implementation; + +import com.microsoft.azure.management.databoxedge.v2019_03_01.StorageAccountCredential; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.databoxedge.v2019_03_01.AsymmetricEncryptedSecret; +import com.microsoft.azure.management.databoxedge.v2019_03_01.SSLStatus; +import com.microsoft.azure.management.databoxedge.v2019_03_01.AccountType; + +class StorageAccountCredentialImpl extends CreatableUpdatableImpl implements StorageAccountCredential, StorageAccountCredential.Definition, StorageAccountCredential.Update { + private final DataBoxEdgeManager manager; + private String deviceName; + private String name; + private String resourceGroupName; + + StorageAccountCredentialImpl(String name, DataBoxEdgeManager manager) { + super(name, new StorageAccountCredentialInner()); + this.manager = manager; + // Set resource name + this.name = name; + // + } + + StorageAccountCredentialImpl(StorageAccountCredentialInner inner, DataBoxEdgeManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.name = inner.name(); + // set resource ancestor and positional variables + this.deviceName = IdParsingUtils.getValueFromIdByName(inner.id(), "dataBoxEdgeDevices"); + this.name = IdParsingUtils.getValueFromIdByName(inner.id(), "storageAccountCredentials"); + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + // + } + + @Override + public DataBoxEdgeManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + StorageAccountCredentialsInner client = this.manager().inner().storageAccountCredentials(); + return client.createOrUpdateAsync(this.deviceName, this.name, this.resourceGroupName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + StorageAccountCredentialsInner client = this.manager().inner().storageAccountCredentials(); + return client.createOrUpdateAsync(this.deviceName, this.name, this.resourceGroupName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + StorageAccountCredentialsInner client = this.manager().inner().storageAccountCredentials(); + return client.getAsync(this.deviceName, this.name, this.resourceGroupName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public AsymmetricEncryptedSecret accountKey() { + return this.inner().accountKey(); + } + + @Override + public AccountType accountType() { + return this.inner().accountType(); + } + + @Override + public String alias() { + return this.inner().alias(); + } + + @Override + public String blobDomainName() { + return this.inner().blobDomainName(); + } + + @Override + public String connectionString() { + return this.inner().connectionString(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public SSLStatus sslStatus() { + return this.inner().sslStatus(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public String userName() { + return this.inner().userName(); + } + + @Override + public StorageAccountCredentialImpl withExistingDataBoxEdgeDevice(String deviceName, String resourceGroupName) { + this.deviceName = deviceName; + this.resourceGroupName = resourceGroupName; + return this; + } + + @Override + public StorageAccountCredentialImpl withAccountType(AccountType accountType) { + this.inner().withAccountType(accountType); + return this; + } + + @Override + public StorageAccountCredentialImpl withAlias(String alias) { + this.inner().withAlias(alias); + return this; + } + + @Override + public StorageAccountCredentialImpl withSslStatus(SSLStatus sslStatus) { + this.inner().withSslStatus(sslStatus); + return this; + } + + @Override + public StorageAccountCredentialImpl withAccountKey(AsymmetricEncryptedSecret accountKey) { + this.inner().withAccountKey(accountKey); + return this; + } + + @Override + public StorageAccountCredentialImpl withBlobDomainName(String blobDomainName) { + this.inner().withBlobDomainName(blobDomainName); + return this; + } + + @Override + public StorageAccountCredentialImpl withConnectionString(String connectionString) { + this.inner().withConnectionString(connectionString); + return this; + } + + @Override + public StorageAccountCredentialImpl withUserName(String userName) { + this.inner().withUserName(userName); + return this; + } + +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/StorageAccountCredentialInner.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/StorageAccountCredentialInner.java new file mode 100644 index 0000000000000..ab03510ecd1a1 --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/StorageAccountCredentialInner.java @@ -0,0 +1,208 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01.implementation; + +import com.microsoft.azure.management.databoxedge.v2019_03_01.AsymmetricEncryptedSecret; +import com.microsoft.azure.management.databoxedge.v2019_03_01.SSLStatus; +import com.microsoft.azure.management.databoxedge.v2019_03_01.AccountType; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.management.databoxedge.v2019_03_01.ARMBaseModel; + +/** + * The storage account credential. + */ +@JsonFlatten +public class StorageAccountCredentialInner extends ARMBaseModel { + /** + * Alias for the storage account. + */ + @JsonProperty(value = "properties.alias", required = true) + private String alias; + + /** + * Username for the storage account. + */ + @JsonProperty(value = "properties.userName") + private String userName; + + /** + * Encrypted storage key. + */ + @JsonProperty(value = "properties.accountKey") + private AsymmetricEncryptedSecret accountKey; + + /** + * Connection string for the storage account. Use this string if username + * and account key are not specified. + */ + @JsonProperty(value = "properties.connectionString") + private String connectionString; + + /** + * Signifies whether SSL needs to be enabled or not. Possible values + * include: 'Enabled', 'Disabled'. + */ + @JsonProperty(value = "properties.sslStatus", required = true) + private SSLStatus sslStatus; + + /** + * Blob end point for private clouds. + */ + @JsonProperty(value = "properties.blobDomainName") + private String blobDomainName; + + /** + * Type of storage accessed on the storage account. Possible values + * include: 'GeneralPurposeStorage', 'BlobStorage'. + */ + @JsonProperty(value = "properties.accountType", required = true) + private AccountType accountType; + + /** + * Get alias for the storage account. + * + * @return the alias value + */ + public String alias() { + return this.alias; + } + + /** + * Set alias for the storage account. + * + * @param alias the alias value to set + * @return the StorageAccountCredentialInner object itself. + */ + public StorageAccountCredentialInner withAlias(String alias) { + this.alias = alias; + return this; + } + + /** + * Get username for the storage account. + * + * @return the userName value + */ + public String userName() { + return this.userName; + } + + /** + * Set username for the storage account. + * + * @param userName the userName value to set + * @return the StorageAccountCredentialInner object itself. + */ + public StorageAccountCredentialInner withUserName(String userName) { + this.userName = userName; + return this; + } + + /** + * Get encrypted storage key. + * + * @return the accountKey value + */ + public AsymmetricEncryptedSecret accountKey() { + return this.accountKey; + } + + /** + * Set encrypted storage key. + * + * @param accountKey the accountKey value to set + * @return the StorageAccountCredentialInner object itself. + */ + public StorageAccountCredentialInner withAccountKey(AsymmetricEncryptedSecret accountKey) { + this.accountKey = accountKey; + return this; + } + + /** + * Get connection string for the storage account. Use this string if username and account key are not specified. + * + * @return the connectionString value + */ + public String connectionString() { + return this.connectionString; + } + + /** + * Set connection string for the storage account. Use this string if username and account key are not specified. + * + * @param connectionString the connectionString value to set + * @return the StorageAccountCredentialInner object itself. + */ + public StorageAccountCredentialInner withConnectionString(String connectionString) { + this.connectionString = connectionString; + return this; + } + + /** + * Get signifies whether SSL needs to be enabled or not. Possible values include: 'Enabled', 'Disabled'. + * + * @return the sslStatus value + */ + public SSLStatus sslStatus() { + return this.sslStatus; + } + + /** + * Set signifies whether SSL needs to be enabled or not. Possible values include: 'Enabled', 'Disabled'. + * + * @param sslStatus the sslStatus value to set + * @return the StorageAccountCredentialInner object itself. + */ + public StorageAccountCredentialInner withSslStatus(SSLStatus sslStatus) { + this.sslStatus = sslStatus; + return this; + } + + /** + * Get blob end point for private clouds. + * + * @return the blobDomainName value + */ + public String blobDomainName() { + return this.blobDomainName; + } + + /** + * Set blob end point for private clouds. + * + * @param blobDomainName the blobDomainName value to set + * @return the StorageAccountCredentialInner object itself. + */ + public StorageAccountCredentialInner withBlobDomainName(String blobDomainName) { + this.blobDomainName = blobDomainName; + return this; + } + + /** + * Get type of storage accessed on the storage account. Possible values include: 'GeneralPurposeStorage', 'BlobStorage'. + * + * @return the accountType value + */ + public AccountType accountType() { + return this.accountType; + } + + /** + * Set type of storage accessed on the storage account. Possible values include: 'GeneralPurposeStorage', 'BlobStorage'. + * + * @param accountType the accountType value to set + * @return the StorageAccountCredentialInner object itself. + */ + public StorageAccountCredentialInner withAccountType(AccountType accountType) { + this.accountType = accountType; + return this; + } + +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/StorageAccountCredentialsImpl.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/StorageAccountCredentialsImpl.java new file mode 100644 index 0000000000000..cce39b0d2213a --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/StorageAccountCredentialsImpl.java @@ -0,0 +1,85 @@ +/** + * 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. + * + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.databoxedge.v2019_03_01.StorageAccountCredentials; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.databoxedge.v2019_03_01.StorageAccountCredential; + +class StorageAccountCredentialsImpl extends WrapperImpl implements StorageAccountCredentials { + private final DataBoxEdgeManager manager; + + StorageAccountCredentialsImpl(DataBoxEdgeManager manager) { + super(manager.inner().storageAccountCredentials()); + this.manager = manager; + } + + public DataBoxEdgeManager manager() { + return this.manager; + } + + @Override + public StorageAccountCredentialImpl define(String name) { + return wrapModel(name); + } + + private StorageAccountCredentialImpl wrapModel(StorageAccountCredentialInner inner) { + return new StorageAccountCredentialImpl(inner, manager()); + } + + private StorageAccountCredentialImpl wrapModel(String name) { + return new StorageAccountCredentialImpl(name, this.manager()); + } + + @Override + public Observable listByDataBoxEdgeDeviceAsync(final String deviceName, final String resourceGroupName) { + StorageAccountCredentialsInner client = this.inner(); + return client.listByDataBoxEdgeDeviceAsync(deviceName, resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public StorageAccountCredential call(StorageAccountCredentialInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String deviceName, String name, String resourceGroupName) { + StorageAccountCredentialsInner client = this.inner(); + return client.getAsync(deviceName, name, resourceGroupName) + .flatMap(new Func1>() { + @Override + public Observable call(StorageAccountCredentialInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((StorageAccountCredential)wrapModel(inner)); + } + } + }); + } + + @Override + public Completable deleteAsync(String deviceName, String name, String resourceGroupName) { + StorageAccountCredentialsInner client = this.inner(); + return client.deleteAsync(deviceName, name, resourceGroupName).toCompletable(); + } + +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/StorageAccountCredentialsInner.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/StorageAccountCredentialsInner.java new file mode 100644 index 0000000000000..1fa1fad058e0f --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/StorageAccountCredentialsInner.java @@ -0,0 +1,776 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in StorageAccountCredentials. + */ +public class StorageAccountCredentialsInner { + /** The Retrofit service to perform REST calls. */ + private StorageAccountCredentialsService service; + /** The service client containing this operation class. */ + private DataBoxEdgeManagementClientImpl client; + + /** + * Initializes an instance of StorageAccountCredentialsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public StorageAccountCredentialsInner(Retrofit retrofit, DataBoxEdgeManagementClientImpl client) { + this.service = retrofit.create(StorageAccountCredentialsService.class); + this.client = client; + } + + /** + * The interface defining all the services for StorageAccountCredentials to be + * used by Retrofit to perform actually REST calls. + */ + interface StorageAccountCredentialsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.databoxedge.v2019_03_01.StorageAccountCredentials listByDataBoxEdgeDevice" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccountCredentials") + Observable> listByDataBoxEdgeDevice(@Path("deviceName") String deviceName, @Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.databoxedge.v2019_03_01.StorageAccountCredentials get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccountCredentials/{name}") + Observable> get(@Path("deviceName") String deviceName, @Path("name") String name, @Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.databoxedge.v2019_03_01.StorageAccountCredentials createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccountCredentials/{name}") + Observable> createOrUpdate(@Path("deviceName") String deviceName, @Path("name") String name, @Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Body StorageAccountCredentialInner storageAccountCredential, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.databoxedge.v2019_03_01.StorageAccountCredentials beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccountCredentials/{name}") + Observable> beginCreateOrUpdate(@Path("deviceName") String deviceName, @Path("name") String name, @Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Body StorageAccountCredentialInner storageAccountCredential, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.databoxedge.v2019_03_01.StorageAccountCredentials delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccountCredentials/{name}", method = "DELETE", hasBody = true) + Observable> delete(@Path("deviceName") String deviceName, @Path("name") String name, @Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.databoxedge.v2019_03_01.StorageAccountCredentials beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccountCredentials/{name}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("deviceName") String deviceName, @Path("name") String name, @Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.databoxedge.v2019_03_01.StorageAccountCredentials listByDataBoxEdgeDeviceNext" }) + @GET + Observable> listByDataBoxEdgeDeviceNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets all the storage account credentials in a data box edge/gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<StorageAccountCredentialInner> object if successful. + */ + public PagedList listByDataBoxEdgeDevice(final String deviceName, final String resourceGroupName) { + ServiceResponse> response = listByDataBoxEdgeDeviceSinglePageAsync(deviceName, resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByDataBoxEdgeDeviceNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the storage account credentials in a data box edge/gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByDataBoxEdgeDeviceAsync(final String deviceName, final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByDataBoxEdgeDeviceSinglePageAsync(deviceName, resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByDataBoxEdgeDeviceNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the storage account credentials in a data box edge/gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<StorageAccountCredentialInner> object + */ + public Observable> listByDataBoxEdgeDeviceAsync(final String deviceName, final String resourceGroupName) { + return listByDataBoxEdgeDeviceWithServiceResponseAsync(deviceName, resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the storage account credentials in a data box edge/gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<StorageAccountCredentialInner> object + */ + public Observable>> listByDataBoxEdgeDeviceWithServiceResponseAsync(final String deviceName, final String resourceGroupName) { + return listByDataBoxEdgeDeviceSinglePageAsync(deviceName, resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByDataBoxEdgeDeviceNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the storage account credentials in a data box edge/gateway device. + * + ServiceResponse> * @param deviceName The device name. + ServiceResponse> * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<StorageAccountCredentialInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByDataBoxEdgeDeviceSinglePageAsync(final String deviceName, final String resourceGroupName) { + if (deviceName == null) { + throw new IllegalArgumentException("Parameter deviceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByDataBoxEdgeDevice(deviceName, this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByDataBoxEdgeDeviceDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByDataBoxEdgeDeviceDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the properties of the specified storage account credential. + * + * @param deviceName The device name. + * @param name The storage account credential name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the StorageAccountCredentialInner object if successful. + */ + public StorageAccountCredentialInner get(String deviceName, String name, String resourceGroupName) { + return getWithServiceResponseAsync(deviceName, name, resourceGroupName).toBlocking().single().body(); + } + + /** + * Gets the properties of the specified storage account credential. + * + * @param deviceName The device name. + * @param name The storage account credential name. + * @param resourceGroupName The resource group name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String deviceName, String name, String resourceGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(deviceName, name, resourceGroupName), serviceCallback); + } + + /** + * Gets the properties of the specified storage account credential. + * + * @param deviceName The device name. + * @param name The storage account credential name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageAccountCredentialInner object + */ + public Observable getAsync(String deviceName, String name, String resourceGroupName) { + return getWithServiceResponseAsync(deviceName, name, resourceGroupName).map(new Func1, StorageAccountCredentialInner>() { + @Override + public StorageAccountCredentialInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the properties of the specified storage account credential. + * + * @param deviceName The device name. + * @param name The storage account credential name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageAccountCredentialInner object + */ + public Observable> getWithServiceResponseAsync(String deviceName, String name, String resourceGroupName) { + if (deviceName == null) { + throw new IllegalArgumentException("Parameter deviceName is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(deviceName, name, this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates or updates the storage account credential. + * + * @param deviceName The device name. + * @param name The storage account credential name. + * @param resourceGroupName The resource group name. + * @param storageAccountCredential The storage account credential. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the StorageAccountCredentialInner object if successful. + */ + public StorageAccountCredentialInner createOrUpdate(String deviceName, String name, String resourceGroupName, StorageAccountCredentialInner storageAccountCredential) { + return createOrUpdateWithServiceResponseAsync(deviceName, name, resourceGroupName, storageAccountCredential).toBlocking().last().body(); + } + + /** + * Creates or updates the storage account credential. + * + * @param deviceName The device name. + * @param name The storage account credential name. + * @param resourceGroupName The resource group name. + * @param storageAccountCredential The storage account credential. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String deviceName, String name, String resourceGroupName, StorageAccountCredentialInner storageAccountCredential, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(deviceName, name, resourceGroupName, storageAccountCredential), serviceCallback); + } + + /** + * Creates or updates the storage account credential. + * + * @param deviceName The device name. + * @param name The storage account credential name. + * @param resourceGroupName The resource group name. + * @param storageAccountCredential The storage account credential. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String deviceName, String name, String resourceGroupName, StorageAccountCredentialInner storageAccountCredential) { + return createOrUpdateWithServiceResponseAsync(deviceName, name, resourceGroupName, storageAccountCredential).map(new Func1, StorageAccountCredentialInner>() { + @Override + public StorageAccountCredentialInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates the storage account credential. + * + * @param deviceName The device name. + * @param name The storage account credential name. + * @param resourceGroupName The resource group name. + * @param storageAccountCredential The storage account credential. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String deviceName, String name, String resourceGroupName, StorageAccountCredentialInner storageAccountCredential) { + if (deviceName == null) { + throw new IllegalArgumentException("Parameter deviceName is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (storageAccountCredential == null) { + throw new IllegalArgumentException("Parameter storageAccountCredential is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(storageAccountCredential); + Observable> observable = service.createOrUpdate(deviceName, name, this.client.subscriptionId(), resourceGroupName, storageAccountCredential, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates or updates the storage account credential. + * + * @param deviceName The device name. + * @param name The storage account credential name. + * @param resourceGroupName The resource group name. + * @param storageAccountCredential The storage account credential. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the StorageAccountCredentialInner object if successful. + */ + public StorageAccountCredentialInner beginCreateOrUpdate(String deviceName, String name, String resourceGroupName, StorageAccountCredentialInner storageAccountCredential) { + return beginCreateOrUpdateWithServiceResponseAsync(deviceName, name, resourceGroupName, storageAccountCredential).toBlocking().single().body(); + } + + /** + * Creates or updates the storage account credential. + * + * @param deviceName The device name. + * @param name The storage account credential name. + * @param resourceGroupName The resource group name. + * @param storageAccountCredential The storage account credential. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String deviceName, String name, String resourceGroupName, StorageAccountCredentialInner storageAccountCredential, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(deviceName, name, resourceGroupName, storageAccountCredential), serviceCallback); + } + + /** + * Creates or updates the storage account credential. + * + * @param deviceName The device name. + * @param name The storage account credential name. + * @param resourceGroupName The resource group name. + * @param storageAccountCredential The storage account credential. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageAccountCredentialInner object + */ + public Observable beginCreateOrUpdateAsync(String deviceName, String name, String resourceGroupName, StorageAccountCredentialInner storageAccountCredential) { + return beginCreateOrUpdateWithServiceResponseAsync(deviceName, name, resourceGroupName, storageAccountCredential).map(new Func1, StorageAccountCredentialInner>() { + @Override + public StorageAccountCredentialInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates the storage account credential. + * + * @param deviceName The device name. + * @param name The storage account credential name. + * @param resourceGroupName The resource group name. + * @param storageAccountCredential The storage account credential. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageAccountCredentialInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String deviceName, String name, String resourceGroupName, StorageAccountCredentialInner storageAccountCredential) { + if (deviceName == null) { + throw new IllegalArgumentException("Parameter deviceName is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (storageAccountCredential == null) { + throw new IllegalArgumentException("Parameter storageAccountCredential is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(storageAccountCredential); + return service.beginCreateOrUpdate(deviceName, name, this.client.subscriptionId(), resourceGroupName, storageAccountCredential, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes the storage account credential. + * + * @param deviceName The device name. + * @param name The storage account credential name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String deviceName, String name, String resourceGroupName) { + deleteWithServiceResponseAsync(deviceName, name, resourceGroupName).toBlocking().last().body(); + } + + /** + * Deletes the storage account credential. + * + * @param deviceName The device name. + * @param name The storage account credential name. + * @param resourceGroupName The resource group name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String deviceName, String name, String resourceGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(deviceName, name, resourceGroupName), serviceCallback); + } + + /** + * Deletes the storage account credential. + * + * @param deviceName The device name. + * @param name The storage account credential name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String deviceName, String name, String resourceGroupName) { + return deleteWithServiceResponseAsync(deviceName, name, resourceGroupName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the storage account credential. + * + * @param deviceName The device name. + * @param name The storage account credential name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String deviceName, String name, String resourceGroupName) { + if (deviceName == null) { + throw new IllegalArgumentException("Parameter deviceName is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.delete(deviceName, name, this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the storage account credential. + * + * @param deviceName The device name. + * @param name The storage account credential name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String deviceName, String name, String resourceGroupName) { + beginDeleteWithServiceResponseAsync(deviceName, name, resourceGroupName).toBlocking().single().body(); + } + + /** + * Deletes the storage account credential. + * + * @param deviceName The device name. + * @param name The storage account credential name. + * @param resourceGroupName The resource group name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String deviceName, String name, String resourceGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(deviceName, name, resourceGroupName), serviceCallback); + } + + /** + * Deletes the storage account credential. + * + * @param deviceName The device name. + * @param name The storage account credential name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String deviceName, String name, String resourceGroupName) { + return beginDeleteWithServiceResponseAsync(deviceName, name, resourceGroupName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the storage account credential. + * + * @param deviceName The device name. + * @param name The storage account credential name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String deviceName, String name, String resourceGroupName) { + if (deviceName == null) { + throw new IllegalArgumentException("Parameter deviceName is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDelete(deviceName, name, this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the storage account credentials in a data box edge/gateway device. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<StorageAccountCredentialInner> object if successful. + */ + public PagedList listByDataBoxEdgeDeviceNext(final String nextPageLink) { + ServiceResponse> response = listByDataBoxEdgeDeviceNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByDataBoxEdgeDeviceNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the storage account credentials in a data box edge/gateway device. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByDataBoxEdgeDeviceNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByDataBoxEdgeDeviceNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByDataBoxEdgeDeviceNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the storage account credentials in a data box edge/gateway device. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<StorageAccountCredentialInner> object + */ + public Observable> listByDataBoxEdgeDeviceNextAsync(final String nextPageLink) { + return listByDataBoxEdgeDeviceNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the storage account credentials in a data box edge/gateway device. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<StorageAccountCredentialInner> object + */ + public Observable>> listByDataBoxEdgeDeviceNextWithServiceResponseAsync(final String nextPageLink) { + return listByDataBoxEdgeDeviceNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByDataBoxEdgeDeviceNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the storage account credentials in a data box edge/gateway device. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<StorageAccountCredentialInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByDataBoxEdgeDeviceNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByDataBoxEdgeDeviceNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByDataBoxEdgeDeviceNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByDataBoxEdgeDeviceNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/TriggerImpl.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/TriggerImpl.java new file mode 100644 index 0000000000000..07329e0b8fef1 --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/TriggerImpl.java @@ -0,0 +1,94 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01.implementation; + +import com.microsoft.azure.management.databoxedge.v2019_03_01.Trigger; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; + +class TriggerImpl extends CreatableUpdatableImpl implements Trigger, Trigger.Definition, Trigger.Update { + private final DataBoxEdgeManager manager; + private String deviceName; + private String name; + private String resourceGroupName; + + TriggerImpl(String name, DataBoxEdgeManager manager) { + super(name, new TriggerInner()); + this.manager = manager; + // Set resource name + this.name = name; + // + } + + TriggerImpl(TriggerInner inner, DataBoxEdgeManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.name = inner.name(); + // set resource ancestor and positional variables + this.deviceName = IdParsingUtils.getValueFromIdByName(inner.id(), "dataBoxEdgeDevices"); + this.name = IdParsingUtils.getValueFromIdByName(inner.id(), "triggers"); + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + // + } + + @Override + public DataBoxEdgeManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + TriggersInner client = this.manager().inner().triggers(); + return client.createOrUpdateAsync(this.deviceName, this.name, this.resourceGroupName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + TriggersInner client = this.manager().inner().triggers(); + return client.createOrUpdateAsync(this.deviceName, this.name, this.resourceGroupName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + TriggersInner client = this.manager().inner().triggers(); + return client.getAsync(this.deviceName, this.name, this.resourceGroupName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public TriggerImpl withExistingDataBoxEdgeDevice(String deviceName, String resourceGroupName) { + this.deviceName = deviceName; + this.resourceGroupName = resourceGroupName; + return this; + } + +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/TriggerInner.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/TriggerInner.java new file mode 100644 index 0000000000000..7c25224e00040 --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/TriggerInner.java @@ -0,0 +1,26 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01.implementation; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.microsoft.azure.management.databoxedge.v2019_03_01.ARMBaseModel; + +/** + * Trigger details. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind", defaultImpl = TriggerInner.class) +@JsonTypeName("Trigger") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "FileEvent", value = FileEventTrigger.class), + @JsonSubTypes.Type(name = "PeriodicTimerEvent", value = PeriodicTimerEventTrigger.class) +}) +public class TriggerInner extends ARMBaseModel { +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/TriggersImpl.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/TriggersImpl.java new file mode 100644 index 0000000000000..1f9040abe11d9 --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/TriggersImpl.java @@ -0,0 +1,85 @@ +/** + * 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. + * + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.databoxedge.v2019_03_01.Triggers; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.databoxedge.v2019_03_01.Trigger; + +class TriggersImpl extends WrapperImpl implements Triggers { + private final DataBoxEdgeManager manager; + + TriggersImpl(DataBoxEdgeManager manager) { + super(manager.inner().triggers()); + this.manager = manager; + } + + public DataBoxEdgeManager manager() { + return this.manager; + } + + @Override + public TriggerImpl define(String name) { + return wrapModel(name); + } + + private TriggerImpl wrapModel(TriggerInner inner) { + return new TriggerImpl(inner, manager()); + } + + private TriggerImpl wrapModel(String name) { + return new TriggerImpl(name, this.manager()); + } + + @Override + public Observable listByDataBoxEdgeDeviceAsync(final String deviceName, final String resourceGroupName) { + TriggersInner client = this.inner(); + return client.listByDataBoxEdgeDeviceAsync(deviceName, resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Trigger call(TriggerInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String deviceName, String name, String resourceGroupName) { + TriggersInner client = this.inner(); + return client.getAsync(deviceName, name, resourceGroupName) + .flatMap(new Func1>() { + @Override + public Observable call(TriggerInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((Trigger)wrapModel(inner)); + } + } + }); + } + + @Override + public Completable deleteAsync(String deviceName, String name, String resourceGroupName) { + TriggersInner client = this.inner(); + return client.deleteAsync(deviceName, name, resourceGroupName).toCompletable(); + } + +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/TriggersInner.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/TriggersInner.java new file mode 100644 index 0000000000000..676f2156de03c --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/TriggersInner.java @@ -0,0 +1,898 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Triggers. + */ +public class TriggersInner { + /** The Retrofit service to perform REST calls. */ + private TriggersService service; + /** The service client containing this operation class. */ + private DataBoxEdgeManagementClientImpl client; + + /** + * Initializes an instance of TriggersInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public TriggersInner(Retrofit retrofit, DataBoxEdgeManagementClientImpl client) { + this.service = retrofit.create(TriggersService.class); + this.client = client; + } + + /** + * The interface defining all the services for Triggers to be + * used by Retrofit to perform actually REST calls. + */ + interface TriggersService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.databoxedge.v2019_03_01.Triggers listByDataBoxEdgeDevice" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/triggers") + Observable> listByDataBoxEdgeDevice(@Path("deviceName") String deviceName, @Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Query("$expand") String expand, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.databoxedge.v2019_03_01.Triggers get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/triggers/{name}") + Observable> get(@Path("deviceName") String deviceName, @Path("name") String name, @Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.databoxedge.v2019_03_01.Triggers createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/triggers/{name}") + Observable> createOrUpdate(@Path("deviceName") String deviceName, @Path("name") String name, @Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Body TriggerInner trigger, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.databoxedge.v2019_03_01.Triggers beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/triggers/{name}") + Observable> beginCreateOrUpdate(@Path("deviceName") String deviceName, @Path("name") String name, @Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Body TriggerInner trigger, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.databoxedge.v2019_03_01.Triggers delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/triggers/{name}", method = "DELETE", hasBody = true) + Observable> delete(@Path("deviceName") String deviceName, @Path("name") String name, @Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.databoxedge.v2019_03_01.Triggers beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/triggers/{name}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("deviceName") String deviceName, @Path("name") String name, @Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.databoxedge.v2019_03_01.Triggers listByDataBoxEdgeDeviceNext" }) + @GET + Observable> listByDataBoxEdgeDeviceNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists all the triggers configured in the device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<TriggerInner> object if successful. + */ + public PagedList listByDataBoxEdgeDevice(final String deviceName, final String resourceGroupName) { + ServiceResponse> response = listByDataBoxEdgeDeviceSinglePageAsync(deviceName, resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByDataBoxEdgeDeviceNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the triggers configured in the device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByDataBoxEdgeDeviceAsync(final String deviceName, final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByDataBoxEdgeDeviceSinglePageAsync(deviceName, resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByDataBoxEdgeDeviceNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the triggers configured in the device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<TriggerInner> object + */ + public Observable> listByDataBoxEdgeDeviceAsync(final String deviceName, final String resourceGroupName) { + return listByDataBoxEdgeDeviceWithServiceResponseAsync(deviceName, resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the triggers configured in the device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<TriggerInner> object + */ + public Observable>> listByDataBoxEdgeDeviceWithServiceResponseAsync(final String deviceName, final String resourceGroupName) { + return listByDataBoxEdgeDeviceSinglePageAsync(deviceName, resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByDataBoxEdgeDeviceNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the triggers configured in the device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<TriggerInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByDataBoxEdgeDeviceSinglePageAsync(final String deviceName, final String resourceGroupName) { + if (deviceName == null) { + throw new IllegalArgumentException("Parameter deviceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String expand = null; + return service.listByDataBoxEdgeDevice(deviceName, this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByDataBoxEdgeDeviceDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Lists all the triggers configured in the device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param expand Specify $filter='CustomContextTag eq <tag>' to filter on custom context tag property + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<TriggerInner> object if successful. + */ + public PagedList listByDataBoxEdgeDevice(final String deviceName, final String resourceGroupName, final String expand) { + ServiceResponse> response = listByDataBoxEdgeDeviceSinglePageAsync(deviceName, resourceGroupName, expand).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByDataBoxEdgeDeviceNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the triggers configured in the device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param expand Specify $filter='CustomContextTag eq <tag>' to filter on custom context tag property + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByDataBoxEdgeDeviceAsync(final String deviceName, final String resourceGroupName, final String expand, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByDataBoxEdgeDeviceSinglePageAsync(deviceName, resourceGroupName, expand), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByDataBoxEdgeDeviceNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the triggers configured in the device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param expand Specify $filter='CustomContextTag eq <tag>' to filter on custom context tag property + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<TriggerInner> object + */ + public Observable> listByDataBoxEdgeDeviceAsync(final String deviceName, final String resourceGroupName, final String expand) { + return listByDataBoxEdgeDeviceWithServiceResponseAsync(deviceName, resourceGroupName, expand) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the triggers configured in the device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param expand Specify $filter='CustomContextTag eq <tag>' to filter on custom context tag property + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<TriggerInner> object + */ + public Observable>> listByDataBoxEdgeDeviceWithServiceResponseAsync(final String deviceName, final String resourceGroupName, final String expand) { + return listByDataBoxEdgeDeviceSinglePageAsync(deviceName, resourceGroupName, expand) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByDataBoxEdgeDeviceNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the triggers configured in the device. + * + ServiceResponse> * @param deviceName The device name. + ServiceResponse> * @param resourceGroupName The resource group name. + ServiceResponse> * @param expand Specify $filter='CustomContextTag eq <tag>' to filter on custom context tag property + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<TriggerInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByDataBoxEdgeDeviceSinglePageAsync(final String deviceName, final String resourceGroupName, final String expand) { + if (deviceName == null) { + throw new IllegalArgumentException("Parameter deviceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByDataBoxEdgeDevice(deviceName, this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByDataBoxEdgeDeviceDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByDataBoxEdgeDeviceDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get a specific trigger by name. + * + * @param deviceName The device name. + * @param name The trigger name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the TriggerInner object if successful. + */ + public TriggerInner get(String deviceName, String name, String resourceGroupName) { + return getWithServiceResponseAsync(deviceName, name, resourceGroupName).toBlocking().single().body(); + } + + /** + * Get a specific trigger by name. + * + * @param deviceName The device name. + * @param name The trigger name. + * @param resourceGroupName The resource group name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String deviceName, String name, String resourceGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(deviceName, name, resourceGroupName), serviceCallback); + } + + /** + * Get a specific trigger by name. + * + * @param deviceName The device name. + * @param name The trigger name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TriggerInner object + */ + public Observable getAsync(String deviceName, String name, String resourceGroupName) { + return getWithServiceResponseAsync(deviceName, name, resourceGroupName).map(new Func1, TriggerInner>() { + @Override + public TriggerInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get a specific trigger by name. + * + * @param deviceName The device name. + * @param name The trigger name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TriggerInner object + */ + public Observable> getWithServiceResponseAsync(String deviceName, String name, String resourceGroupName) { + if (deviceName == null) { + throw new IllegalArgumentException("Parameter deviceName is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(deviceName, name, this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates or updates a trigger. + * + * @param deviceName Creates or updates a trigger + * @param name The trigger name. + * @param resourceGroupName The resource group name. + * @param trigger The trigger. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the TriggerInner object if successful. + */ + public TriggerInner createOrUpdate(String deviceName, String name, String resourceGroupName, TriggerInner trigger) { + return createOrUpdateWithServiceResponseAsync(deviceName, name, resourceGroupName, trigger).toBlocking().last().body(); + } + + /** + * Creates or updates a trigger. + * + * @param deviceName Creates or updates a trigger + * @param name The trigger name. + * @param resourceGroupName The resource group name. + * @param trigger The trigger. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String deviceName, String name, String resourceGroupName, TriggerInner trigger, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(deviceName, name, resourceGroupName, trigger), serviceCallback); + } + + /** + * Creates or updates a trigger. + * + * @param deviceName Creates or updates a trigger + * @param name The trigger name. + * @param resourceGroupName The resource group name. + * @param trigger The trigger. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String deviceName, String name, String resourceGroupName, TriggerInner trigger) { + return createOrUpdateWithServiceResponseAsync(deviceName, name, resourceGroupName, trigger).map(new Func1, TriggerInner>() { + @Override + public TriggerInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a trigger. + * + * @param deviceName Creates or updates a trigger + * @param name The trigger name. + * @param resourceGroupName The resource group name. + * @param trigger The trigger. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String deviceName, String name, String resourceGroupName, TriggerInner trigger) { + if (deviceName == null) { + throw new IllegalArgumentException("Parameter deviceName is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (trigger == null) { + throw new IllegalArgumentException("Parameter trigger is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(trigger); + Observable> observable = service.createOrUpdate(deviceName, name, this.client.subscriptionId(), resourceGroupName, trigger, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates or updates a trigger. + * + * @param deviceName Creates or updates a trigger + * @param name The trigger name. + * @param resourceGroupName The resource group name. + * @param trigger The trigger. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the TriggerInner object if successful. + */ + public TriggerInner beginCreateOrUpdate(String deviceName, String name, String resourceGroupName, TriggerInner trigger) { + return beginCreateOrUpdateWithServiceResponseAsync(deviceName, name, resourceGroupName, trigger).toBlocking().single().body(); + } + + /** + * Creates or updates a trigger. + * + * @param deviceName Creates or updates a trigger + * @param name The trigger name. + * @param resourceGroupName The resource group name. + * @param trigger The trigger. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String deviceName, String name, String resourceGroupName, TriggerInner trigger, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(deviceName, name, resourceGroupName, trigger), serviceCallback); + } + + /** + * Creates or updates a trigger. + * + * @param deviceName Creates or updates a trigger + * @param name The trigger name. + * @param resourceGroupName The resource group name. + * @param trigger The trigger. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TriggerInner object + */ + public Observable beginCreateOrUpdateAsync(String deviceName, String name, String resourceGroupName, TriggerInner trigger) { + return beginCreateOrUpdateWithServiceResponseAsync(deviceName, name, resourceGroupName, trigger).map(new Func1, TriggerInner>() { + @Override + public TriggerInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a trigger. + * + * @param deviceName Creates or updates a trigger + * @param name The trigger name. + * @param resourceGroupName The resource group name. + * @param trigger The trigger. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TriggerInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String deviceName, String name, String resourceGroupName, TriggerInner trigger) { + if (deviceName == null) { + throw new IllegalArgumentException("Parameter deviceName is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (trigger == null) { + throw new IllegalArgumentException("Parameter trigger is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(trigger); + return service.beginCreateOrUpdate(deviceName, name, this.client.subscriptionId(), resourceGroupName, trigger, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes the trigger on the gateway device. + * + * @param deviceName The device name. + * @param name The trigger name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String deviceName, String name, String resourceGroupName) { + deleteWithServiceResponseAsync(deviceName, name, resourceGroupName).toBlocking().last().body(); + } + + /** + * Deletes the trigger on the gateway device. + * + * @param deviceName The device name. + * @param name The trigger name. + * @param resourceGroupName The resource group name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String deviceName, String name, String resourceGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(deviceName, name, resourceGroupName), serviceCallback); + } + + /** + * Deletes the trigger on the gateway device. + * + * @param deviceName The device name. + * @param name The trigger name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String deviceName, String name, String resourceGroupName) { + return deleteWithServiceResponseAsync(deviceName, name, resourceGroupName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the trigger on the gateway device. + * + * @param deviceName The device name. + * @param name The trigger name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String deviceName, String name, String resourceGroupName) { + if (deviceName == null) { + throw new IllegalArgumentException("Parameter deviceName is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.delete(deviceName, name, this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the trigger on the gateway device. + * + * @param deviceName The device name. + * @param name The trigger name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String deviceName, String name, String resourceGroupName) { + beginDeleteWithServiceResponseAsync(deviceName, name, resourceGroupName).toBlocking().single().body(); + } + + /** + * Deletes the trigger on the gateway device. + * + * @param deviceName The device name. + * @param name The trigger name. + * @param resourceGroupName The resource group name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String deviceName, String name, String resourceGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(deviceName, name, resourceGroupName), serviceCallback); + } + + /** + * Deletes the trigger on the gateway device. + * + * @param deviceName The device name. + * @param name The trigger name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String deviceName, String name, String resourceGroupName) { + return beginDeleteWithServiceResponseAsync(deviceName, name, resourceGroupName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the trigger on the gateway device. + * + * @param deviceName The device name. + * @param name The trigger name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String deviceName, String name, String resourceGroupName) { + if (deviceName == null) { + throw new IllegalArgumentException("Parameter deviceName is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDelete(deviceName, name, this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all the triggers configured in the device. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<TriggerInner> object if successful. + */ + public PagedList listByDataBoxEdgeDeviceNext(final String nextPageLink) { + ServiceResponse> response = listByDataBoxEdgeDeviceNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByDataBoxEdgeDeviceNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the triggers configured in the device. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByDataBoxEdgeDeviceNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByDataBoxEdgeDeviceNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByDataBoxEdgeDeviceNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the triggers configured in the device. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<TriggerInner> object + */ + public Observable> listByDataBoxEdgeDeviceNextAsync(final String nextPageLink) { + return listByDataBoxEdgeDeviceNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the triggers configured in the device. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<TriggerInner> object + */ + public Observable>> listByDataBoxEdgeDeviceNextWithServiceResponseAsync(final String nextPageLink) { + return listByDataBoxEdgeDeviceNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByDataBoxEdgeDeviceNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the triggers configured in the device. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<TriggerInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByDataBoxEdgeDeviceNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByDataBoxEdgeDeviceNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByDataBoxEdgeDeviceNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByDataBoxEdgeDeviceNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/UpdateSummaryImpl.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/UpdateSummaryImpl.java new file mode 100644 index 0000000000000..0fb6f5e1c9ac0 --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/UpdateSummaryImpl.java @@ -0,0 +1,130 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01.implementation; + +import com.microsoft.azure.management.databoxedge.v2019_03_01.UpdateSummary; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import org.joda.time.DateTime; +import com.microsoft.azure.management.databoxedge.v2019_03_01.UpdateOperation; +import com.microsoft.azure.management.databoxedge.v2019_03_01.InstallRebootBehavior; +import java.util.List; + +class UpdateSummaryImpl extends WrapperImpl implements UpdateSummary { + private final DataBoxEdgeManager manager; + UpdateSummaryImpl(UpdateSummaryInner inner, DataBoxEdgeManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public DataBoxEdgeManager manager() { + return this.manager; + } + + @Override + public DateTime deviceLastScannedDateTime() { + return this.inner().deviceLastScannedDateTime(); + } + + @Override + public String deviceVersionNumber() { + return this.inner().deviceVersionNumber(); + } + + @Override + public String friendlyDeviceVersionName() { + return this.inner().friendlyDeviceVersionName(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String inProgressDownloadJobId() { + return this.inner().inProgressDownloadJobId(); + } + + @Override + public DateTime inProgressDownloadJobStartedDateTime() { + return this.inner().inProgressDownloadJobStartedDateTime(); + } + + @Override + public String inProgressInstallJobId() { + return this.inner().inProgressInstallJobId(); + } + + @Override + public DateTime inProgressInstallJobStartedDateTime() { + return this.inner().inProgressInstallJobStartedDateTime(); + } + + @Override + public DateTime lastCompletedDownloadJobDateTime() { + return this.inner().lastCompletedDownloadJobDateTime(); + } + + @Override + public DateTime lastCompletedInstallJobDateTime() { + return this.inner().lastCompletedInstallJobDateTime(); + } + + @Override + public DateTime lastCompletedScanJobDateTime() { + return this.inner().lastCompletedScanJobDateTime(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public UpdateOperation ongoingUpdateOperation() { + return this.inner().ongoingUpdateOperation(); + } + + @Override + public InstallRebootBehavior rebootBehavior() { + return this.inner().rebootBehavior(); + } + + @Override + public Integer totalNumberOfUpdatesAvailable() { + return this.inner().totalNumberOfUpdatesAvailable(); + } + + @Override + public Integer totalNumberOfUpdatesPendingDownload() { + return this.inner().totalNumberOfUpdatesPendingDownload(); + } + + @Override + public Integer totalNumberOfUpdatesPendingInstall() { + return this.inner().totalNumberOfUpdatesPendingInstall(); + } + + @Override + public Double totalUpdateSizeInBytes() { + return this.inner().totalUpdateSizeInBytes(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public List updateTitles() { + return this.inner().updateTitles(); + } + +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/UpdateSummaryInner.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/UpdateSummaryInner.java new file mode 100644 index 0000000000000..f59e81aa29bd2 --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/UpdateSummaryInner.java @@ -0,0 +1,330 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01.implementation; + +import org.joda.time.DateTime; +import com.microsoft.azure.management.databoxedge.v2019_03_01.InstallRebootBehavior; +import com.microsoft.azure.management.databoxedge.v2019_03_01.UpdateOperation; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.management.databoxedge.v2019_03_01.ARMBaseModel; + +/** + * Details about ongoing updates and availability of updates on the device. + */ +@JsonFlatten +public class UpdateSummaryInner extends ARMBaseModel { + /** + * The current version of the device in format: 1.2.17312.13.",. + */ + @JsonProperty(value = "properties.deviceVersionNumber") + private String deviceVersionNumber; + + /** + * The current version of the device in text format. + */ + @JsonProperty(value = "properties.friendlyDeviceVersionName") + private String friendlyDeviceVersionName; + + /** + * The last time when a scan was done on the device. + */ + @JsonProperty(value = "properties.deviceLastScannedDateTime") + private DateTime deviceLastScannedDateTime; + + /** + * The time when the last scan job was completed (success/cancelled/failed) + * on the appliance. + */ + @JsonProperty(value = "properties.lastCompletedScanJobDateTime") + private DateTime lastCompletedScanJobDateTime; + + /** + * The time when the last Download job was completed + * (success/cancelled/failed) on the appliance. + */ + @JsonProperty(value = "properties.lastCompletedDownloadJobDateTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime lastCompletedDownloadJobDateTime; + + /** + * The time when the last Install job was completed + * (success/cancelled/failed) on the appliance. + */ + @JsonProperty(value = "properties.lastCompletedInstallJobDateTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime lastCompletedInstallJobDateTime; + + /** + * The number of updates available for the current device version as per + * the last device scan. + */ + @JsonProperty(value = "properties.totalNumberOfUpdatesAvailable", access = JsonProperty.Access.WRITE_ONLY) + private Integer totalNumberOfUpdatesAvailable; + + /** + * The total number of items pending download. + */ + @JsonProperty(value = "properties.totalNumberOfUpdatesPendingDownload", access = JsonProperty.Access.WRITE_ONLY) + private Integer totalNumberOfUpdatesPendingDownload; + + /** + * The total number of items pending install. + */ + @JsonProperty(value = "properties.totalNumberOfUpdatesPendingInstall", access = JsonProperty.Access.WRITE_ONLY) + private Integer totalNumberOfUpdatesPendingInstall; + + /** + * Indicates if updates are available and at least one of the updates needs + * a reboot. Possible values include: 'NeverReboots', 'RequiresReboot', + * 'RequestReboot'. + */ + @JsonProperty(value = "properties.rebootBehavior", access = JsonProperty.Access.WRITE_ONLY) + private InstallRebootBehavior rebootBehavior; + + /** + * The current update operation. Possible values include: 'None', 'Scan', + * 'Download', 'Install'. + */ + @JsonProperty(value = "properties.ongoingUpdateOperation", access = JsonProperty.Access.WRITE_ONLY) + private UpdateOperation ongoingUpdateOperation; + + /** + * The job ID of the download job in progress. + */ + @JsonProperty(value = "properties.inProgressDownloadJobId", access = JsonProperty.Access.WRITE_ONLY) + private String inProgressDownloadJobId; + + /** + * The job ID of the install job in progress. + */ + @JsonProperty(value = "properties.inProgressInstallJobId", access = JsonProperty.Access.WRITE_ONLY) + private String inProgressInstallJobId; + + /** + * The time when the currently running download (if any) started. + */ + @JsonProperty(value = "properties.inProgressDownloadJobStartedDateTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime inProgressDownloadJobStartedDateTime; + + /** + * The time when the currently running install (if any) started. + */ + @JsonProperty(value = "properties.inProgressInstallJobStartedDateTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime inProgressInstallJobStartedDateTime; + + /** + * The list of updates available for install. + */ + @JsonProperty(value = "properties.updateTitles", access = JsonProperty.Access.WRITE_ONLY) + private List updateTitles; + + /** + * The total size of updates available for download in bytes. + */ + @JsonProperty(value = "properties.totalUpdateSizeInBytes", access = JsonProperty.Access.WRITE_ONLY) + private Double totalUpdateSizeInBytes; + + /** + * Get the current version of the device in format: 1.2.17312.13.",. + * + * @return the deviceVersionNumber value + */ + public String deviceVersionNumber() { + return this.deviceVersionNumber; + } + + /** + * Set the current version of the device in format: 1.2.17312.13.",. + * + * @param deviceVersionNumber the deviceVersionNumber value to set + * @return the UpdateSummaryInner object itself. + */ + public UpdateSummaryInner withDeviceVersionNumber(String deviceVersionNumber) { + this.deviceVersionNumber = deviceVersionNumber; + return this; + } + + /** + * Get the current version of the device in text format. + * + * @return the friendlyDeviceVersionName value + */ + public String friendlyDeviceVersionName() { + return this.friendlyDeviceVersionName; + } + + /** + * Set the current version of the device in text format. + * + * @param friendlyDeviceVersionName the friendlyDeviceVersionName value to set + * @return the UpdateSummaryInner object itself. + */ + public UpdateSummaryInner withFriendlyDeviceVersionName(String friendlyDeviceVersionName) { + this.friendlyDeviceVersionName = friendlyDeviceVersionName; + return this; + } + + /** + * Get the last time when a scan was done on the device. + * + * @return the deviceLastScannedDateTime value + */ + public DateTime deviceLastScannedDateTime() { + return this.deviceLastScannedDateTime; + } + + /** + * Set the last time when a scan was done on the device. + * + * @param deviceLastScannedDateTime the deviceLastScannedDateTime value to set + * @return the UpdateSummaryInner object itself. + */ + public UpdateSummaryInner withDeviceLastScannedDateTime(DateTime deviceLastScannedDateTime) { + this.deviceLastScannedDateTime = deviceLastScannedDateTime; + return this; + } + + /** + * Get the time when the last scan job was completed (success/cancelled/failed) on the appliance. + * + * @return the lastCompletedScanJobDateTime value + */ + public DateTime lastCompletedScanJobDateTime() { + return this.lastCompletedScanJobDateTime; + } + + /** + * Set the time when the last scan job was completed (success/cancelled/failed) on the appliance. + * + * @param lastCompletedScanJobDateTime the lastCompletedScanJobDateTime value to set + * @return the UpdateSummaryInner object itself. + */ + public UpdateSummaryInner withLastCompletedScanJobDateTime(DateTime lastCompletedScanJobDateTime) { + this.lastCompletedScanJobDateTime = lastCompletedScanJobDateTime; + return this; + } + + /** + * Get the time when the last Download job was completed (success/cancelled/failed) on the appliance. + * + * @return the lastCompletedDownloadJobDateTime value + */ + public DateTime lastCompletedDownloadJobDateTime() { + return this.lastCompletedDownloadJobDateTime; + } + + /** + * Get the time when the last Install job was completed (success/cancelled/failed) on the appliance. + * + * @return the lastCompletedInstallJobDateTime value + */ + public DateTime lastCompletedInstallJobDateTime() { + return this.lastCompletedInstallJobDateTime; + } + + /** + * Get the number of updates available for the current device version as per the last device scan. + * + * @return the totalNumberOfUpdatesAvailable value + */ + public Integer totalNumberOfUpdatesAvailable() { + return this.totalNumberOfUpdatesAvailable; + } + + /** + * Get the total number of items pending download. + * + * @return the totalNumberOfUpdatesPendingDownload value + */ + public Integer totalNumberOfUpdatesPendingDownload() { + return this.totalNumberOfUpdatesPendingDownload; + } + + /** + * Get the total number of items pending install. + * + * @return the totalNumberOfUpdatesPendingInstall value + */ + public Integer totalNumberOfUpdatesPendingInstall() { + return this.totalNumberOfUpdatesPendingInstall; + } + + /** + * Get indicates if updates are available and at least one of the updates needs a reboot. Possible values include: 'NeverReboots', 'RequiresReboot', 'RequestReboot'. + * + * @return the rebootBehavior value + */ + public InstallRebootBehavior rebootBehavior() { + return this.rebootBehavior; + } + + /** + * Get the current update operation. Possible values include: 'None', 'Scan', 'Download', 'Install'. + * + * @return the ongoingUpdateOperation value + */ + public UpdateOperation ongoingUpdateOperation() { + return this.ongoingUpdateOperation; + } + + /** + * Get the job ID of the download job in progress. + * + * @return the inProgressDownloadJobId value + */ + public String inProgressDownloadJobId() { + return this.inProgressDownloadJobId; + } + + /** + * Get the job ID of the install job in progress. + * + * @return the inProgressInstallJobId value + */ + public String inProgressInstallJobId() { + return this.inProgressInstallJobId; + } + + /** + * Get the time when the currently running download (if any) started. + * + * @return the inProgressDownloadJobStartedDateTime value + */ + public DateTime inProgressDownloadJobStartedDateTime() { + return this.inProgressDownloadJobStartedDateTime; + } + + /** + * Get the time when the currently running install (if any) started. + * + * @return the inProgressInstallJobStartedDateTime value + */ + public DateTime inProgressInstallJobStartedDateTime() { + return this.inProgressInstallJobStartedDateTime; + } + + /** + * Get the list of updates available for install. + * + * @return the updateTitles value + */ + public List updateTitles() { + return this.updateTitles; + } + + /** + * Get the total size of updates available for download in bytes. + * + * @return the totalUpdateSizeInBytes value + */ + public Double totalUpdateSizeInBytes() { + return this.totalUpdateSizeInBytes; + } + +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/UploadCertificateResponseImpl.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/UploadCertificateResponseImpl.java new file mode 100644 index 0000000000000..5c6d942b5270e --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/UploadCertificateResponseImpl.java @@ -0,0 +1,62 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01.implementation; + +import com.microsoft.azure.management.databoxedge.v2019_03_01.UploadCertificateResponse; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.databoxedge.v2019_03_01.AuthenticationType; + +class UploadCertificateResponseImpl extends WrapperImpl implements UploadCertificateResponse { + private final DataBoxEdgeManager manager; + UploadCertificateResponseImpl(UploadCertificateResponseInner inner, DataBoxEdgeManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public DataBoxEdgeManager manager() { + return this.manager; + } + + @Override + public String aadAuthority() { + return this.inner().aadAuthority(); + } + + @Override + public String aadTenantId() { + return this.inner().aadTenantId(); + } + + @Override + public AuthenticationType authType() { + return this.inner().authType(); + } + + @Override + public String azureManagementEndpointAudience() { + return this.inner().azureManagementEndpointAudience(); + } + + @Override + public String resourceId() { + return this.inner().resourceId(); + } + + @Override + public String servicePrincipalClientId() { + return this.inner().servicePrincipalClientId(); + } + + @Override + public String servicePrincipalObjectId() { + return this.inner().servicePrincipalObjectId(); + } + +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/UploadCertificateResponseInner.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/UploadCertificateResponseInner.java new file mode 100644 index 0000000000000..4cc1b308871e4 --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/UploadCertificateResponseInner.java @@ -0,0 +1,201 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01.implementation; + +import com.microsoft.azure.management.databoxedge.v2019_03_01.AuthenticationType; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The upload registration certificate response. + */ +public class UploadCertificateResponseInner { + /** + * Specifies authentication type. Possible values include: 'Invalid', + * 'AzureActiveDirectory'. + */ + @JsonProperty(value = "authType") + private AuthenticationType authType; + + /** + * The resource ID of the Data Box Edge/Gateway device. + */ + @JsonProperty(value = "resourceId", required = true) + private String resourceId; + + /** + * Azure Active Directory tenant authority. + */ + @JsonProperty(value = "aadAuthority", required = true) + private String aadAuthority; + + /** + * Azure Active Directory tenant ID. + */ + @JsonProperty(value = "aadTenantId", required = true) + private String aadTenantId; + + /** + * Azure Active Directory service principal client ID. + */ + @JsonProperty(value = "servicePrincipalClientId", required = true) + private String servicePrincipalClientId; + + /** + * Azure Active Directory service principal object ID. + */ + @JsonProperty(value = "servicePrincipalObjectId", required = true) + private String servicePrincipalObjectId; + + /** + * The azure management endpoint audience. + */ + @JsonProperty(value = "azureManagementEndpointAudience", required = true) + private String azureManagementEndpointAudience; + + /** + * Get specifies authentication type. Possible values include: 'Invalid', 'AzureActiveDirectory'. + * + * @return the authType value + */ + public AuthenticationType authType() { + return this.authType; + } + + /** + * Set specifies authentication type. Possible values include: 'Invalid', 'AzureActiveDirectory'. + * + * @param authType the authType value to set + * @return the UploadCertificateResponseInner object itself. + */ + public UploadCertificateResponseInner withAuthType(AuthenticationType authType) { + this.authType = authType; + return this; + } + + /** + * Get the resource ID of the Data Box Edge/Gateway device. + * + * @return the resourceId value + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the resource ID of the Data Box Edge/Gateway device. + * + * @param resourceId the resourceId value to set + * @return the UploadCertificateResponseInner object itself. + */ + public UploadCertificateResponseInner withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Get azure Active Directory tenant authority. + * + * @return the aadAuthority value + */ + public String aadAuthority() { + return this.aadAuthority; + } + + /** + * Set azure Active Directory tenant authority. + * + * @param aadAuthority the aadAuthority value to set + * @return the UploadCertificateResponseInner object itself. + */ + public UploadCertificateResponseInner withAadAuthority(String aadAuthority) { + this.aadAuthority = aadAuthority; + return this; + } + + /** + * Get azure Active Directory tenant ID. + * + * @return the aadTenantId value + */ + public String aadTenantId() { + return this.aadTenantId; + } + + /** + * Set azure Active Directory tenant ID. + * + * @param aadTenantId the aadTenantId value to set + * @return the UploadCertificateResponseInner object itself. + */ + public UploadCertificateResponseInner withAadTenantId(String aadTenantId) { + this.aadTenantId = aadTenantId; + return this; + } + + /** + * Get azure Active Directory service principal client ID. + * + * @return the servicePrincipalClientId value + */ + public String servicePrincipalClientId() { + return this.servicePrincipalClientId; + } + + /** + * Set azure Active Directory service principal client ID. + * + * @param servicePrincipalClientId the servicePrincipalClientId value to set + * @return the UploadCertificateResponseInner object itself. + */ + public UploadCertificateResponseInner withServicePrincipalClientId(String servicePrincipalClientId) { + this.servicePrincipalClientId = servicePrincipalClientId; + return this; + } + + /** + * Get azure Active Directory service principal object ID. + * + * @return the servicePrincipalObjectId value + */ + public String servicePrincipalObjectId() { + return this.servicePrincipalObjectId; + } + + /** + * Set azure Active Directory service principal object ID. + * + * @param servicePrincipalObjectId the servicePrincipalObjectId value to set + * @return the UploadCertificateResponseInner object itself. + */ + public UploadCertificateResponseInner withServicePrincipalObjectId(String servicePrincipalObjectId) { + this.servicePrincipalObjectId = servicePrincipalObjectId; + return this; + } + + /** + * Get the azure management endpoint audience. + * + * @return the azureManagementEndpointAudience value + */ + public String azureManagementEndpointAudience() { + return this.azureManagementEndpointAudience; + } + + /** + * Set the azure management endpoint audience. + * + * @param azureManagementEndpointAudience the azureManagementEndpointAudience value to set + * @return the UploadCertificateResponseInner object itself. + */ + public UploadCertificateResponseInner withAzureManagementEndpointAudience(String azureManagementEndpointAudience) { + this.azureManagementEndpointAudience = azureManagementEndpointAudience; + return this; + } + +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/UserImpl.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/UserImpl.java new file mode 100644 index 0000000000000..e234d498e808f --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/UserImpl.java @@ -0,0 +1,119 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01.implementation; + +import com.microsoft.azure.management.databoxedge.v2019_03_01.User; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.databoxedge.v2019_03_01.AsymmetricEncryptedSecret; +import java.util.List; +import com.microsoft.azure.management.databoxedge.v2019_03_01.ShareAccessRight; + +class UserImpl extends CreatableUpdatableImpl implements User, User.Definition, User.Update { + private final DataBoxEdgeManager manager; + private String deviceName; + private String name; + private String resourceGroupName; + + UserImpl(String name, DataBoxEdgeManager manager) { + super(name, new UserInner()); + this.manager = manager; + // Set resource name + this.name = name; + // + } + + UserImpl(UserInner inner, DataBoxEdgeManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.name = inner.name(); + // set resource ancestor and positional variables + this.deviceName = IdParsingUtils.getValueFromIdByName(inner.id(), "dataBoxEdgeDevices"); + this.name = IdParsingUtils.getValueFromIdByName(inner.id(), "users"); + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + // + } + + @Override + public DataBoxEdgeManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + UsersInner client = this.manager().inner().users(); + return client.createOrUpdateAsync(this.deviceName, this.name, this.resourceGroupName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + UsersInner client = this.manager().inner().users(); + return client.createOrUpdateAsync(this.deviceName, this.name, this.resourceGroupName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + UsersInner client = this.manager().inner().users(); + return client.getAsync(this.deviceName, this.name, this.resourceGroupName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public AsymmetricEncryptedSecret encryptedPassword() { + return this.inner().encryptedPassword(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public List shareAccessRights() { + return this.inner().shareAccessRights(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public UserImpl withExistingDataBoxEdgeDevice(String deviceName, String resourceGroupName) { + this.deviceName = deviceName; + this.resourceGroupName = resourceGroupName; + return this; + } + + @Override + public UserImpl withEncryptedPassword(AsymmetricEncryptedSecret encryptedPassword) { + this.inner().withEncryptedPassword(encryptedPassword); + return this; + } + + @Override + public UserImpl withShareAccessRights(List shareAccessRights) { + this.inner().withShareAccessRights(shareAccessRights); + return this; + } + +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/UserInner.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/UserInner.java new file mode 100644 index 0000000000000..b5fa3d5a12e49 --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/UserInner.java @@ -0,0 +1,77 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01.implementation; + +import com.microsoft.azure.management.databoxedge.v2019_03_01.AsymmetricEncryptedSecret; +import java.util.List; +import com.microsoft.azure.management.databoxedge.v2019_03_01.ShareAccessRight; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.management.databoxedge.v2019_03_01.ARMBaseModel; + +/** + * Represents a user who has access to one or more shares on the Data Box + * Edge/Gateway device. + */ +@JsonFlatten +public class UserInner extends ARMBaseModel { + /** + * The password details. + */ + @JsonProperty(value = "properties.encryptedPassword") + private AsymmetricEncryptedSecret encryptedPassword; + + /** + * List of shares that the user has rights on. This field should not be + * specified during user creation. + */ + @JsonProperty(value = "properties.shareAccessRights") + private List shareAccessRights; + + /** + * Get the password details. + * + * @return the encryptedPassword value + */ + public AsymmetricEncryptedSecret encryptedPassword() { + return this.encryptedPassword; + } + + /** + * Set the password details. + * + * @param encryptedPassword the encryptedPassword value to set + * @return the UserInner object itself. + */ + public UserInner withEncryptedPassword(AsymmetricEncryptedSecret encryptedPassword) { + this.encryptedPassword = encryptedPassword; + return this; + } + + /** + * Get list of shares that the user has rights on. This field should not be specified during user creation. + * + * @return the shareAccessRights value + */ + public List shareAccessRights() { + return this.shareAccessRights; + } + + /** + * Set list of shares that the user has rights on. This field should not be specified during user creation. + * + * @param shareAccessRights the shareAccessRights value to set + * @return the UserInner object itself. + */ + public UserInner withShareAccessRights(List shareAccessRights) { + this.shareAccessRights = shareAccessRights; + return this; + } + +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/UsersImpl.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/UsersImpl.java new file mode 100644 index 0000000000000..ae9a86aea81b6 --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/UsersImpl.java @@ -0,0 +1,85 @@ +/** + * 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. + * + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.databoxedge.v2019_03_01.Users; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.databoxedge.v2019_03_01.User; + +class UsersImpl extends WrapperImpl implements Users { + private final DataBoxEdgeManager manager; + + UsersImpl(DataBoxEdgeManager manager) { + super(manager.inner().users()); + this.manager = manager; + } + + public DataBoxEdgeManager manager() { + return this.manager; + } + + @Override + public UserImpl define(String name) { + return wrapModel(name); + } + + private UserImpl wrapModel(UserInner inner) { + return new UserImpl(inner, manager()); + } + + private UserImpl wrapModel(String name) { + return new UserImpl(name, this.manager()); + } + + @Override + public Observable listByDataBoxEdgeDeviceAsync(final String deviceName, final String resourceGroupName) { + UsersInner client = this.inner(); + return client.listByDataBoxEdgeDeviceAsync(deviceName, resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public User call(UserInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String deviceName, String name, String resourceGroupName) { + UsersInner client = this.inner(); + return client.getAsync(deviceName, name, resourceGroupName) + .flatMap(new Func1>() { + @Override + public Observable call(UserInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((User)wrapModel(inner)); + } + } + }); + } + + @Override + public Completable deleteAsync(String deviceName, String name, String resourceGroupName) { + UsersInner client = this.inner(); + return client.deleteAsync(deviceName, name, resourceGroupName).toCompletable(); + } + +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/UsersInner.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/UsersInner.java new file mode 100644 index 0000000000000..7a5291e53c8ab --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/UsersInner.java @@ -0,0 +1,776 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.databoxedge.v2019_03_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Users. + */ +public class UsersInner { + /** The Retrofit service to perform REST calls. */ + private UsersService service; + /** The service client containing this operation class. */ + private DataBoxEdgeManagementClientImpl client; + + /** + * Initializes an instance of UsersInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public UsersInner(Retrofit retrofit, DataBoxEdgeManagementClientImpl client) { + this.service = retrofit.create(UsersService.class); + this.client = client; + } + + /** + * The interface defining all the services for Users to be + * used by Retrofit to perform actually REST calls. + */ + interface UsersService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.databoxedge.v2019_03_01.Users listByDataBoxEdgeDevice" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/users") + Observable> listByDataBoxEdgeDevice(@Path("deviceName") String deviceName, @Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.databoxedge.v2019_03_01.Users get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/users/{name}") + Observable> get(@Path("deviceName") String deviceName, @Path("name") String name, @Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.databoxedge.v2019_03_01.Users createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/users/{name}") + Observable> createOrUpdate(@Path("deviceName") String deviceName, @Path("name") String name, @Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Body UserInner user, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.databoxedge.v2019_03_01.Users beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/users/{name}") + Observable> beginCreateOrUpdate(@Path("deviceName") String deviceName, @Path("name") String name, @Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Body UserInner user, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.databoxedge.v2019_03_01.Users delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/users/{name}", method = "DELETE", hasBody = true) + Observable> delete(@Path("deviceName") String deviceName, @Path("name") String name, @Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.databoxedge.v2019_03_01.Users beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/users/{name}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("deviceName") String deviceName, @Path("name") String name, @Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.databoxedge.v2019_03_01.Users listByDataBoxEdgeDeviceNext" }) + @GET + Observable> listByDataBoxEdgeDeviceNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets all the users registered on a data box edge/gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<UserInner> object if successful. + */ + public PagedList listByDataBoxEdgeDevice(final String deviceName, final String resourceGroupName) { + ServiceResponse> response = listByDataBoxEdgeDeviceSinglePageAsync(deviceName, resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByDataBoxEdgeDeviceNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the users registered on a data box edge/gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByDataBoxEdgeDeviceAsync(final String deviceName, final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByDataBoxEdgeDeviceSinglePageAsync(deviceName, resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByDataBoxEdgeDeviceNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the users registered on a data box edge/gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<UserInner> object + */ + public Observable> listByDataBoxEdgeDeviceAsync(final String deviceName, final String resourceGroupName) { + return listByDataBoxEdgeDeviceWithServiceResponseAsync(deviceName, resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the users registered on a data box edge/gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<UserInner> object + */ + public Observable>> listByDataBoxEdgeDeviceWithServiceResponseAsync(final String deviceName, final String resourceGroupName) { + return listByDataBoxEdgeDeviceSinglePageAsync(deviceName, resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByDataBoxEdgeDeviceNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the users registered on a data box edge/gateway device. + * + ServiceResponse> * @param deviceName The device name. + ServiceResponse> * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<UserInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByDataBoxEdgeDeviceSinglePageAsync(final String deviceName, final String resourceGroupName) { + if (deviceName == null) { + throw new IllegalArgumentException("Parameter deviceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByDataBoxEdgeDevice(deviceName, this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByDataBoxEdgeDeviceDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByDataBoxEdgeDeviceDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the properties of the specified user. + * + * @param deviceName The device name. + * @param name The user name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the UserInner object if successful. + */ + public UserInner get(String deviceName, String name, String resourceGroupName) { + return getWithServiceResponseAsync(deviceName, name, resourceGroupName).toBlocking().single().body(); + } + + /** + * Gets the properties of the specified user. + * + * @param deviceName The device name. + * @param name The user name. + * @param resourceGroupName The resource group name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String deviceName, String name, String resourceGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(deviceName, name, resourceGroupName), serviceCallback); + } + + /** + * Gets the properties of the specified user. + * + * @param deviceName The device name. + * @param name The user name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the UserInner object + */ + public Observable getAsync(String deviceName, String name, String resourceGroupName) { + return getWithServiceResponseAsync(deviceName, name, resourceGroupName).map(new Func1, UserInner>() { + @Override + public UserInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the properties of the specified user. + * + * @param deviceName The device name. + * @param name The user name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the UserInner object + */ + public Observable> getWithServiceResponseAsync(String deviceName, String name, String resourceGroupName) { + if (deviceName == null) { + throw new IllegalArgumentException("Parameter deviceName is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(deviceName, name, this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates a new user or updates an existing user's information on a data box edge/gateway device. + * + * @param deviceName The device name. + * @param name The user name. + * @param resourceGroupName The resource group name. + * @param user The user details. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the UserInner object if successful. + */ + public UserInner createOrUpdate(String deviceName, String name, String resourceGroupName, UserInner user) { + return createOrUpdateWithServiceResponseAsync(deviceName, name, resourceGroupName, user).toBlocking().last().body(); + } + + /** + * Creates a new user or updates an existing user's information on a data box edge/gateway device. + * + * @param deviceName The device name. + * @param name The user name. + * @param resourceGroupName The resource group name. + * @param user The user details. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String deviceName, String name, String resourceGroupName, UserInner user, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(deviceName, name, resourceGroupName, user), serviceCallback); + } + + /** + * Creates a new user or updates an existing user's information on a data box edge/gateway device. + * + * @param deviceName The device name. + * @param name The user name. + * @param resourceGroupName The resource group name. + * @param user The user details. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String deviceName, String name, String resourceGroupName, UserInner user) { + return createOrUpdateWithServiceResponseAsync(deviceName, name, resourceGroupName, user).map(new Func1, UserInner>() { + @Override + public UserInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a new user or updates an existing user's information on a data box edge/gateway device. + * + * @param deviceName The device name. + * @param name The user name. + * @param resourceGroupName The resource group name. + * @param user The user details. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String deviceName, String name, String resourceGroupName, UserInner user) { + if (deviceName == null) { + throw new IllegalArgumentException("Parameter deviceName is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (user == null) { + throw new IllegalArgumentException("Parameter user is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(user); + Observable> observable = service.createOrUpdate(deviceName, name, this.client.subscriptionId(), resourceGroupName, user, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates a new user or updates an existing user's information on a data box edge/gateway device. + * + * @param deviceName The device name. + * @param name The user name. + * @param resourceGroupName The resource group name. + * @param user The user details. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the UserInner object if successful. + */ + public UserInner beginCreateOrUpdate(String deviceName, String name, String resourceGroupName, UserInner user) { + return beginCreateOrUpdateWithServiceResponseAsync(deviceName, name, resourceGroupName, user).toBlocking().single().body(); + } + + /** + * Creates a new user or updates an existing user's information on a data box edge/gateway device. + * + * @param deviceName The device name. + * @param name The user name. + * @param resourceGroupName The resource group name. + * @param user The user details. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String deviceName, String name, String resourceGroupName, UserInner user, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(deviceName, name, resourceGroupName, user), serviceCallback); + } + + /** + * Creates a new user or updates an existing user's information on a data box edge/gateway device. + * + * @param deviceName The device name. + * @param name The user name. + * @param resourceGroupName The resource group name. + * @param user The user details. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the UserInner object + */ + public Observable beginCreateOrUpdateAsync(String deviceName, String name, String resourceGroupName, UserInner user) { + return beginCreateOrUpdateWithServiceResponseAsync(deviceName, name, resourceGroupName, user).map(new Func1, UserInner>() { + @Override + public UserInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a new user or updates an existing user's information on a data box edge/gateway device. + * + * @param deviceName The device name. + * @param name The user name. + * @param resourceGroupName The resource group name. + * @param user The user details. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the UserInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String deviceName, String name, String resourceGroupName, UserInner user) { + if (deviceName == null) { + throw new IllegalArgumentException("Parameter deviceName is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (user == null) { + throw new IllegalArgumentException("Parameter user is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(user); + return service.beginCreateOrUpdate(deviceName, name, this.client.subscriptionId(), resourceGroupName, user, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes the user on a databox edge/gateway device. + * + * @param deviceName The device name. + * @param name The user name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String deviceName, String name, String resourceGroupName) { + deleteWithServiceResponseAsync(deviceName, name, resourceGroupName).toBlocking().last().body(); + } + + /** + * Deletes the user on a databox edge/gateway device. + * + * @param deviceName The device name. + * @param name The user name. + * @param resourceGroupName The resource group name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String deviceName, String name, String resourceGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(deviceName, name, resourceGroupName), serviceCallback); + } + + /** + * Deletes the user on a databox edge/gateway device. + * + * @param deviceName The device name. + * @param name The user name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String deviceName, String name, String resourceGroupName) { + return deleteWithServiceResponseAsync(deviceName, name, resourceGroupName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the user on a databox edge/gateway device. + * + * @param deviceName The device name. + * @param name The user name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String deviceName, String name, String resourceGroupName) { + if (deviceName == null) { + throw new IllegalArgumentException("Parameter deviceName is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.delete(deviceName, name, this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the user on a databox edge/gateway device. + * + * @param deviceName The device name. + * @param name The user name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String deviceName, String name, String resourceGroupName) { + beginDeleteWithServiceResponseAsync(deviceName, name, resourceGroupName).toBlocking().single().body(); + } + + /** + * Deletes the user on a databox edge/gateway device. + * + * @param deviceName The device name. + * @param name The user name. + * @param resourceGroupName The resource group name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String deviceName, String name, String resourceGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(deviceName, name, resourceGroupName), serviceCallback); + } + + /** + * Deletes the user on a databox edge/gateway device. + * + * @param deviceName The device name. + * @param name The user name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String deviceName, String name, String resourceGroupName) { + return beginDeleteWithServiceResponseAsync(deviceName, name, resourceGroupName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the user on a databox edge/gateway device. + * + * @param deviceName The device name. + * @param name The user name. + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String deviceName, String name, String resourceGroupName) { + if (deviceName == null) { + throw new IllegalArgumentException("Parameter deviceName is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDelete(deviceName, name, this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all the users registered on a data box edge/gateway device. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<UserInner> object if successful. + */ + public PagedList listByDataBoxEdgeDeviceNext(final String nextPageLink) { + ServiceResponse> response = listByDataBoxEdgeDeviceNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByDataBoxEdgeDeviceNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the users registered on a data box edge/gateway device. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByDataBoxEdgeDeviceNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByDataBoxEdgeDeviceNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByDataBoxEdgeDeviceNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the users registered on a data box edge/gateway device. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<UserInner> object + */ + public Observable> listByDataBoxEdgeDeviceNextAsync(final String nextPageLink) { + return listByDataBoxEdgeDeviceNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the users registered on a data box edge/gateway device. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<UserInner> object + */ + public Observable>> listByDataBoxEdgeDeviceNextWithServiceResponseAsync(final String nextPageLink) { + return listByDataBoxEdgeDeviceNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByDataBoxEdgeDeviceNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all the users registered on a data box edge/gateway device. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<UserInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByDataBoxEdgeDeviceNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByDataBoxEdgeDeviceNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByDataBoxEdgeDeviceNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByDataBoxEdgeDeviceNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/package-info.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/package-info.java new file mode 100644 index 0000000000000..821b179be354b --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/implementation/package-info.java @@ -0,0 +1,10 @@ +// 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. + +/** + * This package contains the implementation classes for DataBoxEdgeManagementClient. + */ +package com.microsoft.azure.management.databoxedge.v2019_03_01.implementation; diff --git a/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/package-info.java b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/package-info.java new file mode 100644 index 0000000000000..2c708d7212a0c --- /dev/null +++ b/sdk/databoxedge/mgmt-v2019_03_01/src/main/java/com/microsoft/azure/management/databoxedge/v2019_03_01/package-info.java @@ -0,0 +1,10 @@ +// 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. + +/** + * This package contains the classes for DataBoxEdgeManagementClient. + */ +package com.microsoft.azure.management.databoxedge.v2019_03_01;