From a5e0cd34f898c7652db0c671dfb1a39fd15b0f83 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Wed, 2 Jan 2019 07:49:43 +0000 Subject: [PATCH] Generated from 9fd537119a0fa74ec60d08f5b16facaf32c15b08 Corrected typo in swagger file name --- azure-mgmt-edgegateway/pom.xml | 133 + .../management/edgegateway/ARMBaseModel.java | 17 + .../management/edgegateway/AccountType.java | 41 + .../azure/management/edgegateway/Address.java | 199 ++ .../azure/management/edgegateway/Alert.java | 74 + .../edgegateway/AlertErrorDetails.java | 62 + .../management/edgegateway/AlertSeverity.java | 44 + .../azure/management/edgegateway/Alerts.java | 40 + .../AsymmetricEncryptedSecret.java | 97 + .../edgegateway/Authentication.java | 43 + .../edgegateway/AuthenticationType.java | 41 + .../edgegateway/AzureContainerDataFormat.java | 44 + .../edgegateway/AzureContainerInfo.java | 97 + .../edgegateway/BandwidthSchedule.java | 157 ++ .../edgegateway/BandwidthSchedules.java | 53 + .../edgegateway/ClientAccessRight.java | 71 + .../edgegateway/ClientPermissionType.java | 44 + .../edgegateway/ContactDetails.java | 122 + .../edgegateway/DataBoxEdgeDevice.java | 288 ++ .../DataBoxEdgeDeviceExtendedInfo.java | 55 + .../edgegateway/DataBoxEdgeDevicePatch.java | 44 + .../edgegateway/DataBoxEdgeDeviceStatus.java | 53 + .../management/edgegateway/DataPolicy.java | 41 + .../management/edgegateway/DayOfWeek.java | 56 + .../management/edgegateway/DeviceType.java | 38 + .../azure/management/edgegateway/Devices.java | 157 ++ .../management/edgegateway/DownloadPhase.java | 47 + .../edgegateway/EncryptionAlgorithm.java | 44 + .../edgegateway/FileEventTrigger.java | 105 + .../edgegateway/FileSourceInfo.java | 43 + .../edgegateway/InstallRebootBehavior.java | 44 + .../management/edgegateway/IoTDeviceInfo.java | 95 + .../azure/management/edgegateway/IoTRole.java | 156 + .../management/edgegateway/Ipv4Config.java | 62 + .../management/edgegateway/Ipv6Config.java | 62 + .../azure/management/edgegateway/Job.java | 103 + .../edgegateway/JobErrorDetails.java | 63 + .../management/edgegateway/JobErrorItem.java | 63 + .../management/edgegateway/JobStatus.java | 56 + .../azure/management/edgegateway/JobType.java | 50 + .../edgegateway/MetricAggregationType.java | 56 + .../edgegateway/MetricCategory.java | 41 + .../edgegateway/MetricDimensionV1.java | 95 + .../edgegateway/MetricSpecificationV1.java | 307 ++ .../management/edgegateway/MetricUnit.java | 59 + .../edgegateway/MonitoringStatus.java | 41 + .../management/edgegateway/MountPointMap.java | 89 + .../edgegateway/NetworkAdapter.java | 268 ++ .../edgegateway/NetworkAdapterDHCPStatus.java | 41 + .../edgegateway/NetworkAdapterPosition.java | 47 + .../edgegateway/NetworkAdapterRDMAStatus.java | 41 + .../edgegateway/NetworkAdapterStatus.java | 41 + .../management/edgegateway/NetworkGroup.java | 44 + .../edgegateway/NetworkSettings.java | 41 + .../management/edgegateway/Operation.java | 40 + .../edgegateway/OperationDisplay.java | 121 + .../management/edgegateway/Operations.java | 27 + .../edgegateway/OperationsStatus.java | 30 + .../azure/management/edgegateway/Order.java | 71 + .../management/edgegateway/OrderStatus.java | 90 + .../azure/management/edgegateway/Orders.java | 62 + .../PeriodicTimerEventTrigger.java | 105 + .../edgegateway/PeriodicTimerSourceInfo.java | 98 + .../management/edgegateway/PlatformType.java | 41 + .../edgegateway/RefreshDetails.java | 135 + .../azure/management/edgegateway/Role.java | 88 + .../management/edgegateway/RoleSinkInfo.java | 43 + .../management/edgegateway/RoleStatus.java | 41 + .../management/edgegateway/RoleTypes.java | 47 + .../azure/management/edgegateway/Roles.java | 53 + .../management/edgegateway/SSLStatus.java | 41 + .../edgegateway/SecuritySettings.java | 48 + .../edgegateway/ServiceSpecification.java | 44 + .../azure/management/edgegateway/Share.java | 319 +++ .../edgegateway/ShareAccessProtocol.java | 41 + .../edgegateway/ShareAccessRight.java | 71 + .../edgegateway/ShareAccessType.java | 44 + .../management/edgegateway/ShareStatus.java | 41 + .../azure/management/edgegateway/Shares.java | 64 + .../azure/management/edgegateway/Sku.java | 70 + .../azure/management/edgegateway/SkuName.java | 41 + .../azure/management/edgegateway/SkuTier.java | 38 + .../management/edgegateway/StatusTypes.java | 77 + .../edgegateway/StorageAccountCredential.java | 255 ++ .../StorageAccountCredentials.java | 53 + .../management/edgegateway/SymmetricKey.java | 43 + .../management/edgegateway/TimeGrain.java | 59 + .../management/edgegateway/TrackingInfo.java | 121 + .../azure/management/edgegateway/Trigger.java | 88 + .../management/edgegateway/Triggers.java | 53 + .../edgegateway/UpdateDownloadProgress.java | 108 + .../edgegateway/UpdateInstallProgress.java | 62 + .../edgegateway/UpdateOperation.java | 47 + .../edgegateway/UpdateOperationStage.java | 86 + .../management/edgegateway/UpdateSummary.java | 122 + .../edgegateway/UploadCertificateRequest.java | 72 + .../UploadCertificateResponse.java | 55 + .../azure/management/edgegateway/User.java | 147 + .../edgegateway/UserAccessRight.java | 71 + .../azure/management/edgegateway/Users.java | 53 + .../edgegateway/implementation/AlertImpl.java | 97 + .../implementation/AlertInner.java | 130 + .../implementation/AlertsImpl.java | 65 + .../implementation/AlertsInner.java | 401 +++ .../implementation/BandwidthScheduleImpl.java | 140 + .../BandwidthScheduleInner.java | 126 + .../BandwidthSchedulesImpl.java | 81 + .../BandwidthSchedulesInner.java | 776 +++++ .../DataBoxEdgeDeviceExtendedInfoImpl.java | 61 + .../DataBoxEdgeDeviceExtendedInfoInner.java | 114 + .../implementation/DataBoxEdgeDeviceImpl.java | 162 ++ .../DataBoxEdgeDeviceInner.java | 377 +++ .../DataBoxEdgeManagementClientImpl.java | 336 +++ .../implementation/DataBoxEdgeManager.java | 219 ++ .../implementation/DevicesImpl.java | 191 ++ .../implementation/DevicesInner.java | 2501 +++++++++++++++++ .../implementation/IdParsingUtils.java | 57 + .../edgegateway/implementation/JobImpl.java | 130 + .../edgegateway/implementation/JobInner.java | 285 ++ .../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 | 46 + .../implementation/OperationsStatusInner.java | 153 + .../edgegateway/implementation/OrderImpl.java | 85 + .../implementation/OrderInner.java | 165 ++ .../implementation/OrdersImpl.java | 84 + .../implementation/OrdersInner.java | 742 +++++ .../edgegateway/implementation/PageImpl.java | 75 + .../edgegateway/implementation/RoleImpl.java | 94 + .../edgegateway/implementation/RoleInner.java | 25 + .../edgegateway/implementation/RolesImpl.java | 81 + .../implementation/RolesInner.java | 776 +++++ .../edgegateway/implementation/ShareImpl.java | 208 ++ .../implementation/ShareInner.java | 284 ++ .../implementation/SharesImpl.java | 87 + .../implementation/SharesInner.java | 953 +++++++ .../StorageAccountCredentialImpl.java | 174 ++ .../StorageAccountCredentialInner.java | 208 ++ .../StorageAccountCredentialsImpl.java | 81 + .../StorageAccountCredentialsInner.java | 776 +++++ .../implementation/TriggerImpl.java | 94 + .../implementation/TriggerInner.java | 26 + .../implementation/TriggersImpl.java | 81 + .../implementation/TriggersInner.java | 776 +++++ .../implementation/UpdateSummaryImpl.java | 130 + .../implementation/UpdateSummaryInner.java | 330 +++ .../UploadCertificateResponseImpl.java | 62 + .../UploadCertificateResponseInner.java | 201 ++ .../edgegateway/implementation/UserImpl.java | 119 + .../edgegateway/implementation/UserInner.java | 77 + .../edgegateway/implementation/UsersImpl.java | 81 + .../implementation/UsersInner.java | 776 +++++ .../implementation/package-info.java | 10 + .../management/edgegateway/package-info.java | 10 + 158 files changed, 22550 insertions(+) create mode 100644 azure-mgmt-edgegateway/pom.xml create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/ARMBaseModel.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/AccountType.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/Address.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/Alert.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/AlertErrorDetails.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/AlertSeverity.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/Alerts.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/AsymmetricEncryptedSecret.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/Authentication.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/AuthenticationType.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/AzureContainerDataFormat.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/AzureContainerInfo.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/BandwidthSchedule.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/BandwidthSchedules.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/ClientAccessRight.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/ClientPermissionType.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/ContactDetails.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/DataBoxEdgeDevice.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/DataBoxEdgeDeviceExtendedInfo.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/DataBoxEdgeDevicePatch.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/DataBoxEdgeDeviceStatus.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/DataPolicy.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/DayOfWeek.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/DeviceType.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/Devices.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/DownloadPhase.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/EncryptionAlgorithm.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/FileEventTrigger.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/FileSourceInfo.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/InstallRebootBehavior.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/IoTDeviceInfo.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/IoTRole.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/Ipv4Config.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/Ipv6Config.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/Job.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/JobErrorDetails.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/JobErrorItem.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/JobStatus.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/JobType.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/MetricAggregationType.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/MetricCategory.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/MetricDimensionV1.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/MetricSpecificationV1.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/MetricUnit.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/MonitoringStatus.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/MountPointMap.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/NetworkAdapter.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/NetworkAdapterDHCPStatus.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/NetworkAdapterPosition.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/NetworkAdapterRDMAStatus.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/NetworkAdapterStatus.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/NetworkGroup.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/NetworkSettings.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/Operation.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/OperationDisplay.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/Operations.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/OperationsStatus.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/Order.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/OrderStatus.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/Orders.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/PeriodicTimerEventTrigger.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/PeriodicTimerSourceInfo.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/PlatformType.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/RefreshDetails.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/Role.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/RoleSinkInfo.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/RoleStatus.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/RoleTypes.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/Roles.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/SSLStatus.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/SecuritySettings.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/ServiceSpecification.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/Share.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/ShareAccessProtocol.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/ShareAccessRight.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/ShareAccessType.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/ShareStatus.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/Shares.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/Sku.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/SkuName.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/SkuTier.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/StatusTypes.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/StorageAccountCredential.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/StorageAccountCredentials.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/SymmetricKey.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/TimeGrain.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/TrackingInfo.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/Trigger.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/Triggers.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/UpdateDownloadProgress.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/UpdateInstallProgress.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/UpdateOperation.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/UpdateOperationStage.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/UpdateSummary.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/UploadCertificateRequest.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/UploadCertificateResponse.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/User.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/UserAccessRight.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/Users.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/AlertImpl.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/AlertInner.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/AlertsImpl.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/AlertsInner.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/BandwidthScheduleImpl.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/BandwidthScheduleInner.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/BandwidthSchedulesImpl.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/BandwidthSchedulesInner.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/DataBoxEdgeDeviceExtendedInfoImpl.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/DataBoxEdgeDeviceExtendedInfoInner.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/DataBoxEdgeDeviceImpl.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/DataBoxEdgeDeviceInner.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/DataBoxEdgeManagementClientImpl.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/DataBoxEdgeManager.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/DevicesImpl.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/DevicesInner.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/IdParsingUtils.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/JobImpl.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/JobInner.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/NetworkSettingsImpl.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/NetworkSettingsInner.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/OperationImpl.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/OperationInner.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/OperationsImpl.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/OperationsInner.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/OperationsStatusImpl.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/OperationsStatusInner.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/OrderImpl.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/OrderInner.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/OrdersImpl.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/OrdersInner.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/PageImpl.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/RoleImpl.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/RoleInner.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/RolesImpl.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/RolesInner.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/ShareImpl.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/ShareInner.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/SharesImpl.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/SharesInner.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/StorageAccountCredentialImpl.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/StorageAccountCredentialInner.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/StorageAccountCredentialsImpl.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/StorageAccountCredentialsInner.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/TriggerImpl.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/TriggerInner.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/TriggersImpl.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/TriggersInner.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/UpdateSummaryImpl.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/UpdateSummaryInner.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/UploadCertificateResponseImpl.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/UploadCertificateResponseInner.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/UserImpl.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/UserInner.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/UsersImpl.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/UsersInner.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/package-info.java create mode 100644 azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/package-info.java diff --git a/azure-mgmt-edgegateway/pom.xml b/azure-mgmt-edgegateway/pom.xml new file mode 100644 index 000000000000..02ac0bc33a2e --- /dev/null +++ b/azure-mgmt-edgegateway/pom.xml @@ -0,0 +1,133 @@ + + + 4.0.0 + com.microsoft.azure.edgegateway + + com.microsoft.azure + azure-arm-parent + 0.0.3-beta + ../../../pom.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 + + + + + + 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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/ARMBaseModel.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/ARMBaseModel.java new file mode 100644 index 000000000000..f90524443422 --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway; + +import com.microsoft.azure.ProxyResource; + +/** + * Represents the base class for all object models. + */ +public class ARMBaseModel extends ProxyResource { +} diff --git a/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/AccountType.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/AccountType.java new file mode 100644 index 000000000000..fd8e9483e8bb --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway; + +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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/Address.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/Address.java new file mode 100644 index 000000000000..62fb52b24c43 --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway; + +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", required = true) + private String addressLine2; + + /** + * The address line3. + */ + @JsonProperty(value = "addressLine3", required = true) + 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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/Alert.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/Alert.java new file mode 100644 index 000000000000..8a4499e0f2c4 --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.edgegateway.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.edgegateway.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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/AlertErrorDetails.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/AlertErrorDetails.java new file mode 100644 index 000000000000..188ddb7b83c6 --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway; + +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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/AlertSeverity.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/AlertSeverity.java new file mode 100644 index 000000000000..64d0ce66b065 --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway; + +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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/Alerts.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/Alerts.java new file mode 100644 index 000000000000..37a2a07915e3 --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway; + +import rx.Observable; +import com.microsoft.azure.management.edgegateway.implementation.AlertsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Alerts. + */ +public interface Alerts extends HasInner { + /** + * Returns an alert by name. + * + * @param deviceName Name of the device. + * @param name Name of the alert which needs to be retrieved. + * @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); + + /** + * Retrieves 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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/AsymmetricEncryptedSecret.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/AsymmetricEncryptedSecret.java new file mode 100644 index 000000000000..4b7140292af0 --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway; + +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 that was used to encrypt "Value". If the value in + * 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 that was used to encrypt "Value". If the value in unencrypted, it will be null. + * + * @return the encryptionCertThumbprint value + */ + public String encryptionCertThumbprint() { + return this.encryptionCertThumbprint; + } + + /** + * Set thumbprint certificate that was used to encrypt "Value". If the value in 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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/Authentication.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/Authentication.java new file mode 100644 index 000000000000..5096013481a7 --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway; + +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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/AuthenticationType.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/AuthenticationType.java new file mode 100644 index 000000000000..95b2fcdf7adb --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway; + +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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/AzureContainerDataFormat.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/AzureContainerDataFormat.java new file mode 100644 index 000000000000..fb9ea9ff7b52 --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway; + +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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/AzureContainerInfo.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/AzureContainerInfo.java new file mode 100644 index 000000000000..81d8e38b776f --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Azure container mapping of the endpoint. + */ +public class AzureContainerInfo { + /** + * ID of the Storage account credential to be used for accessing storage. + */ + @JsonProperty(value = "storageAccountCredentialId", required = true) + private String storageAccountCredentialId; + + /** + * Container name (Based on the data format specified, represents the name + * of Azure file/ 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 to be used for accessing storage. + * + * @return the storageAccountCredentialId value + */ + public String storageAccountCredentialId() { + return this.storageAccountCredentialId; + } + + /** + * Set iD of the Storage account credential to be used for accessing 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, represents the name of Azure file/ Page blob / Block blob). + * + * @return the containerName value + */ + public String containerName() { + return this.containerName; + } + + /** + * Set container name (Based on the data format specified, represents the name of Azure file/ 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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/BandwidthSchedule.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/BandwidthSchedule.java new file mode 100644 index 000000000000..ef04fc3967ee --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.edgegateway.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.edgegateway.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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/BandwidthSchedules.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/BandwidthSchedules.java new file mode 100644 index 000000000000..3428eb0b8da6 --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.edgegateway.implementation.BandwidthSchedulesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing BandwidthSchedules. + */ +public interface BandwidthSchedules extends SupportsCreating, HasInner { + /** + * Returns the properties of the specified bandwidth schedule name. + * + * @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); + + /** + * Returns 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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/ClientAccessRight.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/ClientAccessRight.java new file mode 100644 index 000000000000..815e19b68010 --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway; + +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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/ClientPermissionType.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/ClientPermissionType.java new file mode 100644 index 000000000000..6bcfac826194 --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway; + +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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/ContactDetails.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/ContactDetails.java new file mode 100644 index 000000000000..f7d2a95f5bb0 --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Contains all the contact details of the customer. + */ +public class ContactDetails { + /** + * Gets or sets the contact person. + */ + @JsonProperty(value = "contactPerson", required = true) + private String contactPerson; + + /** + * Gets or sets the name of the company. + */ + @JsonProperty(value = "companyName", required = true) + private String companyName; + + /** + * Gets or sets the phone number. + */ + @JsonProperty(value = "phone", required = true) + private String phone; + + /** + * Gets or sets the email list. + */ + @JsonProperty(value = "emailList", required = true) + private List emailList; + + /** + * Get gets or sets the contact person. + * + * @return the contactPerson value + */ + public String contactPerson() { + return this.contactPerson; + } + + /** + * Set gets or sets the contact person. + * + * @param contactPerson the contactPerson value to set + * @return the ContactDetails object itself. + */ + public ContactDetails withContactPerson(String contactPerson) { + this.contactPerson = contactPerson; + return this; + } + + /** + * Get gets or sets the name of the company. + * + * @return the companyName value + */ + public String companyName() { + return this.companyName; + } + + /** + * Set gets or sets 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 gets or sets the phone number. + * + * @return the phone value + */ + public String phone() { + return this.phone; + } + + /** + * Set gets or sets 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 gets or sets the email list. + * + * @return the emailList value + */ + public List emailList() { + return this.emailList; + } + + /** + * Set gets or sets 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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/DataBoxEdgeDevice.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/DataBoxEdgeDevice.java new file mode 100644 index 000000000000..0cf75d07ad5b --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway; + +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.edgegateway.implementation.DataBoxEdgeManager; +import java.util.List; +import com.microsoft.azure.management.edgegateway.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 of 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 of 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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/DataBoxEdgeDeviceExtendedInfo.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/DataBoxEdgeDeviceExtendedInfo.java new file mode 100644 index 000000000000..229b82c32106 --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/DataBoxEdgeDeviceExtendedInfo.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.edgegateway; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.edgegateway.implementation.DataBoxEdgeManager; +import com.microsoft.azure.management.edgegateway.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 integrityKey value. + */ + String integrityKey(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the resourceKey value. + */ + String resourceKey(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/DataBoxEdgeDevicePatch.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/DataBoxEdgeDevicePatch.java new file mode 100644 index 000000000000..f482f43cc8f1 --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway; + +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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/DataBoxEdgeDeviceStatus.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/DataBoxEdgeDeviceStatus.java new file mode 100644 index 000000000000..25f18cd5e0f5 --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway; + +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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/DataPolicy.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/DataPolicy.java new file mode 100644 index 000000000000..4afd988faa27 --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway; + +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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/DayOfWeek.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/DayOfWeek.java new file mode 100644 index 000000000000..3c27c30ebb4a --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway; + +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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/DeviceType.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/DeviceType.java new file mode 100644 index 000000000000..f6f06d454b44 --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway; + +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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/Devices.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/Devices.java new file mode 100644 index 000000000000..805801da49e3 --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/Devices.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.edgegateway; + +import rx.Observable; +import com.microsoft.azure.management.edgegateway.DataBoxEdgeDevice; +import rx.Completable; +import com.microsoft.azure.management.edgegateway.implementation.DataBoxEdgeDeviceExtendedInfoInner; + +/** + * 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); + + /** + * Returns 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); + + /** + * Retrieves all 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); + + /** + * Retrieves all 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 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 downloadUpdatesAsync(String deviceName, String resourceGroupName); + + /** + * Creates or updates the extended info of the data box edge/gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param parameters The device extended information. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable createOrUpdateExtendedInfoAsync(String deviceName, String resourceGroupName, DataBoxEdgeDeviceExtendedInfoInner parameters); + + /** + * Returns the extended information 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 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); + + /** + * Returns information about the availability of updates as per the last scan done on the device. It also returns 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); + + /** + * Returns 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 deviceAdminPassword Device administrator password as an encrypted string (encrypted using RSA PKCS #1) is used to log into the local web UI of the device. Actual password could have at least 8 characters that are a combination of uppercase, lowercase, numeric, and special characters. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable createOrUpdateSecuritySettingsAsync(String deviceName, String resourceGroupName, AsymmetricEncryptedSecret deviceAdminPassword); + +} diff --git a/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/DownloadPhase.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/DownloadPhase.java new file mode 100644 index 000000000000..74ed07068c7b --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway; + +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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/EncryptionAlgorithm.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/EncryptionAlgorithm.java new file mode 100644 index 000000000000..517a9829fcad --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway; + +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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/FileEventTrigger.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/FileEventTrigger.java new file mode 100644 index 000000000000..4391c2e9b79f --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway; + +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.edgegateway.implementation.TriggerInner; + +/** + * Trigger details. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("FileEvent") +@JsonFlatten +public class FileEventTrigger extends TriggerInner { + /** + * File event source details. + */ + @JsonProperty(value = "properties.sourceInfo") + private FileSourceInfo sourceInfo; + + /** + * Role Sink info. + */ + @JsonProperty(value = "properties.sinkInfo") + private RoleSinkInfo sinkInfo; + + /** + * Custom context tag, typically used to co-relate the trigger against its + * usage. Eg. If a PeriodicTimer trigger may be intended for certain + * specific IOT modules in device, the tag can be the name/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 custom context tag, typically used to co-relate the trigger against its usage. Eg. If a PeriodicTimer trigger may be intended for certain specific IOT modules in device, the tag can be the name/image url of the module. + * + * @return the customContextTag value + */ + public String customContextTag() { + return this.customContextTag; + } + + /** + * Set custom context tag, typically used to co-relate the trigger against its usage. Eg. If a PeriodicTimer trigger may be intended for certain specific IOT modules in device, the tag can be the name/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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/FileSourceInfo.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/FileSourceInfo.java new file mode 100644 index 000000000000..48daafea6650 --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway; + +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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/InstallRebootBehavior.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/InstallRebootBehavior.java new file mode 100644 index 000000000000..540af2c8f863 --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway; + +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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/IoTDeviceInfo.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/IoTDeviceInfo.java new file mode 100644 index 000000000000..6e4f5fc111c0 --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway; + +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 IoT hub which is 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 IoT hub which is associated to the device. + * + * @return the ioTHostHub value + */ + public String ioTHostHub() { + return this.ioTHostHub; + } + + /** + * Set host name for IoT hub which is 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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/IoTRole.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/IoTRole.java new file mode 100644 index 000000000000..ae0dcb4286f6 --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway; + +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.edgegateway.implementation.RoleInner; + +/** + * Compute role. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("IOT") +@JsonFlatten +public class IoTRole extends RoleInner { + /** + * Host OS which IoT role support. 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 which IoT role support. Possible values include: 'Windows', 'Linux'. + * + * @return the hostPlatform value + */ + public PlatformType hostPlatform() { + return this.hostPlatform; + } + + /** + * Set host OS which IoT role support. 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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/Ipv4Config.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/Ipv4Config.java new file mode 100644 index 000000000000..c5b3c0336b86 --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway; + +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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/Ipv6Config.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/Ipv6Config.java new file mode 100644 index 000000000000..7d5b5d16c291 --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway; + +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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/Job.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/Job.java new file mode 100644 index 000000000000..267f131476b7 --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/Job.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.edgegateway; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.edgegateway.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.edgegateway.implementation.DataBoxEdgeManager; +import org.joda.time.DateTime; + +/** + * Type representing Job. + */ +public interface Job 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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/JobErrorDetails.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/JobErrorDetails.java new file mode 100644 index 000000000000..29eac897e033 --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The job error information containing List of JobErrorItem. + */ +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 intended to describe 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 intended to describe the error in detail. + * + * @return the message value + */ + public String message() { + return this.message; + } + +} diff --git a/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/JobErrorItem.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/JobErrorItem.java new file mode 100644 index 000000000000..cf25d73d9028 --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway; + +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 intended to describe 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 intended to describe the error in detail. + * + * @return the message value + */ + public String message() { + return this.message; + } + +} diff --git a/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/JobStatus.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/JobStatus.java new file mode 100644 index 000000000000..32491bd9200b --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway; + +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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/JobType.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/JobType.java new file mode 100644 index 000000000000..77fe489e6420 --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway; + +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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/MetricAggregationType.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/MetricAggregationType.java new file mode 100644 index 000000000000..ea51c52a966e --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway; + +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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/MetricCategory.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/MetricCategory.java new file mode 100644 index 000000000000..63e705029d3a --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway; + +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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/MetricDimensionV1.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/MetricDimensionV1.java new file mode 100644 index 000000000000..fe5b73d54c3a --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway; + +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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/MetricSpecificationV1.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/MetricSpecificationV1.java new file mode 100644 index 000000000000..4560d9566193 --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway; + +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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/MetricUnit.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/MetricUnit.java new file mode 100644 index 000000000000..56089b1c1470 --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway; + +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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/MonitoringStatus.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/MonitoringStatus.java new file mode 100644 index 000000000000..a3db64b767e2 --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway; + +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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/MountPointMap.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/MountPointMap.java new file mode 100644 index 000000000000..3bf62444949d --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The share mount point. + */ +public class MountPointMap { + /** + * ID of the share which is mounted to 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 which is mounted to role VM. + * + * @return the shareId value + */ + public String shareId() { + return this.shareId; + } + + /** + * Set iD of the share which is mounted to 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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/NetworkAdapter.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/NetworkAdapter.java new file mode 100644 index 000000000000..23d0fe542c79 --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway; + +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 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 DNS Servers of the device. + * + * @return the dnsServers value + */ + public List dnsServers() { + return this.dnsServers; + } + +} diff --git a/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/NetworkAdapterDHCPStatus.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/NetworkAdapterDHCPStatus.java new file mode 100644 index 000000000000..6dc5babb89bc --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway; + +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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/NetworkAdapterPosition.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/NetworkAdapterPosition.java new file mode 100644 index 000000000000..bd834d8be045 --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway; + +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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/NetworkAdapterRDMAStatus.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/NetworkAdapterRDMAStatus.java new file mode 100644 index 000000000000..8a8dd1215475 --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway; + +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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/NetworkAdapterStatus.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/NetworkAdapterStatus.java new file mode 100644 index 000000000000..f0ead31274ca --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway; + +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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/NetworkGroup.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/NetworkGroup.java new file mode 100644 index 000000000000..43b2c2958bff --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway; + +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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/NetworkSettings.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/NetworkSettings.java new file mode 100644 index 000000000000..0b2fc5198d84 --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.edgegateway.implementation.DataBoxEdgeManager; +import com.microsoft.azure.management.edgegateway.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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/Operation.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/Operation.java new file mode 100644 index 000000000000..00e3c967ccdc --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.edgegateway.implementation.DataBoxEdgeManager; +import com.microsoft.azure.management.edgegateway.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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/OperationDisplay.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/OperationDisplay.java new file mode 100644 index 000000000000..3b69835e6a20 --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway; + +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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/Operations.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/Operations.java new file mode 100644 index 000000000000..119150b63dcc --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway; + +import rx.Observable; +import com.microsoft.azure.management.edgegateway.implementation.OperationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Operations. + */ +public interface Operations extends HasInner { + /** + * Lists all the operations supported. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(); + +} diff --git a/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/OperationsStatus.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/OperationsStatus.java new file mode 100644 index 000000000000..2fdb15207fae --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway; + +import rx.Observable; +import com.microsoft.azure.management.edgegateway.implementation.OperationsStatusInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing OperationsStatus. + */ +public interface OperationsStatus extends HasInner { + /** + * Returns the job details of the 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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/Order.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/Order.java new file mode 100644 index 000000000000..d7925f03a5f1 --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.edgegateway.implementation.OrderInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.edgegateway.implementation.DataBoxEdgeManager; +import java.util.List; + +/** + * Type representing Order. + */ +public interface Order extends HasInner, HasManager { + /** + * @return the changeStatusTo value. + */ + OrderStatus changeStatusTo(); + + /** + * @return the contactInformation value. + */ + ContactDetails contactInformation(); + + /** + * @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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/OrderStatus.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/OrderStatus.java new file mode 100644 index 000000000000..bea67ddceb0f --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/OrderStatus.java @@ -0,0 +1,90 @@ +/** + * 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.edgegateway; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Represents a single status change. + */ +public class OrderStatus { + /** + * Status of the order pertaining to the allowed StatusTypes. Possible + * values include: 'Untracked', 'AwaitingFulfilment', + * 'AwaitingPreparation', 'AwaitingShipment', 'Shipped', 'Arriving', + * 'Delivered', 'ReplacementRequested', 'LostDevice', 'Declined', + * 'ReturnInitiated', 'AwaitingReturnShipment', 'ShippedBack', + * 'CollectedAtMicrosoft'. + */ + @JsonProperty(value = "status", required = true) + private StatusTypes 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 pertaining to the allowed StatusTypes. Possible values include: 'Untracked', 'AwaitingFulfilment', 'AwaitingPreparation', 'AwaitingShipment', 'Shipped', 'Arriving', 'Delivered', 'ReplacementRequested', 'LostDevice', 'Declined', 'ReturnInitiated', 'AwaitingReturnShipment', 'ShippedBack', 'CollectedAtMicrosoft'. + * + * @return the status value + */ + public StatusTypes status() { + return this.status; + } + + /** + * Set status of the order pertaining to the allowed StatusTypes. 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(StatusTypes 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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/Orders.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/Orders.java new file mode 100644 index 000000000000..472a226baee6 --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway; + +import rx.Observable; +import rx.Completable; +import com.microsoft.azure.management.edgegateway.implementation.OrderInner; +import com.microsoft.azure.management.edgegateway.implementation.OrdersInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Orders. + */ +public interface Orders extends HasInner { + /** + * Get a specific order by name. + * + * @param deviceName Name of the device. + * @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 Name of the edge device for which order needs to be added or updated. + * @param resourceGroupName The resource group name. + * @param order Order to be added. + * @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 Name of the device. + * @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); + + /** + * List all the orders related to the device. + * + * @param deviceName Name of the device. + * @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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/PeriodicTimerEventTrigger.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/PeriodicTimerEventTrigger.java new file mode 100644 index 000000000000..900462473649 --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway; + +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.edgegateway.implementation.TriggerInner; + +/** + * Trigger details. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("PeriodicTimerEvent") +@JsonFlatten +public class PeriodicTimerEventTrigger extends TriggerInner { + /** + * Periodic timer details. + */ + @JsonProperty(value = "properties.sourceInfo") + private PeriodicTimerSourceInfo sourceInfo; + + /** + * Role Sink info. + */ + @JsonProperty(value = "properties.sinkInfo") + private RoleSinkInfo sinkInfo; + + /** + * Custom context tag, typically used to co-relate the trigger against its + * usage. Eg. If a PeriodicTimer trigger may be intended for certain + * specific IOT modules in device, the tag can be the name/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 info. + * + * @return the sinkInfo value + */ + public RoleSinkInfo sinkInfo() { + return this.sinkInfo; + } + + /** + * Set role Sink info. + * + * @param sinkInfo the sinkInfo value to set + * @return the PeriodicTimerEventTrigger object itself. + */ + public PeriodicTimerEventTrigger withSinkInfo(RoleSinkInfo sinkInfo) { + this.sinkInfo = sinkInfo; + return this; + } + + /** + * Get custom context tag, typically used to co-relate the trigger against its usage. Eg. If a PeriodicTimer trigger may be intended for certain specific IOT modules in device, the tag can be the name/image url of the module. + * + * @return the customContextTag value + */ + public String customContextTag() { + return this.customContextTag; + } + + /** + * Set custom context tag, typically used to co-relate the trigger against its usage. Eg. If a PeriodicTimer trigger may be intended for certain specific IOT modules in device, the tag can be the name/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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/PeriodicTimerSourceInfo.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/PeriodicTimerSourceInfo.java new file mode 100644 index 000000000000..6783eabeb549 --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/PeriodicTimerSourceInfo.java @@ -0,0 +1,98 @@ +/** + * 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.edgegateway; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Periodic timer event source. + */ +public class PeriodicTimerSourceInfo { + /** + * Time time [UTC] of the day, from which the trigger will be valid. + * Schedule will be computed with reference to the time specified. + */ + @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 with which periodic events needs to be published to IOT device. + */ + @JsonProperty(value = "topic") + private String topic; + + /** + * Get time time [UTC] of the day, from which the trigger will be valid. Schedule will be computed with reference to the time specified. + * + * @return the startTime value + */ + public DateTime startTime() { + return this.startTime; + } + + /** + * Set time time [UTC] of the day, from which the trigger will be valid. Schedule will be computed with reference to the time specified. + * + * @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 with which periodic events needs to be published to IOT device. + * + * @return the topic value + */ + public String topic() { + return this.topic; + } + + /** + * Set topic with which periodic events needs to be 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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/PlatformType.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/PlatformType.java new file mode 100644 index 000000000000..2f3c02f64adb --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway; + +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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/RefreshDetails.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/RefreshDetails.java new file mode 100644 index 000000000000..378c27737573 --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/RefreshDetails.java @@ -0,0 +1,135 @@ +/** + * 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.edgegateway; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Fields for tracking refresh job on the share. + */ +public class RefreshDetails { + /** + * If a RefreshShare job is currently inprogress on this share - this field + * indicates the ArmId of that job. Empty otherwise. + */ + @JsonProperty(value = "inProgressRefreshJobId") + private String inProgressRefreshJobId; + + /** + * Indicates the job completed time of 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 RefreshShare job is currently inprogress on this share - this field indicates the ArmId of that job. Empty otherwise. + * + * @return the inProgressRefreshJobId value + */ + public String inProgressRefreshJobId() { + return this.inProgressRefreshJobId; + } + + /** + * Set if a RefreshShare job is currently inprogress on this share - this field indicates the ArmId of that job. Empty otherwise. + * + * @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 job completed time of 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 job completed time of 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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/Role.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/Role.java new file mode 100644 index 000000000000..171c3b88fce1 --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.edgegateway.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.edgegateway.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 Name of the device in which the role needs to be added or updated + * @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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/RoleSinkInfo.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/RoleSinkInfo.java new file mode 100644 index 000000000000..9181883ecd5e --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway; + +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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/RoleStatus.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/RoleStatus.java new file mode 100644 index 000000000000..7801dd54e249 --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway; + +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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/RoleTypes.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/RoleTypes.java new file mode 100644 index 000000000000..fe9d28e7f97d --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway; + +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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/Roles.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/Roles.java new file mode 100644 index 000000000000..97fb9fd7bd94 --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.edgegateway.implementation.RolesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Roles. + */ +public interface Roles extends SupportsCreating, HasInner { + /** + * Get a specific role by name. + * + * @param deviceName Name of the device. + * @param name Name of role to be fetched. + * @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 Name of the device. + * @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 gateway device. + * + * @param deviceName Name of the device. + * @param name Name of the role which needs to be deleted. + * @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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/SSLStatus.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/SSLStatus.java new file mode 100644 index 000000000000..ffaf954b3d0e --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway; + +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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/SecuritySettings.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/SecuritySettings.java new file mode 100644 index 000000000000..14a8edcaa702 --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway; + +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 log into the local web UI of the device. Actual + * password could 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 log into the local web UI of the device. Actual password could 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 log into the local web UI of the device. Actual password could 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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/ServiceSpecification.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/ServiceSpecification.java new file mode 100644 index 000000000000..48fe3aa11761 --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway; + +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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/Share.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/Share.java new file mode 100644 index 000000000000..1ca4d2463ef7 --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.edgegateway.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.edgegateway.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 Name of the device + * @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(mandatory 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 (mandatory 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(mandatory 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 (mandatory for SMB protocol) + * @return the next update stage + */ + Update withUserAccessRights(List userAccessRights); + } + + } +} diff --git a/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/ShareAccessProtocol.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/ShareAccessProtocol.java new file mode 100644 index 000000000000..d159666eb02f --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway; + +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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/ShareAccessRight.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/ShareAccessRight.java new file mode 100644 index 000000000000..a68e6b3152a1 --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway; + +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 { + /** + * Id of the share. + */ + @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 id of the share. + * + * @return the shareId value + */ + public String shareId() { + return this.shareId; + } + + /** + * Set id of the share. + * + * @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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/ShareAccessType.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/ShareAccessType.java new file mode 100644 index 000000000000..664539ccdf12 --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway; + +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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/ShareStatus.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/ShareStatus.java new file mode 100644 index 000000000000..ff0db37c67a3 --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway; + +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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/Shares.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/Shares.java new file mode 100644 index 000000000000..556e32aaaca1 --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.edgegateway.implementation.SharesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Shares. + */ +public interface Shares extends SupportsCreating, HasInner { + /** + * Triggers a manual refresh of the share metadata with the actual cloud storage account. + * + * @param deviceName Name of the device. + * @param name Name of the share. + * @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); + + /** + * Returns a particular share by name. + * + * @param deviceName Name of the device. + * @param name Name of the share. + * @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 Name of the device. + * @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 Name of the device. + * @param name Name of the share which needs to be deleted. + * @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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/Sku.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/Sku.java new file mode 100644 index 000000000000..e96c414c72d3 --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway; + +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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/SkuName.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/SkuName.java new file mode 100644 index 000000000000..46af25d12b74 --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway; + +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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/SkuTier.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/SkuTier.java new file mode 100644 index 000000000000..676c7d3af6b2 --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway; + +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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/StatusTypes.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/StatusTypes.java new file mode 100644 index 000000000000..9849f5fce087 --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/StatusTypes.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.edgegateway; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for StatusTypes. + */ +public final class StatusTypes extends ExpandableStringEnum { + /** Static value Untracked for StatusTypes. */ + public static final StatusTypes UNTRACKED = fromString("Untracked"); + + /** Static value AwaitingFulfilment for StatusTypes. */ + public static final StatusTypes AWAITING_FULFILMENT = fromString("AwaitingFulfilment"); + + /** Static value AwaitingPreparation for StatusTypes. */ + public static final StatusTypes AWAITING_PREPARATION = fromString("AwaitingPreparation"); + + /** Static value AwaitingShipment for StatusTypes. */ + public static final StatusTypes AWAITING_SHIPMENT = fromString("AwaitingShipment"); + + /** Static value Shipped for StatusTypes. */ + public static final StatusTypes SHIPPED = fromString("Shipped"); + + /** Static value Arriving for StatusTypes. */ + public static final StatusTypes ARRIVING = fromString("Arriving"); + + /** Static value Delivered for StatusTypes. */ + public static final StatusTypes DELIVERED = fromString("Delivered"); + + /** Static value ReplacementRequested for StatusTypes. */ + public static final StatusTypes REPLACEMENT_REQUESTED = fromString("ReplacementRequested"); + + /** Static value LostDevice for StatusTypes. */ + public static final StatusTypes LOST_DEVICE = fromString("LostDevice"); + + /** Static value Declined for StatusTypes. */ + public static final StatusTypes DECLINED = fromString("Declined"); + + /** Static value ReturnInitiated for StatusTypes. */ + public static final StatusTypes RETURN_INITIATED = fromString("ReturnInitiated"); + + /** Static value AwaitingReturnShipment for StatusTypes. */ + public static final StatusTypes AWAITING_RETURN_SHIPMENT = fromString("AwaitingReturnShipment"); + + /** Static value ShippedBack for StatusTypes. */ + public static final StatusTypes SHIPPED_BACK = fromString("ShippedBack"); + + /** Static value CollectedAtMicrosoft for StatusTypes. */ + public static final StatusTypes COLLECTED_AT_MICROSOFT = fromString("CollectedAtMicrosoft"); + + /** + * Creates or finds a StatusTypes from its string representation. + * @param name a name to look for + * @return the corresponding StatusTypes + */ + @JsonCreator + public static StatusTypes fromString(String name) { + return fromString(name, StatusTypes.class); + } + + /** + * @return known StatusTypes values + */ + public static Collection values() { + return values(StatusTypes.class); + } +} diff --git a/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/StorageAccountCredential.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/StorageAccountCredential.java new file mode 100644 index 000000000000..7ca86e9a405e --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.edgegateway.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.edgegateway.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 Name of the device + * @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 ConnectionString for the storage account. This needs to be specified if UserName/AccountKey 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 ConnectionString for the storage account. This needs to be specified if UserName/AccountKey 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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/StorageAccountCredentials.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/StorageAccountCredentials.java new file mode 100644 index 000000000000..5123f8939d23 --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.edgegateway.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 Name of the device. + * @param name Name of the storage account credential to be fetched. + * @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 Name of the device. + * @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 Name of the device. + * @param name Name of the storage account credential. + * @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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/SymmetricKey.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/SymmetricKey.java new file mode 100644 index 000000000000..aeb29d0f1bb0 --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Symmetric Key for authentication. + */ +public class SymmetricKey { + /** + * Connection string based on symmetric key. + */ + @JsonProperty(value = "connectionString") + private AsymmetricEncryptedSecret connectionString; + + /** + * Get connection string based on symmetric key. + * + * @return the connectionString value + */ + public AsymmetricEncryptedSecret connectionString() { + return this.connectionString; + } + + /** + * Set connection string based on 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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/TimeGrain.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/TimeGrain.java new file mode 100644 index 000000000000..4d23861504d5 --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway; + +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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/TrackingInfo.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/TrackingInfo.java new file mode 100644 index 000000000000..a22974d79a55 --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway; + +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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/Trigger.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/Trigger.java new file mode 100644 index 000000000000..1603e443bc58 --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.edgegateway.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.edgegateway.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 Name of the edge device in which trigger needs to be added or updated + * @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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/Triggers.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/Triggers.java new file mode 100644 index 000000000000..9f81769067eb --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.edgegateway.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 Name of the device. + * @param name Name of trigger to be fetched. + * @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); + + /** + * List all the triggers configured in the device. + * + * @param deviceName Name of the device. + * @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 Name of the device. + * @param name Name of the trigger which needs to be deleted. + * @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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/UpdateDownloadProgress.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/UpdateDownloadProgress.java new file mode 100644 index 000000000000..bad3416f2d01 --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway; + +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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/UpdateInstallProgress.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/UpdateInstallProgress.java new file mode 100644 index 000000000000..dcea519d6d49 --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Details about the progress during installation of updates. + */ +public class UpdateInstallProgress { + /** + * Percentage of completion. + */ + @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 of completion. + * + * @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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/UpdateOperation.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/UpdateOperation.java new file mode 100644 index 000000000000..7d1f327f74a2 --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway; + +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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/UpdateOperationStage.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/UpdateOperationStage.java new file mode 100644 index 000000000000..ccf102e4128d --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway; + +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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/UpdateSummary.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/UpdateSummary.java new file mode 100644 index 000000000000..f05654cce422 --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.edgegateway.implementation.DataBoxEdgeManager; +import com.microsoft.azure.management.edgegateway.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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/UploadCertificateRequest.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/UploadCertificateRequest.java new file mode 100644 index 000000000000..0ffa58575d9b --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway; + +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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/UploadCertificateResponse.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/UploadCertificateResponse.java new file mode 100644 index 000000000000..13e26e25e792 --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.edgegateway.implementation.DataBoxEdgeManager; +import com.microsoft.azure.management.edgegateway.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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/User.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/User.java new file mode 100644 index 000000000000..3e41039ef6bb --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.edgegateway.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.edgegateway.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 details of the password specified for the user + * @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 details of the password specified for the user + * @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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/UserAccessRight.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/UserAccessRight.java new file mode 100644 index 000000000000..6c63484529bc --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/UserAccessRight.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.edgegateway; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The mapping between a particular user and the type of access they have on + * the SMB share. + */ +public class UserAccessRight { + /** + * Id of the user (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 id of the user (already existing in the device). + * + * @return the userId value + */ + public String userId() { + return this.userId; + } + + /** + * Set id of the user (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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/Users.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/Users.java new file mode 100644 index 000000000000..46888dfaeadb --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.edgegateway.implementation.UsersInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Users. + */ +public interface Users extends SupportsCreating, HasInner { + /** + * Returns the properties of the specified user. + * + * @param deviceName The device name. + * @param name The name of the user who needs to be retrieved. + * @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); + + /** + * Returns all the users registered 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 user on a databox edge/gateway device. + * + * @param deviceName The device name. + * @param name The name of the user who needs to be deleted. + * @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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/AlertImpl.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/AlertImpl.java new file mode 100644 index 000000000000..31e1761f1916 --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway.implementation; + +import com.microsoft.azure.management.edgegateway.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.edgegateway.AlertErrorDetails; +import com.microsoft.azure.management.edgegateway.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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/AlertInner.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/AlertInner.java new file mode 100644 index 000000000000..ec9b9efc4dac --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway.implementation; + +import org.joda.time.DateTime; +import com.microsoft.azure.management.edgegateway.AlertSeverity; +import com.microsoft.azure.management.edgegateway.AlertErrorDetails; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.management.edgegateway.ARMBaseModel; + +/** + * Alert on the data box edge/gateway device. + */ +@JsonFlatten +public class AlertInner extends ARMBaseModel { + /** + * Title of the alert. + */ + @JsonProperty(value = "properties.title", access = JsonProperty.Access.WRITE_ONLY) + private String title; + + /** + * Type of the alert. + */ + @JsonProperty(value = "properties.alertType", access = JsonProperty.Access.WRITE_ONLY) + private String alertType; + + /** + * UTC time at which the alert appeared. + */ + @JsonProperty(value = "properties.appearedAtDateTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime appearedAtDateTime; + + /** + * Recommendation for acting on the alert. + */ + @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; + + /** + * Detailed information about the alert. + */ + @JsonProperty(value = "properties.detailedInformation", access = JsonProperty.Access.WRITE_ONLY) + private Map detailedInformation; + + /** + * Get title of the alert. + * + * @return the title value + */ + public String title() { + return this.title; + } + + /** + * Get type of the alert. + * + * @return the alertType value + */ + public String alertType() { + return this.alertType; + } + + /** + * Get uTC time at which the alert appeared. + * + * @return the appearedAtDateTime value + */ + public DateTime appearedAtDateTime() { + return this.appearedAtDateTime; + } + + /** + * Get recommendation for acting on the alert. + * + * @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 detailed information about the alert. + * + * @return the detailedInformation value + */ + public Map detailedInformation() { + return this.detailedInformation; + } + +} diff --git a/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/AlertsImpl.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/AlertsImpl.java new file mode 100644 index 000000000000..268214c484b2 --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/AlertsImpl.java @@ -0,0 +1,65 @@ +/** + * 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.edgegateway.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.edgegateway.Alerts; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.edgegateway.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) + .map(new Func1() { + @Override + public Alert call(AlertInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/AlertsInner.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/AlertsInner.java new file mode 100644 index 000000000000..7acee0e9e2e7 --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway.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.edgegateway.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.edgegateway.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.edgegateway.Alerts listByDataBoxEdgeDeviceNext" }) + @GET + Observable> listByDataBoxEdgeDeviceNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Retrieves 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(); + } + }; + } + + /** + * Retrieves 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); + } + + /** + * Retrieves 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(); + } + }); + } + + /** + * Retrieves 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)); + } + }); + } + + /** + * Retrieves 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); + } + + /** + * Returns an alert by name. + * + * @param deviceName Name of the device. + * @param name Name of the alert which needs to be retrieved. + * @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(); + } + + /** + * Returns an alert by name. + * + * @param deviceName Name of the device. + * @param name Name of the alert which needs to be retrieved. + * @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); + } + + /** + * Returns an alert by name. + * + * @param deviceName Name of the device. + * @param name Name of the alert which needs to be retrieved. + * @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(); + } + }); + } + + /** + * Returns an alert by name. + * + * @param deviceName Name of the device. + * @param name Name of the alert which needs to be retrieved. + * @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); + } + + /** + * Retrieves 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(); + } + }; + } + + /** + * Retrieves 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); + } + + /** + * Retrieves 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(); + } + }); + } + + /** + * Retrieves 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)); + } + }); + } + + /** + * Retrieves 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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/BandwidthScheduleImpl.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/BandwidthScheduleImpl.java new file mode 100644 index 000000000000..259b459b9445 --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway.implementation; + +import com.microsoft.azure.management.edgegateway.BandwidthSchedule; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.management.edgegateway.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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/BandwidthScheduleInner.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/BandwidthScheduleInner.java new file mode 100644 index 000000000000..285bcf36a08b --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway.implementation; + +import java.util.List; +import com.microsoft.azure.management.edgegateway.DayOfWeek; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.management.edgegateway.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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/BandwidthSchedulesImpl.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/BandwidthSchedulesImpl.java new file mode 100644 index 000000000000..da1b0e6d5e9a --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/BandwidthSchedulesImpl.java @@ -0,0 +1,81 @@ +/** + * 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.edgegateway.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.edgegateway.BandwidthSchedules; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.edgegateway.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) + .map(new Func1() { + @Override + public BandwidthSchedule call(BandwidthScheduleInner inner) { + return 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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/BandwidthSchedulesInner.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/BandwidthSchedulesInner.java new file mode 100644 index 000000000000..283359abe380 --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway.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.edgegateway.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.edgegateway.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.edgegateway.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.edgegateway.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.edgegateway.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.edgegateway.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.edgegateway.BandwidthSchedules listByDataBoxEdgeDeviceNext" }) + @GET + Observable> listByDataBoxEdgeDeviceNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Returns 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(); + } + }; + } + + /** + * Returns 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); + } + + /** + * Returns 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(); + } + }); + } + + /** + * Returns 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)); + } + }); + } + + /** + * Returns 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); + } + + /** + * Returns the properties of the specified bandwidth schedule name. + * + * @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(); + } + + /** + * Returns the properties of the specified bandwidth schedule name. + * + * @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); + } + + /** + * Returns the properties of the specified bandwidth schedule name. + * + * @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(); + } + }); + } + + /** + * Returns the properties of the specified bandwidth schedule name. + * + * @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); + } + + /** + * Returns 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(); + } + }; + } + + /** + * Returns 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); + } + + /** + * Returns 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(); + } + }); + } + + /** + * Returns 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)); + } + }); + } + + /** + * Returns 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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/DataBoxEdgeDeviceExtendedInfoImpl.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/DataBoxEdgeDeviceExtendedInfoImpl.java new file mode 100644 index 000000000000..a77e93b1acce --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/DataBoxEdgeDeviceExtendedInfoImpl.java @@ -0,0 +1,61 @@ +/** + * 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.edgegateway.implementation; + +import com.microsoft.azure.management.edgegateway.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 integrityKey() { + return this.inner().integrityKey(); + } + + @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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/DataBoxEdgeDeviceExtendedInfoInner.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/DataBoxEdgeDeviceExtendedInfoInner.java new file mode 100644 index 000000000000..d7fc7577f53e --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/DataBoxEdgeDeviceExtendedInfoInner.java @@ -0,0 +1,114 @@ +/** + * 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.edgegateway.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.management.edgegateway.ARMBaseModel; + +/** + * The extended Info of the Data Box Edge/Gateway device. + */ +@JsonFlatten +public class DataBoxEdgeDeviceExtendedInfoInner extends ARMBaseModel { + /** + * The Channel Integrity Key (CIK) of the device. + */ + @JsonProperty(value = "properties.integrityKey", required = true) + private String integrityKey; + + /** + * The certificate thumbprint that was used to encrypt the Channel + * Integrity Key (CIK). + */ + @JsonProperty(value = "properties.encryptionKeyThumbprint") + private String encryptionKeyThumbprint; + + /** + * The Channel Integrity Key (CIK) of the device. + */ + @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 Channel Integrity Key (CIK) of the device. + * + * @return the integrityKey value + */ + public String integrityKey() { + return this.integrityKey; + } + + /** + * Set the Channel Integrity Key (CIK) of the device. + * + * @param integrityKey the integrityKey value to set + * @return the DataBoxEdgeDeviceExtendedInfoInner object itself. + */ + public DataBoxEdgeDeviceExtendedInfoInner withIntegrityKey(String integrityKey) { + this.integrityKey = integrityKey; + return this; + } + + /** + * Get the certificate thumbprint that was used to encrypt the Channel Integrity Key (CIK). + * + * @return the encryptionKeyThumbprint value + */ + public String encryptionKeyThumbprint() { + return this.encryptionKeyThumbprint; + } + + /** + * Set the certificate thumbprint that was used to encrypt the Channel Integrity Key (CIK). + * + * @param encryptionKeyThumbprint the encryptionKeyThumbprint value to set + * @return the DataBoxEdgeDeviceExtendedInfoInner object itself. + */ + public DataBoxEdgeDeviceExtendedInfoInner withEncryptionKeyThumbprint(String encryptionKeyThumbprint) { + this.encryptionKeyThumbprint = encryptionKeyThumbprint; + return this; + } + + /** + * Get the Channel Integrity Key (CIK) of the device. + * + * @return the encryptionKey value + */ + public String encryptionKey() { + return this.encryptionKey; + } + + /** + * Set the Channel Integrity Key (CIK) of the device. + * + * @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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/DataBoxEdgeDeviceImpl.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/DataBoxEdgeDeviceImpl.java new file mode 100644 index 000000000000..a73dde2a90f8 --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.edgegateway.DataBoxEdgeDevice; +import rx.Observable; +import com.microsoft.azure.management.edgegateway.Sku; +import com.microsoft.azure.management.edgegateway.DataBoxEdgeDeviceStatus; +import com.microsoft.azure.management.edgegateway.DeviceType; +import java.util.List; +import com.microsoft.azure.management.edgegateway.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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/DataBoxEdgeDeviceInner.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/DataBoxEdgeDeviceInner.java new file mode 100644 index 000000000000..aee021c5c769 --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway.implementation; + +import java.util.Map; +import com.microsoft.azure.management.edgegateway.Sku; +import com.microsoft.azure.management.edgegateway.DataBoxEdgeDeviceStatus; +import com.microsoft.azure.management.edgegateway.DeviceType; +import java.util.List; +import com.microsoft.azure.management.edgegateway.RoleTypes; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.management.edgegateway.ARMBaseModel; + +/** + * The Data Box Edge/Gateway device. + */ +@JsonFlatten +public class DataBoxEdgeDeviceInner extends ARMBaseModel { + /** + * The location of the device. This will be one of the supported and + * registered Azure Geo Regions (e.g. West US, East US, Southeast Asia, + * etc.). The geo region of a device cannot be changed once it is created, + * but if an identical geo 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 in + * viewing and grouping this device (across resource groups). + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * The sku type. + */ + @JsonProperty(value = "sku") + private Sku sku; + + /** + * The etag of 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 will be one of the supported and registered Azure Geo Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a device cannot be changed once it is created, but if an identical geo 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 will be one of the supported and registered Azure Geo Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a device cannot be changed once it is created, but if an identical geo 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 in viewing and grouping 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 in viewing and grouping 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 of the devices. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag of 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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/DataBoxEdgeManagementClientImpl.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/DataBoxEdgeManagementClientImpl.java new file mode 100644 index 000000000000..ffe7a71f845d --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/DataBoxEdgeManagementClientImpl.java @@ -0,0 +1,336 @@ +/** + * 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.edgegateway.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 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 = "2018-07-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.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", "2018-07-01"); + } +} diff --git a/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/DataBoxEdgeManager.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/DataBoxEdgeManager.java new file mode 100644 index 000000000000..9ed37ef45e15 --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/DataBoxEdgeManager.java @@ -0,0 +1,219 @@ +/** + * 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.edgegateway.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.edgegateway.Operations; +import com.microsoft.azure.management.edgegateway.Devices; +import com.microsoft.azure.management.edgegateway.Alerts; +import com.microsoft.azure.management.edgegateway.BandwidthSchedules; +import com.microsoft.azure.management.edgegateway.OperationsStatus; +import com.microsoft.azure.management.edgegateway.Orders; +import com.microsoft.azure.management.edgegateway.Roles; +import com.microsoft.azure.management.edgegateway.Shares; +import com.microsoft.azure.management.edgegateway.StorageAccountCredentials; +import com.microsoft.azure.management.edgegateway.Triggers; +import com.microsoft.azure.management.edgegateway.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 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 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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/DevicesImpl.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/DevicesImpl.java new file mode 100644 index 000000000000..ea543f38c914 --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/DevicesImpl.java @@ -0,0 +1,191 @@ +/** + * 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.edgegateway.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.edgegateway.Devices; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.management.edgegateway.DataBoxEdgeDevice; +import com.microsoft.azure.Page; +import rx.Completable; +import com.microsoft.azure.management.edgegateway.DataBoxEdgeDeviceExtendedInfo; +import com.microsoft.azure.management.edgegateway.UpdateSummary; +import com.microsoft.azure.management.edgegateway.UploadCertificateResponse; +import com.microsoft.azure.management.edgegateway.UploadCertificateRequest; +import com.microsoft.azure.management.edgegateway.NetworkSettings; +import com.microsoft.azure.management.edgegateway.AsymmetricEncryptedSecret; + +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).map(new Func1 () { + @Override + public DataBoxEdgeDevice call(DataBoxEdgeDeviceInner inner) { + return 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 createOrUpdateExtendedInfoAsync(String deviceName, String resourceGroupName, DataBoxEdgeDeviceExtendedInfoInner parameters) { + DevicesInner client = this.inner(); + return client.createOrUpdateExtendedInfoAsync(deviceName, resourceGroupName, parameters) + .map(new Func1() { + @Override + public DataBoxEdgeDeviceExtendedInfo call(DataBoxEdgeDeviceExtendedInfoInner inner) { + return new DataBoxEdgeDeviceExtendedInfoImpl(inner, manager()); + } + }); + } + + @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, AsymmetricEncryptedSecret deviceAdminPassword) { + DevicesInner client = this.inner(); + return client.createOrUpdateSecuritySettingsAsync(deviceName, resourceGroupName, deviceAdminPassword).toCompletable(); + } + +} diff --git a/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/DevicesInner.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/DevicesInner.java new file mode 100644 index 000000000000..c219de9572ce --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/DevicesInner.java @@ -0,0 +1,2501 @@ +/** + * 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.edgegateway.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.edgegateway.AsymmetricEncryptedSecret; +import com.microsoft.azure.management.edgegateway.DataBoxEdgeDevicePatch; +import com.microsoft.azure.management.edgegateway.SecuritySettings; +import com.microsoft.azure.management.edgegateway.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 java.util.Map; +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.edgegateway.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.edgegateway.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.edgegateway.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.edgegateway.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.edgegateway.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.edgegateway.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.edgegateway.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.edgegateway.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, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body DataBoxEdgeDevicePatch parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.edgegateway.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.edgegateway.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.edgegateway.Devices createOrUpdateExtendedInfo" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/getExtendedInformation") + Observable> createOrUpdateExtendedInfo(@Path("deviceName") String deviceName, @Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Body DataBoxEdgeDeviceExtendedInfoInner 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.edgegateway.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.edgegateway.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.edgegateway.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.edgegateway.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.edgegateway.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.edgegateway.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.edgegateway.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, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body SecuritySettings securitySettings, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.edgegateway.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, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body SecuritySettings securitySettings, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.edgegateway.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.edgegateway.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.edgegateway.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.edgegateway.Devices listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Retrieves all 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(); + } + }; + } + + /** + * Retrieves all 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); + } + + /** + * Retrieves all 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(); + } + }); + } + + /** + * Retrieves all 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)); + } + }); + } + + /** + * Retrieves all 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); + } + } + }); + } + + /** + * Retrieves all 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(); + } + }; + } + + /** + * Retrieves all 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); + } + + /** + * Retrieves all 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(); + } + }); + } + + /** + * Retrieves all 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)); + } + }); + } + + /** + * Retrieves all 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); + } + + /** + * Retrieves all 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(); + } + }; + } + + /** + * Retrieves all 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); + } + + /** + * Retrieves all 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(); + } + }); + } + + /** + * Retrieves all 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)); + } + }); + } + + /** + * Retrieves all 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); + } + } + }); + } + + /** + * Retrieves all 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(); + } + }; + } + + /** + * Retrieves all 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); + } + + /** + * Retrieves all 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(); + } + }); + } + + /** + * Retrieves all 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)); + } + }); + } + + /** + * Retrieves all 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); + } + + /** + * Returns 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(); + } + + /** + * Returns 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); + } + + /** + * Returns 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(); + } + }); + } + + /** + * Returns 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); + } + + /** + * Updates 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 update(String deviceName, String resourceGroupName) { + return updateWithServiceResponseAsync(deviceName, resourceGroupName).toBlocking().single().body(); + } + + /** + * Updates 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 updateAsync(String deviceName, String resourceGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(deviceName, resourceGroupName), serviceCallback); + } + + /** + * Updates 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 updateAsync(String deviceName, String resourceGroupName) { + return updateWithServiceResponseAsync(deviceName, resourceGroupName).map(new Func1, DataBoxEdgeDeviceInner>() { + @Override + public DataBoxEdgeDeviceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates 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> updateWithServiceResponseAsync(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."); + } + final Map tags = null; + DataBoxEdgeDevicePatch parameters = new DataBoxEdgeDevicePatch(); + parameters.withTags(null); + return service.update(deviceName, this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, 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); + } + } + }); + } + + /** + * Updates data box edge/gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param tags The tags attached to the Data Box Edge/Gateway resource. + * @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, Map tags) { + return updateWithServiceResponseAsync(deviceName, resourceGroupName, tags).toBlocking().single().body(); + } + + /** + * Updates data box edge/gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param tags The tags attached to the Data Box Edge/Gateway resource. + * @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, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(deviceName, resourceGroupName, tags), serviceCallback); + } + + /** + * Updates data box edge/gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param tags The tags attached to the Data Box Edge/Gateway resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DataBoxEdgeDeviceInner object + */ + public Observable updateAsync(String deviceName, String resourceGroupName, Map tags) { + return updateWithServiceResponseAsync(deviceName, resourceGroupName, tags).map(new Func1, DataBoxEdgeDeviceInner>() { + @Override + public DataBoxEdgeDeviceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates data box edge/gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param tags The tags attached to the Data Box Edge/Gateway resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DataBoxEdgeDeviceInner object + */ + public Observable> updateWithServiceResponseAsync(String deviceName, String resourceGroupName, Map tags) { + 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."); + } + Validator.validate(tags); + DataBoxEdgeDevicePatch parameters = new DataBoxEdgeDevicePatch(); + parameters.withTags(tags); + return service.update(deviceName, this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, 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 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 downloadUpdates(String deviceName, String resourceGroupName) { + downloadUpdatesWithServiceResponseAsync(deviceName, resourceGroupName).toBlocking().last().body(); + } + + /** + * Downloads 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 downloadUpdatesAsync(String deviceName, String resourceGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(downloadUpdatesWithServiceResponseAsync(deviceName, resourceGroupName), serviceCallback); + } + + /** + * Downloads 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 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 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> 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 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 beginDownloadUpdates(String deviceName, String resourceGroupName) { + beginDownloadUpdatesWithServiceResponseAsync(deviceName, resourceGroupName).toBlocking().single().body(); + } + + /** + * Downloads 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 beginDownloadUpdatesAsync(String deviceName, String resourceGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDownloadUpdatesWithServiceResponseAsync(deviceName, resourceGroupName), serviceCallback); + } + + /** + * Downloads 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 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 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> 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); + } + + /** + * Creates or updates the extended info of the data box edge/gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param parameters The device extended information. + * @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 createOrUpdateExtendedInfo(String deviceName, String resourceGroupName, DataBoxEdgeDeviceExtendedInfoInner parameters) { + return createOrUpdateExtendedInfoWithServiceResponseAsync(deviceName, resourceGroupName, parameters).toBlocking().single().body(); + } + + /** + * Creates or updates the extended info of the data box edge/gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param parameters The device extended information. + * @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 createOrUpdateExtendedInfoAsync(String deviceName, String resourceGroupName, DataBoxEdgeDeviceExtendedInfoInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateExtendedInfoWithServiceResponseAsync(deviceName, resourceGroupName, parameters), serviceCallback); + } + + /** + * Creates or updates the extended info of the data box edge/gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param parameters The device extended information. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DataBoxEdgeDeviceExtendedInfoInner object + */ + public Observable createOrUpdateExtendedInfoAsync(String deviceName, String resourceGroupName, DataBoxEdgeDeviceExtendedInfoInner parameters) { + return createOrUpdateExtendedInfoWithServiceResponseAsync(deviceName, resourceGroupName, parameters).map(new Func1, DataBoxEdgeDeviceExtendedInfoInner>() { + @Override + public DataBoxEdgeDeviceExtendedInfoInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates the extended info of the data box edge/gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param parameters The device extended information. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DataBoxEdgeDeviceExtendedInfoInner object + */ + public Observable> createOrUpdateExtendedInfoWithServiceResponseAsync(String deviceName, String resourceGroupName, DataBoxEdgeDeviceExtendedInfoInner 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.createOrUpdateExtendedInfo(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 = createOrUpdateExtendedInfoDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateExtendedInfoDelegate(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); + } + + /** + * Returns the extended information 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 DataBoxEdgeDeviceExtendedInfoInner object if successful. + */ + public DataBoxEdgeDeviceExtendedInfoInner getExtendedInformation(String deviceName, String resourceGroupName) { + return getExtendedInformationWithServiceResponseAsync(deviceName, resourceGroupName).toBlocking().single().body(); + } + + /** + * Returns the extended information 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 getExtendedInformationAsync(String deviceName, String resourceGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getExtendedInformationWithServiceResponseAsync(deviceName, resourceGroupName), serviceCallback); + } + + /** + * Returns the extended information 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 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(); + } + }); + } + + /** + * Returns the extended information 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 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); + } + + /** + * Returns 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(); + } + + /** + * Returns 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); + } + + /** + * Returns 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(); + } + }); + } + + /** + * Returns 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 deviceAdminPassword Device administrator password as an encrypted string (encrypted using RSA PKCS #1) is used to log into the local web UI of the device. Actual password could have at least 8 characters that are a combination of uppercase, lowercase, numeric, and special characters. + * @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, AsymmetricEncryptedSecret deviceAdminPassword) { + createOrUpdateSecuritySettingsWithServiceResponseAsync(deviceName, resourceGroupName, deviceAdminPassword).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 deviceAdminPassword Device administrator password as an encrypted string (encrypted using RSA PKCS #1) is used to log into the local web UI of the device. Actual password could have at least 8 characters that are a combination of uppercase, lowercase, numeric, and special characters. + * @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, AsymmetricEncryptedSecret deviceAdminPassword, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateSecuritySettingsWithServiceResponseAsync(deviceName, resourceGroupName, deviceAdminPassword), serviceCallback); + } + + /** + * Updates the security settings on a data box edge/gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param deviceAdminPassword Device administrator password as an encrypted string (encrypted using RSA PKCS #1) is used to log into the local web UI of the device. Actual password could have at least 8 characters that are a combination of uppercase, lowercase, numeric, and special characters. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateSecuritySettingsAsync(String deviceName, String resourceGroupName, AsymmetricEncryptedSecret deviceAdminPassword) { + return createOrUpdateSecuritySettingsWithServiceResponseAsync(deviceName, resourceGroupName, deviceAdminPassword).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 deviceAdminPassword Device administrator password as an encrypted string (encrypted using RSA PKCS #1) is used to log into the local web UI of the device. Actual password could have at least 8 characters that are a combination of uppercase, lowercase, numeric, and special characters. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateSecuritySettingsWithServiceResponseAsync(String deviceName, String resourceGroupName, AsymmetricEncryptedSecret deviceAdminPassword) { + 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."); + } + if (deviceAdminPassword == null) { + throw new IllegalArgumentException("Parameter deviceAdminPassword is required and cannot be null."); + } + Validator.validate(deviceAdminPassword); + SecuritySettings securitySettings = new SecuritySettings(); + securitySettings.withDeviceAdminPassword(deviceAdminPassword); + Observable> observable = service.createOrUpdateSecuritySettings(deviceName, this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), this.client.acceptLanguage(), securitySettings, 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 deviceAdminPassword Device administrator password as an encrypted string (encrypted using RSA PKCS #1) is used to log into the local web UI of the device. Actual password could have at least 8 characters that are a combination of uppercase, lowercase, numeric, and special characters. + * @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, AsymmetricEncryptedSecret deviceAdminPassword) { + beginCreateOrUpdateSecuritySettingsWithServiceResponseAsync(deviceName, resourceGroupName, deviceAdminPassword).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 deviceAdminPassword Device administrator password as an encrypted string (encrypted using RSA PKCS #1) is used to log into the local web UI of the device. Actual password could have at least 8 characters that are a combination of uppercase, lowercase, numeric, and special characters. + * @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, AsymmetricEncryptedSecret deviceAdminPassword, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateSecuritySettingsWithServiceResponseAsync(deviceName, resourceGroupName, deviceAdminPassword), serviceCallback); + } + + /** + * Updates the security settings on a data box edge/gateway device. + * + * @param deviceName The device name. + * @param resourceGroupName The resource group name. + * @param deviceAdminPassword Device administrator password as an encrypted string (encrypted using RSA PKCS #1) is used to log into the local web UI of the device. Actual password could have at least 8 characters that are a combination of uppercase, lowercase, numeric, and special characters. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginCreateOrUpdateSecuritySettingsAsync(String deviceName, String resourceGroupName, AsymmetricEncryptedSecret deviceAdminPassword) { + return beginCreateOrUpdateSecuritySettingsWithServiceResponseAsync(deviceName, resourceGroupName, deviceAdminPassword).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 deviceAdminPassword Device administrator password as an encrypted string (encrypted using RSA PKCS #1) is used to log into the local web UI of the device. Actual password could have at least 8 characters that are a combination of uppercase, lowercase, numeric, and special characters. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginCreateOrUpdateSecuritySettingsWithServiceResponseAsync(String deviceName, String resourceGroupName, AsymmetricEncryptedSecret deviceAdminPassword) { + 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."); + } + if (deviceAdminPassword == null) { + throw new IllegalArgumentException("Parameter deviceAdminPassword is required and cannot be null."); + } + Validator.validate(deviceAdminPassword); + SecuritySettings securitySettings = new SecuritySettings(); + securitySettings.withDeviceAdminPassword(deviceAdminPassword); + return service.beginCreateOrUpdateSecuritySettings(deviceName, this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), this.client.acceptLanguage(), securitySettings, 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); + } + + /** + * Returns information about the availability of updates as per the last scan done on the device. It also returns 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(); + } + + /** + * Returns information about the availability of updates as per the last scan done on the device. It also returns 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); + } + + /** + * Returns information about the availability of updates as per the last scan done on the device. It also returns 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(); + } + }); + } + + /** + * Returns information about the availability of updates as per the last scan done on the device. It also returns 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); + } + + /** + * Retrieves all 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(); + } + }; + } + + /** + * Retrieves all 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); + } + + /** + * Retrieves all 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(); + } + }); + } + + /** + * Retrieves all 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)); + } + }); + } + + /** + * Retrieves all 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); + } + + /** + * Retrieves all 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(); + } + }; + } + + /** + * Retrieves all 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); + } + + /** + * Retrieves all 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(); + } + }); + } + + /** + * Retrieves all 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)); + } + }); + } + + /** + * Retrieves all 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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/IdParsingUtils.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/IdParsingUtils.java new file mode 100644 index 000000000000..b1cd9a98f895 --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway.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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/JobImpl.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/JobImpl.java new file mode 100644 index 000000000000..03fb6b604641 --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/JobImpl.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.edgegateway.implementation; + +import com.microsoft.azure.management.edgegateway.Job; +import com.microsoft.azure.arm.model.implementation.IndexableRefreshableWrapperImpl; +import rx.Observable; +import com.microsoft.azure.management.edgegateway.UpdateOperationStage; +import com.microsoft.azure.management.edgegateway.UpdateDownloadProgress; +import org.joda.time.DateTime; +import com.microsoft.azure.management.edgegateway.JobErrorDetails; +import com.microsoft.azure.management.edgegateway.UpdateInstallProgress; +import com.microsoft.azure.management.edgegateway.JobType; +import com.microsoft.azure.management.edgegateway.JobStatus; + +class JobImpl extends IndexableRefreshableWrapperImpl implements Job { + private final DataBoxEdgeManager manager; + private String deviceName; + private String name; + private String resourceGroupName; + + JobImpl(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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/JobInner.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/JobInner.java new file mode 100644 index 000000000000..3a240f1d51be --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway.implementation; + +import com.microsoft.azure.management.edgegateway.JobStatus; +import org.joda.time.DateTime; +import com.microsoft.azure.management.edgegateway.JobErrorDetails; +import com.microsoft.azure.management.edgegateway.JobType; +import com.microsoft.azure.management.edgegateway.UpdateOperationStage; +import com.microsoft.azure.management.edgegateway.UpdateDownloadProgress; +import com.microsoft.azure.management.edgegateway.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 datetime at which the job was started. + */ + @JsonProperty(value = "startTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime startTime; + + /** + * The UTC datetime at which the job completed. + */ + @JsonProperty(value = "endTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime endTime; + + /** + * The percentage of the job that is already 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 on which the Refresh operation was done. + */ + @JsonProperty(value = "properties.shareId", access = JsonProperty.Access.WRITE_ONLY) + private String shareId; + + /** + * If only subfolders need to be refreshed, then the sub folder path inside + * the share. Empty otherwise. + */ + @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 datetime at which the job was started. + * + * @return the startTime value + */ + public DateTime startTime() { + return this.startTime; + } + + /** + * Get the UTC datetime at which the job completed. + * + * @return the endTime value + */ + public DateTime endTime() { + return this.endTime; + } + + /** + * Get the percentage of the job that is already 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 on which the Refresh operation was done. + * + * @return the shareId value + */ + public String shareId() { + return this.shareId; + } + + /** + * Get if only subfolders need to be refreshed, then the sub folder path inside the share. Empty otherwise. + * + * @return the folder value + */ + public String folder() { + return this.folder; + } + + /** + * Set if only subfolders need to be refreshed, then the sub folder path inside the share. Empty otherwise. + * + * @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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/NetworkSettingsImpl.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/NetworkSettingsImpl.java new file mode 100644 index 000000000000..bf8cac12993c --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway.implementation; + +import com.microsoft.azure.management.edgegateway.NetworkSettings; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.edgegateway.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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/NetworkSettingsInner.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/NetworkSettingsInner.java new file mode 100644 index 000000000000..b934d15837db --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway.implementation; + +import java.util.List; +import com.microsoft.azure.management.edgegateway.NetworkAdapter; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.management.edgegateway.ARMBaseModel; + +/** + * The NetworkSettings 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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/OperationImpl.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/OperationImpl.java new file mode 100644 index 000000000000..5db8140b502d --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway.implementation; + +import com.microsoft.azure.management.edgegateway.Operation; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.edgegateway.OperationDisplay; +import com.microsoft.azure.management.edgegateway.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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/OperationInner.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/OperationInner.java new file mode 100644 index 000000000000..d512707ceafd --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway.implementation; + +import com.microsoft.azure.management.edgegateway.OperationDisplay; +import com.microsoft.azure.management.edgegateway.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 to 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 to displayed for the operation. + * + * @return the display value + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Set properties to 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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/OperationsImpl.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/OperationsImpl.java new file mode 100644 index 000000000000..3d59835269f8 --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.edgegateway.Operations; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.edgegateway.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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/OperationsInner.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/OperationsInner.java new file mode 100644 index 000000000000..5305af0c1fcd --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway.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.edgegateway.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.edgegateway.Operations listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists all the operations supported. + * + * @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(); + } + }; + } + + /** + * Lists all the operations supported. + * + * @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); + } + + /** + * Lists all the operations supported. + * + * @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(); + } + }); + } + + /** + * Lists all the operations supported. + * + * @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)); + } + }); + } + + /** + * Lists all the operations supported. + * + * @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); + } + + /** + * Lists all the operations supported. + * + * @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(); + } + }; + } + + /** + * Lists all the operations supported. + * + * @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); + } + + /** + * Lists all the operations supported. + * + * @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(); + } + }); + } + + /** + * Lists all the operations supported. + * + * @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)); + } + }); + } + + /** + * Lists all the operations supported. + * + 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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/OperationsStatusImpl.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/OperationsStatusImpl.java new file mode 100644 index 000000000000..3723a2222629 --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/OperationsStatusImpl.java @@ -0,0 +1,46 @@ +/** + * 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.edgegateway.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.edgegateway.OperationsStatus; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.management.edgegateway.Job; + +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 JobImpl wrapModel(JobInner inner) { + return new JobImpl(inner, manager()); + } + + @Override + public Observable getAsync(String deviceName, String name, String resourceGroupName) { + OperationsStatusInner client = this.inner(); + return client.getAsync(deviceName, name, resourceGroupName) + .map(new Func1() { + @Override + public Job call(JobInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/OperationsStatusInner.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/OperationsStatusInner.java new file mode 100644 index 000000000000..e286c7f44694 --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway.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.edgegateway.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); + + } + + /** + * Returns the job details of the 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(); + } + + /** + * Returns the job details of the 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); + } + + /** + * Returns the job details of the 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(); + } + }); + } + + /** + * Returns the job details of the 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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/OrderImpl.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/OrderImpl.java new file mode 100644 index 000000000000..7774402d9e8b --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway.implementation; + +import com.microsoft.azure.management.edgegateway.Order; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; +import com.microsoft.azure.management.edgegateway.OrderStatus; +import com.microsoft.azure.management.edgegateway.ContactDetails; +import java.util.List; +import com.microsoft.azure.management.edgegateway.TrackingInfo; +import com.microsoft.azure.management.edgegateway.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 OrderStatus changeStatusTo() { + return this.inner().changeStatusTo(); + } + + @Override + public ContactDetails contactInformation() { + return this.inner().contactInformation(); + } + + @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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/OrderInner.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/OrderInner.java new file mode 100644 index 000000000000..f7781ec19b9f --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway.implementation; + +import com.microsoft.azure.management.edgegateway.ContactDetails; +import com.microsoft.azure.management.edgegateway.Address; +import com.microsoft.azure.management.edgegateway.OrderStatus; +import java.util.List; +import com.microsoft.azure.management.edgegateway.TrackingInfo; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.management.edgegateway.ARMBaseModel; + +/** + * The order details. + */ +@JsonFlatten +public class OrderInner extends ARMBaseModel { + /** + * The contact details. + */ + @JsonProperty(value = "properties.contactInformation") + private ContactDetails contactInformation; + + /** + * The shipping address. + */ + @JsonProperty(value = "properties.shippingAddress") + private Address shippingAddress; + + /** + * Current status of the Order. + */ + @JsonProperty(value = "properties.changeStatusTo") + private OrderStatus changeStatusTo; + + /** + * 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 related to the packages being delivered to the + * customer whether original or replacement devices. + */ + @JsonProperty(value = "properties.deliveryTrackingInfo", access = JsonProperty.Access.WRITE_ONLY) + private List deliveryTrackingInfo; + + /** + * Tracking information related to the package being returned from the + * customer whether original or replacement devices. + */ + @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 changeStatusTo value + */ + public OrderStatus changeStatusTo() { + return this.changeStatusTo; + } + + /** + * Set current status of the Order. + * + * @param changeStatusTo the changeStatusTo value to set + * @return the OrderInner object itself. + */ + public OrderInner withChangeStatusTo(OrderStatus changeStatusTo) { + this.changeStatusTo = changeStatusTo; + 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 related to the packages being delivered to the customer whether original or replacement devices. + * + * @return the deliveryTrackingInfo value + */ + public List deliveryTrackingInfo() { + return this.deliveryTrackingInfo; + } + + /** + * Get tracking information related to the package being returned from the customer whether original or replacement devices. + * + * @return the returnTrackingInfo value + */ + public List returnTrackingInfo() { + return this.returnTrackingInfo; + } + +} diff --git a/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/OrdersImpl.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/OrdersImpl.java new file mode 100644 index 000000000000..bfdefa2136ac --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.edgegateway.Orders; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import rx.Completable; +import com.microsoft.azure.management.edgegateway.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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/OrdersInner.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/OrdersInner.java new file mode 100644 index 000000000000..e8b4d8cb42b1 --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway.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.edgegateway.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.edgegateway.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.edgegateway.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.edgegateway.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.edgegateway.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.edgegateway.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.edgegateway.Orders listByDataBoxEdgeDeviceNext" }) + @GET + Observable> listByDataBoxEdgeDeviceNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * List all the orders related to the device. + * + * @param deviceName Name of the device. + * @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(); + } + }; + } + + /** + * List all the orders related to the device. + * + * @param deviceName Name of the device. + * @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); + } + + /** + * List all the orders related to the device. + * + * @param deviceName Name of the device. + * @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(); + } + }); + } + + /** + * List all the orders related to the device. + * + * @param deviceName Name of the device. + * @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)); + } + }); + } + + /** + * List all the orders related to the device. + * + ServiceResponse> * @param deviceName Name of the device. + 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); + } + + /** + * Get a specific order by name. + * + * @param deviceName Name of the device. + * @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(); + } + + /** + * Get a specific order by name. + * + * @param deviceName Name of the device. + * @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); + } + + /** + * Get a specific order by name. + * + * @param deviceName Name of the device. + * @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(); + } + }); + } + + /** + * Get a specific order by name. + * + * @param deviceName Name of the device. + * @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 Name of the edge device for which order needs to be added or updated. + * @param resourceGroupName The resource group name. + * @param order Order to be added. + * @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 Name of the edge device for which order needs to be added or updated. + * @param resourceGroupName The resource group name. + * @param order Order to be added. + * @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 Name of the edge device for which order needs to be added or updated. + * @param resourceGroupName The resource group name. + * @param order Order to be added. + * @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 Name of the edge device for which order needs to be added or updated. + * @param resourceGroupName The resource group name. + * @param order Order to be added. + * @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 Name of the edge device for which order needs to be added or updated. + * @param resourceGroupName The resource group name. + * @param order Order to be added. + * @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 Name of the edge device for which order needs to be added or updated. + * @param resourceGroupName The resource group name. + * @param order Order to be added. + * @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 Name of the edge device for which order needs to be added or updated. + * @param resourceGroupName The resource group name. + * @param order Order to be added. + * @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 Name of the edge device for which order needs to be added or updated. + * @param resourceGroupName The resource group name. + * @param order Order to be added. + * @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 Name of the device. + * @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 Name of the device. + * @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 Name of the device. + * @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 Name of the device. + * @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 Name of the device. + * @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 Name of the device. + * @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 Name of the device. + * @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 Name of the device. + * @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); + } + + /** + * List all the orders related to 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<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(); + } + }; + } + + /** + * List all the orders related to 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); + } + + /** + * List all the orders related to 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<OrderInner> object + */ + public Observable> listByDataBoxEdgeDeviceNextAsync(final String nextPageLink) { + return listByDataBoxEdgeDeviceNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List all the orders related to 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<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)); + } + }); + } + + /** + * List all the orders related to 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<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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/PageImpl.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/PageImpl.java new file mode 100644 index 000000000000..ec153f3113f3 --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway.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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/RoleImpl.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/RoleImpl.java new file mode 100644 index 000000000000..56e7410f5c31 --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway.implementation; + +import com.microsoft.azure.management.edgegateway.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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/RoleInner.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/RoleInner.java new file mode 100644 index 000000000000..c57ef4a56d3e --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway.implementation; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.microsoft.azure.management.edgegateway.ARMBaseModel; + +/** + * Compute role. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("Role") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "IOT", value = IoTRole.class) +}) +public class RoleInner extends ARMBaseModel { +} diff --git a/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/RolesImpl.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/RolesImpl.java new file mode 100644 index 000000000000..ae67ca4edadc --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/RolesImpl.java @@ -0,0 +1,81 @@ +/** + * 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.edgegateway.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.edgegateway.Roles; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.edgegateway.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) + .map(new Func1() { + @Override + public Role call(RoleInner inner) { + return 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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/RolesInner.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/RolesInner.java new file mode 100644 index 000000000000..9530d5903ac9 --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway.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.edgegateway.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.edgegateway.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.edgegateway.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.edgegateway.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.edgegateway.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.edgegateway.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.edgegateway.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 Name of the device. + * @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 Name of the device. + * @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 Name of the device. + * @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 Name of the device. + * @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 Name of the device. + 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); + } + + /** + * Get a specific role by name. + * + * @param deviceName Name of the device. + * @param name Name of role to be fetched. + * @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(); + } + + /** + * Get a specific role by name. + * + * @param deviceName Name of the device. + * @param name Name of role to be fetched. + * @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 role by name. + * + * @param deviceName Name of the device. + * @param name Name of role to be fetched. + * @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(); + } + }); + } + + /** + * Get a specific role by name. + * + * @param deviceName Name of the device. + * @param name Name of role to be fetched. + * @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 Name of the device in which the role needs to be added or updated. + * @param name Name of the role to be updated. + * @param resourceGroupName The resource group name. + * @param role Role to be added. + * @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 Name of the device in which the role needs to be added or updated. + * @param name Name of the role to be updated. + * @param resourceGroupName The resource group name. + * @param role Role to be added. + * @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 Name of the device in which the role needs to be added or updated. + * @param name Name of the role to be updated. + * @param resourceGroupName The resource group name. + * @param role Role to be added. + * @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 Name of the device in which the role needs to be added or updated. + * @param name Name of the role to be updated. + * @param resourceGroupName The resource group name. + * @param role Role to be added. + * @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 Name of the device in which the role needs to be added or updated. + * @param name Name of the role to be updated. + * @param resourceGroupName The resource group name. + * @param role Role to be added. + * @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 Name of the device in which the role needs to be added or updated. + * @param name Name of the role to be updated. + * @param resourceGroupName The resource group name. + * @param role Role to be added. + * @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 Name of the device in which the role needs to be added or updated. + * @param name Name of the role to be updated. + * @param resourceGroupName The resource group name. + * @param role Role to be added. + * @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 Name of the device in which the role needs to be added or updated. + * @param name Name of the role to be updated. + * @param resourceGroupName The resource group name. + * @param role Role to be added. + * @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 gateway device. + * + * @param deviceName Name of the device. + * @param name Name of the role which needs to be deleted. + * @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 gateway device. + * + * @param deviceName Name of the device. + * @param name Name of the role which needs to be deleted. + * @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 gateway device. + * + * @param deviceName Name of the device. + * @param name Name of the role which needs to be deleted. + * @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 gateway device. + * + * @param deviceName Name of the device. + * @param name Name of the role which needs to be deleted. + * @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 gateway device. + * + * @param deviceName Name of the device. + * @param name Name of the role which needs to be deleted. + * @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 gateway device. + * + * @param deviceName Name of the device. + * @param name Name of the role which needs to be deleted. + * @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 gateway device. + * + * @param deviceName Name of the device. + * @param name Name of the role which needs to be deleted. + * @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 gateway device. + * + * @param deviceName Name of the device. + * @param name Name of the role which needs to be deleted. + * @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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/ShareImpl.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/ShareImpl.java new file mode 100644 index 000000000000..a21175d0c199 --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway.implementation; + +import com.microsoft.azure.management.edgegateway.Share; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.edgegateway.ShareStatus; +import com.microsoft.azure.management.edgegateway.MonitoringStatus; +import com.microsoft.azure.management.edgegateway.AzureContainerInfo; +import com.microsoft.azure.management.edgegateway.ShareAccessProtocol; +import java.util.List; +import com.microsoft.azure.management.edgegateway.UserAccessRight; +import com.microsoft.azure.management.edgegateway.ClientAccessRight; +import com.microsoft.azure.management.edgegateway.RefreshDetails; +import com.microsoft.azure.management.edgegateway.MountPointMap; +import com.microsoft.azure.management.edgegateway.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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/ShareInner.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/ShareInner.java new file mode 100644 index 000000000000..37b740d77eac --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway.implementation; + +import com.microsoft.azure.management.edgegateway.ShareStatus; +import com.microsoft.azure.management.edgegateway.MonitoringStatus; +import com.microsoft.azure.management.edgegateway.AzureContainerInfo; +import com.microsoft.azure.management.edgegateway.ShareAccessProtocol; +import java.util.List; +import com.microsoft.azure.management.edgegateway.UserAccessRight; +import com.microsoft.azure.management.edgegateway.ClientAccessRight; +import com.microsoft.azure.management.edgegateway.RefreshDetails; +import com.microsoft.azure.management.edgegateway.MountPointMap; +import com.microsoft.azure.management.edgegateway.DataPolicy; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.management.edgegateway.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 (mandatory + * for SMB protocol). + */ + @JsonProperty(value = "properties.userAccessRights") + private List userAccessRights; + + /** + * List of IP addresses and corresponding access rights on the + * share(mandatory 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 (mandatory for SMB protocol). + * + * @return the userAccessRights value + */ + public List userAccessRights() { + return this.userAccessRights; + } + + /** + * Set mapping of Users and corresponding access rights on the share (mandatory 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(mandatory 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(mandatory 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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/SharesImpl.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/SharesImpl.java new file mode 100644 index 000000000000..a4c9f678aa2f --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/SharesImpl.java @@ -0,0 +1,87 @@ +/** + * 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.edgegateway.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.edgegateway.Shares; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.edgegateway.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) + .map(new Func1() { + @Override + public Share call(ShareInner inner) { + return 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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/SharesInner.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/SharesInner.java new file mode 100644 index 000000000000..bbd130e25ade --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway.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.edgegateway.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.edgegateway.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.edgegateway.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.edgegateway.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.edgegateway.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.edgegateway.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.edgegateway.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.edgegateway.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.edgegateway.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 Name of the device. + * @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 Name of the device. + * @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 Name of the device. + * @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 Name of the device. + * @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 Name of the device. + 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); + } + + /** + * Returns a particular share by name. + * + * @param deviceName Name of the device. + * @param name Name of the share. + * @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(); + } + + /** + * Returns a particular share by name. + * + * @param deviceName Name of the device. + * @param name Name of the share. + * @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); + } + + /** + * Returns a particular share by name. + * + * @param deviceName Name of the device. + * @param name Name of the share. + * @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(); + } + }); + } + + /** + * Returns a particular share by name. + * + * @param deviceName Name of the device. + * @param name Name of the share. + * @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 update an existing share on the device. + * + * @param deviceName Name of the device. + * @param name Name of the share which needs to be added/updated. + * @param resourceGroupName The resource group name. + * @param share The share object containing the share 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 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 update an existing share on the device. + * + * @param deviceName Name of the device. + * @param name Name of the share which needs to be added/updated. + * @param resourceGroupName The resource group name. + * @param share The share object containing the share 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, ShareInner share, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(deviceName, name, resourceGroupName, share), serviceCallback); + } + + /** + * Creates a new share or update an existing share on the device. + * + * @param deviceName Name of the device. + * @param name Name of the share which needs to be added/updated. + * @param resourceGroupName The resource group name. + * @param share The share object containing the share details. + * @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 update an existing share on the device. + * + * @param deviceName Name of the device. + * @param name Name of the share which needs to be added/updated. + * @param resourceGroupName The resource group name. + * @param share The share object containing the share details. + * @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 update an existing share on the device. + * + * @param deviceName Name of the device. + * @param name Name of the share which needs to be added/updated. + * @param resourceGroupName The resource group name. + * @param share The share object containing the share 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 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 update an existing share on the device. + * + * @param deviceName Name of the device. + * @param name Name of the share which needs to be added/updated. + * @param resourceGroupName The resource group name. + * @param share The share object containing the share 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, ShareInner share, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(deviceName, name, resourceGroupName, share), serviceCallback); + } + + /** + * Creates a new share or update an existing share on the device. + * + * @param deviceName Name of the device. + * @param name Name of the share which needs to be added/updated. + * @param resourceGroupName The resource group name. + * @param share The share object containing the share details. + * @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 update an existing share on the device. + * + * @param deviceName Name of the device. + * @param name Name of the share which needs to be added/updated. + * @param resourceGroupName The resource group name. + * @param share The share object containing the share details. + * @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 Name of the device. + * @param name Name of the share which needs to be deleted. + * @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 Name of the device. + * @param name Name of the share which needs to be deleted. + * @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 Name of the device. + * @param name Name of the share which needs to be deleted. + * @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 Name of the device. + * @param name Name of the share which needs to be deleted. + * @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 Name of the device. + * @param name Name of the share which needs to be deleted. + * @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 Name of the device. + * @param name Name of the share which needs to be deleted. + * @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 Name of the device. + * @param name Name of the share which needs to be deleted. + * @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 Name of the device. + * @param name Name of the share which needs to be deleted. + * @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); + } + + /** + * Triggers a manual refresh of the share metadata with the actual cloud storage account. + * + * @param deviceName Name of the device. + * @param name Name of the share. + * @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(); + } + + /** + * Triggers a manual refresh of the share metadata with the actual cloud storage account. + * + * @param deviceName Name of the device. + * @param name Name of the share. + * @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); + } + + /** + * Triggers a manual refresh of the share metadata with the actual cloud storage account. + * + * @param deviceName Name of the device. + * @param name Name of the share. + * @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(); + } + }); + } + + /** + * Triggers a manual refresh of the share metadata with the actual cloud storage account. + * + * @param deviceName Name of the device. + * @param name Name of the share. + * @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()); + } + + /** + * Triggers a manual refresh of the share metadata with the actual cloud storage account. + * + * @param deviceName Name of the device. + * @param name Name of the share. + * @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(); + } + + /** + * Triggers a manual refresh of the share metadata with the actual cloud storage account. + * + * @param deviceName Name of the device. + * @param name Name of the share. + * @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); + } + + /** + * Triggers a manual refresh of the share metadata with the actual cloud storage account. + * + * @param deviceName Name of the device. + * @param name Name of the share. + * @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(); + } + }); + } + + /** + * Triggers a manual refresh of the share metadata with the actual cloud storage account. + * + * @param deviceName Name of the device. + * @param name Name of the share. + * @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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/StorageAccountCredentialImpl.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/StorageAccountCredentialImpl.java new file mode 100644 index 000000000000..c453f9d9ab9b --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway.implementation; + +import com.microsoft.azure.management.edgegateway.StorageAccountCredential; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.edgegateway.AsymmetricEncryptedSecret; +import com.microsoft.azure.management.edgegateway.SSLStatus; +import com.microsoft.azure.management.edgegateway.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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/StorageAccountCredentialInner.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/StorageAccountCredentialInner.java new file mode 100644 index 000000000000..94c38ba77248 --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway.implementation; + +import com.microsoft.azure.management.edgegateway.AsymmetricEncryptedSecret; +import com.microsoft.azure.management.edgegateway.SSLStatus; +import com.microsoft.azure.management.edgegateway.AccountType; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.management.edgegateway.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; + + /** + * ConnectionString for the storage account. This needs to be specified if + * UserName/AccountKey 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 connectionString for the storage account. This needs to be specified if UserName/AccountKey are not specified. + * + * @return the connectionString value + */ + public String connectionString() { + return this.connectionString; + } + + /** + * Set connectionString for the storage account. This needs to be specified if UserName/AccountKey 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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/StorageAccountCredentialsImpl.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/StorageAccountCredentialsImpl.java new file mode 100644 index 000000000000..70296581c954 --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/StorageAccountCredentialsImpl.java @@ -0,0 +1,81 @@ +/** + * 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.edgegateway.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.edgegateway.StorageAccountCredentials; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.edgegateway.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) + .map(new Func1() { + @Override + public StorageAccountCredential call(StorageAccountCredentialInner inner) { + return 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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/StorageAccountCredentialsInner.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/StorageAccountCredentialsInner.java new file mode 100644 index 000000000000..a6cb1b0621cd --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway.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.edgegateway.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.edgegateway.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.edgegateway.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.edgegateway.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.edgegateway.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.edgegateway.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.edgegateway.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 Name of the device. + * @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 Name of the device. + * @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 Name of the device. + * @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 Name of the device. + * @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 Name of the device. + 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 Name of the device. + * @param name Name of the storage account credential to be fetched. + * @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 Name of the device. + * @param name Name of the storage account credential to be fetched. + * @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 Name of the device. + * @param name Name of the storage account credential to be fetched. + * @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 Name of the device. + * @param name Name of the storage account credential to be fetched. + * @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 Name of the device. + * @param name The storage account credential name. + * @param resourceGroupName The resource group name. + * @param storageAccountCredential The storage account credential 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 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 Name of the device. + * @param name The storage account credential name. + * @param resourceGroupName The resource group name. + * @param storageAccountCredential The storage account credential 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, StorageAccountCredentialInner storageAccountCredential, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(deviceName, name, resourceGroupName, storageAccountCredential), serviceCallback); + } + + /** + * Creates or updates the storage account credential. + * + * @param deviceName Name of the device. + * @param name The storage account credential name. + * @param resourceGroupName The resource group name. + * @param storageAccountCredential The storage account credential 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, 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 Name of the device. + * @param name The storage account credential name. + * @param resourceGroupName The resource group name. + * @param storageAccountCredential The storage account credential 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, 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 Name of the device. + * @param name The storage account credential name. + * @param resourceGroupName The resource group name. + * @param storageAccountCredential The storage account credential 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 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 Name of the device. + * @param name The storage account credential name. + * @param resourceGroupName The resource group name. + * @param storageAccountCredential The storage account credential 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, StorageAccountCredentialInner storageAccountCredential, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(deviceName, name, resourceGroupName, storageAccountCredential), serviceCallback); + } + + /** + * Creates or updates the storage account credential. + * + * @param deviceName Name of the device. + * @param name The storage account credential name. + * @param resourceGroupName The resource group name. + * @param storageAccountCredential The storage account credential to be added or updated. + * @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 Name of the device. + * @param name The storage account credential name. + * @param resourceGroupName The resource group name. + * @param storageAccountCredential The storage account credential to be added or updated. + * @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 Name of the device. + * @param name Name of the storage account credential. + * @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 Name of the device. + * @param name Name of the storage account credential. + * @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 Name of the device. + * @param name Name of the storage account credential. + * @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 Name of the device. + * @param name Name of the storage account credential. + * @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 Name of the device. + * @param name Name of the storage account credential. + * @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 Name of the device. + * @param name Name of the storage account credential. + * @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 Name of the device. + * @param name Name of the storage account credential. + * @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 Name of the device. + * @param name Name of the storage account credential. + * @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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/TriggerImpl.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/TriggerImpl.java new file mode 100644 index 000000000000..36c343c83744 --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway.implementation; + +import com.microsoft.azure.management.edgegateway.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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/TriggerInner.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/TriggerInner.java new file mode 100644 index 000000000000..5fa59f2d678f --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway.implementation; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.microsoft.azure.management.edgegateway.ARMBaseModel; + +/** + * Trigger details. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/TriggersImpl.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/TriggersImpl.java new file mode 100644 index 000000000000..bc7857d168d0 --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/TriggersImpl.java @@ -0,0 +1,81 @@ +/** + * 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.edgegateway.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.edgegateway.Triggers; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.edgegateway.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) + .map(new Func1() { + @Override + public Trigger call(TriggerInner inner) { + return 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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/TriggersInner.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/TriggersInner.java new file mode 100644 index 000000000000..fc1efea805c5 --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/TriggersInner.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.edgegateway.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.edgegateway.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, @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.edgegateway.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.edgegateway.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.edgegateway.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.edgegateway.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.edgegateway.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.edgegateway.Triggers listByDataBoxEdgeDeviceNext" }) + @GET + Observable> listByDataBoxEdgeDeviceNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * List all the triggers configured in the device. + * + * @param deviceName Name of the device. + * @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(); + } + }; + } + + /** + * List all the triggers configured in the device. + * + * @param deviceName Name of the device. + * @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); + } + + /** + * List all the triggers configured in the device. + * + * @param deviceName Name of the device. + * @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(); + } + }); + } + + /** + * List all the triggers configured in the device. + * + * @param deviceName Name of the device. + * @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)); + } + }); + } + + /** + * List all the triggers configured in the device. + * + ServiceResponse> * @param deviceName Name of the device. + ServiceResponse> * @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."); + } + 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); + } + + /** + * Get a specific trigger by name. + * + * @param deviceName Name of the device. + * @param name Name of trigger to be fetched. + * @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 Name of the device. + * @param name Name of trigger to be fetched. + * @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 Name of the device. + * @param name Name of trigger to be fetched. + * @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 Name of the device. + * @param name Name of trigger to be fetched. + * @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); + } + + /** + * Create or update a trigger. + * + * @param deviceName Name of the edge device in which trigger needs to be added or updated. + * @param name Name of trigger to be added or updated. + * @param resourceGroupName The resource group name. + * @param trigger Trigger to be added. + * @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(); + } + + /** + * Create or update a trigger. + * + * @param deviceName Name of the edge device in which trigger needs to be added or updated. + * @param name Name of trigger to be added or updated. + * @param resourceGroupName The resource group name. + * @param trigger Trigger to be added. + * @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); + } + + /** + * Create or update a trigger. + * + * @param deviceName Name of the edge device in which trigger needs to be added or updated. + * @param name Name of trigger to be added or updated. + * @param resourceGroupName The resource group name. + * @param trigger Trigger to be added. + * @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(); + } + }); + } + + /** + * Create or update a trigger. + * + * @param deviceName Name of the edge device in which trigger needs to be added or updated. + * @param name Name of trigger to be added or updated. + * @param resourceGroupName The resource group name. + * @param trigger Trigger to be added. + * @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()); + } + + /** + * Create or update a trigger. + * + * @param deviceName Name of the edge device in which trigger needs to be added or updated. + * @param name Name of trigger to be added or updated. + * @param resourceGroupName The resource group name. + * @param trigger Trigger to be added. + * @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(); + } + + /** + * Create or update a trigger. + * + * @param deviceName Name of the edge device in which trigger needs to be added or updated. + * @param name Name of trigger to be added or updated. + * @param resourceGroupName The resource group name. + * @param trigger Trigger to be added. + * @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); + } + + /** + * Create or update a trigger. + * + * @param deviceName Name of the edge device in which trigger needs to be added or updated. + * @param name Name of trigger to be added or updated. + * @param resourceGroupName The resource group name. + * @param trigger Trigger to be added. + * @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(); + } + }); + } + + /** + * Create or update a trigger. + * + * @param deviceName Name of the edge device in which trigger needs to be added or updated. + * @param name Name of trigger to be added or updated. + * @param resourceGroupName The resource group name. + * @param trigger Trigger to be added. + * @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 Name of the device. + * @param name Name of the trigger which needs to be deleted. + * @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 Name of the device. + * @param name Name of the trigger which needs to be deleted. + * @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 Name of the device. + * @param name Name of the trigger which needs to be deleted. + * @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 Name of the device. + * @param name Name of the trigger which needs to be deleted. + * @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 Name of the device. + * @param name Name of the trigger which needs to be deleted. + * @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 Name of the device. + * @param name Name of the trigger which needs to be deleted. + * @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 Name of the device. + * @param name Name of the trigger which needs to be deleted. + * @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 Name of the device. + * @param name Name of the trigger which needs to be deleted. + * @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); + } + + /** + * List 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(); + } + }; + } + + /** + * List 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); + } + + /** + * List 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(); + } + }); + } + + /** + * List 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)); + } + }); + } + + /** + * List 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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/UpdateSummaryImpl.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/UpdateSummaryImpl.java new file mode 100644 index 000000000000..6a3d92fc94c0 --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway.implementation; + +import com.microsoft.azure.management.edgegateway.UpdateSummary; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import org.joda.time.DateTime; +import com.microsoft.azure.management.edgegateway.UpdateOperation; +import com.microsoft.azure.management.edgegateway.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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/UpdateSummaryInner.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/UpdateSummaryInner.java new file mode 100644 index 000000000000..3d229ba7acb4 --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway.implementation; + +import org.joda.time.DateTime; +import com.microsoft.azure.management.edgegateway.InstallRebootBehavior; +import com.microsoft.azure.management.edgegateway.UpdateOperation; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.management.edgegateway.ARMBaseModel; + +/** + * Details about ongoing updates and availability of updates on the device. + */ +@JsonFlatten +public class UpdateSummaryInner extends ARMBaseModel { + /** + * The current version of the device, of format: 1.2.17312.13. + */ + @JsonProperty(value = "properties.deviceVersionNumber") + private String deviceVersionNumber; + + /** + * The current version of the device represented 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; + + /** + * Count of updates that are available for the current device version as + * per the last scan on the device. + */ + @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 update items + * detected 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 if a download is in progress. + */ + @JsonProperty(value = "properties.inProgressDownloadJobId", access = JsonProperty.Access.WRITE_ONLY) + private String inProgressDownloadJobId; + + /** + * The Job ID of the install job if an install is 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 update titles which are 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, of format: 1.2.17312.13. + * + * @return the deviceVersionNumber value + */ + public String deviceVersionNumber() { + return this.deviceVersionNumber; + } + + /** + * Set the current version of the device, of 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 represented in text format. + * + * @return the friendlyDeviceVersionName value + */ + public String friendlyDeviceVersionName() { + return this.friendlyDeviceVersionName; + } + + /** + * Set the current version of the device represented 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 count of updates that are available for the current device version as per the last scan on the device. + * + * @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 update items detected 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 if a download is in progress. + * + * @return the inProgressDownloadJobId value + */ + public String inProgressDownloadJobId() { + return this.inProgressDownloadJobId; + } + + /** + * Get the Job ID of the install job if an install is 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 update titles which are 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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/UploadCertificateResponseImpl.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/UploadCertificateResponseImpl.java new file mode 100644 index 000000000000..e29787b569a6 --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway.implementation; + +import com.microsoft.azure.management.edgegateway.UploadCertificateResponse; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.edgegateway.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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/UploadCertificateResponseInner.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/UploadCertificateResponseInner.java new file mode 100644 index 000000000000..c768b640fe50 --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway.implementation; + +import com.microsoft.azure.management.edgegateway.AuthenticationType; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The upload registration certificate response. + */ +public class UploadCertificateResponseInner { + /** + * Specifies the Authentication type. Possible values include: 'Invalid', + * 'AzureActiveDirectory'. + */ + @JsonProperty(value = "authType") + private AuthenticationType authType; + + /** + * The resource ID of the edge 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 the Authentication type. Possible values include: 'Invalid', 'AzureActiveDirectory'. + * + * @return the authType value + */ + public AuthenticationType authType() { + return this.authType; + } + + /** + * Set specifies the 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 edge device. + * + * @return the resourceId value + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the resource ID of the edge 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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/UserImpl.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/UserImpl.java new file mode 100644 index 000000000000..70c769caca90 --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway.implementation; + +import com.microsoft.azure.management.edgegateway.User; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.edgegateway.AsymmetricEncryptedSecret; +import java.util.List; +import com.microsoft.azure.management.edgegateway.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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/UserInner.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/UserInner.java new file mode 100644 index 000000000000..8155c7ff9c28 --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway.implementation; + +import com.microsoft.azure.management.edgegateway.AsymmetricEncryptedSecret; +import java.util.List; +import com.microsoft.azure.management.edgegateway.ShareAccessRight; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.management.edgegateway.ARMBaseModel; + +/** + * Represents a user who has access to one or more shares on the Edge storage + * device. + */ +@JsonFlatten +public class UserInner extends ARMBaseModel { + /** + * The details of the password specified for the user. + */ + @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 details of the password specified for the user. + * + * @return the encryptedPassword value + */ + public AsymmetricEncryptedSecret encryptedPassword() { + return this.encryptedPassword; + } + + /** + * Set the details of the password specified for the user. + * + * @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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/UsersImpl.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/UsersImpl.java new file mode 100644 index 000000000000..eb19bbe45d8e --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/UsersImpl.java @@ -0,0 +1,81 @@ +/** + * 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.edgegateway.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.edgegateway.Users; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.edgegateway.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) + .map(new Func1() { + @Override + public User call(UserInner inner) { + return 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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/UsersInner.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/UsersInner.java new file mode 100644 index 000000000000..087cb8b6ccf5 --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway.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.edgegateway.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.edgegateway.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.edgegateway.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.edgegateway.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.edgegateway.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.edgegateway.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.edgegateway.Users listByDataBoxEdgeDeviceNext" }) + @GET + Observable> listByDataBoxEdgeDeviceNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Returns all the users registered 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<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(); + } + }; + } + + /** + * Returns all the users registered 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); + } + + /** + * Returns all the users registered 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<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(); + } + }); + } + + /** + * Returns all the users registered 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<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)); + } + }); + } + + /** + * Returns all the users registered 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<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); + } + + /** + * Returns the properties of the specified user. + * + * @param deviceName The device name. + * @param name The name of the user who needs to be retrieved. + * @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(); + } + + /** + * Returns the properties of the specified user. + * + * @param deviceName The device name. + * @param name The name of the user who needs to be retrieved. + * @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); + } + + /** + * Returns the properties of the specified user. + * + * @param deviceName The device name. + * @param name The name of the user who needs to be retrieved. + * @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(); + } + }); + } + + /** + * Returns the properties of the specified user. + * + * @param deviceName The device name. + * @param name The name of the user who needs to be retrieved. + * @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); + } + + /** + * Create a new user or update an existing user's information on a data box edge/gateway device. + * + * @param deviceName The device name. + * @param name The name of the user who needs to be added/updated. + * @param resourceGroupName The resource group name. + * @param user The user object containing the user details and encrypted password. + * @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(); + } + + /** + * Create a new user or update an existing user's information on a data box edge/gateway device. + * + * @param deviceName The device name. + * @param name The name of the user who needs to be added/updated. + * @param resourceGroupName The resource group name. + * @param user The user object containing the user details and encrypted password. + * @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); + } + + /** + * Create a new user or update an existing user's information on a data box edge/gateway device. + * + * @param deviceName The device name. + * @param name The name of the user who needs to be added/updated. + * @param resourceGroupName The resource group name. + * @param user The user object containing the user details and encrypted password. + * @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(); + } + }); + } + + /** + * Create a new user or update an existing user's information on a data box edge/gateway device. + * + * @param deviceName The device name. + * @param name The name of the user who needs to be added/updated. + * @param resourceGroupName The resource group name. + * @param user The user object containing the user details and encrypted password. + * @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()); + } + + /** + * Create a new user or update an existing user's information on a data box edge/gateway device. + * + * @param deviceName The device name. + * @param name The name of the user who needs to be added/updated. + * @param resourceGroupName The resource group name. + * @param user The user object containing the user details and encrypted password. + * @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(); + } + + /** + * Create a new user or update an existing user's information on a data box edge/gateway device. + * + * @param deviceName The device name. + * @param name The name of the user who needs to be added/updated. + * @param resourceGroupName The resource group name. + * @param user The user object containing the user details and encrypted password. + * @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); + } + + /** + * Create a new user or update an existing user's information on a data box edge/gateway device. + * + * @param deviceName The device name. + * @param name The name of the user who needs to be added/updated. + * @param resourceGroupName The resource group name. + * @param user The user object containing the user details and encrypted password. + * @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(); + } + }); + } + + /** + * Create a new user or update an existing user's information on a data box edge/gateway device. + * + * @param deviceName The device name. + * @param name The name of the user who needs to be added/updated. + * @param resourceGroupName The resource group name. + * @param user The user object containing the user details and encrypted password. + * @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 name of the user who needs to be deleted. + * @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 name of the user who needs to be deleted. + * @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 name of the user who needs to be deleted. + * @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 name of the user who needs to be deleted. + * @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 name of the user who needs to be deleted. + * @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 name of the user who needs to be deleted. + * @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 name of the user who needs to be deleted. + * @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 name of the user who needs to be deleted. + * @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); + } + + /** + * Returns all the users registered 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<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(); + } + }; + } + + /** + * Returns all the users registered 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); + } + + /** + * Returns all the users registered 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<UserInner> object + */ + public Observable> listByDataBoxEdgeDeviceNextAsync(final String nextPageLink) { + return listByDataBoxEdgeDeviceNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Returns all the users registered 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<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)); + } + }); + } + + /** + * Returns all the users registered 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<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/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/package-info.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/implementation/package-info.java new file mode 100644 index 000000000000..561c61ae3e5c --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway.implementation; diff --git a/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/package-info.java b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/package-info.java new file mode 100644 index 000000000000..fc0bdbf44230 --- /dev/null +++ b/azure-mgmt-edgegateway/src/main/java/com/microsoft/azure/management/edgegateway/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.edgegateway;