From 2995cfacd256cccea2545a6038add38900a94624 Mon Sep 17 00:00:00 2001 From: SDK Automation Date: Fri, 21 Feb 2020 19:00:06 +0000 Subject: [PATCH] Generated from c84335e325912fc8d5a74218e3b1426557d5cb98 Updated readme.md --- sdk/cosmosdb/mgmt-v2015_04_08/pom.xml | 135 + .../cosmosdb/v2015_04_08/Capability.java | 45 + .../v2015_04_08/CassandraKeyspace.java | 127 + ...ssandraKeyspaceCreateUpdateParameters.java | 73 + .../CassandraKeyspaceResource.java | 43 + .../v2015_04_08/CassandraPartitionKey.java | 43 + .../cosmosdb/v2015_04_08/CassandraSchema.java | 96 + .../cosmosdb/v2015_04_08/CassandraTable.java | 61 + .../CassandraTableCreateUpdateParameters.java | 73 + .../v2015_04_08/CassandraTableResource.java | 95 + .../cosmosdb/v2015_04_08/ClusterKey.java | 70 + ...lectionDatabasisDatabaseAccountMetric.java | 52 + ...abasisDatabaseAccountMetricDefinition.java | 46 + ...onDatabasisDatabaseAccountMetricModel.java | 52 + ...llectionDatabasisDatabaseAccountUsage.java | 45 + .../CollectionPartitionRegions.java | 31 + .../v2015_04_08/CollectionPartitions.java | 42 + .../v2015_04_08/CollectionRegions.java | 32 + .../cosmosdb/v2015_04_08/Collections.java | 57 + .../cosmosdb/v2015_04_08/Column.java | 69 + .../v2015_04_08/ConflictResolutionMode.java | 41 + .../v2015_04_08/ConflictResolutionPolicy.java | 96 + .../cosmosdb/v2015_04_08/ConnectorOffer.java | 38 + .../v2015_04_08/ConsistencyPolicy.java | 103 + .../v2015_04_08/ContainerPartitionKey.java | 72 + .../cosmosdb/v2015_04_08/DataType.java | 53 + .../cosmosdb/v2015_04_08/DatabaseAccount.java | 305 + .../DatabaseAccountConnectionString.java | 47 + ...DatabaseAccountCreateUpdateParameters.java | 353 + .../v2015_04_08/DatabaseAccountKind.java | 44 + ...aseAccountListConnectionStringsResult.java | 26 + .../DatabaseAccountListKeysResult.java | 40 + ...DatabaseAccountListReadOnlyKeysResult.java | 30 + .../v2015_04_08/DatabaseAccountMetric.java | 52 + .../DatabaseAccountMetricDefinition.java | 46 + .../v2015_04_08/DatabaseAccountOfferType.java | 50 + .../DatabaseAccountPatchParameters.java | 73 + ...atabaseAccountRegenerateKeyParameters.java | 44 + .../v2015_04_08/DatabaseAccountRegions.java | 31 + .../v2015_04_08/DatabaseAccountUsage.java | 45 + .../v2015_04_08/DatabaseAccounts.java | 751 ++ .../cosmosdb/v2015_04_08/Databases.java | 54 + .../DatabasisDatabaseAccountMetric.java | 52 + ...abasisDatabaseAccountMetricDefinition.java | 46 + .../DatabasisDatabaseAccountUsage.java | 45 + .../v2015_04_08/DefaultConsistencyLevel.java | 62 + .../cosmosdb/v2015_04_08/ErrorResponse.java | 69 + .../v2015_04_08/ErrorResponseException.java | 44 + .../cosmosdb/v2015_04_08/ExcludedPath.java | 44 + .../ExtendedResourceProperties.java | 98 + .../v2015_04_08/FailoverPolicies.java | 44 + .../cosmosdb/v2015_04_08/FailoverPolicy.java | 89 + .../cosmosdb/v2015_04_08/GremlinDatabase.java | 66 + ...GremlinDatabaseCreateUpdateParameters.java | 73 + .../v2015_04_08/GremlinDatabaseResource.java | 43 + .../cosmosdb/v2015_04_08/GremlinGraph.java | 169 + .../GremlinGraphCreateUpdateParameters.java | 73 + .../v2015_04_08/GremlinGraphResource.java | 177 + .../cosmosdb/v2015_04_08/IncludedPath.java | 71 + .../cosmosdb/v2015_04_08/IndexKind.java | 44 + .../cosmosdb/v2015_04_08/Indexes.java | 98 + .../cosmosdb/v2015_04_08/IndexingMode.java | 44 + .../cosmosdb/v2015_04_08/IndexingPolicy.java | 123 + .../cosmosdb/v2015_04_08/KeyKind.java | 47 + .../cosmosdb/v2015_04_08/Location.java | 157 + .../v2015_04_08/MetricAvailability.java | 47 + .../cosmosdb/v2015_04_08/MetricName.java | 47 + .../cosmosdb/v2015_04_08/MetricValue.java | 108 + .../v2015_04_08/MongoDBCollection.java | 140 + ...ngoDBCollectionCreateUpdateParameters.java | 73 + .../MongoDBCollectionResource.java | 97 + .../cosmosdb/v2015_04_08/MongoDBDatabase.java | 51 + ...MongoDBDatabaseCreateUpdateParameters.java | 73 + .../v2015_04_08/MongoDBDatabaseResource.java | 43 + .../cosmosdb/v2015_04_08/MongoIndex.java | 69 + .../cosmosdb/v2015_04_08/MongoIndexKeys.java | 44 + .../v2015_04_08/MongoIndexOptions.java | 69 + .../cosmosdb/v2015_04_08/Operation.java | 30 + .../v2015_04_08/OperationDisplay.java | 121 + .../cosmosdb/v2015_04_08/Operations.java | 27 + .../PartitionKeyRangeIdRegions.java | 32 + .../v2015_04_08/PartitionKeyRangeIds.java | 31 + .../cosmosdb/v2015_04_08/PartitionKind.java | 41 + .../cosmosdb/v2015_04_08/PartitionMetric.java | 62 + .../cosmosdb/v2015_04_08/PartitionUsage.java | 55 + .../v2015_04_08/PercentileMetric.java | 52 + .../v2015_04_08/PercentileMetricValue.java | 122 + .../v2015_04_08/PercentileSourceTargets.java | 32 + .../v2015_04_08/PercentileTargets.java | 31 + .../cosmosdb/v2015_04_08/Percentiles.java | 30 + .../v2015_04_08/PrimaryAggregationType.java | 53 + .../v2015_04_08/RegionForOnlineOffline.java | 43 + .../cosmosdb/v2015_04_08/SqlContainer.java | 169 + .../SqlContainerCreateUpdateParameters.java | 73 + .../v2015_04_08/SqlContainerResource.java | 177 + .../cosmosdb/v2015_04_08/SqlDatabase.java | 152 + .../SqlDatabaseCreateUpdateParameters.java | 73 + .../v2015_04_08/SqlDatabaseResource.java | 43 + .../cosmosdb/v2015_04_08/Table.java | 127 + .../TableCreateUpdateParameters.java | 73 + .../cosmosdb/v2015_04_08/TableResource.java | 43 + .../cosmosdb/v2015_04_08/Throughput.java | 51 + .../v2015_04_08/ThroughputResource.java | 43 + .../ThroughputUpdateParameters.java | 45 + .../cosmosdb/v2015_04_08/UniqueKey.java | 46 + .../cosmosdb/v2015_04_08/UniqueKeyPolicy.java | 46 + .../cosmosdb/v2015_04_08/UnitType.java | 56 + .../v2015_04_08/VirtualNetworkRule.java | 71 + .../implementation/CassandraKeyspaceImpl.java | 145 + .../CassandraKeyspaceInner.java | 48 + .../implementation/CassandraTableImpl.java | 68 + .../implementation/CassandraTableInner.java | 101 + ...isDatabaseAccountMetricDefinitionImpl.java | 60 + ...ionDatabasisDatabaseAccountMetricImpl.java | 65 + ...tabasisDatabaseAccountMetricModelImpl.java | 65 + ...tionDatabasisDatabaseAccountUsageImpl.java | 57 + .../CollectionPartitionRegionsImpl.java | 49 + .../CollectionPartitionRegionsInner.java | 180 + .../CollectionPartitionsImpl.java | 68 + .../CollectionPartitionsInner.java | 385 + .../implementation/CollectionRegionsImpl.java | 53 + .../CollectionRegionsInner.java | 180 + .../implementation/CollectionsImpl.java | 99 + .../implementation/CollectionsInner.java | 494 + .../CosmosDBManagementClientImpl.java | 364 + .../implementation/CosmosDBManager.java | 243 + .../implementation/DatabaseAccountImpl.java | 238 + .../implementation/DatabaseAccountInner.java | 403 + ...ccountListConnectionStringsResultImpl.java | 33 + ...countListConnectionStringsResultInner.java | 45 + .../DatabaseAccountListKeysResultImpl.java | 46 + .../DatabaseAccountListKeysResultInner.java | 47 + ...baseAccountListReadOnlyKeysResultImpl.java | 36 + ...aseAccountListReadOnlyKeysResultInner.java | 47 + .../DatabaseAccountMetricDefinitionImpl.java | 60 + .../DatabaseAccountMetricImpl.java | 65 + .../DatabaseAccountRegionsImpl.java | 49 + .../DatabaseAccountRegionsInner.java | 166 + .../DatabaseAccountUsageImpl.java | 57 + .../implementation/DatabaseAccountsImpl.java | 998 ++ .../implementation/DatabaseAccountsInner.java | 10384 ++++++++++++++++ .../implementation/DatabasesImpl.java | 99 + .../implementation/DatabasesInner.java | 466 + ...isDatabaseAccountMetricDefinitionImpl.java | 60 + .../DatabasisDatabaseAccountMetricImpl.java | 65 + .../DatabasisDatabaseAccountUsageImpl.java | 57 + .../implementation/GremlinDatabaseImpl.java | 72 + .../implementation/GremlinDatabaseInner.java | 128 + .../implementation/GremlinGraphImpl.java | 192 + .../implementation/GremlinGraphInner.java | 266 + .../implementation/IdParsingUtils.java | 57 + .../implementation/MetricDefinitionInner.java | 111 + .../implementation/MetricInner.java | 125 + .../implementation/MongoDBCollectionImpl.java | 160 + .../MongoDBCollectionInner.java | 103 + .../implementation/MongoDBDatabaseImpl.java | 57 + .../implementation/MongoDBDatabaseInner.java | 48 + .../implementation/OperationImpl.java | 37 + .../implementation/OperationInner.java | 70 + .../implementation/OperationsImpl.java | 49 + .../implementation/OperationsInner.java | 283 + .../v2015_04_08/implementation/PageImpl.java | 75 + .../v2015_04_08/implementation/PageImpl1.java | 75 + .../PartitionKeyRangeIdRegionsImpl.java | 49 + .../PartitionKeyRangeIdRegionsInner.java | 187 + .../PartitionKeyRangeIdsImpl.java | 49 + .../PartitionKeyRangeIdsInner.java | 180 + .../implementation/PartitionMetricImpl.java | 71 + .../implementation/PartitionMetricInner.java | 47 + .../implementation/PartitionUsageImpl.java | 63 + .../implementation/PartitionUsageInner.java | 47 + .../implementation/PercentileMetricImpl.java | 61 + .../implementation/PercentileMetricInner.java | 125 + .../PercentileSourceTargetsImpl.java | 49 + .../PercentileSourceTargetsInner.java | 173 + .../implementation/PercentileTargetsImpl.java | 49 + .../PercentileTargetsInner.java | 166 + .../implementation/PercentilesImpl.java | 49 + .../implementation/PercentilesInner.java | 159 + .../implementation/SqlContainerImpl.java | 192 + .../implementation/SqlContainerInner.java | 266 + .../implementation/SqlDatabaseImpl.java | 170 + .../implementation/SqlDatabaseInner.java | 182 + .../v2015_04_08/implementation/TableImpl.java | 145 + .../implementation/TableInner.java | 48 + .../implementation/ThroughputImpl.java | 57 + .../implementation/ThroughputInner.java | 48 + .../implementation/UsageInner.java | 107 + .../implementation/package-info.java | 11 + .../cosmosdb/v2015_04_08/package-info.java | 11 + 190 files changed, 29184 insertions(+) create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/pom.xml create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/Capability.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/CassandraKeyspace.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/CassandraKeyspaceCreateUpdateParameters.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/CassandraKeyspaceResource.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/CassandraPartitionKey.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/CassandraSchema.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/CassandraTable.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/CassandraTableCreateUpdateParameters.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/CassandraTableResource.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/ClusterKey.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/CollectionDatabasisDatabaseAccountMetric.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/CollectionDatabasisDatabaseAccountMetricDefinition.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/CollectionDatabasisDatabaseAccountMetricModel.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/CollectionDatabasisDatabaseAccountUsage.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/CollectionPartitionRegions.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/CollectionPartitions.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/CollectionRegions.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/Collections.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/Column.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/ConflictResolutionMode.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/ConflictResolutionPolicy.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/ConnectorOffer.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/ConsistencyPolicy.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/ContainerPartitionKey.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DataType.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DatabaseAccount.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DatabaseAccountConnectionString.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DatabaseAccountCreateUpdateParameters.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DatabaseAccountKind.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DatabaseAccountListConnectionStringsResult.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DatabaseAccountListKeysResult.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DatabaseAccountListReadOnlyKeysResult.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DatabaseAccountMetric.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DatabaseAccountMetricDefinition.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DatabaseAccountOfferType.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DatabaseAccountPatchParameters.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DatabaseAccountRegenerateKeyParameters.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DatabaseAccountRegions.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DatabaseAccountUsage.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DatabaseAccounts.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/Databases.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DatabasisDatabaseAccountMetric.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DatabasisDatabaseAccountMetricDefinition.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DatabasisDatabaseAccountUsage.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DefaultConsistencyLevel.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/ErrorResponse.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/ErrorResponseException.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/ExcludedPath.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/ExtendedResourceProperties.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/FailoverPolicies.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/FailoverPolicy.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/GremlinDatabase.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/GremlinDatabaseCreateUpdateParameters.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/GremlinDatabaseResource.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/GremlinGraph.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/GremlinGraphCreateUpdateParameters.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/GremlinGraphResource.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/IncludedPath.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/IndexKind.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/Indexes.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/IndexingMode.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/IndexingPolicy.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/KeyKind.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/Location.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/MetricAvailability.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/MetricName.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/MetricValue.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/MongoDBCollection.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/MongoDBCollectionCreateUpdateParameters.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/MongoDBCollectionResource.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/MongoDBDatabase.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/MongoDBDatabaseCreateUpdateParameters.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/MongoDBDatabaseResource.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/MongoIndex.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/MongoIndexKeys.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/MongoIndexOptions.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/Operation.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/OperationDisplay.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/Operations.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/PartitionKeyRangeIdRegions.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/PartitionKeyRangeIds.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/PartitionKind.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/PartitionMetric.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/PartitionUsage.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/PercentileMetric.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/PercentileMetricValue.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/PercentileSourceTargets.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/PercentileTargets.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/Percentiles.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/PrimaryAggregationType.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/RegionForOnlineOffline.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/SqlContainer.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/SqlContainerCreateUpdateParameters.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/SqlContainerResource.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/SqlDatabase.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/SqlDatabaseCreateUpdateParameters.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/SqlDatabaseResource.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/Table.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/TableCreateUpdateParameters.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/TableResource.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/Throughput.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/ThroughputResource.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/ThroughputUpdateParameters.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/UniqueKey.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/UniqueKeyPolicy.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/UnitType.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/VirtualNetworkRule.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/CassandraKeyspaceImpl.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/CassandraKeyspaceInner.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/CassandraTableImpl.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/CassandraTableInner.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/CollectionDatabasisDatabaseAccountMetricDefinitionImpl.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/CollectionDatabasisDatabaseAccountMetricImpl.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/CollectionDatabasisDatabaseAccountMetricModelImpl.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/CollectionDatabasisDatabaseAccountUsageImpl.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/CollectionPartitionRegionsImpl.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/CollectionPartitionRegionsInner.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/CollectionPartitionsImpl.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/CollectionPartitionsInner.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/CollectionRegionsImpl.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/CollectionRegionsInner.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/CollectionsImpl.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/CollectionsInner.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/CosmosDBManagementClientImpl.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/CosmosDBManager.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountImpl.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountInner.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountListConnectionStringsResultImpl.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountListConnectionStringsResultInner.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountListKeysResultImpl.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountListKeysResultInner.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountListReadOnlyKeysResultImpl.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountListReadOnlyKeysResultInner.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountMetricDefinitionImpl.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountMetricImpl.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountRegionsImpl.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountRegionsInner.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountUsageImpl.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountsImpl.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountsInner.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabasesImpl.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabasesInner.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabasisDatabaseAccountMetricDefinitionImpl.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabasisDatabaseAccountMetricImpl.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabasisDatabaseAccountUsageImpl.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/GremlinDatabaseImpl.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/GremlinDatabaseInner.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/GremlinGraphImpl.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/GremlinGraphInner.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/IdParsingUtils.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/MetricDefinitionInner.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/MetricInner.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/MongoDBCollectionImpl.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/MongoDBCollectionInner.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/MongoDBDatabaseImpl.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/MongoDBDatabaseInner.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/OperationImpl.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/OperationInner.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/OperationsImpl.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/OperationsInner.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/PageImpl.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/PageImpl1.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/PartitionKeyRangeIdRegionsImpl.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/PartitionKeyRangeIdRegionsInner.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/PartitionKeyRangeIdsImpl.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/PartitionKeyRangeIdsInner.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/PartitionMetricImpl.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/PartitionMetricInner.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/PartitionUsageImpl.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/PartitionUsageInner.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/PercentileMetricImpl.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/PercentileMetricInner.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/PercentileSourceTargetsImpl.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/PercentileSourceTargetsInner.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/PercentileTargetsImpl.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/PercentileTargetsInner.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/PercentilesImpl.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/PercentilesInner.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/SqlContainerImpl.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/SqlContainerInner.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/SqlDatabaseImpl.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/SqlDatabaseInner.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/TableImpl.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/TableInner.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/ThroughputImpl.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/ThroughputInner.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/UsageInner.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/package-info.java create mode 100644 sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/package-info.java diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/pom.xml b/sdk/cosmosdb/mgmt-v2015_04_08/pom.xml new file mode 100644 index 000000000000..64718249a534 --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/pom.xml @@ -0,0 +1,135 @@ + + + 4.0.0 + com.microsoft.azure.cosmosdb.v2015_04_08 + + com.microsoft.azure + azure-arm-parent + 1.1.0 + ../../../pom.management.xml + + azure-mgmt-cosmosdb + 1.0.0-beta + jar + Microsoft Azure SDK for CosmosDB Management + This package contains Microsoft CosmosDB Management SDK. + https://github.com/Azure/azure-sdk-for-java + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + scm:git:https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + UTF-8 + + + + + microsoft + Microsoft + + + + + com.microsoft.azure + azure-client-runtime + + + com.microsoft.azure + azure-arm-client-runtime + + + junit + junit + test + + + com.microsoft.azure + azure-client-authentication + test + + + com.microsoft.azure + azure-mgmt-resources + test + + + com.microsoft.azure + azure-arm-client-runtime + test-jar + test + + 1.6.5 + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + true + true + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.7 + 1.7 + + + com.microsoft.azure.management.apigeneration.LangDefinitionProcessor + + + true + true + + true + true + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.8 + + *.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.search + + + /** +
* Copyright (c) Microsoft Corporation. All rights reserved. +
* Licensed under the MIT License. See License.txt in the project root for +
* license information. +
*/ + ]]> +
+
+
+
+
+
diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/Capability.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/Capability.java new file mode 100644 index 000000000000..88ce9d9db11a --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/Capability.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.cosmosdb.v2015_04_08; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Cosmos DB capability object. + */ +public class Capability { + /** + * Name of the Cosmos DB capability. For example, "name": + * "EnableCassandra". Current values also include "EnableTable" and + * "EnableGremlin". + */ + @JsonProperty(value = "name") + private String name; + + /** + * Get name of the Cosmos DB capability. For example, "name": "EnableCassandra". Current values also include "EnableTable" and "EnableGremlin". + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the Cosmos DB capability. For example, "name": "EnableCassandra". Current values also include "EnableTable" and "EnableGremlin". + * + * @param name the name value to set + * @return the Capability object itself. + */ + public Capability withName(String name) { + this.name = name; + return this; + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/CassandraKeyspace.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/CassandraKeyspace.java new file mode 100644 index 000000000000..c67f335d7cbd --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/CassandraKeyspace.java @@ -0,0 +1,127 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.cosmosdb.v2015_04_08; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation.CassandraKeyspaceInner; +import com.microsoft.azure.arm.model.Indexable; +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.cosmosdb.v2015_04_08.implementation.CosmosDBManager; +import java.util.Map; + +/** + * Type representing CassandraKeyspace. + */ +public interface CassandraKeyspace extends HasInner, Indexable, Updatable, HasManager { + /** + * @return the cassandraKeyspaceId value. + */ + String cassandraKeyspaceId(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the CassandraKeyspace definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithApi, DefinitionStages.WithOptions, DefinitionStages.WithResource, DefinitionStages.WithCreate { + } + + /** + * Grouping of CassandraKeyspace definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a CassandraKeyspace definition. + */ + interface Blank extends WithApi { + } + + /** + * The stage of the cassandrakeyspace definition allowing to specify Api. + */ + interface WithApi { + /** + * Specifies resourceGroupName, accountName. + * @param resourceGroupName Name of an Azure resource group + * @param accountName Cosmos DB database account name + * @return the next definition stage + */ + WithOptions withExistingApi(String resourceGroupName, String accountName); + } + + /** + * The stage of the cassandrakeyspace definition allowing to specify Options. + */ + interface WithOptions { + /** + * Specifies options. + * @param options A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request + * @return the next definition stage + */ + WithResource withOptions(Map options); + } + + /** + * The stage of the cassandrakeyspace definition allowing to specify Resource. + */ + interface WithResource { + /** + * Specifies resource. + * @param resource The standard JSON format of a Cassandra keyspace + * @return the next definition stage + */ + WithCreate withResource(CassandraKeyspaceResource resource); + } + + /** + * 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 CassandraKeyspace update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable { + } + + /** + * Grouping of CassandraKeyspace update stages. + */ + interface UpdateStages { + } +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/CassandraKeyspaceCreateUpdateParameters.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/CassandraKeyspaceCreateUpdateParameters.java new file mode 100644 index 000000000000..87d4ef3232ac --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/CassandraKeyspaceCreateUpdateParameters.java @@ -0,0 +1,73 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.cosmosdb.v2015_04_08; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Parameters to create and update Cosmos DB Cassandra keyspace. + */ +@JsonFlatten +public class CassandraKeyspaceCreateUpdateParameters { + /** + * The standard JSON format of a Cassandra keyspace. + */ + @JsonProperty(value = "properties.resource", required = true) + private CassandraKeyspaceResource resource; + + /** + * A key-value pair of options to be applied for the request. This + * corresponds to the headers sent with the request. + */ + @JsonProperty(value = "properties.options", required = true) + private Map options; + + /** + * Get the standard JSON format of a Cassandra keyspace. + * + * @return the resource value + */ + public CassandraKeyspaceResource resource() { + return this.resource; + } + + /** + * Set the standard JSON format of a Cassandra keyspace. + * + * @param resource the resource value to set + * @return the CassandraKeyspaceCreateUpdateParameters object itself. + */ + public CassandraKeyspaceCreateUpdateParameters withResource(CassandraKeyspaceResource resource) { + this.resource = resource; + return this; + } + + /** + * Get a key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. + * + * @return the options value + */ + public Map options() { + return this.options; + } + + /** + * Set a key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. + * + * @param options the options value to set + * @return the CassandraKeyspaceCreateUpdateParameters object itself. + */ + public CassandraKeyspaceCreateUpdateParameters withOptions(Map options) { + this.options = options; + return this; + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/CassandraKeyspaceResource.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/CassandraKeyspaceResource.java new file mode 100644 index 000000000000..17c4fb05b8d6 --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/CassandraKeyspaceResource.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.cosmosdb.v2015_04_08; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Cosmos DB Cassandra keyspace id object. + */ +public class CassandraKeyspaceResource { + /** + * Name of the Cosmos DB Cassandra keyspace. + */ + @JsonProperty(value = "id", required = true) + private String id; + + /** + * Get name of the Cosmos DB Cassandra keyspace. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set name of the Cosmos DB Cassandra keyspace. + * + * @param id the id value to set + * @return the CassandraKeyspaceResource object itself. + */ + public CassandraKeyspaceResource withId(String id) { + this.id = id; + return this; + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/CassandraPartitionKey.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/CassandraPartitionKey.java new file mode 100644 index 000000000000..bbe8939950a0 --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/CassandraPartitionKey.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.cosmosdb.v2015_04_08; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Cosmos DB Cassandra table partition key. + */ +public class CassandraPartitionKey { + /** + * Name of the Cosmos DB Cassandra table partition key. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Get name of the Cosmos DB Cassandra table partition key. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the Cosmos DB Cassandra table partition key. + * + * @param name the name value to set + * @return the CassandraPartitionKey object itself. + */ + public CassandraPartitionKey withName(String name) { + this.name = name; + return this; + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/CassandraSchema.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/CassandraSchema.java new file mode 100644 index 000000000000..1570f18858c5 --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/CassandraSchema.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.cosmosdb.v2015_04_08; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Cosmos DB Cassandra table schema. + */ +public class CassandraSchema { + /** + * List of Cassandra table columns. + */ + @JsonProperty(value = "columns") + private List columns; + + /** + * List of partition key. + */ + @JsonProperty(value = "partitionKeys") + private List partitionKeys; + + /** + * List of cluster key. + */ + @JsonProperty(value = "clusterKeys") + private List clusterKeys; + + /** + * Get list of Cassandra table columns. + * + * @return the columns value + */ + public List columns() { + return this.columns; + } + + /** + * Set list of Cassandra table columns. + * + * @param columns the columns value to set + * @return the CassandraSchema object itself. + */ + public CassandraSchema withColumns(List columns) { + this.columns = columns; + return this; + } + + /** + * Get list of partition key. + * + * @return the partitionKeys value + */ + public List partitionKeys() { + return this.partitionKeys; + } + + /** + * Set list of partition key. + * + * @param partitionKeys the partitionKeys value to set + * @return the CassandraSchema object itself. + */ + public CassandraSchema withPartitionKeys(List partitionKeys) { + this.partitionKeys = partitionKeys; + return this; + } + + /** + * Get list of cluster key. + * + * @return the clusterKeys value + */ + public List clusterKeys() { + return this.clusterKeys; + } + + /** + * Set list of cluster key. + * + * @param clusterKeys the clusterKeys value to set + * @return the CassandraSchema object itself. + */ + public CassandraSchema withClusterKeys(List clusterKeys) { + this.clusterKeys = clusterKeys; + return this; + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/CassandraTable.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/CassandraTable.java new file mode 100644 index 000000000000..7057423db00f --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/CassandraTable.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.cosmosdb.v2015_04_08; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation.CosmosDBManager; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation.CassandraTableInner; +import java.util.Map; + +/** + * Type representing CassandraTable. + */ +public interface CassandraTable extends HasInner, HasManager { + /** + * @return the cassandraTableId value. + */ + String cassandraTableId(); + + /** + * @return the defaultTtl value. + */ + Integer defaultTtl(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the schema value. + */ + CassandraSchema schema(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/CassandraTableCreateUpdateParameters.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/CassandraTableCreateUpdateParameters.java new file mode 100644 index 000000000000..71433d405cfe --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/CassandraTableCreateUpdateParameters.java @@ -0,0 +1,73 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.cosmosdb.v2015_04_08; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Parameters to create and update Cosmos DB Cassandra table. + */ +@JsonFlatten +public class CassandraTableCreateUpdateParameters { + /** + * The standard JSON format of a Cassandra table. + */ + @JsonProperty(value = "properties.resource", required = true) + private CassandraTableResource resource; + + /** + * A key-value pair of options to be applied for the request. This + * corresponds to the headers sent with the request. + */ + @JsonProperty(value = "properties.options", required = true) + private Map options; + + /** + * Get the standard JSON format of a Cassandra table. + * + * @return the resource value + */ + public CassandraTableResource resource() { + return this.resource; + } + + /** + * Set the standard JSON format of a Cassandra table. + * + * @param resource the resource value to set + * @return the CassandraTableCreateUpdateParameters object itself. + */ + public CassandraTableCreateUpdateParameters withResource(CassandraTableResource resource) { + this.resource = resource; + return this; + } + + /** + * Get a key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. + * + * @return the options value + */ + public Map options() { + return this.options; + } + + /** + * Set a key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. + * + * @param options the options value to set + * @return the CassandraTableCreateUpdateParameters object itself. + */ + public CassandraTableCreateUpdateParameters withOptions(Map options) { + this.options = options; + return this; + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/CassandraTableResource.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/CassandraTableResource.java new file mode 100644 index 000000000000..6118e97f2b11 --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/CassandraTableResource.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.cosmosdb.v2015_04_08; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Cosmos DB Cassandra table id object. + */ +public class CassandraTableResource { + /** + * Name of the Cosmos DB Cassandra table. + */ + @JsonProperty(value = "id", required = true) + private String id; + + /** + * Time to live of the Cosmos DB Cassandra table. + */ + @JsonProperty(value = "defaultTtl") + private Integer defaultTtl; + + /** + * Schema of the Cosmos DB Cassandra table. + */ + @JsonProperty(value = "schema") + private CassandraSchema schema; + + /** + * Get name of the Cosmos DB Cassandra table. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set name of the Cosmos DB Cassandra table. + * + * @param id the id value to set + * @return the CassandraTableResource object itself. + */ + public CassandraTableResource withId(String id) { + this.id = id; + return this; + } + + /** + * Get time to live of the Cosmos DB Cassandra table. + * + * @return the defaultTtl value + */ + public Integer defaultTtl() { + return this.defaultTtl; + } + + /** + * Set time to live of the Cosmos DB Cassandra table. + * + * @param defaultTtl the defaultTtl value to set + * @return the CassandraTableResource object itself. + */ + public CassandraTableResource withDefaultTtl(Integer defaultTtl) { + this.defaultTtl = defaultTtl; + return this; + } + + /** + * Get schema of the Cosmos DB Cassandra table. + * + * @return the schema value + */ + public CassandraSchema schema() { + return this.schema; + } + + /** + * Set schema of the Cosmos DB Cassandra table. + * + * @param schema the schema value to set + * @return the CassandraTableResource object itself. + */ + public CassandraTableResource withSchema(CassandraSchema schema) { + this.schema = schema; + return this; + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/ClusterKey.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/ClusterKey.java new file mode 100644 index 000000000000..45ea38f0b852 --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/ClusterKey.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.cosmosdb.v2015_04_08; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Cosmos DB Cassandra table cluster key. + */ +public class ClusterKey { + /** + * Name of the Cosmos DB Cassandra table cluster key. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Order of the Cosmos DB Cassandra table cluster key, only support "Asc" + * and "Desc". + */ + @JsonProperty(value = "orderBy") + private String orderBy; + + /** + * Get name of the Cosmos DB Cassandra table cluster key. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the Cosmos DB Cassandra table cluster key. + * + * @param name the name value to set + * @return the ClusterKey object itself. + */ + public ClusterKey withName(String name) { + this.name = name; + return this; + } + + /** + * Get order of the Cosmos DB Cassandra table cluster key, only support "Asc" and "Desc". + * + * @return the orderBy value + */ + public String orderBy() { + return this.orderBy; + } + + /** + * Set order of the Cosmos DB Cassandra table cluster key, only support "Asc" and "Desc". + * + * @param orderBy the orderBy value to set + * @return the ClusterKey object itself. + */ + public ClusterKey withOrderBy(String orderBy) { + this.orderBy = orderBy; + return this; + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/CollectionDatabasisDatabaseAccountMetric.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/CollectionDatabasisDatabaseAccountMetric.java new file mode 100644 index 000000000000..f81040613764 --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/CollectionDatabasisDatabaseAccountMetric.java @@ -0,0 +1,52 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.cosmosdb.v2015_04_08; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation.MetricInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation.CosmosDBManager; +import org.joda.time.DateTime; +import java.util.List; + +/** + * Type representing CollectionDatabasisDatabaseAccountMetric. + */ +public interface CollectionDatabasisDatabaseAccountMetric extends HasInner, HasManager { + /** + * @return the endTime value. + */ + DateTime endTime(); + + /** + * @return the metricValues value. + */ + List metricValues(); + + /** + * @return the name value. + */ + MetricName name(); + + /** + * @return the startTime value. + */ + DateTime startTime(); + + /** + * @return the timeGrain value. + */ + String timeGrain(); + + /** + * @return the unit value. + */ + UnitType unit(); + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/CollectionDatabasisDatabaseAccountMetricDefinition.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/CollectionDatabasisDatabaseAccountMetricDefinition.java new file mode 100644 index 000000000000..5253f6b6fc18 --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/CollectionDatabasisDatabaseAccountMetricDefinition.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.cosmosdb.v2015_04_08; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation.MetricDefinitionInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation.CosmosDBManager; +import java.util.List; + +/** + * Type representing CollectionDatabasisDatabaseAccountMetricDefinition. + */ +public interface CollectionDatabasisDatabaseAccountMetricDefinition extends HasInner, HasManager { + /** + * @return the metricAvailabilities value. + */ + List metricAvailabilities(); + + /** + * @return the name value. + */ + MetricName name(); + + /** + * @return the primaryAggregationType value. + */ + PrimaryAggregationType primaryAggregationType(); + + /** + * @return the resourceUri value. + */ + String resourceUri(); + + /** + * @return the unit value. + */ + UnitType unit(); + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/CollectionDatabasisDatabaseAccountMetricModel.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/CollectionDatabasisDatabaseAccountMetricModel.java new file mode 100644 index 000000000000..627840565ec2 --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/CollectionDatabasisDatabaseAccountMetricModel.java @@ -0,0 +1,52 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.cosmosdb.v2015_04_08; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation.MetricInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation.CosmosDBManager; +import org.joda.time.DateTime; +import java.util.List; + +/** + * Type representing CollectionDatabasisDatabaseAccountMetricModel. + */ +public interface CollectionDatabasisDatabaseAccountMetricModel extends HasInner, HasManager { + /** + * @return the endTime value. + */ + DateTime endTime(); + + /** + * @return the metricValues value. + */ + List metricValues(); + + /** + * @return the name value. + */ + MetricName name(); + + /** + * @return the startTime value. + */ + DateTime startTime(); + + /** + * @return the timeGrain value. + */ + String timeGrain(); + + /** + * @return the unit value. + */ + UnitType unit(); + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/CollectionDatabasisDatabaseAccountUsage.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/CollectionDatabasisDatabaseAccountUsage.java new file mode 100644 index 000000000000..df70472a24aa --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/CollectionDatabasisDatabaseAccountUsage.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.cosmosdb.v2015_04_08; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation.UsageInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation.CosmosDBManager; + +/** + * Type representing CollectionDatabasisDatabaseAccountUsage. + */ +public interface CollectionDatabasisDatabaseAccountUsage extends HasInner, HasManager { + /** + * @return the currentValue value. + */ + Long currentValue(); + + /** + * @return the limit value. + */ + Long limit(); + + /** + * @return the name value. + */ + MetricName name(); + + /** + * @return the quotaPeriod value. + */ + String quotaPeriod(); + + /** + * @return the unit value. + */ + UnitType unit(); + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/CollectionPartitionRegions.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/CollectionPartitionRegions.java new file mode 100644 index 000000000000..456482c65195 --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/CollectionPartitionRegions.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.cosmosdb.v2015_04_08; + +import rx.Observable; + +/** + * Type representing CollectionPartitionRegions. + */ +public interface CollectionPartitionRegions { + /** + * Retrieves the metrics determined by the given filter for the given collection and region, split by partition. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param region Cosmos DB region, with spaces between words and each word capitalized. + * @param databaseRid Cosmos DB database rid. + * @param collectionRid Cosmos DB collection rid. + * @param filter An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listMetricsAsync(String resourceGroupName, String accountName, String region, String databaseRid, String collectionRid, String filter); + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/CollectionPartitions.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/CollectionPartitions.java new file mode 100644 index 000000000000..d6c4810cff4b --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/CollectionPartitions.java @@ -0,0 +1,42 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.cosmosdb.v2015_04_08; + +import rx.Observable; + +/** + * Type representing CollectionPartitions. + */ +public interface CollectionPartitions { + /** + * Retrieves the metrics determined by the given filter for the given collection, split by partition. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseRid Cosmos DB database rid. + * @param collectionRid Cosmos DB collection rid. + * @param filter An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listMetricsAsync(String resourceGroupName, String accountName, String databaseRid, String collectionRid, String filter); + + /** + * Retrieves the usages (most recent storage data) for the given collection, split by partition. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseRid Cosmos DB database rid. + * @param collectionRid Cosmos DB collection rid. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listUsagesAsync(String resourceGroupName, String accountName, String databaseRid, String collectionRid); + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/CollectionRegions.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/CollectionRegions.java new file mode 100644 index 000000000000..5a7caf0910cc --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/CollectionRegions.java @@ -0,0 +1,32 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.cosmosdb.v2015_04_08; + +import rx.Observable; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.CollectionDatabasisDatabaseAccountMetricModel; + +/** + * Type representing CollectionRegions. + */ +public interface CollectionRegions { + /** + * Retrieves the metrics determined by the given filter for the given database account, collection and region. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param region Cosmos DB region, with spaces between words and each word capitalized. + * @param databaseRid Cosmos DB database rid. + * @param collectionRid Cosmos DB collection rid. + * @param filter An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listMetricsAsync(String resourceGroupName, String accountName, String region, String databaseRid, String collectionRid, String filter); + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/Collections.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/Collections.java new file mode 100644 index 000000000000..308b198dedcd --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/Collections.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.cosmosdb.v2015_04_08; + +import rx.Observable; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.CollectionDatabasisDatabaseAccountMetricDefinition; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.CollectionDatabasisDatabaseAccountMetric; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.CollectionDatabasisDatabaseAccountUsage; + +/** + * Type representing Collections. + */ +public interface Collections { + /** + * Retrieves metric definitions for the given collection. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseRid Cosmos DB database rid. + * @param collectionRid Cosmos DB collection rid. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listMetricDefinitionsAsync(String resourceGroupName, String accountName, String databaseRid, String collectionRid); + + /** + * Retrieves the metrics determined by the given filter for the given database account and collection. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseRid Cosmos DB database rid. + * @param collectionRid Cosmos DB collection rid. + * @param filter An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listMetricsAsync(String resourceGroupName, String accountName, String databaseRid, String collectionRid, String filter); + + /** + * Retrieves the usages (most recent storage data) for the given collection. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseRid Cosmos DB database rid. + * @param collectionRid Cosmos DB collection rid. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listUsagesAsync(String resourceGroupName, String accountName, String databaseRid, String collectionRid); + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/Column.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/Column.java new file mode 100644 index 000000000000..66474dd6d67b --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/Column.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.cosmosdb.v2015_04_08; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Cosmos DB Cassandra table column. + */ +public class Column { + /** + * Name of the Cosmos DB Cassandra table column. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Type of the Cosmos DB Cassandra table column. + */ + @JsonProperty(value = "type") + private String type; + + /** + * Get name of the Cosmos DB Cassandra table column. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the Cosmos DB Cassandra table column. + * + * @param name the name value to set + * @return the Column object itself. + */ + public Column withName(String name) { + this.name = name; + return this; + } + + /** + * Get type of the Cosmos DB Cassandra table column. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set type of the Cosmos DB Cassandra table column. + * + * @param type the type value to set + * @return the Column object itself. + */ + public Column withType(String type) { + this.type = type; + return this; + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/ConflictResolutionMode.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/ConflictResolutionMode.java new file mode 100644 index 000000000000..f548581daa8b --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/ConflictResolutionMode.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.cosmosdb.v2015_04_08; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ConflictResolutionMode. + */ +public final class ConflictResolutionMode extends ExpandableStringEnum { + /** Static value LastWriterWins for ConflictResolutionMode. */ + public static final ConflictResolutionMode LAST_WRITER_WINS = fromString("LastWriterWins"); + + /** Static value Custom for ConflictResolutionMode. */ + public static final ConflictResolutionMode CUSTOM = fromString("Custom"); + + /** + * Creates or finds a ConflictResolutionMode from its string representation. + * @param name a name to look for + * @return the corresponding ConflictResolutionMode + */ + @JsonCreator + public static ConflictResolutionMode fromString(String name) { + return fromString(name, ConflictResolutionMode.class); + } + + /** + * @return known ConflictResolutionMode values + */ + public static Collection values() { + return values(ConflictResolutionMode.class); + } +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/ConflictResolutionPolicy.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/ConflictResolutionPolicy.java new file mode 100644 index 000000000000..e14e3d639f55 --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/ConflictResolutionPolicy.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.cosmosdb.v2015_04_08; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The conflict resolution policy for the container. + */ +public class ConflictResolutionPolicy { + /** + * Indicates the conflict resolution mode. Possible values include: + * 'LastWriterWins', 'Custom'. + */ + @JsonProperty(value = "mode") + private ConflictResolutionMode mode; + + /** + * The conflict resolution path in the case of LastWriterWins mode. + */ + @JsonProperty(value = "conflictResolutionPath") + private String conflictResolutionPath; + + /** + * The procedure to resolve conflicts in the case of custom mode. + */ + @JsonProperty(value = "conflictResolutionProcedure") + private String conflictResolutionProcedure; + + /** + * Get indicates the conflict resolution mode. Possible values include: 'LastWriterWins', 'Custom'. + * + * @return the mode value + */ + public ConflictResolutionMode mode() { + return this.mode; + } + + /** + * Set indicates the conflict resolution mode. Possible values include: 'LastWriterWins', 'Custom'. + * + * @param mode the mode value to set + * @return the ConflictResolutionPolicy object itself. + */ + public ConflictResolutionPolicy withMode(ConflictResolutionMode mode) { + this.mode = mode; + return this; + } + + /** + * Get the conflict resolution path in the case of LastWriterWins mode. + * + * @return the conflictResolutionPath value + */ + public String conflictResolutionPath() { + return this.conflictResolutionPath; + } + + /** + * Set the conflict resolution path in the case of LastWriterWins mode. + * + * @param conflictResolutionPath the conflictResolutionPath value to set + * @return the ConflictResolutionPolicy object itself. + */ + public ConflictResolutionPolicy withConflictResolutionPath(String conflictResolutionPath) { + this.conflictResolutionPath = conflictResolutionPath; + return this; + } + + /** + * Get the procedure to resolve conflicts in the case of custom mode. + * + * @return the conflictResolutionProcedure value + */ + public String conflictResolutionProcedure() { + return this.conflictResolutionProcedure; + } + + /** + * Set the procedure to resolve conflicts in the case of custom mode. + * + * @param conflictResolutionProcedure the conflictResolutionProcedure value to set + * @return the ConflictResolutionPolicy object itself. + */ + public ConflictResolutionPolicy withConflictResolutionProcedure(String conflictResolutionProcedure) { + this.conflictResolutionProcedure = conflictResolutionProcedure; + return this; + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/ConnectorOffer.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/ConnectorOffer.java new file mode 100644 index 000000000000..0c7b491f046e --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/ConnectorOffer.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.cosmosdb.v2015_04_08; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ConnectorOffer. + */ +public final class ConnectorOffer extends ExpandableStringEnum { + /** Static value Small for ConnectorOffer. */ + public static final ConnectorOffer SMALL = fromString("Small"); + + /** + * Creates or finds a ConnectorOffer from its string representation. + * @param name a name to look for + * @return the corresponding ConnectorOffer + */ + @JsonCreator + public static ConnectorOffer fromString(String name) { + return fromString(name, ConnectorOffer.class); + } + + /** + * @return known ConnectorOffer values + */ + public static Collection values() { + return values(ConnectorOffer.class); + } +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/ConsistencyPolicy.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/ConsistencyPolicy.java new file mode 100644 index 000000000000..a863d8764eb3 --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/ConsistencyPolicy.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.cosmosdb.v2015_04_08; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The consistency policy for the Cosmos DB database account. + */ +public class ConsistencyPolicy { + /** + * The default consistency level and configuration settings of the Cosmos + * DB account. Possible values include: 'Eventual', 'Session', + * 'BoundedStaleness', 'Strong', 'ConsistentPrefix'. + */ + @JsonProperty(value = "defaultConsistencyLevel", required = true) + private DefaultConsistencyLevel defaultConsistencyLevel; + + /** + * When used with the Bounded Staleness consistency level, this value + * represents the number of stale requests tolerated. Accepted range for + * this value is 1 – 2,147,483,647. Required when defaultConsistencyPolicy + * is set to 'BoundedStaleness'. + */ + @JsonProperty(value = "maxStalenessPrefix") + private Long maxStalenessPrefix; + + /** + * When used with the Bounded Staleness consistency level, this value + * represents the time amount of staleness (in seconds) tolerated. Accepted + * range for this value is 5 - 86400. Required when + * defaultConsistencyPolicy is set to 'BoundedStaleness'. + */ + @JsonProperty(value = "maxIntervalInSeconds") + private Integer maxIntervalInSeconds; + + /** + * Get the default consistency level and configuration settings of the Cosmos DB account. Possible values include: 'Eventual', 'Session', 'BoundedStaleness', 'Strong', 'ConsistentPrefix'. + * + * @return the defaultConsistencyLevel value + */ + public DefaultConsistencyLevel defaultConsistencyLevel() { + return this.defaultConsistencyLevel; + } + + /** + * Set the default consistency level and configuration settings of the Cosmos DB account. Possible values include: 'Eventual', 'Session', 'BoundedStaleness', 'Strong', 'ConsistentPrefix'. + * + * @param defaultConsistencyLevel the defaultConsistencyLevel value to set + * @return the ConsistencyPolicy object itself. + */ + public ConsistencyPolicy withDefaultConsistencyLevel(DefaultConsistencyLevel defaultConsistencyLevel) { + this.defaultConsistencyLevel = defaultConsistencyLevel; + return this; + } + + /** + * Get when used with the Bounded Staleness consistency level, this value represents the number of stale requests tolerated. Accepted range for this value is 1 – 2,147,483,647. Required when defaultConsistencyPolicy is set to 'BoundedStaleness'. + * + * @return the maxStalenessPrefix value + */ + public Long maxStalenessPrefix() { + return this.maxStalenessPrefix; + } + + /** + * Set when used with the Bounded Staleness consistency level, this value represents the number of stale requests tolerated. Accepted range for this value is 1 – 2,147,483,647. Required when defaultConsistencyPolicy is set to 'BoundedStaleness'. + * + * @param maxStalenessPrefix the maxStalenessPrefix value to set + * @return the ConsistencyPolicy object itself. + */ + public ConsistencyPolicy withMaxStalenessPrefix(Long maxStalenessPrefix) { + this.maxStalenessPrefix = maxStalenessPrefix; + return this; + } + + /** + * Get when used with the Bounded Staleness consistency level, this value represents the time amount of staleness (in seconds) tolerated. Accepted range for this value is 5 - 86400. Required when defaultConsistencyPolicy is set to 'BoundedStaleness'. + * + * @return the maxIntervalInSeconds value + */ + public Integer maxIntervalInSeconds() { + return this.maxIntervalInSeconds; + } + + /** + * Set when used with the Bounded Staleness consistency level, this value represents the time amount of staleness (in seconds) tolerated. Accepted range for this value is 5 - 86400. Required when defaultConsistencyPolicy is set to 'BoundedStaleness'. + * + * @param maxIntervalInSeconds the maxIntervalInSeconds value to set + * @return the ConsistencyPolicy object itself. + */ + public ConsistencyPolicy withMaxIntervalInSeconds(Integer maxIntervalInSeconds) { + this.maxIntervalInSeconds = maxIntervalInSeconds; + return this; + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/ContainerPartitionKey.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/ContainerPartitionKey.java new file mode 100644 index 000000000000..25b9e1690116 --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/ContainerPartitionKey.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.cosmosdb.v2015_04_08; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The configuration of the partition key to be used for partitioning data into + * multiple partitions. + */ +public class ContainerPartitionKey { + /** + * List of paths using which data within the container can be partitioned. + */ + @JsonProperty(value = "paths") + private List paths; + + /** + * Indicates the kind of algorithm used for partitioning. Possible values + * include: 'Hash', 'Range'. + */ + @JsonProperty(value = "kind") + private PartitionKind kind; + + /** + * Get list of paths using which data within the container can be partitioned. + * + * @return the paths value + */ + public List paths() { + return this.paths; + } + + /** + * Set list of paths using which data within the container can be partitioned. + * + * @param paths the paths value to set + * @return the ContainerPartitionKey object itself. + */ + public ContainerPartitionKey withPaths(List paths) { + this.paths = paths; + return this; + } + + /** + * Get indicates the kind of algorithm used for partitioning. Possible values include: 'Hash', 'Range'. + * + * @return the kind value + */ + public PartitionKind kind() { + return this.kind; + } + + /** + * Set indicates the kind of algorithm used for partitioning. Possible values include: 'Hash', 'Range'. + * + * @param kind the kind value to set + * @return the ContainerPartitionKey object itself. + */ + public ContainerPartitionKey withKind(PartitionKind kind) { + this.kind = kind; + return this; + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DataType.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DataType.java new file mode 100644 index 000000000000..6c05d35b1d14 --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DataType.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.cosmosdb.v2015_04_08; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for DataType. + */ +public final class DataType extends ExpandableStringEnum { + /** Static value String for DataType. */ + public static final DataType STRING = fromString("String"); + + /** Static value Number for DataType. */ + public static final DataType NUMBER = fromString("Number"); + + /** Static value Point for DataType. */ + public static final DataType POINT = fromString("Point"); + + /** Static value Polygon for DataType. */ + public static final DataType POLYGON = fromString("Polygon"); + + /** Static value LineString for DataType. */ + public static final DataType LINE_STRING = fromString("LineString"); + + /** Static value MultiPolygon for DataType. */ + public static final DataType MULTI_POLYGON = fromString("MultiPolygon"); + + /** + * Creates or finds a DataType from its string representation. + * @param name a name to look for + * @return the corresponding DataType + */ + @JsonCreator + public static DataType fromString(String name) { + return fromString(name, DataType.class); + } + + /** + * @return known DataType values + */ + public static Collection values() { + return values(DataType.class); + } +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DatabaseAccount.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DatabaseAccount.java new file mode 100644 index 000000000000..b344cb239bad --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DatabaseAccount.java @@ -0,0 +1,305 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.cosmosdb.v2015_04_08; + +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.cosmosdb.v2015_04_08.implementation.CosmosDBManager; +import java.util.List; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation.DatabaseAccountInner; + +/** + * Type representing DatabaseAccount. + */ +public interface DatabaseAccount extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the capabilities value. + */ + List capabilities(); + + /** + * @return the connectorOffer value. + */ + ConnectorOffer connectorOffer(); + + /** + * @return the consistencyPolicy value. + */ + ConsistencyPolicy consistencyPolicy(); + + /** + * @return the databaseAccountOfferType value. + */ + DatabaseAccountOfferType databaseAccountOfferType(); + + /** + * @return the documentEndpoint value. + */ + String documentEndpoint(); + + /** + * @return the enableAutomaticFailover value. + */ + Boolean enableAutomaticFailover(); + + /** + * @return the enableCassandraConnector value. + */ + Boolean enableCassandraConnector(); + + /** + * @return the enableMultipleWriteLocations value. + */ + Boolean enableMultipleWriteLocations(); + + /** + * @return the failoverPolicies value. + */ + List failoverPolicies(); + + /** + * @return the ipRangeFilter value. + */ + String ipRangeFilter(); + + /** + * @return the isVirtualNetworkFilterEnabled value. + */ + Boolean isVirtualNetworkFilterEnabled(); + + /** + * @return the kind value. + */ + DatabaseAccountKind kind(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the readLocations value. + */ + List readLocations(); + + /** + * @return the virtualNetworkRules value. + */ + List virtualNetworkRules(); + + /** + * @return the writeLocations value. + */ + List writeLocations(); + + /** + * The entirety of the DatabaseAccount definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithDatabaseAccountOfferType, DefinitionStages.WithLocations, DefinitionStages.WithCreate { + } + + /** + * Grouping of DatabaseAccount definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a DatabaseAccount definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the DatabaseAccount definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the databaseaccount definition allowing to specify DatabaseAccountOfferType. + */ + interface WithDatabaseAccountOfferType { + /** + * Specifies databaseAccountOfferType. + * @param databaseAccountOfferType The offer type for the database + * @return the next definition stage +*/ + WithLocations withDatabaseAccountOfferType(String databaseAccountOfferType); + } + + /** + * The stage of the databaseaccount definition allowing to specify Locations. + */ + interface WithLocations { + /** + * Specifies locations. + * @param locations An array that contains the georeplication locations enabled for the Cosmos DB account + * @return the next definition stage +*/ + WithCreate withLocations(List locations); + } + + /** + * The stage of the databaseaccount definition allowing to specify Capabilities. + */ + interface WithCapabilities { + /** + * Specifies capabilities. + * @param capabilities List of Cosmos DB capabilities for the account + * @return the next definition stage + */ + WithCreate withCapabilities(List capabilities); + } + + /** + * The stage of the databaseaccount definition allowing to specify ConnectorOffer. + */ + interface WithConnectorOffer { + /** + * Specifies connectorOffer. + * @param connectorOffer The cassandra connector offer type for the Cosmos DB database C* account. Possible values include: 'Small' + * @return the next definition stage + */ + WithCreate withConnectorOffer(ConnectorOffer connectorOffer); + } + + /** + * The stage of the databaseaccount definition allowing to specify ConsistencyPolicy. + */ + interface WithConsistencyPolicy { + /** + * Specifies consistencyPolicy. + * @param consistencyPolicy The consistency policy for the Cosmos DB account + * @return the next definition stage + */ + WithCreate withConsistencyPolicy(ConsistencyPolicy consistencyPolicy); + } + + /** + * The stage of the databaseaccount definition allowing to specify EnableAutomaticFailover. + */ + interface WithEnableAutomaticFailover { + /** + * Specifies enableAutomaticFailover. + * @param enableAutomaticFailover Enables automatic failover of the write region in the rare event that the region is unavailable due to an outage. Automatic failover will result in a new write region for the account and is chosen based on the failover priorities configured for the account + * @return the next definition stage + */ + WithCreate withEnableAutomaticFailover(Boolean enableAutomaticFailover); + } + + /** + * The stage of the databaseaccount definition allowing to specify EnableCassandraConnector. + */ + interface WithEnableCassandraConnector { + /** + * Specifies enableCassandraConnector. + * @param enableCassandraConnector Enables the cassandra connector on the Cosmos DB C* account + * @return the next definition stage + */ + WithCreate withEnableCassandraConnector(Boolean enableCassandraConnector); + } + + /** + * The stage of the databaseaccount definition allowing to specify EnableMultipleWriteLocations. + */ + interface WithEnableMultipleWriteLocations { + /** + * Specifies enableMultipleWriteLocations. + * @param enableMultipleWriteLocations Enables the account to write in multiple locations + * @return the next definition stage + */ + WithCreate withEnableMultipleWriteLocations(Boolean enableMultipleWriteLocations); + } + + /** + * The stage of the databaseaccount definition allowing to specify IpRangeFilter. + */ + interface WithIpRangeFilter { + /** + * Specifies ipRangeFilter. + * @param ipRangeFilter Cosmos DB Firewall Support: This value specifies the set of IP addresses or IP address ranges in CIDR form to be included as the allowed list of client IPs for a given database account. IP addresses/ranges must be comma separated and must not contain any spaces + * @return the next definition stage + */ + WithCreate withIpRangeFilter(String ipRangeFilter); + } + + /** + * The stage of the databaseaccount definition allowing to specify IsVirtualNetworkFilterEnabled. + */ + interface WithIsVirtualNetworkFilterEnabled { + /** + * Specifies isVirtualNetworkFilterEnabled. + * @param isVirtualNetworkFilterEnabled Flag to indicate whether to enable/disable Virtual Network ACL rules + * @return the next definition stage + */ + WithCreate withIsVirtualNetworkFilterEnabled(Boolean isVirtualNetworkFilterEnabled); + } + + /** + * The stage of the databaseaccount definition allowing to specify Kind. + */ + interface WithKind { + /** + * Specifies kind. + * @param kind Indicates the type of database account. This can only be set at database account creation. Possible values include: 'GlobalDocumentDB', 'MongoDB', 'Parse' + * @return the next definition stage + */ + WithCreate withKind(DatabaseAccountKind kind); + } + + /** + * The stage of the databaseaccount definition allowing to specify VirtualNetworkRules. + */ + interface WithVirtualNetworkRules { + /** + * Specifies virtualNetworkRules. + * @param virtualNetworkRules List of Virtual Network ACL rules configured for the Cosmos DB account + * @return the next definition stage + */ + WithCreate withVirtualNetworkRules(List virtualNetworkRules); + } + + /** + * 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.WithCapabilities, DefinitionStages.WithConnectorOffer, DefinitionStages.WithConsistencyPolicy, DefinitionStages.WithEnableAutomaticFailover, DefinitionStages.WithEnableCassandraConnector, DefinitionStages.WithEnableMultipleWriteLocations, DefinitionStages.WithIpRangeFilter, DefinitionStages.WithIsVirtualNetworkFilterEnabled, DefinitionStages.WithKind, DefinitionStages.WithVirtualNetworkRules { + } + } + /** + * The template for a DatabaseAccount update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithCapabilities { + } + + /** + * Grouping of DatabaseAccount update stages. + */ + interface UpdateStages { + /** + * The stage of the databaseaccount update allowing to specify Capabilities. + */ + interface WithCapabilities { + /** + * Specifies capabilities. + * @param capabilities List of Cosmos DB capabilities for the account + * @return the next update stage + */ + Update withCapabilities(List capabilities); + } + + } +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DatabaseAccountConnectionString.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DatabaseAccountConnectionString.java new file mode 100644 index 000000000000..1f01c89d8649 --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DatabaseAccountConnectionString.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.cosmosdb.v2015_04_08; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Connection string for the Cosmos DB account. + */ +public class DatabaseAccountConnectionString { + /** + * Value of the connection string. + */ + @JsonProperty(value = "connectionString", access = JsonProperty.Access.WRITE_ONLY) + private String connectionString; + + /** + * Description of the connection string. + */ + @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) + private String description; + + /** + * Get value of the connection string. + * + * @return the connectionString value + */ + public String connectionString() { + return this.connectionString; + } + + /** + * Get description of the connection string. + * + * @return the description value + */ + public String description() { + return this.description; + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DatabaseAccountCreateUpdateParameters.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DatabaseAccountCreateUpdateParameters.java new file mode 100644 index 000000000000..7240cfbf570b --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DatabaseAccountCreateUpdateParameters.java @@ -0,0 +1,353 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.cosmosdb.v2015_04_08; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * Parameters to create and update Cosmos DB database accounts. + */ +@JsonFlatten +@SkipParentValidation +public class DatabaseAccountCreateUpdateParameters extends Resource { + /** + * Indicates the type of database account. This can only be set at database + * account creation. Possible values include: 'GlobalDocumentDB', + * 'MongoDB', 'Parse'. + */ + @JsonProperty(value = "kind") + private DatabaseAccountKind kind; + + /** + * The consistency policy for the Cosmos DB account. + */ + @JsonProperty(value = "properties.consistencyPolicy") + private ConsistencyPolicy consistencyPolicy; + + /** + * An array that contains the georeplication locations enabled for the + * Cosmos DB account. + */ + @JsonProperty(value = "properties.locations", required = true) + private List locations; + + /** + * The offer type for the database. + */ + @JsonProperty(value = "properties.databaseAccountOfferType", required = true) + private String databaseAccountOfferType; + + /** + * Cosmos DB Firewall Support: This value specifies the set of IP addresses + * or IP address ranges in CIDR form to be included as the allowed list of + * client IPs for a given database account. IP addresses/ranges must be + * comma separated and must not contain any spaces. + */ + @JsonProperty(value = "properties.ipRangeFilter") + private String ipRangeFilter; + + /** + * Flag to indicate whether to enable/disable Virtual Network ACL rules. + */ + @JsonProperty(value = "properties.isVirtualNetworkFilterEnabled") + private Boolean isVirtualNetworkFilterEnabled; + + /** + * Enables automatic failover of the write region in the rare event that + * the region is unavailable due to an outage. Automatic failover will + * result in a new write region for the account and is chosen based on the + * failover priorities configured for the account. + */ + @JsonProperty(value = "properties.enableAutomaticFailover") + private Boolean enableAutomaticFailover; + + /** + * List of Cosmos DB capabilities for the account. + */ + @JsonProperty(value = "properties.capabilities") + private List capabilities; + + /** + * List of Virtual Network ACL rules configured for the Cosmos DB account. + */ + @JsonProperty(value = "properties.virtualNetworkRules") + private List virtualNetworkRules; + + /** + * Enables the account to write in multiple locations. + */ + @JsonProperty(value = "properties.enableMultipleWriteLocations") + private Boolean enableMultipleWriteLocations; + + /** + * Enables the cassandra connector on the Cosmos DB C* account. + */ + @JsonProperty(value = "properties.enableCassandraConnector") + private Boolean enableCassandraConnector; + + /** + * The cassandra connector offer type for the Cosmos DB database C* + * account. Possible values include: 'Small'. + */ + @JsonProperty(value = "properties.connectorOffer") + private ConnectorOffer connectorOffer; + + /** + * Creates an instance of DatabaseAccountCreateUpdateParameters class. + * @param locations an array that contains the georeplication locations enabled for the Cosmos DB account. + */ + public DatabaseAccountCreateUpdateParameters() { + databaseAccountOfferType = "Standard"; + } + + /** + * Get indicates the type of database account. This can only be set at database account creation. Possible values include: 'GlobalDocumentDB', 'MongoDB', 'Parse'. + * + * @return the kind value + */ + public DatabaseAccountKind kind() { + return this.kind; + } + + /** + * Set indicates the type of database account. This can only be set at database account creation. Possible values include: 'GlobalDocumentDB', 'MongoDB', 'Parse'. + * + * @param kind the kind value to set + * @return the DatabaseAccountCreateUpdateParameters object itself. + */ + public DatabaseAccountCreateUpdateParameters withKind(DatabaseAccountKind kind) { + this.kind = kind; + return this; + } + + /** + * Get the consistency policy for the Cosmos DB account. + * + * @return the consistencyPolicy value + */ + public ConsistencyPolicy consistencyPolicy() { + return this.consistencyPolicy; + } + + /** + * Set the consistency policy for the Cosmos DB account. + * + * @param consistencyPolicy the consistencyPolicy value to set + * @return the DatabaseAccountCreateUpdateParameters object itself. + */ + public DatabaseAccountCreateUpdateParameters withConsistencyPolicy(ConsistencyPolicy consistencyPolicy) { + this.consistencyPolicy = consistencyPolicy; + return this; + } + + /** + * Get an array that contains the georeplication locations enabled for the Cosmos DB account. + * + * @return the locations value + */ + public List locations() { + return this.locations; + } + + /** + * Set an array that contains the georeplication locations enabled for the Cosmos DB account. + * + * @param locations the locations value to set + * @return the DatabaseAccountCreateUpdateParameters object itself. + */ + public DatabaseAccountCreateUpdateParameters withLocations(List locations) { + this.locations = locations; + return this; + } + + /** + * Get the offer type for the database. + * + * @return the databaseAccountOfferType value + */ + public String databaseAccountOfferType() { + return this.databaseAccountOfferType; + } + + /** + * Set the offer type for the database. + * + * @param databaseAccountOfferType the databaseAccountOfferType value to set + * @return the DatabaseAccountCreateUpdateParameters object itself. + */ + public DatabaseAccountCreateUpdateParameters withDatabaseAccountOfferType(String databaseAccountOfferType) { + this.databaseAccountOfferType = databaseAccountOfferType; + return this; + } + + /** + * Get cosmos DB Firewall Support: This value specifies the set of IP addresses or IP address ranges in CIDR form to be included as the allowed list of client IPs for a given database account. IP addresses/ranges must be comma separated and must not contain any spaces. + * + * @return the ipRangeFilter value + */ + public String ipRangeFilter() { + return this.ipRangeFilter; + } + + /** + * Set cosmos DB Firewall Support: This value specifies the set of IP addresses or IP address ranges in CIDR form to be included as the allowed list of client IPs for a given database account. IP addresses/ranges must be comma separated and must not contain any spaces. + * + * @param ipRangeFilter the ipRangeFilter value to set + * @return the DatabaseAccountCreateUpdateParameters object itself. + */ + public DatabaseAccountCreateUpdateParameters withIpRangeFilter(String ipRangeFilter) { + this.ipRangeFilter = ipRangeFilter; + return this; + } + + /** + * Get flag to indicate whether to enable/disable Virtual Network ACL rules. + * + * @return the isVirtualNetworkFilterEnabled value + */ + public Boolean isVirtualNetworkFilterEnabled() { + return this.isVirtualNetworkFilterEnabled; + } + + /** + * Set flag to indicate whether to enable/disable Virtual Network ACL rules. + * + * @param isVirtualNetworkFilterEnabled the isVirtualNetworkFilterEnabled value to set + * @return the DatabaseAccountCreateUpdateParameters object itself. + */ + public DatabaseAccountCreateUpdateParameters withIsVirtualNetworkFilterEnabled(Boolean isVirtualNetworkFilterEnabled) { + this.isVirtualNetworkFilterEnabled = isVirtualNetworkFilterEnabled; + return this; + } + + /** + * Get enables automatic failover of the write region in the rare event that the region is unavailable due to an outage. Automatic failover will result in a new write region for the account and is chosen based on the failover priorities configured for the account. + * + * @return the enableAutomaticFailover value + */ + public Boolean enableAutomaticFailover() { + return this.enableAutomaticFailover; + } + + /** + * Set enables automatic failover of the write region in the rare event that the region is unavailable due to an outage. Automatic failover will result in a new write region for the account and is chosen based on the failover priorities configured for the account. + * + * @param enableAutomaticFailover the enableAutomaticFailover value to set + * @return the DatabaseAccountCreateUpdateParameters object itself. + */ + public DatabaseAccountCreateUpdateParameters withEnableAutomaticFailover(Boolean enableAutomaticFailover) { + this.enableAutomaticFailover = enableAutomaticFailover; + return this; + } + + /** + * Get list of Cosmos DB capabilities for the account. + * + * @return the capabilities value + */ + public List capabilities() { + return this.capabilities; + } + + /** + * Set list of Cosmos DB capabilities for the account. + * + * @param capabilities the capabilities value to set + * @return the DatabaseAccountCreateUpdateParameters object itself. + */ + public DatabaseAccountCreateUpdateParameters withCapabilities(List capabilities) { + this.capabilities = capabilities; + return this; + } + + /** + * Get list of Virtual Network ACL rules configured for the Cosmos DB account. + * + * @return the virtualNetworkRules value + */ + public List virtualNetworkRules() { + return this.virtualNetworkRules; + } + + /** + * Set list of Virtual Network ACL rules configured for the Cosmos DB account. + * + * @param virtualNetworkRules the virtualNetworkRules value to set + * @return the DatabaseAccountCreateUpdateParameters object itself. + */ + public DatabaseAccountCreateUpdateParameters withVirtualNetworkRules(List virtualNetworkRules) { + this.virtualNetworkRules = virtualNetworkRules; + return this; + } + + /** + * Get enables the account to write in multiple locations. + * + * @return the enableMultipleWriteLocations value + */ + public Boolean enableMultipleWriteLocations() { + return this.enableMultipleWriteLocations; + } + + /** + * Set enables the account to write in multiple locations. + * + * @param enableMultipleWriteLocations the enableMultipleWriteLocations value to set + * @return the DatabaseAccountCreateUpdateParameters object itself. + */ + public DatabaseAccountCreateUpdateParameters withEnableMultipleWriteLocations(Boolean enableMultipleWriteLocations) { + this.enableMultipleWriteLocations = enableMultipleWriteLocations; + return this; + } + + /** + * Get enables the cassandra connector on the Cosmos DB C* account. + * + * @return the enableCassandraConnector value + */ + public Boolean enableCassandraConnector() { + return this.enableCassandraConnector; + } + + /** + * Set enables the cassandra connector on the Cosmos DB C* account. + * + * @param enableCassandraConnector the enableCassandraConnector value to set + * @return the DatabaseAccountCreateUpdateParameters object itself. + */ + public DatabaseAccountCreateUpdateParameters withEnableCassandraConnector(Boolean enableCassandraConnector) { + this.enableCassandraConnector = enableCassandraConnector; + return this; + } + + /** + * Get the cassandra connector offer type for the Cosmos DB database C* account. Possible values include: 'Small'. + * + * @return the connectorOffer value + */ + public ConnectorOffer connectorOffer() { + return this.connectorOffer; + } + + /** + * Set the cassandra connector offer type for the Cosmos DB database C* account. Possible values include: 'Small'. + * + * @param connectorOffer the connectorOffer value to set + * @return the DatabaseAccountCreateUpdateParameters object itself. + */ + public DatabaseAccountCreateUpdateParameters withConnectorOffer(ConnectorOffer connectorOffer) { + this.connectorOffer = connectorOffer; + return this; + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DatabaseAccountKind.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DatabaseAccountKind.java new file mode 100644 index 000000000000..c2c473cba153 --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DatabaseAccountKind.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.cosmosdb.v2015_04_08; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for DatabaseAccountKind. + */ +public final class DatabaseAccountKind extends ExpandableStringEnum { + /** Static value GlobalDocumentDB for DatabaseAccountKind. */ + public static final DatabaseAccountKind GLOBAL_DOCUMENT_DB = fromString("GlobalDocumentDB"); + + /** Static value MongoDB for DatabaseAccountKind. */ + public static final DatabaseAccountKind MONGO_DB = fromString("MongoDB"); + + /** Static value Parse for DatabaseAccountKind. */ + public static final DatabaseAccountKind PARSE = fromString("Parse"); + + /** + * Creates or finds a DatabaseAccountKind from its string representation. + * @param name a name to look for + * @return the corresponding DatabaseAccountKind + */ + @JsonCreator + public static DatabaseAccountKind fromString(String name) { + return fromString(name, DatabaseAccountKind.class); + } + + /** + * @return known DatabaseAccountKind values + */ + public static Collection values() { + return values(DatabaseAccountKind.class); + } +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DatabaseAccountListConnectionStringsResult.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DatabaseAccountListConnectionStringsResult.java new file mode 100644 index 000000000000..65bbe6cb9199 --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DatabaseAccountListConnectionStringsResult.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.cosmosdb.v2015_04_08; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation.CosmosDBManager; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation.DatabaseAccountListConnectionStringsResultInner; +import java.util.List; + +/** + * Type representing DatabaseAccountListConnectionStringsResult. + */ +public interface DatabaseAccountListConnectionStringsResult extends HasInner, HasManager { + /** + * @return the connectionStrings value. + */ + List connectionStrings(); + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DatabaseAccountListKeysResult.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DatabaseAccountListKeysResult.java new file mode 100644 index 000000000000..b0c705cad284 --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DatabaseAccountListKeysResult.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.cosmosdb.v2015_04_08; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation.CosmosDBManager; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation.DatabaseAccountListKeysResultInner; + +/** + * Type representing DatabaseAccountListKeysResult. + */ +public interface DatabaseAccountListKeysResult extends HasInner, HasManager { + /** + * @return the primaryMasterKey value. + */ + String primaryMasterKey(); + + /** + * @return the primaryReadonlyMasterKey value. + */ + String primaryReadonlyMasterKey(); + + /** + * @return the secondaryMasterKey value. + */ + String secondaryMasterKey(); + + /** + * @return the secondaryReadonlyMasterKey value. + */ + String secondaryReadonlyMasterKey(); + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DatabaseAccountListReadOnlyKeysResult.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DatabaseAccountListReadOnlyKeysResult.java new file mode 100644 index 000000000000..613b002ed9ee --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DatabaseAccountListReadOnlyKeysResult.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.cosmosdb.v2015_04_08; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation.CosmosDBManager; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation.DatabaseAccountListReadOnlyKeysResultInner; + +/** + * Type representing DatabaseAccountListReadOnlyKeysResult. + */ +public interface DatabaseAccountListReadOnlyKeysResult extends HasInner, HasManager { + /** + * @return the primaryReadonlyMasterKey value. + */ + String primaryReadonlyMasterKey(); + + /** + * @return the secondaryReadonlyMasterKey value. + */ + String secondaryReadonlyMasterKey(); + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DatabaseAccountMetric.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DatabaseAccountMetric.java new file mode 100644 index 000000000000..e2b422e5cdc0 --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DatabaseAccountMetric.java @@ -0,0 +1,52 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.cosmosdb.v2015_04_08; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation.MetricInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation.CosmosDBManager; +import org.joda.time.DateTime; +import java.util.List; + +/** + * Type representing DatabaseAccountMetric. + */ +public interface DatabaseAccountMetric extends HasInner, HasManager { + /** + * @return the endTime value. + */ + DateTime endTime(); + + /** + * @return the metricValues value. + */ + List metricValues(); + + /** + * @return the name value. + */ + MetricName name(); + + /** + * @return the startTime value. + */ + DateTime startTime(); + + /** + * @return the timeGrain value. + */ + String timeGrain(); + + /** + * @return the unit value. + */ + UnitType unit(); + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DatabaseAccountMetricDefinition.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DatabaseAccountMetricDefinition.java new file mode 100644 index 000000000000..c2256d7c4028 --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DatabaseAccountMetricDefinition.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.cosmosdb.v2015_04_08; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation.MetricDefinitionInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation.CosmosDBManager; +import java.util.List; + +/** + * Type representing DatabaseAccountMetricDefinition. + */ +public interface DatabaseAccountMetricDefinition extends HasInner, HasManager { + /** + * @return the metricAvailabilities value. + */ + List metricAvailabilities(); + + /** + * @return the name value. + */ + MetricName name(); + + /** + * @return the primaryAggregationType value. + */ + PrimaryAggregationType primaryAggregationType(); + + /** + * @return the resourceUri value. + */ + String resourceUri(); + + /** + * @return the unit value. + */ + UnitType unit(); + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DatabaseAccountOfferType.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DatabaseAccountOfferType.java new file mode 100644 index 000000000000..c022bf86be70 --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DatabaseAccountOfferType.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.cosmosdb.v2015_04_08; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for DatabaseAccountOfferType. + */ +public enum DatabaseAccountOfferType { + /** Enum value Standard. */ + STANDARD("Standard"); + + /** The actual serialized value for a DatabaseAccountOfferType instance. */ + private String value; + + DatabaseAccountOfferType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a DatabaseAccountOfferType instance. + * + * @param value the serialized value to parse. + * @return the parsed DatabaseAccountOfferType object, or null if unable to parse. + */ + @JsonCreator + public static DatabaseAccountOfferType fromString(String value) { + DatabaseAccountOfferType[] items = DatabaseAccountOfferType.values(); + for (DatabaseAccountOfferType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DatabaseAccountPatchParameters.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DatabaseAccountPatchParameters.java new file mode 100644 index 000000000000..26dbd92f42b4 --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DatabaseAccountPatchParameters.java @@ -0,0 +1,73 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.cosmosdb.v2015_04_08; + +import java.util.Map; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Parameters for patching Azure Cosmos DB database account properties. + */ +@JsonFlatten +public class DatabaseAccountPatchParameters { + /** + * The tags property. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * List of Cosmos DB capabilities for the account. + */ + @JsonProperty(value = "properties.capabilities") + private List capabilities; + + /** + * Get the tags value. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags value. + * + * @param tags the tags value to set + * @return the DatabaseAccountPatchParameters object itself. + */ + public DatabaseAccountPatchParameters withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get list of Cosmos DB capabilities for the account. + * + * @return the capabilities value + */ + public List capabilities() { + return this.capabilities; + } + + /** + * Set list of Cosmos DB capabilities for the account. + * + * @param capabilities the capabilities value to set + * @return the DatabaseAccountPatchParameters object itself. + */ + public DatabaseAccountPatchParameters withCapabilities(List capabilities) { + this.capabilities = capabilities; + return this; + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DatabaseAccountRegenerateKeyParameters.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DatabaseAccountRegenerateKeyParameters.java new file mode 100644 index 000000000000..65d13106a160 --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DatabaseAccountRegenerateKeyParameters.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.cosmosdb.v2015_04_08; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters to regenerate the keys within the database account. + */ +public class DatabaseAccountRegenerateKeyParameters { + /** + * The access key to regenerate. Possible values include: 'primary', + * 'secondary', 'primaryReadonly', 'secondaryReadonly'. + */ + @JsonProperty(value = "keyKind", required = true) + private KeyKind keyKind; + + /** + * Get the access key to regenerate. Possible values include: 'primary', 'secondary', 'primaryReadonly', 'secondaryReadonly'. + * + * @return the keyKind value + */ + public KeyKind keyKind() { + return this.keyKind; + } + + /** + * Set the access key to regenerate. Possible values include: 'primary', 'secondary', 'primaryReadonly', 'secondaryReadonly'. + * + * @param keyKind the keyKind value to set + * @return the DatabaseAccountRegenerateKeyParameters object itself. + */ + public DatabaseAccountRegenerateKeyParameters withKeyKind(KeyKind keyKind) { + this.keyKind = keyKind; + return this; + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DatabaseAccountRegions.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DatabaseAccountRegions.java new file mode 100644 index 000000000000..17b9c0740803 --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DatabaseAccountRegions.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.cosmosdb.v2015_04_08; + +import rx.Observable; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation.DatabaseAccountRegionsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing DatabaseAccountRegions. + */ +public interface DatabaseAccountRegions extends HasInner { + /** + * Retrieves the metrics determined by the given filter for the given database account and region. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param region Cosmos DB region, with spaces between words and each word capitalized. + * @param filter An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listMetricsAsync(String resourceGroupName, String accountName, String region, String filter); + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DatabaseAccountUsage.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DatabaseAccountUsage.java new file mode 100644 index 000000000000..537fe7f7f975 --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DatabaseAccountUsage.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.cosmosdb.v2015_04_08; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation.UsageInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation.CosmosDBManager; + +/** + * Type representing DatabaseAccountUsage. + */ +public interface DatabaseAccountUsage extends HasInner, HasManager { + /** + * @return the currentValue value. + */ + Long currentValue(); + + /** + * @return the limit value. + */ + Long limit(); + + /** + * @return the name value. + */ + MetricName name(); + + /** + * @return the quotaPeriod value. + */ + String quotaPeriod(); + + /** + * @return the unit value. + */ + UnitType unit(); + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DatabaseAccounts.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DatabaseAccounts.java new file mode 100644 index 000000000000..78943dd10b53 --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DatabaseAccounts.java @@ -0,0 +1,751 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.cosmosdb.v2015_04_08; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import rx.Completable; +import java.util.List; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation.DatabaseAccountsInner; +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.DatabaseAccountMetric; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.DatabaseAccountUsage; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.DatabaseAccountMetricDefinition; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.SqlContainer; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.MongoDBCollection; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.GremlinGraph; + +/** + * Type representing DatabaseAccounts. + */ +public interface DatabaseAccounts extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { + /** + * Begins definition for a new Databasis resource. + * @param name resource name. + * @return the first stage of the new Databasis definition. + */ + SqlDatabase.DefinitionStages.Blank defineDatabasis(String name); + + /** + * Begins definition for a new Container resource. + * @param name resource name. + * @return the first stage of the new Container definition. + */ + SqlContainer.DefinitionStages.Blank defineContainer(String name); + + /** + * Begins definition for a new Collection resource. + * @param name resource name. + * @return the first stage of the new Collection definition. + */ + MongoDBCollection.DefinitionStages.Blank defineCollection(String name); + + /** + * Begins definition for a new Table resource. + * @param name resource name. + * @return the first stage of the new Table definition. + */ + Table.DefinitionStages.Blank defineTable(String name); + + /** + * Begins definition for a new Keyspace resource. + * @param name resource name. + * @return the first stage of the new Keyspace definition. + */ + CassandraKeyspace.DefinitionStages.Blank defineKeyspace(String name); + + /** + * Begins definition for a new Graph resource. + * @param name resource name. + * @return the first stage of the new Graph definition. + */ + GremlinGraph.DefinitionStages.Blank defineGraph(String name); + + /** + * Changes the failover priority for the Azure Cosmos DB database account. A failover priority of 0 indicates a write region. The maximum value for a failover priority = (total number of regions - 1). Failover priority values must be unique for each of the regions in which the database account exists. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param failoverPolicies List of failover policies. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable failoverPriorityChangeAsync(String resourceGroupName, String accountName, List failoverPolicies); + + /** + * Lists the access keys for the specified Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listKeysAsync(String resourceGroupName, String accountName); + + /** + * Lists the connection strings for the specified Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listConnectionStringsAsync(String resourceGroupName, String accountName); + + /** + * Offline the specified region for the specified Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param region Cosmos DB region, with spaces between words and each word capitalized. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable offlineRegionAsync(String resourceGroupName, String accountName, String region); + + /** + * Online the specified region for the specified Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param region Cosmos DB region, with spaces between words and each word capitalized. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable onlineRegionAsync(String resourceGroupName, String accountName, String region); + + /** + * Lists the read-only access keys for the specified Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listReadOnlyKeysAsync(String resourceGroupName, String accountName); + + /** + * Regenerates an access key for the specified Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param keyKind The access key to regenerate. Possible values include: 'primary', 'secondary', 'primaryReadonly', 'secondaryReadonly' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable regenerateKeyAsync(String resourceGroupName, String accountName, KeyKind keyKind); + + /** + * Lists the read-only access keys for the specified Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getReadOnlyKeysAsync(String resourceGroupName, String accountName); + + /** + * Checks that the Azure Cosmos DB account name already exists. A valid account name may contain only lowercase letters, numbers, and the '-' character, and must be between 3 and 50 characters. + * + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable checkNameExistsAsync(String accountName); + + /** + * Retrieves the metrics determined by the given filter for the given database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param filter An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listMetricsAsync(String resourceGroupName, String accountName, String filter); + + /** + * Retrieves the usages (most recent data) for the given database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listUsagesAsync(String resourceGroupName, String accountName); + + /** + * Retrieves metric definitions for the given database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listMetricDefinitionsAsync(String resourceGroupName, String accountName); + + /** + * Lists the SQL databases under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listSqlDatabasesAsync(String resourceGroupName, String accountName); + + /** + * Gets the SQL database under an existing Azure Cosmos DB database account with the provided name. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getSqlDatabaseAsync(String resourceGroupName, String accountName, String databaseName); + + /** + * Deletes an existing Azure Cosmos DB SQL database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteSqlDatabaseAsync(String resourceGroupName, String accountName, String databaseName); + + /** + * Lists the MongoDB databases under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listMongoDBDatabasesAsync(String resourceGroupName, String accountName); + + /** + * Gets the MongoDB databases under an existing Azure Cosmos DB database account with the provided name. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getMongoDBDatabaseAsync(String resourceGroupName, String accountName, String databaseName); + + /** + * Create or updates Azure Cosmos DB MongoDB database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param createUpdateMongoDBDatabaseParameters The parameters to provide for the current MongoDB database. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable createUpdateMongoDBDatabaseAsync(String resourceGroupName, String accountName, String databaseName, MongoDBDatabaseCreateUpdateParameters createUpdateMongoDBDatabaseParameters); + + /** + * Deletes an existing Azure Cosmos DB MongoDB database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteMongoDBDatabaseAsync(String resourceGroupName, String accountName, String databaseName); + + /** + * Lists the Gremlin databases under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listGremlinDatabasesAsync(String resourceGroupName, String accountName); + + /** + * Gets the Gremlin databases under an existing Azure Cosmos DB database account with the provided name. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getGremlinDatabaseAsync(String resourceGroupName, String accountName, String databaseName); + + /** + * Create or update an Azure Cosmos DB Gremlin database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param createUpdateGremlinDatabaseParameters The parameters to provide for the current Gremlin database. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable createUpdateGremlinDatabaseAsync(String resourceGroupName, String accountName, String databaseName, GremlinDatabaseCreateUpdateParameters createUpdateGremlinDatabaseParameters); + + /** + * Deletes an existing Azure Cosmos DB Gremlin database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteGremlinDatabaseAsync(String resourceGroupName, String accountName, String databaseName); + + /** + * Gets the RUs per second of the SQL database under an existing Azure Cosmos DB database account with the provided name. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getSqlDatabaseThroughputAsync(String resourceGroupName, String accountName, String databaseName); + + /** + * Update RUs per second of an Azure Cosmos DB SQL database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param resource The standard JSON format of a resource throughput + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable updateSqlDatabaseThroughputAsync(String resourceGroupName, String accountName, String databaseName, ThroughputResource resource); + + /** + * Gets the RUs per second of the SQL container under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getSqlContainerThroughputAsync(String resourceGroupName, String accountName, String databaseName, String containerName); + + /** + * Update RUs per second of an Azure Cosmos DB SQL container. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @param resource The standard JSON format of a resource throughput + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable updateSqlContainerThroughputAsync(String resourceGroupName, String accountName, String databaseName, String containerName, ThroughputResource resource); + + /** + * Gets the RUs per second of the MongoDB database under an existing Azure Cosmos DB database account with the provided name. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getMongoDBDatabaseThroughputAsync(String resourceGroupName, String accountName, String databaseName); + + /** + * Update RUs per second of the an Azure Cosmos DB MongoDB database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param resource The standard JSON format of a resource throughput + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable updateMongoDBDatabaseThroughputAsync(String resourceGroupName, String accountName, String databaseName, ThroughputResource resource); + + /** + * Gets the RUs per second of the MongoDB collection under an existing Azure Cosmos DB database account with the provided name. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getMongoDBCollectionThroughputAsync(String resourceGroupName, String accountName, String databaseName, String collectionName); + + /** + * Update the RUs per second of an Azure Cosmos DB MongoDB collection. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @param resource The standard JSON format of a resource throughput + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable updateMongoDBCollectionThroughputAsync(String resourceGroupName, String accountName, String databaseName, String collectionName, ThroughputResource resource); + + /** + * Gets the RUs per second of the Table under an existing Azure Cosmos DB database account with the provided name. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param tableName Cosmos DB table name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getTableThroughputAsync(String resourceGroupName, String accountName, String tableName); + + /** + * Update RUs per second of an Azure Cosmos DB Table. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param tableName Cosmos DB table name. + * @param resource The standard JSON format of a resource throughput + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable updateTableThroughputAsync(String resourceGroupName, String accountName, String tableName, ThroughputResource resource); + + /** + * Gets the RUs per second of the Cassandra Keyspace under an existing Azure Cosmos DB database account with the provided name. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getCassandraKeyspaceThroughputAsync(String resourceGroupName, String accountName, String keyspaceName); + + /** + * Update RUs per second of an Azure Cosmos DB Cassandra Keyspace. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param resource The standard JSON format of a resource throughput + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable updateCassandraKeyspaceThroughputAsync(String resourceGroupName, String accountName, String keyspaceName, ThroughputResource resource); + + /** + * Gets the RUs per second of the Cassandra table under an existing Azure Cosmos DB database account with the provided name. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getCassandraTableThroughputAsync(String resourceGroupName, String accountName, String keyspaceName, String tableName); + + /** + * Update RUs per second of an Azure Cosmos DB Cassandra table. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @param resource The standard JSON format of a resource throughput + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable updateCassandraTableThroughputAsync(String resourceGroupName, String accountName, String keyspaceName, String tableName, ThroughputResource resource); + + /** + * Gets the RUs per second of the Gremlin database under an existing Azure Cosmos DB database account with the provided name. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getGremlinDatabaseThroughputAsync(String resourceGroupName, String accountName, String databaseName); + + /** + * Update RUs per second of an Azure Cosmos DB Gremlin database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param resource The standard JSON format of a resource throughput + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable updateGremlinDatabaseThroughputAsync(String resourceGroupName, String accountName, String databaseName, ThroughputResource resource); + + /** + * Gets the Gremlin graph throughput under an existing Azure Cosmos DB database account with the provided name. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param graphName Cosmos DB graph name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getGremlinGraphThroughputAsync(String resourceGroupName, String accountName, String databaseName, String graphName); + + /** + * Update RUs per second of an Azure Cosmos DB Gremlin graph. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param graphName Cosmos DB graph name. + * @param resource The standard JSON format of a resource throughput + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable updateGremlinGraphThroughputAsync(String resourceGroupName, String accountName, String databaseName, String graphName, ThroughputResource resource); + + /** + * Gets the SQL container under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getSqlContainerAsync(String resourceGroupName, String accountName, String databaseName, String containerName); + + /** + * Lists the SQL container under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listSqlContainersAsync(String resourceGroupName, String accountName, String databaseName); + + /** + * Deletes an existing Azure Cosmos DB SQL container. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteSqlContainerAsync(String resourceGroupName, String accountName, String databaseName, String containerName); + + /** + * Gets the MongoDB collection under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getMongoDBCollectionAsync(String resourceGroupName, String accountName, String databaseName, String collectionName); + + /** + * Lists the MongoDB collection under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listMongoDBCollectionsAsync(String resourceGroupName, String accountName, String databaseName); + + /** + * Deletes an existing Azure Cosmos DB MongoDB Collection. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteMongoDBCollectionAsync(String resourceGroupName, String accountName, String databaseName, String collectionName); + + /** + * Lists the Tables under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listTablesAsync(String resourceGroupName, String accountName); + + /** + * Gets the Tables under an existing Azure Cosmos DB database account with the provided name. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param tableName Cosmos DB table name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable
getTableAsync(String resourceGroupName, String accountName, String tableName); + + /** + * Deletes an existing Azure Cosmos DB Table. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param tableName Cosmos DB table name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteTableAsync(String resourceGroupName, String accountName, String tableName); + + /** + * Lists the Cassandra table under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listCassandraTablesAsync(String resourceGroupName, String accountName, String keyspaceName); + + /** + * Gets the Cassandra table under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getCassandraTableAsync(String resourceGroupName, String accountName, String keyspaceName, String tableName); + + /** + * Create or update an Azure Cosmos DB Cassandra Table. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @param createUpdateCassandraTableParameters The parameters to provide for the current Cassandra Table. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable createUpdateCassandraTableAsync(String resourceGroupName, String accountName, String keyspaceName, String tableName, CassandraTableCreateUpdateParameters createUpdateCassandraTableParameters); + + /** + * Deletes an existing Azure Cosmos DB Cassandra table. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteCassandraTableAsync(String resourceGroupName, String accountName, String keyspaceName, String tableName); + + /** + * Lists the Cassandra keyspaces under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listCassandraKeyspacesAsync(String resourceGroupName, String accountName); + + /** + * Gets the Cassandra keyspaces under an existing Azure Cosmos DB database account with the provided name. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getCassandraKeyspaceAsync(String resourceGroupName, String accountName, String keyspaceName); + + /** + * Deletes an existing Azure Cosmos DB Cassandra keyspace. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteCassandraKeyspaceAsync(String resourceGroupName, String accountName, String keyspaceName); + + /** + * Gets the Gremlin graph under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param graphName Cosmos DB graph name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getGremlinGraphAsync(String resourceGroupName, String accountName, String databaseName, String graphName); + + /** + * Lists the Gremlin graph under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listGremlinGraphsAsync(String resourceGroupName, String accountName, String databaseName); + + /** + * Deletes an existing Azure Cosmos DB Gremlin graph. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param graphName Cosmos DB graph name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteGremlinGraphAsync(String resourceGroupName, String accountName, String databaseName, String graphName); + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/Databases.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/Databases.java new file mode 100644 index 000000000000..be27b8b60c0d --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/Databases.java @@ -0,0 +1,54 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.cosmosdb.v2015_04_08; + +import rx.Observable; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.DatabasisDatabaseAccountMetricDefinition; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.DatabasisDatabaseAccountMetric; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.DatabasisDatabaseAccountUsage; + +/** + * Type representing Databases. + */ +public interface Databases { + /** + * Retrieves metric definitions for the given database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseRid Cosmos DB database rid. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listMetricDefinitionsAsync(String resourceGroupName, String accountName, String databaseRid); + + /** + * Retrieves the metrics determined by the given filter for the given database account and database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseRid Cosmos DB database rid. + * @param filter An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listMetricsAsync(String resourceGroupName, String accountName, String databaseRid, String filter); + + /** + * Retrieves the usages (most recent data) for the given database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseRid Cosmos DB database rid. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listUsagesAsync(String resourceGroupName, String accountName, String databaseRid); + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DatabasisDatabaseAccountMetric.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DatabasisDatabaseAccountMetric.java new file mode 100644 index 000000000000..ae60f081859b --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DatabasisDatabaseAccountMetric.java @@ -0,0 +1,52 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.cosmosdb.v2015_04_08; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation.MetricInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation.CosmosDBManager; +import org.joda.time.DateTime; +import java.util.List; + +/** + * Type representing DatabasisDatabaseAccountMetric. + */ +public interface DatabasisDatabaseAccountMetric extends HasInner, HasManager { + /** + * @return the endTime value. + */ + DateTime endTime(); + + /** + * @return the metricValues value. + */ + List metricValues(); + + /** + * @return the name value. + */ + MetricName name(); + + /** + * @return the startTime value. + */ + DateTime startTime(); + + /** + * @return the timeGrain value. + */ + String timeGrain(); + + /** + * @return the unit value. + */ + UnitType unit(); + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DatabasisDatabaseAccountMetricDefinition.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DatabasisDatabaseAccountMetricDefinition.java new file mode 100644 index 000000000000..402b93eaec63 --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DatabasisDatabaseAccountMetricDefinition.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.cosmosdb.v2015_04_08; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation.MetricDefinitionInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation.CosmosDBManager; +import java.util.List; + +/** + * Type representing DatabasisDatabaseAccountMetricDefinition. + */ +public interface DatabasisDatabaseAccountMetricDefinition extends HasInner, HasManager { + /** + * @return the metricAvailabilities value. + */ + List metricAvailabilities(); + + /** + * @return the name value. + */ + MetricName name(); + + /** + * @return the primaryAggregationType value. + */ + PrimaryAggregationType primaryAggregationType(); + + /** + * @return the resourceUri value. + */ + String resourceUri(); + + /** + * @return the unit value. + */ + UnitType unit(); + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DatabasisDatabaseAccountUsage.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DatabasisDatabaseAccountUsage.java new file mode 100644 index 000000000000..e3412d911495 --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DatabasisDatabaseAccountUsage.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.cosmosdb.v2015_04_08; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation.UsageInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation.CosmosDBManager; + +/** + * Type representing DatabasisDatabaseAccountUsage. + */ +public interface DatabasisDatabaseAccountUsage extends HasInner, HasManager { + /** + * @return the currentValue value. + */ + Long currentValue(); + + /** + * @return the limit value. + */ + Long limit(); + + /** + * @return the name value. + */ + MetricName name(); + + /** + * @return the quotaPeriod value. + */ + String quotaPeriod(); + + /** + * @return the unit value. + */ + UnitType unit(); + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DefaultConsistencyLevel.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DefaultConsistencyLevel.java new file mode 100644 index 000000000000..4f415b4de4a4 --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/DefaultConsistencyLevel.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.cosmosdb.v2015_04_08; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for DefaultConsistencyLevel. + */ +public enum DefaultConsistencyLevel { + /** Enum value Eventual. */ + EVENTUAL("Eventual"), + + /** Enum value Session. */ + SESSION("Session"), + + /** Enum value BoundedStaleness. */ + BOUNDED_STALENESS("BoundedStaleness"), + + /** Enum value Strong. */ + STRONG("Strong"), + + /** Enum value ConsistentPrefix. */ + CONSISTENT_PREFIX("ConsistentPrefix"); + + /** The actual serialized value for a DefaultConsistencyLevel instance. */ + private String value; + + DefaultConsistencyLevel(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a DefaultConsistencyLevel instance. + * + * @param value the serialized value to parse. + * @return the parsed DefaultConsistencyLevel object, or null if unable to parse. + */ + @JsonCreator + public static DefaultConsistencyLevel fromString(String value) { + DefaultConsistencyLevel[] items = DefaultConsistencyLevel.values(); + for (DefaultConsistencyLevel item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/ErrorResponse.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/ErrorResponse.java new file mode 100644 index 000000000000..0b6a580e3bfa --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/ErrorResponse.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.cosmosdb.v2015_04_08; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Error Response. + */ +public class ErrorResponse { + /** + * Error code. + */ + @JsonProperty(value = "code") + private String code; + + /** + * Error message indicating why the operation failed. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Get error code. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Set error code. + * + * @param code the code value to set + * @return the ErrorResponse object itself. + */ + public ErrorResponse withCode(String code) { + this.code = code; + return this; + } + + /** + * Get error message indicating why the operation failed. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set error message indicating why the operation failed. + * + * @param message the message value to set + * @return the ErrorResponse object itself. + */ + public ErrorResponse withMessage(String message) { + this.message = message; + return this; + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/ErrorResponseException.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/ErrorResponseException.java new file mode 100644 index 000000000000..cf1f7014bba6 --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/ErrorResponseException.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.cosmosdb.v2015_04_08; + +import com.microsoft.rest.RestException; +import okhttp3.ResponseBody; +import retrofit2.Response; + +/** + * Exception thrown for an invalid response with ErrorResponse information. + */ +public class ErrorResponseException extends RestException { + /** + * Initializes a new instance of the ErrorResponseException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + */ + public ErrorResponseException(final String message, final Response response) { + super(message, response); + } + + /** + * Initializes a new instance of the ErrorResponseException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + * @param body the deserialized response body + */ + public ErrorResponseException(final String message, final Response response, final ErrorResponse body) { + super(message, response, body); + } + + @Override + public ErrorResponse body() { + return (ErrorResponse) super.body(); + } +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/ExcludedPath.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/ExcludedPath.java new file mode 100644 index 000000000000..3885d4e55285 --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/ExcludedPath.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.cosmosdb.v2015_04_08; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The ExcludedPath model. + */ +public class ExcludedPath { + /** + * The path for which the indexing behavior applies to. Index paths + * typically start with root and end with wildcard (/path/*). + */ + @JsonProperty(value = "path") + private String path; + + /** + * Get the path for which the indexing behavior applies to. Index paths typically start with root and end with wildcard (/path/*). + * + * @return the path value + */ + public String path() { + return this.path; + } + + /** + * Set the path for which the indexing behavior applies to. Index paths typically start with root and end with wildcard (/path/*). + * + * @param path the path value to set + * @return the ExcludedPath object itself. + */ + public ExcludedPath withPath(String path) { + this.path = path; + return this; + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/ExtendedResourceProperties.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/ExtendedResourceProperties.java new file mode 100644 index 000000000000..184b855ded0d --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/ExtendedResourceProperties.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.cosmosdb.v2015_04_08; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The system generated resource properties associated with SQL databases and + * SQL containers. + */ +public class ExtendedResourceProperties { + /** + * A system generated property. A unique identifier. + */ + @JsonProperty(value = "_rid") + private String _rid; + + /** + * A system generated property that denotes the last updated timestamp of + * the resource. + */ + @JsonProperty(value = "_ts") + private Object _ts; + + /** + * A system generated property representing the resource etag required for + * optimistic concurrency control. + */ + @JsonProperty(value = "_etag") + private String _etag; + + /** + * Get a system generated property. A unique identifier. + * + * @return the _rid value + */ + public String _rid() { + return this._rid; + } + + /** + * Set a system generated property. A unique identifier. + * + * @param _rid the _rid value to set + * @return the ExtendedResourceProperties object itself. + */ + public ExtendedResourceProperties with_rid(String _rid) { + this._rid = _rid; + return this; + } + + /** + * Get a system generated property that denotes the last updated timestamp of the resource. + * + * @return the _ts value + */ + public Object _ts() { + return this._ts; + } + + /** + * Set a system generated property that denotes the last updated timestamp of the resource. + * + * @param _ts the _ts value to set + * @return the ExtendedResourceProperties object itself. + */ + public ExtendedResourceProperties with_ts(Object _ts) { + this._ts = _ts; + return this; + } + + /** + * Get a system generated property representing the resource etag required for optimistic concurrency control. + * + * @return the _etag value + */ + public String _etag() { + return this._etag; + } + + /** + * Set a system generated property representing the resource etag required for optimistic concurrency control. + * + * @param _etag the _etag value to set + * @return the ExtendedResourceProperties object itself. + */ + public ExtendedResourceProperties with_etag(String _etag) { + this._etag = _etag; + return this; + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/FailoverPolicies.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/FailoverPolicies.java new file mode 100644 index 000000000000..c6b1d2ec74ec --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/FailoverPolicies.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.cosmosdb.v2015_04_08; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The list of new failover policies for the failover priority change. + */ +public class FailoverPolicies { + /** + * List of failover policies. + */ + @JsonProperty(value = "failoverPolicies", required = true) + private List failoverPolicies; + + /** + * Get list of failover policies. + * + * @return the failoverPolicies value + */ + public List failoverPolicies() { + return this.failoverPolicies; + } + + /** + * Set list of failover policies. + * + * @param failoverPolicies the failoverPolicies value to set + * @return the FailoverPolicies object itself. + */ + public FailoverPolicies withFailoverPolicies(List failoverPolicies) { + this.failoverPolicies = failoverPolicies; + return this; + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/FailoverPolicy.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/FailoverPolicy.java new file mode 100644 index 000000000000..6f72b4f8b023 --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/FailoverPolicy.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.cosmosdb.v2015_04_08; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The failover policy for a given region of a database account. + */ +public class FailoverPolicy { + /** + * The unique identifier of the region in which the database account + * replicates to. Example: + * <accountName>-<locationName>. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * The name of the region in which the database account exists. + */ + @JsonProperty(value = "locationName") + private String locationName; + + /** + * The failover priority of the region. A failover priority of 0 indicates + * a write region. The maximum value for a failover priority = (total + * number of regions - 1). Failover priority values must be unique for each + * of the regions in which the database account exists. + */ + @JsonProperty(value = "failoverPriority") + private Integer failoverPriority; + + /** + * Get the unique identifier of the region in which the database account replicates to. Example: <accountName>-<locationName>. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Get the name of the region in which the database account exists. + * + * @return the locationName value + */ + public String locationName() { + return this.locationName; + } + + /** + * Set the name of the region in which the database account exists. + * + * @param locationName the locationName value to set + * @return the FailoverPolicy object itself. + */ + public FailoverPolicy withLocationName(String locationName) { + this.locationName = locationName; + return this; + } + + /** + * Get the failover priority of the region. A failover priority of 0 indicates a write region. The maximum value for a failover priority = (total number of regions - 1). Failover priority values must be unique for each of the regions in which the database account exists. + * + * @return the failoverPriority value + */ + public Integer failoverPriority() { + return this.failoverPriority; + } + + /** + * Set the failover priority of the region. A failover priority of 0 indicates a write region. The maximum value for a failover priority = (total number of regions - 1). Failover priority values must be unique for each of the regions in which the database account exists. + * + * @param failoverPriority the failoverPriority value to set + * @return the FailoverPolicy object itself. + */ + public FailoverPolicy withFailoverPriority(Integer failoverPriority) { + this.failoverPriority = failoverPriority; + return this; + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/GremlinDatabase.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/GremlinDatabase.java new file mode 100644 index 000000000000..b8c32d366393 --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/GremlinDatabase.java @@ -0,0 +1,66 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.cosmosdb.v2015_04_08; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation.CosmosDBManager; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation.GremlinDatabaseInner; +import java.util.Map; + +/** + * Type representing GremlinDatabase. + */ +public interface GremlinDatabase extends HasInner, HasManager { + /** + * @return the _etag value. + */ + String _etag(); + + /** + * @return the _rid value. + */ + String _rid(); + + /** + * @return the _ts value. + */ + Object _ts(); + + /** + * @return the gremlinDatabaseId value. + */ + String gremlinDatabaseId(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/GremlinDatabaseCreateUpdateParameters.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/GremlinDatabaseCreateUpdateParameters.java new file mode 100644 index 000000000000..1008c5811eb7 --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/GremlinDatabaseCreateUpdateParameters.java @@ -0,0 +1,73 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.cosmosdb.v2015_04_08; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Parameters to create and update Cosmos DB Gremlin database. + */ +@JsonFlatten +public class GremlinDatabaseCreateUpdateParameters { + /** + * The standard JSON format of a Gremlin database. + */ + @JsonProperty(value = "properties.resource", required = true) + private GremlinDatabaseResource resource; + + /** + * A key-value pair of options to be applied for the request. This + * corresponds to the headers sent with the request. + */ + @JsonProperty(value = "properties.options", required = true) + private Map options; + + /** + * Get the standard JSON format of a Gremlin database. + * + * @return the resource value + */ + public GremlinDatabaseResource resource() { + return this.resource; + } + + /** + * Set the standard JSON format of a Gremlin database. + * + * @param resource the resource value to set + * @return the GremlinDatabaseCreateUpdateParameters object itself. + */ + public GremlinDatabaseCreateUpdateParameters withResource(GremlinDatabaseResource resource) { + this.resource = resource; + return this; + } + + /** + * Get a key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. + * + * @return the options value + */ + public Map options() { + return this.options; + } + + /** + * Set a key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. + * + * @param options the options value to set + * @return the GremlinDatabaseCreateUpdateParameters object itself. + */ + public GremlinDatabaseCreateUpdateParameters withOptions(Map options) { + this.options = options; + return this; + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/GremlinDatabaseResource.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/GremlinDatabaseResource.java new file mode 100644 index 000000000000..385493bf90b8 --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/GremlinDatabaseResource.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.cosmosdb.v2015_04_08; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Cosmos DB Gremlin database id object. + */ +public class GremlinDatabaseResource { + /** + * Name of the Cosmos DB Gremlin database. + */ + @JsonProperty(value = "id", required = true) + private String id; + + /** + * Get name of the Cosmos DB Gremlin database. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set name of the Cosmos DB Gremlin database. + * + * @param id the id value to set + * @return the GremlinDatabaseResource object itself. + */ + public GremlinDatabaseResource withId(String id) { + this.id = id; + return this; + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/GremlinGraph.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/GremlinGraph.java new file mode 100644 index 000000000000..e14a006984bc --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/GremlinGraph.java @@ -0,0 +1,169 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.cosmosdb.v2015_04_08; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation.GremlinGraphInner; +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.cosmosdb.v2015_04_08.implementation.CosmosDBManager; +import java.util.Map; + +/** + * Type representing GremlinGraph. + */ +public interface GremlinGraph extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the _etag value. + */ + String _etag(); + + /** + * @return the _rid value. + */ + String _rid(); + + /** + * @return the _ts value. + */ + Object _ts(); + + /** + * @return the conflictResolutionPolicy value. + */ + ConflictResolutionPolicy conflictResolutionPolicy(); + + /** + * @return the defaultTtl value. + */ + Integer defaultTtl(); + + /** + * @return the gremlinGraphId value. + */ + String gremlinGraphId(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the indexingPolicy value. + */ + IndexingPolicy indexingPolicy(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the partitionKey value. + */ + ContainerPartitionKey partitionKey(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + + /** + * @return the uniqueKeyPolicy value. + */ + UniqueKeyPolicy uniqueKeyPolicy(); + + /** + * The entirety of the GremlinGraph definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithDatabasis, DefinitionStages.WithOptions, DefinitionStages.WithResource, DefinitionStages.WithCreate { + } + + /** + * Grouping of GremlinGraph definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a GremlinGraph definition. + */ + interface Blank extends WithDatabasis { + } + + /** + * The stage of the gremlingraph definition allowing to specify Databasis. + */ + interface WithDatabasis { + /** + * Specifies resourceGroupName, accountName, databaseName. + * @param resourceGroupName Name of an Azure resource group + * @param accountName Cosmos DB database account name + * @param databaseName Cosmos DB database name + * @return the next definition stage + */ + WithOptions withExistingDatabasis(String resourceGroupName, String accountName, String databaseName); + } + + /** + * The stage of the gremlingraph definition allowing to specify Options. + */ + interface WithOptions { + /** + * Specifies options. + * @param options A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request + * @return the next definition stage + */ + WithResource withOptions(Map options); + } + + /** + * The stage of the gremlingraph definition allowing to specify Resource. + */ + interface WithResource { + /** + * Specifies resource. + * @param resource The standard JSON format of a Gremlin graph + * @return the next definition stage + */ + WithCreate withResource(GremlinGraphResource resource); + } + + /** + * 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 GremlinGraph update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable { + } + + /** + * Grouping of GremlinGraph update stages. + */ + interface UpdateStages { + } +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/GremlinGraphCreateUpdateParameters.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/GremlinGraphCreateUpdateParameters.java new file mode 100644 index 000000000000..f19390a320f1 --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/GremlinGraphCreateUpdateParameters.java @@ -0,0 +1,73 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.cosmosdb.v2015_04_08; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Parameters to create and update Cosmos DB Gremlin graph. + */ +@JsonFlatten +public class GremlinGraphCreateUpdateParameters { + /** + * The standard JSON format of a Gremlin graph. + */ + @JsonProperty(value = "properties.resource", required = true) + private GremlinGraphResource resource; + + /** + * A key-value pair of options to be applied for the request. This + * corresponds to the headers sent with the request. + */ + @JsonProperty(value = "properties.options", required = true) + private Map options; + + /** + * Get the standard JSON format of a Gremlin graph. + * + * @return the resource value + */ + public GremlinGraphResource resource() { + return this.resource; + } + + /** + * Set the standard JSON format of a Gremlin graph. + * + * @param resource the resource value to set + * @return the GremlinGraphCreateUpdateParameters object itself. + */ + public GremlinGraphCreateUpdateParameters withResource(GremlinGraphResource resource) { + this.resource = resource; + return this; + } + + /** + * Get a key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. + * + * @return the options value + */ + public Map options() { + return this.options; + } + + /** + * Set a key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. + * + * @param options the options value to set + * @return the GremlinGraphCreateUpdateParameters object itself. + */ + public GremlinGraphCreateUpdateParameters withOptions(Map options) { + this.options = options; + return this; + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/GremlinGraphResource.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/GremlinGraphResource.java new file mode 100644 index 000000000000..5684772e9353 --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/GremlinGraphResource.java @@ -0,0 +1,177 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.cosmosdb.v2015_04_08; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Cosmos DB Gremlin graph resource object. + */ +public class GremlinGraphResource { + /** + * Name of the Cosmos DB Gremlin graph. + */ + @JsonProperty(value = "id", required = true) + private String id; + + /** + * The configuration of the indexing policy. By default, the indexing is + * automatic for all document paths within the graph. + */ + @JsonProperty(value = "indexingPolicy") + private IndexingPolicy indexingPolicy; + + /** + * The configuration of the partition key to be used for partitioning data + * into multiple partitions. + */ + @JsonProperty(value = "partitionKey") + private ContainerPartitionKey partitionKey; + + /** + * Default time to live. + */ + @JsonProperty(value = "defaultTtl") + private Integer defaultTtl; + + /** + * The unique key policy configuration for specifying uniqueness + * constraints on documents in the collection in the Azure Cosmos DB + * service. + */ + @JsonProperty(value = "uniqueKeyPolicy") + private UniqueKeyPolicy uniqueKeyPolicy; + + /** + * The conflict resolution policy for the graph. + */ + @JsonProperty(value = "conflictResolutionPolicy") + private ConflictResolutionPolicy conflictResolutionPolicy; + + /** + * Get name of the Cosmos DB Gremlin graph. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set name of the Cosmos DB Gremlin graph. + * + * @param id the id value to set + * @return the GremlinGraphResource object itself. + */ + public GremlinGraphResource withId(String id) { + this.id = id; + return this; + } + + /** + * Get the configuration of the indexing policy. By default, the indexing is automatic for all document paths within the graph. + * + * @return the indexingPolicy value + */ + public IndexingPolicy indexingPolicy() { + return this.indexingPolicy; + } + + /** + * Set the configuration of the indexing policy. By default, the indexing is automatic for all document paths within the graph. + * + * @param indexingPolicy the indexingPolicy value to set + * @return the GremlinGraphResource object itself. + */ + public GremlinGraphResource withIndexingPolicy(IndexingPolicy indexingPolicy) { + this.indexingPolicy = indexingPolicy; + return this; + } + + /** + * Get the configuration of the partition key to be used for partitioning data into multiple partitions. + * + * @return the partitionKey value + */ + public ContainerPartitionKey partitionKey() { + return this.partitionKey; + } + + /** + * Set the configuration of the partition key to be used for partitioning data into multiple partitions. + * + * @param partitionKey the partitionKey value to set + * @return the GremlinGraphResource object itself. + */ + public GremlinGraphResource withPartitionKey(ContainerPartitionKey partitionKey) { + this.partitionKey = partitionKey; + return this; + } + + /** + * Get default time to live. + * + * @return the defaultTtl value + */ + public Integer defaultTtl() { + return this.defaultTtl; + } + + /** + * Set default time to live. + * + * @param defaultTtl the defaultTtl value to set + * @return the GremlinGraphResource object itself. + */ + public GremlinGraphResource withDefaultTtl(Integer defaultTtl) { + this.defaultTtl = defaultTtl; + return this; + } + + /** + * Get the unique key policy configuration for specifying uniqueness constraints on documents in the collection in the Azure Cosmos DB service. + * + * @return the uniqueKeyPolicy value + */ + public UniqueKeyPolicy uniqueKeyPolicy() { + return this.uniqueKeyPolicy; + } + + /** + * Set the unique key policy configuration for specifying uniqueness constraints on documents in the collection in the Azure Cosmos DB service. + * + * @param uniqueKeyPolicy the uniqueKeyPolicy value to set + * @return the GremlinGraphResource object itself. + */ + public GremlinGraphResource withUniqueKeyPolicy(UniqueKeyPolicy uniqueKeyPolicy) { + this.uniqueKeyPolicy = uniqueKeyPolicy; + return this; + } + + /** + * Get the conflict resolution policy for the graph. + * + * @return the conflictResolutionPolicy value + */ + public ConflictResolutionPolicy conflictResolutionPolicy() { + return this.conflictResolutionPolicy; + } + + /** + * Set the conflict resolution policy for the graph. + * + * @param conflictResolutionPolicy the conflictResolutionPolicy value to set + * @return the GremlinGraphResource object itself. + */ + public GremlinGraphResource withConflictResolutionPolicy(ConflictResolutionPolicy conflictResolutionPolicy) { + this.conflictResolutionPolicy = conflictResolutionPolicy; + return this; + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/IncludedPath.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/IncludedPath.java new file mode 100644 index 000000000000..6b4ab59de343 --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/IncludedPath.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.cosmosdb.v2015_04_08; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The paths that are included in indexing. + */ +public class IncludedPath { + /** + * The path for which the indexing behavior applies to. Index paths + * typically start with root and end with wildcard (/path/*). + */ + @JsonProperty(value = "path") + private String path; + + /** + * List of indexes for this path. + */ + @JsonProperty(value = "indexes") + private List indexes; + + /** + * Get the path for which the indexing behavior applies to. Index paths typically start with root and end with wildcard (/path/*). + * + * @return the path value + */ + public String path() { + return this.path; + } + + /** + * Set the path for which the indexing behavior applies to. Index paths typically start with root and end with wildcard (/path/*). + * + * @param path the path value to set + * @return the IncludedPath object itself. + */ + public IncludedPath withPath(String path) { + this.path = path; + return this; + } + + /** + * Get list of indexes for this path. + * + * @return the indexes value + */ + public List indexes() { + return this.indexes; + } + + /** + * Set list of indexes for this path. + * + * @param indexes the indexes value to set + * @return the IncludedPath object itself. + */ + public IncludedPath withIndexes(List indexes) { + this.indexes = indexes; + return this; + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/IndexKind.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/IndexKind.java new file mode 100644 index 000000000000..969579bc7f6f --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/IndexKind.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.cosmosdb.v2015_04_08; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for IndexKind. + */ +public final class IndexKind extends ExpandableStringEnum { + /** Static value Hash for IndexKind. */ + public static final IndexKind HASH = fromString("Hash"); + + /** Static value Range for IndexKind. */ + public static final IndexKind RANGE = fromString("Range"); + + /** Static value Spatial for IndexKind. */ + public static final IndexKind SPATIAL = fromString("Spatial"); + + /** + * Creates or finds a IndexKind from its string representation. + * @param name a name to look for + * @return the corresponding IndexKind + */ + @JsonCreator + public static IndexKind fromString(String name) { + return fromString(name, IndexKind.class); + } + + /** + * @return known IndexKind values + */ + public static Collection values() { + return values(IndexKind.class); + } +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/Indexes.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/Indexes.java new file mode 100644 index 000000000000..8247b1c30f3c --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/Indexes.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.cosmosdb.v2015_04_08; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The indexes for the path. + */ +public class Indexes { + /** + * The datatype for which the indexing behavior is applied to. Possible + * values include: 'String', 'Number', 'Point', 'Polygon', 'LineString', + * 'MultiPolygon'. + */ + @JsonProperty(value = "dataType") + private DataType dataType; + + /** + * The precision of the index. -1 is maximum precision. + */ + @JsonProperty(value = "precision") + private Integer precision; + + /** + * Indicates the type of index. Possible values include: 'Hash', 'Range', + * 'Spatial'. + */ + @JsonProperty(value = "kind") + private IndexKind kind; + + /** + * Get the datatype for which the indexing behavior is applied to. Possible values include: 'String', 'Number', 'Point', 'Polygon', 'LineString', 'MultiPolygon'. + * + * @return the dataType value + */ + public DataType dataType() { + return this.dataType; + } + + /** + * Set the datatype for which the indexing behavior is applied to. Possible values include: 'String', 'Number', 'Point', 'Polygon', 'LineString', 'MultiPolygon'. + * + * @param dataType the dataType value to set + * @return the Indexes object itself. + */ + public Indexes withDataType(DataType dataType) { + this.dataType = dataType; + return this; + } + + /** + * Get the precision of the index. -1 is maximum precision. + * + * @return the precision value + */ + public Integer precision() { + return this.precision; + } + + /** + * Set the precision of the index. -1 is maximum precision. + * + * @param precision the precision value to set + * @return the Indexes object itself. + */ + public Indexes withPrecision(Integer precision) { + this.precision = precision; + return this; + } + + /** + * Get indicates the type of index. Possible values include: 'Hash', 'Range', 'Spatial'. + * + * @return the kind value + */ + public IndexKind kind() { + return this.kind; + } + + /** + * Set indicates the type of index. Possible values include: 'Hash', 'Range', 'Spatial'. + * + * @param kind the kind value to set + * @return the Indexes object itself. + */ + public Indexes withKind(IndexKind kind) { + this.kind = kind; + return this; + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/IndexingMode.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/IndexingMode.java new file mode 100644 index 000000000000..2a4725d3e288 --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/IndexingMode.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.cosmosdb.v2015_04_08; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for IndexingMode. + */ +public final class IndexingMode extends ExpandableStringEnum { + /** Static value Consistent for IndexingMode. */ + public static final IndexingMode CONSISTENT = fromString("Consistent"); + + /** Static value Lazy for IndexingMode. */ + public static final IndexingMode LAZY = fromString("Lazy"); + + /** Static value None for IndexingMode. */ + public static final IndexingMode NONE = fromString("None"); + + /** + * Creates or finds a IndexingMode from its string representation. + * @param name a name to look for + * @return the corresponding IndexingMode + */ + @JsonCreator + public static IndexingMode fromString(String name) { + return fromString(name, IndexingMode.class); + } + + /** + * @return known IndexingMode values + */ + public static Collection values() { + return values(IndexingMode.class); + } +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/IndexingPolicy.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/IndexingPolicy.java new file mode 100644 index 000000000000..728ee3d8ac25 --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/IndexingPolicy.java @@ -0,0 +1,123 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.cosmosdb.v2015_04_08; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Cosmos DB indexing policy. + */ +public class IndexingPolicy { + /** + * Indicates if the indexing policy is automatic. + */ + @JsonProperty(value = "automatic") + private Boolean automatic; + + /** + * Indicates the indexing mode. Possible values include: 'Consistent', + * 'Lazy', 'None'. + */ + @JsonProperty(value = "indexingMode") + private IndexingMode indexingMode; + + /** + * List of paths to include in the indexing. + */ + @JsonProperty(value = "includedPaths") + private List includedPaths; + + /** + * List of paths to exclude from indexing. + */ + @JsonProperty(value = "excludedPaths") + private List excludedPaths; + + /** + * Get indicates if the indexing policy is automatic. + * + * @return the automatic value + */ + public Boolean automatic() { + return this.automatic; + } + + /** + * Set indicates if the indexing policy is automatic. + * + * @param automatic the automatic value to set + * @return the IndexingPolicy object itself. + */ + public IndexingPolicy withAutomatic(Boolean automatic) { + this.automatic = automatic; + return this; + } + + /** + * Get indicates the indexing mode. Possible values include: 'Consistent', 'Lazy', 'None'. + * + * @return the indexingMode value + */ + public IndexingMode indexingMode() { + return this.indexingMode; + } + + /** + * Set indicates the indexing mode. Possible values include: 'Consistent', 'Lazy', 'None'. + * + * @param indexingMode the indexingMode value to set + * @return the IndexingPolicy object itself. + */ + public IndexingPolicy withIndexingMode(IndexingMode indexingMode) { + this.indexingMode = indexingMode; + return this; + } + + /** + * Get list of paths to include in the indexing. + * + * @return the includedPaths value + */ + public List includedPaths() { + return this.includedPaths; + } + + /** + * Set list of paths to include in the indexing. + * + * @param includedPaths the includedPaths value to set + * @return the IndexingPolicy object itself. + */ + public IndexingPolicy withIncludedPaths(List includedPaths) { + this.includedPaths = includedPaths; + return this; + } + + /** + * Get list of paths to exclude from indexing. + * + * @return the excludedPaths value + */ + public List excludedPaths() { + return this.excludedPaths; + } + + /** + * Set list of paths to exclude from indexing. + * + * @param excludedPaths the excludedPaths value to set + * @return the IndexingPolicy object itself. + */ + public IndexingPolicy withExcludedPaths(List excludedPaths) { + this.excludedPaths = excludedPaths; + return this; + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/KeyKind.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/KeyKind.java new file mode 100644 index 000000000000..fa0ae6365e4d --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/KeyKind.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.cosmosdb.v2015_04_08; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for KeyKind. + */ +public final class KeyKind extends ExpandableStringEnum { + /** Static value primary for KeyKind. */ + public static final KeyKind PRIMARY = fromString("primary"); + + /** Static value secondary for KeyKind. */ + public static final KeyKind SECONDARY = fromString("secondary"); + + /** Static value primaryReadonly for KeyKind. */ + public static final KeyKind PRIMARY_READONLY = fromString("primaryReadonly"); + + /** Static value secondaryReadonly for KeyKind. */ + public static final KeyKind SECONDARY_READONLY = fromString("secondaryReadonly"); + + /** + * Creates or finds a KeyKind from its string representation. + * @param name a name to look for + * @return the corresponding KeyKind + */ + @JsonCreator + public static KeyKind fromString(String name) { + return fromString(name, KeyKind.class); + } + + /** + * @return known KeyKind values + */ + public static Collection values() { + return values(KeyKind.class); + } +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/Location.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/Location.java new file mode 100644 index 000000000000..3ae2977d996a --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/Location.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.cosmosdb.v2015_04_08; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A region in which the Azure Cosmos DB database account is deployed. + */ +public class Location { + /** + * The unique identifier of the region within the database account. + * Example: <accountName>-<locationName>. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * The name of the region. + */ + @JsonProperty(value = "locationName") + private String locationName; + + /** + * The connection endpoint for the specific region. Example: + * https://<accountName>-<locationName>.documents.azure.com:443/. + */ + @JsonProperty(value = "documentEndpoint", access = JsonProperty.Access.WRITE_ONLY) + private String documentEndpoint; + + /** + * The provisioningState property. + */ + @JsonProperty(value = "provisioningState") + private String provisioningState; + + /** + * The failover priority of the region. A failover priority of 0 indicates + * a write region. The maximum value for a failover priority = (total + * number of regions - 1). Failover priority values must be unique for each + * of the regions in which the database account exists. + */ + @JsonProperty(value = "failoverPriority") + private Integer failoverPriority; + + /** + * Flag to indicate whether or not this region is an AvailabilityZone + * region. + */ + @JsonProperty(value = "isZoneRedundant") + private Boolean isZoneRedundant; + + /** + * Get the unique identifier of the region within the database account. Example: <accountName>-<locationName>. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Get the name of the region. + * + * @return the locationName value + */ + public String locationName() { + return this.locationName; + } + + /** + * Set the name of the region. + * + * @param locationName the locationName value to set + * @return the Location object itself. + */ + public Location withLocationName(String locationName) { + this.locationName = locationName; + return this; + } + + /** + * Get the connection endpoint for the specific region. Example: https://<accountName>-<locationName>.documents.azure.com:443/. + * + * @return the documentEndpoint value + */ + public String documentEndpoint() { + return this.documentEndpoint; + } + + /** + * Get the provisioningState value. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioningState value. + * + * @param provisioningState the provisioningState value to set + * @return the Location object itself. + */ + public Location withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get the failover priority of the region. A failover priority of 0 indicates a write region. The maximum value for a failover priority = (total number of regions - 1). Failover priority values must be unique for each of the regions in which the database account exists. + * + * @return the failoverPriority value + */ + public Integer failoverPriority() { + return this.failoverPriority; + } + + /** + * Set the failover priority of the region. A failover priority of 0 indicates a write region. The maximum value for a failover priority = (total number of regions - 1). Failover priority values must be unique for each of the regions in which the database account exists. + * + * @param failoverPriority the failoverPriority value to set + * @return the Location object itself. + */ + public Location withFailoverPriority(Integer failoverPriority) { + this.failoverPriority = failoverPriority; + return this; + } + + /** + * Get flag to indicate whether or not this region is an AvailabilityZone region. + * + * @return the isZoneRedundant value + */ + public Boolean isZoneRedundant() { + return this.isZoneRedundant; + } + + /** + * Set flag to indicate whether or not this region is an AvailabilityZone region. + * + * @param isZoneRedundant the isZoneRedundant value to set + * @return the Location object itself. + */ + public Location withIsZoneRedundant(Boolean isZoneRedundant) { + this.isZoneRedundant = isZoneRedundant; + return this; + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/MetricAvailability.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/MetricAvailability.java new file mode 100644 index 000000000000..9768ebd12ad6 --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/MetricAvailability.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.cosmosdb.v2015_04_08; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The availability of the metric. + */ +public class MetricAvailability { + /** + * The time grain to be used to summarize the metric values. + */ + @JsonProperty(value = "timeGrain", access = JsonProperty.Access.WRITE_ONLY) + private String timeGrain; + + /** + * The retention for the metric values. + */ + @JsonProperty(value = "retention", access = JsonProperty.Access.WRITE_ONLY) + private String retention; + + /** + * Get the time grain to be used to summarize the metric values. + * + * @return the timeGrain value + */ + public String timeGrain() { + return this.timeGrain; + } + + /** + * Get the retention for the metric values. + * + * @return the retention value + */ + public String retention() { + return this.retention; + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/MetricName.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/MetricName.java new file mode 100644 index 000000000000..4987adb804df --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/MetricName.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.cosmosdb.v2015_04_08; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A metric name. + */ +public class MetricName { + /** + * The name of the metric. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private String value; + + /** + * The friendly name of the metric. + */ + @JsonProperty(value = "localizedValue", access = JsonProperty.Access.WRITE_ONLY) + private String localizedValue; + + /** + * Get the name of the metric. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Get the friendly name of the metric. + * + * @return the localizedValue value + */ + public String localizedValue() { + return this.localizedValue; + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/MetricValue.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/MetricValue.java new file mode 100644 index 000000000000..7cfd8049adf2 --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/MetricValue.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.cosmosdb.v2015_04_08; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Represents metrics values. + */ +public class MetricValue { + /** + * The number of values for the metric. + */ + @JsonProperty(value = "_count", access = JsonProperty.Access.WRITE_ONLY) + private Double _count; + + /** + * The average value of the metric. + */ + @JsonProperty(value = "average", access = JsonProperty.Access.WRITE_ONLY) + private Double average; + + /** + * The max value of the metric. + */ + @JsonProperty(value = "maximum", access = JsonProperty.Access.WRITE_ONLY) + private Double maximum; + + /** + * The min value of the metric. + */ + @JsonProperty(value = "minimum", access = JsonProperty.Access.WRITE_ONLY) + private Double minimum; + + /** + * The metric timestamp (ISO-8601 format). + */ + @JsonProperty(value = "timestamp", access = JsonProperty.Access.WRITE_ONLY) + private DateTime timestamp; + + /** + * The total value of the metric. + */ + @JsonProperty(value = "total", access = JsonProperty.Access.WRITE_ONLY) + private Double total; + + /** + * Get the number of values for the metric. + * + * @return the _count value + */ + public Double _count() { + return this._count; + } + + /** + * Get the average value of the metric. + * + * @return the average value + */ + public Double average() { + return this.average; + } + + /** + * Get the max value of the metric. + * + * @return the maximum value + */ + public Double maximum() { + return this.maximum; + } + + /** + * Get the min value of the metric. + * + * @return the minimum value + */ + public Double minimum() { + return this.minimum; + } + + /** + * Get the metric timestamp (ISO-8601 format). + * + * @return the timestamp value + */ + public DateTime timestamp() { + return this.timestamp; + } + + /** + * Get the total value of the metric. + * + * @return the total value + */ + public Double total() { + return this.total; + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/MongoDBCollection.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/MongoDBCollection.java new file mode 100644 index 000000000000..58c275266a0a --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/MongoDBCollection.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.cosmosdb.v2015_04_08; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation.MongoDBCollectionInner; +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.cosmosdb.v2015_04_08.implementation.CosmosDBManager; +import java.util.Map; +import java.util.List; + +/** + * Type representing MongoDBCollection. + */ +public interface MongoDBCollection extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the indexes value. + */ + List indexes(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the mongoDBCollectionId value. + */ + String mongoDBCollectionId(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the shardKey value. + */ + Map shardKey(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the MongoDBCollection definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithDatabasis, DefinitionStages.WithOptions, DefinitionStages.WithResource, DefinitionStages.WithCreate { + } + + /** + * Grouping of MongoDBCollection definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a MongoDBCollection definition. + */ + interface Blank extends WithDatabasis { + } + + /** + * The stage of the mongodbcollection definition allowing to specify Databasis. + */ + interface WithDatabasis { + /** + * Specifies resourceGroupName, accountName, databaseName. + * @param resourceGroupName Name of an Azure resource group + * @param accountName Cosmos DB database account name + * @param databaseName Cosmos DB database name + * @return the next definition stage + */ + WithOptions withExistingDatabasis(String resourceGroupName, String accountName, String databaseName); + } + + /** + * The stage of the mongodbcollection definition allowing to specify Options. + */ + interface WithOptions { + /** + * Specifies options. + * @param options A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request + * @return the next definition stage + */ + WithResource withOptions(Map options); + } + + /** + * The stage of the mongodbcollection definition allowing to specify Resource. + */ + interface WithResource { + /** + * Specifies resource. + * @param resource The standard JSON format of a MongoDB collection + * @return the next definition stage + */ + WithCreate withResource(MongoDBCollectionResource resource); + } + + /** + * 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 MongoDBCollection update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable { + } + + /** + * Grouping of MongoDBCollection update stages. + */ + interface UpdateStages { + } +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/MongoDBCollectionCreateUpdateParameters.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/MongoDBCollectionCreateUpdateParameters.java new file mode 100644 index 000000000000..1ee105c96f07 --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/MongoDBCollectionCreateUpdateParameters.java @@ -0,0 +1,73 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.cosmosdb.v2015_04_08; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Parameters to create and update Cosmos DB MongoDB collection. + */ +@JsonFlatten +public class MongoDBCollectionCreateUpdateParameters { + /** + * The standard JSON format of a MongoDB collection. + */ + @JsonProperty(value = "properties.resource", required = true) + private MongoDBCollectionResource resource; + + /** + * A key-value pair of options to be applied for the request. This + * corresponds to the headers sent with the request. + */ + @JsonProperty(value = "properties.options", required = true) + private Map options; + + /** + * Get the standard JSON format of a MongoDB collection. + * + * @return the resource value + */ + public MongoDBCollectionResource resource() { + return this.resource; + } + + /** + * Set the standard JSON format of a MongoDB collection. + * + * @param resource the resource value to set + * @return the MongoDBCollectionCreateUpdateParameters object itself. + */ + public MongoDBCollectionCreateUpdateParameters withResource(MongoDBCollectionResource resource) { + this.resource = resource; + return this; + } + + /** + * Get a key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. + * + * @return the options value + */ + public Map options() { + return this.options; + } + + /** + * Set a key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. + * + * @param options the options value to set + * @return the MongoDBCollectionCreateUpdateParameters object itself. + */ + public MongoDBCollectionCreateUpdateParameters withOptions(Map options) { + this.options = options; + return this; + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/MongoDBCollectionResource.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/MongoDBCollectionResource.java new file mode 100644 index 000000000000..c51928decc5b --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/MongoDBCollectionResource.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.cosmosdb.v2015_04_08; + +import java.util.Map; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Cosmos DB MongoDB collection resource object. + */ +public class MongoDBCollectionResource { + /** + * Name of the Cosmos DB MongoDB collection. + */ + @JsonProperty(value = "id", required = true) + private String id; + + /** + * A key-value pair of shard keys to be applied for the request. + */ + @JsonProperty(value = "shardKey") + private Map shardKey; + + /** + * List of index keys. + */ + @JsonProperty(value = "indexes") + private List indexes; + + /** + * Get name of the Cosmos DB MongoDB collection. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set name of the Cosmos DB MongoDB collection. + * + * @param id the id value to set + * @return the MongoDBCollectionResource object itself. + */ + public MongoDBCollectionResource withId(String id) { + this.id = id; + return this; + } + + /** + * Get a key-value pair of shard keys to be applied for the request. + * + * @return the shardKey value + */ + public Map shardKey() { + return this.shardKey; + } + + /** + * Set a key-value pair of shard keys to be applied for the request. + * + * @param shardKey the shardKey value to set + * @return the MongoDBCollectionResource object itself. + */ + public MongoDBCollectionResource withShardKey(Map shardKey) { + this.shardKey = shardKey; + return this; + } + + /** + * Get list of index keys. + * + * @return the indexes value + */ + public List indexes() { + return this.indexes; + } + + /** + * Set list of index keys. + * + * @param indexes the indexes value to set + * @return the MongoDBCollectionResource object itself. + */ + public MongoDBCollectionResource withIndexes(List indexes) { + this.indexes = indexes; + return this; + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/MongoDBDatabase.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/MongoDBDatabase.java new file mode 100644 index 000000000000..bb3b51f8538f --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/MongoDBDatabase.java @@ -0,0 +1,51 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.cosmosdb.v2015_04_08; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation.CosmosDBManager; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation.MongoDBDatabaseInner; +import java.util.Map; + +/** + * Type representing MongoDBDatabase. + */ +public interface MongoDBDatabase extends HasInner, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the mongoDBDatabaseId value. + */ + String mongoDBDatabaseId(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/MongoDBDatabaseCreateUpdateParameters.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/MongoDBDatabaseCreateUpdateParameters.java new file mode 100644 index 000000000000..a1a057c8c293 --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/MongoDBDatabaseCreateUpdateParameters.java @@ -0,0 +1,73 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.cosmosdb.v2015_04_08; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Parameters to create and update Cosmos DB MongoDB database. + */ +@JsonFlatten +public class MongoDBDatabaseCreateUpdateParameters { + /** + * The standard JSON format of a MongoDB database. + */ + @JsonProperty(value = "properties.resource", required = true) + private MongoDBDatabaseResource resource; + + /** + * A key-value pair of options to be applied for the request. This + * corresponds to the headers sent with the request. + */ + @JsonProperty(value = "properties.options", required = true) + private Map options; + + /** + * Get the standard JSON format of a MongoDB database. + * + * @return the resource value + */ + public MongoDBDatabaseResource resource() { + return this.resource; + } + + /** + * Set the standard JSON format of a MongoDB database. + * + * @param resource the resource value to set + * @return the MongoDBDatabaseCreateUpdateParameters object itself. + */ + public MongoDBDatabaseCreateUpdateParameters withResource(MongoDBDatabaseResource resource) { + this.resource = resource; + return this; + } + + /** + * Get a key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. + * + * @return the options value + */ + public Map options() { + return this.options; + } + + /** + * Set a key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. + * + * @param options the options value to set + * @return the MongoDBDatabaseCreateUpdateParameters object itself. + */ + public MongoDBDatabaseCreateUpdateParameters withOptions(Map options) { + this.options = options; + return this; + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/MongoDBDatabaseResource.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/MongoDBDatabaseResource.java new file mode 100644 index 000000000000..adfaa17cba3d --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/MongoDBDatabaseResource.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.cosmosdb.v2015_04_08; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Cosmos DB MongoDB database id object. + */ +public class MongoDBDatabaseResource { + /** + * Name of the Cosmos DB MongoDB database. + */ + @JsonProperty(value = "id", required = true) + private String id; + + /** + * Get name of the Cosmos DB MongoDB database. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set name of the Cosmos DB MongoDB database. + * + * @param id the id value to set + * @return the MongoDBDatabaseResource object itself. + */ + public MongoDBDatabaseResource withId(String id) { + this.id = id; + return this; + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/MongoIndex.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/MongoIndex.java new file mode 100644 index 000000000000..8d10eb94fdc3 --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/MongoIndex.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.cosmosdb.v2015_04_08; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Cosmos DB MongoDB collection index key. + */ +public class MongoIndex { + /** + * Cosmos DB MongoDB collection index keys. + */ + @JsonProperty(value = "key") + private MongoIndexKeys key; + + /** + * Cosmos DB MongoDB collection index key options. + */ + @JsonProperty(value = "options") + private MongoIndexOptions options; + + /** + * Get cosmos DB MongoDB collection index keys. + * + * @return the key value + */ + public MongoIndexKeys key() { + return this.key; + } + + /** + * Set cosmos DB MongoDB collection index keys. + * + * @param key the key value to set + * @return the MongoIndex object itself. + */ + public MongoIndex withKey(MongoIndexKeys key) { + this.key = key; + return this; + } + + /** + * Get cosmos DB MongoDB collection index key options. + * + * @return the options value + */ + public MongoIndexOptions options() { + return this.options; + } + + /** + * Set cosmos DB MongoDB collection index key options. + * + * @param options the options value to set + * @return the MongoIndex object itself. + */ + public MongoIndex withOptions(MongoIndexOptions options) { + this.options = options; + return this; + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/MongoIndexKeys.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/MongoIndexKeys.java new file mode 100644 index 000000000000..9482984bd19e --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/MongoIndexKeys.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.cosmosdb.v2015_04_08; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Cosmos DB MongoDB collection resource object. + */ +public class MongoIndexKeys { + /** + * List of keys for each MongoDB collection in the Azure Cosmos DB service. + */ + @JsonProperty(value = "keys") + private List keys; + + /** + * Get list of keys for each MongoDB collection in the Azure Cosmos DB service. + * + * @return the keys value + */ + public List keys() { + return this.keys; + } + + /** + * Set list of keys for each MongoDB collection in the Azure Cosmos DB service. + * + * @param keys the keys value to set + * @return the MongoIndexKeys object itself. + */ + public MongoIndexKeys withKeys(List keys) { + this.keys = keys; + return this; + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/MongoIndexOptions.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/MongoIndexOptions.java new file mode 100644 index 000000000000..d2b9d94acc5a --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/MongoIndexOptions.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.cosmosdb.v2015_04_08; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Cosmos DB MongoDB collection index options. + */ +public class MongoIndexOptions { + /** + * Expire after seconds. + */ + @JsonProperty(value = "expireAfterSeconds") + private Integer expireAfterSeconds; + + /** + * Is unique or not. + */ + @JsonProperty(value = "unique") + private Boolean unique; + + /** + * Get expire after seconds. + * + * @return the expireAfterSeconds value + */ + public Integer expireAfterSeconds() { + return this.expireAfterSeconds; + } + + /** + * Set expire after seconds. + * + * @param expireAfterSeconds the expireAfterSeconds value to set + * @return the MongoIndexOptions object itself. + */ + public MongoIndexOptions withExpireAfterSeconds(Integer expireAfterSeconds) { + this.expireAfterSeconds = expireAfterSeconds; + return this; + } + + /** + * Get is unique or not. + * + * @return the unique value + */ + public Boolean unique() { + return this.unique; + } + + /** + * Set is unique or not. + * + * @param unique the unique value to set + * @return the MongoIndexOptions object itself. + */ + public MongoIndexOptions withUnique(Boolean unique) { + this.unique = unique; + return this; + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/Operation.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/Operation.java new file mode 100644 index 000000000000..e7b6d0f15616 --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/Operation.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.cosmosdb.v2015_04_08; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation.CosmosDBManager; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation.OperationInner; + +/** + * Type representing Operation. + */ +public interface Operation extends HasInner, HasManager { + /** + * @return the display value. + */ + OperationDisplay display(); + + /** + * @return the name value. + */ + String name(); + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/OperationDisplay.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/OperationDisplay.java new file mode 100644 index 000000000000..d52b734cb5df --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/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.cosmosdb.v2015_04_08; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The object that represents the operation. + */ +public class OperationDisplay { + /** + * Service provider: Microsoft.ResourceProvider. + */ + @JsonProperty(value = "Provider") + private String provider; + + /** + * Resource on which the operation is performed: Profile, endpoint, etc. + */ + @JsonProperty(value = "Resource") + private String resource; + + /** + * Operation type: Read, write, delete, etc. + */ + @JsonProperty(value = "Operation") + private String operation; + + /** + * Description of operation. + */ + @JsonProperty(value = "Description") + private String description; + + /** + * Get service provider: Microsoft.ResourceProvider. + * + * @return the provider value + */ + public String provider() { + return this.provider; + } + + /** + * Set service provider: Microsoft.ResourceProvider. + * + * @param provider the provider value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get resource on which the operation is performed: Profile, endpoint, etc. + * + * @return the resource value + */ + public String resource() { + return this.resource; + } + + /** + * Set resource on which the operation is performed: Profile, endpoint, etc. + * + * @param resource the resource value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withResource(String resource) { + this.resource = resource; + return this; + } + + /** + * Get operation type: Read, write, delete, etc. + * + * @return the operation value + */ + public String operation() { + return this.operation; + } + + /** + * Set operation type: Read, write, delete, etc. + * + * @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 operation. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set description of operation. + * + * @param description the description value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withDescription(String description) { + this.description = description; + return this; + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/Operations.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/Operations.java new file mode 100644 index 000000000000..1a80664ba990 --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/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.cosmosdb.v2015_04_08; + +import rx.Observable; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation.OperationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Operations. + */ +public interface Operations extends HasInner { + /** + * Lists all of the available Cosmos DB Resource Provider operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(); + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/PartitionKeyRangeIdRegions.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/PartitionKeyRangeIdRegions.java new file mode 100644 index 000000000000..0c55be3a92ff --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/PartitionKeyRangeIdRegions.java @@ -0,0 +1,32 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.cosmosdb.v2015_04_08; + +import rx.Observable; + +/** + * Type representing PartitionKeyRangeIdRegions. + */ +public interface PartitionKeyRangeIdRegions { + /** + * Retrieves the metrics determined by the given filter for the given partition key range id and region. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param region Cosmos DB region, with spaces between words and each word capitalized. + * @param databaseRid Cosmos DB database rid. + * @param collectionRid Cosmos DB collection rid. + * @param partitionKeyRangeId Partition Key Range Id for which to get data. + * @param filter An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listMetricsAsync(String resourceGroupName, String accountName, String region, String databaseRid, String collectionRid, String partitionKeyRangeId, String filter); + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/PartitionKeyRangeIds.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/PartitionKeyRangeIds.java new file mode 100644 index 000000000000..78959b9814ae --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/PartitionKeyRangeIds.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.cosmosdb.v2015_04_08; + +import rx.Observable; + +/** + * Type representing PartitionKeyRangeIds. + */ +public interface PartitionKeyRangeIds { + /** + * Retrieves the metrics determined by the given filter for the given partition key range id. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseRid Cosmos DB database rid. + * @param collectionRid Cosmos DB collection rid. + * @param partitionKeyRangeId Partition Key Range Id for which to get data. + * @param filter An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listMetricsAsync(String resourceGroupName, String accountName, String databaseRid, String collectionRid, String partitionKeyRangeId, String filter); + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/PartitionKind.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/PartitionKind.java new file mode 100644 index 000000000000..5f71ad325e81 --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/PartitionKind.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.cosmosdb.v2015_04_08; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for PartitionKind. + */ +public final class PartitionKind extends ExpandableStringEnum { + /** Static value Hash for PartitionKind. */ + public static final PartitionKind HASH = fromString("Hash"); + + /** Static value Range for PartitionKind. */ + public static final PartitionKind RANGE = fromString("Range"); + + /** + * Creates or finds a PartitionKind from its string representation. + * @param name a name to look for + * @return the corresponding PartitionKind + */ + @JsonCreator + public static PartitionKind fromString(String name) { + return fromString(name, PartitionKind.class); + } + + /** + * @return known PartitionKind values + */ + public static Collection values() { + return values(PartitionKind.class); + } +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/PartitionMetric.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/PartitionMetric.java new file mode 100644 index 000000000000..f71b2da26643 --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/PartitionMetric.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.cosmosdb.v2015_04_08; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation.CosmosDBManager; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation.PartitionMetricInner; +import org.joda.time.DateTime; +import java.util.List; + +/** + * Type representing PartitionMetric. + */ +public interface PartitionMetric extends HasInner, HasManager { + /** + * @return the endTime value. + */ + DateTime endTime(); + + /** + * @return the metricValues value. + */ + List metricValues(); + + /** + * @return the name value. + */ + MetricName name(); + + /** + * @return the partitionId value. + */ + String partitionId(); + + /** + * @return the partitionKeyRangeId value. + */ + String partitionKeyRangeId(); + + /** + * @return the startTime value. + */ + DateTime startTime(); + + /** + * @return the timeGrain value. + */ + String timeGrain(); + + /** + * @return the unit value. + */ + UnitType unit(); + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/PartitionUsage.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/PartitionUsage.java new file mode 100644 index 000000000000..88fbd7208209 --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/PartitionUsage.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.cosmosdb.v2015_04_08; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation.CosmosDBManager; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation.PartitionUsageInner; + +/** + * Type representing PartitionUsage. + */ +public interface PartitionUsage extends HasInner, HasManager { + /** + * @return the currentValue value. + */ + Long currentValue(); + + /** + * @return the limit value. + */ + Long limit(); + + /** + * @return the name value. + */ + MetricName name(); + + /** + * @return the partitionId value. + */ + String partitionId(); + + /** + * @return the partitionKeyRangeId value. + */ + String partitionKeyRangeId(); + + /** + * @return the quotaPeriod value. + */ + String quotaPeriod(); + + /** + * @return the unit value. + */ + UnitType unit(); + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/PercentileMetric.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/PercentileMetric.java new file mode 100644 index 000000000000..68e2b873d3ae --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/PercentileMetric.java @@ -0,0 +1,52 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.cosmosdb.v2015_04_08; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation.CosmosDBManager; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation.PercentileMetricInner; +import org.joda.time.DateTime; +import java.util.List; + +/** + * Type representing PercentileMetric. + */ +public interface PercentileMetric extends HasInner, HasManager { + /** + * @return the endTime value. + */ + DateTime endTime(); + + /** + * @return the metricValues value. + */ + List metricValues(); + + /** + * @return the name value. + */ + MetricName name(); + + /** + * @return the startTime value. + */ + DateTime startTime(); + + /** + * @return the timeGrain value. + */ + String timeGrain(); + + /** + * @return the unit value. + */ + UnitType unit(); + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/PercentileMetricValue.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/PercentileMetricValue.java new file mode 100644 index 000000000000..4051d9284cff --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/PercentileMetricValue.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.cosmosdb.v2015_04_08; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Represents percentile metrics values. + */ +public class PercentileMetricValue extends MetricValue { + /** + * The 10th percentile value for the metric. + */ + @JsonProperty(value = "P10", access = JsonProperty.Access.WRITE_ONLY) + private Double p10; + + /** + * The 25th percentile value for the metric. + */ + @JsonProperty(value = "P25", access = JsonProperty.Access.WRITE_ONLY) + private Double p25; + + /** + * The 50th percentile value for the metric. + */ + @JsonProperty(value = "P50", access = JsonProperty.Access.WRITE_ONLY) + private Double p50; + + /** + * The 75th percentile value for the metric. + */ + @JsonProperty(value = "P75", access = JsonProperty.Access.WRITE_ONLY) + private Double p75; + + /** + * The 90th percentile value for the metric. + */ + @JsonProperty(value = "P90", access = JsonProperty.Access.WRITE_ONLY) + private Double p90; + + /** + * The 95th percentile value for the metric. + */ + @JsonProperty(value = "P95", access = JsonProperty.Access.WRITE_ONLY) + private Double p95; + + /** + * The 99th percentile value for the metric. + */ + @JsonProperty(value = "P99", access = JsonProperty.Access.WRITE_ONLY) + private Double p99; + + /** + * Get the 10th percentile value for the metric. + * + * @return the p10 value + */ + public Double p10() { + return this.p10; + } + + /** + * Get the 25th percentile value for the metric. + * + * @return the p25 value + */ + public Double p25() { + return this.p25; + } + + /** + * Get the 50th percentile value for the metric. + * + * @return the p50 value + */ + public Double p50() { + return this.p50; + } + + /** + * Get the 75th percentile value for the metric. + * + * @return the p75 value + */ + public Double p75() { + return this.p75; + } + + /** + * Get the 90th percentile value for the metric. + * + * @return the p90 value + */ + public Double p90() { + return this.p90; + } + + /** + * Get the 95th percentile value for the metric. + * + * @return the p95 value + */ + public Double p95() { + return this.p95; + } + + /** + * Get the 99th percentile value for the metric. + * + * @return the p99 value + */ + public Double p99() { + return this.p99; + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/PercentileSourceTargets.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/PercentileSourceTargets.java new file mode 100644 index 000000000000..24d1df657039 --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/PercentileSourceTargets.java @@ -0,0 +1,32 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.cosmosdb.v2015_04_08; + +import rx.Observable; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation.PercentileSourceTargetsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing PercentileSourceTargets. + */ +public interface PercentileSourceTargets extends HasInner { + /** + * Retrieves the metrics determined by the given filter for the given account, source and target region. This url is only for PBS and Replication Latency data. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param sourceRegion Source region from which data is written. Cosmos DB region, with spaces between words and each word capitalized. + * @param targetRegion Target region to which data is written. Cosmos DB region, with spaces between words and each word capitalized. + * @param filter An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listMetricsAsync(String resourceGroupName, String accountName, String sourceRegion, String targetRegion, String filter); + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/PercentileTargets.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/PercentileTargets.java new file mode 100644 index 000000000000..937afbde388a --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/PercentileTargets.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.cosmosdb.v2015_04_08; + +import rx.Observable; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation.PercentileTargetsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing PercentileTargets. + */ +public interface PercentileTargets extends HasInner { + /** + * Retrieves the metrics determined by the given filter for the given account target region. This url is only for PBS and Replication Latency data. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param targetRegion Target region to which data is written. Cosmos DB region, with spaces between words and each word capitalized. + * @param filter An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listMetricsAsync(String resourceGroupName, String accountName, String targetRegion, String filter); + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/Percentiles.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/Percentiles.java new file mode 100644 index 000000000000..304dbeb5326d --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/Percentiles.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.cosmosdb.v2015_04_08; + +import rx.Observable; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation.PercentilesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Percentiles. + */ +public interface Percentiles extends HasInner { + /** + * Retrieves the metrics determined by the given filter for the given database account. This url is only for PBS and Replication Latency data. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param filter An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listMetricsAsync(String resourceGroupName, String accountName, String filter); + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/PrimaryAggregationType.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/PrimaryAggregationType.java new file mode 100644 index 000000000000..86f2e8b13bd2 --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/PrimaryAggregationType.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.cosmosdb.v2015_04_08; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for PrimaryAggregationType. + */ +public final class PrimaryAggregationType extends ExpandableStringEnum { + /** Static value None for PrimaryAggregationType. */ + public static final PrimaryAggregationType NONE = fromString("None"); + + /** Static value Average for PrimaryAggregationType. */ + public static final PrimaryAggregationType AVERAGE = fromString("Average"); + + /** Static value Total for PrimaryAggregationType. */ + public static final PrimaryAggregationType TOTAL = fromString("Total"); + + /** Static value Minimum for PrimaryAggregationType. */ + public static final PrimaryAggregationType MINIMUM = fromString("Minimum"); + + /** Static value Maximum for PrimaryAggregationType. */ + public static final PrimaryAggregationType MAXIMUM = fromString("Maximum"); + + /** Static value Last for PrimaryAggregationType. */ + public static final PrimaryAggregationType LAST = fromString("Last"); + + /** + * Creates or finds a PrimaryAggregationType from its string representation. + * @param name a name to look for + * @return the corresponding PrimaryAggregationType + */ + @JsonCreator + public static PrimaryAggregationType fromString(String name) { + return fromString(name, PrimaryAggregationType.class); + } + + /** + * @return known PrimaryAggregationType values + */ + public static Collection values() { + return values(PrimaryAggregationType.class); + } +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/RegionForOnlineOffline.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/RegionForOnlineOffline.java new file mode 100644 index 000000000000..ddb51ddb6a8e --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/RegionForOnlineOffline.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.cosmosdb.v2015_04_08; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Cosmos DB region to online or offline. + */ +public class RegionForOnlineOffline { + /** + * Cosmos DB region, with spaces between words and each word capitalized. + */ + @JsonProperty(value = "region", required = true) + private String region; + + /** + * Get cosmos DB region, with spaces between words and each word capitalized. + * + * @return the region value + */ + public String region() { + return this.region; + } + + /** + * Set cosmos DB region, with spaces between words and each word capitalized. + * + * @param region the region value to set + * @return the RegionForOnlineOffline object itself. + */ + public RegionForOnlineOffline withRegion(String region) { + this.region = region; + return this; + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/SqlContainer.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/SqlContainer.java new file mode 100644 index 000000000000..8aa6050c80c1 --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/SqlContainer.java @@ -0,0 +1,169 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.cosmosdb.v2015_04_08; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation.SqlContainerInner; +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.cosmosdb.v2015_04_08.implementation.CosmosDBManager; +import java.util.Map; + +/** + * Type representing SqlContainer. + */ +public interface SqlContainer extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the _etag value. + */ + String _etag(); + + /** + * @return the _rid value. + */ + String _rid(); + + /** + * @return the _ts value. + */ + Object _ts(); + + /** + * @return the conflictResolutionPolicy value. + */ + ConflictResolutionPolicy conflictResolutionPolicy(); + + /** + * @return the defaultTtl value. + */ + Integer defaultTtl(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the indexingPolicy value. + */ + IndexingPolicy indexingPolicy(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the partitionKey value. + */ + ContainerPartitionKey partitionKey(); + + /** + * @return the sqlContainerId value. + */ + String sqlContainerId(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + + /** + * @return the uniqueKeyPolicy value. + */ + UniqueKeyPolicy uniqueKeyPolicy(); + + /** + * The entirety of the SqlContainer definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithDatabasis, DefinitionStages.WithOptions, DefinitionStages.WithResource, DefinitionStages.WithCreate { + } + + /** + * Grouping of SqlContainer definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a SqlContainer definition. + */ + interface Blank extends WithDatabasis { + } + + /** + * The stage of the sqlcontainer definition allowing to specify Databasis. + */ + interface WithDatabasis { + /** + * Specifies resourceGroupName, accountName, databaseName. + * @param resourceGroupName Name of an Azure resource group + * @param accountName Cosmos DB database account name + * @param databaseName Cosmos DB database name + * @return the next definition stage + */ + WithOptions withExistingDatabasis(String resourceGroupName, String accountName, String databaseName); + } + + /** + * The stage of the sqlcontainer definition allowing to specify Options. + */ + interface WithOptions { + /** + * Specifies options. + * @param options A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request + * @return the next definition stage + */ + WithResource withOptions(Map options); + } + + /** + * The stage of the sqlcontainer definition allowing to specify Resource. + */ + interface WithResource { + /** + * Specifies resource. + * @param resource The standard JSON format of a container + * @return the next definition stage + */ + WithCreate withResource(SqlContainerResource resource); + } + + /** + * 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 SqlContainer update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable { + } + + /** + * Grouping of SqlContainer update stages. + */ + interface UpdateStages { + } +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/SqlContainerCreateUpdateParameters.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/SqlContainerCreateUpdateParameters.java new file mode 100644 index 000000000000..de221fb26b77 --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/SqlContainerCreateUpdateParameters.java @@ -0,0 +1,73 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.cosmosdb.v2015_04_08; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Parameters to create and update Cosmos DB container. + */ +@JsonFlatten +public class SqlContainerCreateUpdateParameters { + /** + * The standard JSON format of a container. + */ + @JsonProperty(value = "properties.resource", required = true) + private SqlContainerResource resource; + + /** + * A key-value pair of options to be applied for the request. This + * corresponds to the headers sent with the request. + */ + @JsonProperty(value = "properties.options", required = true) + private Map options; + + /** + * Get the standard JSON format of a container. + * + * @return the resource value + */ + public SqlContainerResource resource() { + return this.resource; + } + + /** + * Set the standard JSON format of a container. + * + * @param resource the resource value to set + * @return the SqlContainerCreateUpdateParameters object itself. + */ + public SqlContainerCreateUpdateParameters withResource(SqlContainerResource resource) { + this.resource = resource; + return this; + } + + /** + * Get a key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. + * + * @return the options value + */ + public Map options() { + return this.options; + } + + /** + * Set a key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. + * + * @param options the options value to set + * @return the SqlContainerCreateUpdateParameters object itself. + */ + public SqlContainerCreateUpdateParameters withOptions(Map options) { + this.options = options; + return this; + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/SqlContainerResource.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/SqlContainerResource.java new file mode 100644 index 000000000000..b2f37621d9af --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/SqlContainerResource.java @@ -0,0 +1,177 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.cosmosdb.v2015_04_08; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Cosmos DB SQL container resource object. + */ +public class SqlContainerResource { + /** + * Name of the Cosmos DB SQL container. + */ + @JsonProperty(value = "id", required = true) + private String id; + + /** + * The configuration of the indexing policy. By default, the indexing is + * automatic for all document paths within the container. + */ + @JsonProperty(value = "indexingPolicy") + private IndexingPolicy indexingPolicy; + + /** + * The configuration of the partition key to be used for partitioning data + * into multiple partitions. + */ + @JsonProperty(value = "partitionKey") + private ContainerPartitionKey partitionKey; + + /** + * Default time to live. + */ + @JsonProperty(value = "defaultTtl") + private Integer defaultTtl; + + /** + * The unique key policy configuration for specifying uniqueness + * constraints on documents in the collection in the Azure Cosmos DB + * service. + */ + @JsonProperty(value = "uniqueKeyPolicy") + private UniqueKeyPolicy uniqueKeyPolicy; + + /** + * The conflict resolution policy for the container. + */ + @JsonProperty(value = "conflictResolutionPolicy") + private ConflictResolutionPolicy conflictResolutionPolicy; + + /** + * Get name of the Cosmos DB SQL container. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set name of the Cosmos DB SQL container. + * + * @param id the id value to set + * @return the SqlContainerResource object itself. + */ + public SqlContainerResource withId(String id) { + this.id = id; + return this; + } + + /** + * Get the configuration of the indexing policy. By default, the indexing is automatic for all document paths within the container. + * + * @return the indexingPolicy value + */ + public IndexingPolicy indexingPolicy() { + return this.indexingPolicy; + } + + /** + * Set the configuration of the indexing policy. By default, the indexing is automatic for all document paths within the container. + * + * @param indexingPolicy the indexingPolicy value to set + * @return the SqlContainerResource object itself. + */ + public SqlContainerResource withIndexingPolicy(IndexingPolicy indexingPolicy) { + this.indexingPolicy = indexingPolicy; + return this; + } + + /** + * Get the configuration of the partition key to be used for partitioning data into multiple partitions. + * + * @return the partitionKey value + */ + public ContainerPartitionKey partitionKey() { + return this.partitionKey; + } + + /** + * Set the configuration of the partition key to be used for partitioning data into multiple partitions. + * + * @param partitionKey the partitionKey value to set + * @return the SqlContainerResource object itself. + */ + public SqlContainerResource withPartitionKey(ContainerPartitionKey partitionKey) { + this.partitionKey = partitionKey; + return this; + } + + /** + * Get default time to live. + * + * @return the defaultTtl value + */ + public Integer defaultTtl() { + return this.defaultTtl; + } + + /** + * Set default time to live. + * + * @param defaultTtl the defaultTtl value to set + * @return the SqlContainerResource object itself. + */ + public SqlContainerResource withDefaultTtl(Integer defaultTtl) { + this.defaultTtl = defaultTtl; + return this; + } + + /** + * Get the unique key policy configuration for specifying uniqueness constraints on documents in the collection in the Azure Cosmos DB service. + * + * @return the uniqueKeyPolicy value + */ + public UniqueKeyPolicy uniqueKeyPolicy() { + return this.uniqueKeyPolicy; + } + + /** + * Set the unique key policy configuration for specifying uniqueness constraints on documents in the collection in the Azure Cosmos DB service. + * + * @param uniqueKeyPolicy the uniqueKeyPolicy value to set + * @return the SqlContainerResource object itself. + */ + public SqlContainerResource withUniqueKeyPolicy(UniqueKeyPolicy uniqueKeyPolicy) { + this.uniqueKeyPolicy = uniqueKeyPolicy; + return this; + } + + /** + * Get the conflict resolution policy for the container. + * + * @return the conflictResolutionPolicy value + */ + public ConflictResolutionPolicy conflictResolutionPolicy() { + return this.conflictResolutionPolicy; + } + + /** + * Set the conflict resolution policy for the container. + * + * @param conflictResolutionPolicy the conflictResolutionPolicy value to set + * @return the SqlContainerResource object itself. + */ + public SqlContainerResource withConflictResolutionPolicy(ConflictResolutionPolicy conflictResolutionPolicy) { + this.conflictResolutionPolicy = conflictResolutionPolicy; + return this; + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/SqlDatabase.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/SqlDatabase.java new file mode 100644 index 000000000000..d397725febaa --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/SqlDatabase.java @@ -0,0 +1,152 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.cosmosdb.v2015_04_08; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation.SqlDatabaseInner; +import com.microsoft.azure.arm.model.Indexable; +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.cosmosdb.v2015_04_08.implementation.CosmosDBManager; +import java.util.Map; + +/** + * Type representing SqlDatabase. + */ +public interface SqlDatabase extends HasInner, Indexable, Updatable, HasManager { + /** + * @return the _colls value. + */ + String _colls(); + + /** + * @return the _etag value. + */ + String _etag(); + + /** + * @return the _rid value. + */ + String _rid(); + + /** + * @return the _ts value. + */ + Object _ts(); + + /** + * @return the _users value. + */ + String _users(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the sqlDatabaseId value. + */ + String sqlDatabaseId(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the SqlDatabase definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithApi, DefinitionStages.WithOptions, DefinitionStages.WithResource, DefinitionStages.WithCreate { + } + + /** + * Grouping of SqlDatabase definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a SqlDatabase definition. + */ + interface Blank extends WithApi { + } + + /** + * The stage of the sqldatabase definition allowing to specify Api. + */ + interface WithApi { + /** + * Specifies resourceGroupName, accountName. + * @param resourceGroupName Name of an Azure resource group + * @param accountName Cosmos DB database account name + * @return the next definition stage + */ + WithOptions withExistingApi(String resourceGroupName, String accountName); + } + + /** + * The stage of the sqldatabase definition allowing to specify Options. + */ + interface WithOptions { + /** + * Specifies options. + * @param options A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request + * @return the next definition stage + */ + WithResource withOptions(Map options); + } + + /** + * The stage of the sqldatabase definition allowing to specify Resource. + */ + interface WithResource { + /** + * Specifies resource. + * @param resource The standard JSON format of a SQL database + * @return the next definition stage + */ + WithCreate withResource(SqlDatabaseResource resource); + } + + /** + * 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 SqlDatabase update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable { + } + + /** + * Grouping of SqlDatabase update stages. + */ + interface UpdateStages { + } +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/SqlDatabaseCreateUpdateParameters.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/SqlDatabaseCreateUpdateParameters.java new file mode 100644 index 000000000000..7506ffb9f927 --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/SqlDatabaseCreateUpdateParameters.java @@ -0,0 +1,73 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.cosmosdb.v2015_04_08; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Parameters to create and update Cosmos DB SQL database. + */ +@JsonFlatten +public class SqlDatabaseCreateUpdateParameters { + /** + * The standard JSON format of a SQL database. + */ + @JsonProperty(value = "properties.resource", required = true) + private SqlDatabaseResource resource; + + /** + * A key-value pair of options to be applied for the request. This + * corresponds to the headers sent with the request. + */ + @JsonProperty(value = "properties.options", required = true) + private Map options; + + /** + * Get the standard JSON format of a SQL database. + * + * @return the resource value + */ + public SqlDatabaseResource resource() { + return this.resource; + } + + /** + * Set the standard JSON format of a SQL database. + * + * @param resource the resource value to set + * @return the SqlDatabaseCreateUpdateParameters object itself. + */ + public SqlDatabaseCreateUpdateParameters withResource(SqlDatabaseResource resource) { + this.resource = resource; + return this; + } + + /** + * Get a key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. + * + * @return the options value + */ + public Map options() { + return this.options; + } + + /** + * Set a key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. + * + * @param options the options value to set + * @return the SqlDatabaseCreateUpdateParameters object itself. + */ + public SqlDatabaseCreateUpdateParameters withOptions(Map options) { + this.options = options; + return this; + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/SqlDatabaseResource.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/SqlDatabaseResource.java new file mode 100644 index 000000000000..9608b2492320 --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/SqlDatabaseResource.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.cosmosdb.v2015_04_08; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Cosmos DB SQL database id object. + */ +public class SqlDatabaseResource { + /** + * Name of the Cosmos DB SQL database. + */ + @JsonProperty(value = "id", required = true) + private String id; + + /** + * Get name of the Cosmos DB SQL database. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set name of the Cosmos DB SQL database. + * + * @param id the id value to set + * @return the SqlDatabaseResource object itself. + */ + public SqlDatabaseResource withId(String id) { + this.id = id; + return this; + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/Table.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/Table.java new file mode 100644 index 000000000000..cf4de7502793 --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/Table.java @@ -0,0 +1,127 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.cosmosdb.v2015_04_08; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation.TableInner; +import com.microsoft.azure.arm.model.Indexable; +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.cosmosdb.v2015_04_08.implementation.CosmosDBManager; +import java.util.Map; + +/** + * Type representing Table. + */ +public interface Table extends HasInner, Indexable, Updatable, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the tableId value. + */ + String tableId(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the Table definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithApi, DefinitionStages.WithOptions, DefinitionStages.WithResource, DefinitionStages.WithCreate { + } + + /** + * Grouping of Table definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a Table definition. + */ + interface Blank extends WithApi { + } + + /** + * The stage of the table definition allowing to specify Api. + */ + interface WithApi { + /** + * Specifies resourceGroupName, accountName. + * @param resourceGroupName Name of an Azure resource group + * @param accountName Cosmos DB database account name + * @return the next definition stage + */ + WithOptions withExistingApi(String resourceGroupName, String accountName); + } + + /** + * The stage of the table definition allowing to specify Options. + */ + interface WithOptions { + /** + * Specifies options. + * @param options A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request + * @return the next definition stage + */ + WithResource withOptions(Map options); + } + + /** + * The stage of the table definition allowing to specify Resource. + */ + interface WithResource { + /** + * Specifies resource. + * @param resource The standard JSON format of a Table + * @return the next definition stage + */ + WithCreate withResource(TableResource resource); + } + + /** + * 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 Table update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable
{ + } + + /** + * Grouping of Table update stages. + */ + interface UpdateStages { + } +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/TableCreateUpdateParameters.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/TableCreateUpdateParameters.java new file mode 100644 index 000000000000..0b58765ed7e5 --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/TableCreateUpdateParameters.java @@ -0,0 +1,73 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.cosmosdb.v2015_04_08; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Parameters to create and update Cosmos DB Table. + */ +@JsonFlatten +public class TableCreateUpdateParameters { + /** + * The standard JSON format of a Table. + */ + @JsonProperty(value = "properties.resource", required = true) + private TableResource resource; + + /** + * A key-value pair of options to be applied for the request. This + * corresponds to the headers sent with the request. + */ + @JsonProperty(value = "properties.options", required = true) + private Map options; + + /** + * Get the standard JSON format of a Table. + * + * @return the resource value + */ + public TableResource resource() { + return this.resource; + } + + /** + * Set the standard JSON format of a Table. + * + * @param resource the resource value to set + * @return the TableCreateUpdateParameters object itself. + */ + public TableCreateUpdateParameters withResource(TableResource resource) { + this.resource = resource; + return this; + } + + /** + * Get a key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. + * + * @return the options value + */ + public Map options() { + return this.options; + } + + /** + * Set a key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. + * + * @param options the options value to set + * @return the TableCreateUpdateParameters object itself. + */ + public TableCreateUpdateParameters withOptions(Map options) { + this.options = options; + return this; + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/TableResource.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/TableResource.java new file mode 100644 index 000000000000..f3b170475738 --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/TableResource.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.cosmosdb.v2015_04_08; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Cosmos DB table id object. + */ +public class TableResource { + /** + * Name of the Cosmos DB table. + */ + @JsonProperty(value = "id", required = true) + private String id; + + /** + * Get name of the Cosmos DB table. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set name of the Cosmos DB table. + * + * @param id the id value to set + * @return the TableResource object itself. + */ + public TableResource withId(String id) { + this.id = id; + return this; + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/Throughput.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/Throughput.java new file mode 100644 index 000000000000..78afc4bcd0de --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/Throughput.java @@ -0,0 +1,51 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.cosmosdb.v2015_04_08; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation.CosmosDBManager; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation.ThroughputInner; +import java.util.Map; + +/** + * Type representing Throughput. + */ +public interface Throughput extends HasInner, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the throughput value. + */ + int throughput(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/ThroughputResource.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/ThroughputResource.java new file mode 100644 index 000000000000..caa6dc9341e8 --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/ThroughputResource.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.cosmosdb.v2015_04_08; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Cosmos DB resource throughput object. + */ +public class ThroughputResource { + /** + * Value of the Cosmos DB resource throughput. + */ + @JsonProperty(value = "throughput", required = true) + private int throughput; + + /** + * Get value of the Cosmos DB resource throughput. + * + * @return the throughput value + */ + public int throughput() { + return this.throughput; + } + + /** + * Set value of the Cosmos DB resource throughput. + * + * @param throughput the throughput value to set + * @return the ThroughputResource object itself. + */ + public ThroughputResource withThroughput(int throughput) { + this.throughput = throughput; + return this; + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/ThroughputUpdateParameters.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/ThroughputUpdateParameters.java new file mode 100644 index 000000000000..f99ee8a7f86c --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/ThroughputUpdateParameters.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.cosmosdb.v2015_04_08; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Parameters to update Cosmos DB resource throughput. + */ +@JsonFlatten +public class ThroughputUpdateParameters { + /** + * The standard JSON format of a resource throughput. + */ + @JsonProperty(value = "properties.resource", required = true) + private ThroughputResource resource; + + /** + * Get the standard JSON format of a resource throughput. + * + * @return the resource value + */ + public ThroughputResource resource() { + return this.resource; + } + + /** + * Set the standard JSON format of a resource throughput. + * + * @param resource the resource value to set + * @return the ThroughputUpdateParameters object itself. + */ + public ThroughputUpdateParameters withResource(ThroughputResource resource) { + this.resource = resource; + return this; + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/UniqueKey.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/UniqueKey.java new file mode 100644 index 000000000000..c72daed99369 --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/UniqueKey.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.cosmosdb.v2015_04_08; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The unique key on that enforces uniqueness constraint on documents in the + * collection in the Azure Cosmos DB service. + */ +public class UniqueKey { + /** + * List of paths must be unique for each document in the Azure Cosmos DB + * service. + */ + @JsonProperty(value = "paths") + private List paths; + + /** + * Get list of paths must be unique for each document in the Azure Cosmos DB service. + * + * @return the paths value + */ + public List paths() { + return this.paths; + } + + /** + * Set list of paths must be unique for each document in the Azure Cosmos DB service. + * + * @param paths the paths value to set + * @return the UniqueKey object itself. + */ + public UniqueKey withPaths(List paths) { + this.paths = paths; + return this; + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/UniqueKeyPolicy.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/UniqueKeyPolicy.java new file mode 100644 index 000000000000..1bfd818277ce --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/UniqueKeyPolicy.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.cosmosdb.v2015_04_08; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The unique key policy configuration for specifying uniqueness constraints on + * documents in the collection in the Azure Cosmos DB service. + */ +public class UniqueKeyPolicy { + /** + * List of unique keys on that enforces uniqueness constraint on documents + * in the collection in the Azure Cosmos DB service. + */ + @JsonProperty(value = "uniqueKeys") + private List uniqueKeys; + + /** + * Get list of unique keys on that enforces uniqueness constraint on documents in the collection in the Azure Cosmos DB service. + * + * @return the uniqueKeys value + */ + public List uniqueKeys() { + return this.uniqueKeys; + } + + /** + * Set list of unique keys on that enforces uniqueness constraint on documents in the collection in the Azure Cosmos DB service. + * + * @param uniqueKeys the uniqueKeys value to set + * @return the UniqueKeyPolicy object itself. + */ + public UniqueKeyPolicy withUniqueKeys(List uniqueKeys) { + this.uniqueKeys = uniqueKeys; + return this; + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/UnitType.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/UnitType.java new file mode 100644 index 000000000000..0faa53e2b000 --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/UnitType.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.cosmosdb.v2015_04_08; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for UnitType. + */ +public final class UnitType extends ExpandableStringEnum { + /** Static value Count for UnitType. */ + public static final UnitType COUNT = fromString("Count"); + + /** Static value Bytes for UnitType. */ + public static final UnitType BYTES = fromString("Bytes"); + + /** Static value Seconds for UnitType. */ + public static final UnitType SECONDS = fromString("Seconds"); + + /** Static value Percent for UnitType. */ + public static final UnitType PERCENT = fromString("Percent"); + + /** Static value CountPerSecond for UnitType. */ + public static final UnitType COUNT_PER_SECOND = fromString("CountPerSecond"); + + /** Static value BytesPerSecond for UnitType. */ + public static final UnitType BYTES_PER_SECOND = fromString("BytesPerSecond"); + + /** Static value Milliseconds for UnitType. */ + public static final UnitType MILLISECONDS = fromString("Milliseconds"); + + /** + * Creates or finds a UnitType from its string representation. + * @param name a name to look for + * @return the corresponding UnitType + */ + @JsonCreator + public static UnitType fromString(String name) { + return fromString(name, UnitType.class); + } + + /** + * @return known UnitType values + */ + public static Collection values() { + return values(UnitType.class); + } +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/VirtualNetworkRule.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/VirtualNetworkRule.java new file mode 100644 index 000000000000..ff9af2f8c263 --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/VirtualNetworkRule.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.cosmosdb.v2015_04_08; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Virtual Network ACL Rule object. + */ +public class VirtualNetworkRule { + /** + * Resource ID of a subnet, for example: + * /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Create firewall rule before the virtual network has vnet service + * endpoint enabled. + */ + @JsonProperty(value = "ignoreMissingVNetServiceEndpoint") + private Boolean ignoreMissingVNetServiceEndpoint; + + /** + * Get resource ID of a subnet, for example: /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource ID of a subnet, for example: /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. + * + * @param id the id value to set + * @return the VirtualNetworkRule object itself. + */ + public VirtualNetworkRule withId(String id) { + this.id = id; + return this; + } + + /** + * Get create firewall rule before the virtual network has vnet service endpoint enabled. + * + * @return the ignoreMissingVNetServiceEndpoint value + */ + public Boolean ignoreMissingVNetServiceEndpoint() { + return this.ignoreMissingVNetServiceEndpoint; + } + + /** + * Set create firewall rule before the virtual network has vnet service endpoint enabled. + * + * @param ignoreMissingVNetServiceEndpoint the ignoreMissingVNetServiceEndpoint value to set + * @return the VirtualNetworkRule object itself. + */ + public VirtualNetworkRule withIgnoreMissingVNetServiceEndpoint(Boolean ignoreMissingVNetServiceEndpoint) { + this.ignoreMissingVNetServiceEndpoint = ignoreMissingVNetServiceEndpoint; + return this; + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/CassandraKeyspaceImpl.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/CassandraKeyspaceImpl.java new file mode 100644 index 000000000000..f4d1d9eea295 --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/CassandraKeyspaceImpl.java @@ -0,0 +1,145 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation; + +import com.microsoft.azure.management.cosmosdb.v2015_04_08.CassandraKeyspace; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.CassandraKeyspaceCreateUpdateParameters; +import java.util.Map; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.CassandraKeyspaceResource; +import rx.functions.Func1; + +class CassandraKeyspaceImpl extends CreatableUpdatableImpl implements CassandraKeyspace, CassandraKeyspace.Definition, CassandraKeyspace.Update { + private final CosmosDBManager manager; + private String resourceGroupName; + private String accountName; + private String keyspaceName; + private CassandraKeyspaceCreateUpdateParameters createOrUpdateParameter; + + CassandraKeyspaceImpl(String name, CosmosDBManager manager) { + super(name, new CassandraKeyspaceInner()); + this.manager = manager; + // Set resource name + this.keyspaceName = name; + // + this.createOrUpdateParameter = new CassandraKeyspaceCreateUpdateParameters(); + } + + CassandraKeyspaceImpl(CassandraKeyspaceInner inner, CosmosDBManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.keyspaceName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.accountName = IdParsingUtils.getValueFromIdByName(inner.id(), "databaseAccounts"); + this.keyspaceName = IdParsingUtils.getValueFromIdByName(inner.id(), "keyspaces"); + // + this.createOrUpdateParameter = new CassandraKeyspaceCreateUpdateParameters(); + } + + @Override + public CosmosDBManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + DatabaseAccountsInner client = this.manager().inner().databaseAccounts(); + return client.createUpdateCassandraKeyspaceAsync(this.resourceGroupName, this.accountName, this.keyspaceName, this.createOrUpdateParameter) + .map(new Func1() { + @Override + public CassandraKeyspaceInner call(CassandraKeyspaceInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + DatabaseAccountsInner client = this.manager().inner().databaseAccounts(); + return client.createUpdateCassandraKeyspaceAsync(this.resourceGroupName, this.accountName, this.keyspaceName, this.createOrUpdateParameter) + .map(new Func1() { + @Override + public CassandraKeyspaceInner call(CassandraKeyspaceInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + DatabaseAccountsInner client = this.manager().inner().databaseAccounts(); + return null; // NOP getInnerAsync implementation as get is not supported + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.createOrUpdateParameter = new CassandraKeyspaceCreateUpdateParameters(); + } + + @Override + public String cassandraKeyspaceId() { + return this.inner().cassandraKeyspaceId(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public CassandraKeyspaceImpl withExistingApi(String resourceGroupName, String accountName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + return this; + } + + @Override + public CassandraKeyspaceImpl withOptions(Map options) { + this.createOrUpdateParameter.withOptions(options); + return this; + } + + @Override + public CassandraKeyspaceImpl withResource(CassandraKeyspaceResource resource) { + this.createOrUpdateParameter.withResource(resource); + return this; + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/CassandraKeyspaceInner.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/CassandraKeyspaceInner.java new file mode 100644 index 000000000000..64caae7529ea --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/CassandraKeyspaceInner.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.cosmosdb.v2015_04_08.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * An Azure Cosmos DB Cassandra keyspace. + */ +@JsonFlatten +@SkipParentValidation +public class CassandraKeyspaceInner extends Resource { + /** + * Name of the Cosmos DB Cassandra keyspace. + */ + @JsonProperty(value = "properties.id", required = true) + private String cassandraKeyspaceId; + + /** + * Get name of the Cosmos DB Cassandra keyspace. + * + * @return the cassandraKeyspaceId value + */ + public String cassandraKeyspaceId() { + return this.cassandraKeyspaceId; + } + + /** + * Set name of the Cosmos DB Cassandra keyspace. + * + * @param cassandraKeyspaceId the cassandraKeyspaceId value to set + * @return the CassandraKeyspaceInner object itself. + */ + public CassandraKeyspaceInner withCassandraKeyspaceId(String cassandraKeyspaceId) { + this.cassandraKeyspaceId = cassandraKeyspaceId; + return this; + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/CassandraTableImpl.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/CassandraTableImpl.java new file mode 100644 index 000000000000..ffca343b0776 --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/CassandraTableImpl.java @@ -0,0 +1,68 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation; + +import com.microsoft.azure.management.cosmosdb.v2015_04_08.CassandraTable; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.CassandraSchema; +import java.util.Map; + +class CassandraTableImpl extends WrapperImpl implements CassandraTable { + private final CosmosDBManager manager; + CassandraTableImpl(CassandraTableInner inner, CosmosDBManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public CosmosDBManager manager() { + return this.manager; + } + + @Override + public String cassandraTableId() { + return this.inner().cassandraTableId(); + } + + @Override + public Integer defaultTtl() { + return this.inner().defaultTtl(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public CassandraSchema schema() { + return this.inner().schema(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/CassandraTableInner.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/CassandraTableInner.java new file mode 100644 index 000000000000..d6ee6d4d7d3c --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/CassandraTableInner.java @@ -0,0 +1,101 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation; + +import com.microsoft.azure.management.cosmosdb.v2015_04_08.CassandraSchema; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * An Azure Cosmos DB Cassandra table. + */ +@JsonFlatten +@SkipParentValidation +public class CassandraTableInner extends Resource { + /** + * Name of the Cosmos DB Cassandra table. + */ + @JsonProperty(value = "properties.id", required = true) + private String cassandraTableId; + + /** + * Time to live of the Cosmos DB Cassandra table. + */ + @JsonProperty(value = "properties.defaultTtl") + private Integer defaultTtl; + + /** + * Schema of the Cosmos DB Cassandra table. + */ + @JsonProperty(value = "properties.schema") + private CassandraSchema schema; + + /** + * Get name of the Cosmos DB Cassandra table. + * + * @return the cassandraTableId value + */ + public String cassandraTableId() { + return this.cassandraTableId; + } + + /** + * Set name of the Cosmos DB Cassandra table. + * + * @param cassandraTableId the cassandraTableId value to set + * @return the CassandraTableInner object itself. + */ + public CassandraTableInner withCassandraTableId(String cassandraTableId) { + this.cassandraTableId = cassandraTableId; + return this; + } + + /** + * Get time to live of the Cosmos DB Cassandra table. + * + * @return the defaultTtl value + */ + public Integer defaultTtl() { + return this.defaultTtl; + } + + /** + * Set time to live of the Cosmos DB Cassandra table. + * + * @param defaultTtl the defaultTtl value to set + * @return the CassandraTableInner object itself. + */ + public CassandraTableInner withDefaultTtl(Integer defaultTtl) { + this.defaultTtl = defaultTtl; + return this; + } + + /** + * Get schema of the Cosmos DB Cassandra table. + * + * @return the schema value + */ + public CassandraSchema schema() { + return this.schema; + } + + /** + * Set schema of the Cosmos DB Cassandra table. + * + * @param schema the schema value to set + * @return the CassandraTableInner object itself. + */ + public CassandraTableInner withSchema(CassandraSchema schema) { + this.schema = schema; + return this; + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/CollectionDatabasisDatabaseAccountMetricDefinitionImpl.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/CollectionDatabasisDatabaseAccountMetricDefinitionImpl.java new file mode 100644 index 000000000000..02371675fc10 --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/CollectionDatabasisDatabaseAccountMetricDefinitionImpl.java @@ -0,0 +1,60 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation; + +import com.microsoft.azure.management.cosmosdb.v2015_04_08.CollectionDatabasisDatabaseAccountMetricDefinition; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.MetricAvailability; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.MetricName; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.PrimaryAggregationType; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.UnitType; + +class CollectionDatabasisDatabaseAccountMetricDefinitionImpl extends WrapperImpl implements CollectionDatabasisDatabaseAccountMetricDefinition { + private final CosmosDBManager manager; + + CollectionDatabasisDatabaseAccountMetricDefinitionImpl(MetricDefinitionInner inner, CosmosDBManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public CosmosDBManager manager() { + return this.manager; + } + + + + @Override + public List metricAvailabilities() { + return this.inner().metricAvailabilities(); + } + + @Override + public MetricName name() { + return this.inner().name(); + } + + @Override + public PrimaryAggregationType primaryAggregationType() { + return this.inner().primaryAggregationType(); + } + + @Override + public String resourceUri() { + return this.inner().resourceUri(); + } + + @Override + public UnitType unit() { + return this.inner().unit(); + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/CollectionDatabasisDatabaseAccountMetricImpl.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/CollectionDatabasisDatabaseAccountMetricImpl.java new file mode 100644 index 000000000000..7466fb10b2b5 --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/CollectionDatabasisDatabaseAccountMetricImpl.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.cosmosdb.v2015_04_08.implementation; + +import com.microsoft.azure.management.cosmosdb.v2015_04_08.CollectionDatabasisDatabaseAccountMetric; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; +import org.joda.time.DateTime; +import java.util.List; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.MetricValue; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.MetricName; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.UnitType; + +class CollectionDatabasisDatabaseAccountMetricImpl extends WrapperImpl implements CollectionDatabasisDatabaseAccountMetric { + private final CosmosDBManager manager; + + CollectionDatabasisDatabaseAccountMetricImpl(MetricInner inner, CosmosDBManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public CosmosDBManager manager() { + return this.manager; + } + + + + @Override + public DateTime endTime() { + return this.inner().endTime(); + } + + @Override + public List metricValues() { + return this.inner().metricValues(); + } + + @Override + public MetricName name() { + return this.inner().name(); + } + + @Override + public DateTime startTime() { + return this.inner().startTime(); + } + + @Override + public String timeGrain() { + return this.inner().timeGrain(); + } + + @Override + public UnitType unit() { + return this.inner().unit(); + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/CollectionDatabasisDatabaseAccountMetricModelImpl.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/CollectionDatabasisDatabaseAccountMetricModelImpl.java new file mode 100644 index 000000000000..5f815efff1d9 --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/CollectionDatabasisDatabaseAccountMetricModelImpl.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.cosmosdb.v2015_04_08.implementation; + +import com.microsoft.azure.management.cosmosdb.v2015_04_08.CollectionDatabasisDatabaseAccountMetricModel; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; +import org.joda.time.DateTime; +import java.util.List; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.MetricValue; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.MetricName; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.UnitType; + +class CollectionDatabasisDatabaseAccountMetricModelImpl extends WrapperImpl implements CollectionDatabasisDatabaseAccountMetricModel { + private final CosmosDBManager manager; + + CollectionDatabasisDatabaseAccountMetricModelImpl(MetricInner inner, CosmosDBManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public CosmosDBManager manager() { + return this.manager; + } + + + + @Override + public DateTime endTime() { + return this.inner().endTime(); + } + + @Override + public List metricValues() { + return this.inner().metricValues(); + } + + @Override + public MetricName name() { + return this.inner().name(); + } + + @Override + public DateTime startTime() { + return this.inner().startTime(); + } + + @Override + public String timeGrain() { + return this.inner().timeGrain(); + } + + @Override + public UnitType unit() { + return this.inner().unit(); + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/CollectionDatabasisDatabaseAccountUsageImpl.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/CollectionDatabasisDatabaseAccountUsageImpl.java new file mode 100644 index 000000000000..f731159c37be --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/CollectionDatabasisDatabaseAccountUsageImpl.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.cosmosdb.v2015_04_08.implementation; + +import com.microsoft.azure.management.cosmosdb.v2015_04_08.CollectionDatabasisDatabaseAccountUsage; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.MetricName; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.UnitType; + +class CollectionDatabasisDatabaseAccountUsageImpl extends WrapperImpl implements CollectionDatabasisDatabaseAccountUsage { + private final CosmosDBManager manager; + + CollectionDatabasisDatabaseAccountUsageImpl(UsageInner inner, CosmosDBManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public CosmosDBManager manager() { + return this.manager; + } + + + + @Override + public Long currentValue() { + return this.inner().currentValue(); + } + + @Override + public Long limit() { + return this.inner().limit(); + } + + @Override + public MetricName name() { + return this.inner().name(); + } + + @Override + public String quotaPeriod() { + return this.inner().quotaPeriod(); + } + + @Override + public UnitType unit() { + return this.inner().unit(); + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/CollectionPartitionRegionsImpl.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/CollectionPartitionRegionsImpl.java new file mode 100644 index 000000000000..6609614351ce --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/CollectionPartitionRegionsImpl.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.cosmosdb.v2015_04_08.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.CollectionPartitionRegions; +import rx.functions.Func1; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.PartitionMetric; + +class CollectionPartitionRegionsImpl extends WrapperImpl implements CollectionPartitionRegions { + private final CosmosDBManager manager; + + CollectionPartitionRegionsImpl(CosmosDBManager manager) { + super(manager.inner().collectionPartitionRegions()); + this.manager = manager; + } + + public CosmosDBManager manager() { + return this.manager; + } + + @Override + public Observable listMetricsAsync(String resourceGroupName, String accountName, String region, String databaseRid, String collectionRid, String filter) { + CollectionPartitionRegionsInner client = this.inner(); + return client.listMetricsAsync(resourceGroupName, accountName, region, databaseRid, collectionRid, filter) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public PartitionMetric call(PartitionMetricInner inner) { + return new PartitionMetricImpl(inner, manager()); + } + }); + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/CollectionPartitionRegionsInner.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/CollectionPartitionRegionsInner.java new file mode 100644 index 000000000000..2ee7249e37e5 --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/CollectionPartitionRegionsInner.java @@ -0,0 +1,180 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.cosmosdb.v2015_04_08.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 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.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in CollectionPartitionRegions. + */ +public class CollectionPartitionRegionsInner { + /** The Retrofit service to perform REST calls. */ + private CollectionPartitionRegionsService service; + /** The service client containing this operation class. */ + private CosmosDBManagementClientImpl client; + + /** + * Initializes an instance of CollectionPartitionRegionsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public CollectionPartitionRegionsInner(Retrofit retrofit, CosmosDBManagementClientImpl client) { + this.service = retrofit.create(CollectionPartitionRegionsService.class); + this.client = client; + } + + /** + * The interface defining all the services for CollectionPartitionRegions to be + * used by Retrofit to perform actually REST calls. + */ + interface CollectionPartitionRegionsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cosmosdb.v2015_04_08.CollectionPartitionRegions listMetrics" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/region/{region}/databases/{databaseRid}/collections/{collectionRid}/partitions/metrics") + Observable> listMetrics(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("region") String region, @Path("databaseRid") String databaseRid, @Path("collectionRid") String collectionRid, @Query("api-version") String apiVersion, @Query("$filter") String filter, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Retrieves the metrics determined by the given filter for the given collection and region, split by partition. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param region Cosmos DB region, with spaces between words and each word capitalized. + * @param databaseRid Cosmos DB database rid. + * @param collectionRid Cosmos DB collection rid. + * @param filter An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq. + * @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 List<PartitionMetricInner> object if successful. + */ + public List listMetrics(String resourceGroupName, String accountName, String region, String databaseRid, String collectionRid, String filter) { + return listMetricsWithServiceResponseAsync(resourceGroupName, accountName, region, databaseRid, collectionRid, filter).toBlocking().single().body(); + } + + /** + * Retrieves the metrics determined by the given filter for the given collection and region, split by partition. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param region Cosmos DB region, with spaces between words and each word capitalized. + * @param databaseRid Cosmos DB database rid. + * @param collectionRid Cosmos DB collection rid. + * @param filter An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq. + * @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> listMetricsAsync(String resourceGroupName, String accountName, String region, String databaseRid, String collectionRid, String filter, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listMetricsWithServiceResponseAsync(resourceGroupName, accountName, region, databaseRid, collectionRid, filter), serviceCallback); + } + + /** + * Retrieves the metrics determined by the given filter for the given collection and region, split by partition. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param region Cosmos DB region, with spaces between words and each word capitalized. + * @param databaseRid Cosmos DB database rid. + * @param collectionRid Cosmos DB collection rid. + * @param filter An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<PartitionMetricInner> object + */ + public Observable> listMetricsAsync(String resourceGroupName, String accountName, String region, String databaseRid, String collectionRid, String filter) { + return listMetricsWithServiceResponseAsync(resourceGroupName, accountName, region, databaseRid, collectionRid, filter).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Retrieves the metrics determined by the given filter for the given collection and region, split by partition. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param region Cosmos DB region, with spaces between words and each word capitalized. + * @param databaseRid Cosmos DB database rid. + * @param collectionRid Cosmos DB collection rid. + * @param filter An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<PartitionMetricInner> object + */ + public Observable>> listMetricsWithServiceResponseAsync(String resourceGroupName, String accountName, String region, String databaseRid, String collectionRid, String filter) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (region == null) { + throw new IllegalArgumentException("Parameter region is required and cannot be null."); + } + if (databaseRid == null) { + throw new IllegalArgumentException("Parameter databaseRid is required and cannot be null."); + } + if (collectionRid == null) { + throw new IllegalArgumentException("Parameter collectionRid 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 (filter == null) { + throw new IllegalArgumentException("Parameter filter is required and cannot be null."); + } + return service.listMetrics(this.client.subscriptionId(), resourceGroupName, accountName, region, databaseRid, collectionRid, this.client.apiVersion(), filter, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listMetricsDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listMetricsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/CollectionPartitionsImpl.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/CollectionPartitionsImpl.java new file mode 100644 index 000000000000..339fc60ee5b2 --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/CollectionPartitionsImpl.java @@ -0,0 +1,68 @@ +/** + * Copyright (c) Microsoft Corporation. All rights 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.cosmosdb.v2015_04_08.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.CollectionPartitions; +import rx.functions.Func1; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.PartitionMetric; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.PartitionUsage; + +class CollectionPartitionsImpl extends WrapperImpl implements CollectionPartitions { + private final CosmosDBManager manager; + + CollectionPartitionsImpl(CosmosDBManager manager) { + super(manager.inner().collectionPartitions()); + this.manager = manager; + } + + public CosmosDBManager manager() { + return this.manager; + } + + @Override + public Observable listMetricsAsync(String resourceGroupName, String accountName, String databaseRid, String collectionRid, String filter) { + CollectionPartitionsInner client = this.inner(); + return client.listMetricsAsync(resourceGroupName, accountName, databaseRid, collectionRid, filter) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public PartitionMetric call(PartitionMetricInner inner) { + return new PartitionMetricImpl(inner, manager()); + } + }); + } + + @Override + public Observable listUsagesAsync(String resourceGroupName, String accountName, String databaseRid, String collectionRid) { + CollectionPartitionsInner client = this.inner(); + return client.listUsagesAsync(resourceGroupName, accountName, databaseRid, collectionRid) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public PartitionUsage call(PartitionUsageInner inner) { + return new PartitionUsageImpl(inner, manager()); + } + }); + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/CollectionPartitionsInner.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/CollectionPartitionsInner.java new file mode 100644 index 000000000000..29a4e976a9c6 --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/CollectionPartitionsInner.java @@ -0,0 +1,385 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.cosmosdb.v2015_04_08.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 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.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in CollectionPartitions. + */ +public class CollectionPartitionsInner { + /** The Retrofit service to perform REST calls. */ + private CollectionPartitionsService service; + /** The service client containing this operation class. */ + private CosmosDBManagementClientImpl client; + + /** + * Initializes an instance of CollectionPartitionsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public CollectionPartitionsInner(Retrofit retrofit, CosmosDBManagementClientImpl client) { + this.service = retrofit.create(CollectionPartitionsService.class); + this.client = client; + } + + /** + * The interface defining all the services for CollectionPartitions to be + * used by Retrofit to perform actually REST calls. + */ + interface CollectionPartitionsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cosmosdb.v2015_04_08.CollectionPartitions listMetrics" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/partitions/metrics") + Observable> listMetrics(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("databaseRid") String databaseRid, @Path("collectionRid") String collectionRid, @Query("api-version") String apiVersion, @Query("$filter") String filter, @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.cosmosdb.v2015_04_08.CollectionPartitions listUsages" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/partitions/usages") + Observable> listUsages(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("databaseRid") String databaseRid, @Path("collectionRid") String collectionRid, @Query("api-version") String apiVersion, @Query("$filter") String filter, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Retrieves the metrics determined by the given filter for the given collection, split by partition. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseRid Cosmos DB database rid. + * @param collectionRid Cosmos DB collection rid. + * @param filter An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq. + * @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 List<PartitionMetricInner> object if successful. + */ + public List listMetrics(String resourceGroupName, String accountName, String databaseRid, String collectionRid, String filter) { + return listMetricsWithServiceResponseAsync(resourceGroupName, accountName, databaseRid, collectionRid, filter).toBlocking().single().body(); + } + + /** + * Retrieves the metrics determined by the given filter for the given collection, split by partition. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseRid Cosmos DB database rid. + * @param collectionRid Cosmos DB collection rid. + * @param filter An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq. + * @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> listMetricsAsync(String resourceGroupName, String accountName, String databaseRid, String collectionRid, String filter, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listMetricsWithServiceResponseAsync(resourceGroupName, accountName, databaseRid, collectionRid, filter), serviceCallback); + } + + /** + * Retrieves the metrics determined by the given filter for the given collection, split by partition. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseRid Cosmos DB database rid. + * @param collectionRid Cosmos DB collection rid. + * @param filter An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<PartitionMetricInner> object + */ + public Observable> listMetricsAsync(String resourceGroupName, String accountName, String databaseRid, String collectionRid, String filter) { + return listMetricsWithServiceResponseAsync(resourceGroupName, accountName, databaseRid, collectionRid, filter).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Retrieves the metrics determined by the given filter for the given collection, split by partition. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseRid Cosmos DB database rid. + * @param collectionRid Cosmos DB collection rid. + * @param filter An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<PartitionMetricInner> object + */ + public Observable>> listMetricsWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseRid, String collectionRid, String filter) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (databaseRid == null) { + throw new IllegalArgumentException("Parameter databaseRid is required and cannot be null."); + } + if (collectionRid == null) { + throw new IllegalArgumentException("Parameter collectionRid 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 (filter == null) { + throw new IllegalArgumentException("Parameter filter is required and cannot be null."); + } + return service.listMetrics(this.client.subscriptionId(), resourceGroupName, accountName, databaseRid, collectionRid, this.client.apiVersion(), filter, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listMetricsDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listMetricsDelegate(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 the usages (most recent storage data) for the given collection, split by partition. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseRid Cosmos DB database rid. + * @param collectionRid Cosmos DB collection rid. + * @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 List<PartitionUsageInner> object if successful. + */ + public List listUsages(String resourceGroupName, String accountName, String databaseRid, String collectionRid) { + return listUsagesWithServiceResponseAsync(resourceGroupName, accountName, databaseRid, collectionRid).toBlocking().single().body(); + } + + /** + * Retrieves the usages (most recent storage data) for the given collection, split by partition. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseRid Cosmos DB database rid. + * @param collectionRid Cosmos DB collection rid. + * @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> listUsagesAsync(String resourceGroupName, String accountName, String databaseRid, String collectionRid, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listUsagesWithServiceResponseAsync(resourceGroupName, accountName, databaseRid, collectionRid), serviceCallback); + } + + /** + * Retrieves the usages (most recent storage data) for the given collection, split by partition. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseRid Cosmos DB database rid. + * @param collectionRid Cosmos DB collection rid. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<PartitionUsageInner> object + */ + public Observable> listUsagesAsync(String resourceGroupName, String accountName, String databaseRid, String collectionRid) { + return listUsagesWithServiceResponseAsync(resourceGroupName, accountName, databaseRid, collectionRid).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Retrieves the usages (most recent storage data) for the given collection, split by partition. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseRid Cosmos DB database rid. + * @param collectionRid Cosmos DB collection rid. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<PartitionUsageInner> object + */ + public Observable>> listUsagesWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseRid, String collectionRid) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (databaseRid == null) { + throw new IllegalArgumentException("Parameter databaseRid is required and cannot be null."); + } + if (collectionRid == null) { + throw new IllegalArgumentException("Parameter collectionRid 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 filter = null; + return service.listUsages(this.client.subscriptionId(), resourceGroupName, accountName, databaseRid, collectionRid, this.client.apiVersion(), filter, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listUsagesDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Retrieves the usages (most recent storage data) for the given collection, split by partition. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseRid Cosmos DB database rid. + * @param collectionRid Cosmos DB collection rid. + * @param filter An OData filter expression that describes a subset of usages to return. The supported parameter is name.value (name of the metric, can have an or of multiple names). + * @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 List<PartitionUsageInner> object if successful. + */ + public List listUsages(String resourceGroupName, String accountName, String databaseRid, String collectionRid, String filter) { + return listUsagesWithServiceResponseAsync(resourceGroupName, accountName, databaseRid, collectionRid, filter).toBlocking().single().body(); + } + + /** + * Retrieves the usages (most recent storage data) for the given collection, split by partition. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseRid Cosmos DB database rid. + * @param collectionRid Cosmos DB collection rid. + * @param filter An OData filter expression that describes a subset of usages to return. The supported parameter is name.value (name of the metric, can have an or of multiple names). + * @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> listUsagesAsync(String resourceGroupName, String accountName, String databaseRid, String collectionRid, String filter, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listUsagesWithServiceResponseAsync(resourceGroupName, accountName, databaseRid, collectionRid, filter), serviceCallback); + } + + /** + * Retrieves the usages (most recent storage data) for the given collection, split by partition. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseRid Cosmos DB database rid. + * @param collectionRid Cosmos DB collection rid. + * @param filter An OData filter expression that describes a subset of usages to return. The supported parameter is name.value (name of the metric, can have an or of multiple names). + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<PartitionUsageInner> object + */ + public Observable> listUsagesAsync(String resourceGroupName, String accountName, String databaseRid, String collectionRid, String filter) { + return listUsagesWithServiceResponseAsync(resourceGroupName, accountName, databaseRid, collectionRid, filter).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Retrieves the usages (most recent storage data) for the given collection, split by partition. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseRid Cosmos DB database rid. + * @param collectionRid Cosmos DB collection rid. + * @param filter An OData filter expression that describes a subset of usages to return. The supported parameter is name.value (name of the metric, can have an or of multiple names). + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<PartitionUsageInner> object + */ + public Observable>> listUsagesWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseRid, String collectionRid, String filter) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (databaseRid == null) { + throw new IllegalArgumentException("Parameter databaseRid is required and cannot be null."); + } + if (collectionRid == null) { + throw new IllegalArgumentException("Parameter collectionRid 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.listUsages(this.client.subscriptionId(), resourceGroupName, accountName, databaseRid, collectionRid, this.client.apiVersion(), filter, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listUsagesDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listUsagesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/CollectionRegionsImpl.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/CollectionRegionsImpl.java new file mode 100644 index 000000000000..137254e531a3 --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/CollectionRegionsImpl.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. + * abc + */ + +package com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.CollectionRegions; +import rx.Observable; +import rx.functions.Func1; +import java.util.List; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.CollectionDatabasisDatabaseAccountMetricModel; + +class CollectionRegionsImpl extends WrapperImpl implements CollectionRegions { + private final CosmosDBManager manager; + + CollectionRegionsImpl(CosmosDBManager manager) { + super(manager.inner().collectionRegions()); + this.manager = manager; + } + + public CosmosDBManager manager() { + return this.manager; + } + + private CollectionDatabasisDatabaseAccountMetricModelImpl wrapCollectionDatabasisDatabaseAccountMetricModelModel(MetricInner inner) { + return new CollectionDatabasisDatabaseAccountMetricModelImpl(inner, manager()); + } + + @Override + public Observable listMetricsAsync(String resourceGroupName, String accountName, String region, String databaseRid, String collectionRid, String filter) { + CollectionRegionsInner client = this.inner(); + return client.listMetricsAsync(resourceGroupName, accountName, region, databaseRid, collectionRid, filter) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public CollectionDatabasisDatabaseAccountMetricModel call(MetricInner inner) { + return wrapCollectionDatabasisDatabaseAccountMetricModelModel(inner); + } + }); + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/CollectionRegionsInner.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/CollectionRegionsInner.java new file mode 100644 index 000000000000..71378a30029b --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/CollectionRegionsInner.java @@ -0,0 +1,180 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.cosmosdb.v2015_04_08.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 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.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in CollectionRegions. + */ +public class CollectionRegionsInner { + /** The Retrofit service to perform REST calls. */ + private CollectionRegionsService service; + /** The service client containing this operation class. */ + private CosmosDBManagementClientImpl client; + + /** + * Initializes an instance of CollectionRegionsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public CollectionRegionsInner(Retrofit retrofit, CosmosDBManagementClientImpl client) { + this.service = retrofit.create(CollectionRegionsService.class); + this.client = client; + } + + /** + * The interface defining all the services for CollectionRegions to be + * used by Retrofit to perform actually REST calls. + */ + interface CollectionRegionsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cosmosdb.v2015_04_08.CollectionRegions listMetrics" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/region/{region}/databases/{databaseRid}/collections/{collectionRid}/metrics") + Observable> listMetrics(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("region") String region, @Path("databaseRid") String databaseRid, @Path("collectionRid") String collectionRid, @Query("api-version") String apiVersion, @Query("$filter") String filter, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Retrieves the metrics determined by the given filter for the given database account, collection and region. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param region Cosmos DB region, with spaces between words and each word capitalized. + * @param databaseRid Cosmos DB database rid. + * @param collectionRid Cosmos DB collection rid. + * @param filter An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq. + * @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 List<MetricInner> object if successful. + */ + public List listMetrics(String resourceGroupName, String accountName, String region, String databaseRid, String collectionRid, String filter) { + return listMetricsWithServiceResponseAsync(resourceGroupName, accountName, region, databaseRid, collectionRid, filter).toBlocking().single().body(); + } + + /** + * Retrieves the metrics determined by the given filter for the given database account, collection and region. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param region Cosmos DB region, with spaces between words and each word capitalized. + * @param databaseRid Cosmos DB database rid. + * @param collectionRid Cosmos DB collection rid. + * @param filter An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq. + * @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> listMetricsAsync(String resourceGroupName, String accountName, String region, String databaseRid, String collectionRid, String filter, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listMetricsWithServiceResponseAsync(resourceGroupName, accountName, region, databaseRid, collectionRid, filter), serviceCallback); + } + + /** + * Retrieves the metrics determined by the given filter for the given database account, collection and region. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param region Cosmos DB region, with spaces between words and each word capitalized. + * @param databaseRid Cosmos DB database rid. + * @param collectionRid Cosmos DB collection rid. + * @param filter An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<MetricInner> object + */ + public Observable> listMetricsAsync(String resourceGroupName, String accountName, String region, String databaseRid, String collectionRid, String filter) { + return listMetricsWithServiceResponseAsync(resourceGroupName, accountName, region, databaseRid, collectionRid, filter).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Retrieves the metrics determined by the given filter for the given database account, collection and region. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param region Cosmos DB region, with spaces between words and each word capitalized. + * @param databaseRid Cosmos DB database rid. + * @param collectionRid Cosmos DB collection rid. + * @param filter An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<MetricInner> object + */ + public Observable>> listMetricsWithServiceResponseAsync(String resourceGroupName, String accountName, String region, String databaseRid, String collectionRid, String filter) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (region == null) { + throw new IllegalArgumentException("Parameter region is required and cannot be null."); + } + if (databaseRid == null) { + throw new IllegalArgumentException("Parameter databaseRid is required and cannot be null."); + } + if (collectionRid == null) { + throw new IllegalArgumentException("Parameter collectionRid 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 (filter == null) { + throw new IllegalArgumentException("Parameter filter is required and cannot be null."); + } + return service.listMetrics(this.client.subscriptionId(), resourceGroupName, accountName, region, databaseRid, collectionRid, this.client.apiVersion(), filter, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listMetricsDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listMetricsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/CollectionsImpl.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/CollectionsImpl.java new file mode 100644 index 000000000000..60accebd7f34 --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/CollectionsImpl.java @@ -0,0 +1,99 @@ +/** + * Copyright (c) Microsoft Corporation. All rights 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.cosmosdb.v2015_04_08.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.Collections; +import rx.Observable; +import rx.functions.Func1; +import java.util.List; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.CollectionDatabasisDatabaseAccountMetricDefinition; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.CollectionDatabasisDatabaseAccountMetric; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.CollectionDatabasisDatabaseAccountUsage; + +class CollectionsImpl extends WrapperImpl implements Collections { + private final CosmosDBManager manager; + + CollectionsImpl(CosmosDBManager manager) { + super(manager.inner().collections()); + this.manager = manager; + } + + public CosmosDBManager manager() { + return this.manager; + } + + private CollectionDatabasisDatabaseAccountMetricDefinitionImpl wrapCollectionDatabasisDatabaseAccountMetricDefinitionModel(MetricDefinitionInner inner) { + return new CollectionDatabasisDatabaseAccountMetricDefinitionImpl(inner, manager()); + } + + private CollectionDatabasisDatabaseAccountMetricImpl wrapCollectionDatabasisDatabaseAccountMetricModel(MetricInner inner) { + return new CollectionDatabasisDatabaseAccountMetricImpl(inner, manager()); + } + + private CollectionDatabasisDatabaseAccountUsageImpl wrapCollectionDatabasisDatabaseAccountUsageModel(UsageInner inner) { + return new CollectionDatabasisDatabaseAccountUsageImpl(inner, manager()); + } + + @Override + public Observable listMetricDefinitionsAsync(String resourceGroupName, String accountName, String databaseRid, String collectionRid) { + CollectionsInner client = this.inner(); + return client.listMetricDefinitionsAsync(resourceGroupName, accountName, databaseRid, collectionRid) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public CollectionDatabasisDatabaseAccountMetricDefinition call(MetricDefinitionInner inner) { + return wrapCollectionDatabasisDatabaseAccountMetricDefinitionModel(inner); + } + }); + } + + @Override + public Observable listMetricsAsync(String resourceGroupName, String accountName, String databaseRid, String collectionRid, String filter) { + CollectionsInner client = this.inner(); + return client.listMetricsAsync(resourceGroupName, accountName, databaseRid, collectionRid, filter) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public CollectionDatabasisDatabaseAccountMetric call(MetricInner inner) { + return wrapCollectionDatabasisDatabaseAccountMetricModel(inner); + } + }); + } + + @Override + public Observable listUsagesAsync(String resourceGroupName, String accountName, String databaseRid, String collectionRid) { + CollectionsInner client = this.inner(); + return client.listUsagesAsync(resourceGroupName, accountName, databaseRid, collectionRid) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public CollectionDatabasisDatabaseAccountUsage call(UsageInner inner) { + return wrapCollectionDatabasisDatabaseAccountUsageModel(inner); + } + }); + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/CollectionsInner.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/CollectionsInner.java new file mode 100644 index 000000000000..8e9e260abc99 --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/CollectionsInner.java @@ -0,0 +1,494 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.cosmosdb.v2015_04_08.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 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.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Collections. + */ +public class CollectionsInner { + /** The Retrofit service to perform REST calls. */ + private CollectionsService service; + /** The service client containing this operation class. */ + private CosmosDBManagementClientImpl client; + + /** + * Initializes an instance of CollectionsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public CollectionsInner(Retrofit retrofit, CosmosDBManagementClientImpl client) { + this.service = retrofit.create(CollectionsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Collections to be + * used by Retrofit to perform actually REST calls. + */ + interface CollectionsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cosmosdb.v2015_04_08.Collections listMetrics" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/metrics") + Observable> listMetrics(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("databaseRid") String databaseRid, @Path("collectionRid") String collectionRid, @Query("api-version") String apiVersion, @Query("$filter") String filter, @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.cosmosdb.v2015_04_08.Collections listUsages" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/usages") + Observable> listUsages(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("databaseRid") String databaseRid, @Path("collectionRid") String collectionRid, @Query("api-version") String apiVersion, @Query("$filter") String filter, @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.cosmosdb.v2015_04_08.Collections listMetricDefinitions" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/metricDefinitions") + Observable> listMetricDefinitions(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("databaseRid") String databaseRid, @Path("collectionRid") String collectionRid, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Retrieves the metrics determined by the given filter for the given database account and collection. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseRid Cosmos DB database rid. + * @param collectionRid Cosmos DB collection rid. + * @param filter An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq. + * @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 List<MetricInner> object if successful. + */ + public List listMetrics(String resourceGroupName, String accountName, String databaseRid, String collectionRid, String filter) { + return listMetricsWithServiceResponseAsync(resourceGroupName, accountName, databaseRid, collectionRid, filter).toBlocking().single().body(); + } + + /** + * Retrieves the metrics determined by the given filter for the given database account and collection. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseRid Cosmos DB database rid. + * @param collectionRid Cosmos DB collection rid. + * @param filter An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq. + * @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> listMetricsAsync(String resourceGroupName, String accountName, String databaseRid, String collectionRid, String filter, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listMetricsWithServiceResponseAsync(resourceGroupName, accountName, databaseRid, collectionRid, filter), serviceCallback); + } + + /** + * Retrieves the metrics determined by the given filter for the given database account and collection. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseRid Cosmos DB database rid. + * @param collectionRid Cosmos DB collection rid. + * @param filter An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<MetricInner> object + */ + public Observable> listMetricsAsync(String resourceGroupName, String accountName, String databaseRid, String collectionRid, String filter) { + return listMetricsWithServiceResponseAsync(resourceGroupName, accountName, databaseRid, collectionRid, filter).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Retrieves the metrics determined by the given filter for the given database account and collection. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseRid Cosmos DB database rid. + * @param collectionRid Cosmos DB collection rid. + * @param filter An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<MetricInner> object + */ + public Observable>> listMetricsWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseRid, String collectionRid, String filter) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (databaseRid == null) { + throw new IllegalArgumentException("Parameter databaseRid is required and cannot be null."); + } + if (collectionRid == null) { + throw new IllegalArgumentException("Parameter collectionRid 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 (filter == null) { + throw new IllegalArgumentException("Parameter filter is required and cannot be null."); + } + return service.listMetrics(this.client.subscriptionId(), resourceGroupName, accountName, databaseRid, collectionRid, this.client.apiVersion(), filter, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listMetricsDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listMetricsDelegate(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 the usages (most recent storage data) for the given collection. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseRid Cosmos DB database rid. + * @param collectionRid Cosmos DB collection rid. + * @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 List<UsageInner> object if successful. + */ + public List listUsages(String resourceGroupName, String accountName, String databaseRid, String collectionRid) { + return listUsagesWithServiceResponseAsync(resourceGroupName, accountName, databaseRid, collectionRid).toBlocking().single().body(); + } + + /** + * Retrieves the usages (most recent storage data) for the given collection. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseRid Cosmos DB database rid. + * @param collectionRid Cosmos DB collection rid. + * @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> listUsagesAsync(String resourceGroupName, String accountName, String databaseRid, String collectionRid, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listUsagesWithServiceResponseAsync(resourceGroupName, accountName, databaseRid, collectionRid), serviceCallback); + } + + /** + * Retrieves the usages (most recent storage data) for the given collection. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseRid Cosmos DB database rid. + * @param collectionRid Cosmos DB collection rid. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<UsageInner> object + */ + public Observable> listUsagesAsync(String resourceGroupName, String accountName, String databaseRid, String collectionRid) { + return listUsagesWithServiceResponseAsync(resourceGroupName, accountName, databaseRid, collectionRid).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Retrieves the usages (most recent storage data) for the given collection. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseRid Cosmos DB database rid. + * @param collectionRid Cosmos DB collection rid. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<UsageInner> object + */ + public Observable>> listUsagesWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseRid, String collectionRid) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (databaseRid == null) { + throw new IllegalArgumentException("Parameter databaseRid is required and cannot be null."); + } + if (collectionRid == null) { + throw new IllegalArgumentException("Parameter collectionRid 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 filter = null; + return service.listUsages(this.client.subscriptionId(), resourceGroupName, accountName, databaseRid, collectionRid, this.client.apiVersion(), filter, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listUsagesDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Retrieves the usages (most recent storage data) for the given collection. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseRid Cosmos DB database rid. + * @param collectionRid Cosmos DB collection rid. + * @param filter An OData filter expression that describes a subset of usages to return. The supported parameter is name.value (name of the metric, can have an or of multiple names). + * @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 List<UsageInner> object if successful. + */ + public List listUsages(String resourceGroupName, String accountName, String databaseRid, String collectionRid, String filter) { + return listUsagesWithServiceResponseAsync(resourceGroupName, accountName, databaseRid, collectionRid, filter).toBlocking().single().body(); + } + + /** + * Retrieves the usages (most recent storage data) for the given collection. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseRid Cosmos DB database rid. + * @param collectionRid Cosmos DB collection rid. + * @param filter An OData filter expression that describes a subset of usages to return. The supported parameter is name.value (name of the metric, can have an or of multiple names). + * @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> listUsagesAsync(String resourceGroupName, String accountName, String databaseRid, String collectionRid, String filter, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listUsagesWithServiceResponseAsync(resourceGroupName, accountName, databaseRid, collectionRid, filter), serviceCallback); + } + + /** + * Retrieves the usages (most recent storage data) for the given collection. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseRid Cosmos DB database rid. + * @param collectionRid Cosmos DB collection rid. + * @param filter An OData filter expression that describes a subset of usages to return. The supported parameter is name.value (name of the metric, can have an or of multiple names). + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<UsageInner> object + */ + public Observable> listUsagesAsync(String resourceGroupName, String accountName, String databaseRid, String collectionRid, String filter) { + return listUsagesWithServiceResponseAsync(resourceGroupName, accountName, databaseRid, collectionRid, filter).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Retrieves the usages (most recent storage data) for the given collection. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseRid Cosmos DB database rid. + * @param collectionRid Cosmos DB collection rid. + * @param filter An OData filter expression that describes a subset of usages to return. The supported parameter is name.value (name of the metric, can have an or of multiple names). + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<UsageInner> object + */ + public Observable>> listUsagesWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseRid, String collectionRid, String filter) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (databaseRid == null) { + throw new IllegalArgumentException("Parameter databaseRid is required and cannot be null."); + } + if (collectionRid == null) { + throw new IllegalArgumentException("Parameter collectionRid 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.listUsages(this.client.subscriptionId(), resourceGroupName, accountName, databaseRid, collectionRid, this.client.apiVersion(), filter, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listUsagesDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listUsagesDelegate(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 metric definitions for the given collection. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseRid Cosmos DB database rid. + * @param collectionRid Cosmos DB collection rid. + * @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 List<MetricDefinitionInner> object if successful. + */ + public List listMetricDefinitions(String resourceGroupName, String accountName, String databaseRid, String collectionRid) { + return listMetricDefinitionsWithServiceResponseAsync(resourceGroupName, accountName, databaseRid, collectionRid).toBlocking().single().body(); + } + + /** + * Retrieves metric definitions for the given collection. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseRid Cosmos DB database rid. + * @param collectionRid Cosmos DB collection rid. + * @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> listMetricDefinitionsAsync(String resourceGroupName, String accountName, String databaseRid, String collectionRid, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listMetricDefinitionsWithServiceResponseAsync(resourceGroupName, accountName, databaseRid, collectionRid), serviceCallback); + } + + /** + * Retrieves metric definitions for the given collection. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseRid Cosmos DB database rid. + * @param collectionRid Cosmos DB collection rid. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<MetricDefinitionInner> object + */ + public Observable> listMetricDefinitionsAsync(String resourceGroupName, String accountName, String databaseRid, String collectionRid) { + return listMetricDefinitionsWithServiceResponseAsync(resourceGroupName, accountName, databaseRid, collectionRid).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Retrieves metric definitions for the given collection. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseRid Cosmos DB database rid. + * @param collectionRid Cosmos DB collection rid. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<MetricDefinitionInner> object + */ + public Observable>> listMetricDefinitionsWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseRid, String collectionRid) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (databaseRid == null) { + throw new IllegalArgumentException("Parameter databaseRid is required and cannot be null."); + } + if (collectionRid == null) { + throw new IllegalArgumentException("Parameter collectionRid 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.listMetricDefinitions(this.client.subscriptionId(), resourceGroupName, accountName, databaseRid, collectionRid, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listMetricDefinitionsDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listMetricDefinitionsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/CosmosDBManagementClientImpl.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/CosmosDBManagementClientImpl.java new file mode 100644 index 000000000000..dd58a7cc54dc --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/CosmosDBManagementClientImpl.java @@ -0,0 +1,364 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.cosmosdb.v2015_04_08.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 CosmosDBManagementClientImpl class. + */ +public class CosmosDBManagementClientImpl 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; + } + + /** Azure subscription ID. */ + private String subscriptionId; + + /** + * Gets Azure subscription ID. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Sets Azure subscription ID. + * + * @param subscriptionId the subscriptionId value. + * @return the service client itself + */ + public CosmosDBManagementClientImpl withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** Version of the API to be used with the client request. The current version is 2015-04-08. */ + private String apiVersion; + + /** + * Gets Version of the API to be used with the client request. The current version is 2015-04-08. + * + * @return the apiVersion value. + */ + public String apiVersion() { + return this.apiVersion; + } + + /** 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 CosmosDBManagementClientImpl 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 CosmosDBManagementClientImpl 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 CosmosDBManagementClientImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * The DatabaseAccountsInner object to access its operations. + */ + private DatabaseAccountsInner databaseAccounts; + + /** + * Gets the DatabaseAccountsInner object to access its operations. + * @return the DatabaseAccountsInner object. + */ + public DatabaseAccountsInner databaseAccounts() { + return this.databaseAccounts; + } + + /** + * 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 DatabasesInner object to access its operations. + */ + private DatabasesInner databases; + + /** + * Gets the DatabasesInner object to access its operations. + * @return the DatabasesInner object. + */ + public DatabasesInner databases() { + return this.databases; + } + + /** + * The CollectionsInner object to access its operations. + */ + private CollectionsInner collections; + + /** + * Gets the CollectionsInner object to access its operations. + * @return the CollectionsInner object. + */ + public CollectionsInner collections() { + return this.collections; + } + + /** + * The CollectionRegionsInner object to access its operations. + */ + private CollectionRegionsInner collectionRegions; + + /** + * Gets the CollectionRegionsInner object to access its operations. + * @return the CollectionRegionsInner object. + */ + public CollectionRegionsInner collectionRegions() { + return this.collectionRegions; + } + + /** + * The DatabaseAccountRegionsInner object to access its operations. + */ + private DatabaseAccountRegionsInner databaseAccountRegions; + + /** + * Gets the DatabaseAccountRegionsInner object to access its operations. + * @return the DatabaseAccountRegionsInner object. + */ + public DatabaseAccountRegionsInner databaseAccountRegions() { + return this.databaseAccountRegions; + } + + /** + * The PercentileSourceTargetsInner object to access its operations. + */ + private PercentileSourceTargetsInner percentileSourceTargets; + + /** + * Gets the PercentileSourceTargetsInner object to access its operations. + * @return the PercentileSourceTargetsInner object. + */ + public PercentileSourceTargetsInner percentileSourceTargets() { + return this.percentileSourceTargets; + } + + /** + * The PercentileTargetsInner object to access its operations. + */ + private PercentileTargetsInner percentileTargets; + + /** + * Gets the PercentileTargetsInner object to access its operations. + * @return the PercentileTargetsInner object. + */ + public PercentileTargetsInner percentileTargets() { + return this.percentileTargets; + } + + /** + * The PercentilesInner object to access its operations. + */ + private PercentilesInner percentiles; + + /** + * Gets the PercentilesInner object to access its operations. + * @return the PercentilesInner object. + */ + public PercentilesInner percentiles() { + return this.percentiles; + } + + /** + * The CollectionPartitionRegionsInner object to access its operations. + */ + private CollectionPartitionRegionsInner collectionPartitionRegions; + + /** + * Gets the CollectionPartitionRegionsInner object to access its operations. + * @return the CollectionPartitionRegionsInner object. + */ + public CollectionPartitionRegionsInner collectionPartitionRegions() { + return this.collectionPartitionRegions; + } + + /** + * The CollectionPartitionsInner object to access its operations. + */ + private CollectionPartitionsInner collectionPartitions; + + /** + * Gets the CollectionPartitionsInner object to access its operations. + * @return the CollectionPartitionsInner object. + */ + public CollectionPartitionsInner collectionPartitions() { + return this.collectionPartitions; + } + + /** + * The PartitionKeyRangeIdsInner object to access its operations. + */ + private PartitionKeyRangeIdsInner partitionKeyRangeIds; + + /** + * Gets the PartitionKeyRangeIdsInner object to access its operations. + * @return the PartitionKeyRangeIdsInner object. + */ + public PartitionKeyRangeIdsInner partitionKeyRangeIds() { + return this.partitionKeyRangeIds; + } + + /** + * The PartitionKeyRangeIdRegionsInner object to access its operations. + */ + private PartitionKeyRangeIdRegionsInner partitionKeyRangeIdRegions; + + /** + * Gets the PartitionKeyRangeIdRegionsInner object to access its operations. + * @return the PartitionKeyRangeIdRegionsInner object. + */ + public PartitionKeyRangeIdRegionsInner partitionKeyRangeIdRegions() { + return this.partitionKeyRangeIdRegions; + } + + /** + * Initializes an instance of CosmosDBManagementClient client. + * + * @param credentials the management credentials for Azure + */ + public CosmosDBManagementClientImpl(ServiceClientCredentials credentials) { + this("https://management.azure.com", credentials); + } + + /** + * Initializes an instance of CosmosDBManagementClient client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public CosmosDBManagementClientImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of CosmosDBManagementClient client. + * + * @param restClient the REST client to connect to Azure. + */ + public CosmosDBManagementClientImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.apiVersion = "2015-04-08"; + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.databaseAccounts = new DatabaseAccountsInner(restClient().retrofit(), this); + this.operations = new OperationsInner(restClient().retrofit(), this); + this.databases = new DatabasesInner(restClient().retrofit(), this); + this.collections = new CollectionsInner(restClient().retrofit(), this); + this.collectionRegions = new CollectionRegionsInner(restClient().retrofit(), this); + this.databaseAccountRegions = new DatabaseAccountRegionsInner(restClient().retrofit(), this); + this.percentileSourceTargets = new PercentileSourceTargetsInner(restClient().retrofit(), this); + this.percentileTargets = new PercentileTargetsInner(restClient().retrofit(), this); + this.percentiles = new PercentilesInner(restClient().retrofit(), this); + this.collectionPartitionRegions = new CollectionPartitionRegionsInner(restClient().retrofit(), this); + this.collectionPartitions = new CollectionPartitionsInner(restClient().retrofit(), this); + this.partitionKeyRangeIds = new PartitionKeyRangeIdsInner(restClient().retrofit(), this); + this.partitionKeyRangeIdRegions = new PartitionKeyRangeIdRegionsInner(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(), "CosmosDBManagementClient", "2015-04-08"); + } +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/CosmosDBManager.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/CosmosDBManager.java new file mode 100644 index 000000000000..69f8b0a61757 --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/CosmosDBManager.java @@ -0,0 +1,243 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.cosmosdb.v2015_04_08.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.cosmosdb.v2015_04_08.DatabaseAccounts; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.Operations; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.Databases; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.Collections; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.CollectionRegions; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.DatabaseAccountRegions; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.PercentileSourceTargets; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.PercentileTargets; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.Percentiles; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.CollectionPartitionRegions; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.CollectionPartitions; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.PartitionKeyRangeIds; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.PartitionKeyRangeIdRegions; +import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; +import com.microsoft.azure.arm.resources.implementation.ManagerCore; + +/** + * Entry point to Azure CosmosDB resource management. + */ +public final class CosmosDBManager extends ManagerCore { + private DatabaseAccounts databaseAccounts; + private Operations operations; + private Databases databases; + private Collections collections; + private CollectionRegions collectionRegions; + private DatabaseAccountRegions databaseAccountRegions; + private PercentileSourceTargets percentileSourceTargets; + private PercentileTargets percentileTargets; + private Percentiles percentiles; + private CollectionPartitionRegions collectionPartitionRegions; + private CollectionPartitions collectionPartitions; + private PartitionKeyRangeIds partitionKeyRangeIds; + private PartitionKeyRangeIdRegions partitionKeyRangeIdRegions; + /** + * Get a Configurable instance that can be used to create CosmosDBManager with optional configuration. + * + * @return the instance allowing configurations + */ + public static Configurable configure() { + return new CosmosDBManager.ConfigurableImpl(); + } + /** + * Creates an instance of CosmosDBManager that exposes CosmosDB resource management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the CosmosDBManager + */ + public static CosmosDBManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return new CosmosDBManager(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 CosmosDBManager that exposes CosmosDB resource management API entry points. + * + * @param restClient the RestClient to be used for API calls. + * @param subscriptionId the subscription UUID + * @return the CosmosDBManager + */ + public static CosmosDBManager authenticate(RestClient restClient, String subscriptionId) { + return new CosmosDBManager(restClient, subscriptionId); + } + /** + * The interface allowing configurations to be set. + */ + public interface Configurable extends AzureConfigurable { + /** + * Creates an instance of CosmosDBManager that exposes CosmosDB management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the interface exposing CosmosDB management API entry points that work across subscriptions + */ + CosmosDBManager authenticate(AzureTokenCredentials credentials, String subscriptionId); + } + + /** + * @return Entry point to manage DatabaseAccounts. + */ + public DatabaseAccounts databaseAccounts() { + if (this.databaseAccounts == null) { + this.databaseAccounts = new DatabaseAccountsImpl(this); + } + return this.databaseAccounts; + } + + /** + * @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 Databases. + */ + public Databases databases() { + if (this.databases == null) { + this.databases = new DatabasesImpl(this); + } + return this.databases; + } + + /** + * @return Entry point to manage Collections. + */ + public Collections collections() { + if (this.collections == null) { + this.collections = new CollectionsImpl(this); + } + return this.collections; + } + + /** + * @return Entry point to manage CollectionRegions. + */ + public CollectionRegions collectionRegions() { + if (this.collectionRegions == null) { + this.collectionRegions = new CollectionRegionsImpl(this); + } + return this.collectionRegions; + } + + /** + * @return Entry point to manage DatabaseAccountRegions. + */ + public DatabaseAccountRegions databaseAccountRegions() { + if (this.databaseAccountRegions == null) { + this.databaseAccountRegions = new DatabaseAccountRegionsImpl(this); + } + return this.databaseAccountRegions; + } + + /** + * @return Entry point to manage PercentileSourceTargets. + */ + public PercentileSourceTargets percentileSourceTargets() { + if (this.percentileSourceTargets == null) { + this.percentileSourceTargets = new PercentileSourceTargetsImpl(this); + } + return this.percentileSourceTargets; + } + + /** + * @return Entry point to manage PercentileTargets. + */ + public PercentileTargets percentileTargets() { + if (this.percentileTargets == null) { + this.percentileTargets = new PercentileTargetsImpl(this); + } + return this.percentileTargets; + } + + /** + * @return Entry point to manage Percentiles. + */ + public Percentiles percentiles() { + if (this.percentiles == null) { + this.percentiles = new PercentilesImpl(this); + } + return this.percentiles; + } + + /** + * @return Entry point to manage CollectionPartitionRegions. + */ + public CollectionPartitionRegions collectionPartitionRegions() { + if (this.collectionPartitionRegions == null) { + this.collectionPartitionRegions = new CollectionPartitionRegionsImpl(this); + } + return this.collectionPartitionRegions; + } + + /** + * @return Entry point to manage CollectionPartitions. + */ + public CollectionPartitions collectionPartitions() { + if (this.collectionPartitions == null) { + this.collectionPartitions = new CollectionPartitionsImpl(this); + } + return this.collectionPartitions; + } + + /** + * @return Entry point to manage PartitionKeyRangeIds. + */ + public PartitionKeyRangeIds partitionKeyRangeIds() { + if (this.partitionKeyRangeIds == null) { + this.partitionKeyRangeIds = new PartitionKeyRangeIdsImpl(this); + } + return this.partitionKeyRangeIds; + } + + /** + * @return Entry point to manage PartitionKeyRangeIdRegions. + */ + public PartitionKeyRangeIdRegions partitionKeyRangeIdRegions() { + if (this.partitionKeyRangeIdRegions == null) { + this.partitionKeyRangeIdRegions = new PartitionKeyRangeIdRegionsImpl(this); + } + return this.partitionKeyRangeIdRegions; + } + + /** + * The implementation for Configurable interface. + */ + private static final class ConfigurableImpl extends AzureConfigurableCoreImpl implements Configurable { + public CosmosDBManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return CosmosDBManager.authenticate(buildRestClient(credentials), subscriptionId); + } + } + private CosmosDBManager(RestClient restClient, String subscriptionId) { + super( + restClient, + subscriptionId, + new CosmosDBManagementClientImpl(restClient).withSubscriptionId(subscriptionId)); + } +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountImpl.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountImpl.java new file mode 100644 index 000000000000..6dc8f71cb170 --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountImpl.java @@ -0,0 +1,238 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.DatabaseAccount; +import rx.Observable; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.DatabaseAccountPatchParameters; +import java.util.List; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.DatabaseAccountCreateUpdateParameters; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.Capability; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.ConnectorOffer; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.ConsistencyPolicy; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.DatabaseAccountOfferType; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.FailoverPolicy; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.DatabaseAccountKind; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.Location; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.VirtualNetworkRule; +import rx.functions.Func1; + +class DatabaseAccountImpl extends GroupableResourceCoreImpl implements DatabaseAccount, DatabaseAccount.Definition, DatabaseAccount.Update { + private DatabaseAccountCreateUpdateParameters createParameter; + private DatabaseAccountPatchParameters updateParameter; + DatabaseAccountImpl(String name, DatabaseAccountInner inner, CosmosDBManager manager) { + super(name, inner, manager); + this.createParameter = new DatabaseAccountCreateUpdateParameters(); + this.updateParameter = new DatabaseAccountPatchParameters(); + } + + @Override + public Observable createResourceAsync() { + DatabaseAccountsInner client = this.manager().inner().databaseAccounts(); + this.createParameter.withLocation(inner().location()); + this.createParameter.withTags(inner().getTags()); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.createParameter) + .map(new Func1() { + @Override + public DatabaseAccountInner call(DatabaseAccountInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + DatabaseAccountsInner client = this.manager().inner().databaseAccounts(); + return client.patchAsync(this.resourceGroupName(), this.name(), this.updateParameter) + .map(new Func1() { + @Override + public DatabaseAccountInner call(DatabaseAccountInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + DatabaseAccountsInner client = this.manager().inner().databaseAccounts(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.createParameter = new DatabaseAccountCreateUpdateParameters(); + this.updateParameter = new DatabaseAccountPatchParameters(); + } + + @Override + public List capabilities() { + return this.inner().capabilities(); + } + + @Override + public ConnectorOffer connectorOffer() { + return this.inner().connectorOffer(); + } + + @Override + public ConsistencyPolicy consistencyPolicy() { + return this.inner().consistencyPolicy(); + } + + @Override + public DatabaseAccountOfferType databaseAccountOfferType() { + return this.inner().databaseAccountOfferType(); + } + + @Override + public String documentEndpoint() { + return this.inner().documentEndpoint(); + } + + @Override + public Boolean enableAutomaticFailover() { + return this.inner().enableAutomaticFailover(); + } + + @Override + public Boolean enableCassandraConnector() { + return this.inner().enableCassandraConnector(); + } + + @Override + public Boolean enableMultipleWriteLocations() { + return this.inner().enableMultipleWriteLocations(); + } + + @Override + public List failoverPolicies() { + return this.inner().failoverPolicies(); + } + + @Override + public String ipRangeFilter() { + return this.inner().ipRangeFilter(); + } + + @Override + public Boolean isVirtualNetworkFilterEnabled() { + return this.inner().isVirtualNetworkFilterEnabled(); + } + + @Override + public DatabaseAccountKind kind() { + return this.inner().kind(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public List readLocations() { + return this.inner().readLocations(); + } + + @Override + public List virtualNetworkRules() { + return this.inner().virtualNetworkRules(); + } + + @Override + public List writeLocations() { + return this.inner().writeLocations(); + } + + @Override + public DatabaseAccountImpl withDatabaseAccountOfferType(String databaseAccountOfferType) { + this.createParameter.withDatabaseAccountOfferType(databaseAccountOfferType); + return this; + } + + @Override + public DatabaseAccountImpl withLocations(List locations) { + this.createParameter.withLocations(locations); + return this; + } + + @Override + public DatabaseAccountImpl withConnectorOffer(ConnectorOffer connectorOffer) { + this.createParameter.withConnectorOffer(connectorOffer); + return this; + } + + @Override + public DatabaseAccountImpl withConsistencyPolicy(ConsistencyPolicy consistencyPolicy) { + this.createParameter.withConsistencyPolicy(consistencyPolicy); + return this; + } + + @Override + public DatabaseAccountImpl withEnableAutomaticFailover(Boolean enableAutomaticFailover) { + this.createParameter.withEnableAutomaticFailover(enableAutomaticFailover); + return this; + } + + @Override + public DatabaseAccountImpl withEnableCassandraConnector(Boolean enableCassandraConnector) { + this.createParameter.withEnableCassandraConnector(enableCassandraConnector); + return this; + } + + @Override + public DatabaseAccountImpl withEnableMultipleWriteLocations(Boolean enableMultipleWriteLocations) { + this.createParameter.withEnableMultipleWriteLocations(enableMultipleWriteLocations); + return this; + } + + @Override + public DatabaseAccountImpl withIpRangeFilter(String ipRangeFilter) { + this.createParameter.withIpRangeFilter(ipRangeFilter); + return this; + } + + @Override + public DatabaseAccountImpl withIsVirtualNetworkFilterEnabled(Boolean isVirtualNetworkFilterEnabled) { + this.createParameter.withIsVirtualNetworkFilterEnabled(isVirtualNetworkFilterEnabled); + return this; + } + + @Override + public DatabaseAccountImpl withKind(DatabaseAccountKind kind) { + this.createParameter.withKind(kind); + return this; + } + + @Override + public DatabaseAccountImpl withVirtualNetworkRules(List virtualNetworkRules) { + this.createParameter.withVirtualNetworkRules(virtualNetworkRules); + return this; + } + + @Override + public DatabaseAccountImpl withCapabilities(List capabilities) { + if (isInCreateMode()) { + this.createParameter.withCapabilities(capabilities); + } else { + this.updateParameter.withCapabilities(capabilities); + } + return this; + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountInner.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountInner.java new file mode 100644 index 000000000000..f7924f4c005c --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountInner.java @@ -0,0 +1,403 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation; + +import com.microsoft.azure.management.cosmosdb.v2015_04_08.DatabaseAccountKind; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.DatabaseAccountOfferType; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.ConsistencyPolicy; +import java.util.List; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.Capability; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.Location; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.FailoverPolicy; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.VirtualNetworkRule; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.ConnectorOffer; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * An Azure Cosmos DB database account. + */ +@JsonFlatten +@SkipParentValidation +public class DatabaseAccountInner extends Resource { + /** + * Indicates the type of database account. This can only be set at database + * account creation. Possible values include: 'GlobalDocumentDB', + * 'MongoDB', 'Parse'. + */ + @JsonProperty(value = "kind") + private DatabaseAccountKind kind; + + /** + * The provisioningState property. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * The connection endpoint for the Cosmos DB database account. + */ + @JsonProperty(value = "properties.documentEndpoint", access = JsonProperty.Access.WRITE_ONLY) + private String documentEndpoint; + + /** + * The offer type for the Cosmos DB database account. Default value: + * Standard. Possible values include: 'Standard'. + */ + @JsonProperty(value = "properties.databaseAccountOfferType", access = JsonProperty.Access.WRITE_ONLY) + private DatabaseAccountOfferType databaseAccountOfferType; + + /** + * Cosmos DB Firewall Support: This value specifies the set of IP addresses + * or IP address ranges in CIDR form to be included as the allowed list of + * client IPs for a given database account. IP addresses/ranges must be + * comma separated and must not contain any spaces. + */ + @JsonProperty(value = "properties.ipRangeFilter") + private String ipRangeFilter; + + /** + * Flag to indicate whether to enable/disable Virtual Network ACL rules. + */ + @JsonProperty(value = "properties.isVirtualNetworkFilterEnabled") + private Boolean isVirtualNetworkFilterEnabled; + + /** + * Enables automatic failover of the write region in the rare event that + * the region is unavailable due to an outage. Automatic failover will + * result in a new write region for the account and is chosen based on the + * failover priorities configured for the account. + */ + @JsonProperty(value = "properties.enableAutomaticFailover") + private Boolean enableAutomaticFailover; + + /** + * The consistency policy for the Cosmos DB database account. + */ + @JsonProperty(value = "properties.consistencyPolicy") + private ConsistencyPolicy consistencyPolicy; + + /** + * List of Cosmos DB capabilities for the account. + */ + @JsonProperty(value = "properties.capabilities") + private List capabilities; + + /** + * An array that contains the write location for the Cosmos DB account. + */ + @JsonProperty(value = "properties.writeLocations", access = JsonProperty.Access.WRITE_ONLY) + private List writeLocations; + + /** + * An array that contains of the read locations enabled for the Cosmos DB + * account. + */ + @JsonProperty(value = "properties.readLocations", access = JsonProperty.Access.WRITE_ONLY) + private List readLocations; + + /** + * An array that contains the regions ordered by their failover priorities. + */ + @JsonProperty(value = "properties.failoverPolicies", access = JsonProperty.Access.WRITE_ONLY) + private List failoverPolicies; + + /** + * List of Virtual Network ACL rules configured for the Cosmos DB account. + */ + @JsonProperty(value = "properties.virtualNetworkRules") + private List virtualNetworkRules; + + /** + * Enables the account to write in multiple locations. + */ + @JsonProperty(value = "properties.enableMultipleWriteLocations") + private Boolean enableMultipleWriteLocations; + + /** + * Enables the cassandra connector on the Cosmos DB C* account. + */ + @JsonProperty(value = "properties.enableCassandraConnector") + private Boolean enableCassandraConnector; + + /** + * The cassandra connector offer type for the Cosmos DB database C* + * account. Possible values include: 'Small'. + */ + @JsonProperty(value = "properties.connectorOffer") + private ConnectorOffer connectorOffer; + + /** + * Get indicates the type of database account. This can only be set at database account creation. Possible values include: 'GlobalDocumentDB', 'MongoDB', 'Parse'. + * + * @return the kind value + */ + public DatabaseAccountKind kind() { + return this.kind; + } + + /** + * Set indicates the type of database account. This can only be set at database account creation. Possible values include: 'GlobalDocumentDB', 'MongoDB', 'Parse'. + * + * @param kind the kind value to set + * @return the DatabaseAccountInner object itself. + */ + public DatabaseAccountInner withKind(DatabaseAccountKind kind) { + this.kind = kind; + return this; + } + + /** + * Get the provisioningState value. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioningState value. + * + * @param provisioningState the provisioningState value to set + * @return the DatabaseAccountInner object itself. + */ + public DatabaseAccountInner withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get the connection endpoint for the Cosmos DB database account. + * + * @return the documentEndpoint value + */ + public String documentEndpoint() { + return this.documentEndpoint; + } + + /** + * Get the offer type for the Cosmos DB database account. Default value: Standard. Possible values include: 'Standard'. + * + * @return the databaseAccountOfferType value + */ + public DatabaseAccountOfferType databaseAccountOfferType() { + return this.databaseAccountOfferType; + } + + /** + * Get cosmos DB Firewall Support: This value specifies the set of IP addresses or IP address ranges in CIDR form to be included as the allowed list of client IPs for a given database account. IP addresses/ranges must be comma separated and must not contain any spaces. + * + * @return the ipRangeFilter value + */ + public String ipRangeFilter() { + return this.ipRangeFilter; + } + + /** + * Set cosmos DB Firewall Support: This value specifies the set of IP addresses or IP address ranges in CIDR form to be included as the allowed list of client IPs for a given database account. IP addresses/ranges must be comma separated and must not contain any spaces. + * + * @param ipRangeFilter the ipRangeFilter value to set + * @return the DatabaseAccountInner object itself. + */ + public DatabaseAccountInner withIpRangeFilter(String ipRangeFilter) { + this.ipRangeFilter = ipRangeFilter; + return this; + } + + /** + * Get flag to indicate whether to enable/disable Virtual Network ACL rules. + * + * @return the isVirtualNetworkFilterEnabled value + */ + public Boolean isVirtualNetworkFilterEnabled() { + return this.isVirtualNetworkFilterEnabled; + } + + /** + * Set flag to indicate whether to enable/disable Virtual Network ACL rules. + * + * @param isVirtualNetworkFilterEnabled the isVirtualNetworkFilterEnabled value to set + * @return the DatabaseAccountInner object itself. + */ + public DatabaseAccountInner withIsVirtualNetworkFilterEnabled(Boolean isVirtualNetworkFilterEnabled) { + this.isVirtualNetworkFilterEnabled = isVirtualNetworkFilterEnabled; + return this; + } + + /** + * Get enables automatic failover of the write region in the rare event that the region is unavailable due to an outage. Automatic failover will result in a new write region for the account and is chosen based on the failover priorities configured for the account. + * + * @return the enableAutomaticFailover value + */ + public Boolean enableAutomaticFailover() { + return this.enableAutomaticFailover; + } + + /** + * Set enables automatic failover of the write region in the rare event that the region is unavailable due to an outage. Automatic failover will result in a new write region for the account and is chosen based on the failover priorities configured for the account. + * + * @param enableAutomaticFailover the enableAutomaticFailover value to set + * @return the DatabaseAccountInner object itself. + */ + public DatabaseAccountInner withEnableAutomaticFailover(Boolean enableAutomaticFailover) { + this.enableAutomaticFailover = enableAutomaticFailover; + return this; + } + + /** + * Get the consistency policy for the Cosmos DB database account. + * + * @return the consistencyPolicy value + */ + public ConsistencyPolicy consistencyPolicy() { + return this.consistencyPolicy; + } + + /** + * Set the consistency policy for the Cosmos DB database account. + * + * @param consistencyPolicy the consistencyPolicy value to set + * @return the DatabaseAccountInner object itself. + */ + public DatabaseAccountInner withConsistencyPolicy(ConsistencyPolicy consistencyPolicy) { + this.consistencyPolicy = consistencyPolicy; + return this; + } + + /** + * Get list of Cosmos DB capabilities for the account. + * + * @return the capabilities value + */ + public List capabilities() { + return this.capabilities; + } + + /** + * Set list of Cosmos DB capabilities for the account. + * + * @param capabilities the capabilities value to set + * @return the DatabaseAccountInner object itself. + */ + public DatabaseAccountInner withCapabilities(List capabilities) { + this.capabilities = capabilities; + return this; + } + + /** + * Get an array that contains the write location for the Cosmos DB account. + * + * @return the writeLocations value + */ + public List writeLocations() { + return this.writeLocations; + } + + /** + * Get an array that contains of the read locations enabled for the Cosmos DB account. + * + * @return the readLocations value + */ + public List readLocations() { + return this.readLocations; + } + + /** + * Get an array that contains the regions ordered by their failover priorities. + * + * @return the failoverPolicies value + */ + public List failoverPolicies() { + return this.failoverPolicies; + } + + /** + * Get list of Virtual Network ACL rules configured for the Cosmos DB account. + * + * @return the virtualNetworkRules value + */ + public List virtualNetworkRules() { + return this.virtualNetworkRules; + } + + /** + * Set list of Virtual Network ACL rules configured for the Cosmos DB account. + * + * @param virtualNetworkRules the virtualNetworkRules value to set + * @return the DatabaseAccountInner object itself. + */ + public DatabaseAccountInner withVirtualNetworkRules(List virtualNetworkRules) { + this.virtualNetworkRules = virtualNetworkRules; + return this; + } + + /** + * Get enables the account to write in multiple locations. + * + * @return the enableMultipleWriteLocations value + */ + public Boolean enableMultipleWriteLocations() { + return this.enableMultipleWriteLocations; + } + + /** + * Set enables the account to write in multiple locations. + * + * @param enableMultipleWriteLocations the enableMultipleWriteLocations value to set + * @return the DatabaseAccountInner object itself. + */ + public DatabaseAccountInner withEnableMultipleWriteLocations(Boolean enableMultipleWriteLocations) { + this.enableMultipleWriteLocations = enableMultipleWriteLocations; + return this; + } + + /** + * Get enables the cassandra connector on the Cosmos DB C* account. + * + * @return the enableCassandraConnector value + */ + public Boolean enableCassandraConnector() { + return this.enableCassandraConnector; + } + + /** + * Set enables the cassandra connector on the Cosmos DB C* account. + * + * @param enableCassandraConnector the enableCassandraConnector value to set + * @return the DatabaseAccountInner object itself. + */ + public DatabaseAccountInner withEnableCassandraConnector(Boolean enableCassandraConnector) { + this.enableCassandraConnector = enableCassandraConnector; + return this; + } + + /** + * Get the cassandra connector offer type for the Cosmos DB database C* account. Possible values include: 'Small'. + * + * @return the connectorOffer value + */ + public ConnectorOffer connectorOffer() { + return this.connectorOffer; + } + + /** + * Set the cassandra connector offer type for the Cosmos DB database C* account. Possible values include: 'Small'. + * + * @param connectorOffer the connectorOffer value to set + * @return the DatabaseAccountInner object itself. + */ + public DatabaseAccountInner withConnectorOffer(ConnectorOffer connectorOffer) { + this.connectorOffer = connectorOffer; + return this; + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountListConnectionStringsResultImpl.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountListConnectionStringsResultImpl.java new file mode 100644 index 000000000000..83f0407ab338 --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountListConnectionStringsResultImpl.java @@ -0,0 +1,33 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation; + +import com.microsoft.azure.management.cosmosdb.v2015_04_08.DatabaseAccountListConnectionStringsResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.DatabaseAccountConnectionString; + +class DatabaseAccountListConnectionStringsResultImpl extends WrapperImpl implements DatabaseAccountListConnectionStringsResult { + private final CosmosDBManager manager; + DatabaseAccountListConnectionStringsResultImpl(DatabaseAccountListConnectionStringsResultInner inner, CosmosDBManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public CosmosDBManager manager() { + return this.manager; + } + + @Override + public List connectionStrings() { + return this.inner().connectionStrings(); + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountListConnectionStringsResultInner.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountListConnectionStringsResultInner.java new file mode 100644 index 000000000000..497ba777fdbc --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountListConnectionStringsResultInner.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation; + +import java.util.List; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.DatabaseAccountConnectionString; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The connection strings for the given database account. + */ +public class DatabaseAccountListConnectionStringsResultInner { + /** + * An array that contains the connection strings for the Cosmos DB account. + */ + @JsonProperty(value = "connectionStrings") + private List connectionStrings; + + /** + * Get an array that contains the connection strings for the Cosmos DB account. + * + * @return the connectionStrings value + */ + public List connectionStrings() { + return this.connectionStrings; + } + + /** + * Set an array that contains the connection strings for the Cosmos DB account. + * + * @param connectionStrings the connectionStrings value to set + * @return the DatabaseAccountListConnectionStringsResultInner object itself. + */ + public DatabaseAccountListConnectionStringsResultInner withConnectionStrings(List connectionStrings) { + this.connectionStrings = connectionStrings; + return this; + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountListKeysResultImpl.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountListKeysResultImpl.java new file mode 100644 index 000000000000..294216cd35b8 --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountListKeysResultImpl.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.cosmosdb.v2015_04_08.implementation; + +import com.microsoft.azure.management.cosmosdb.v2015_04_08.DatabaseAccountListKeysResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class DatabaseAccountListKeysResultImpl extends WrapperImpl implements DatabaseAccountListKeysResult { + private final CosmosDBManager manager; + DatabaseAccountListKeysResultImpl(DatabaseAccountListKeysResultInner inner, CosmosDBManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public CosmosDBManager manager() { + return this.manager; + } + + @Override + public String primaryMasterKey() { + return this.inner().primaryMasterKey(); + } + + @Override + public String primaryReadonlyMasterKey() { + return this.inner().primaryReadonlyMasterKey(); + } + + @Override + public String secondaryMasterKey() { + return this.inner().secondaryMasterKey(); + } + + @Override + public String secondaryReadonlyMasterKey() { + return this.inner().secondaryReadonlyMasterKey(); + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountListKeysResultInner.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountListKeysResultInner.java new file mode 100644 index 000000000000..463e70c4e4b1 --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountListKeysResultInner.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.cosmosdb.v2015_04_08.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The access keys for the given database account. + */ +public class DatabaseAccountListKeysResultInner extends DatabaseAccountListReadOnlyKeysResultInner { + /** + * Base 64 encoded value of the primary read-write key. + */ + @JsonProperty(value = "primaryMasterKey", access = JsonProperty.Access.WRITE_ONLY) + private String primaryMasterKey; + + /** + * Base 64 encoded value of the secondary read-write key. + */ + @JsonProperty(value = "secondaryMasterKey", access = JsonProperty.Access.WRITE_ONLY) + private String secondaryMasterKey; + + /** + * Get base 64 encoded value of the primary read-write key. + * + * @return the primaryMasterKey value + */ + public String primaryMasterKey() { + return this.primaryMasterKey; + } + + /** + * Get base 64 encoded value of the secondary read-write key. + * + * @return the secondaryMasterKey value + */ + public String secondaryMasterKey() { + return this.secondaryMasterKey; + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountListReadOnlyKeysResultImpl.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountListReadOnlyKeysResultImpl.java new file mode 100644 index 000000000000..1a7772993789 --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountListReadOnlyKeysResultImpl.java @@ -0,0 +1,36 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation; + +import com.microsoft.azure.management.cosmosdb.v2015_04_08.DatabaseAccountListReadOnlyKeysResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class DatabaseAccountListReadOnlyKeysResultImpl extends WrapperImpl implements DatabaseAccountListReadOnlyKeysResult { + private final CosmosDBManager manager; + DatabaseAccountListReadOnlyKeysResultImpl(DatabaseAccountListReadOnlyKeysResultInner inner, CosmosDBManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public CosmosDBManager manager() { + return this.manager; + } + + @Override + public String primaryReadonlyMasterKey() { + return this.inner().primaryReadonlyMasterKey(); + } + + @Override + public String secondaryReadonlyMasterKey() { + return this.inner().secondaryReadonlyMasterKey(); + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountListReadOnlyKeysResultInner.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountListReadOnlyKeysResultInner.java new file mode 100644 index 000000000000..b149663f86c2 --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountListReadOnlyKeysResultInner.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.cosmosdb.v2015_04_08.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The read-only access keys for the given database account. + */ +public class DatabaseAccountListReadOnlyKeysResultInner { + /** + * Base 64 encoded value of the primary read-only key. + */ + @JsonProperty(value = "primaryReadonlyMasterKey", access = JsonProperty.Access.WRITE_ONLY) + private String primaryReadonlyMasterKey; + + /** + * Base 64 encoded value of the secondary read-only key. + */ + @JsonProperty(value = "secondaryReadonlyMasterKey", access = JsonProperty.Access.WRITE_ONLY) + private String secondaryReadonlyMasterKey; + + /** + * Get base 64 encoded value of the primary read-only key. + * + * @return the primaryReadonlyMasterKey value + */ + public String primaryReadonlyMasterKey() { + return this.primaryReadonlyMasterKey; + } + + /** + * Get base 64 encoded value of the secondary read-only key. + * + * @return the secondaryReadonlyMasterKey value + */ + public String secondaryReadonlyMasterKey() { + return this.secondaryReadonlyMasterKey; + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountMetricDefinitionImpl.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountMetricDefinitionImpl.java new file mode 100644 index 000000000000..297f16c946b8 --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountMetricDefinitionImpl.java @@ -0,0 +1,60 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation; + +import com.microsoft.azure.management.cosmosdb.v2015_04_08.DatabaseAccountMetricDefinition; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.MetricAvailability; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.MetricName; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.PrimaryAggregationType; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.UnitType; + +class DatabaseAccountMetricDefinitionImpl extends WrapperImpl implements DatabaseAccountMetricDefinition { + private final CosmosDBManager manager; + + DatabaseAccountMetricDefinitionImpl(MetricDefinitionInner inner, CosmosDBManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public CosmosDBManager manager() { + return this.manager; + } + + + + @Override + public List metricAvailabilities() { + return this.inner().metricAvailabilities(); + } + + @Override + public MetricName name() { + return this.inner().name(); + } + + @Override + public PrimaryAggregationType primaryAggregationType() { + return this.inner().primaryAggregationType(); + } + + @Override + public String resourceUri() { + return this.inner().resourceUri(); + } + + @Override + public UnitType unit() { + return this.inner().unit(); + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountMetricImpl.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountMetricImpl.java new file mode 100644 index 000000000000..fcb8ff309923 --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountMetricImpl.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.cosmosdb.v2015_04_08.implementation; + +import com.microsoft.azure.management.cosmosdb.v2015_04_08.DatabaseAccountMetric; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; +import org.joda.time.DateTime; +import java.util.List; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.MetricValue; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.MetricName; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.UnitType; + +class DatabaseAccountMetricImpl extends WrapperImpl implements DatabaseAccountMetric { + private final CosmosDBManager manager; + + DatabaseAccountMetricImpl(MetricInner inner, CosmosDBManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public CosmosDBManager manager() { + return this.manager; + } + + + + @Override + public DateTime endTime() { + return this.inner().endTime(); + } + + @Override + public List metricValues() { + return this.inner().metricValues(); + } + + @Override + public MetricName name() { + return this.inner().name(); + } + + @Override + public DateTime startTime() { + return this.inner().startTime(); + } + + @Override + public String timeGrain() { + return this.inner().timeGrain(); + } + + @Override + public UnitType unit() { + return this.inner().unit(); + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountRegionsImpl.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountRegionsImpl.java new file mode 100644 index 000000000000..560a33bc7508 --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountRegionsImpl.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.cosmosdb.v2015_04_08.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.DatabaseAccountRegions; +import rx.functions.Func1; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.DatabaseAccountMetric; + +class DatabaseAccountRegionsImpl extends WrapperImpl implements DatabaseAccountRegions { + private final CosmosDBManager manager; + + DatabaseAccountRegionsImpl(CosmosDBManager manager) { + super(manager.inner().databaseAccountRegions()); + this.manager = manager; + } + + public CosmosDBManager manager() { + return this.manager; + } + + @Override + public Observable listMetricsAsync(String resourceGroupName, String accountName, String region, String filter) { + DatabaseAccountRegionsInner client = this.inner(); + return client.listMetricsAsync(resourceGroupName, accountName, region, filter) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public DatabaseAccountMetric call(MetricInner inner) { + return new DatabaseAccountMetricImpl(inner, manager()); + } + }); + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountRegionsInner.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountRegionsInner.java new file mode 100644 index 000000000000..b6093dd5b9f8 --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountRegionsInner.java @@ -0,0 +1,166 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.cosmosdb.v2015_04_08.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 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.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in DatabaseAccountRegions. + */ +public class DatabaseAccountRegionsInner { + /** The Retrofit service to perform REST calls. */ + private DatabaseAccountRegionsService service; + /** The service client containing this operation class. */ + private CosmosDBManagementClientImpl client; + + /** + * Initializes an instance of DatabaseAccountRegionsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public DatabaseAccountRegionsInner(Retrofit retrofit, CosmosDBManagementClientImpl client) { + this.service = retrofit.create(DatabaseAccountRegionsService.class); + this.client = client; + } + + /** + * The interface defining all the services for DatabaseAccountRegions to be + * used by Retrofit to perform actually REST calls. + */ + interface DatabaseAccountRegionsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cosmosdb.v2015_04_08.DatabaseAccountRegions listMetrics" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/region/{region}/metrics") + Observable> listMetrics(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("region") String region, @Query("api-version") String apiVersion, @Query("$filter") String filter, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Retrieves the metrics determined by the given filter for the given database account and region. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param region Cosmos DB region, with spaces between words and each word capitalized. + * @param filter An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq. + * @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 List<MetricInner> object if successful. + */ + public List listMetrics(String resourceGroupName, String accountName, String region, String filter) { + return listMetricsWithServiceResponseAsync(resourceGroupName, accountName, region, filter).toBlocking().single().body(); + } + + /** + * Retrieves the metrics determined by the given filter for the given database account and region. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param region Cosmos DB region, with spaces between words and each word capitalized. + * @param filter An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq. + * @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> listMetricsAsync(String resourceGroupName, String accountName, String region, String filter, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listMetricsWithServiceResponseAsync(resourceGroupName, accountName, region, filter), serviceCallback); + } + + /** + * Retrieves the metrics determined by the given filter for the given database account and region. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param region Cosmos DB region, with spaces between words and each word capitalized. + * @param filter An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<MetricInner> object + */ + public Observable> listMetricsAsync(String resourceGroupName, String accountName, String region, String filter) { + return listMetricsWithServiceResponseAsync(resourceGroupName, accountName, region, filter).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Retrieves the metrics determined by the given filter for the given database account and region. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param region Cosmos DB region, with spaces between words and each word capitalized. + * @param filter An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<MetricInner> object + */ + public Observable>> listMetricsWithServiceResponseAsync(String resourceGroupName, String accountName, String region, String filter) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (region == null) { + throw new IllegalArgumentException("Parameter region 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 (filter == null) { + throw new IllegalArgumentException("Parameter filter is required and cannot be null."); + } + return service.listMetrics(this.client.subscriptionId(), resourceGroupName, accountName, region, this.client.apiVersion(), filter, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listMetricsDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listMetricsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountUsageImpl.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountUsageImpl.java new file mode 100644 index 000000000000..b1a1f7d459f3 --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountUsageImpl.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.cosmosdb.v2015_04_08.implementation; + +import com.microsoft.azure.management.cosmosdb.v2015_04_08.DatabaseAccountUsage; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.MetricName; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.UnitType; + +class DatabaseAccountUsageImpl extends WrapperImpl implements DatabaseAccountUsage { + private final CosmosDBManager manager; + + DatabaseAccountUsageImpl(UsageInner inner, CosmosDBManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public CosmosDBManager manager() { + return this.manager; + } + + + + @Override + public Long currentValue() { + return this.inner().currentValue(); + } + + @Override + public Long limit() { + return this.inner().limit(); + } + + @Override + public MetricName name() { + return this.inner().name(); + } + + @Override + public String quotaPeriod() { + return this.inner().quotaPeriod(); + } + + @Override + public UnitType unit() { + return this.inner().unit(); + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountsImpl.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountsImpl.java new file mode 100644 index 000000000000..1a7827c3b95c --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountsImpl.java @@ -0,0 +1,998 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.DatabaseAccounts; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.DatabaseAccount; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.DatabaseAccountListKeysResult; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.DatabaseAccountListConnectionStringsResult; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.DatabaseAccountListReadOnlyKeysResult; +import java.util.List; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.FailoverPolicy; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.KeyKind; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.DatabaseAccountMetric; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.DatabaseAccountUsage; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.DatabaseAccountMetricDefinition; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.SqlDatabase; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.MongoDBDatabase; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.GremlinDatabase; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.MongoDBDatabaseCreateUpdateParameters; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.GremlinDatabaseCreateUpdateParameters; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.Throughput; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.ThroughputResource; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.SqlContainer; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.MongoDBCollection; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.Table; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.CassandraTable; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.CassandraTableCreateUpdateParameters; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.CassandraKeyspace; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.GremlinGraph; + +class DatabaseAccountsImpl extends GroupableResourcesCoreImpl implements DatabaseAccounts { + protected DatabaseAccountsImpl(CosmosDBManager manager) { + super(manager.inner().databaseAccounts(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + DatabaseAccountsInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + DatabaseAccountsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + DatabaseAccountsInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + DatabaseAccountsInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(Page innerPage) { + return Observable.from(innerPage.items()); + } + }) + .map(new Func1() { + @Override + public DatabaseAccount call(DatabaseAccountInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + DatabaseAccountsInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + DatabaseAccountsInner client = this.inner(); + return client.listAsync() + .flatMap(new Func1, Observable>() { + @Override + public Observable call(Page innerPage) { + return Observable.from(innerPage.items()); + } + }) + .map(new Func1() { + @Override + public DatabaseAccount call(DatabaseAccountInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public DatabaseAccountImpl define(String name) { + return wrapModel(name); + } + + @Override + public Completable failoverPriorityChangeAsync(String resourceGroupName, String accountName, List failoverPolicies) { + DatabaseAccountsInner client = this.inner(); + return client.failoverPriorityChangeAsync(resourceGroupName, accountName, failoverPolicies).toCompletable(); + } + + @Override + public Observable listKeysAsync(String resourceGroupName, String accountName) { + DatabaseAccountsInner client = this.inner(); + return client.listKeysAsync(resourceGroupName, accountName) + .map(new Func1() { + @Override + public DatabaseAccountListKeysResult call(DatabaseAccountListKeysResultInner inner) { + return new DatabaseAccountListKeysResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable listConnectionStringsAsync(String resourceGroupName, String accountName) { + DatabaseAccountsInner client = this.inner(); + return client.listConnectionStringsAsync(resourceGroupName, accountName) + .map(new Func1() { + @Override + public DatabaseAccountListConnectionStringsResult call(DatabaseAccountListConnectionStringsResultInner inner) { + return new DatabaseAccountListConnectionStringsResultImpl(inner, manager()); + } + }); + } + + @Override + public Completable offlineRegionAsync(String resourceGroupName, String accountName, String region) { + DatabaseAccountsInner client = this.inner(); + return client.offlineRegionAsync(resourceGroupName, accountName, region).toCompletable(); + } + + @Override + public Completable onlineRegionAsync(String resourceGroupName, String accountName, String region) { + DatabaseAccountsInner client = this.inner(); + return client.onlineRegionAsync(resourceGroupName, accountName, region).toCompletable(); + } + + @Override + public Observable listReadOnlyKeysAsync(String resourceGroupName, String accountName) { + DatabaseAccountsInner client = this.inner(); + return client.listReadOnlyKeysAsync(resourceGroupName, accountName) + .map(new Func1() { + @Override + public DatabaseAccountListReadOnlyKeysResult call(DatabaseAccountListReadOnlyKeysResultInner inner) { + return new DatabaseAccountListReadOnlyKeysResultImpl(inner, manager()); + } + }); + } + + @Override + public Completable regenerateKeyAsync(String resourceGroupName, String accountName, KeyKind keyKind) { + DatabaseAccountsInner client = this.inner(); + return client.regenerateKeyAsync(resourceGroupName, accountName, keyKind).toCompletable(); + } + + @Override + protected DatabaseAccountImpl wrapModel(DatabaseAccountInner inner) { + return new DatabaseAccountImpl(inner.name(), inner, manager()); + } + + @Override + protected DatabaseAccountImpl wrapModel(String name) { + return new DatabaseAccountImpl(name, new DatabaseAccountInner(), this.manager()); + } + + @Override + public SqlDatabaseImpl defineDatabasis(String name) { + return wrapDatabasisModel(name); + } + + @Override + public SqlContainerImpl defineContainer(String name) { + return wrapContainerModel(name); + } + + @Override + public MongoDBCollectionImpl defineCollection(String name) { + return wrapCollectionModel(name); + } + + @Override + public TableImpl defineTable(String name) { + return wrapTableModel(name); + } + + @Override + public CassandraKeyspaceImpl defineKeyspace(String name) { + return wrapKeyspaceModel(name); + } + + @Override + public GremlinGraphImpl defineGraph(String name) { + return wrapGraphModel(name); + } + + private SqlDatabaseImpl wrapDatabasisModel(String name) { + return new SqlDatabaseImpl(name, this.manager()); + } + + private SqlContainerImpl wrapContainerModel(String name) { + return new SqlContainerImpl(name, this.manager()); + } + + private MongoDBCollectionImpl wrapCollectionModel(String name) { + return new MongoDBCollectionImpl(name, this.manager()); + } + + private TableImpl wrapTableModel(String name) { + return new TableImpl(name, this.manager()); + } + + private CassandraKeyspaceImpl wrapKeyspaceModel(String name) { + return new CassandraKeyspaceImpl(name, this.manager()); + } + + private GremlinGraphImpl wrapGraphModel(String name) { + return new GremlinGraphImpl(name, this.manager()); + } + + private DatabaseAccountMetricImpl wrapDatabaseAccountMetricModel(MetricInner inner) { + return new DatabaseAccountMetricImpl(inner, manager()); + } + + private DatabaseAccountUsageImpl wrapDatabaseAccountUsageModel(UsageInner inner) { + return new DatabaseAccountUsageImpl(inner, manager()); + } + + private DatabaseAccountMetricDefinitionImpl wrapDatabaseAccountMetricDefinitionModel(MetricDefinitionInner inner) { + return new DatabaseAccountMetricDefinitionImpl(inner, manager()); + } + + private SqlDatabaseImpl wrapSqlDatabaseModel(SqlDatabaseInner inner) { + return new SqlDatabaseImpl(inner, manager()); + } + + private SqlContainerImpl wrapSqlContainerModel(SqlContainerInner inner) { + return new SqlContainerImpl(inner, manager()); + } + + private MongoDBCollectionImpl wrapMongoDBCollectionModel(MongoDBCollectionInner inner) { + return new MongoDBCollectionImpl(inner, manager()); + } + + private TableImpl wrapTableModel(TableInner inner) { + return new TableImpl(inner, manager()); + } + + private CassandraKeyspaceImpl wrapCassandraKeyspaceModel(CassandraKeyspaceInner inner) { + return new CassandraKeyspaceImpl(inner, manager()); + } + + private GremlinGraphImpl wrapGremlinGraphModel(GremlinGraphInner inner) { + return new GremlinGraphImpl(inner, manager()); + } + + private Observable getSqlContainerInnerUsingDatabaseAccountsInnerAsync(String id) { + String resourceGroupName = IdParsingUtils.getValueFromIdByName(id, "resourceGroups"); + String accountName = IdParsingUtils.getValueFromIdByName(id, "databaseAccounts"); + String databaseName = IdParsingUtils.getValueFromIdByName(id, "databases"); + String containerName = IdParsingUtils.getValueFromIdByName(id, "containers"); + DatabaseAccountsInner client = this.inner(); + return client.getSqlContainerAsync(resourceGroupName, accountName, databaseName, containerName); + } + + private Observable getMongoDBCollectionInnerUsingDatabaseAccountsInnerAsync(String id) { + String resourceGroupName = IdParsingUtils.getValueFromIdByName(id, "resourceGroups"); + String accountName = IdParsingUtils.getValueFromIdByName(id, "databaseAccounts"); + String databaseName = IdParsingUtils.getValueFromIdByName(id, "databases"); + String collectionName = IdParsingUtils.getValueFromIdByName(id, "collections"); + DatabaseAccountsInner client = this.inner(); + return client.getMongoDBCollectionAsync(resourceGroupName, accountName, databaseName, collectionName); + } + + private Observable getGremlinGraphInnerUsingDatabaseAccountsInnerAsync(String id) { + String resourceGroupName = IdParsingUtils.getValueFromIdByName(id, "resourceGroups"); + String accountName = IdParsingUtils.getValueFromIdByName(id, "databaseAccounts"); + String databaseName = IdParsingUtils.getValueFromIdByName(id, "databases"); + String graphName = IdParsingUtils.getValueFromIdByName(id, "graphs"); + DatabaseAccountsInner client = this.inner(); + return client.getGremlinGraphAsync(resourceGroupName, accountName, databaseName, graphName); + } + + @Override + public Observable getReadOnlyKeysAsync(String resourceGroupName, String accountName) { + DatabaseAccountsInner client = this.inner(); + return client.getReadOnlyKeysAsync(resourceGroupName, accountName) + .map(new Func1() { + @Override + public DatabaseAccountListReadOnlyKeysResult call(DatabaseAccountListReadOnlyKeysResultInner inner) { + return new DatabaseAccountListReadOnlyKeysResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable checkNameExistsAsync(String accountName) { + DatabaseAccountsInner client = this.inner(); + return client.checkNameExistsAsync(accountName) + ;} + + @Override + public Observable listMetricsAsync(String resourceGroupName, String accountName, String filter) { + DatabaseAccountsInner client = this.inner(); + return client.listMetricsAsync(resourceGroupName, accountName, filter) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public DatabaseAccountMetric call(MetricInner inner) { + return wrapDatabaseAccountMetricModel(inner); + } + }); + } + + @Override + public Observable listUsagesAsync(String resourceGroupName, String accountName) { + DatabaseAccountsInner client = this.inner(); + return client.listUsagesAsync(resourceGroupName, accountName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public DatabaseAccountUsage call(UsageInner inner) { + return wrapDatabaseAccountUsageModel(inner); + } + }); + } + + @Override + public Observable listMetricDefinitionsAsync(String resourceGroupName, String accountName) { + DatabaseAccountsInner client = this.inner(); + return client.listMetricDefinitionsAsync(resourceGroupName, accountName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public DatabaseAccountMetricDefinition call(MetricDefinitionInner inner) { + return wrapDatabaseAccountMetricDefinitionModel(inner); + } + }); + } + + @Override + public Observable listSqlDatabasesAsync(String resourceGroupName, String accountName) { + DatabaseAccountsInner client = this.inner(); + return client.listSqlDatabasesAsync(resourceGroupName, accountName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public SqlDatabase call(SqlDatabaseInner inner) { + return new SqlDatabaseImpl(inner, manager()); + } + }); + } + + @Override + public Observable getSqlDatabaseAsync(String resourceGroupName, String accountName, String databaseName) { + DatabaseAccountsInner client = this.inner(); + return client.getSqlDatabaseAsync(resourceGroupName, accountName, databaseName) + .map(new Func1() { + @Override + public SqlDatabase call(SqlDatabaseInner inner) { + return new SqlDatabaseImpl(inner, manager()); + } + }); + } + + @Override + public Completable deleteSqlDatabaseAsync(String resourceGroupName, String accountName, String databaseName) { + DatabaseAccountsInner client = this.inner(); + return client.deleteSqlDatabaseAsync(resourceGroupName, accountName, databaseName).toCompletable(); + } + + @Override + public Observable listMongoDBDatabasesAsync(String resourceGroupName, String accountName) { + DatabaseAccountsInner client = this.inner(); + return client.listMongoDBDatabasesAsync(resourceGroupName, accountName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public MongoDBDatabase call(MongoDBDatabaseInner inner) { + return new MongoDBDatabaseImpl(inner, manager()); + } + }); + } + + @Override + public Observable getMongoDBDatabaseAsync(String resourceGroupName, String accountName, String databaseName) { + DatabaseAccountsInner client = this.inner(); + return client.getMongoDBDatabaseAsync(resourceGroupName, accountName, databaseName) + .map(new Func1() { + @Override + public MongoDBDatabase call(MongoDBDatabaseInner inner) { + return new MongoDBDatabaseImpl(inner, manager()); + } + }); + } + + @Override + public Observable createUpdateMongoDBDatabaseAsync(String resourceGroupName, String accountName, String databaseName, MongoDBDatabaseCreateUpdateParameters createUpdateMongoDBDatabaseParameters) { + DatabaseAccountsInner client = this.inner(); + return client.createUpdateMongoDBDatabaseAsync(resourceGroupName, accountName, databaseName, createUpdateMongoDBDatabaseParameters) + .map(new Func1() { + @Override + public MongoDBDatabase call(MongoDBDatabaseInner inner) { + return new MongoDBDatabaseImpl(inner, manager()); + } + }); + } + + @Override + public Completable deleteMongoDBDatabaseAsync(String resourceGroupName, String accountName, String databaseName) { + DatabaseAccountsInner client = this.inner(); + return client.deleteMongoDBDatabaseAsync(resourceGroupName, accountName, databaseName).toCompletable(); + } + + @Override + public Observable listGremlinDatabasesAsync(String resourceGroupName, String accountName) { + DatabaseAccountsInner client = this.inner(); + return client.listGremlinDatabasesAsync(resourceGroupName, accountName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public GremlinDatabase call(GremlinDatabaseInner inner) { + return new GremlinDatabaseImpl(inner, manager()); + } + }); + } + + @Override + public Observable getGremlinDatabaseAsync(String resourceGroupName, String accountName, String databaseName) { + DatabaseAccountsInner client = this.inner(); + return client.getGremlinDatabaseAsync(resourceGroupName, accountName, databaseName) + .map(new Func1() { + @Override + public GremlinDatabase call(GremlinDatabaseInner inner) { + return new GremlinDatabaseImpl(inner, manager()); + } + }); + } + + @Override + public Observable createUpdateGremlinDatabaseAsync(String resourceGroupName, String accountName, String databaseName, GremlinDatabaseCreateUpdateParameters createUpdateGremlinDatabaseParameters) { + DatabaseAccountsInner client = this.inner(); + return client.createUpdateGremlinDatabaseAsync(resourceGroupName, accountName, databaseName, createUpdateGremlinDatabaseParameters) + .map(new Func1() { + @Override + public GremlinDatabase call(GremlinDatabaseInner inner) { + return new GremlinDatabaseImpl(inner, manager()); + } + }); + } + + @Override + public Completable deleteGremlinDatabaseAsync(String resourceGroupName, String accountName, String databaseName) { + DatabaseAccountsInner client = this.inner(); + return client.deleteGremlinDatabaseAsync(resourceGroupName, accountName, databaseName).toCompletable(); + } + + @Override + public Observable getSqlDatabaseThroughputAsync(String resourceGroupName, String accountName, String databaseName) { + DatabaseAccountsInner client = this.inner(); + return client.getSqlDatabaseThroughputAsync(resourceGroupName, accountName, databaseName) + .map(new Func1() { + @Override + public Throughput call(ThroughputInner inner) { + return new ThroughputImpl(inner, manager()); + } + }); + } + + @Override + public Observable updateSqlDatabaseThroughputAsync(String resourceGroupName, String accountName, String databaseName, ThroughputResource resource) { + DatabaseAccountsInner client = this.inner(); + return client.updateSqlDatabaseThroughputAsync(resourceGroupName, accountName, databaseName, resource) + .map(new Func1() { + @Override + public Throughput call(ThroughputInner inner) { + return new ThroughputImpl(inner, manager()); + } + }); + } + + @Override + public Observable getSqlContainerThroughputAsync(String resourceGroupName, String accountName, String databaseName, String containerName) { + DatabaseAccountsInner client = this.inner(); + return client.getSqlContainerThroughputAsync(resourceGroupName, accountName, databaseName, containerName) + .map(new Func1() { + @Override + public Throughput call(ThroughputInner inner) { + return new ThroughputImpl(inner, manager()); + } + }); + } + + @Override + public Observable updateSqlContainerThroughputAsync(String resourceGroupName, String accountName, String databaseName, String containerName, ThroughputResource resource) { + DatabaseAccountsInner client = this.inner(); + return client.updateSqlContainerThroughputAsync(resourceGroupName, accountName, databaseName, containerName, resource) + .map(new Func1() { + @Override + public Throughput call(ThroughputInner inner) { + return new ThroughputImpl(inner, manager()); + } + }); + } + + @Override + public Observable getMongoDBDatabaseThroughputAsync(String resourceGroupName, String accountName, String databaseName) { + DatabaseAccountsInner client = this.inner(); + return client.getMongoDBDatabaseThroughputAsync(resourceGroupName, accountName, databaseName) + .map(new Func1() { + @Override + public Throughput call(ThroughputInner inner) { + return new ThroughputImpl(inner, manager()); + } + }); + } + + @Override + public Observable updateMongoDBDatabaseThroughputAsync(String resourceGroupName, String accountName, String databaseName, ThroughputResource resource) { + DatabaseAccountsInner client = this.inner(); + return client.updateMongoDBDatabaseThroughputAsync(resourceGroupName, accountName, databaseName, resource) + .map(new Func1() { + @Override + public Throughput call(ThroughputInner inner) { + return new ThroughputImpl(inner, manager()); + } + }); + } + + @Override + public Observable getMongoDBCollectionThroughputAsync(String resourceGroupName, String accountName, String databaseName, String collectionName) { + DatabaseAccountsInner client = this.inner(); + return client.getMongoDBCollectionThroughputAsync(resourceGroupName, accountName, databaseName, collectionName) + .map(new Func1() { + @Override + public Throughput call(ThroughputInner inner) { + return new ThroughputImpl(inner, manager()); + } + }); + } + + @Override + public Observable updateMongoDBCollectionThroughputAsync(String resourceGroupName, String accountName, String databaseName, String collectionName, ThroughputResource resource) { + DatabaseAccountsInner client = this.inner(); + return client.updateMongoDBCollectionThroughputAsync(resourceGroupName, accountName, databaseName, collectionName, resource) + .map(new Func1() { + @Override + public Throughput call(ThroughputInner inner) { + return new ThroughputImpl(inner, manager()); + } + }); + } + + @Override + public Observable getTableThroughputAsync(String resourceGroupName, String accountName, String tableName) { + DatabaseAccountsInner client = this.inner(); + return client.getTableThroughputAsync(resourceGroupName, accountName, tableName) + .map(new Func1() { + @Override + public Throughput call(ThroughputInner inner) { + return new ThroughputImpl(inner, manager()); + } + }); + } + + @Override + public Observable updateTableThroughputAsync(String resourceGroupName, String accountName, String tableName, ThroughputResource resource) { + DatabaseAccountsInner client = this.inner(); + return client.updateTableThroughputAsync(resourceGroupName, accountName, tableName, resource) + .map(new Func1() { + @Override + public Throughput call(ThroughputInner inner) { + return new ThroughputImpl(inner, manager()); + } + }); + } + + @Override + public Observable getCassandraKeyspaceThroughputAsync(String resourceGroupName, String accountName, String keyspaceName) { + DatabaseAccountsInner client = this.inner(); + return client.getCassandraKeyspaceThroughputAsync(resourceGroupName, accountName, keyspaceName) + .map(new Func1() { + @Override + public Throughput call(ThroughputInner inner) { + return new ThroughputImpl(inner, manager()); + } + }); + } + + @Override + public Observable updateCassandraKeyspaceThroughputAsync(String resourceGroupName, String accountName, String keyspaceName, ThroughputResource resource) { + DatabaseAccountsInner client = this.inner(); + return client.updateCassandraKeyspaceThroughputAsync(resourceGroupName, accountName, keyspaceName, resource) + .map(new Func1() { + @Override + public Throughput call(ThroughputInner inner) { + return new ThroughputImpl(inner, manager()); + } + }); + } + + @Override + public Observable getCassandraTableThroughputAsync(String resourceGroupName, String accountName, String keyspaceName, String tableName) { + DatabaseAccountsInner client = this.inner(); + return client.getCassandraTableThroughputAsync(resourceGroupName, accountName, keyspaceName, tableName) + .map(new Func1() { + @Override + public Throughput call(ThroughputInner inner) { + return new ThroughputImpl(inner, manager()); + } + }); + } + + @Override + public Observable updateCassandraTableThroughputAsync(String resourceGroupName, String accountName, String keyspaceName, String tableName, ThroughputResource resource) { + DatabaseAccountsInner client = this.inner(); + return client.updateCassandraTableThroughputAsync(resourceGroupName, accountName, keyspaceName, tableName, resource) + .map(new Func1() { + @Override + public Throughput call(ThroughputInner inner) { + return new ThroughputImpl(inner, manager()); + } + }); + } + + @Override + public Observable getGremlinDatabaseThroughputAsync(String resourceGroupName, String accountName, String databaseName) { + DatabaseAccountsInner client = this.inner(); + return client.getGremlinDatabaseThroughputAsync(resourceGroupName, accountName, databaseName) + .map(new Func1() { + @Override + public Throughput call(ThroughputInner inner) { + return new ThroughputImpl(inner, manager()); + } + }); + } + + @Override + public Observable updateGremlinDatabaseThroughputAsync(String resourceGroupName, String accountName, String databaseName, ThroughputResource resource) { + DatabaseAccountsInner client = this.inner(); + return client.updateGremlinDatabaseThroughputAsync(resourceGroupName, accountName, databaseName, resource) + .map(new Func1() { + @Override + public Throughput call(ThroughputInner inner) { + return new ThroughputImpl(inner, manager()); + } + }); + } + + @Override + public Observable getGremlinGraphThroughputAsync(String resourceGroupName, String accountName, String databaseName, String graphName) { + DatabaseAccountsInner client = this.inner(); + return client.getGremlinGraphThroughputAsync(resourceGroupName, accountName, databaseName, graphName) + .map(new Func1() { + @Override + public Throughput call(ThroughputInner inner) { + return new ThroughputImpl(inner, manager()); + } + }); + } + + @Override + public Observable updateGremlinGraphThroughputAsync(String resourceGroupName, String accountName, String databaseName, String graphName, ThroughputResource resource) { + DatabaseAccountsInner client = this.inner(); + return client.updateGremlinGraphThroughputAsync(resourceGroupName, accountName, databaseName, graphName, resource) + .map(new Func1() { + @Override + public Throughput call(ThroughputInner inner) { + return new ThroughputImpl(inner, manager()); + } + }); + } + + @Override + public Observable getSqlContainerAsync(String resourceGroupName, String accountName, String databaseName, String containerName) { + DatabaseAccountsInner client = this.inner(); + return client.getSqlContainerAsync(resourceGroupName, accountName, databaseName, containerName) + .flatMap(new Func1>() { + @Override + public Observable call(SqlContainerInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((SqlContainer)wrapSqlContainerModel(inner)); + } + } + }); + } + + @Override + public Observable listSqlContainersAsync(String resourceGroupName, String accountName, String databaseName) { + DatabaseAccountsInner client = this.inner(); + return client.listSqlContainersAsync(resourceGroupName, accountName, databaseName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public SqlContainer call(SqlContainerInner inner) { + return wrapSqlContainerModel(inner); + } + }); + } + + @Override + public Completable deleteSqlContainerAsync(String resourceGroupName, String accountName, String databaseName, String containerName) { + DatabaseAccountsInner client = this.inner(); + return client.deleteSqlContainerAsync(resourceGroupName, accountName, databaseName, containerName).toCompletable(); + } + + @Override + public Observable getMongoDBCollectionAsync(String resourceGroupName, String accountName, String databaseName, String collectionName) { + DatabaseAccountsInner client = this.inner(); + return client.getMongoDBCollectionAsync(resourceGroupName, accountName, databaseName, collectionName) + .flatMap(new Func1>() { + @Override + public Observable call(MongoDBCollectionInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((MongoDBCollection)wrapMongoDBCollectionModel(inner)); + } + } + }); + } + + @Override + public Observable listMongoDBCollectionsAsync(String resourceGroupName, String accountName, String databaseName) { + DatabaseAccountsInner client = this.inner(); + return client.listMongoDBCollectionsAsync(resourceGroupName, accountName, databaseName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public MongoDBCollection call(MongoDBCollectionInner inner) { + return wrapMongoDBCollectionModel(inner); + } + }); + } + + @Override + public Completable deleteMongoDBCollectionAsync(String resourceGroupName, String accountName, String databaseName, String collectionName) { + DatabaseAccountsInner client = this.inner(); + return client.deleteMongoDBCollectionAsync(resourceGroupName, accountName, databaseName, collectionName).toCompletable(); + } + + @Override + public Observable
listTablesAsync(String resourceGroupName, String accountName) { + DatabaseAccountsInner client = this.inner(); + return client.listTablesAsync(resourceGroupName, accountName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public Table call(TableInner inner) { + return new TableImpl(inner, manager()); + } + }); + } + + @Override + public Observable
getTableAsync(String resourceGroupName, String accountName, String tableName) { + DatabaseAccountsInner client = this.inner(); + return client.getTableAsync(resourceGroupName, accountName, tableName) + .map(new Func1() { + @Override + public Table call(TableInner inner) { + return new TableImpl(inner, manager()); + } + }); + } + + @Override + public Completable deleteTableAsync(String resourceGroupName, String accountName, String tableName) { + DatabaseAccountsInner client = this.inner(); + return client.deleteTableAsync(resourceGroupName, accountName, tableName).toCompletable(); + } + + @Override + public Observable listCassandraTablesAsync(String resourceGroupName, String accountName, String keyspaceName) { + DatabaseAccountsInner client = this.inner(); + return client.listCassandraTablesAsync(resourceGroupName, accountName, keyspaceName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public CassandraTable call(CassandraTableInner inner) { + return new CassandraTableImpl(inner, manager()); + } + }); + } + + @Override + public Observable getCassandraTableAsync(String resourceGroupName, String accountName, String keyspaceName, String tableName) { + DatabaseAccountsInner client = this.inner(); + return client.getCassandraTableAsync(resourceGroupName, accountName, keyspaceName, tableName) + .map(new Func1() { + @Override + public CassandraTable call(CassandraTableInner inner) { + return new CassandraTableImpl(inner, manager()); + } + }); + } + + @Override + public Observable createUpdateCassandraTableAsync(String resourceGroupName, String accountName, String keyspaceName, String tableName, CassandraTableCreateUpdateParameters createUpdateCassandraTableParameters) { + DatabaseAccountsInner client = this.inner(); + return client.createUpdateCassandraTableAsync(resourceGroupName, accountName, keyspaceName, tableName, createUpdateCassandraTableParameters) + .map(new Func1() { + @Override + public CassandraTable call(CassandraTableInner inner) { + return new CassandraTableImpl(inner, manager()); + } + }); + } + + @Override + public Completable deleteCassandraTableAsync(String resourceGroupName, String accountName, String keyspaceName, String tableName) { + DatabaseAccountsInner client = this.inner(); + return client.deleteCassandraTableAsync(resourceGroupName, accountName, keyspaceName, tableName).toCompletable(); + } + + @Override + public Observable listCassandraKeyspacesAsync(String resourceGroupName, String accountName) { + DatabaseAccountsInner client = this.inner(); + return client.listCassandraKeyspacesAsync(resourceGroupName, accountName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public CassandraKeyspace call(CassandraKeyspaceInner inner) { + return new CassandraKeyspaceImpl(inner, manager()); + } + }); + } + + @Override + public Observable getCassandraKeyspaceAsync(String resourceGroupName, String accountName, String keyspaceName) { + DatabaseAccountsInner client = this.inner(); + return client.getCassandraKeyspaceAsync(resourceGroupName, accountName, keyspaceName) + .map(new Func1() { + @Override + public CassandraKeyspace call(CassandraKeyspaceInner inner) { + return new CassandraKeyspaceImpl(inner, manager()); + } + }); + } + + @Override + public Completable deleteCassandraKeyspaceAsync(String resourceGroupName, String accountName, String keyspaceName) { + DatabaseAccountsInner client = this.inner(); + return client.deleteCassandraKeyspaceAsync(resourceGroupName, accountName, keyspaceName).toCompletable(); + } + + @Override + public Observable getGremlinGraphAsync(String resourceGroupName, String accountName, String databaseName, String graphName) { + DatabaseAccountsInner client = this.inner(); + return client.getGremlinGraphAsync(resourceGroupName, accountName, databaseName, graphName) + .flatMap(new Func1>() { + @Override + public Observable call(GremlinGraphInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((GremlinGraph)wrapGremlinGraphModel(inner)); + } + } + }); + } + + @Override + public Observable listGremlinGraphsAsync(String resourceGroupName, String accountName, String databaseName) { + DatabaseAccountsInner client = this.inner(); + return client.listGremlinGraphsAsync(resourceGroupName, accountName, databaseName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public GremlinGraph call(GremlinGraphInner inner) { + return wrapGremlinGraphModel(inner); + } + }); + } + + @Override + public Completable deleteGremlinGraphAsync(String resourceGroupName, String accountName, String databaseName, String graphName) { + DatabaseAccountsInner client = this.inner(); + return client.deleteGremlinGraphAsync(resourceGroupName, accountName, databaseName, graphName).toCompletable(); + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountsInner.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountsInner.java new file mode 100644 index 000000000000..0e7475fd2179 --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountsInner.java @@ -0,0 +1,10384 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.cosmosdb.v2015_04_08.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.CloudException; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.CassandraKeyspaceCreateUpdateParameters; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.CassandraTableCreateUpdateParameters; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.DatabaseAccountCreateUpdateParameters; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.DatabaseAccountPatchParameters; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.DatabaseAccountRegenerateKeyParameters; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.ErrorResponseException; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.FailoverPolicies; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.FailoverPolicy; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.GremlinDatabaseCreateUpdateParameters; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.GremlinGraphCreateUpdateParameters; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.KeyKind; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.MongoDBCollectionCreateUpdateParameters; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.MongoDBDatabaseCreateUpdateParameters; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.RegionForOnlineOffline; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.SqlContainerCreateUpdateParameters; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.SqlDatabaseCreateUpdateParameters; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.TableCreateUpdateParameters; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.ThroughputResource; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.ThroughputUpdateParameters; +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.HEAD; +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.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in DatabaseAccounts. + */ +public class DatabaseAccountsInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private DatabaseAccountsService service; + /** The service client containing this operation class. */ + private CosmosDBManagementClientImpl client; + + /** + * Initializes an instance of DatabaseAccountsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public DatabaseAccountsInner(Retrofit retrofit, CosmosDBManagementClientImpl client) { + this.service = retrofit.create(DatabaseAccountsService.class); + this.client = client; + } + + /** + * The interface defining all the services for DatabaseAccounts to be + * used by Retrofit to perform actually REST calls. + */ + interface DatabaseAccountsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cosmosdb.v2015_04_08.DatabaseAccounts getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}") + Observable> getByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @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.cosmosdb.v2015_04_08.DatabaseAccounts patch" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}") + Observable> patch(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Query("api-version") String apiVersion, @Body DatabaseAccountPatchParameters updateParameters, @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.cosmosdb.v2015_04_08.DatabaseAccounts beginPatch" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}") + Observable> beginPatch(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Query("api-version") String apiVersion, @Body DatabaseAccountPatchParameters updateParameters, @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.cosmosdb.v2015_04_08.DatabaseAccounts createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Query("api-version") String apiVersion, @Body DatabaseAccountCreateUpdateParameters createUpdateParameters, @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.cosmosdb.v2015_04_08.DatabaseAccounts beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}") + Observable> beginCreateOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Query("api-version") String apiVersion, @Body DatabaseAccountCreateUpdateParameters createUpdateParameters, @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.cosmosdb.v2015_04_08.DatabaseAccounts delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @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.cosmosdb.v2015_04_08.DatabaseAccounts beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @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.cosmosdb.v2015_04_08.DatabaseAccounts failoverPriorityChange" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/failoverPriorityChange") + Observable> failoverPriorityChange(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body FailoverPolicies failoverParameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cosmosdb.v2015_04_08.DatabaseAccounts beginFailoverPriorityChange" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/failoverPriorityChange") + Observable> beginFailoverPriorityChange(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body FailoverPolicies failoverParameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cosmosdb.v2015_04_08.DatabaseAccounts list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/databaseAccounts") + Observable> list(@Path("subscriptionId") String subscriptionId, @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.cosmosdb.v2015_04_08.DatabaseAccounts listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts") + Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @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.cosmosdb.v2015_04_08.DatabaseAccounts listKeys" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/listKeys") + Observable> listKeys(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @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.cosmosdb.v2015_04_08.DatabaseAccounts listConnectionStrings" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/listConnectionStrings") + Observable> listConnectionStrings(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @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.cosmosdb.v2015_04_08.DatabaseAccounts offlineRegion" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/offlineRegion") + Observable> offlineRegion(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body RegionForOnlineOffline regionParameterForOffline, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cosmosdb.v2015_04_08.DatabaseAccounts beginOfflineRegion" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/offlineRegion") + Observable> beginOfflineRegion(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body RegionForOnlineOffline regionParameterForOffline, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cosmosdb.v2015_04_08.DatabaseAccounts onlineRegion" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/onlineRegion") + Observable> onlineRegion(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body RegionForOnlineOffline regionParameterForOnline, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cosmosdb.v2015_04_08.DatabaseAccounts beginOnlineRegion" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/onlineRegion") + Observable> beginOnlineRegion(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body RegionForOnlineOffline regionParameterForOnline, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cosmosdb.v2015_04_08.DatabaseAccounts getReadOnlyKeys" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/readonlykeys") + Observable> getReadOnlyKeys(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @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.cosmosdb.v2015_04_08.DatabaseAccounts listReadOnlyKeys" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/readonlykeys") + Observable> listReadOnlyKeys(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @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.cosmosdb.v2015_04_08.DatabaseAccounts regenerateKey" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/regenerateKey") + Observable> regenerateKey(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body DatabaseAccountRegenerateKeyParameters keyToRegenerate, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cosmosdb.v2015_04_08.DatabaseAccounts beginRegenerateKey" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/regenerateKey") + Observable> beginRegenerateKey(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body DatabaseAccountRegenerateKeyParameters keyToRegenerate, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cosmosdb.v2015_04_08.DatabaseAccounts checkNameExists" }) + @HEAD("providers/Microsoft.DocumentDB/databaseAccountNames/{accountName}") + Observable> checkNameExists(@Path("accountName") String accountName, @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.cosmosdb.v2015_04_08.DatabaseAccounts listMetrics" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/metrics") + Observable> listMetrics(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Query("api-version") String apiVersion, @Query("$filter") String filter, @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.cosmosdb.v2015_04_08.DatabaseAccounts listUsages" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/usages") + Observable> listUsages(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Query("api-version") String apiVersion, @Query("$filter") String filter, @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.cosmosdb.v2015_04_08.DatabaseAccounts listMetricDefinitions" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/metricDefinitions") + Observable> listMetricDefinitions(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @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.cosmosdb.v2015_04_08.DatabaseAccounts listSqlDatabases" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/sql/databases") + Observable> listSqlDatabases(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @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.cosmosdb.v2015_04_08.DatabaseAccounts getSqlDatabase" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/sql/databases/{databaseName}") + Observable> getSqlDatabase(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("databaseName") String databaseName, @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.cosmosdb.v2015_04_08.DatabaseAccounts createUpdateSqlDatabase" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/sql/databases/{databaseName}") + Observable> createUpdateSqlDatabase(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("databaseName") String databaseName, @Query("api-version") String apiVersion, @Body SqlDatabaseCreateUpdateParameters createUpdateSqlDatabaseParameters, @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.cosmosdb.v2015_04_08.DatabaseAccounts beginCreateUpdateSqlDatabase" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/sql/databases/{databaseName}") + Observable> beginCreateUpdateSqlDatabase(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("databaseName") String databaseName, @Query("api-version") String apiVersion, @Body SqlDatabaseCreateUpdateParameters createUpdateSqlDatabaseParameters, @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.cosmosdb.v2015_04_08.DatabaseAccounts deleteSqlDatabase" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/sql/databases/{databaseName}", method = "DELETE", hasBody = true) + Observable> deleteSqlDatabase(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("databaseName") String databaseName, @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.cosmosdb.v2015_04_08.DatabaseAccounts beginDeleteSqlDatabase" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/sql/databases/{databaseName}", method = "DELETE", hasBody = true) + Observable> beginDeleteSqlDatabase(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("databaseName") String databaseName, @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.cosmosdb.v2015_04_08.DatabaseAccounts getSqlDatabaseThroughput" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/sql/databases/{databaseName}/settings/throughput") + Observable> getSqlDatabaseThroughput(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("databaseName") String databaseName, @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.cosmosdb.v2015_04_08.DatabaseAccounts updateSqlDatabaseThroughput" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/sql/databases/{databaseName}/settings/throughput") + Observable> updateSqlDatabaseThroughput(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("databaseName") String databaseName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body ThroughputUpdateParameters updateThroughputParameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cosmosdb.v2015_04_08.DatabaseAccounts beginUpdateSqlDatabaseThroughput" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/sql/databases/{databaseName}/settings/throughput") + Observable> beginUpdateSqlDatabaseThroughput(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("databaseName") String databaseName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body ThroughputUpdateParameters updateThroughputParameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cosmosdb.v2015_04_08.DatabaseAccounts listSqlContainers" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/sql/databases/{databaseName}/containers") + Observable> listSqlContainers(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("databaseName") String databaseName, @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.cosmosdb.v2015_04_08.DatabaseAccounts getSqlContainer" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/sql/databases/{databaseName}/containers/{containerName}") + Observable> getSqlContainer(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("databaseName") String databaseName, @Path("containerName") String containerName, @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.cosmosdb.v2015_04_08.DatabaseAccounts createUpdateSqlContainer" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/sql/databases/{databaseName}/containers/{containerName}") + Observable> createUpdateSqlContainer(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("databaseName") String databaseName, @Path("containerName") String containerName, @Query("api-version") String apiVersion, @Body SqlContainerCreateUpdateParameters createUpdateSqlContainerParameters, @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.cosmosdb.v2015_04_08.DatabaseAccounts beginCreateUpdateSqlContainer" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/sql/databases/{databaseName}/containers/{containerName}") + Observable> beginCreateUpdateSqlContainer(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("databaseName") String databaseName, @Path("containerName") String containerName, @Query("api-version") String apiVersion, @Body SqlContainerCreateUpdateParameters createUpdateSqlContainerParameters, @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.cosmosdb.v2015_04_08.DatabaseAccounts deleteSqlContainer" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/sql/databases/{databaseName}/containers/{containerName}", method = "DELETE", hasBody = true) + Observable> deleteSqlContainer(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("databaseName") String databaseName, @Path("containerName") String containerName, @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.cosmosdb.v2015_04_08.DatabaseAccounts beginDeleteSqlContainer" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/sql/databases/{databaseName}/containers/{containerName}", method = "DELETE", hasBody = true) + Observable> beginDeleteSqlContainer(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("databaseName") String databaseName, @Path("containerName") String containerName, @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.cosmosdb.v2015_04_08.DatabaseAccounts getSqlContainerThroughput" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/sql/databases/{databaseName}/containers/{containerName}/settings/throughput") + Observable> getSqlContainerThroughput(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("databaseName") String databaseName, @Path("containerName") String containerName, @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.cosmosdb.v2015_04_08.DatabaseAccounts updateSqlContainerThroughput" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/sql/databases/{databaseName}/containers/{containerName}/settings/throughput") + Observable> updateSqlContainerThroughput(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("databaseName") String databaseName, @Path("containerName") String containerName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body ThroughputUpdateParameters updateThroughputParameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cosmosdb.v2015_04_08.DatabaseAccounts beginUpdateSqlContainerThroughput" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/sql/databases/{databaseName}/containers/{containerName}/settings/throughput") + Observable> beginUpdateSqlContainerThroughput(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("databaseName") String databaseName, @Path("containerName") String containerName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body ThroughputUpdateParameters updateThroughputParameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cosmosdb.v2015_04_08.DatabaseAccounts listMongoDBDatabases" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/mongodb/databases") + Observable> listMongoDBDatabases(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @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.cosmosdb.v2015_04_08.DatabaseAccounts getMongoDBDatabase" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/mongodb/databases/{databaseName}") + Observable> getMongoDBDatabase(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("databaseName") String databaseName, @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.cosmosdb.v2015_04_08.DatabaseAccounts createUpdateMongoDBDatabase" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/mongodb/databases/{databaseName}") + Observable> createUpdateMongoDBDatabase(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("databaseName") String databaseName, @Query("api-version") String apiVersion, @Body MongoDBDatabaseCreateUpdateParameters createUpdateMongoDBDatabaseParameters, @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.cosmosdb.v2015_04_08.DatabaseAccounts beginCreateUpdateMongoDBDatabase" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/mongodb/databases/{databaseName}") + Observable> beginCreateUpdateMongoDBDatabase(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("databaseName") String databaseName, @Query("api-version") String apiVersion, @Body MongoDBDatabaseCreateUpdateParameters createUpdateMongoDBDatabaseParameters, @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.cosmosdb.v2015_04_08.DatabaseAccounts deleteMongoDBDatabase" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/mongodb/databases/{databaseName}", method = "DELETE", hasBody = true) + Observable> deleteMongoDBDatabase(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("databaseName") String databaseName, @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.cosmosdb.v2015_04_08.DatabaseAccounts beginDeleteMongoDBDatabase" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/mongodb/databases/{databaseName}", method = "DELETE", hasBody = true) + Observable> beginDeleteMongoDBDatabase(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("databaseName") String databaseName, @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.cosmosdb.v2015_04_08.DatabaseAccounts getMongoDBDatabaseThroughput" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/mongodb/databases/{databaseName}/settings/throughput") + Observable> getMongoDBDatabaseThroughput(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("databaseName") String databaseName, @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.cosmosdb.v2015_04_08.DatabaseAccounts updateMongoDBDatabaseThroughput" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/mongodb/databases/{databaseName}/settings/throughput") + Observable> updateMongoDBDatabaseThroughput(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("databaseName") String databaseName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body ThroughputUpdateParameters updateThroughputParameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cosmosdb.v2015_04_08.DatabaseAccounts beginUpdateMongoDBDatabaseThroughput" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/mongodb/databases/{databaseName}/settings/throughput") + Observable> beginUpdateMongoDBDatabaseThroughput(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("databaseName") String databaseName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body ThroughputUpdateParameters updateThroughputParameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cosmosdb.v2015_04_08.DatabaseAccounts listMongoDBCollections" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/mongodb/databases/{databaseName}/collections") + Observable> listMongoDBCollections(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("databaseName") String databaseName, @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.cosmosdb.v2015_04_08.DatabaseAccounts getMongoDBCollection" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/mongodb/databases/{databaseName}/collections/{collectionName}") + Observable> getMongoDBCollection(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("databaseName") String databaseName, @Path("collectionName") String collectionName, @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.cosmosdb.v2015_04_08.DatabaseAccounts createUpdateMongoDBCollection" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/mongodb/databases/{databaseName}/collections/{collectionName}") + Observable> createUpdateMongoDBCollection(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("databaseName") String databaseName, @Path("collectionName") String collectionName, @Query("api-version") String apiVersion, @Body MongoDBCollectionCreateUpdateParameters createUpdateMongoDBCollectionParameters, @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.cosmosdb.v2015_04_08.DatabaseAccounts beginCreateUpdateMongoDBCollection" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/mongodb/databases/{databaseName}/collections/{collectionName}") + Observable> beginCreateUpdateMongoDBCollection(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("databaseName") String databaseName, @Path("collectionName") String collectionName, @Query("api-version") String apiVersion, @Body MongoDBCollectionCreateUpdateParameters createUpdateMongoDBCollectionParameters, @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.cosmosdb.v2015_04_08.DatabaseAccounts deleteMongoDBCollection" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/mongodb/databases/{databaseName}/collections/{collectionName}", method = "DELETE", hasBody = true) + Observable> deleteMongoDBCollection(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("databaseName") String databaseName, @Path("collectionName") String collectionName, @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.cosmosdb.v2015_04_08.DatabaseAccounts beginDeleteMongoDBCollection" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/mongodb/databases/{databaseName}/collections/{collectionName}", method = "DELETE", hasBody = true) + Observable> beginDeleteMongoDBCollection(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("databaseName") String databaseName, @Path("collectionName") String collectionName, @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.cosmosdb.v2015_04_08.DatabaseAccounts getMongoDBCollectionThroughput" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/mongodb/databases/{databaseName}/collections/{collectionName}/settings/throughput") + Observable> getMongoDBCollectionThroughput(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("databaseName") String databaseName, @Path("collectionName") String collectionName, @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.cosmosdb.v2015_04_08.DatabaseAccounts updateMongoDBCollectionThroughput" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/mongodb/databases/{databaseName}/collections/{collectionName}/settings/throughput") + Observable> updateMongoDBCollectionThroughput(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("databaseName") String databaseName, @Path("collectionName") String collectionName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body ThroughputUpdateParameters updateThroughputParameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cosmosdb.v2015_04_08.DatabaseAccounts beginUpdateMongoDBCollectionThroughput" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/mongodb/databases/{databaseName}/collections/{collectionName}/settings/throughput") + Observable> beginUpdateMongoDBCollectionThroughput(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("databaseName") String databaseName, @Path("collectionName") String collectionName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body ThroughputUpdateParameters updateThroughputParameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cosmosdb.v2015_04_08.DatabaseAccounts listTables" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/table/tables") + Observable> listTables(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @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.cosmosdb.v2015_04_08.DatabaseAccounts getTable" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/table/tables/{tableName}") + Observable> getTable(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("tableName") String tableName, @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.cosmosdb.v2015_04_08.DatabaseAccounts createUpdateTable" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/table/tables/{tableName}") + Observable> createUpdateTable(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("tableName") String tableName, @Query("api-version") String apiVersion, @Body TableCreateUpdateParameters createUpdateTableParameters, @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.cosmosdb.v2015_04_08.DatabaseAccounts beginCreateUpdateTable" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/table/tables/{tableName}") + Observable> beginCreateUpdateTable(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("tableName") String tableName, @Query("api-version") String apiVersion, @Body TableCreateUpdateParameters createUpdateTableParameters, @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.cosmosdb.v2015_04_08.DatabaseAccounts deleteTable" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/table/tables/{tableName}", method = "DELETE", hasBody = true) + Observable> deleteTable(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("tableName") String tableName, @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.cosmosdb.v2015_04_08.DatabaseAccounts beginDeleteTable" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/table/tables/{tableName}", method = "DELETE", hasBody = true) + Observable> beginDeleteTable(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("tableName") String tableName, @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.cosmosdb.v2015_04_08.DatabaseAccounts getTableThroughput" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/table/tables/{tableName}/settings/throughput") + Observable> getTableThroughput(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("tableName") String tableName, @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.cosmosdb.v2015_04_08.DatabaseAccounts updateTableThroughput" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/table/tables/{tableName}/settings/throughput") + Observable> updateTableThroughput(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("tableName") String tableName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body ThroughputUpdateParameters updateThroughputParameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cosmosdb.v2015_04_08.DatabaseAccounts beginUpdateTableThroughput" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/table/tables/{tableName}/settings/throughput") + Observable> beginUpdateTableThroughput(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("tableName") String tableName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body ThroughputUpdateParameters updateThroughputParameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cosmosdb.v2015_04_08.DatabaseAccounts listCassandraKeyspaces" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/cassandra/keyspaces") + Observable> listCassandraKeyspaces(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @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.cosmosdb.v2015_04_08.DatabaseAccounts getCassandraKeyspace" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/cassandra/keyspaces/{keyspaceName}") + Observable> getCassandraKeyspace(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("keyspaceName") String keyspaceName, @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.cosmosdb.v2015_04_08.DatabaseAccounts createUpdateCassandraKeyspace" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/cassandra/keyspaces/{keyspaceName}") + Observable> createUpdateCassandraKeyspace(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("keyspaceName") String keyspaceName, @Query("api-version") String apiVersion, @Body CassandraKeyspaceCreateUpdateParameters createUpdateCassandraKeyspaceParameters, @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.cosmosdb.v2015_04_08.DatabaseAccounts beginCreateUpdateCassandraKeyspace" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/cassandra/keyspaces/{keyspaceName}") + Observable> beginCreateUpdateCassandraKeyspace(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("keyspaceName") String keyspaceName, @Query("api-version") String apiVersion, @Body CassandraKeyspaceCreateUpdateParameters createUpdateCassandraKeyspaceParameters, @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.cosmosdb.v2015_04_08.DatabaseAccounts deleteCassandraKeyspace" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/cassandra/keyspaces/{keyspaceName}", method = "DELETE", hasBody = true) + Observable> deleteCassandraKeyspace(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("keyspaceName") String keyspaceName, @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.cosmosdb.v2015_04_08.DatabaseAccounts beginDeleteCassandraKeyspace" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/cassandra/keyspaces/{keyspaceName}", method = "DELETE", hasBody = true) + Observable> beginDeleteCassandraKeyspace(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("keyspaceName") String keyspaceName, @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.cosmosdb.v2015_04_08.DatabaseAccounts getCassandraKeyspaceThroughput" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/cassandra/keyspaces/{keyspaceName}/settings/throughput") + Observable> getCassandraKeyspaceThroughput(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("keyspaceName") String keyspaceName, @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.cosmosdb.v2015_04_08.DatabaseAccounts updateCassandraKeyspaceThroughput" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/cassandra/keyspaces/{keyspaceName}/settings/throughput") + Observable> updateCassandraKeyspaceThroughput(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("keyspaceName") String keyspaceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body ThroughputUpdateParameters updateThroughputParameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cosmosdb.v2015_04_08.DatabaseAccounts beginUpdateCassandraKeyspaceThroughput" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/cassandra/keyspaces/{keyspaceName}/settings/throughput") + Observable> beginUpdateCassandraKeyspaceThroughput(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("keyspaceName") String keyspaceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body ThroughputUpdateParameters updateThroughputParameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cosmosdb.v2015_04_08.DatabaseAccounts listCassandraTables" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/cassandra/keyspaces/{keyspaceName}/tables") + Observable> listCassandraTables(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("keyspaceName") String keyspaceName, @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.cosmosdb.v2015_04_08.DatabaseAccounts getCassandraTable" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/cassandra/keyspaces/{keyspaceName}/tables/{tableName}") + Observable> getCassandraTable(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("keyspaceName") String keyspaceName, @Path("tableName") String tableName, @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.cosmosdb.v2015_04_08.DatabaseAccounts createUpdateCassandraTable" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/cassandra/keyspaces/{keyspaceName}/tables/{tableName}") + Observable> createUpdateCassandraTable(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("keyspaceName") String keyspaceName, @Path("tableName") String tableName, @Query("api-version") String apiVersion, @Body CassandraTableCreateUpdateParameters createUpdateCassandraTableParameters, @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.cosmosdb.v2015_04_08.DatabaseAccounts beginCreateUpdateCassandraTable" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/cassandra/keyspaces/{keyspaceName}/tables/{tableName}") + Observable> beginCreateUpdateCassandraTable(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("keyspaceName") String keyspaceName, @Path("tableName") String tableName, @Query("api-version") String apiVersion, @Body CassandraTableCreateUpdateParameters createUpdateCassandraTableParameters, @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.cosmosdb.v2015_04_08.DatabaseAccounts deleteCassandraTable" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/cassandra/keyspaces/{keyspaceName}/tables/{tableName}", method = "DELETE", hasBody = true) + Observable> deleteCassandraTable(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("keyspaceName") String keyspaceName, @Path("tableName") String tableName, @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.cosmosdb.v2015_04_08.DatabaseAccounts beginDeleteCassandraTable" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/cassandra/keyspaces/{keyspaceName}/tables/{tableName}", method = "DELETE", hasBody = true) + Observable> beginDeleteCassandraTable(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("keyspaceName") String keyspaceName, @Path("tableName") String tableName, @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.cosmosdb.v2015_04_08.DatabaseAccounts getCassandraTableThroughput" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/cassandra/keyspaces/{keyspaceName}/tables/{tableName}/settings/throughput") + Observable> getCassandraTableThroughput(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("keyspaceName") String keyspaceName, @Path("tableName") String tableName, @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.cosmosdb.v2015_04_08.DatabaseAccounts updateCassandraTableThroughput" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/cassandra/keyspaces/{keyspaceName}/tables/{tableName}/settings/throughput") + Observable> updateCassandraTableThroughput(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("keyspaceName") String keyspaceName, @Path("tableName") String tableName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body ThroughputUpdateParameters updateThroughputParameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cosmosdb.v2015_04_08.DatabaseAccounts beginUpdateCassandraTableThroughput" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/cassandra/keyspaces/{keyspaceName}/tables/{tableName}/settings/throughput") + Observable> beginUpdateCassandraTableThroughput(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("keyspaceName") String keyspaceName, @Path("tableName") String tableName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body ThroughputUpdateParameters updateThroughputParameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cosmosdb.v2015_04_08.DatabaseAccounts listGremlinDatabases" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/gremlin/databases") + Observable> listGremlinDatabases(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @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.cosmosdb.v2015_04_08.DatabaseAccounts getGremlinDatabase" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/gremlin/databases/{databaseName}") + Observable> getGremlinDatabase(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("databaseName") String databaseName, @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.cosmosdb.v2015_04_08.DatabaseAccounts createUpdateGremlinDatabase" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/gremlin/databases/{databaseName}") + Observable> createUpdateGremlinDatabase(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("databaseName") String databaseName, @Query("api-version") String apiVersion, @Body GremlinDatabaseCreateUpdateParameters createUpdateGremlinDatabaseParameters, @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.cosmosdb.v2015_04_08.DatabaseAccounts beginCreateUpdateGremlinDatabase" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/gremlin/databases/{databaseName}") + Observable> beginCreateUpdateGremlinDatabase(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("databaseName") String databaseName, @Query("api-version") String apiVersion, @Body GremlinDatabaseCreateUpdateParameters createUpdateGremlinDatabaseParameters, @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.cosmosdb.v2015_04_08.DatabaseAccounts deleteGremlinDatabase" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/gremlin/databases/{databaseName}", method = "DELETE", hasBody = true) + Observable> deleteGremlinDatabase(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("databaseName") String databaseName, @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.cosmosdb.v2015_04_08.DatabaseAccounts beginDeleteGremlinDatabase" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/gremlin/databases/{databaseName}", method = "DELETE", hasBody = true) + Observable> beginDeleteGremlinDatabase(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("databaseName") String databaseName, @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.cosmosdb.v2015_04_08.DatabaseAccounts getGremlinDatabaseThroughput" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/gremlin/databases/{databaseName}/settings/throughput") + Observable> getGremlinDatabaseThroughput(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("databaseName") String databaseName, @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.cosmosdb.v2015_04_08.DatabaseAccounts updateGremlinDatabaseThroughput" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/gremlin/databases/{databaseName}/settings/throughput") + Observable> updateGremlinDatabaseThroughput(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("databaseName") String databaseName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body ThroughputUpdateParameters updateThroughputParameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cosmosdb.v2015_04_08.DatabaseAccounts beginUpdateGremlinDatabaseThroughput" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/gremlin/databases/{databaseName}/settings/throughput") + Observable> beginUpdateGremlinDatabaseThroughput(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("databaseName") String databaseName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body ThroughputUpdateParameters updateThroughputParameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cosmosdb.v2015_04_08.DatabaseAccounts listGremlinGraphs" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/gremlin/databases/{databaseName}/graphs") + Observable> listGremlinGraphs(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("databaseName") String databaseName, @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.cosmosdb.v2015_04_08.DatabaseAccounts getGremlinGraph" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/gremlin/databases/{databaseName}/graphs/{graphName}") + Observable> getGremlinGraph(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("databaseName") String databaseName, @Path("graphName") String graphName, @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.cosmosdb.v2015_04_08.DatabaseAccounts createUpdateGremlinGraph" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/gremlin/databases/{databaseName}/graphs/{graphName}") + Observable> createUpdateGremlinGraph(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("databaseName") String databaseName, @Path("graphName") String graphName, @Query("api-version") String apiVersion, @Body GremlinGraphCreateUpdateParameters createUpdateGremlinGraphParameters, @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.cosmosdb.v2015_04_08.DatabaseAccounts beginCreateUpdateGremlinGraph" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/gremlin/databases/{databaseName}/graphs/{graphName}") + Observable> beginCreateUpdateGremlinGraph(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("databaseName") String databaseName, @Path("graphName") String graphName, @Query("api-version") String apiVersion, @Body GremlinGraphCreateUpdateParameters createUpdateGremlinGraphParameters, @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.cosmosdb.v2015_04_08.DatabaseAccounts deleteGremlinGraph" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/gremlin/databases/{databaseName}/graphs/{graphName}", method = "DELETE", hasBody = true) + Observable> deleteGremlinGraph(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("databaseName") String databaseName, @Path("graphName") String graphName, @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.cosmosdb.v2015_04_08.DatabaseAccounts beginDeleteGremlinGraph" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/gremlin/databases/{databaseName}/graphs/{graphName}", method = "DELETE", hasBody = true) + Observable> beginDeleteGremlinGraph(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("databaseName") String databaseName, @Path("graphName") String graphName, @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.cosmosdb.v2015_04_08.DatabaseAccounts getGremlinGraphThroughput" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/gremlin/databases/{databaseName}/graphs/{graphName}/settings/throughput") + Observable> getGremlinGraphThroughput(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("databaseName") String databaseName, @Path("graphName") String graphName, @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.cosmosdb.v2015_04_08.DatabaseAccounts updateGremlinGraphThroughput" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/gremlin/databases/{databaseName}/graphs/{graphName}/settings/throughput") + Observable> updateGremlinGraphThroughput(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("databaseName") String databaseName, @Path("graphName") String graphName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body ThroughputUpdateParameters updateThroughputParameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cosmosdb.v2015_04_08.DatabaseAccounts beginUpdateGremlinGraphThroughput" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/gremlin/databases/{databaseName}/graphs/{graphName}/settings/throughput") + Observable> beginUpdateGremlinGraphThroughput(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("databaseName") String databaseName, @Path("graphName") String graphName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body ThroughputUpdateParameters updateThroughputParameters, @Header("User-Agent") String userAgent); + + } + + /** + * Retrieves the properties of an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account 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 DatabaseAccountInner object if successful. + */ + public DatabaseAccountInner getByResourceGroup(String resourceGroupName, String accountName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * Retrieves the properties of an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account 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 resourceGroupName, String accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * Retrieves the properties of an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DatabaseAccountInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String accountName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, DatabaseAccountInner>() { + @Override + public DatabaseAccountInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Retrieves the properties of an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DatabaseAccountInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String accountName) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName 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(this.client.subscriptionId(), resourceGroupName, accountName, 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); + } + + /** + * Patches the properties of an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param updateParameters The tags parameter to patch for the current database account. + * @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 DatabaseAccountInner object if successful. + */ + public DatabaseAccountInner patch(String resourceGroupName, String accountName, DatabaseAccountPatchParameters updateParameters) { + return patchWithServiceResponseAsync(resourceGroupName, accountName, updateParameters).toBlocking().last().body(); + } + + /** + * Patches the properties of an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param updateParameters The tags parameter to patch for the current database account. + * @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 patchAsync(String resourceGroupName, String accountName, DatabaseAccountPatchParameters updateParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(patchWithServiceResponseAsync(resourceGroupName, accountName, updateParameters), serviceCallback); + } + + /** + * Patches the properties of an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param updateParameters The tags parameter to patch for the current database account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable patchAsync(String resourceGroupName, String accountName, DatabaseAccountPatchParameters updateParameters) { + return patchWithServiceResponseAsync(resourceGroupName, accountName, updateParameters).map(new Func1, DatabaseAccountInner>() { + @Override + public DatabaseAccountInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Patches the properties of an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param updateParameters The tags parameter to patch for the current database account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> patchWithServiceResponseAsync(String resourceGroupName, String accountName, DatabaseAccountPatchParameters updateParameters) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName 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 (updateParameters == null) { + throw new IllegalArgumentException("Parameter updateParameters is required and cannot be null."); + } + Validator.validate(updateParameters); + Observable> observable = service.patch(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), updateParameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Patches the properties of an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param updateParameters The tags parameter to patch for the current database account. + * @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 DatabaseAccountInner object if successful. + */ + public DatabaseAccountInner beginPatch(String resourceGroupName, String accountName, DatabaseAccountPatchParameters updateParameters) { + return beginPatchWithServiceResponseAsync(resourceGroupName, accountName, updateParameters).toBlocking().single().body(); + } + + /** + * Patches the properties of an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param updateParameters The tags parameter to patch for the current database account. + * @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 beginPatchAsync(String resourceGroupName, String accountName, DatabaseAccountPatchParameters updateParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginPatchWithServiceResponseAsync(resourceGroupName, accountName, updateParameters), serviceCallback); + } + + /** + * Patches the properties of an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param updateParameters The tags parameter to patch for the current database account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DatabaseAccountInner object + */ + public Observable beginPatchAsync(String resourceGroupName, String accountName, DatabaseAccountPatchParameters updateParameters) { + return beginPatchWithServiceResponseAsync(resourceGroupName, accountName, updateParameters).map(new Func1, DatabaseAccountInner>() { + @Override + public DatabaseAccountInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Patches the properties of an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param updateParameters The tags parameter to patch for the current database account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DatabaseAccountInner object + */ + public Observable> beginPatchWithServiceResponseAsync(String resourceGroupName, String accountName, DatabaseAccountPatchParameters updateParameters) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName 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 (updateParameters == null) { + throw new IllegalArgumentException("Parameter updateParameters is required and cannot be null."); + } + Validator.validate(updateParameters); + return service.beginPatch(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), updateParameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginPatchDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginPatchDelegate(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 Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param createUpdateParameters The parameters to provide for the current database account. + * @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 DatabaseAccountInner object if successful. + */ + public DatabaseAccountInner createOrUpdate(String resourceGroupName, String accountName, DatabaseAccountCreateUpdateParameters createUpdateParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, createUpdateParameters).toBlocking().last().body(); + } + + /** + * Creates or updates an Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param createUpdateParameters The parameters to provide for the current database account. + * @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 resourceGroupName, String accountName, DatabaseAccountCreateUpdateParameters createUpdateParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, createUpdateParameters), serviceCallback); + } + + /** + * Creates or updates an Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param createUpdateParameters The parameters to provide for the current database account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String accountName, DatabaseAccountCreateUpdateParameters createUpdateParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, createUpdateParameters).map(new Func1, DatabaseAccountInner>() { + @Override + public DatabaseAccountInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates an Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param createUpdateParameters The parameters to provide for the current database account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String accountName, DatabaseAccountCreateUpdateParameters createUpdateParameters) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName 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 (createUpdateParameters == null) { + throw new IllegalArgumentException("Parameter createUpdateParameters is required and cannot be null."); + } + Validator.validate(createUpdateParameters); + Observable> observable = service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), createUpdateParameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates or updates an Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param createUpdateParameters The parameters to provide for the current database account. + * @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 DatabaseAccountInner object if successful. + */ + public DatabaseAccountInner beginCreateOrUpdate(String resourceGroupName, String accountName, DatabaseAccountCreateUpdateParameters createUpdateParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, createUpdateParameters).toBlocking().single().body(); + } + + /** + * Creates or updates an Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param createUpdateParameters The parameters to provide for the current database account. + * @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 resourceGroupName, String accountName, DatabaseAccountCreateUpdateParameters createUpdateParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, createUpdateParameters), serviceCallback); + } + + /** + * Creates or updates an Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param createUpdateParameters The parameters to provide for the current database account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DatabaseAccountInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String accountName, DatabaseAccountCreateUpdateParameters createUpdateParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, createUpdateParameters).map(new Func1, DatabaseAccountInner>() { + @Override + public DatabaseAccountInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates an Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param createUpdateParameters The parameters to provide for the current database account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DatabaseAccountInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String accountName, DatabaseAccountCreateUpdateParameters createUpdateParameters) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName 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 (createUpdateParameters == null) { + throw new IllegalArgumentException("Parameter createUpdateParameters is required and cannot be null."); + } + Validator.validate(createUpdateParameters); + return service.beginCreateOrUpdate(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), createUpdateParameters, 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 an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account 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 resourceGroupName, String accountName) { + deleteWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().last().body(); + } + + /** + * Deletes an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account 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 resourceGroupName, String accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * Deletes an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String accountName) { + return deleteWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String accountName) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName 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(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account 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 resourceGroupName, String accountName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * Deletes an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account 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 resourceGroupName, String accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * Deletes an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String accountName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String accountName) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName 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(this.client.subscriptionId(), resourceGroupName, accountName, 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(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Changes the failover priority for the Azure Cosmos DB database account. A failover priority of 0 indicates a write region. The maximum value for a failover priority = (total number of regions - 1). Failover priority values must be unique for each of the regions in which the database account exists. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param failoverPolicies List of failover policies. + * @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 failoverPriorityChange(String resourceGroupName, String accountName, List failoverPolicies) { + failoverPriorityChangeWithServiceResponseAsync(resourceGroupName, accountName, failoverPolicies).toBlocking().last().body(); + } + + /** + * Changes the failover priority for the Azure Cosmos DB database account. A failover priority of 0 indicates a write region. The maximum value for a failover priority = (total number of regions - 1). Failover priority values must be unique for each of the regions in which the database account exists. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param failoverPolicies List of failover policies. + * @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 failoverPriorityChangeAsync(String resourceGroupName, String accountName, List failoverPolicies, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(failoverPriorityChangeWithServiceResponseAsync(resourceGroupName, accountName, failoverPolicies), serviceCallback); + } + + /** + * Changes the failover priority for the Azure Cosmos DB database account. A failover priority of 0 indicates a write region. The maximum value for a failover priority = (total number of regions - 1). Failover priority values must be unique for each of the regions in which the database account exists. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param failoverPolicies List of failover policies. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable failoverPriorityChangeAsync(String resourceGroupName, String accountName, List failoverPolicies) { + return failoverPriorityChangeWithServiceResponseAsync(resourceGroupName, accountName, failoverPolicies).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Changes the failover priority for the Azure Cosmos DB database account. A failover priority of 0 indicates a write region. The maximum value for a failover priority = (total number of regions - 1). Failover priority values must be unique for each of the regions in which the database account exists. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param failoverPolicies List of failover policies. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> failoverPriorityChangeWithServiceResponseAsync(String resourceGroupName, String accountName, List failoverPolicies) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName 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 (failoverPolicies == null) { + throw new IllegalArgumentException("Parameter failoverPolicies is required and cannot be null."); + } + Validator.validate(failoverPolicies); + FailoverPolicies failoverParameters = new FailoverPolicies(); + failoverParameters.withFailoverPolicies(failoverPolicies); + Observable> observable = service.failoverPriorityChange(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), this.client.acceptLanguage(), failoverParameters, this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Changes the failover priority for the Azure Cosmos DB database account. A failover priority of 0 indicates a write region. The maximum value for a failover priority = (total number of regions - 1). Failover priority values must be unique for each of the regions in which the database account exists. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param failoverPolicies List of failover policies. + * @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 beginFailoverPriorityChange(String resourceGroupName, String accountName, List failoverPolicies) { + beginFailoverPriorityChangeWithServiceResponseAsync(resourceGroupName, accountName, failoverPolicies).toBlocking().single().body(); + } + + /** + * Changes the failover priority for the Azure Cosmos DB database account. A failover priority of 0 indicates a write region. The maximum value for a failover priority = (total number of regions - 1). Failover priority values must be unique for each of the regions in which the database account exists. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param failoverPolicies List of failover policies. + * @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 beginFailoverPriorityChangeAsync(String resourceGroupName, String accountName, List failoverPolicies, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginFailoverPriorityChangeWithServiceResponseAsync(resourceGroupName, accountName, failoverPolicies), serviceCallback); + } + + /** + * Changes the failover priority for the Azure Cosmos DB database account. A failover priority of 0 indicates a write region. The maximum value for a failover priority = (total number of regions - 1). Failover priority values must be unique for each of the regions in which the database account exists. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param failoverPolicies List of failover policies. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginFailoverPriorityChangeAsync(String resourceGroupName, String accountName, List failoverPolicies) { + return beginFailoverPriorityChangeWithServiceResponseAsync(resourceGroupName, accountName, failoverPolicies).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Changes the failover priority for the Azure Cosmos DB database account. A failover priority of 0 indicates a write region. The maximum value for a failover priority = (total number of regions - 1). Failover priority values must be unique for each of the regions in which the database account exists. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param failoverPolicies List of failover policies. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginFailoverPriorityChangeWithServiceResponseAsync(String resourceGroupName, String accountName, List failoverPolicies) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName 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 (failoverPolicies == null) { + throw new IllegalArgumentException("Parameter failoverPolicies is required and cannot be null."); + } + Validator.validate(failoverPolicies); + FailoverPolicies failoverParameters = new FailoverPolicies(); + failoverParameters.withFailoverPolicies(failoverPolicies); + return service.beginFailoverPriorityChange(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), this.client.acceptLanguage(), failoverParameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginFailoverPriorityChangeDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginFailoverPriorityChangeDelegate(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); + } + + /** + * Lists all the Azure Cosmos DB database accounts available under the subscription. + * + * @return the PagedList object if successful. + */ + public PagedList list() { + PageImpl page = new PageImpl<>(); + page.setItems(listWithServiceResponseAsync().toBlocking().single().body()); + page.setNextPageLink(null); + return new PagedList(page) { + @Override + public Page nextPage(String nextPageLink) { + return null; + } + }; + } + + /** + * Lists all the Azure Cosmos DB database accounts available under the subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(), serviceCallback); + } + + /** + * Lists all the Azure Cosmos DB database accounts available under the subscription. + * + * @return the observable to the List<DatabaseAccountInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync().map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + PageImpl page = new PageImpl<>(); + page.setItems(response.body()); + return page; + } + }); + } + + /** + * Lists all the Azure Cosmos DB database accounts available under the subscription. + * + * @return the observable to the List<DatabaseAccountInner> object + */ + public Observable>> listWithServiceResponseAsync() { + 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(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } 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 Azure Cosmos DB database accounts available under the given resource group. + * + * @param resourceGroupName Name of an Azure resource group. + * @return the PagedList object if successful. + */ + public PagedList listByResourceGroup(String resourceGroupName) { + PageImpl page = new PageImpl<>(); + page.setItems(listByResourceGroupWithServiceResponseAsync(resourceGroupName).toBlocking().single().body()); + page.setNextPageLink(null); + return new PagedList(page) { + @Override + public Page nextPage(String nextPageLink) { + return null; + } + }; + } + + /** + * Lists all the Azure Cosmos DB database accounts available under the given resource group. + * + * @param resourceGroupName Name of an Azure resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(String resourceGroupName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listByResourceGroupWithServiceResponseAsync(resourceGroupName), serviceCallback); + } + + /** + * Lists all the Azure Cosmos DB database accounts available under the given resource group. + * + * @param resourceGroupName Name of an Azure resource group. + * @return the observable to the List<DatabaseAccountInner> object + */ + public Observable> listByResourceGroupAsync(String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName).map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + PageImpl page = new PageImpl<>(); + page.setItems(response.body()); + return page; + } + }); + } + + /** + * Lists all the Azure Cosmos DB database accounts available under the given resource group. + * + * @param resourceGroupName Name of an Azure resource group. + * @return the observable to the List<DatabaseAccountInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(String resourceGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName 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 (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } 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); + } + + /** + * Lists the access keys for the specified Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account 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 DatabaseAccountListKeysResultInner object if successful. + */ + public DatabaseAccountListKeysResultInner listKeys(String resourceGroupName, String accountName) { + return listKeysWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * Lists the access keys for the specified Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account 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 listKeysAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listKeysWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * Lists the access keys for the specified Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DatabaseAccountListKeysResultInner object + */ + public Observable listKeysAsync(String resourceGroupName, String accountName) { + return listKeysWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, DatabaseAccountListKeysResultInner>() { + @Override + public DatabaseAccountListKeysResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Lists the access keys for the specified Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DatabaseAccountListKeysResultInner object + */ + public Observable> listKeysWithServiceResponseAsync(String resourceGroupName, String accountName) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName 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.listKeys(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listKeysDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listKeysDelegate(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); + } + + /** + * Lists the connection strings for the specified Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account 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 DatabaseAccountListConnectionStringsResultInner object if successful. + */ + public DatabaseAccountListConnectionStringsResultInner listConnectionStrings(String resourceGroupName, String accountName) { + return listConnectionStringsWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * Lists the connection strings for the specified Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account 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 listConnectionStringsAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listConnectionStringsWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * Lists the connection strings for the specified Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DatabaseAccountListConnectionStringsResultInner object + */ + public Observable listConnectionStringsAsync(String resourceGroupName, String accountName) { + return listConnectionStringsWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, DatabaseAccountListConnectionStringsResultInner>() { + @Override + public DatabaseAccountListConnectionStringsResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Lists the connection strings for the specified Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DatabaseAccountListConnectionStringsResultInner object + */ + public Observable> listConnectionStringsWithServiceResponseAsync(String resourceGroupName, String accountName) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName 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.listConnectionStrings(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listConnectionStringsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listConnectionStringsDelegate(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); + } + + /** + * Offline the specified region for the specified Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param region Cosmos DB region, with spaces between words and each word capitalized. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void offlineRegion(String resourceGroupName, String accountName, String region) { + offlineRegionWithServiceResponseAsync(resourceGroupName, accountName, region).toBlocking().last().body(); + } + + /** + * Offline the specified region for the specified Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param region Cosmos DB region, with spaces between words and each word capitalized. + * @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 offlineRegionAsync(String resourceGroupName, String accountName, String region, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(offlineRegionWithServiceResponseAsync(resourceGroupName, accountName, region), serviceCallback); + } + + /** + * Offline the specified region for the specified Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param region Cosmos DB region, with spaces between words and each word capitalized. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable offlineRegionAsync(String resourceGroupName, String accountName, String region) { + return offlineRegionWithServiceResponseAsync(resourceGroupName, accountName, region).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Offline the specified region for the specified Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param region Cosmos DB region, with spaces between words and each word capitalized. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> offlineRegionWithServiceResponseAsync(String resourceGroupName, String accountName, String region) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName 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 (region == null) { + throw new IllegalArgumentException("Parameter region is required and cannot be null."); + } + RegionForOnlineOffline regionParameterForOffline = new RegionForOnlineOffline(); + regionParameterForOffline.withRegion(region); + Observable> observable = service.offlineRegion(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), this.client.acceptLanguage(), regionParameterForOffline, this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Offline the specified region for the specified Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param region Cosmos DB region, with spaces between words and each word capitalized. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginOfflineRegion(String resourceGroupName, String accountName, String region) { + beginOfflineRegionWithServiceResponseAsync(resourceGroupName, accountName, region).toBlocking().single().body(); + } + + /** + * Offline the specified region for the specified Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param region Cosmos DB region, with spaces between words and each word capitalized. + * @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 beginOfflineRegionAsync(String resourceGroupName, String accountName, String region, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginOfflineRegionWithServiceResponseAsync(resourceGroupName, accountName, region), serviceCallback); + } + + /** + * Offline the specified region for the specified Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param region Cosmos DB region, with spaces between words and each word capitalized. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginOfflineRegionAsync(String resourceGroupName, String accountName, String region) { + return beginOfflineRegionWithServiceResponseAsync(resourceGroupName, accountName, region).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Offline the specified region for the specified Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param region Cosmos DB region, with spaces between words and each word capitalized. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginOfflineRegionWithServiceResponseAsync(String resourceGroupName, String accountName, String region) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName 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 (region == null) { + throw new IllegalArgumentException("Parameter region is required and cannot be null."); + } + RegionForOnlineOffline regionParameterForOffline = new RegionForOnlineOffline(); + regionParameterForOffline.withRegion(region); + return service.beginOfflineRegion(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), this.client.acceptLanguage(), regionParameterForOffline, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginOfflineRegionDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginOfflineRegionDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Online the specified region for the specified Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param region Cosmos DB region, with spaces between words and each word capitalized. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void onlineRegion(String resourceGroupName, String accountName, String region) { + onlineRegionWithServiceResponseAsync(resourceGroupName, accountName, region).toBlocking().last().body(); + } + + /** + * Online the specified region for the specified Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param region Cosmos DB region, with spaces between words and each word capitalized. + * @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 onlineRegionAsync(String resourceGroupName, String accountName, String region, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(onlineRegionWithServiceResponseAsync(resourceGroupName, accountName, region), serviceCallback); + } + + /** + * Online the specified region for the specified Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param region Cosmos DB region, with spaces between words and each word capitalized. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable onlineRegionAsync(String resourceGroupName, String accountName, String region) { + return onlineRegionWithServiceResponseAsync(resourceGroupName, accountName, region).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Online the specified region for the specified Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param region Cosmos DB region, with spaces between words and each word capitalized. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> onlineRegionWithServiceResponseAsync(String resourceGroupName, String accountName, String region) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName 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 (region == null) { + throw new IllegalArgumentException("Parameter region is required and cannot be null."); + } + RegionForOnlineOffline regionParameterForOnline = new RegionForOnlineOffline(); + regionParameterForOnline.withRegion(region); + Observable> observable = service.onlineRegion(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), this.client.acceptLanguage(), regionParameterForOnline, this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Online the specified region for the specified Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param region Cosmos DB region, with spaces between words and each word capitalized. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginOnlineRegion(String resourceGroupName, String accountName, String region) { + beginOnlineRegionWithServiceResponseAsync(resourceGroupName, accountName, region).toBlocking().single().body(); + } + + /** + * Online the specified region for the specified Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param region Cosmos DB region, with spaces between words and each word capitalized. + * @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 beginOnlineRegionAsync(String resourceGroupName, String accountName, String region, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginOnlineRegionWithServiceResponseAsync(resourceGroupName, accountName, region), serviceCallback); + } + + /** + * Online the specified region for the specified Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param region Cosmos DB region, with spaces between words and each word capitalized. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginOnlineRegionAsync(String resourceGroupName, String accountName, String region) { + return beginOnlineRegionWithServiceResponseAsync(resourceGroupName, accountName, region).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Online the specified region for the specified Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param region Cosmos DB region, with spaces between words and each word capitalized. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginOnlineRegionWithServiceResponseAsync(String resourceGroupName, String accountName, String region) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName 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 (region == null) { + throw new IllegalArgumentException("Parameter region is required and cannot be null."); + } + RegionForOnlineOffline regionParameterForOnline = new RegionForOnlineOffline(); + regionParameterForOnline.withRegion(region); + return service.beginOnlineRegion(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), this.client.acceptLanguage(), regionParameterForOnline, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginOnlineRegionDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginOnlineRegionDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists the read-only access keys for the specified Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account 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 DatabaseAccountListReadOnlyKeysResultInner object if successful. + */ + public DatabaseAccountListReadOnlyKeysResultInner getReadOnlyKeys(String resourceGroupName, String accountName) { + return getReadOnlyKeysWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * Lists the read-only access keys for the specified Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account 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 getReadOnlyKeysAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getReadOnlyKeysWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * Lists the read-only access keys for the specified Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DatabaseAccountListReadOnlyKeysResultInner object + */ + public Observable getReadOnlyKeysAsync(String resourceGroupName, String accountName) { + return getReadOnlyKeysWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, DatabaseAccountListReadOnlyKeysResultInner>() { + @Override + public DatabaseAccountListReadOnlyKeysResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Lists the read-only access keys for the specified Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DatabaseAccountListReadOnlyKeysResultInner object + */ + public Observable> getReadOnlyKeysWithServiceResponseAsync(String resourceGroupName, String accountName) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName 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.getReadOnlyKeys(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getReadOnlyKeysDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getReadOnlyKeysDelegate(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); + } + + /** + * Lists the read-only access keys for the specified Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account 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 DatabaseAccountListReadOnlyKeysResultInner object if successful. + */ + public DatabaseAccountListReadOnlyKeysResultInner listReadOnlyKeys(String resourceGroupName, String accountName) { + return listReadOnlyKeysWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * Lists the read-only access keys for the specified Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account 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 listReadOnlyKeysAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listReadOnlyKeysWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * Lists the read-only access keys for the specified Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DatabaseAccountListReadOnlyKeysResultInner object + */ + public Observable listReadOnlyKeysAsync(String resourceGroupName, String accountName) { + return listReadOnlyKeysWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, DatabaseAccountListReadOnlyKeysResultInner>() { + @Override + public DatabaseAccountListReadOnlyKeysResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Lists the read-only access keys for the specified Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DatabaseAccountListReadOnlyKeysResultInner object + */ + public Observable> listReadOnlyKeysWithServiceResponseAsync(String resourceGroupName, String accountName) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName 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.listReadOnlyKeys(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listReadOnlyKeysDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listReadOnlyKeysDelegate(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); + } + + /** + * Regenerates an access key for the specified Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param keyKind The access key to regenerate. Possible values include: 'primary', 'secondary', 'primaryReadonly', 'secondaryReadonly' + * @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 regenerateKey(String resourceGroupName, String accountName, KeyKind keyKind) { + regenerateKeyWithServiceResponseAsync(resourceGroupName, accountName, keyKind).toBlocking().last().body(); + } + + /** + * Regenerates an access key for the specified Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param keyKind The access key to regenerate. Possible values include: 'primary', 'secondary', 'primaryReadonly', 'secondaryReadonly' + * @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 regenerateKeyAsync(String resourceGroupName, String accountName, KeyKind keyKind, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(regenerateKeyWithServiceResponseAsync(resourceGroupName, accountName, keyKind), serviceCallback); + } + + /** + * Regenerates an access key for the specified Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param keyKind The access key to regenerate. Possible values include: 'primary', 'secondary', 'primaryReadonly', 'secondaryReadonly' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable regenerateKeyAsync(String resourceGroupName, String accountName, KeyKind keyKind) { + return regenerateKeyWithServiceResponseAsync(resourceGroupName, accountName, keyKind).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Regenerates an access key for the specified Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param keyKind The access key to regenerate. Possible values include: 'primary', 'secondary', 'primaryReadonly', 'secondaryReadonly' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> regenerateKeyWithServiceResponseAsync(String resourceGroupName, String accountName, KeyKind keyKind) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName 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 (keyKind == null) { + throw new IllegalArgumentException("Parameter keyKind is required and cannot be null."); + } + DatabaseAccountRegenerateKeyParameters keyToRegenerate = new DatabaseAccountRegenerateKeyParameters(); + keyToRegenerate.withKeyKind(keyKind); + Observable> observable = service.regenerateKey(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), this.client.acceptLanguage(), keyToRegenerate, this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Regenerates an access key for the specified Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param keyKind The access key to regenerate. Possible values include: 'primary', 'secondary', 'primaryReadonly', 'secondaryReadonly' + * @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 beginRegenerateKey(String resourceGroupName, String accountName, KeyKind keyKind) { + beginRegenerateKeyWithServiceResponseAsync(resourceGroupName, accountName, keyKind).toBlocking().single().body(); + } + + /** + * Regenerates an access key for the specified Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param keyKind The access key to regenerate. Possible values include: 'primary', 'secondary', 'primaryReadonly', 'secondaryReadonly' + * @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 beginRegenerateKeyAsync(String resourceGroupName, String accountName, KeyKind keyKind, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginRegenerateKeyWithServiceResponseAsync(resourceGroupName, accountName, keyKind), serviceCallback); + } + + /** + * Regenerates an access key for the specified Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param keyKind The access key to regenerate. Possible values include: 'primary', 'secondary', 'primaryReadonly', 'secondaryReadonly' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginRegenerateKeyAsync(String resourceGroupName, String accountName, KeyKind keyKind) { + return beginRegenerateKeyWithServiceResponseAsync(resourceGroupName, accountName, keyKind).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Regenerates an access key for the specified Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param keyKind The access key to regenerate. Possible values include: 'primary', 'secondary', 'primaryReadonly', 'secondaryReadonly' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginRegenerateKeyWithServiceResponseAsync(String resourceGroupName, String accountName, KeyKind keyKind) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName 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 (keyKind == null) { + throw new IllegalArgumentException("Parameter keyKind is required and cannot be null."); + } + DatabaseAccountRegenerateKeyParameters keyToRegenerate = new DatabaseAccountRegenerateKeyParameters(); + keyToRegenerate.withKeyKind(keyKind); + return service.beginRegenerateKey(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), this.client.acceptLanguage(), keyToRegenerate, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginRegenerateKeyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginRegenerateKeyDelegate(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); + } + + /** + * Checks that the Azure Cosmos DB account name already exists. A valid account name may contain only lowercase letters, numbers, and the '-' character, and must be between 3 and 50 characters. + * + * @param accountName Cosmos DB database account 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 boolean object if successful. + */ + public boolean checkNameExists(String accountName) { + return checkNameExistsWithServiceResponseAsync(accountName).toBlocking().single().body(); + } + + /** + * Checks that the Azure Cosmos DB account name already exists. A valid account name may contain only lowercase letters, numbers, and the '-' character, and must be between 3 and 50 characters. + * + * @param accountName Cosmos DB database account 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 checkNameExistsAsync(String accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(checkNameExistsWithServiceResponseAsync(accountName), serviceCallback); + } + + /** + * Checks that the Azure Cosmos DB account name already exists. A valid account name may contain only lowercase letters, numbers, and the '-' character, and must be between 3 and 50 characters. + * + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Boolean object + */ + public Observable checkNameExistsAsync(String accountName) { + return checkNameExistsWithServiceResponseAsync(accountName).map(new Func1, Boolean>() { + @Override + public Boolean call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Checks that the Azure Cosmos DB account name already exists. A valid account name may contain only lowercase letters, numbers, and the '-' character, and must be between 3 and 50 characters. + * + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Boolean object + */ + public Observable> checkNameExistsWithServiceResponseAsync(String accountName) { + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName 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.checkNameExists(accountName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = checkNameExistsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse checkNameExistsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(404, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildEmpty(response); + } + + /** + * Retrieves the metrics determined by the given filter for the given database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param filter An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq. + * @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 List<MetricInner> object if successful. + */ + public List listMetrics(String resourceGroupName, String accountName, String filter) { + return listMetricsWithServiceResponseAsync(resourceGroupName, accountName, filter).toBlocking().single().body(); + } + + /** + * Retrieves the metrics determined by the given filter for the given database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param filter An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq. + * @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> listMetricsAsync(String resourceGroupName, String accountName, String filter, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listMetricsWithServiceResponseAsync(resourceGroupName, accountName, filter), serviceCallback); + } + + /** + * Retrieves the metrics determined by the given filter for the given database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param filter An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<MetricInner> object + */ + public Observable> listMetricsAsync(String resourceGroupName, String accountName, String filter) { + return listMetricsWithServiceResponseAsync(resourceGroupName, accountName, filter).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Retrieves the metrics determined by the given filter for the given database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param filter An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<MetricInner> object + */ + public Observable>> listMetricsWithServiceResponseAsync(String resourceGroupName, String accountName, String filter) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName 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 (filter == null) { + throw new IllegalArgumentException("Parameter filter is required and cannot be null."); + } + return service.listMetrics(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), filter, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listMetricsDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listMetricsDelegate(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 the usages (most recent data) for the given database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account 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 List<UsageInner> object if successful. + */ + public List listUsages(String resourceGroupName, String accountName) { + return listUsagesWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * Retrieves the usages (most recent data) for the given database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account 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> listUsagesAsync(String resourceGroupName, String accountName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listUsagesWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * Retrieves the usages (most recent data) for the given database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<UsageInner> object + */ + public Observable> listUsagesAsync(String resourceGroupName, String accountName) { + return listUsagesWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Retrieves the usages (most recent data) for the given database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<UsageInner> object + */ + public Observable>> listUsagesWithServiceResponseAsync(String resourceGroupName, String accountName) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName 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 filter = null; + return service.listUsages(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), filter, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listUsagesDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Retrieves the usages (most recent data) for the given database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param filter An OData filter expression that describes a subset of usages to return. The supported parameter is name.value (name of the metric, can have an or of multiple names). + * @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 List<UsageInner> object if successful. + */ + public List listUsages(String resourceGroupName, String accountName, String filter) { + return listUsagesWithServiceResponseAsync(resourceGroupName, accountName, filter).toBlocking().single().body(); + } + + /** + * Retrieves the usages (most recent data) for the given database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param filter An OData filter expression that describes a subset of usages to return. The supported parameter is name.value (name of the metric, can have an or of multiple names). + * @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> listUsagesAsync(String resourceGroupName, String accountName, String filter, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listUsagesWithServiceResponseAsync(resourceGroupName, accountName, filter), serviceCallback); + } + + /** + * Retrieves the usages (most recent data) for the given database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param filter An OData filter expression that describes a subset of usages to return. The supported parameter is name.value (name of the metric, can have an or of multiple names). + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<UsageInner> object + */ + public Observable> listUsagesAsync(String resourceGroupName, String accountName, String filter) { + return listUsagesWithServiceResponseAsync(resourceGroupName, accountName, filter).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Retrieves the usages (most recent data) for the given database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param filter An OData filter expression that describes a subset of usages to return. The supported parameter is name.value (name of the metric, can have an or of multiple names). + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<UsageInner> object + */ + public Observable>> listUsagesWithServiceResponseAsync(String resourceGroupName, String accountName, String filter) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName 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.listUsages(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), filter, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listUsagesDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listUsagesDelegate(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 metric definitions for the given database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account 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 List<MetricDefinitionInner> object if successful. + */ + public List listMetricDefinitions(String resourceGroupName, String accountName) { + return listMetricDefinitionsWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * Retrieves metric definitions for the given database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account 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> listMetricDefinitionsAsync(String resourceGroupName, String accountName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listMetricDefinitionsWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * Retrieves metric definitions for the given database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<MetricDefinitionInner> object + */ + public Observable> listMetricDefinitionsAsync(String resourceGroupName, String accountName) { + return listMetricDefinitionsWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Retrieves metric definitions for the given database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<MetricDefinitionInner> object + */ + public Observable>> listMetricDefinitionsWithServiceResponseAsync(String resourceGroupName, String accountName) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName 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.listMetricDefinitions(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listMetricDefinitionsDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listMetricDefinitionsDelegate(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 the SQL databases under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account 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 List<SqlDatabaseInner> object if successful. + */ + public List listSqlDatabases(String resourceGroupName, String accountName) { + return listSqlDatabasesWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * Lists the SQL databases under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account 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> listSqlDatabasesAsync(String resourceGroupName, String accountName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listSqlDatabasesWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * Lists the SQL databases under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<SqlDatabaseInner> object + */ + public Observable> listSqlDatabasesAsync(String resourceGroupName, String accountName) { + return listSqlDatabasesWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the SQL databases under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<SqlDatabaseInner> object + */ + public Observable>> listSqlDatabasesWithServiceResponseAsync(String resourceGroupName, String accountName) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName 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.listSqlDatabases(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listSqlDatabasesDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listSqlDatabasesDelegate(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 SQL database under an existing Azure Cosmos DB database account with the provided name. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database 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 SqlDatabaseInner object if successful. + */ + public SqlDatabaseInner getSqlDatabase(String resourceGroupName, String accountName, String databaseName) { + return getSqlDatabaseWithServiceResponseAsync(resourceGroupName, accountName, databaseName).toBlocking().single().body(); + } + + /** + * Gets the SQL database under an existing Azure Cosmos DB database account with the provided name. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database 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 getSqlDatabaseAsync(String resourceGroupName, String accountName, String databaseName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getSqlDatabaseWithServiceResponseAsync(resourceGroupName, accountName, databaseName), serviceCallback); + } + + /** + * Gets the SQL database under an existing Azure Cosmos DB database account with the provided name. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SqlDatabaseInner object + */ + public Observable getSqlDatabaseAsync(String resourceGroupName, String accountName, String databaseName) { + return getSqlDatabaseWithServiceResponseAsync(resourceGroupName, accountName, databaseName).map(new Func1, SqlDatabaseInner>() { + @Override + public SqlDatabaseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the SQL database under an existing Azure Cosmos DB database account with the provided name. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SqlDatabaseInner object + */ + public Observable> getSqlDatabaseWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName 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.getSqlDatabase(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getSqlDatabaseDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getSqlDatabaseDelegate(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 an Azure Cosmos DB SQL database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param createUpdateSqlDatabaseParameters The parameters to provide for the current SQL database. + * @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 SqlDatabaseInner object if successful. + */ + public SqlDatabaseInner createUpdateSqlDatabase(String resourceGroupName, String accountName, String databaseName, SqlDatabaseCreateUpdateParameters createUpdateSqlDatabaseParameters) { + return createUpdateSqlDatabaseWithServiceResponseAsync(resourceGroupName, accountName, databaseName, createUpdateSqlDatabaseParameters).toBlocking().last().body(); + } + + /** + * Create or update an Azure Cosmos DB SQL database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param createUpdateSqlDatabaseParameters The parameters to provide for the current SQL database. + * @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 createUpdateSqlDatabaseAsync(String resourceGroupName, String accountName, String databaseName, SqlDatabaseCreateUpdateParameters createUpdateSqlDatabaseParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createUpdateSqlDatabaseWithServiceResponseAsync(resourceGroupName, accountName, databaseName, createUpdateSqlDatabaseParameters), serviceCallback); + } + + /** + * Create or update an Azure Cosmos DB SQL database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param createUpdateSqlDatabaseParameters The parameters to provide for the current SQL database. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createUpdateSqlDatabaseAsync(String resourceGroupName, String accountName, String databaseName, SqlDatabaseCreateUpdateParameters createUpdateSqlDatabaseParameters) { + return createUpdateSqlDatabaseWithServiceResponseAsync(resourceGroupName, accountName, databaseName, createUpdateSqlDatabaseParameters).map(new Func1, SqlDatabaseInner>() { + @Override + public SqlDatabaseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update an Azure Cosmos DB SQL database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param createUpdateSqlDatabaseParameters The parameters to provide for the current SQL database. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createUpdateSqlDatabaseWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName, SqlDatabaseCreateUpdateParameters createUpdateSqlDatabaseParameters) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName 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 (createUpdateSqlDatabaseParameters == null) { + throw new IllegalArgumentException("Parameter createUpdateSqlDatabaseParameters is required and cannot be null."); + } + Validator.validate(createUpdateSqlDatabaseParameters); + Observable> observable = service.createUpdateSqlDatabase(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, this.client.apiVersion(), createUpdateSqlDatabaseParameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Create or update an Azure Cosmos DB SQL database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param createUpdateSqlDatabaseParameters The parameters to provide for the current SQL database. + * @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 SqlDatabaseInner object if successful. + */ + public SqlDatabaseInner beginCreateUpdateSqlDatabase(String resourceGroupName, String accountName, String databaseName, SqlDatabaseCreateUpdateParameters createUpdateSqlDatabaseParameters) { + return beginCreateUpdateSqlDatabaseWithServiceResponseAsync(resourceGroupName, accountName, databaseName, createUpdateSqlDatabaseParameters).toBlocking().single().body(); + } + + /** + * Create or update an Azure Cosmos DB SQL database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param createUpdateSqlDatabaseParameters The parameters to provide for the current SQL database. + * @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 beginCreateUpdateSqlDatabaseAsync(String resourceGroupName, String accountName, String databaseName, SqlDatabaseCreateUpdateParameters createUpdateSqlDatabaseParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateUpdateSqlDatabaseWithServiceResponseAsync(resourceGroupName, accountName, databaseName, createUpdateSqlDatabaseParameters), serviceCallback); + } + + /** + * Create or update an Azure Cosmos DB SQL database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param createUpdateSqlDatabaseParameters The parameters to provide for the current SQL database. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SqlDatabaseInner object + */ + public Observable beginCreateUpdateSqlDatabaseAsync(String resourceGroupName, String accountName, String databaseName, SqlDatabaseCreateUpdateParameters createUpdateSqlDatabaseParameters) { + return beginCreateUpdateSqlDatabaseWithServiceResponseAsync(resourceGroupName, accountName, databaseName, createUpdateSqlDatabaseParameters).map(new Func1, SqlDatabaseInner>() { + @Override + public SqlDatabaseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update an Azure Cosmos DB SQL database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param createUpdateSqlDatabaseParameters The parameters to provide for the current SQL database. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SqlDatabaseInner object + */ + public Observable> beginCreateUpdateSqlDatabaseWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName, SqlDatabaseCreateUpdateParameters createUpdateSqlDatabaseParameters) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName 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 (createUpdateSqlDatabaseParameters == null) { + throw new IllegalArgumentException("Parameter createUpdateSqlDatabaseParameters is required and cannot be null."); + } + Validator.validate(createUpdateSqlDatabaseParameters); + return service.beginCreateUpdateSqlDatabase(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, this.client.apiVersion(), createUpdateSqlDatabaseParameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateUpdateSqlDatabaseDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateUpdateSqlDatabaseDelegate(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 an existing Azure Cosmos DB SQL database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database 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 deleteSqlDatabase(String resourceGroupName, String accountName, String databaseName) { + deleteSqlDatabaseWithServiceResponseAsync(resourceGroupName, accountName, databaseName).toBlocking().last().body(); + } + + /** + * Deletes an existing Azure Cosmos DB SQL database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database 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 deleteSqlDatabaseAsync(String resourceGroupName, String accountName, String databaseName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteSqlDatabaseWithServiceResponseAsync(resourceGroupName, accountName, databaseName), serviceCallback); + } + + /** + * Deletes an existing Azure Cosmos DB SQL database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteSqlDatabaseAsync(String resourceGroupName, String accountName, String databaseName) { + return deleteSqlDatabaseWithServiceResponseAsync(resourceGroupName, accountName, databaseName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes an existing Azure Cosmos DB SQL database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteSqlDatabaseWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName 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.deleteSqlDatabase(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes an existing Azure Cosmos DB SQL database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database 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 beginDeleteSqlDatabase(String resourceGroupName, String accountName, String databaseName) { + beginDeleteSqlDatabaseWithServiceResponseAsync(resourceGroupName, accountName, databaseName).toBlocking().single().body(); + } + + /** + * Deletes an existing Azure Cosmos DB SQL database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database 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 beginDeleteSqlDatabaseAsync(String resourceGroupName, String accountName, String databaseName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteSqlDatabaseWithServiceResponseAsync(resourceGroupName, accountName, databaseName), serviceCallback); + } + + /** + * Deletes an existing Azure Cosmos DB SQL database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteSqlDatabaseAsync(String resourceGroupName, String accountName, String databaseName) { + return beginDeleteSqlDatabaseWithServiceResponseAsync(resourceGroupName, accountName, databaseName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes an existing Azure Cosmos DB SQL database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteSqlDatabaseWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName 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.beginDeleteSqlDatabase(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteSqlDatabaseDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteSqlDatabaseDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the RUs per second of the SQL database under an existing Azure Cosmos DB database account with the provided name. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database 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 ThroughputInner object if successful. + */ + public ThroughputInner getSqlDatabaseThroughput(String resourceGroupName, String accountName, String databaseName) { + return getSqlDatabaseThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName).toBlocking().single().body(); + } + + /** + * Gets the RUs per second of the SQL database under an existing Azure Cosmos DB database account with the provided name. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database 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 getSqlDatabaseThroughputAsync(String resourceGroupName, String accountName, String databaseName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getSqlDatabaseThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName), serviceCallback); + } + + /** + * Gets the RUs per second of the SQL database under an existing Azure Cosmos DB database account with the provided name. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ThroughputInner object + */ + public Observable getSqlDatabaseThroughputAsync(String resourceGroupName, String accountName, String databaseName) { + return getSqlDatabaseThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName).map(new Func1, ThroughputInner>() { + @Override + public ThroughputInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the RUs per second of the SQL database under an existing Azure Cosmos DB database account with the provided name. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ThroughputInner object + */ + public Observable> getSqlDatabaseThroughputWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName 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.getSqlDatabaseThroughput(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getSqlDatabaseThroughputDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getSqlDatabaseThroughputDelegate(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); + } + + /** + * Update RUs per second of an Azure Cosmos DB SQL database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param resource The standard JSON format of a resource throughput + * @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 ThroughputInner object if successful. + */ + public ThroughputInner updateSqlDatabaseThroughput(String resourceGroupName, String accountName, String databaseName, ThroughputResource resource) { + return updateSqlDatabaseThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName, resource).toBlocking().last().body(); + } + + /** + * Update RUs per second of an Azure Cosmos DB SQL database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param resource The standard JSON format of a resource throughput + * @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 updateSqlDatabaseThroughputAsync(String resourceGroupName, String accountName, String databaseName, ThroughputResource resource, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateSqlDatabaseThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName, resource), serviceCallback); + } + + /** + * Update RUs per second of an Azure Cosmos DB SQL database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param resource The standard JSON format of a resource throughput + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateSqlDatabaseThroughputAsync(String resourceGroupName, String accountName, String databaseName, ThroughputResource resource) { + return updateSqlDatabaseThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName, resource).map(new Func1, ThroughputInner>() { + @Override + public ThroughputInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update RUs per second of an Azure Cosmos DB SQL database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param resource The standard JSON format of a resource throughput + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateSqlDatabaseThroughputWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName, ThroughputResource resource) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName 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 (resource == null) { + throw new IllegalArgumentException("Parameter resource is required and cannot be null."); + } + Validator.validate(resource); + ThroughputUpdateParameters updateThroughputParameters = new ThroughputUpdateParameters(); + updateThroughputParameters.withResource(resource); + Observable> observable = service.updateSqlDatabaseThroughput(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, this.client.apiVersion(), this.client.acceptLanguage(), updateThroughputParameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Update RUs per second of an Azure Cosmos DB SQL database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param resource The standard JSON format of a resource throughput + * @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 ThroughputInner object if successful. + */ + public ThroughputInner beginUpdateSqlDatabaseThroughput(String resourceGroupName, String accountName, String databaseName, ThroughputResource resource) { + return beginUpdateSqlDatabaseThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName, resource).toBlocking().single().body(); + } + + /** + * Update RUs per second of an Azure Cosmos DB SQL database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param resource The standard JSON format of a resource throughput + * @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 beginUpdateSqlDatabaseThroughputAsync(String resourceGroupName, String accountName, String databaseName, ThroughputResource resource, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateSqlDatabaseThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName, resource), serviceCallback); + } + + /** + * Update RUs per second of an Azure Cosmos DB SQL database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param resource The standard JSON format of a resource throughput + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ThroughputInner object + */ + public Observable beginUpdateSqlDatabaseThroughputAsync(String resourceGroupName, String accountName, String databaseName, ThroughputResource resource) { + return beginUpdateSqlDatabaseThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName, resource).map(new Func1, ThroughputInner>() { + @Override + public ThroughputInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update RUs per second of an Azure Cosmos DB SQL database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param resource The standard JSON format of a resource throughput + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ThroughputInner object + */ + public Observable> beginUpdateSqlDatabaseThroughputWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName, ThroughputResource resource) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName 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 (resource == null) { + throw new IllegalArgumentException("Parameter resource is required and cannot be null."); + } + Validator.validate(resource); + ThroughputUpdateParameters updateThroughputParameters = new ThroughputUpdateParameters(); + updateThroughputParameters.withResource(resource); + return service.beginUpdateSqlDatabaseThroughput(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, this.client.apiVersion(), this.client.acceptLanguage(), updateThroughputParameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateSqlDatabaseThroughputDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateSqlDatabaseThroughputDelegate(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 the SQL container under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database 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 List<SqlContainerInner> object if successful. + */ + public List listSqlContainers(String resourceGroupName, String accountName, String databaseName) { + return listSqlContainersWithServiceResponseAsync(resourceGroupName, accountName, databaseName).toBlocking().single().body(); + } + + /** + * Lists the SQL container under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database 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> listSqlContainersAsync(String resourceGroupName, String accountName, String databaseName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listSqlContainersWithServiceResponseAsync(resourceGroupName, accountName, databaseName), serviceCallback); + } + + /** + * Lists the SQL container under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<SqlContainerInner> object + */ + public Observable> listSqlContainersAsync(String resourceGroupName, String accountName, String databaseName) { + return listSqlContainersWithServiceResponseAsync(resourceGroupName, accountName, databaseName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the SQL container under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<SqlContainerInner> object + */ + public Observable>> listSqlContainersWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName 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.listSqlContainers(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listSqlContainersDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listSqlContainersDelegate(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 SQL container under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container 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 SqlContainerInner object if successful. + */ + public SqlContainerInner getSqlContainer(String resourceGroupName, String accountName, String databaseName, String containerName) { + return getSqlContainerWithServiceResponseAsync(resourceGroupName, accountName, databaseName, containerName).toBlocking().single().body(); + } + + /** + * Gets the SQL container under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container 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 getSqlContainerAsync(String resourceGroupName, String accountName, String databaseName, String containerName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getSqlContainerWithServiceResponseAsync(resourceGroupName, accountName, databaseName, containerName), serviceCallback); + } + + /** + * Gets the SQL container under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SqlContainerInner object + */ + public Observable getSqlContainerAsync(String resourceGroupName, String accountName, String databaseName, String containerName) { + return getSqlContainerWithServiceResponseAsync(resourceGroupName, accountName, databaseName, containerName).map(new Func1, SqlContainerInner>() { + @Override + public SqlContainerInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the SQL container under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SqlContainerInner object + */ + public Observable> getSqlContainerWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName, String containerName) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (containerName == null) { + throw new IllegalArgumentException("Parameter containerName 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.getSqlContainer(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, containerName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getSqlContainerDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getSqlContainerDelegate(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 an Azure Cosmos DB SQL container. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @param createUpdateSqlContainerParameters The parameters to provide for the current SQL container. + * @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 SqlContainerInner object if successful. + */ + public SqlContainerInner createUpdateSqlContainer(String resourceGroupName, String accountName, String databaseName, String containerName, SqlContainerCreateUpdateParameters createUpdateSqlContainerParameters) { + return createUpdateSqlContainerWithServiceResponseAsync(resourceGroupName, accountName, databaseName, containerName, createUpdateSqlContainerParameters).toBlocking().last().body(); + } + + /** + * Create or update an Azure Cosmos DB SQL container. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @param createUpdateSqlContainerParameters The parameters to provide for the current SQL container. + * @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 createUpdateSqlContainerAsync(String resourceGroupName, String accountName, String databaseName, String containerName, SqlContainerCreateUpdateParameters createUpdateSqlContainerParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createUpdateSqlContainerWithServiceResponseAsync(resourceGroupName, accountName, databaseName, containerName, createUpdateSqlContainerParameters), serviceCallback); + } + + /** + * Create or update an Azure Cosmos DB SQL container. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @param createUpdateSqlContainerParameters The parameters to provide for the current SQL container. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createUpdateSqlContainerAsync(String resourceGroupName, String accountName, String databaseName, String containerName, SqlContainerCreateUpdateParameters createUpdateSqlContainerParameters) { + return createUpdateSqlContainerWithServiceResponseAsync(resourceGroupName, accountName, databaseName, containerName, createUpdateSqlContainerParameters).map(new Func1, SqlContainerInner>() { + @Override + public SqlContainerInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update an Azure Cosmos DB SQL container. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @param createUpdateSqlContainerParameters The parameters to provide for the current SQL container. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createUpdateSqlContainerWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName, String containerName, SqlContainerCreateUpdateParameters createUpdateSqlContainerParameters) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (containerName == null) { + throw new IllegalArgumentException("Parameter containerName 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 (createUpdateSqlContainerParameters == null) { + throw new IllegalArgumentException("Parameter createUpdateSqlContainerParameters is required and cannot be null."); + } + Validator.validate(createUpdateSqlContainerParameters); + Observable> observable = service.createUpdateSqlContainer(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, containerName, this.client.apiVersion(), createUpdateSqlContainerParameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Create or update an Azure Cosmos DB SQL container. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @param createUpdateSqlContainerParameters The parameters to provide for the current SQL container. + * @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 SqlContainerInner object if successful. + */ + public SqlContainerInner beginCreateUpdateSqlContainer(String resourceGroupName, String accountName, String databaseName, String containerName, SqlContainerCreateUpdateParameters createUpdateSqlContainerParameters) { + return beginCreateUpdateSqlContainerWithServiceResponseAsync(resourceGroupName, accountName, databaseName, containerName, createUpdateSqlContainerParameters).toBlocking().single().body(); + } + + /** + * Create or update an Azure Cosmos DB SQL container. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @param createUpdateSqlContainerParameters The parameters to provide for the current SQL container. + * @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 beginCreateUpdateSqlContainerAsync(String resourceGroupName, String accountName, String databaseName, String containerName, SqlContainerCreateUpdateParameters createUpdateSqlContainerParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateUpdateSqlContainerWithServiceResponseAsync(resourceGroupName, accountName, databaseName, containerName, createUpdateSqlContainerParameters), serviceCallback); + } + + /** + * Create or update an Azure Cosmos DB SQL container. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @param createUpdateSqlContainerParameters The parameters to provide for the current SQL container. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SqlContainerInner object + */ + public Observable beginCreateUpdateSqlContainerAsync(String resourceGroupName, String accountName, String databaseName, String containerName, SqlContainerCreateUpdateParameters createUpdateSqlContainerParameters) { + return beginCreateUpdateSqlContainerWithServiceResponseAsync(resourceGroupName, accountName, databaseName, containerName, createUpdateSqlContainerParameters).map(new Func1, SqlContainerInner>() { + @Override + public SqlContainerInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update an Azure Cosmos DB SQL container. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @param createUpdateSqlContainerParameters The parameters to provide for the current SQL container. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SqlContainerInner object + */ + public Observable> beginCreateUpdateSqlContainerWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName, String containerName, SqlContainerCreateUpdateParameters createUpdateSqlContainerParameters) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (containerName == null) { + throw new IllegalArgumentException("Parameter containerName 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 (createUpdateSqlContainerParameters == null) { + throw new IllegalArgumentException("Parameter createUpdateSqlContainerParameters is required and cannot be null."); + } + Validator.validate(createUpdateSqlContainerParameters); + return service.beginCreateUpdateSqlContainer(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, containerName, this.client.apiVersion(), createUpdateSqlContainerParameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateUpdateSqlContainerDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateUpdateSqlContainerDelegate(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 an existing Azure Cosmos DB SQL container. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container 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 deleteSqlContainer(String resourceGroupName, String accountName, String databaseName, String containerName) { + deleteSqlContainerWithServiceResponseAsync(resourceGroupName, accountName, databaseName, containerName).toBlocking().last().body(); + } + + /** + * Deletes an existing Azure Cosmos DB SQL container. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container 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 deleteSqlContainerAsync(String resourceGroupName, String accountName, String databaseName, String containerName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteSqlContainerWithServiceResponseAsync(resourceGroupName, accountName, databaseName, containerName), serviceCallback); + } + + /** + * Deletes an existing Azure Cosmos DB SQL container. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteSqlContainerAsync(String resourceGroupName, String accountName, String databaseName, String containerName) { + return deleteSqlContainerWithServiceResponseAsync(resourceGroupName, accountName, databaseName, containerName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes an existing Azure Cosmos DB SQL container. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteSqlContainerWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName, String containerName) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (containerName == null) { + throw new IllegalArgumentException("Parameter containerName 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.deleteSqlContainer(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, containerName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes an existing Azure Cosmos DB SQL container. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container 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 beginDeleteSqlContainer(String resourceGroupName, String accountName, String databaseName, String containerName) { + beginDeleteSqlContainerWithServiceResponseAsync(resourceGroupName, accountName, databaseName, containerName).toBlocking().single().body(); + } + + /** + * Deletes an existing Azure Cosmos DB SQL container. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container 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 beginDeleteSqlContainerAsync(String resourceGroupName, String accountName, String databaseName, String containerName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteSqlContainerWithServiceResponseAsync(resourceGroupName, accountName, databaseName, containerName), serviceCallback); + } + + /** + * Deletes an existing Azure Cosmos DB SQL container. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteSqlContainerAsync(String resourceGroupName, String accountName, String databaseName, String containerName) { + return beginDeleteSqlContainerWithServiceResponseAsync(resourceGroupName, accountName, databaseName, containerName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes an existing Azure Cosmos DB SQL container. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteSqlContainerWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName, String containerName) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (containerName == null) { + throw new IllegalArgumentException("Parameter containerName 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.beginDeleteSqlContainer(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, containerName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteSqlContainerDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteSqlContainerDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the RUs per second of the SQL container under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container 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 ThroughputInner object if successful. + */ + public ThroughputInner getSqlContainerThroughput(String resourceGroupName, String accountName, String databaseName, String containerName) { + return getSqlContainerThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName, containerName).toBlocking().single().body(); + } + + /** + * Gets the RUs per second of the SQL container under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container 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 getSqlContainerThroughputAsync(String resourceGroupName, String accountName, String databaseName, String containerName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getSqlContainerThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName, containerName), serviceCallback); + } + + /** + * Gets the RUs per second of the SQL container under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ThroughputInner object + */ + public Observable getSqlContainerThroughputAsync(String resourceGroupName, String accountName, String databaseName, String containerName) { + return getSqlContainerThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName, containerName).map(new Func1, ThroughputInner>() { + @Override + public ThroughputInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the RUs per second of the SQL container under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ThroughputInner object + */ + public Observable> getSqlContainerThroughputWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName, String containerName) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (containerName == null) { + throw new IllegalArgumentException("Parameter containerName 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.getSqlContainerThroughput(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, containerName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getSqlContainerThroughputDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getSqlContainerThroughputDelegate(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); + } + + /** + * Update RUs per second of an Azure Cosmos DB SQL container. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @param resource The standard JSON format of a resource throughput + * @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 ThroughputInner object if successful. + */ + public ThroughputInner updateSqlContainerThroughput(String resourceGroupName, String accountName, String databaseName, String containerName, ThroughputResource resource) { + return updateSqlContainerThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName, containerName, resource).toBlocking().last().body(); + } + + /** + * Update RUs per second of an Azure Cosmos DB SQL container. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @param resource The standard JSON format of a resource throughput + * @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 updateSqlContainerThroughputAsync(String resourceGroupName, String accountName, String databaseName, String containerName, ThroughputResource resource, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateSqlContainerThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName, containerName, resource), serviceCallback); + } + + /** + * Update RUs per second of an Azure Cosmos DB SQL container. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @param resource The standard JSON format of a resource throughput + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateSqlContainerThroughputAsync(String resourceGroupName, String accountName, String databaseName, String containerName, ThroughputResource resource) { + return updateSqlContainerThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName, containerName, resource).map(new Func1, ThroughputInner>() { + @Override + public ThroughputInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update RUs per second of an Azure Cosmos DB SQL container. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @param resource The standard JSON format of a resource throughput + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateSqlContainerThroughputWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName, String containerName, ThroughputResource resource) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (containerName == null) { + throw new IllegalArgumentException("Parameter containerName 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 (resource == null) { + throw new IllegalArgumentException("Parameter resource is required and cannot be null."); + } + Validator.validate(resource); + ThroughputUpdateParameters updateThroughputParameters = new ThroughputUpdateParameters(); + updateThroughputParameters.withResource(resource); + Observable> observable = service.updateSqlContainerThroughput(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, containerName, this.client.apiVersion(), this.client.acceptLanguage(), updateThroughputParameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Update RUs per second of an Azure Cosmos DB SQL container. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @param resource The standard JSON format of a resource throughput + * @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 ThroughputInner object if successful. + */ + public ThroughputInner beginUpdateSqlContainerThroughput(String resourceGroupName, String accountName, String databaseName, String containerName, ThroughputResource resource) { + return beginUpdateSqlContainerThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName, containerName, resource).toBlocking().single().body(); + } + + /** + * Update RUs per second of an Azure Cosmos DB SQL container. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @param resource The standard JSON format of a resource throughput + * @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 beginUpdateSqlContainerThroughputAsync(String resourceGroupName, String accountName, String databaseName, String containerName, ThroughputResource resource, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateSqlContainerThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName, containerName, resource), serviceCallback); + } + + /** + * Update RUs per second of an Azure Cosmos DB SQL container. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @param resource The standard JSON format of a resource throughput + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ThroughputInner object + */ + public Observable beginUpdateSqlContainerThroughputAsync(String resourceGroupName, String accountName, String databaseName, String containerName, ThroughputResource resource) { + return beginUpdateSqlContainerThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName, containerName, resource).map(new Func1, ThroughputInner>() { + @Override + public ThroughputInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update RUs per second of an Azure Cosmos DB SQL container. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @param resource The standard JSON format of a resource throughput + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ThroughputInner object + */ + public Observable> beginUpdateSqlContainerThroughputWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName, String containerName, ThroughputResource resource) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (containerName == null) { + throw new IllegalArgumentException("Parameter containerName 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 (resource == null) { + throw new IllegalArgumentException("Parameter resource is required and cannot be null."); + } + Validator.validate(resource); + ThroughputUpdateParameters updateThroughputParameters = new ThroughputUpdateParameters(); + updateThroughputParameters.withResource(resource); + return service.beginUpdateSqlContainerThroughput(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, containerName, this.client.apiVersion(), this.client.acceptLanguage(), updateThroughputParameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateSqlContainerThroughputDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateSqlContainerThroughputDelegate(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 the MongoDB databases under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account 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 List<MongoDBDatabaseInner> object if successful. + */ + public List listMongoDBDatabases(String resourceGroupName, String accountName) { + return listMongoDBDatabasesWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * Lists the MongoDB databases under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account 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> listMongoDBDatabasesAsync(String resourceGroupName, String accountName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listMongoDBDatabasesWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * Lists the MongoDB databases under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<MongoDBDatabaseInner> object + */ + public Observable> listMongoDBDatabasesAsync(String resourceGroupName, String accountName) { + return listMongoDBDatabasesWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the MongoDB databases under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<MongoDBDatabaseInner> object + */ + public Observable>> listMongoDBDatabasesWithServiceResponseAsync(String resourceGroupName, String accountName) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName 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.listMongoDBDatabases(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listMongoDBDatabasesDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listMongoDBDatabasesDelegate(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 MongoDB databases under an existing Azure Cosmos DB database account with the provided name. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database 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 MongoDBDatabaseInner object if successful. + */ + public MongoDBDatabaseInner getMongoDBDatabase(String resourceGroupName, String accountName, String databaseName) { + return getMongoDBDatabaseWithServiceResponseAsync(resourceGroupName, accountName, databaseName).toBlocking().single().body(); + } + + /** + * Gets the MongoDB databases under an existing Azure Cosmos DB database account with the provided name. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database 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 getMongoDBDatabaseAsync(String resourceGroupName, String accountName, String databaseName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getMongoDBDatabaseWithServiceResponseAsync(resourceGroupName, accountName, databaseName), serviceCallback); + } + + /** + * Gets the MongoDB databases under an existing Azure Cosmos DB database account with the provided name. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the MongoDBDatabaseInner object + */ + public Observable getMongoDBDatabaseAsync(String resourceGroupName, String accountName, String databaseName) { + return getMongoDBDatabaseWithServiceResponseAsync(resourceGroupName, accountName, databaseName).map(new Func1, MongoDBDatabaseInner>() { + @Override + public MongoDBDatabaseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the MongoDB databases under an existing Azure Cosmos DB database account with the provided name. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the MongoDBDatabaseInner object + */ + public Observable> getMongoDBDatabaseWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName 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.getMongoDBDatabase(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getMongoDBDatabaseDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getMongoDBDatabaseDelegate(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 updates Azure Cosmos DB MongoDB database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param createUpdateMongoDBDatabaseParameters The parameters to provide for the current MongoDB database. + * @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 MongoDBDatabaseInner object if successful. + */ + public MongoDBDatabaseInner createUpdateMongoDBDatabase(String resourceGroupName, String accountName, String databaseName, MongoDBDatabaseCreateUpdateParameters createUpdateMongoDBDatabaseParameters) { + return createUpdateMongoDBDatabaseWithServiceResponseAsync(resourceGroupName, accountName, databaseName, createUpdateMongoDBDatabaseParameters).toBlocking().last().body(); + } + + /** + * Create or updates Azure Cosmos DB MongoDB database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param createUpdateMongoDBDatabaseParameters The parameters to provide for the current MongoDB database. + * @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 createUpdateMongoDBDatabaseAsync(String resourceGroupName, String accountName, String databaseName, MongoDBDatabaseCreateUpdateParameters createUpdateMongoDBDatabaseParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createUpdateMongoDBDatabaseWithServiceResponseAsync(resourceGroupName, accountName, databaseName, createUpdateMongoDBDatabaseParameters), serviceCallback); + } + + /** + * Create or updates Azure Cosmos DB MongoDB database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param createUpdateMongoDBDatabaseParameters The parameters to provide for the current MongoDB database. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createUpdateMongoDBDatabaseAsync(String resourceGroupName, String accountName, String databaseName, MongoDBDatabaseCreateUpdateParameters createUpdateMongoDBDatabaseParameters) { + return createUpdateMongoDBDatabaseWithServiceResponseAsync(resourceGroupName, accountName, databaseName, createUpdateMongoDBDatabaseParameters).map(new Func1, MongoDBDatabaseInner>() { + @Override + public MongoDBDatabaseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or updates Azure Cosmos DB MongoDB database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param createUpdateMongoDBDatabaseParameters The parameters to provide for the current MongoDB database. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createUpdateMongoDBDatabaseWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName, MongoDBDatabaseCreateUpdateParameters createUpdateMongoDBDatabaseParameters) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName 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 (createUpdateMongoDBDatabaseParameters == null) { + throw new IllegalArgumentException("Parameter createUpdateMongoDBDatabaseParameters is required and cannot be null."); + } + Validator.validate(createUpdateMongoDBDatabaseParameters); + Observable> observable = service.createUpdateMongoDBDatabase(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, this.client.apiVersion(), createUpdateMongoDBDatabaseParameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Create or updates Azure Cosmos DB MongoDB database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param createUpdateMongoDBDatabaseParameters The parameters to provide for the current MongoDB database. + * @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 MongoDBDatabaseInner object if successful. + */ + public MongoDBDatabaseInner beginCreateUpdateMongoDBDatabase(String resourceGroupName, String accountName, String databaseName, MongoDBDatabaseCreateUpdateParameters createUpdateMongoDBDatabaseParameters) { + return beginCreateUpdateMongoDBDatabaseWithServiceResponseAsync(resourceGroupName, accountName, databaseName, createUpdateMongoDBDatabaseParameters).toBlocking().single().body(); + } + + /** + * Create or updates Azure Cosmos DB MongoDB database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param createUpdateMongoDBDatabaseParameters The parameters to provide for the current MongoDB database. + * @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 beginCreateUpdateMongoDBDatabaseAsync(String resourceGroupName, String accountName, String databaseName, MongoDBDatabaseCreateUpdateParameters createUpdateMongoDBDatabaseParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateUpdateMongoDBDatabaseWithServiceResponseAsync(resourceGroupName, accountName, databaseName, createUpdateMongoDBDatabaseParameters), serviceCallback); + } + + /** + * Create or updates Azure Cosmos DB MongoDB database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param createUpdateMongoDBDatabaseParameters The parameters to provide for the current MongoDB database. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the MongoDBDatabaseInner object + */ + public Observable beginCreateUpdateMongoDBDatabaseAsync(String resourceGroupName, String accountName, String databaseName, MongoDBDatabaseCreateUpdateParameters createUpdateMongoDBDatabaseParameters) { + return beginCreateUpdateMongoDBDatabaseWithServiceResponseAsync(resourceGroupName, accountName, databaseName, createUpdateMongoDBDatabaseParameters).map(new Func1, MongoDBDatabaseInner>() { + @Override + public MongoDBDatabaseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or updates Azure Cosmos DB MongoDB database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param createUpdateMongoDBDatabaseParameters The parameters to provide for the current MongoDB database. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the MongoDBDatabaseInner object + */ + public Observable> beginCreateUpdateMongoDBDatabaseWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName, MongoDBDatabaseCreateUpdateParameters createUpdateMongoDBDatabaseParameters) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName 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 (createUpdateMongoDBDatabaseParameters == null) { + throw new IllegalArgumentException("Parameter createUpdateMongoDBDatabaseParameters is required and cannot be null."); + } + Validator.validate(createUpdateMongoDBDatabaseParameters); + return service.beginCreateUpdateMongoDBDatabase(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, this.client.apiVersion(), createUpdateMongoDBDatabaseParameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateUpdateMongoDBDatabaseDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateUpdateMongoDBDatabaseDelegate(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 an existing Azure Cosmos DB MongoDB database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database 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 deleteMongoDBDatabase(String resourceGroupName, String accountName, String databaseName) { + deleteMongoDBDatabaseWithServiceResponseAsync(resourceGroupName, accountName, databaseName).toBlocking().last().body(); + } + + /** + * Deletes an existing Azure Cosmos DB MongoDB database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database 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 deleteMongoDBDatabaseAsync(String resourceGroupName, String accountName, String databaseName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteMongoDBDatabaseWithServiceResponseAsync(resourceGroupName, accountName, databaseName), serviceCallback); + } + + /** + * Deletes an existing Azure Cosmos DB MongoDB database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteMongoDBDatabaseAsync(String resourceGroupName, String accountName, String databaseName) { + return deleteMongoDBDatabaseWithServiceResponseAsync(resourceGroupName, accountName, databaseName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes an existing Azure Cosmos DB MongoDB database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteMongoDBDatabaseWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName 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.deleteMongoDBDatabase(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes an existing Azure Cosmos DB MongoDB database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database 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 beginDeleteMongoDBDatabase(String resourceGroupName, String accountName, String databaseName) { + beginDeleteMongoDBDatabaseWithServiceResponseAsync(resourceGroupName, accountName, databaseName).toBlocking().single().body(); + } + + /** + * Deletes an existing Azure Cosmos DB MongoDB database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database 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 beginDeleteMongoDBDatabaseAsync(String resourceGroupName, String accountName, String databaseName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteMongoDBDatabaseWithServiceResponseAsync(resourceGroupName, accountName, databaseName), serviceCallback); + } + + /** + * Deletes an existing Azure Cosmos DB MongoDB database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteMongoDBDatabaseAsync(String resourceGroupName, String accountName, String databaseName) { + return beginDeleteMongoDBDatabaseWithServiceResponseAsync(resourceGroupName, accountName, databaseName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes an existing Azure Cosmos DB MongoDB database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteMongoDBDatabaseWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName 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.beginDeleteMongoDBDatabase(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteMongoDBDatabaseDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteMongoDBDatabaseDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the RUs per second of the MongoDB database under an existing Azure Cosmos DB database account with the provided name. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database 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 ThroughputInner object if successful. + */ + public ThroughputInner getMongoDBDatabaseThroughput(String resourceGroupName, String accountName, String databaseName) { + return getMongoDBDatabaseThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName).toBlocking().single().body(); + } + + /** + * Gets the RUs per second of the MongoDB database under an existing Azure Cosmos DB database account with the provided name. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database 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 getMongoDBDatabaseThroughputAsync(String resourceGroupName, String accountName, String databaseName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getMongoDBDatabaseThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName), serviceCallback); + } + + /** + * Gets the RUs per second of the MongoDB database under an existing Azure Cosmos DB database account with the provided name. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ThroughputInner object + */ + public Observable getMongoDBDatabaseThroughputAsync(String resourceGroupName, String accountName, String databaseName) { + return getMongoDBDatabaseThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName).map(new Func1, ThroughputInner>() { + @Override + public ThroughputInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the RUs per second of the MongoDB database under an existing Azure Cosmos DB database account with the provided name. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ThroughputInner object + */ + public Observable> getMongoDBDatabaseThroughputWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName 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.getMongoDBDatabaseThroughput(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getMongoDBDatabaseThroughputDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getMongoDBDatabaseThroughputDelegate(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); + } + + /** + * Update RUs per second of the an Azure Cosmos DB MongoDB database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param resource The standard JSON format of a resource throughput + * @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 ThroughputInner object if successful. + */ + public ThroughputInner updateMongoDBDatabaseThroughput(String resourceGroupName, String accountName, String databaseName, ThroughputResource resource) { + return updateMongoDBDatabaseThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName, resource).toBlocking().last().body(); + } + + /** + * Update RUs per second of the an Azure Cosmos DB MongoDB database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param resource The standard JSON format of a resource throughput + * @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 updateMongoDBDatabaseThroughputAsync(String resourceGroupName, String accountName, String databaseName, ThroughputResource resource, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateMongoDBDatabaseThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName, resource), serviceCallback); + } + + /** + * Update RUs per second of the an Azure Cosmos DB MongoDB database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param resource The standard JSON format of a resource throughput + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateMongoDBDatabaseThroughputAsync(String resourceGroupName, String accountName, String databaseName, ThroughputResource resource) { + return updateMongoDBDatabaseThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName, resource).map(new Func1, ThroughputInner>() { + @Override + public ThroughputInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update RUs per second of the an Azure Cosmos DB MongoDB database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param resource The standard JSON format of a resource throughput + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateMongoDBDatabaseThroughputWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName, ThroughputResource resource) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName 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 (resource == null) { + throw new IllegalArgumentException("Parameter resource is required and cannot be null."); + } + Validator.validate(resource); + ThroughputUpdateParameters updateThroughputParameters = new ThroughputUpdateParameters(); + updateThroughputParameters.withResource(resource); + Observable> observable = service.updateMongoDBDatabaseThroughput(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, this.client.apiVersion(), this.client.acceptLanguage(), updateThroughputParameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Update RUs per second of the an Azure Cosmos DB MongoDB database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param resource The standard JSON format of a resource throughput + * @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 ThroughputInner object if successful. + */ + public ThroughputInner beginUpdateMongoDBDatabaseThroughput(String resourceGroupName, String accountName, String databaseName, ThroughputResource resource) { + return beginUpdateMongoDBDatabaseThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName, resource).toBlocking().single().body(); + } + + /** + * Update RUs per second of the an Azure Cosmos DB MongoDB database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param resource The standard JSON format of a resource throughput + * @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 beginUpdateMongoDBDatabaseThroughputAsync(String resourceGroupName, String accountName, String databaseName, ThroughputResource resource, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateMongoDBDatabaseThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName, resource), serviceCallback); + } + + /** + * Update RUs per second of the an Azure Cosmos DB MongoDB database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param resource The standard JSON format of a resource throughput + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ThroughputInner object + */ + public Observable beginUpdateMongoDBDatabaseThroughputAsync(String resourceGroupName, String accountName, String databaseName, ThroughputResource resource) { + return beginUpdateMongoDBDatabaseThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName, resource).map(new Func1, ThroughputInner>() { + @Override + public ThroughputInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update RUs per second of the an Azure Cosmos DB MongoDB database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param resource The standard JSON format of a resource throughput + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ThroughputInner object + */ + public Observable> beginUpdateMongoDBDatabaseThroughputWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName, ThroughputResource resource) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName 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 (resource == null) { + throw new IllegalArgumentException("Parameter resource is required and cannot be null."); + } + Validator.validate(resource); + ThroughputUpdateParameters updateThroughputParameters = new ThroughputUpdateParameters(); + updateThroughputParameters.withResource(resource); + return service.beginUpdateMongoDBDatabaseThroughput(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, this.client.apiVersion(), this.client.acceptLanguage(), updateThroughputParameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateMongoDBDatabaseThroughputDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateMongoDBDatabaseThroughputDelegate(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 the MongoDB collection under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database 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 List<MongoDBCollectionInner> object if successful. + */ + public List listMongoDBCollections(String resourceGroupName, String accountName, String databaseName) { + return listMongoDBCollectionsWithServiceResponseAsync(resourceGroupName, accountName, databaseName).toBlocking().single().body(); + } + + /** + * Lists the MongoDB collection under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database 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> listMongoDBCollectionsAsync(String resourceGroupName, String accountName, String databaseName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listMongoDBCollectionsWithServiceResponseAsync(resourceGroupName, accountName, databaseName), serviceCallback); + } + + /** + * Lists the MongoDB collection under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<MongoDBCollectionInner> object + */ + public Observable> listMongoDBCollectionsAsync(String resourceGroupName, String accountName, String databaseName) { + return listMongoDBCollectionsWithServiceResponseAsync(resourceGroupName, accountName, databaseName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the MongoDB collection under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<MongoDBCollectionInner> object + */ + public Observable>> listMongoDBCollectionsWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName 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.listMongoDBCollections(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listMongoDBCollectionsDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listMongoDBCollectionsDelegate(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 MongoDB collection under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection 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 MongoDBCollectionInner object if successful. + */ + public MongoDBCollectionInner getMongoDBCollection(String resourceGroupName, String accountName, String databaseName, String collectionName) { + return getMongoDBCollectionWithServiceResponseAsync(resourceGroupName, accountName, databaseName, collectionName).toBlocking().single().body(); + } + + /** + * Gets the MongoDB collection under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection 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 getMongoDBCollectionAsync(String resourceGroupName, String accountName, String databaseName, String collectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getMongoDBCollectionWithServiceResponseAsync(resourceGroupName, accountName, databaseName, collectionName), serviceCallback); + } + + /** + * Gets the MongoDB collection under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the MongoDBCollectionInner object + */ + public Observable getMongoDBCollectionAsync(String resourceGroupName, String accountName, String databaseName, String collectionName) { + return getMongoDBCollectionWithServiceResponseAsync(resourceGroupName, accountName, databaseName, collectionName).map(new Func1, MongoDBCollectionInner>() { + @Override + public MongoDBCollectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the MongoDB collection under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the MongoDBCollectionInner object + */ + public Observable> getMongoDBCollectionWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName, String collectionName) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (collectionName == null) { + throw new IllegalArgumentException("Parameter collectionName 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.getMongoDBCollection(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, collectionName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getMongoDBCollectionDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getMongoDBCollectionDelegate(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 an Azure Cosmos DB MongoDB Collection. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @param createUpdateMongoDBCollectionParameters The parameters to provide for the current MongoDB Collection. + * @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 MongoDBCollectionInner object if successful. + */ + public MongoDBCollectionInner createUpdateMongoDBCollection(String resourceGroupName, String accountName, String databaseName, String collectionName, MongoDBCollectionCreateUpdateParameters createUpdateMongoDBCollectionParameters) { + return createUpdateMongoDBCollectionWithServiceResponseAsync(resourceGroupName, accountName, databaseName, collectionName, createUpdateMongoDBCollectionParameters).toBlocking().last().body(); + } + + /** + * Create or update an Azure Cosmos DB MongoDB Collection. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @param createUpdateMongoDBCollectionParameters The parameters to provide for the current MongoDB Collection. + * @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 createUpdateMongoDBCollectionAsync(String resourceGroupName, String accountName, String databaseName, String collectionName, MongoDBCollectionCreateUpdateParameters createUpdateMongoDBCollectionParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createUpdateMongoDBCollectionWithServiceResponseAsync(resourceGroupName, accountName, databaseName, collectionName, createUpdateMongoDBCollectionParameters), serviceCallback); + } + + /** + * Create or update an Azure Cosmos DB MongoDB Collection. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @param createUpdateMongoDBCollectionParameters The parameters to provide for the current MongoDB Collection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createUpdateMongoDBCollectionAsync(String resourceGroupName, String accountName, String databaseName, String collectionName, MongoDBCollectionCreateUpdateParameters createUpdateMongoDBCollectionParameters) { + return createUpdateMongoDBCollectionWithServiceResponseAsync(resourceGroupName, accountName, databaseName, collectionName, createUpdateMongoDBCollectionParameters).map(new Func1, MongoDBCollectionInner>() { + @Override + public MongoDBCollectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update an Azure Cosmos DB MongoDB Collection. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @param createUpdateMongoDBCollectionParameters The parameters to provide for the current MongoDB Collection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createUpdateMongoDBCollectionWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName, String collectionName, MongoDBCollectionCreateUpdateParameters createUpdateMongoDBCollectionParameters) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (collectionName == null) { + throw new IllegalArgumentException("Parameter collectionName 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 (createUpdateMongoDBCollectionParameters == null) { + throw new IllegalArgumentException("Parameter createUpdateMongoDBCollectionParameters is required and cannot be null."); + } + Validator.validate(createUpdateMongoDBCollectionParameters); + Observable> observable = service.createUpdateMongoDBCollection(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, collectionName, this.client.apiVersion(), createUpdateMongoDBCollectionParameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Create or update an Azure Cosmos DB MongoDB Collection. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @param createUpdateMongoDBCollectionParameters The parameters to provide for the current MongoDB Collection. + * @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 MongoDBCollectionInner object if successful. + */ + public MongoDBCollectionInner beginCreateUpdateMongoDBCollection(String resourceGroupName, String accountName, String databaseName, String collectionName, MongoDBCollectionCreateUpdateParameters createUpdateMongoDBCollectionParameters) { + return beginCreateUpdateMongoDBCollectionWithServiceResponseAsync(resourceGroupName, accountName, databaseName, collectionName, createUpdateMongoDBCollectionParameters).toBlocking().single().body(); + } + + /** + * Create or update an Azure Cosmos DB MongoDB Collection. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @param createUpdateMongoDBCollectionParameters The parameters to provide for the current MongoDB Collection. + * @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 beginCreateUpdateMongoDBCollectionAsync(String resourceGroupName, String accountName, String databaseName, String collectionName, MongoDBCollectionCreateUpdateParameters createUpdateMongoDBCollectionParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateUpdateMongoDBCollectionWithServiceResponseAsync(resourceGroupName, accountName, databaseName, collectionName, createUpdateMongoDBCollectionParameters), serviceCallback); + } + + /** + * Create or update an Azure Cosmos DB MongoDB Collection. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @param createUpdateMongoDBCollectionParameters The parameters to provide for the current MongoDB Collection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the MongoDBCollectionInner object + */ + public Observable beginCreateUpdateMongoDBCollectionAsync(String resourceGroupName, String accountName, String databaseName, String collectionName, MongoDBCollectionCreateUpdateParameters createUpdateMongoDBCollectionParameters) { + return beginCreateUpdateMongoDBCollectionWithServiceResponseAsync(resourceGroupName, accountName, databaseName, collectionName, createUpdateMongoDBCollectionParameters).map(new Func1, MongoDBCollectionInner>() { + @Override + public MongoDBCollectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update an Azure Cosmos DB MongoDB Collection. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @param createUpdateMongoDBCollectionParameters The parameters to provide for the current MongoDB Collection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the MongoDBCollectionInner object + */ + public Observable> beginCreateUpdateMongoDBCollectionWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName, String collectionName, MongoDBCollectionCreateUpdateParameters createUpdateMongoDBCollectionParameters) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (collectionName == null) { + throw new IllegalArgumentException("Parameter collectionName 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 (createUpdateMongoDBCollectionParameters == null) { + throw new IllegalArgumentException("Parameter createUpdateMongoDBCollectionParameters is required and cannot be null."); + } + Validator.validate(createUpdateMongoDBCollectionParameters); + return service.beginCreateUpdateMongoDBCollection(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, collectionName, this.client.apiVersion(), createUpdateMongoDBCollectionParameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateUpdateMongoDBCollectionDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateUpdateMongoDBCollectionDelegate(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 an existing Azure Cosmos DB MongoDB Collection. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection 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 deleteMongoDBCollection(String resourceGroupName, String accountName, String databaseName, String collectionName) { + deleteMongoDBCollectionWithServiceResponseAsync(resourceGroupName, accountName, databaseName, collectionName).toBlocking().last().body(); + } + + /** + * Deletes an existing Azure Cosmos DB MongoDB Collection. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection 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 deleteMongoDBCollectionAsync(String resourceGroupName, String accountName, String databaseName, String collectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteMongoDBCollectionWithServiceResponseAsync(resourceGroupName, accountName, databaseName, collectionName), serviceCallback); + } + + /** + * Deletes an existing Azure Cosmos DB MongoDB Collection. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteMongoDBCollectionAsync(String resourceGroupName, String accountName, String databaseName, String collectionName) { + return deleteMongoDBCollectionWithServiceResponseAsync(resourceGroupName, accountName, databaseName, collectionName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes an existing Azure Cosmos DB MongoDB Collection. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteMongoDBCollectionWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName, String collectionName) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (collectionName == null) { + throw new IllegalArgumentException("Parameter collectionName 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.deleteMongoDBCollection(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, collectionName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes an existing Azure Cosmos DB MongoDB Collection. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection 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 beginDeleteMongoDBCollection(String resourceGroupName, String accountName, String databaseName, String collectionName) { + beginDeleteMongoDBCollectionWithServiceResponseAsync(resourceGroupName, accountName, databaseName, collectionName).toBlocking().single().body(); + } + + /** + * Deletes an existing Azure Cosmos DB MongoDB Collection. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection 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 beginDeleteMongoDBCollectionAsync(String resourceGroupName, String accountName, String databaseName, String collectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteMongoDBCollectionWithServiceResponseAsync(resourceGroupName, accountName, databaseName, collectionName), serviceCallback); + } + + /** + * Deletes an existing Azure Cosmos DB MongoDB Collection. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteMongoDBCollectionAsync(String resourceGroupName, String accountName, String databaseName, String collectionName) { + return beginDeleteMongoDBCollectionWithServiceResponseAsync(resourceGroupName, accountName, databaseName, collectionName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes an existing Azure Cosmos DB MongoDB Collection. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteMongoDBCollectionWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName, String collectionName) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (collectionName == null) { + throw new IllegalArgumentException("Parameter collectionName 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.beginDeleteMongoDBCollection(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, collectionName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteMongoDBCollectionDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteMongoDBCollectionDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the RUs per second of the MongoDB collection under an existing Azure Cosmos DB database account with the provided name. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection 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 ThroughputInner object if successful. + */ + public ThroughputInner getMongoDBCollectionThroughput(String resourceGroupName, String accountName, String databaseName, String collectionName) { + return getMongoDBCollectionThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName, collectionName).toBlocking().single().body(); + } + + /** + * Gets the RUs per second of the MongoDB collection under an existing Azure Cosmos DB database account with the provided name. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection 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 getMongoDBCollectionThroughputAsync(String resourceGroupName, String accountName, String databaseName, String collectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getMongoDBCollectionThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName, collectionName), serviceCallback); + } + + /** + * Gets the RUs per second of the MongoDB collection under an existing Azure Cosmos DB database account with the provided name. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ThroughputInner object + */ + public Observable getMongoDBCollectionThroughputAsync(String resourceGroupName, String accountName, String databaseName, String collectionName) { + return getMongoDBCollectionThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName, collectionName).map(new Func1, ThroughputInner>() { + @Override + public ThroughputInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the RUs per second of the MongoDB collection under an existing Azure Cosmos DB database account with the provided name. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ThroughputInner object + */ + public Observable> getMongoDBCollectionThroughputWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName, String collectionName) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (collectionName == null) { + throw new IllegalArgumentException("Parameter collectionName 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.getMongoDBCollectionThroughput(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, collectionName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getMongoDBCollectionThroughputDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getMongoDBCollectionThroughputDelegate(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); + } + + /** + * Update the RUs per second of an Azure Cosmos DB MongoDB collection. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @param resource The standard JSON format of a resource throughput + * @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 ThroughputInner object if successful. + */ + public ThroughputInner updateMongoDBCollectionThroughput(String resourceGroupName, String accountName, String databaseName, String collectionName, ThroughputResource resource) { + return updateMongoDBCollectionThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName, collectionName, resource).toBlocking().last().body(); + } + + /** + * Update the RUs per second of an Azure Cosmos DB MongoDB collection. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @param resource The standard JSON format of a resource throughput + * @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 updateMongoDBCollectionThroughputAsync(String resourceGroupName, String accountName, String databaseName, String collectionName, ThroughputResource resource, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateMongoDBCollectionThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName, collectionName, resource), serviceCallback); + } + + /** + * Update the RUs per second of an Azure Cosmos DB MongoDB collection. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @param resource The standard JSON format of a resource throughput + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateMongoDBCollectionThroughputAsync(String resourceGroupName, String accountName, String databaseName, String collectionName, ThroughputResource resource) { + return updateMongoDBCollectionThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName, collectionName, resource).map(new Func1, ThroughputInner>() { + @Override + public ThroughputInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update the RUs per second of an Azure Cosmos DB MongoDB collection. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @param resource The standard JSON format of a resource throughput + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateMongoDBCollectionThroughputWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName, String collectionName, ThroughputResource resource) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (collectionName == null) { + throw new IllegalArgumentException("Parameter collectionName 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 (resource == null) { + throw new IllegalArgumentException("Parameter resource is required and cannot be null."); + } + Validator.validate(resource); + ThroughputUpdateParameters updateThroughputParameters = new ThroughputUpdateParameters(); + updateThroughputParameters.withResource(resource); + Observable> observable = service.updateMongoDBCollectionThroughput(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, collectionName, this.client.apiVersion(), this.client.acceptLanguage(), updateThroughputParameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Update the RUs per second of an Azure Cosmos DB MongoDB collection. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @param resource The standard JSON format of a resource throughput + * @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 ThroughputInner object if successful. + */ + public ThroughputInner beginUpdateMongoDBCollectionThroughput(String resourceGroupName, String accountName, String databaseName, String collectionName, ThroughputResource resource) { + return beginUpdateMongoDBCollectionThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName, collectionName, resource).toBlocking().single().body(); + } + + /** + * Update the RUs per second of an Azure Cosmos DB MongoDB collection. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @param resource The standard JSON format of a resource throughput + * @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 beginUpdateMongoDBCollectionThroughputAsync(String resourceGroupName, String accountName, String databaseName, String collectionName, ThroughputResource resource, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateMongoDBCollectionThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName, collectionName, resource), serviceCallback); + } + + /** + * Update the RUs per second of an Azure Cosmos DB MongoDB collection. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @param resource The standard JSON format of a resource throughput + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ThroughputInner object + */ + public Observable beginUpdateMongoDBCollectionThroughputAsync(String resourceGroupName, String accountName, String databaseName, String collectionName, ThroughputResource resource) { + return beginUpdateMongoDBCollectionThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName, collectionName, resource).map(new Func1, ThroughputInner>() { + @Override + public ThroughputInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update the RUs per second of an Azure Cosmos DB MongoDB collection. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @param resource The standard JSON format of a resource throughput + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ThroughputInner object + */ + public Observable> beginUpdateMongoDBCollectionThroughputWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName, String collectionName, ThroughputResource resource) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (collectionName == null) { + throw new IllegalArgumentException("Parameter collectionName 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 (resource == null) { + throw new IllegalArgumentException("Parameter resource is required and cannot be null."); + } + Validator.validate(resource); + ThroughputUpdateParameters updateThroughputParameters = new ThroughputUpdateParameters(); + updateThroughputParameters.withResource(resource); + return service.beginUpdateMongoDBCollectionThroughput(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, collectionName, this.client.apiVersion(), this.client.acceptLanguage(), updateThroughputParameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateMongoDBCollectionThroughputDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateMongoDBCollectionThroughputDelegate(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 the Tables under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account 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 List<TableInner> object if successful. + */ + public List listTables(String resourceGroupName, String accountName) { + return listTablesWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * Lists the Tables under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account 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> listTablesAsync(String resourceGroupName, String accountName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listTablesWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * Lists the Tables under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<TableInner> object + */ + public Observable> listTablesAsync(String resourceGroupName, String accountName) { + return listTablesWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the Tables under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<TableInner> object + */ + public Observable>> listTablesWithServiceResponseAsync(String resourceGroupName, String accountName) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName 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.listTables(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listTablesDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listTablesDelegate(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 Tables under an existing Azure Cosmos DB database account with the provided name. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param tableName Cosmos DB table 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 TableInner object if successful. + */ + public TableInner getTable(String resourceGroupName, String accountName, String tableName) { + return getTableWithServiceResponseAsync(resourceGroupName, accountName, tableName).toBlocking().single().body(); + } + + /** + * Gets the Tables under an existing Azure Cosmos DB database account with the provided name. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param tableName Cosmos DB table 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 getTableAsync(String resourceGroupName, String accountName, String tableName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getTableWithServiceResponseAsync(resourceGroupName, accountName, tableName), serviceCallback); + } + + /** + * Gets the Tables under an existing Azure Cosmos DB database account with the provided name. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param tableName Cosmos DB table name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TableInner object + */ + public Observable getTableAsync(String resourceGroupName, String accountName, String tableName) { + return getTableWithServiceResponseAsync(resourceGroupName, accountName, tableName).map(new Func1, TableInner>() { + @Override + public TableInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the Tables under an existing Azure Cosmos DB database account with the provided name. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param tableName Cosmos DB table name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TableInner object + */ + public Observable> getTableWithServiceResponseAsync(String resourceGroupName, String accountName, String tableName) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (tableName == null) { + throw new IllegalArgumentException("Parameter tableName 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.getTable(this.client.subscriptionId(), resourceGroupName, accountName, tableName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getTableDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getTableDelegate(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 an Azure Cosmos DB Table. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param tableName Cosmos DB table name. + * @param createUpdateTableParameters The parameters to provide for the current Table. + * @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 TableInner object if successful. + */ + public TableInner createUpdateTable(String resourceGroupName, String accountName, String tableName, TableCreateUpdateParameters createUpdateTableParameters) { + return createUpdateTableWithServiceResponseAsync(resourceGroupName, accountName, tableName, createUpdateTableParameters).toBlocking().last().body(); + } + + /** + * Create or update an Azure Cosmos DB Table. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param tableName Cosmos DB table name. + * @param createUpdateTableParameters The parameters to provide for the current Table. + * @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 createUpdateTableAsync(String resourceGroupName, String accountName, String tableName, TableCreateUpdateParameters createUpdateTableParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createUpdateTableWithServiceResponseAsync(resourceGroupName, accountName, tableName, createUpdateTableParameters), serviceCallback); + } + + /** + * Create or update an Azure Cosmos DB Table. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param tableName Cosmos DB table name. + * @param createUpdateTableParameters The parameters to provide for the current Table. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createUpdateTableAsync(String resourceGroupName, String accountName, String tableName, TableCreateUpdateParameters createUpdateTableParameters) { + return createUpdateTableWithServiceResponseAsync(resourceGroupName, accountName, tableName, createUpdateTableParameters).map(new Func1, TableInner>() { + @Override + public TableInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update an Azure Cosmos DB Table. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param tableName Cosmos DB table name. + * @param createUpdateTableParameters The parameters to provide for the current Table. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createUpdateTableWithServiceResponseAsync(String resourceGroupName, String accountName, String tableName, TableCreateUpdateParameters createUpdateTableParameters) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (tableName == null) { + throw new IllegalArgumentException("Parameter tableName 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 (createUpdateTableParameters == null) { + throw new IllegalArgumentException("Parameter createUpdateTableParameters is required and cannot be null."); + } + Validator.validate(createUpdateTableParameters); + Observable> observable = service.createUpdateTable(this.client.subscriptionId(), resourceGroupName, accountName, tableName, this.client.apiVersion(), createUpdateTableParameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Create or update an Azure Cosmos DB Table. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param tableName Cosmos DB table name. + * @param createUpdateTableParameters The parameters to provide for the current Table. + * @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 TableInner object if successful. + */ + public TableInner beginCreateUpdateTable(String resourceGroupName, String accountName, String tableName, TableCreateUpdateParameters createUpdateTableParameters) { + return beginCreateUpdateTableWithServiceResponseAsync(resourceGroupName, accountName, tableName, createUpdateTableParameters).toBlocking().single().body(); + } + + /** + * Create or update an Azure Cosmos DB Table. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param tableName Cosmos DB table name. + * @param createUpdateTableParameters The parameters to provide for the current Table. + * @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 beginCreateUpdateTableAsync(String resourceGroupName, String accountName, String tableName, TableCreateUpdateParameters createUpdateTableParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateUpdateTableWithServiceResponseAsync(resourceGroupName, accountName, tableName, createUpdateTableParameters), serviceCallback); + } + + /** + * Create or update an Azure Cosmos DB Table. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param tableName Cosmos DB table name. + * @param createUpdateTableParameters The parameters to provide for the current Table. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TableInner object + */ + public Observable beginCreateUpdateTableAsync(String resourceGroupName, String accountName, String tableName, TableCreateUpdateParameters createUpdateTableParameters) { + return beginCreateUpdateTableWithServiceResponseAsync(resourceGroupName, accountName, tableName, createUpdateTableParameters).map(new Func1, TableInner>() { + @Override + public TableInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update an Azure Cosmos DB Table. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param tableName Cosmos DB table name. + * @param createUpdateTableParameters The parameters to provide for the current Table. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TableInner object + */ + public Observable> beginCreateUpdateTableWithServiceResponseAsync(String resourceGroupName, String accountName, String tableName, TableCreateUpdateParameters createUpdateTableParameters) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (tableName == null) { + throw new IllegalArgumentException("Parameter tableName 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 (createUpdateTableParameters == null) { + throw new IllegalArgumentException("Parameter createUpdateTableParameters is required and cannot be null."); + } + Validator.validate(createUpdateTableParameters); + return service.beginCreateUpdateTable(this.client.subscriptionId(), resourceGroupName, accountName, tableName, this.client.apiVersion(), createUpdateTableParameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateUpdateTableDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateUpdateTableDelegate(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 an existing Azure Cosmos DB Table. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param tableName Cosmos DB table 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 deleteTable(String resourceGroupName, String accountName, String tableName) { + deleteTableWithServiceResponseAsync(resourceGroupName, accountName, tableName).toBlocking().last().body(); + } + + /** + * Deletes an existing Azure Cosmos DB Table. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param tableName Cosmos DB table 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 deleteTableAsync(String resourceGroupName, String accountName, String tableName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteTableWithServiceResponseAsync(resourceGroupName, accountName, tableName), serviceCallback); + } + + /** + * Deletes an existing Azure Cosmos DB Table. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param tableName Cosmos DB table name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteTableAsync(String resourceGroupName, String accountName, String tableName) { + return deleteTableWithServiceResponseAsync(resourceGroupName, accountName, tableName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes an existing Azure Cosmos DB Table. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param tableName Cosmos DB table name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteTableWithServiceResponseAsync(String resourceGroupName, String accountName, String tableName) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (tableName == null) { + throw new IllegalArgumentException("Parameter tableName 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.deleteTable(this.client.subscriptionId(), resourceGroupName, accountName, tableName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes an existing Azure Cosmos DB Table. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param tableName Cosmos DB table 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 beginDeleteTable(String resourceGroupName, String accountName, String tableName) { + beginDeleteTableWithServiceResponseAsync(resourceGroupName, accountName, tableName).toBlocking().single().body(); + } + + /** + * Deletes an existing Azure Cosmos DB Table. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param tableName Cosmos DB table 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 beginDeleteTableAsync(String resourceGroupName, String accountName, String tableName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteTableWithServiceResponseAsync(resourceGroupName, accountName, tableName), serviceCallback); + } + + /** + * Deletes an existing Azure Cosmos DB Table. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param tableName Cosmos DB table name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteTableAsync(String resourceGroupName, String accountName, String tableName) { + return beginDeleteTableWithServiceResponseAsync(resourceGroupName, accountName, tableName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes an existing Azure Cosmos DB Table. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param tableName Cosmos DB table name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteTableWithServiceResponseAsync(String resourceGroupName, String accountName, String tableName) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (tableName == null) { + throw new IllegalArgumentException("Parameter tableName 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.beginDeleteTable(this.client.subscriptionId(), resourceGroupName, accountName, tableName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteTableDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteTableDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the RUs per second of the Table under an existing Azure Cosmos DB database account with the provided name. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param tableName Cosmos DB table 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 ThroughputInner object if successful. + */ + public ThroughputInner getTableThroughput(String resourceGroupName, String accountName, String tableName) { + return getTableThroughputWithServiceResponseAsync(resourceGroupName, accountName, tableName).toBlocking().single().body(); + } + + /** + * Gets the RUs per second of the Table under an existing Azure Cosmos DB database account with the provided name. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param tableName Cosmos DB table 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 getTableThroughputAsync(String resourceGroupName, String accountName, String tableName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getTableThroughputWithServiceResponseAsync(resourceGroupName, accountName, tableName), serviceCallback); + } + + /** + * Gets the RUs per second of the Table under an existing Azure Cosmos DB database account with the provided name. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param tableName Cosmos DB table name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ThroughputInner object + */ + public Observable getTableThroughputAsync(String resourceGroupName, String accountName, String tableName) { + return getTableThroughputWithServiceResponseAsync(resourceGroupName, accountName, tableName).map(new Func1, ThroughputInner>() { + @Override + public ThroughputInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the RUs per second of the Table under an existing Azure Cosmos DB database account with the provided name. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param tableName Cosmos DB table name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ThroughputInner object + */ + public Observable> getTableThroughputWithServiceResponseAsync(String resourceGroupName, String accountName, String tableName) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (tableName == null) { + throw new IllegalArgumentException("Parameter tableName 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.getTableThroughput(this.client.subscriptionId(), resourceGroupName, accountName, tableName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getTableThroughputDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getTableThroughputDelegate(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); + } + + /** + * Update RUs per second of an Azure Cosmos DB Table. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param tableName Cosmos DB table name. + * @param resource The standard JSON format of a resource throughput + * @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 ThroughputInner object if successful. + */ + public ThroughputInner updateTableThroughput(String resourceGroupName, String accountName, String tableName, ThroughputResource resource) { + return updateTableThroughputWithServiceResponseAsync(resourceGroupName, accountName, tableName, resource).toBlocking().last().body(); + } + + /** + * Update RUs per second of an Azure Cosmos DB Table. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param tableName Cosmos DB table name. + * @param resource The standard JSON format of a resource throughput + * @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 updateTableThroughputAsync(String resourceGroupName, String accountName, String tableName, ThroughputResource resource, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateTableThroughputWithServiceResponseAsync(resourceGroupName, accountName, tableName, resource), serviceCallback); + } + + /** + * Update RUs per second of an Azure Cosmos DB Table. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param tableName Cosmos DB table name. + * @param resource The standard JSON format of a resource throughput + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateTableThroughputAsync(String resourceGroupName, String accountName, String tableName, ThroughputResource resource) { + return updateTableThroughputWithServiceResponseAsync(resourceGroupName, accountName, tableName, resource).map(new Func1, ThroughputInner>() { + @Override + public ThroughputInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update RUs per second of an Azure Cosmos DB Table. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param tableName Cosmos DB table name. + * @param resource The standard JSON format of a resource throughput + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateTableThroughputWithServiceResponseAsync(String resourceGroupName, String accountName, String tableName, ThroughputResource resource) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (tableName == null) { + throw new IllegalArgumentException("Parameter tableName 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 (resource == null) { + throw new IllegalArgumentException("Parameter resource is required and cannot be null."); + } + Validator.validate(resource); + ThroughputUpdateParameters updateThroughputParameters = new ThroughputUpdateParameters(); + updateThroughputParameters.withResource(resource); + Observable> observable = service.updateTableThroughput(this.client.subscriptionId(), resourceGroupName, accountName, tableName, this.client.apiVersion(), this.client.acceptLanguage(), updateThroughputParameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Update RUs per second of an Azure Cosmos DB Table. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param tableName Cosmos DB table name. + * @param resource The standard JSON format of a resource throughput + * @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 ThroughputInner object if successful. + */ + public ThroughputInner beginUpdateTableThroughput(String resourceGroupName, String accountName, String tableName, ThroughputResource resource) { + return beginUpdateTableThroughputWithServiceResponseAsync(resourceGroupName, accountName, tableName, resource).toBlocking().single().body(); + } + + /** + * Update RUs per second of an Azure Cosmos DB Table. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param tableName Cosmos DB table name. + * @param resource The standard JSON format of a resource throughput + * @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 beginUpdateTableThroughputAsync(String resourceGroupName, String accountName, String tableName, ThroughputResource resource, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateTableThroughputWithServiceResponseAsync(resourceGroupName, accountName, tableName, resource), serviceCallback); + } + + /** + * Update RUs per second of an Azure Cosmos DB Table. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param tableName Cosmos DB table name. + * @param resource The standard JSON format of a resource throughput + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ThroughputInner object + */ + public Observable beginUpdateTableThroughputAsync(String resourceGroupName, String accountName, String tableName, ThroughputResource resource) { + return beginUpdateTableThroughputWithServiceResponseAsync(resourceGroupName, accountName, tableName, resource).map(new Func1, ThroughputInner>() { + @Override + public ThroughputInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update RUs per second of an Azure Cosmos DB Table. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param tableName Cosmos DB table name. + * @param resource The standard JSON format of a resource throughput + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ThroughputInner object + */ + public Observable> beginUpdateTableThroughputWithServiceResponseAsync(String resourceGroupName, String accountName, String tableName, ThroughputResource resource) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (tableName == null) { + throw new IllegalArgumentException("Parameter tableName 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 (resource == null) { + throw new IllegalArgumentException("Parameter resource is required and cannot be null."); + } + Validator.validate(resource); + ThroughputUpdateParameters updateThroughputParameters = new ThroughputUpdateParameters(); + updateThroughputParameters.withResource(resource); + return service.beginUpdateTableThroughput(this.client.subscriptionId(), resourceGroupName, accountName, tableName, this.client.apiVersion(), this.client.acceptLanguage(), updateThroughputParameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateTableThroughputDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateTableThroughputDelegate(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 the Cassandra keyspaces under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account 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 List<CassandraKeyspaceInner> object if successful. + */ + public List listCassandraKeyspaces(String resourceGroupName, String accountName) { + return listCassandraKeyspacesWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * Lists the Cassandra keyspaces under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account 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> listCassandraKeyspacesAsync(String resourceGroupName, String accountName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listCassandraKeyspacesWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * Lists the Cassandra keyspaces under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<CassandraKeyspaceInner> object + */ + public Observable> listCassandraKeyspacesAsync(String resourceGroupName, String accountName) { + return listCassandraKeyspacesWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the Cassandra keyspaces under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<CassandraKeyspaceInner> object + */ + public Observable>> listCassandraKeyspacesWithServiceResponseAsync(String resourceGroupName, String accountName) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName 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.listCassandraKeyspaces(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listCassandraKeyspacesDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listCassandraKeyspacesDelegate(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 Cassandra keyspaces under an existing Azure Cosmos DB database account with the provided name. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace 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 CassandraKeyspaceInner object if successful. + */ + public CassandraKeyspaceInner getCassandraKeyspace(String resourceGroupName, String accountName, String keyspaceName) { + return getCassandraKeyspaceWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName).toBlocking().single().body(); + } + + /** + * Gets the Cassandra keyspaces under an existing Azure Cosmos DB database account with the provided name. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace 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 getCassandraKeyspaceAsync(String resourceGroupName, String accountName, String keyspaceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getCassandraKeyspaceWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName), serviceCallback); + } + + /** + * Gets the Cassandra keyspaces under an existing Azure Cosmos DB database account with the provided name. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CassandraKeyspaceInner object + */ + public Observable getCassandraKeyspaceAsync(String resourceGroupName, String accountName, String keyspaceName) { + return getCassandraKeyspaceWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName).map(new Func1, CassandraKeyspaceInner>() { + @Override + public CassandraKeyspaceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the Cassandra keyspaces under an existing Azure Cosmos DB database account with the provided name. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CassandraKeyspaceInner object + */ + public Observable> getCassandraKeyspaceWithServiceResponseAsync(String resourceGroupName, String accountName, String keyspaceName) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (keyspaceName == null) { + throw new IllegalArgumentException("Parameter keyspaceName 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.getCassandraKeyspace(this.client.subscriptionId(), resourceGroupName, accountName, keyspaceName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getCassandraKeyspaceDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getCassandraKeyspaceDelegate(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 an Azure Cosmos DB Cassandra keyspace. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param createUpdateCassandraKeyspaceParameters The parameters to provide for the current Cassandra keyspace. + * @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 CassandraKeyspaceInner object if successful. + */ + public CassandraKeyspaceInner createUpdateCassandraKeyspace(String resourceGroupName, String accountName, String keyspaceName, CassandraKeyspaceCreateUpdateParameters createUpdateCassandraKeyspaceParameters) { + return createUpdateCassandraKeyspaceWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName, createUpdateCassandraKeyspaceParameters).toBlocking().last().body(); + } + + /** + * Create or update an Azure Cosmos DB Cassandra keyspace. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param createUpdateCassandraKeyspaceParameters The parameters to provide for the current Cassandra keyspace. + * @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 createUpdateCassandraKeyspaceAsync(String resourceGroupName, String accountName, String keyspaceName, CassandraKeyspaceCreateUpdateParameters createUpdateCassandraKeyspaceParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createUpdateCassandraKeyspaceWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName, createUpdateCassandraKeyspaceParameters), serviceCallback); + } + + /** + * Create or update an Azure Cosmos DB Cassandra keyspace. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param createUpdateCassandraKeyspaceParameters The parameters to provide for the current Cassandra keyspace. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createUpdateCassandraKeyspaceAsync(String resourceGroupName, String accountName, String keyspaceName, CassandraKeyspaceCreateUpdateParameters createUpdateCassandraKeyspaceParameters) { + return createUpdateCassandraKeyspaceWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName, createUpdateCassandraKeyspaceParameters).map(new Func1, CassandraKeyspaceInner>() { + @Override + public CassandraKeyspaceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update an Azure Cosmos DB Cassandra keyspace. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param createUpdateCassandraKeyspaceParameters The parameters to provide for the current Cassandra keyspace. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createUpdateCassandraKeyspaceWithServiceResponseAsync(String resourceGroupName, String accountName, String keyspaceName, CassandraKeyspaceCreateUpdateParameters createUpdateCassandraKeyspaceParameters) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (keyspaceName == null) { + throw new IllegalArgumentException("Parameter keyspaceName 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 (createUpdateCassandraKeyspaceParameters == null) { + throw new IllegalArgumentException("Parameter createUpdateCassandraKeyspaceParameters is required and cannot be null."); + } + Validator.validate(createUpdateCassandraKeyspaceParameters); + Observable> observable = service.createUpdateCassandraKeyspace(this.client.subscriptionId(), resourceGroupName, accountName, keyspaceName, this.client.apiVersion(), createUpdateCassandraKeyspaceParameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Create or update an Azure Cosmos DB Cassandra keyspace. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param createUpdateCassandraKeyspaceParameters The parameters to provide for the current Cassandra keyspace. + * @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 CassandraKeyspaceInner object if successful. + */ + public CassandraKeyspaceInner beginCreateUpdateCassandraKeyspace(String resourceGroupName, String accountName, String keyspaceName, CassandraKeyspaceCreateUpdateParameters createUpdateCassandraKeyspaceParameters) { + return beginCreateUpdateCassandraKeyspaceWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName, createUpdateCassandraKeyspaceParameters).toBlocking().single().body(); + } + + /** + * Create or update an Azure Cosmos DB Cassandra keyspace. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param createUpdateCassandraKeyspaceParameters The parameters to provide for the current Cassandra keyspace. + * @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 beginCreateUpdateCassandraKeyspaceAsync(String resourceGroupName, String accountName, String keyspaceName, CassandraKeyspaceCreateUpdateParameters createUpdateCassandraKeyspaceParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateUpdateCassandraKeyspaceWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName, createUpdateCassandraKeyspaceParameters), serviceCallback); + } + + /** + * Create or update an Azure Cosmos DB Cassandra keyspace. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param createUpdateCassandraKeyspaceParameters The parameters to provide for the current Cassandra keyspace. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CassandraKeyspaceInner object + */ + public Observable beginCreateUpdateCassandraKeyspaceAsync(String resourceGroupName, String accountName, String keyspaceName, CassandraKeyspaceCreateUpdateParameters createUpdateCassandraKeyspaceParameters) { + return beginCreateUpdateCassandraKeyspaceWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName, createUpdateCassandraKeyspaceParameters).map(new Func1, CassandraKeyspaceInner>() { + @Override + public CassandraKeyspaceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update an Azure Cosmos DB Cassandra keyspace. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param createUpdateCassandraKeyspaceParameters The parameters to provide for the current Cassandra keyspace. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CassandraKeyspaceInner object + */ + public Observable> beginCreateUpdateCassandraKeyspaceWithServiceResponseAsync(String resourceGroupName, String accountName, String keyspaceName, CassandraKeyspaceCreateUpdateParameters createUpdateCassandraKeyspaceParameters) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (keyspaceName == null) { + throw new IllegalArgumentException("Parameter keyspaceName 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 (createUpdateCassandraKeyspaceParameters == null) { + throw new IllegalArgumentException("Parameter createUpdateCassandraKeyspaceParameters is required and cannot be null."); + } + Validator.validate(createUpdateCassandraKeyspaceParameters); + return service.beginCreateUpdateCassandraKeyspace(this.client.subscriptionId(), resourceGroupName, accountName, keyspaceName, this.client.apiVersion(), createUpdateCassandraKeyspaceParameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateUpdateCassandraKeyspaceDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateUpdateCassandraKeyspaceDelegate(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 an existing Azure Cosmos DB Cassandra keyspace. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace 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 deleteCassandraKeyspace(String resourceGroupName, String accountName, String keyspaceName) { + deleteCassandraKeyspaceWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName).toBlocking().last().body(); + } + + /** + * Deletes an existing Azure Cosmos DB Cassandra keyspace. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace 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 deleteCassandraKeyspaceAsync(String resourceGroupName, String accountName, String keyspaceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteCassandraKeyspaceWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName), serviceCallback); + } + + /** + * Deletes an existing Azure Cosmos DB Cassandra keyspace. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteCassandraKeyspaceAsync(String resourceGroupName, String accountName, String keyspaceName) { + return deleteCassandraKeyspaceWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes an existing Azure Cosmos DB Cassandra keyspace. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteCassandraKeyspaceWithServiceResponseAsync(String resourceGroupName, String accountName, String keyspaceName) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (keyspaceName == null) { + throw new IllegalArgumentException("Parameter keyspaceName 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.deleteCassandraKeyspace(this.client.subscriptionId(), resourceGroupName, accountName, keyspaceName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes an existing Azure Cosmos DB Cassandra keyspace. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace 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 beginDeleteCassandraKeyspace(String resourceGroupName, String accountName, String keyspaceName) { + beginDeleteCassandraKeyspaceWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName).toBlocking().single().body(); + } + + /** + * Deletes an existing Azure Cosmos DB Cassandra keyspace. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace 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 beginDeleteCassandraKeyspaceAsync(String resourceGroupName, String accountName, String keyspaceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteCassandraKeyspaceWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName), serviceCallback); + } + + /** + * Deletes an existing Azure Cosmos DB Cassandra keyspace. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteCassandraKeyspaceAsync(String resourceGroupName, String accountName, String keyspaceName) { + return beginDeleteCassandraKeyspaceWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes an existing Azure Cosmos DB Cassandra keyspace. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteCassandraKeyspaceWithServiceResponseAsync(String resourceGroupName, String accountName, String keyspaceName) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (keyspaceName == null) { + throw new IllegalArgumentException("Parameter keyspaceName 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.beginDeleteCassandraKeyspace(this.client.subscriptionId(), resourceGroupName, accountName, keyspaceName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteCassandraKeyspaceDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteCassandraKeyspaceDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the RUs per second of the Cassandra Keyspace under an existing Azure Cosmos DB database account with the provided name. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace 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 ThroughputInner object if successful. + */ + public ThroughputInner getCassandraKeyspaceThroughput(String resourceGroupName, String accountName, String keyspaceName) { + return getCassandraKeyspaceThroughputWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName).toBlocking().single().body(); + } + + /** + * Gets the RUs per second of the Cassandra Keyspace under an existing Azure Cosmos DB database account with the provided name. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace 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 getCassandraKeyspaceThroughputAsync(String resourceGroupName, String accountName, String keyspaceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getCassandraKeyspaceThroughputWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName), serviceCallback); + } + + /** + * Gets the RUs per second of the Cassandra Keyspace under an existing Azure Cosmos DB database account with the provided name. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ThroughputInner object + */ + public Observable getCassandraKeyspaceThroughputAsync(String resourceGroupName, String accountName, String keyspaceName) { + return getCassandraKeyspaceThroughputWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName).map(new Func1, ThroughputInner>() { + @Override + public ThroughputInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the RUs per second of the Cassandra Keyspace under an existing Azure Cosmos DB database account with the provided name. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ThroughputInner object + */ + public Observable> getCassandraKeyspaceThroughputWithServiceResponseAsync(String resourceGroupName, String accountName, String keyspaceName) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (keyspaceName == null) { + throw new IllegalArgumentException("Parameter keyspaceName 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.getCassandraKeyspaceThroughput(this.client.subscriptionId(), resourceGroupName, accountName, keyspaceName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getCassandraKeyspaceThroughputDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getCassandraKeyspaceThroughputDelegate(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); + } + + /** + * Update RUs per second of an Azure Cosmos DB Cassandra Keyspace. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param resource The standard JSON format of a resource throughput + * @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 ThroughputInner object if successful. + */ + public ThroughputInner updateCassandraKeyspaceThroughput(String resourceGroupName, String accountName, String keyspaceName, ThroughputResource resource) { + return updateCassandraKeyspaceThroughputWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName, resource).toBlocking().last().body(); + } + + /** + * Update RUs per second of an Azure Cosmos DB Cassandra Keyspace. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param resource The standard JSON format of a resource throughput + * @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 updateCassandraKeyspaceThroughputAsync(String resourceGroupName, String accountName, String keyspaceName, ThroughputResource resource, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateCassandraKeyspaceThroughputWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName, resource), serviceCallback); + } + + /** + * Update RUs per second of an Azure Cosmos DB Cassandra Keyspace. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param resource The standard JSON format of a resource throughput + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateCassandraKeyspaceThroughputAsync(String resourceGroupName, String accountName, String keyspaceName, ThroughputResource resource) { + return updateCassandraKeyspaceThroughputWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName, resource).map(new Func1, ThroughputInner>() { + @Override + public ThroughputInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update RUs per second of an Azure Cosmos DB Cassandra Keyspace. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param resource The standard JSON format of a resource throughput + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateCassandraKeyspaceThroughputWithServiceResponseAsync(String resourceGroupName, String accountName, String keyspaceName, ThroughputResource resource) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (keyspaceName == null) { + throw new IllegalArgumentException("Parameter keyspaceName 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 (resource == null) { + throw new IllegalArgumentException("Parameter resource is required and cannot be null."); + } + Validator.validate(resource); + ThroughputUpdateParameters updateThroughputParameters = new ThroughputUpdateParameters(); + updateThroughputParameters.withResource(resource); + Observable> observable = service.updateCassandraKeyspaceThroughput(this.client.subscriptionId(), resourceGroupName, accountName, keyspaceName, this.client.apiVersion(), this.client.acceptLanguage(), updateThroughputParameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Update RUs per second of an Azure Cosmos DB Cassandra Keyspace. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param resource The standard JSON format of a resource throughput + * @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 ThroughputInner object if successful. + */ + public ThroughputInner beginUpdateCassandraKeyspaceThroughput(String resourceGroupName, String accountName, String keyspaceName, ThroughputResource resource) { + return beginUpdateCassandraKeyspaceThroughputWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName, resource).toBlocking().single().body(); + } + + /** + * Update RUs per second of an Azure Cosmos DB Cassandra Keyspace. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param resource The standard JSON format of a resource throughput + * @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 beginUpdateCassandraKeyspaceThroughputAsync(String resourceGroupName, String accountName, String keyspaceName, ThroughputResource resource, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateCassandraKeyspaceThroughputWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName, resource), serviceCallback); + } + + /** + * Update RUs per second of an Azure Cosmos DB Cassandra Keyspace. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param resource The standard JSON format of a resource throughput + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ThroughputInner object + */ + public Observable beginUpdateCassandraKeyspaceThroughputAsync(String resourceGroupName, String accountName, String keyspaceName, ThroughputResource resource) { + return beginUpdateCassandraKeyspaceThroughputWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName, resource).map(new Func1, ThroughputInner>() { + @Override + public ThroughputInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update RUs per second of an Azure Cosmos DB Cassandra Keyspace. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param resource The standard JSON format of a resource throughput + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ThroughputInner object + */ + public Observable> beginUpdateCassandraKeyspaceThroughputWithServiceResponseAsync(String resourceGroupName, String accountName, String keyspaceName, ThroughputResource resource) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (keyspaceName == null) { + throw new IllegalArgumentException("Parameter keyspaceName 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 (resource == null) { + throw new IllegalArgumentException("Parameter resource is required and cannot be null."); + } + Validator.validate(resource); + ThroughputUpdateParameters updateThroughputParameters = new ThroughputUpdateParameters(); + updateThroughputParameters.withResource(resource); + return service.beginUpdateCassandraKeyspaceThroughput(this.client.subscriptionId(), resourceGroupName, accountName, keyspaceName, this.client.apiVersion(), this.client.acceptLanguage(), updateThroughputParameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateCassandraKeyspaceThroughputDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateCassandraKeyspaceThroughputDelegate(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 the Cassandra table under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace 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 List<CassandraTableInner> object if successful. + */ + public List listCassandraTables(String resourceGroupName, String accountName, String keyspaceName) { + return listCassandraTablesWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName).toBlocking().single().body(); + } + + /** + * Lists the Cassandra table under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace 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> listCassandraTablesAsync(String resourceGroupName, String accountName, String keyspaceName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listCassandraTablesWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName), serviceCallback); + } + + /** + * Lists the Cassandra table under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<CassandraTableInner> object + */ + public Observable> listCassandraTablesAsync(String resourceGroupName, String accountName, String keyspaceName) { + return listCassandraTablesWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the Cassandra table under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<CassandraTableInner> object + */ + public Observable>> listCassandraTablesWithServiceResponseAsync(String resourceGroupName, String accountName, String keyspaceName) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (keyspaceName == null) { + throw new IllegalArgumentException("Parameter keyspaceName 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.listCassandraTables(this.client.subscriptionId(), resourceGroupName, accountName, keyspaceName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listCassandraTablesDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listCassandraTablesDelegate(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 Cassandra table under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table 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 CassandraTableInner object if successful. + */ + public CassandraTableInner getCassandraTable(String resourceGroupName, String accountName, String keyspaceName, String tableName) { + return getCassandraTableWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName, tableName).toBlocking().single().body(); + } + + /** + * Gets the Cassandra table under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table 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 getCassandraTableAsync(String resourceGroupName, String accountName, String keyspaceName, String tableName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getCassandraTableWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName, tableName), serviceCallback); + } + + /** + * Gets the Cassandra table under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CassandraTableInner object + */ + public Observable getCassandraTableAsync(String resourceGroupName, String accountName, String keyspaceName, String tableName) { + return getCassandraTableWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName, tableName).map(new Func1, CassandraTableInner>() { + @Override + public CassandraTableInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the Cassandra table under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CassandraTableInner object + */ + public Observable> getCassandraTableWithServiceResponseAsync(String resourceGroupName, String accountName, String keyspaceName, String tableName) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (keyspaceName == null) { + throw new IllegalArgumentException("Parameter keyspaceName is required and cannot be null."); + } + if (tableName == null) { + throw new IllegalArgumentException("Parameter tableName 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.getCassandraTable(this.client.subscriptionId(), resourceGroupName, accountName, keyspaceName, tableName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getCassandraTableDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getCassandraTableDelegate(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 an Azure Cosmos DB Cassandra Table. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @param createUpdateCassandraTableParameters The parameters to provide for the current Cassandra Table. + * @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 CassandraTableInner object if successful. + */ + public CassandraTableInner createUpdateCassandraTable(String resourceGroupName, String accountName, String keyspaceName, String tableName, CassandraTableCreateUpdateParameters createUpdateCassandraTableParameters) { + return createUpdateCassandraTableWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName, tableName, createUpdateCassandraTableParameters).toBlocking().last().body(); + } + + /** + * Create or update an Azure Cosmos DB Cassandra Table. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @param createUpdateCassandraTableParameters The parameters to provide for the current Cassandra Table. + * @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 createUpdateCassandraTableAsync(String resourceGroupName, String accountName, String keyspaceName, String tableName, CassandraTableCreateUpdateParameters createUpdateCassandraTableParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createUpdateCassandraTableWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName, tableName, createUpdateCassandraTableParameters), serviceCallback); + } + + /** + * Create or update an Azure Cosmos DB Cassandra Table. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @param createUpdateCassandraTableParameters The parameters to provide for the current Cassandra Table. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createUpdateCassandraTableAsync(String resourceGroupName, String accountName, String keyspaceName, String tableName, CassandraTableCreateUpdateParameters createUpdateCassandraTableParameters) { + return createUpdateCassandraTableWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName, tableName, createUpdateCassandraTableParameters).map(new Func1, CassandraTableInner>() { + @Override + public CassandraTableInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update an Azure Cosmos DB Cassandra Table. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @param createUpdateCassandraTableParameters The parameters to provide for the current Cassandra Table. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createUpdateCassandraTableWithServiceResponseAsync(String resourceGroupName, String accountName, String keyspaceName, String tableName, CassandraTableCreateUpdateParameters createUpdateCassandraTableParameters) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (keyspaceName == null) { + throw new IllegalArgumentException("Parameter keyspaceName is required and cannot be null."); + } + if (tableName == null) { + throw new IllegalArgumentException("Parameter tableName 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 (createUpdateCassandraTableParameters == null) { + throw new IllegalArgumentException("Parameter createUpdateCassandraTableParameters is required and cannot be null."); + } + Validator.validate(createUpdateCassandraTableParameters); + Observable> observable = service.createUpdateCassandraTable(this.client.subscriptionId(), resourceGroupName, accountName, keyspaceName, tableName, this.client.apiVersion(), createUpdateCassandraTableParameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Create or update an Azure Cosmos DB Cassandra Table. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @param createUpdateCassandraTableParameters The parameters to provide for the current Cassandra Table. + * @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 CassandraTableInner object if successful. + */ + public CassandraTableInner beginCreateUpdateCassandraTable(String resourceGroupName, String accountName, String keyspaceName, String tableName, CassandraTableCreateUpdateParameters createUpdateCassandraTableParameters) { + return beginCreateUpdateCassandraTableWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName, tableName, createUpdateCassandraTableParameters).toBlocking().single().body(); + } + + /** + * Create or update an Azure Cosmos DB Cassandra Table. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @param createUpdateCassandraTableParameters The parameters to provide for the current Cassandra Table. + * @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 beginCreateUpdateCassandraTableAsync(String resourceGroupName, String accountName, String keyspaceName, String tableName, CassandraTableCreateUpdateParameters createUpdateCassandraTableParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateUpdateCassandraTableWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName, tableName, createUpdateCassandraTableParameters), serviceCallback); + } + + /** + * Create or update an Azure Cosmos DB Cassandra Table. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @param createUpdateCassandraTableParameters The parameters to provide for the current Cassandra Table. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CassandraTableInner object + */ + public Observable beginCreateUpdateCassandraTableAsync(String resourceGroupName, String accountName, String keyspaceName, String tableName, CassandraTableCreateUpdateParameters createUpdateCassandraTableParameters) { + return beginCreateUpdateCassandraTableWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName, tableName, createUpdateCassandraTableParameters).map(new Func1, CassandraTableInner>() { + @Override + public CassandraTableInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update an Azure Cosmos DB Cassandra Table. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @param createUpdateCassandraTableParameters The parameters to provide for the current Cassandra Table. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CassandraTableInner object + */ + public Observable> beginCreateUpdateCassandraTableWithServiceResponseAsync(String resourceGroupName, String accountName, String keyspaceName, String tableName, CassandraTableCreateUpdateParameters createUpdateCassandraTableParameters) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (keyspaceName == null) { + throw new IllegalArgumentException("Parameter keyspaceName is required and cannot be null."); + } + if (tableName == null) { + throw new IllegalArgumentException("Parameter tableName 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 (createUpdateCassandraTableParameters == null) { + throw new IllegalArgumentException("Parameter createUpdateCassandraTableParameters is required and cannot be null."); + } + Validator.validate(createUpdateCassandraTableParameters); + return service.beginCreateUpdateCassandraTable(this.client.subscriptionId(), resourceGroupName, accountName, keyspaceName, tableName, this.client.apiVersion(), createUpdateCassandraTableParameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateUpdateCassandraTableDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateUpdateCassandraTableDelegate(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 an existing Azure Cosmos DB Cassandra table. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table 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 deleteCassandraTable(String resourceGroupName, String accountName, String keyspaceName, String tableName) { + deleteCassandraTableWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName, tableName).toBlocking().last().body(); + } + + /** + * Deletes an existing Azure Cosmos DB Cassandra table. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table 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 deleteCassandraTableAsync(String resourceGroupName, String accountName, String keyspaceName, String tableName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteCassandraTableWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName, tableName), serviceCallback); + } + + /** + * Deletes an existing Azure Cosmos DB Cassandra table. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteCassandraTableAsync(String resourceGroupName, String accountName, String keyspaceName, String tableName) { + return deleteCassandraTableWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName, tableName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes an existing Azure Cosmos DB Cassandra table. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteCassandraTableWithServiceResponseAsync(String resourceGroupName, String accountName, String keyspaceName, String tableName) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (keyspaceName == null) { + throw new IllegalArgumentException("Parameter keyspaceName is required and cannot be null."); + } + if (tableName == null) { + throw new IllegalArgumentException("Parameter tableName 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.deleteCassandraTable(this.client.subscriptionId(), resourceGroupName, accountName, keyspaceName, tableName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes an existing Azure Cosmos DB Cassandra table. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table 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 beginDeleteCassandraTable(String resourceGroupName, String accountName, String keyspaceName, String tableName) { + beginDeleteCassandraTableWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName, tableName).toBlocking().single().body(); + } + + /** + * Deletes an existing Azure Cosmos DB Cassandra table. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table 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 beginDeleteCassandraTableAsync(String resourceGroupName, String accountName, String keyspaceName, String tableName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteCassandraTableWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName, tableName), serviceCallback); + } + + /** + * Deletes an existing Azure Cosmos DB Cassandra table. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteCassandraTableAsync(String resourceGroupName, String accountName, String keyspaceName, String tableName) { + return beginDeleteCassandraTableWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName, tableName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes an existing Azure Cosmos DB Cassandra table. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteCassandraTableWithServiceResponseAsync(String resourceGroupName, String accountName, String keyspaceName, String tableName) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (keyspaceName == null) { + throw new IllegalArgumentException("Parameter keyspaceName is required and cannot be null."); + } + if (tableName == null) { + throw new IllegalArgumentException("Parameter tableName 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.beginDeleteCassandraTable(this.client.subscriptionId(), resourceGroupName, accountName, keyspaceName, tableName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteCassandraTableDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteCassandraTableDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the RUs per second of the Cassandra table under an existing Azure Cosmos DB database account with the provided name. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table 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 ThroughputInner object if successful. + */ + public ThroughputInner getCassandraTableThroughput(String resourceGroupName, String accountName, String keyspaceName, String tableName) { + return getCassandraTableThroughputWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName, tableName).toBlocking().single().body(); + } + + /** + * Gets the RUs per second of the Cassandra table under an existing Azure Cosmos DB database account with the provided name. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table 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 getCassandraTableThroughputAsync(String resourceGroupName, String accountName, String keyspaceName, String tableName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getCassandraTableThroughputWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName, tableName), serviceCallback); + } + + /** + * Gets the RUs per second of the Cassandra table under an existing Azure Cosmos DB database account with the provided name. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ThroughputInner object + */ + public Observable getCassandraTableThroughputAsync(String resourceGroupName, String accountName, String keyspaceName, String tableName) { + return getCassandraTableThroughputWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName, tableName).map(new Func1, ThroughputInner>() { + @Override + public ThroughputInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the RUs per second of the Cassandra table under an existing Azure Cosmos DB database account with the provided name. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ThroughputInner object + */ + public Observable> getCassandraTableThroughputWithServiceResponseAsync(String resourceGroupName, String accountName, String keyspaceName, String tableName) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (keyspaceName == null) { + throw new IllegalArgumentException("Parameter keyspaceName is required and cannot be null."); + } + if (tableName == null) { + throw new IllegalArgumentException("Parameter tableName 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.getCassandraTableThroughput(this.client.subscriptionId(), resourceGroupName, accountName, keyspaceName, tableName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getCassandraTableThroughputDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getCassandraTableThroughputDelegate(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); + } + + /** + * Update RUs per second of an Azure Cosmos DB Cassandra table. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @param resource The standard JSON format of a resource throughput + * @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 ThroughputInner object if successful. + */ + public ThroughputInner updateCassandraTableThroughput(String resourceGroupName, String accountName, String keyspaceName, String tableName, ThroughputResource resource) { + return updateCassandraTableThroughputWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName, tableName, resource).toBlocking().last().body(); + } + + /** + * Update RUs per second of an Azure Cosmos DB Cassandra table. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @param resource The standard JSON format of a resource throughput + * @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 updateCassandraTableThroughputAsync(String resourceGroupName, String accountName, String keyspaceName, String tableName, ThroughputResource resource, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateCassandraTableThroughputWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName, tableName, resource), serviceCallback); + } + + /** + * Update RUs per second of an Azure Cosmos DB Cassandra table. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @param resource The standard JSON format of a resource throughput + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateCassandraTableThroughputAsync(String resourceGroupName, String accountName, String keyspaceName, String tableName, ThroughputResource resource) { + return updateCassandraTableThroughputWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName, tableName, resource).map(new Func1, ThroughputInner>() { + @Override + public ThroughputInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update RUs per second of an Azure Cosmos DB Cassandra table. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @param resource The standard JSON format of a resource throughput + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateCassandraTableThroughputWithServiceResponseAsync(String resourceGroupName, String accountName, String keyspaceName, String tableName, ThroughputResource resource) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (keyspaceName == null) { + throw new IllegalArgumentException("Parameter keyspaceName is required and cannot be null."); + } + if (tableName == null) { + throw new IllegalArgumentException("Parameter tableName 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 (resource == null) { + throw new IllegalArgumentException("Parameter resource is required and cannot be null."); + } + Validator.validate(resource); + ThroughputUpdateParameters updateThroughputParameters = new ThroughputUpdateParameters(); + updateThroughputParameters.withResource(resource); + Observable> observable = service.updateCassandraTableThroughput(this.client.subscriptionId(), resourceGroupName, accountName, keyspaceName, tableName, this.client.apiVersion(), this.client.acceptLanguage(), updateThroughputParameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Update RUs per second of an Azure Cosmos DB Cassandra table. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @param resource The standard JSON format of a resource throughput + * @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 ThroughputInner object if successful. + */ + public ThroughputInner beginUpdateCassandraTableThroughput(String resourceGroupName, String accountName, String keyspaceName, String tableName, ThroughputResource resource) { + return beginUpdateCassandraTableThroughputWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName, tableName, resource).toBlocking().single().body(); + } + + /** + * Update RUs per second of an Azure Cosmos DB Cassandra table. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @param resource The standard JSON format of a resource throughput + * @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 beginUpdateCassandraTableThroughputAsync(String resourceGroupName, String accountName, String keyspaceName, String tableName, ThroughputResource resource, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateCassandraTableThroughputWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName, tableName, resource), serviceCallback); + } + + /** + * Update RUs per second of an Azure Cosmos DB Cassandra table. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @param resource The standard JSON format of a resource throughput + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ThroughputInner object + */ + public Observable beginUpdateCassandraTableThroughputAsync(String resourceGroupName, String accountName, String keyspaceName, String tableName, ThroughputResource resource) { + return beginUpdateCassandraTableThroughputWithServiceResponseAsync(resourceGroupName, accountName, keyspaceName, tableName, resource).map(new Func1, ThroughputInner>() { + @Override + public ThroughputInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update RUs per second of an Azure Cosmos DB Cassandra table. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @param resource The standard JSON format of a resource throughput + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ThroughputInner object + */ + public Observable> beginUpdateCassandraTableThroughputWithServiceResponseAsync(String resourceGroupName, String accountName, String keyspaceName, String tableName, ThroughputResource resource) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (keyspaceName == null) { + throw new IllegalArgumentException("Parameter keyspaceName is required and cannot be null."); + } + if (tableName == null) { + throw new IllegalArgumentException("Parameter tableName 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 (resource == null) { + throw new IllegalArgumentException("Parameter resource is required and cannot be null."); + } + Validator.validate(resource); + ThroughputUpdateParameters updateThroughputParameters = new ThroughputUpdateParameters(); + updateThroughputParameters.withResource(resource); + return service.beginUpdateCassandraTableThroughput(this.client.subscriptionId(), resourceGroupName, accountName, keyspaceName, tableName, this.client.apiVersion(), this.client.acceptLanguage(), updateThroughputParameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateCassandraTableThroughputDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateCassandraTableThroughputDelegate(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 the Gremlin databases under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account 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 List<GremlinDatabaseInner> object if successful. + */ + public List listGremlinDatabases(String resourceGroupName, String accountName) { + return listGremlinDatabasesWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * Lists the Gremlin databases under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account 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> listGremlinDatabasesAsync(String resourceGroupName, String accountName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listGremlinDatabasesWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * Lists the Gremlin databases under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<GremlinDatabaseInner> object + */ + public Observable> listGremlinDatabasesAsync(String resourceGroupName, String accountName) { + return listGremlinDatabasesWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the Gremlin databases under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<GremlinDatabaseInner> object + */ + public Observable>> listGremlinDatabasesWithServiceResponseAsync(String resourceGroupName, String accountName) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName 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.listGremlinDatabases(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listGremlinDatabasesDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listGremlinDatabasesDelegate(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 Gremlin databases under an existing Azure Cosmos DB database account with the provided name. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database 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 GremlinDatabaseInner object if successful. + */ + public GremlinDatabaseInner getGremlinDatabase(String resourceGroupName, String accountName, String databaseName) { + return getGremlinDatabaseWithServiceResponseAsync(resourceGroupName, accountName, databaseName).toBlocking().single().body(); + } + + /** + * Gets the Gremlin databases under an existing Azure Cosmos DB database account with the provided name. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database 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 getGremlinDatabaseAsync(String resourceGroupName, String accountName, String databaseName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getGremlinDatabaseWithServiceResponseAsync(resourceGroupName, accountName, databaseName), serviceCallback); + } + + /** + * Gets the Gremlin databases under an existing Azure Cosmos DB database account with the provided name. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the GremlinDatabaseInner object + */ + public Observable getGremlinDatabaseAsync(String resourceGroupName, String accountName, String databaseName) { + return getGremlinDatabaseWithServiceResponseAsync(resourceGroupName, accountName, databaseName).map(new Func1, GremlinDatabaseInner>() { + @Override + public GremlinDatabaseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the Gremlin databases under an existing Azure Cosmos DB database account with the provided name. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the GremlinDatabaseInner object + */ + public Observable> getGremlinDatabaseWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName 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.getGremlinDatabase(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getGremlinDatabaseDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getGremlinDatabaseDelegate(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 an Azure Cosmos DB Gremlin database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param createUpdateGremlinDatabaseParameters The parameters to provide for the current Gremlin database. + * @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 GremlinDatabaseInner object if successful. + */ + public GremlinDatabaseInner createUpdateGremlinDatabase(String resourceGroupName, String accountName, String databaseName, GremlinDatabaseCreateUpdateParameters createUpdateGremlinDatabaseParameters) { + return createUpdateGremlinDatabaseWithServiceResponseAsync(resourceGroupName, accountName, databaseName, createUpdateGremlinDatabaseParameters).toBlocking().last().body(); + } + + /** + * Create or update an Azure Cosmos DB Gremlin database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param createUpdateGremlinDatabaseParameters The parameters to provide for the current Gremlin database. + * @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 createUpdateGremlinDatabaseAsync(String resourceGroupName, String accountName, String databaseName, GremlinDatabaseCreateUpdateParameters createUpdateGremlinDatabaseParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createUpdateGremlinDatabaseWithServiceResponseAsync(resourceGroupName, accountName, databaseName, createUpdateGremlinDatabaseParameters), serviceCallback); + } + + /** + * Create or update an Azure Cosmos DB Gremlin database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param createUpdateGremlinDatabaseParameters The parameters to provide for the current Gremlin database. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createUpdateGremlinDatabaseAsync(String resourceGroupName, String accountName, String databaseName, GremlinDatabaseCreateUpdateParameters createUpdateGremlinDatabaseParameters) { + return createUpdateGremlinDatabaseWithServiceResponseAsync(resourceGroupName, accountName, databaseName, createUpdateGremlinDatabaseParameters).map(new Func1, GremlinDatabaseInner>() { + @Override + public GremlinDatabaseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update an Azure Cosmos DB Gremlin database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param createUpdateGremlinDatabaseParameters The parameters to provide for the current Gremlin database. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createUpdateGremlinDatabaseWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName, GremlinDatabaseCreateUpdateParameters createUpdateGremlinDatabaseParameters) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName 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 (createUpdateGremlinDatabaseParameters == null) { + throw new IllegalArgumentException("Parameter createUpdateGremlinDatabaseParameters is required and cannot be null."); + } + Validator.validate(createUpdateGremlinDatabaseParameters); + Observable> observable = service.createUpdateGremlinDatabase(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, this.client.apiVersion(), createUpdateGremlinDatabaseParameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Create or update an Azure Cosmos DB Gremlin database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param createUpdateGremlinDatabaseParameters The parameters to provide for the current Gremlin database. + * @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 GremlinDatabaseInner object if successful. + */ + public GremlinDatabaseInner beginCreateUpdateGremlinDatabase(String resourceGroupName, String accountName, String databaseName, GremlinDatabaseCreateUpdateParameters createUpdateGremlinDatabaseParameters) { + return beginCreateUpdateGremlinDatabaseWithServiceResponseAsync(resourceGroupName, accountName, databaseName, createUpdateGremlinDatabaseParameters).toBlocking().single().body(); + } + + /** + * Create or update an Azure Cosmos DB Gremlin database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param createUpdateGremlinDatabaseParameters The parameters to provide for the current Gremlin database. + * @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 beginCreateUpdateGremlinDatabaseAsync(String resourceGroupName, String accountName, String databaseName, GremlinDatabaseCreateUpdateParameters createUpdateGremlinDatabaseParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateUpdateGremlinDatabaseWithServiceResponseAsync(resourceGroupName, accountName, databaseName, createUpdateGremlinDatabaseParameters), serviceCallback); + } + + /** + * Create or update an Azure Cosmos DB Gremlin database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param createUpdateGremlinDatabaseParameters The parameters to provide for the current Gremlin database. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the GremlinDatabaseInner object + */ + public Observable beginCreateUpdateGremlinDatabaseAsync(String resourceGroupName, String accountName, String databaseName, GremlinDatabaseCreateUpdateParameters createUpdateGremlinDatabaseParameters) { + return beginCreateUpdateGremlinDatabaseWithServiceResponseAsync(resourceGroupName, accountName, databaseName, createUpdateGremlinDatabaseParameters).map(new Func1, GremlinDatabaseInner>() { + @Override + public GremlinDatabaseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update an Azure Cosmos DB Gremlin database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param createUpdateGremlinDatabaseParameters The parameters to provide for the current Gremlin database. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the GremlinDatabaseInner object + */ + public Observable> beginCreateUpdateGremlinDatabaseWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName, GremlinDatabaseCreateUpdateParameters createUpdateGremlinDatabaseParameters) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName 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 (createUpdateGremlinDatabaseParameters == null) { + throw new IllegalArgumentException("Parameter createUpdateGremlinDatabaseParameters is required and cannot be null."); + } + Validator.validate(createUpdateGremlinDatabaseParameters); + return service.beginCreateUpdateGremlinDatabase(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, this.client.apiVersion(), createUpdateGremlinDatabaseParameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateUpdateGremlinDatabaseDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateUpdateGremlinDatabaseDelegate(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 an existing Azure Cosmos DB Gremlin database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database 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 deleteGremlinDatabase(String resourceGroupName, String accountName, String databaseName) { + deleteGremlinDatabaseWithServiceResponseAsync(resourceGroupName, accountName, databaseName).toBlocking().last().body(); + } + + /** + * Deletes an existing Azure Cosmos DB Gremlin database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database 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 deleteGremlinDatabaseAsync(String resourceGroupName, String accountName, String databaseName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteGremlinDatabaseWithServiceResponseAsync(resourceGroupName, accountName, databaseName), serviceCallback); + } + + /** + * Deletes an existing Azure Cosmos DB Gremlin database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteGremlinDatabaseAsync(String resourceGroupName, String accountName, String databaseName) { + return deleteGremlinDatabaseWithServiceResponseAsync(resourceGroupName, accountName, databaseName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes an existing Azure Cosmos DB Gremlin database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteGremlinDatabaseWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName 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.deleteGremlinDatabase(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes an existing Azure Cosmos DB Gremlin database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database 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 beginDeleteGremlinDatabase(String resourceGroupName, String accountName, String databaseName) { + beginDeleteGremlinDatabaseWithServiceResponseAsync(resourceGroupName, accountName, databaseName).toBlocking().single().body(); + } + + /** + * Deletes an existing Azure Cosmos DB Gremlin database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database 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 beginDeleteGremlinDatabaseAsync(String resourceGroupName, String accountName, String databaseName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteGremlinDatabaseWithServiceResponseAsync(resourceGroupName, accountName, databaseName), serviceCallback); + } + + /** + * Deletes an existing Azure Cosmos DB Gremlin database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteGremlinDatabaseAsync(String resourceGroupName, String accountName, String databaseName) { + return beginDeleteGremlinDatabaseWithServiceResponseAsync(resourceGroupName, accountName, databaseName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes an existing Azure Cosmos DB Gremlin database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteGremlinDatabaseWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName 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.beginDeleteGremlinDatabase(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteGremlinDatabaseDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteGremlinDatabaseDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the RUs per second of the Gremlin database under an existing Azure Cosmos DB database account with the provided name. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database 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 ThroughputInner object if successful. + */ + public ThroughputInner getGremlinDatabaseThroughput(String resourceGroupName, String accountName, String databaseName) { + return getGremlinDatabaseThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName).toBlocking().single().body(); + } + + /** + * Gets the RUs per second of the Gremlin database under an existing Azure Cosmos DB database account with the provided name. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database 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 getGremlinDatabaseThroughputAsync(String resourceGroupName, String accountName, String databaseName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getGremlinDatabaseThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName), serviceCallback); + } + + /** + * Gets the RUs per second of the Gremlin database under an existing Azure Cosmos DB database account with the provided name. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ThroughputInner object + */ + public Observable getGremlinDatabaseThroughputAsync(String resourceGroupName, String accountName, String databaseName) { + return getGremlinDatabaseThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName).map(new Func1, ThroughputInner>() { + @Override + public ThroughputInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the RUs per second of the Gremlin database under an existing Azure Cosmos DB database account with the provided name. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ThroughputInner object + */ + public Observable> getGremlinDatabaseThroughputWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName 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.getGremlinDatabaseThroughput(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getGremlinDatabaseThroughputDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getGremlinDatabaseThroughputDelegate(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); + } + + /** + * Update RUs per second of an Azure Cosmos DB Gremlin database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param resource The standard JSON format of a resource throughput + * @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 ThroughputInner object if successful. + */ + public ThroughputInner updateGremlinDatabaseThroughput(String resourceGroupName, String accountName, String databaseName, ThroughputResource resource) { + return updateGremlinDatabaseThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName, resource).toBlocking().last().body(); + } + + /** + * Update RUs per second of an Azure Cosmos DB Gremlin database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param resource The standard JSON format of a resource throughput + * @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 updateGremlinDatabaseThroughputAsync(String resourceGroupName, String accountName, String databaseName, ThroughputResource resource, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateGremlinDatabaseThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName, resource), serviceCallback); + } + + /** + * Update RUs per second of an Azure Cosmos DB Gremlin database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param resource The standard JSON format of a resource throughput + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateGremlinDatabaseThroughputAsync(String resourceGroupName, String accountName, String databaseName, ThroughputResource resource) { + return updateGremlinDatabaseThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName, resource).map(new Func1, ThroughputInner>() { + @Override + public ThroughputInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update RUs per second of an Azure Cosmos DB Gremlin database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param resource The standard JSON format of a resource throughput + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateGremlinDatabaseThroughputWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName, ThroughputResource resource) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName 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 (resource == null) { + throw new IllegalArgumentException("Parameter resource is required and cannot be null."); + } + Validator.validate(resource); + ThroughputUpdateParameters updateThroughputParameters = new ThroughputUpdateParameters(); + updateThroughputParameters.withResource(resource); + Observable> observable = service.updateGremlinDatabaseThroughput(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, this.client.apiVersion(), this.client.acceptLanguage(), updateThroughputParameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Update RUs per second of an Azure Cosmos DB Gremlin database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param resource The standard JSON format of a resource throughput + * @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 ThroughputInner object if successful. + */ + public ThroughputInner beginUpdateGremlinDatabaseThroughput(String resourceGroupName, String accountName, String databaseName, ThroughputResource resource) { + return beginUpdateGremlinDatabaseThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName, resource).toBlocking().single().body(); + } + + /** + * Update RUs per second of an Azure Cosmos DB Gremlin database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param resource The standard JSON format of a resource throughput + * @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 beginUpdateGremlinDatabaseThroughputAsync(String resourceGroupName, String accountName, String databaseName, ThroughputResource resource, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateGremlinDatabaseThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName, resource), serviceCallback); + } + + /** + * Update RUs per second of an Azure Cosmos DB Gremlin database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param resource The standard JSON format of a resource throughput + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ThroughputInner object + */ + public Observable beginUpdateGremlinDatabaseThroughputAsync(String resourceGroupName, String accountName, String databaseName, ThroughputResource resource) { + return beginUpdateGremlinDatabaseThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName, resource).map(new Func1, ThroughputInner>() { + @Override + public ThroughputInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update RUs per second of an Azure Cosmos DB Gremlin database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param resource The standard JSON format of a resource throughput + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ThroughputInner object + */ + public Observable> beginUpdateGremlinDatabaseThroughputWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName, ThroughputResource resource) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName 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 (resource == null) { + throw new IllegalArgumentException("Parameter resource is required and cannot be null."); + } + Validator.validate(resource); + ThroughputUpdateParameters updateThroughputParameters = new ThroughputUpdateParameters(); + updateThroughputParameters.withResource(resource); + return service.beginUpdateGremlinDatabaseThroughput(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, this.client.apiVersion(), this.client.acceptLanguage(), updateThroughputParameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateGremlinDatabaseThroughputDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateGremlinDatabaseThroughputDelegate(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 the Gremlin graph under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database 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 List<GremlinGraphInner> object if successful. + */ + public List listGremlinGraphs(String resourceGroupName, String accountName, String databaseName) { + return listGremlinGraphsWithServiceResponseAsync(resourceGroupName, accountName, databaseName).toBlocking().single().body(); + } + + /** + * Lists the Gremlin graph under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database 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> listGremlinGraphsAsync(String resourceGroupName, String accountName, String databaseName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listGremlinGraphsWithServiceResponseAsync(resourceGroupName, accountName, databaseName), serviceCallback); + } + + /** + * Lists the Gremlin graph under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<GremlinGraphInner> object + */ + public Observable> listGremlinGraphsAsync(String resourceGroupName, String accountName, String databaseName) { + return listGremlinGraphsWithServiceResponseAsync(resourceGroupName, accountName, databaseName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the Gremlin graph under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<GremlinGraphInner> object + */ + public Observable>> listGremlinGraphsWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName 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.listGremlinGraphs(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listGremlinGraphsDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listGremlinGraphsDelegate(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 Gremlin graph under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param graphName Cosmos DB graph 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 GremlinGraphInner object if successful. + */ + public GremlinGraphInner getGremlinGraph(String resourceGroupName, String accountName, String databaseName, String graphName) { + return getGremlinGraphWithServiceResponseAsync(resourceGroupName, accountName, databaseName, graphName).toBlocking().single().body(); + } + + /** + * Gets the Gremlin graph under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param graphName Cosmos DB graph 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 getGremlinGraphAsync(String resourceGroupName, String accountName, String databaseName, String graphName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getGremlinGraphWithServiceResponseAsync(resourceGroupName, accountName, databaseName, graphName), serviceCallback); + } + + /** + * Gets the Gremlin graph under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param graphName Cosmos DB graph name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the GremlinGraphInner object + */ + public Observable getGremlinGraphAsync(String resourceGroupName, String accountName, String databaseName, String graphName) { + return getGremlinGraphWithServiceResponseAsync(resourceGroupName, accountName, databaseName, graphName).map(new Func1, GremlinGraphInner>() { + @Override + public GremlinGraphInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the Gremlin graph under an existing Azure Cosmos DB database account. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param graphName Cosmos DB graph name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the GremlinGraphInner object + */ + public Observable> getGremlinGraphWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName, String graphName) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (graphName == null) { + throw new IllegalArgumentException("Parameter graphName 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.getGremlinGraph(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, graphName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getGremlinGraphDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getGremlinGraphDelegate(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 an Azure Cosmos DB Gremlin graph. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param graphName Cosmos DB graph name. + * @param createUpdateGremlinGraphParameters The parameters to provide for the current Gremlin graph. + * @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 GremlinGraphInner object if successful. + */ + public GremlinGraphInner createUpdateGremlinGraph(String resourceGroupName, String accountName, String databaseName, String graphName, GremlinGraphCreateUpdateParameters createUpdateGremlinGraphParameters) { + return createUpdateGremlinGraphWithServiceResponseAsync(resourceGroupName, accountName, databaseName, graphName, createUpdateGremlinGraphParameters).toBlocking().last().body(); + } + + /** + * Create or update an Azure Cosmos DB Gremlin graph. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param graphName Cosmos DB graph name. + * @param createUpdateGremlinGraphParameters The parameters to provide for the current Gremlin graph. + * @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 createUpdateGremlinGraphAsync(String resourceGroupName, String accountName, String databaseName, String graphName, GremlinGraphCreateUpdateParameters createUpdateGremlinGraphParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createUpdateGremlinGraphWithServiceResponseAsync(resourceGroupName, accountName, databaseName, graphName, createUpdateGremlinGraphParameters), serviceCallback); + } + + /** + * Create or update an Azure Cosmos DB Gremlin graph. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param graphName Cosmos DB graph name. + * @param createUpdateGremlinGraphParameters The parameters to provide for the current Gremlin graph. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createUpdateGremlinGraphAsync(String resourceGroupName, String accountName, String databaseName, String graphName, GremlinGraphCreateUpdateParameters createUpdateGremlinGraphParameters) { + return createUpdateGremlinGraphWithServiceResponseAsync(resourceGroupName, accountName, databaseName, graphName, createUpdateGremlinGraphParameters).map(new Func1, GremlinGraphInner>() { + @Override + public GremlinGraphInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update an Azure Cosmos DB Gremlin graph. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param graphName Cosmos DB graph name. + * @param createUpdateGremlinGraphParameters The parameters to provide for the current Gremlin graph. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createUpdateGremlinGraphWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName, String graphName, GremlinGraphCreateUpdateParameters createUpdateGremlinGraphParameters) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (graphName == null) { + throw new IllegalArgumentException("Parameter graphName 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 (createUpdateGremlinGraphParameters == null) { + throw new IllegalArgumentException("Parameter createUpdateGremlinGraphParameters is required and cannot be null."); + } + Validator.validate(createUpdateGremlinGraphParameters); + Observable> observable = service.createUpdateGremlinGraph(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, graphName, this.client.apiVersion(), createUpdateGremlinGraphParameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Create or update an Azure Cosmos DB Gremlin graph. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param graphName Cosmos DB graph name. + * @param createUpdateGremlinGraphParameters The parameters to provide for the current Gremlin graph. + * @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 GremlinGraphInner object if successful. + */ + public GremlinGraphInner beginCreateUpdateGremlinGraph(String resourceGroupName, String accountName, String databaseName, String graphName, GremlinGraphCreateUpdateParameters createUpdateGremlinGraphParameters) { + return beginCreateUpdateGremlinGraphWithServiceResponseAsync(resourceGroupName, accountName, databaseName, graphName, createUpdateGremlinGraphParameters).toBlocking().single().body(); + } + + /** + * Create or update an Azure Cosmos DB Gremlin graph. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param graphName Cosmos DB graph name. + * @param createUpdateGremlinGraphParameters The parameters to provide for the current Gremlin graph. + * @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 beginCreateUpdateGremlinGraphAsync(String resourceGroupName, String accountName, String databaseName, String graphName, GremlinGraphCreateUpdateParameters createUpdateGremlinGraphParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateUpdateGremlinGraphWithServiceResponseAsync(resourceGroupName, accountName, databaseName, graphName, createUpdateGremlinGraphParameters), serviceCallback); + } + + /** + * Create or update an Azure Cosmos DB Gremlin graph. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param graphName Cosmos DB graph name. + * @param createUpdateGremlinGraphParameters The parameters to provide for the current Gremlin graph. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the GremlinGraphInner object + */ + public Observable beginCreateUpdateGremlinGraphAsync(String resourceGroupName, String accountName, String databaseName, String graphName, GremlinGraphCreateUpdateParameters createUpdateGremlinGraphParameters) { + return beginCreateUpdateGremlinGraphWithServiceResponseAsync(resourceGroupName, accountName, databaseName, graphName, createUpdateGremlinGraphParameters).map(new Func1, GremlinGraphInner>() { + @Override + public GremlinGraphInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update an Azure Cosmos DB Gremlin graph. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param graphName Cosmos DB graph name. + * @param createUpdateGremlinGraphParameters The parameters to provide for the current Gremlin graph. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the GremlinGraphInner object + */ + public Observable> beginCreateUpdateGremlinGraphWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName, String graphName, GremlinGraphCreateUpdateParameters createUpdateGremlinGraphParameters) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (graphName == null) { + throw new IllegalArgumentException("Parameter graphName 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 (createUpdateGremlinGraphParameters == null) { + throw new IllegalArgumentException("Parameter createUpdateGremlinGraphParameters is required and cannot be null."); + } + Validator.validate(createUpdateGremlinGraphParameters); + return service.beginCreateUpdateGremlinGraph(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, graphName, this.client.apiVersion(), createUpdateGremlinGraphParameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateUpdateGremlinGraphDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateUpdateGremlinGraphDelegate(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 an existing Azure Cosmos DB Gremlin graph. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param graphName Cosmos DB graph 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 deleteGremlinGraph(String resourceGroupName, String accountName, String databaseName, String graphName) { + deleteGremlinGraphWithServiceResponseAsync(resourceGroupName, accountName, databaseName, graphName).toBlocking().last().body(); + } + + /** + * Deletes an existing Azure Cosmos DB Gremlin graph. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param graphName Cosmos DB graph 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 deleteGremlinGraphAsync(String resourceGroupName, String accountName, String databaseName, String graphName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteGremlinGraphWithServiceResponseAsync(resourceGroupName, accountName, databaseName, graphName), serviceCallback); + } + + /** + * Deletes an existing Azure Cosmos DB Gremlin graph. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param graphName Cosmos DB graph name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteGremlinGraphAsync(String resourceGroupName, String accountName, String databaseName, String graphName) { + return deleteGremlinGraphWithServiceResponseAsync(resourceGroupName, accountName, databaseName, graphName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes an existing Azure Cosmos DB Gremlin graph. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param graphName Cosmos DB graph name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteGremlinGraphWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName, String graphName) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (graphName == null) { + throw new IllegalArgumentException("Parameter graphName 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.deleteGremlinGraph(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, graphName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes an existing Azure Cosmos DB Gremlin graph. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param graphName Cosmos DB graph 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 beginDeleteGremlinGraph(String resourceGroupName, String accountName, String databaseName, String graphName) { + beginDeleteGremlinGraphWithServiceResponseAsync(resourceGroupName, accountName, databaseName, graphName).toBlocking().single().body(); + } + + /** + * Deletes an existing Azure Cosmos DB Gremlin graph. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param graphName Cosmos DB graph 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 beginDeleteGremlinGraphAsync(String resourceGroupName, String accountName, String databaseName, String graphName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteGremlinGraphWithServiceResponseAsync(resourceGroupName, accountName, databaseName, graphName), serviceCallback); + } + + /** + * Deletes an existing Azure Cosmos DB Gremlin graph. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param graphName Cosmos DB graph name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteGremlinGraphAsync(String resourceGroupName, String accountName, String databaseName, String graphName) { + return beginDeleteGremlinGraphWithServiceResponseAsync(resourceGroupName, accountName, databaseName, graphName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes an existing Azure Cosmos DB Gremlin graph. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param graphName Cosmos DB graph name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteGremlinGraphWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName, String graphName) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (graphName == null) { + throw new IllegalArgumentException("Parameter graphName 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.beginDeleteGremlinGraph(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, graphName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteGremlinGraphDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteGremlinGraphDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the Gremlin graph throughput under an existing Azure Cosmos DB database account with the provided name. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param graphName Cosmos DB graph 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 ThroughputInner object if successful. + */ + public ThroughputInner getGremlinGraphThroughput(String resourceGroupName, String accountName, String databaseName, String graphName) { + return getGremlinGraphThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName, graphName).toBlocking().single().body(); + } + + /** + * Gets the Gremlin graph throughput under an existing Azure Cosmos DB database account with the provided name. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param graphName Cosmos DB graph 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 getGremlinGraphThroughputAsync(String resourceGroupName, String accountName, String databaseName, String graphName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getGremlinGraphThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName, graphName), serviceCallback); + } + + /** + * Gets the Gremlin graph throughput under an existing Azure Cosmos DB database account with the provided name. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param graphName Cosmos DB graph name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ThroughputInner object + */ + public Observable getGremlinGraphThroughputAsync(String resourceGroupName, String accountName, String databaseName, String graphName) { + return getGremlinGraphThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName, graphName).map(new Func1, ThroughputInner>() { + @Override + public ThroughputInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the Gremlin graph throughput under an existing Azure Cosmos DB database account with the provided name. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param graphName Cosmos DB graph name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ThroughputInner object + */ + public Observable> getGremlinGraphThroughputWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName, String graphName) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (graphName == null) { + throw new IllegalArgumentException("Parameter graphName 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.getGremlinGraphThroughput(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, graphName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getGremlinGraphThroughputDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getGremlinGraphThroughputDelegate(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); + } + + /** + * Update RUs per second of an Azure Cosmos DB Gremlin graph. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param graphName Cosmos DB graph name. + * @param resource The standard JSON format of a resource throughput + * @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 ThroughputInner object if successful. + */ + public ThroughputInner updateGremlinGraphThroughput(String resourceGroupName, String accountName, String databaseName, String graphName, ThroughputResource resource) { + return updateGremlinGraphThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName, graphName, resource).toBlocking().last().body(); + } + + /** + * Update RUs per second of an Azure Cosmos DB Gremlin graph. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param graphName Cosmos DB graph name. + * @param resource The standard JSON format of a resource throughput + * @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 updateGremlinGraphThroughputAsync(String resourceGroupName, String accountName, String databaseName, String graphName, ThroughputResource resource, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateGremlinGraphThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName, graphName, resource), serviceCallback); + } + + /** + * Update RUs per second of an Azure Cosmos DB Gremlin graph. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param graphName Cosmos DB graph name. + * @param resource The standard JSON format of a resource throughput + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateGremlinGraphThroughputAsync(String resourceGroupName, String accountName, String databaseName, String graphName, ThroughputResource resource) { + return updateGremlinGraphThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName, graphName, resource).map(new Func1, ThroughputInner>() { + @Override + public ThroughputInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update RUs per second of an Azure Cosmos DB Gremlin graph. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param graphName Cosmos DB graph name. + * @param resource The standard JSON format of a resource throughput + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateGremlinGraphThroughputWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName, String graphName, ThroughputResource resource) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (graphName == null) { + throw new IllegalArgumentException("Parameter graphName 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 (resource == null) { + throw new IllegalArgumentException("Parameter resource is required and cannot be null."); + } + Validator.validate(resource); + ThroughputUpdateParameters updateThroughputParameters = new ThroughputUpdateParameters(); + updateThroughputParameters.withResource(resource); + Observable> observable = service.updateGremlinGraphThroughput(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, graphName, this.client.apiVersion(), this.client.acceptLanguage(), updateThroughputParameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Update RUs per second of an Azure Cosmos DB Gremlin graph. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param graphName Cosmos DB graph name. + * @param resource The standard JSON format of a resource throughput + * @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 ThroughputInner object if successful. + */ + public ThroughputInner beginUpdateGremlinGraphThroughput(String resourceGroupName, String accountName, String databaseName, String graphName, ThroughputResource resource) { + return beginUpdateGremlinGraphThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName, graphName, resource).toBlocking().single().body(); + } + + /** + * Update RUs per second of an Azure Cosmos DB Gremlin graph. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param graphName Cosmos DB graph name. + * @param resource The standard JSON format of a resource throughput + * @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 beginUpdateGremlinGraphThroughputAsync(String resourceGroupName, String accountName, String databaseName, String graphName, ThroughputResource resource, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateGremlinGraphThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName, graphName, resource), serviceCallback); + } + + /** + * Update RUs per second of an Azure Cosmos DB Gremlin graph. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param graphName Cosmos DB graph name. + * @param resource The standard JSON format of a resource throughput + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ThroughputInner object + */ + public Observable beginUpdateGremlinGraphThroughputAsync(String resourceGroupName, String accountName, String databaseName, String graphName, ThroughputResource resource) { + return beginUpdateGremlinGraphThroughputWithServiceResponseAsync(resourceGroupName, accountName, databaseName, graphName, resource).map(new Func1, ThroughputInner>() { + @Override + public ThroughputInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update RUs per second of an Azure Cosmos DB Gremlin graph. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param graphName Cosmos DB graph name. + * @param resource The standard JSON format of a resource throughput + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ThroughputInner object + */ + public Observable> beginUpdateGremlinGraphThroughputWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseName, String graphName, ThroughputResource resource) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (databaseName == null) { + throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); + } + if (graphName == null) { + throw new IllegalArgumentException("Parameter graphName 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 (resource == null) { + throw new IllegalArgumentException("Parameter resource is required and cannot be null."); + } + Validator.validate(resource); + ThroughputUpdateParameters updateThroughputParameters = new ThroughputUpdateParameters(); + updateThroughputParameters.withResource(resource); + return service.beginUpdateGremlinGraphThroughput(this.client.subscriptionId(), resourceGroupName, accountName, databaseName, graphName, this.client.apiVersion(), this.client.acceptLanguage(), updateThroughputParameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateGremlinGraphThroughputDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateGremlinGraphThroughputDelegate(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); + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabasesImpl.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabasesImpl.java new file mode 100644 index 000000000000..86ccc275852a --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabasesImpl.java @@ -0,0 +1,99 @@ +/** + * Copyright (c) Microsoft Corporation. All rights 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.cosmosdb.v2015_04_08.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.Databases; +import rx.Observable; +import rx.functions.Func1; +import java.util.List; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.DatabasisDatabaseAccountMetricDefinition; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.DatabasisDatabaseAccountMetric; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.DatabasisDatabaseAccountUsage; + +class DatabasesImpl extends WrapperImpl implements Databases { + private final CosmosDBManager manager; + + DatabasesImpl(CosmosDBManager manager) { + super(manager.inner().databases()); + this.manager = manager; + } + + public CosmosDBManager manager() { + return this.manager; + } + + private DatabasisDatabaseAccountMetricDefinitionImpl wrapDatabasisDatabaseAccountMetricDefinitionModel(MetricDefinitionInner inner) { + return new DatabasisDatabaseAccountMetricDefinitionImpl(inner, manager()); + } + + private DatabasisDatabaseAccountMetricImpl wrapDatabasisDatabaseAccountMetricModel(MetricInner inner) { + return new DatabasisDatabaseAccountMetricImpl(inner, manager()); + } + + private DatabasisDatabaseAccountUsageImpl wrapDatabasisDatabaseAccountUsageModel(UsageInner inner) { + return new DatabasisDatabaseAccountUsageImpl(inner, manager()); + } + + @Override + public Observable listMetricDefinitionsAsync(String resourceGroupName, String accountName, String databaseRid) { + DatabasesInner client = this.inner(); + return client.listMetricDefinitionsAsync(resourceGroupName, accountName, databaseRid) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public DatabasisDatabaseAccountMetricDefinition call(MetricDefinitionInner inner) { + return wrapDatabasisDatabaseAccountMetricDefinitionModel(inner); + } + }); + } + + @Override + public Observable listMetricsAsync(String resourceGroupName, String accountName, String databaseRid, String filter) { + DatabasesInner client = this.inner(); + return client.listMetricsAsync(resourceGroupName, accountName, databaseRid, filter) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public DatabasisDatabaseAccountMetric call(MetricInner inner) { + return wrapDatabasisDatabaseAccountMetricModel(inner); + } + }); + } + + @Override + public Observable listUsagesAsync(String resourceGroupName, String accountName, String databaseRid) { + DatabasesInner client = this.inner(); + return client.listUsagesAsync(resourceGroupName, accountName, databaseRid) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public DatabasisDatabaseAccountUsage call(UsageInner inner) { + return wrapDatabasisDatabaseAccountUsageModel(inner); + } + }); + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabasesInner.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabasesInner.java new file mode 100644 index 000000000000..22b156491d14 --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabasesInner.java @@ -0,0 +1,466 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.cosmosdb.v2015_04_08.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 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.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Databases. + */ +public class DatabasesInner { + /** The Retrofit service to perform REST calls. */ + private DatabasesService service; + /** The service client containing this operation class. */ + private CosmosDBManagementClientImpl client; + + /** + * Initializes an instance of DatabasesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public DatabasesInner(Retrofit retrofit, CosmosDBManagementClientImpl client) { + this.service = retrofit.create(DatabasesService.class); + this.client = client; + } + + /** + * The interface defining all the services for Databases to be + * used by Retrofit to perform actually REST calls. + */ + interface DatabasesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cosmosdb.v2015_04_08.Databases listMetrics" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/metrics") + Observable> listMetrics(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("databaseRid") String databaseRid, @Query("api-version") String apiVersion, @Query("$filter") String filter, @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.cosmosdb.v2015_04_08.Databases listUsages" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/usages") + Observable> listUsages(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("databaseRid") String databaseRid, @Query("api-version") String apiVersion, @Query("$filter") String filter, @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.cosmosdb.v2015_04_08.Databases listMetricDefinitions" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/metricDefinitions") + Observable> listMetricDefinitions(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("databaseRid") String databaseRid, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Retrieves the metrics determined by the given filter for the given database account and database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseRid Cosmos DB database rid. + * @param filter An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq. + * @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 List<MetricInner> object if successful. + */ + public List listMetrics(String resourceGroupName, String accountName, String databaseRid, String filter) { + return listMetricsWithServiceResponseAsync(resourceGroupName, accountName, databaseRid, filter).toBlocking().single().body(); + } + + /** + * Retrieves the metrics determined by the given filter for the given database account and database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseRid Cosmos DB database rid. + * @param filter An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq. + * @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> listMetricsAsync(String resourceGroupName, String accountName, String databaseRid, String filter, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listMetricsWithServiceResponseAsync(resourceGroupName, accountName, databaseRid, filter), serviceCallback); + } + + /** + * Retrieves the metrics determined by the given filter for the given database account and database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseRid Cosmos DB database rid. + * @param filter An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<MetricInner> object + */ + public Observable> listMetricsAsync(String resourceGroupName, String accountName, String databaseRid, String filter) { + return listMetricsWithServiceResponseAsync(resourceGroupName, accountName, databaseRid, filter).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Retrieves the metrics determined by the given filter for the given database account and database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseRid Cosmos DB database rid. + * @param filter An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<MetricInner> object + */ + public Observable>> listMetricsWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseRid, String filter) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (databaseRid == null) { + throw new IllegalArgumentException("Parameter databaseRid 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 (filter == null) { + throw new IllegalArgumentException("Parameter filter is required and cannot be null."); + } + return service.listMetrics(this.client.subscriptionId(), resourceGroupName, accountName, databaseRid, this.client.apiVersion(), filter, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listMetricsDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listMetricsDelegate(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 the usages (most recent data) for the given database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseRid Cosmos DB database rid. + * @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 List<UsageInner> object if successful. + */ + public List listUsages(String resourceGroupName, String accountName, String databaseRid) { + return listUsagesWithServiceResponseAsync(resourceGroupName, accountName, databaseRid).toBlocking().single().body(); + } + + /** + * Retrieves the usages (most recent data) for the given database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseRid Cosmos DB database rid. + * @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> listUsagesAsync(String resourceGroupName, String accountName, String databaseRid, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listUsagesWithServiceResponseAsync(resourceGroupName, accountName, databaseRid), serviceCallback); + } + + /** + * Retrieves the usages (most recent data) for the given database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseRid Cosmos DB database rid. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<UsageInner> object + */ + public Observable> listUsagesAsync(String resourceGroupName, String accountName, String databaseRid) { + return listUsagesWithServiceResponseAsync(resourceGroupName, accountName, databaseRid).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Retrieves the usages (most recent data) for the given database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseRid Cosmos DB database rid. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<UsageInner> object + */ + public Observable>> listUsagesWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseRid) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (databaseRid == null) { + throw new IllegalArgumentException("Parameter databaseRid 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 filter = null; + return service.listUsages(this.client.subscriptionId(), resourceGroupName, accountName, databaseRid, this.client.apiVersion(), filter, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listUsagesDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Retrieves the usages (most recent data) for the given database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseRid Cosmos DB database rid. + * @param filter An OData filter expression that describes a subset of usages to return. The supported parameter is name.value (name of the metric, can have an or of multiple names). + * @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 List<UsageInner> object if successful. + */ + public List listUsages(String resourceGroupName, String accountName, String databaseRid, String filter) { + return listUsagesWithServiceResponseAsync(resourceGroupName, accountName, databaseRid, filter).toBlocking().single().body(); + } + + /** + * Retrieves the usages (most recent data) for the given database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseRid Cosmos DB database rid. + * @param filter An OData filter expression that describes a subset of usages to return. The supported parameter is name.value (name of the metric, can have an or of multiple names). + * @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> listUsagesAsync(String resourceGroupName, String accountName, String databaseRid, String filter, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listUsagesWithServiceResponseAsync(resourceGroupName, accountName, databaseRid, filter), serviceCallback); + } + + /** + * Retrieves the usages (most recent data) for the given database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseRid Cosmos DB database rid. + * @param filter An OData filter expression that describes a subset of usages to return. The supported parameter is name.value (name of the metric, can have an or of multiple names). + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<UsageInner> object + */ + public Observable> listUsagesAsync(String resourceGroupName, String accountName, String databaseRid, String filter) { + return listUsagesWithServiceResponseAsync(resourceGroupName, accountName, databaseRid, filter).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Retrieves the usages (most recent data) for the given database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseRid Cosmos DB database rid. + * @param filter An OData filter expression that describes a subset of usages to return. The supported parameter is name.value (name of the metric, can have an or of multiple names). + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<UsageInner> object + */ + public Observable>> listUsagesWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseRid, String filter) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (databaseRid == null) { + throw new IllegalArgumentException("Parameter databaseRid 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.listUsages(this.client.subscriptionId(), resourceGroupName, accountName, databaseRid, this.client.apiVersion(), filter, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listUsagesDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listUsagesDelegate(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 metric definitions for the given database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseRid Cosmos DB database rid. + * @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 List<MetricDefinitionInner> object if successful. + */ + public List listMetricDefinitions(String resourceGroupName, String accountName, String databaseRid) { + return listMetricDefinitionsWithServiceResponseAsync(resourceGroupName, accountName, databaseRid).toBlocking().single().body(); + } + + /** + * Retrieves metric definitions for the given database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseRid Cosmos DB database rid. + * @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> listMetricDefinitionsAsync(String resourceGroupName, String accountName, String databaseRid, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listMetricDefinitionsWithServiceResponseAsync(resourceGroupName, accountName, databaseRid), serviceCallback); + } + + /** + * Retrieves metric definitions for the given database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseRid Cosmos DB database rid. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<MetricDefinitionInner> object + */ + public Observable> listMetricDefinitionsAsync(String resourceGroupName, String accountName, String databaseRid) { + return listMetricDefinitionsWithServiceResponseAsync(resourceGroupName, accountName, databaseRid).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Retrieves metric definitions for the given database. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseRid Cosmos DB database rid. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<MetricDefinitionInner> object + */ + public Observable>> listMetricDefinitionsWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseRid) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (databaseRid == null) { + throw new IllegalArgumentException("Parameter databaseRid 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.listMetricDefinitions(this.client.subscriptionId(), resourceGroupName, accountName, databaseRid, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listMetricDefinitionsDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listMetricDefinitionsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabasisDatabaseAccountMetricDefinitionImpl.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabasisDatabaseAccountMetricDefinitionImpl.java new file mode 100644 index 000000000000..05e098cd68e5 --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabasisDatabaseAccountMetricDefinitionImpl.java @@ -0,0 +1,60 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation; + +import com.microsoft.azure.management.cosmosdb.v2015_04_08.DatabasisDatabaseAccountMetricDefinition; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.MetricAvailability; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.MetricName; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.PrimaryAggregationType; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.UnitType; + +class DatabasisDatabaseAccountMetricDefinitionImpl extends WrapperImpl implements DatabasisDatabaseAccountMetricDefinition { + private final CosmosDBManager manager; + + DatabasisDatabaseAccountMetricDefinitionImpl(MetricDefinitionInner inner, CosmosDBManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public CosmosDBManager manager() { + return this.manager; + } + + + + @Override + public List metricAvailabilities() { + return this.inner().metricAvailabilities(); + } + + @Override + public MetricName name() { + return this.inner().name(); + } + + @Override + public PrimaryAggregationType primaryAggregationType() { + return this.inner().primaryAggregationType(); + } + + @Override + public String resourceUri() { + return this.inner().resourceUri(); + } + + @Override + public UnitType unit() { + return this.inner().unit(); + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabasisDatabaseAccountMetricImpl.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabasisDatabaseAccountMetricImpl.java new file mode 100644 index 000000000000..a2f6f4182cd0 --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabasisDatabaseAccountMetricImpl.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.cosmosdb.v2015_04_08.implementation; + +import com.microsoft.azure.management.cosmosdb.v2015_04_08.DatabasisDatabaseAccountMetric; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; +import org.joda.time.DateTime; +import java.util.List; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.MetricValue; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.MetricName; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.UnitType; + +class DatabasisDatabaseAccountMetricImpl extends WrapperImpl implements DatabasisDatabaseAccountMetric { + private final CosmosDBManager manager; + + DatabasisDatabaseAccountMetricImpl(MetricInner inner, CosmosDBManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public CosmosDBManager manager() { + return this.manager; + } + + + + @Override + public DateTime endTime() { + return this.inner().endTime(); + } + + @Override + public List metricValues() { + return this.inner().metricValues(); + } + + @Override + public MetricName name() { + return this.inner().name(); + } + + @Override + public DateTime startTime() { + return this.inner().startTime(); + } + + @Override + public String timeGrain() { + return this.inner().timeGrain(); + } + + @Override + public UnitType unit() { + return this.inner().unit(); + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabasisDatabaseAccountUsageImpl.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabasisDatabaseAccountUsageImpl.java new file mode 100644 index 000000000000..a69ecb686986 --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabasisDatabaseAccountUsageImpl.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.cosmosdb.v2015_04_08.implementation; + +import com.microsoft.azure.management.cosmosdb.v2015_04_08.DatabasisDatabaseAccountUsage; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.MetricName; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.UnitType; + +class DatabasisDatabaseAccountUsageImpl extends WrapperImpl implements DatabasisDatabaseAccountUsage { + private final CosmosDBManager manager; + + DatabasisDatabaseAccountUsageImpl(UsageInner inner, CosmosDBManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public CosmosDBManager manager() { + return this.manager; + } + + + + @Override + public Long currentValue() { + return this.inner().currentValue(); + } + + @Override + public Long limit() { + return this.inner().limit(); + } + + @Override + public MetricName name() { + return this.inner().name(); + } + + @Override + public String quotaPeriod() { + return this.inner().quotaPeriod(); + } + + @Override + public UnitType unit() { + return this.inner().unit(); + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/GremlinDatabaseImpl.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/GremlinDatabaseImpl.java new file mode 100644 index 000000000000..94e71b5facea --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/GremlinDatabaseImpl.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.cosmosdb.v2015_04_08.implementation; + +import com.microsoft.azure.management.cosmosdb.v2015_04_08.GremlinDatabase; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.Map; + +class GremlinDatabaseImpl extends WrapperImpl implements GremlinDatabase { + private final CosmosDBManager manager; + GremlinDatabaseImpl(GremlinDatabaseInner inner, CosmosDBManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public CosmosDBManager manager() { + return this.manager; + } + + @Override + public String _etag() { + return this.inner()._etag(); + } + + @Override + public String _rid() { + return this.inner()._rid(); + } + + @Override + public Object _ts() { + return this.inner()._ts(); + } + + @Override + public String gremlinDatabaseId() { + return this.inner().gremlinDatabaseId(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/GremlinDatabaseInner.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/GremlinDatabaseInner.java new file mode 100644 index 000000000000..4aafcf600525 --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/GremlinDatabaseInner.java @@ -0,0 +1,128 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * An Azure Cosmos DB Gremlin database. + */ +@JsonFlatten +@SkipParentValidation +public class GremlinDatabaseInner extends Resource { + /** + * Name of the Cosmos DB Gremlin database. + */ + @JsonProperty(value = "properties.id", required = true) + private String gremlinDatabaseId; + + /** + * A system generated property. A unique identifier. + */ + @JsonProperty(value = "properties._rid") + private String _rid; + + /** + * A system generated property that denotes the last updated timestamp of + * the resource. + */ + @JsonProperty(value = "properties._ts") + private Object _ts; + + /** + * A system generated property representing the resource etag required for + * optimistic concurrency control. + */ + @JsonProperty(value = "properties._etag") + private String _etag; + + /** + * Get name of the Cosmos DB Gremlin database. + * + * @return the gremlinDatabaseId value + */ + public String gremlinDatabaseId() { + return this.gremlinDatabaseId; + } + + /** + * Set name of the Cosmos DB Gremlin database. + * + * @param gremlinDatabaseId the gremlinDatabaseId value to set + * @return the GremlinDatabaseInner object itself. + */ + public GremlinDatabaseInner withGremlinDatabaseId(String gremlinDatabaseId) { + this.gremlinDatabaseId = gremlinDatabaseId; + return this; + } + + /** + * Get a system generated property. A unique identifier. + * + * @return the _rid value + */ + public String _rid() { + return this._rid; + } + + /** + * Set a system generated property. A unique identifier. + * + * @param _rid the _rid value to set + * @return the GremlinDatabaseInner object itself. + */ + public GremlinDatabaseInner with_rid(String _rid) { + this._rid = _rid; + return this; + } + + /** + * Get a system generated property that denotes the last updated timestamp of the resource. + * + * @return the _ts value + */ + public Object _ts() { + return this._ts; + } + + /** + * Set a system generated property that denotes the last updated timestamp of the resource. + * + * @param _ts the _ts value to set + * @return the GremlinDatabaseInner object itself. + */ + public GremlinDatabaseInner with_ts(Object _ts) { + this._ts = _ts; + return this; + } + + /** + * Get a system generated property representing the resource etag required for optimistic concurrency control. + * + * @return the _etag value + */ + public String _etag() { + return this._etag; + } + + /** + * Set a system generated property representing the resource etag required for optimistic concurrency control. + * + * @param _etag the _etag value to set + * @return the GremlinDatabaseInner object itself. + */ + public GremlinDatabaseInner with_etag(String _etag) { + this._etag = _etag; + return this; + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/GremlinGraphImpl.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/GremlinGraphImpl.java new file mode 100644 index 000000000000..f0868d22076b --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/GremlinGraphImpl.java @@ -0,0 +1,192 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation; + +import com.microsoft.azure.management.cosmosdb.v2015_04_08.GremlinGraph; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.GremlinGraphCreateUpdateParameters; +import java.util.Map; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.ConflictResolutionPolicy; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.IndexingPolicy; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.ContainerPartitionKey; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.UniqueKeyPolicy; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.GremlinGraphResource; +import rx.functions.Func1; + +class GremlinGraphImpl extends CreatableUpdatableImpl implements GremlinGraph, GremlinGraph.Definition, GremlinGraph.Update { + private final CosmosDBManager manager; + private String resourceGroupName; + private String accountName; + private String databaseName; + private String graphName; + private GremlinGraphCreateUpdateParameters createOrUpdateParameter; + + GremlinGraphImpl(String name, CosmosDBManager manager) { + super(name, new GremlinGraphInner()); + this.manager = manager; + // Set resource name + this.graphName = name; + // + this.createOrUpdateParameter = new GremlinGraphCreateUpdateParameters(); + } + + GremlinGraphImpl(GremlinGraphInner inner, CosmosDBManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.graphName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.accountName = IdParsingUtils.getValueFromIdByName(inner.id(), "databaseAccounts"); + this.databaseName = IdParsingUtils.getValueFromIdByName(inner.id(), "databases"); + this.graphName = IdParsingUtils.getValueFromIdByName(inner.id(), "graphs"); + // + this.createOrUpdateParameter = new GremlinGraphCreateUpdateParameters(); + } + + @Override + public CosmosDBManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + DatabaseAccountsInner client = this.manager().inner().databaseAccounts(); + return client.createUpdateGremlinGraphAsync(this.resourceGroupName, this.accountName, this.databaseName, this.graphName, this.createOrUpdateParameter) + .map(new Func1() { + @Override + public GremlinGraphInner call(GremlinGraphInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + DatabaseAccountsInner client = this.manager().inner().databaseAccounts(); + return client.createUpdateGremlinGraphAsync(this.resourceGroupName, this.accountName, this.databaseName, this.graphName, this.createOrUpdateParameter) + .map(new Func1() { + @Override + public GremlinGraphInner call(GremlinGraphInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + DatabaseAccountsInner client = this.manager().inner().databaseAccounts(); + return client.getGremlinGraphAsync(this.resourceGroupName, this.accountName, this.databaseName, this.graphName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.createOrUpdateParameter = new GremlinGraphCreateUpdateParameters(); + } + + @Override + public String _etag() { + return this.inner()._etag(); + } + + @Override + public String _rid() { + return this.inner()._rid(); + } + + @Override + public Object _ts() { + return this.inner()._ts(); + } + + @Override + public ConflictResolutionPolicy conflictResolutionPolicy() { + return this.inner().conflictResolutionPolicy(); + } + + @Override + public Integer defaultTtl() { + return this.inner().defaultTtl(); + } + + @Override + public String gremlinGraphId() { + return this.inner().gremlinGraphId(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public IndexingPolicy indexingPolicy() { + return this.inner().indexingPolicy(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public ContainerPartitionKey partitionKey() { + return this.inner().partitionKey(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public UniqueKeyPolicy uniqueKeyPolicy() { + return this.inner().uniqueKeyPolicy(); + } + + @Override + public GremlinGraphImpl withExistingDatabasis(String resourceGroupName, String accountName, String databaseName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + this.databaseName = databaseName; + return this; + } + + @Override + public GremlinGraphImpl withOptions(Map options) { + this.createOrUpdateParameter.withOptions(options); + return this; + } + + @Override + public GremlinGraphImpl withResource(GremlinGraphResource resource) { + this.createOrUpdateParameter.withResource(resource); + return this; + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/GremlinGraphInner.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/GremlinGraphInner.java new file mode 100644 index 000000000000..c237c1b3b1ce --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/GremlinGraphInner.java @@ -0,0 +1,266 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation; + +import com.microsoft.azure.management.cosmosdb.v2015_04_08.IndexingPolicy; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.ContainerPartitionKey; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.UniqueKeyPolicy; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.ConflictResolutionPolicy; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * An Azure Cosmos DB Gremlin graph. + */ +@JsonFlatten +@SkipParentValidation +public class GremlinGraphInner extends Resource { + /** + * Name of the Cosmos DB Gremlin graph. + */ + @JsonProperty(value = "properties.id", required = true) + private String gremlinGraphId; + + /** + * The configuration of the indexing policy. By default, the indexing is + * automatic for all document paths within the graph. + */ + @JsonProperty(value = "properties.indexingPolicy") + private IndexingPolicy indexingPolicy; + + /** + * The configuration of the partition key to be used for partitioning data + * into multiple partitions. + */ + @JsonProperty(value = "properties.partitionKey") + private ContainerPartitionKey partitionKey; + + /** + * Default time to live. + */ + @JsonProperty(value = "properties.defaultTtl") + private Integer defaultTtl; + + /** + * The unique key policy configuration for specifying uniqueness + * constraints on documents in the collection in the Azure Cosmos DB + * service. + */ + @JsonProperty(value = "properties.uniqueKeyPolicy") + private UniqueKeyPolicy uniqueKeyPolicy; + + /** + * The conflict resolution policy for the graph. + */ + @JsonProperty(value = "properties.conflictResolutionPolicy") + private ConflictResolutionPolicy conflictResolutionPolicy; + + /** + * A system generated property. A unique identifier. + */ + @JsonProperty(value = "properties._rid") + private String _rid; + + /** + * A system generated property that denotes the last updated timestamp of + * the resource. + */ + @JsonProperty(value = "properties._ts") + private Object _ts; + + /** + * A system generated property representing the resource etag required for + * optimistic concurrency control. + */ + @JsonProperty(value = "properties._etag") + private String _etag; + + /** + * Get name of the Cosmos DB Gremlin graph. + * + * @return the gremlinGraphId value + */ + public String gremlinGraphId() { + return this.gremlinGraphId; + } + + /** + * Set name of the Cosmos DB Gremlin graph. + * + * @param gremlinGraphId the gremlinGraphId value to set + * @return the GremlinGraphInner object itself. + */ + public GremlinGraphInner withGremlinGraphId(String gremlinGraphId) { + this.gremlinGraphId = gremlinGraphId; + return this; + } + + /** + * Get the configuration of the indexing policy. By default, the indexing is automatic for all document paths within the graph. + * + * @return the indexingPolicy value + */ + public IndexingPolicy indexingPolicy() { + return this.indexingPolicy; + } + + /** + * Set the configuration of the indexing policy. By default, the indexing is automatic for all document paths within the graph. + * + * @param indexingPolicy the indexingPolicy value to set + * @return the GremlinGraphInner object itself. + */ + public GremlinGraphInner withIndexingPolicy(IndexingPolicy indexingPolicy) { + this.indexingPolicy = indexingPolicy; + return this; + } + + /** + * Get the configuration of the partition key to be used for partitioning data into multiple partitions. + * + * @return the partitionKey value + */ + public ContainerPartitionKey partitionKey() { + return this.partitionKey; + } + + /** + * Set the configuration of the partition key to be used for partitioning data into multiple partitions. + * + * @param partitionKey the partitionKey value to set + * @return the GremlinGraphInner object itself. + */ + public GremlinGraphInner withPartitionKey(ContainerPartitionKey partitionKey) { + this.partitionKey = partitionKey; + return this; + } + + /** + * Get default time to live. + * + * @return the defaultTtl value + */ + public Integer defaultTtl() { + return this.defaultTtl; + } + + /** + * Set default time to live. + * + * @param defaultTtl the defaultTtl value to set + * @return the GremlinGraphInner object itself. + */ + public GremlinGraphInner withDefaultTtl(Integer defaultTtl) { + this.defaultTtl = defaultTtl; + return this; + } + + /** + * Get the unique key policy configuration for specifying uniqueness constraints on documents in the collection in the Azure Cosmos DB service. + * + * @return the uniqueKeyPolicy value + */ + public UniqueKeyPolicy uniqueKeyPolicy() { + return this.uniqueKeyPolicy; + } + + /** + * Set the unique key policy configuration for specifying uniqueness constraints on documents in the collection in the Azure Cosmos DB service. + * + * @param uniqueKeyPolicy the uniqueKeyPolicy value to set + * @return the GremlinGraphInner object itself. + */ + public GremlinGraphInner withUniqueKeyPolicy(UniqueKeyPolicy uniqueKeyPolicy) { + this.uniqueKeyPolicy = uniqueKeyPolicy; + return this; + } + + /** + * Get the conflict resolution policy for the graph. + * + * @return the conflictResolutionPolicy value + */ + public ConflictResolutionPolicy conflictResolutionPolicy() { + return this.conflictResolutionPolicy; + } + + /** + * Set the conflict resolution policy for the graph. + * + * @param conflictResolutionPolicy the conflictResolutionPolicy value to set + * @return the GremlinGraphInner object itself. + */ + public GremlinGraphInner withConflictResolutionPolicy(ConflictResolutionPolicy conflictResolutionPolicy) { + this.conflictResolutionPolicy = conflictResolutionPolicy; + return this; + } + + /** + * Get a system generated property. A unique identifier. + * + * @return the _rid value + */ + public String _rid() { + return this._rid; + } + + /** + * Set a system generated property. A unique identifier. + * + * @param _rid the _rid value to set + * @return the GremlinGraphInner object itself. + */ + public GremlinGraphInner with_rid(String _rid) { + this._rid = _rid; + return this; + } + + /** + * Get a system generated property that denotes the last updated timestamp of the resource. + * + * @return the _ts value + */ + public Object _ts() { + return this._ts; + } + + /** + * Set a system generated property that denotes the last updated timestamp of the resource. + * + * @param _ts the _ts value to set + * @return the GremlinGraphInner object itself. + */ + public GremlinGraphInner with_ts(Object _ts) { + this._ts = _ts; + return this; + } + + /** + * Get a system generated property representing the resource etag required for optimistic concurrency control. + * + * @return the _etag value + */ + public String _etag() { + return this._etag; + } + + /** + * Set a system generated property representing the resource etag required for optimistic concurrency control. + * + * @param _etag the _etag value to set + * @return the GremlinGraphInner object itself. + */ + public GremlinGraphInner with_etag(String _etag) { + this._etag = _etag; + return this; + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/IdParsingUtils.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/IdParsingUtils.java new file mode 100644 index 000000000000..3b1e70dad1b2 --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/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.cosmosdb.v2015_04_08.implementation; +import java.util.Arrays; +import java.util.Iterator; + +class IdParsingUtils { + public static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + public static String getValueFromIdByPosition(String id, int pos) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + int index = 0; + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (index == pos) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + index++; + } + return null; + } +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/MetricDefinitionInner.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/MetricDefinitionInner.java new file mode 100644 index 000000000000..a7bb92409790 --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/MetricDefinitionInner.java @@ -0,0 +1,111 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation; + +import java.util.List; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.MetricAvailability; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.PrimaryAggregationType; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.UnitType; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.MetricName; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The definition of a metric. + */ +public class MetricDefinitionInner { + /** + * The list of metric availabilities for the account. + */ + @JsonProperty(value = "metricAvailabilities", access = JsonProperty.Access.WRITE_ONLY) + private List metricAvailabilities; + + /** + * The primary aggregation type of the metric. Possible values include: + * 'None', 'Average', 'Total', 'Minimum', 'Maximum', 'Last'. + */ + @JsonProperty(value = "primaryAggregationType", access = JsonProperty.Access.WRITE_ONLY) + private PrimaryAggregationType primaryAggregationType; + + /** + * The unit of the metric. Possible values include: 'Count', 'Bytes', + * 'Seconds', 'Percent', 'CountPerSecond', 'BytesPerSecond', + * 'Milliseconds'. + */ + @JsonProperty(value = "unit") + private UnitType unit; + + /** + * The resource uri of the database. + */ + @JsonProperty(value = "resourceUri", access = JsonProperty.Access.WRITE_ONLY) + private String resourceUri; + + /** + * The name information for the metric. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private MetricName name; + + /** + * Get the list of metric availabilities for the account. + * + * @return the metricAvailabilities value + */ + public List metricAvailabilities() { + return this.metricAvailabilities; + } + + /** + * Get the primary aggregation type of the metric. Possible values include: 'None', 'Average', 'Total', 'Minimum', 'Maximum', 'Last'. + * + * @return the primaryAggregationType value + */ + public PrimaryAggregationType primaryAggregationType() { + return this.primaryAggregationType; + } + + /** + * Get the unit of the metric. Possible values include: 'Count', 'Bytes', 'Seconds', 'Percent', 'CountPerSecond', 'BytesPerSecond', 'Milliseconds'. + * + * @return the unit value + */ + public UnitType unit() { + return this.unit; + } + + /** + * Set the unit of the metric. Possible values include: 'Count', 'Bytes', 'Seconds', 'Percent', 'CountPerSecond', 'BytesPerSecond', 'Milliseconds'. + * + * @param unit the unit value to set + * @return the MetricDefinitionInner object itself. + */ + public MetricDefinitionInner withUnit(UnitType unit) { + this.unit = unit; + return this; + } + + /** + * Get the resource uri of the database. + * + * @return the resourceUri value + */ + public String resourceUri() { + return this.resourceUri; + } + + /** + * Get the name information for the metric. + * + * @return the name value + */ + public MetricName name() { + return this.name; + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/MetricInner.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/MetricInner.java new file mode 100644 index 000000000000..b2a81c77403c --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/MetricInner.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.cosmosdb.v2015_04_08.implementation; + +import org.joda.time.DateTime; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.UnitType; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.MetricName; +import java.util.List; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.MetricValue; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Metric data. + */ +public class MetricInner { + /** + * The start time for the metric (ISO-8601 format). + */ + @JsonProperty(value = "startTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime startTime; + + /** + * The end time for the metric (ISO-8601 format). + */ + @JsonProperty(value = "endTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime endTime; + + /** + * The time grain to be used to summarize the metric values. + */ + @JsonProperty(value = "timeGrain", access = JsonProperty.Access.WRITE_ONLY) + private String timeGrain; + + /** + * The unit of the metric. Possible values include: 'Count', 'Bytes', + * 'Seconds', 'Percent', 'CountPerSecond', 'BytesPerSecond', + * 'Milliseconds'. + */ + @JsonProperty(value = "unit") + private UnitType unit; + + /** + * The name information for the metric. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private MetricName name; + + /** + * The metric values for the specified time window and timestep. + */ + @JsonProperty(value = "metricValues", access = JsonProperty.Access.WRITE_ONLY) + private List metricValues; + + /** + * Get the start time for the metric (ISO-8601 format). + * + * @return the startTime value + */ + public DateTime startTime() { + return this.startTime; + } + + /** + * Get the end time for the metric (ISO-8601 format). + * + * @return the endTime value + */ + public DateTime endTime() { + return this.endTime; + } + + /** + * Get the time grain to be used to summarize the metric values. + * + * @return the timeGrain value + */ + public String timeGrain() { + return this.timeGrain; + } + + /** + * Get the unit of the metric. Possible values include: 'Count', 'Bytes', 'Seconds', 'Percent', 'CountPerSecond', 'BytesPerSecond', 'Milliseconds'. + * + * @return the unit value + */ + public UnitType unit() { + return this.unit; + } + + /** + * Set the unit of the metric. Possible values include: 'Count', 'Bytes', 'Seconds', 'Percent', 'CountPerSecond', 'BytesPerSecond', 'Milliseconds'. + * + * @param unit the unit value to set + * @return the MetricInner object itself. + */ + public MetricInner withUnit(UnitType unit) { + this.unit = unit; + return this; + } + + /** + * Get the name information for the metric. + * + * @return the name value + */ + public MetricName name() { + return this.name; + } + + /** + * Get the metric values for the specified time window and timestep. + * + * @return the metricValues value + */ + public List metricValues() { + return this.metricValues; + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/MongoDBCollectionImpl.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/MongoDBCollectionImpl.java new file mode 100644 index 000000000000..9f26a216a38f --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/MongoDBCollectionImpl.java @@ -0,0 +1,160 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation; + +import com.microsoft.azure.management.cosmosdb.v2015_04_08.MongoDBCollection; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.MongoDBCollectionCreateUpdateParameters; +import java.util.Map; +import java.util.List; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.MongoIndex; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.MongoDBCollectionResource; +import rx.functions.Func1; + +class MongoDBCollectionImpl extends CreatableUpdatableImpl implements MongoDBCollection, MongoDBCollection.Definition, MongoDBCollection.Update { + private final CosmosDBManager manager; + private String resourceGroupName; + private String accountName; + private String databaseName; + private String collectionName; + private MongoDBCollectionCreateUpdateParameters createOrUpdateParameter; + + MongoDBCollectionImpl(String name, CosmosDBManager manager) { + super(name, new MongoDBCollectionInner()); + this.manager = manager; + // Set resource name + this.collectionName = name; + // + this.createOrUpdateParameter = new MongoDBCollectionCreateUpdateParameters(); + } + + MongoDBCollectionImpl(MongoDBCollectionInner inner, CosmosDBManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.collectionName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.accountName = IdParsingUtils.getValueFromIdByName(inner.id(), "databaseAccounts"); + this.databaseName = IdParsingUtils.getValueFromIdByName(inner.id(), "databases"); + this.collectionName = IdParsingUtils.getValueFromIdByName(inner.id(), "collections"); + // + this.createOrUpdateParameter = new MongoDBCollectionCreateUpdateParameters(); + } + + @Override + public CosmosDBManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + DatabaseAccountsInner client = this.manager().inner().databaseAccounts(); + return client.createUpdateMongoDBCollectionAsync(this.resourceGroupName, this.accountName, this.databaseName, this.collectionName, this.createOrUpdateParameter) + .map(new Func1() { + @Override + public MongoDBCollectionInner call(MongoDBCollectionInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + DatabaseAccountsInner client = this.manager().inner().databaseAccounts(); + return client.createUpdateMongoDBCollectionAsync(this.resourceGroupName, this.accountName, this.databaseName, this.collectionName, this.createOrUpdateParameter) + .map(new Func1() { + @Override + public MongoDBCollectionInner call(MongoDBCollectionInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + DatabaseAccountsInner client = this.manager().inner().databaseAccounts(); + return client.getMongoDBCollectionAsync(this.resourceGroupName, this.accountName, this.databaseName, this.collectionName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.createOrUpdateParameter = new MongoDBCollectionCreateUpdateParameters(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public List indexes() { + return this.inner().indexes(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String mongoDBCollectionId() { + return this.inner().mongoDBCollectionId(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public Map shardKey() { + return this.inner().shardKey(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public MongoDBCollectionImpl withExistingDatabasis(String resourceGroupName, String accountName, String databaseName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + this.databaseName = databaseName; + return this; + } + + @Override + public MongoDBCollectionImpl withOptions(Map options) { + this.createOrUpdateParameter.withOptions(options); + return this; + } + + @Override + public MongoDBCollectionImpl withResource(MongoDBCollectionResource resource) { + this.createOrUpdateParameter.withResource(resource); + return this; + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/MongoDBCollectionInner.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/MongoDBCollectionInner.java new file mode 100644 index 000000000000..16786ea8c895 --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/MongoDBCollectionInner.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.cosmosdb.v2015_04_08.implementation; + +import java.util.Map; +import java.util.List; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.MongoIndex; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * An Azure Cosmos DB MongoDB collection. + */ +@JsonFlatten +@SkipParentValidation +public class MongoDBCollectionInner extends Resource { + /** + * Name of the Cosmos DB MongoDB collection. + */ + @JsonProperty(value = "properties.id", required = true) + private String mongoDBCollectionId; + + /** + * A key-value pair of shard keys to be applied for the request. + */ + @JsonProperty(value = "properties.shardKey") + private Map shardKey; + + /** + * List of index keys. + */ + @JsonProperty(value = "properties.indexes") + private List indexes; + + /** + * Get name of the Cosmos DB MongoDB collection. + * + * @return the mongoDBCollectionId value + */ + public String mongoDBCollectionId() { + return this.mongoDBCollectionId; + } + + /** + * Set name of the Cosmos DB MongoDB collection. + * + * @param mongoDBCollectionId the mongoDBCollectionId value to set + * @return the MongoDBCollectionInner object itself. + */ + public MongoDBCollectionInner withMongoDBCollectionId(String mongoDBCollectionId) { + this.mongoDBCollectionId = mongoDBCollectionId; + return this; + } + + /** + * Get a key-value pair of shard keys to be applied for the request. + * + * @return the shardKey value + */ + public Map shardKey() { + return this.shardKey; + } + + /** + * Set a key-value pair of shard keys to be applied for the request. + * + * @param shardKey the shardKey value to set + * @return the MongoDBCollectionInner object itself. + */ + public MongoDBCollectionInner withShardKey(Map shardKey) { + this.shardKey = shardKey; + return this; + } + + /** + * Get list of index keys. + * + * @return the indexes value + */ + public List indexes() { + return this.indexes; + } + + /** + * Set list of index keys. + * + * @param indexes the indexes value to set + * @return the MongoDBCollectionInner object itself. + */ + public MongoDBCollectionInner withIndexes(List indexes) { + this.indexes = indexes; + return this; + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/MongoDBDatabaseImpl.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/MongoDBDatabaseImpl.java new file mode 100644 index 000000000000..9f96c2419956 --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/MongoDBDatabaseImpl.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.cosmosdb.v2015_04_08.implementation; + +import com.microsoft.azure.management.cosmosdb.v2015_04_08.MongoDBDatabase; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.Map; + +class MongoDBDatabaseImpl extends WrapperImpl implements MongoDBDatabase { + private final CosmosDBManager manager; + MongoDBDatabaseImpl(MongoDBDatabaseInner inner, CosmosDBManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public CosmosDBManager manager() { + return this.manager; + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String mongoDBDatabaseId() { + return this.inner().mongoDBDatabaseId(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/MongoDBDatabaseInner.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/MongoDBDatabaseInner.java new file mode 100644 index 000000000000..4f7816b864c1 --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/MongoDBDatabaseInner.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.cosmosdb.v2015_04_08.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * An Azure Cosmos DB MongoDB database. + */ +@JsonFlatten +@SkipParentValidation +public class MongoDBDatabaseInner extends Resource { + /** + * Name of the Cosmos DB MongoDB database. + */ + @JsonProperty(value = "properties.id", required = true) + private String mongoDBDatabaseId; + + /** + * Get name of the Cosmos DB MongoDB database. + * + * @return the mongoDBDatabaseId value + */ + public String mongoDBDatabaseId() { + return this.mongoDBDatabaseId; + } + + /** + * Set name of the Cosmos DB MongoDB database. + * + * @param mongoDBDatabaseId the mongoDBDatabaseId value to set + * @return the MongoDBDatabaseInner object itself. + */ + public MongoDBDatabaseInner withMongoDBDatabaseId(String mongoDBDatabaseId) { + this.mongoDBDatabaseId = mongoDBDatabaseId; + return this; + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/OperationImpl.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/OperationImpl.java new file mode 100644 index 000000000000..92705bb3a819 --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/OperationImpl.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.cosmosdb.v2015_04_08.implementation; + +import com.microsoft.azure.management.cosmosdb.v2015_04_08.Operation; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.OperationDisplay; + +class OperationImpl extends WrapperImpl implements Operation { + private final CosmosDBManager manager; + OperationImpl(OperationInner inner, CosmosDBManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public CosmosDBManager manager() { + return this.manager; + } + + @Override + public OperationDisplay display() { + return this.inner().display(); + } + + @Override + public String name() { + return this.inner().name(); + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/OperationInner.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/OperationInner.java new file mode 100644 index 000000000000..a2cc9bea024b --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/OperationInner.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.cosmosdb.v2015_04_08.implementation; + +import com.microsoft.azure.management.cosmosdb.v2015_04_08.OperationDisplay; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * REST API operation. + */ +public class OperationInner { + /** + * Operation name: {provider}/{resource}/{operation}. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The object that represents the operation. + */ + @JsonProperty(value = "display") + private OperationDisplay display; + + /** + * Get operation name: {provider}/{resource}/{operation}. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set operation name: {provider}/{resource}/{operation}. + * + * @param name the name value to set + * @return the OperationInner object itself. + */ + public OperationInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the object that represents the operation. + * + * @return the display value + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Set the object that represents the operation. + * + * @param display the display value to set + * @return the OperationInner object itself. + */ + public OperationInner withDisplay(OperationDisplay display) { + this.display = display; + return this; + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/OperationsImpl.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/OperationsImpl.java new file mode 100644 index 000000000000..ebcf8a99937c --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/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.cosmosdb.v2015_04_08.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.Operations; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.Operation; + +class OperationsImpl extends WrapperImpl implements Operations { + private final CosmosDBManager manager; + + OperationsImpl(CosmosDBManager manager) { + super(manager.inner().operations()); + this.manager = manager; + } + + public CosmosDBManager manager() { + return this.manager; + } + + @Override + public Observable listAsync() { + OperationsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Operation call(OperationInner inner) { + return new OperationImpl(inner, manager()); + } + }); + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/OperationsInner.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/OperationsInner.java new file mode 100644 index 000000000000..ff83fbd5761e --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/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.cosmosdb.v2015_04_08.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 CosmosDBManagementClientImpl 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, CosmosDBManagementClientImpl 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.cosmosdb.v2015_04_08.Operations list" }) + @GET("providers/Microsoft.DocumentDB/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.cosmosdb.v2015_04_08.Operations listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists all of the available Cosmos DB Resource Provider operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<OperationInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all of the available Cosmos DB Resource Provider operations. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all of the available Cosmos DB Resource Provider operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all of the available Cosmos DB Resource Provider operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all of the available Cosmos DB Resource Provider operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<OperationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all of the available Cosmos DB Resource Provider operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<OperationInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all of the available Cosmos DB Resource Provider operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all of the available Cosmos DB Resource Provider operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all of the available Cosmos DB Resource Provider operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all of the available Cosmos DB Resource Provider operations. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<OperationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/PageImpl.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/PageImpl.java new file mode 100644 index 000000000000..d446f2673d08 --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/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.cosmosdb.v2015_04_08.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("") + private String nextPageLink; + + /** + * The list of items. + */ + @JsonProperty("value") + private List items; + + /** + * Gets the link to the next page. + * + * @return the link to the next page. + */ + @Override + public String nextPageLink() { + return this.nextPageLink; + } + + /** + * Gets the list of items. + * + * @return the list of items in {@link List}. + */ + @Override + public List items() { + return items; + } + + /** + * Sets the link to the next page. + * + * @param nextPageLink the link to the next page. + * @return this Page object itself. + */ + public PageImpl setNextPageLink(String nextPageLink) { + this.nextPageLink = nextPageLink; + return this; + } + + /** + * Sets the list of items. + * + * @param items the list of items in {@link List}. + * @return this Page object itself. + */ + public PageImpl setItems(List items) { + this.items = items; + return this; + } +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/PageImpl1.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/PageImpl1.java new file mode 100644 index 000000000000..5d1f9940fb15 --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/PageImpl1.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.cosmosdb.v2015_04_08.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 PageImpl1 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 PageImpl1 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 PageImpl1 setItems(List items) { + this.items = items; + return this; + } +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/PartitionKeyRangeIdRegionsImpl.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/PartitionKeyRangeIdRegionsImpl.java new file mode 100644 index 000000000000..fd0068a47c6f --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/PartitionKeyRangeIdRegionsImpl.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.cosmosdb.v2015_04_08.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.PartitionKeyRangeIdRegions; +import rx.functions.Func1; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.PartitionMetric; + +class PartitionKeyRangeIdRegionsImpl extends WrapperImpl implements PartitionKeyRangeIdRegions { + private final CosmosDBManager manager; + + PartitionKeyRangeIdRegionsImpl(CosmosDBManager manager) { + super(manager.inner().partitionKeyRangeIdRegions()); + this.manager = manager; + } + + public CosmosDBManager manager() { + return this.manager; + } + + @Override + public Observable listMetricsAsync(String resourceGroupName, String accountName, String region, String databaseRid, String collectionRid, String partitionKeyRangeId, String filter) { + PartitionKeyRangeIdRegionsInner client = this.inner(); + return client.listMetricsAsync(resourceGroupName, accountName, region, databaseRid, collectionRid, partitionKeyRangeId, filter) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public PartitionMetric call(PartitionMetricInner inner) { + return new PartitionMetricImpl(inner, manager()); + } + }); + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/PartitionKeyRangeIdRegionsInner.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/PartitionKeyRangeIdRegionsInner.java new file mode 100644 index 000000000000..558556f7f6f1 --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/PartitionKeyRangeIdRegionsInner.java @@ -0,0 +1,187 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.cosmosdb.v2015_04_08.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 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.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in PartitionKeyRangeIdRegions. + */ +public class PartitionKeyRangeIdRegionsInner { + /** The Retrofit service to perform REST calls. */ + private PartitionKeyRangeIdRegionsService service; + /** The service client containing this operation class. */ + private CosmosDBManagementClientImpl client; + + /** + * Initializes an instance of PartitionKeyRangeIdRegionsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public PartitionKeyRangeIdRegionsInner(Retrofit retrofit, CosmosDBManagementClientImpl client) { + this.service = retrofit.create(PartitionKeyRangeIdRegionsService.class); + this.client = client; + } + + /** + * The interface defining all the services for PartitionKeyRangeIdRegions to be + * used by Retrofit to perform actually REST calls. + */ + interface PartitionKeyRangeIdRegionsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cosmosdb.v2015_04_08.PartitionKeyRangeIdRegions listMetrics" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/region/{region}/databases/{databaseRid}/collections/{collectionRid}/partitionKeyRangeId/{partitionKeyRangeId}/metrics") + Observable> listMetrics(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("region") String region, @Path("databaseRid") String databaseRid, @Path("collectionRid") String collectionRid, @Path("partitionKeyRangeId") String partitionKeyRangeId, @Query("api-version") String apiVersion, @Query("$filter") String filter, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Retrieves the metrics determined by the given filter for the given partition key range id and region. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param region Cosmos DB region, with spaces between words and each word capitalized. + * @param databaseRid Cosmos DB database rid. + * @param collectionRid Cosmos DB collection rid. + * @param partitionKeyRangeId Partition Key Range Id for which to get data. + * @param filter An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq. + * @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 List<PartitionMetricInner> object if successful. + */ + public List listMetrics(String resourceGroupName, String accountName, String region, String databaseRid, String collectionRid, String partitionKeyRangeId, String filter) { + return listMetricsWithServiceResponseAsync(resourceGroupName, accountName, region, databaseRid, collectionRid, partitionKeyRangeId, filter).toBlocking().single().body(); + } + + /** + * Retrieves the metrics determined by the given filter for the given partition key range id and region. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param region Cosmos DB region, with spaces between words and each word capitalized. + * @param databaseRid Cosmos DB database rid. + * @param collectionRid Cosmos DB collection rid. + * @param partitionKeyRangeId Partition Key Range Id for which to get data. + * @param filter An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq. + * @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> listMetricsAsync(String resourceGroupName, String accountName, String region, String databaseRid, String collectionRid, String partitionKeyRangeId, String filter, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listMetricsWithServiceResponseAsync(resourceGroupName, accountName, region, databaseRid, collectionRid, partitionKeyRangeId, filter), serviceCallback); + } + + /** + * Retrieves the metrics determined by the given filter for the given partition key range id and region. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param region Cosmos DB region, with spaces between words and each word capitalized. + * @param databaseRid Cosmos DB database rid. + * @param collectionRid Cosmos DB collection rid. + * @param partitionKeyRangeId Partition Key Range Id for which to get data. + * @param filter An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<PartitionMetricInner> object + */ + public Observable> listMetricsAsync(String resourceGroupName, String accountName, String region, String databaseRid, String collectionRid, String partitionKeyRangeId, String filter) { + return listMetricsWithServiceResponseAsync(resourceGroupName, accountName, region, databaseRid, collectionRid, partitionKeyRangeId, filter).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Retrieves the metrics determined by the given filter for the given partition key range id and region. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param region Cosmos DB region, with spaces between words and each word capitalized. + * @param databaseRid Cosmos DB database rid. + * @param collectionRid Cosmos DB collection rid. + * @param partitionKeyRangeId Partition Key Range Id for which to get data. + * @param filter An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<PartitionMetricInner> object + */ + public Observable>> listMetricsWithServiceResponseAsync(String resourceGroupName, String accountName, String region, String databaseRid, String collectionRid, String partitionKeyRangeId, String filter) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (region == null) { + throw new IllegalArgumentException("Parameter region is required and cannot be null."); + } + if (databaseRid == null) { + throw new IllegalArgumentException("Parameter databaseRid is required and cannot be null."); + } + if (collectionRid == null) { + throw new IllegalArgumentException("Parameter collectionRid is required and cannot be null."); + } + if (partitionKeyRangeId == null) { + throw new IllegalArgumentException("Parameter partitionKeyRangeId 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 (filter == null) { + throw new IllegalArgumentException("Parameter filter is required and cannot be null."); + } + return service.listMetrics(this.client.subscriptionId(), resourceGroupName, accountName, region, databaseRid, collectionRid, partitionKeyRangeId, this.client.apiVersion(), filter, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listMetricsDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listMetricsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/PartitionKeyRangeIdsImpl.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/PartitionKeyRangeIdsImpl.java new file mode 100644 index 000000000000..be051ff6fe02 --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/PartitionKeyRangeIdsImpl.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.cosmosdb.v2015_04_08.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.PartitionKeyRangeIds; +import rx.functions.Func1; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.PartitionMetric; + +class PartitionKeyRangeIdsImpl extends WrapperImpl implements PartitionKeyRangeIds { + private final CosmosDBManager manager; + + PartitionKeyRangeIdsImpl(CosmosDBManager manager) { + super(manager.inner().partitionKeyRangeIds()); + this.manager = manager; + } + + public CosmosDBManager manager() { + return this.manager; + } + + @Override + public Observable listMetricsAsync(String resourceGroupName, String accountName, String databaseRid, String collectionRid, String partitionKeyRangeId, String filter) { + PartitionKeyRangeIdsInner client = this.inner(); + return client.listMetricsAsync(resourceGroupName, accountName, databaseRid, collectionRid, partitionKeyRangeId, filter) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public PartitionMetric call(PartitionMetricInner inner) { + return new PartitionMetricImpl(inner, manager()); + } + }); + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/PartitionKeyRangeIdsInner.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/PartitionKeyRangeIdsInner.java new file mode 100644 index 000000000000..f1778387c96e --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/PartitionKeyRangeIdsInner.java @@ -0,0 +1,180 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.cosmosdb.v2015_04_08.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 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.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in PartitionKeyRangeIds. + */ +public class PartitionKeyRangeIdsInner { + /** The Retrofit service to perform REST calls. */ + private PartitionKeyRangeIdsService service; + /** The service client containing this operation class. */ + private CosmosDBManagementClientImpl client; + + /** + * Initializes an instance of PartitionKeyRangeIdsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public PartitionKeyRangeIdsInner(Retrofit retrofit, CosmosDBManagementClientImpl client) { + this.service = retrofit.create(PartitionKeyRangeIdsService.class); + this.client = client; + } + + /** + * The interface defining all the services for PartitionKeyRangeIds to be + * used by Retrofit to perform actually REST calls. + */ + interface PartitionKeyRangeIdsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cosmosdb.v2015_04_08.PartitionKeyRangeIds listMetrics" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/partitionKeyRangeId/{partitionKeyRangeId}/metrics") + Observable> listMetrics(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("databaseRid") String databaseRid, @Path("collectionRid") String collectionRid, @Path("partitionKeyRangeId") String partitionKeyRangeId, @Query("api-version") String apiVersion, @Query("$filter") String filter, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Retrieves the metrics determined by the given filter for the given partition key range id. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseRid Cosmos DB database rid. + * @param collectionRid Cosmos DB collection rid. + * @param partitionKeyRangeId Partition Key Range Id for which to get data. + * @param filter An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq. + * @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 List<PartitionMetricInner> object if successful. + */ + public List listMetrics(String resourceGroupName, String accountName, String databaseRid, String collectionRid, String partitionKeyRangeId, String filter) { + return listMetricsWithServiceResponseAsync(resourceGroupName, accountName, databaseRid, collectionRid, partitionKeyRangeId, filter).toBlocking().single().body(); + } + + /** + * Retrieves the metrics determined by the given filter for the given partition key range id. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseRid Cosmos DB database rid. + * @param collectionRid Cosmos DB collection rid. + * @param partitionKeyRangeId Partition Key Range Id for which to get data. + * @param filter An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq. + * @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> listMetricsAsync(String resourceGroupName, String accountName, String databaseRid, String collectionRid, String partitionKeyRangeId, String filter, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listMetricsWithServiceResponseAsync(resourceGroupName, accountName, databaseRid, collectionRid, partitionKeyRangeId, filter), serviceCallback); + } + + /** + * Retrieves the metrics determined by the given filter for the given partition key range id. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseRid Cosmos DB database rid. + * @param collectionRid Cosmos DB collection rid. + * @param partitionKeyRangeId Partition Key Range Id for which to get data. + * @param filter An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<PartitionMetricInner> object + */ + public Observable> listMetricsAsync(String resourceGroupName, String accountName, String databaseRid, String collectionRid, String partitionKeyRangeId, String filter) { + return listMetricsWithServiceResponseAsync(resourceGroupName, accountName, databaseRid, collectionRid, partitionKeyRangeId, filter).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Retrieves the metrics determined by the given filter for the given partition key range id. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param databaseRid Cosmos DB database rid. + * @param collectionRid Cosmos DB collection rid. + * @param partitionKeyRangeId Partition Key Range Id for which to get data. + * @param filter An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<PartitionMetricInner> object + */ + public Observable>> listMetricsWithServiceResponseAsync(String resourceGroupName, String accountName, String databaseRid, String collectionRid, String partitionKeyRangeId, String filter) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (databaseRid == null) { + throw new IllegalArgumentException("Parameter databaseRid is required and cannot be null."); + } + if (collectionRid == null) { + throw new IllegalArgumentException("Parameter collectionRid is required and cannot be null."); + } + if (partitionKeyRangeId == null) { + throw new IllegalArgumentException("Parameter partitionKeyRangeId 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 (filter == null) { + throw new IllegalArgumentException("Parameter filter is required and cannot be null."); + } + return service.listMetrics(this.client.subscriptionId(), resourceGroupName, accountName, databaseRid, collectionRid, partitionKeyRangeId, this.client.apiVersion(), filter, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listMetricsDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listMetricsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/PartitionMetricImpl.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/PartitionMetricImpl.java new file mode 100644 index 000000000000..b0995ebe9255 --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/PartitionMetricImpl.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.cosmosdb.v2015_04_08.implementation; + +import com.microsoft.azure.management.cosmosdb.v2015_04_08.PartitionMetric; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import org.joda.time.DateTime; +import java.util.List; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.MetricValue; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.MetricName; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.UnitType; + +class PartitionMetricImpl extends WrapperImpl implements PartitionMetric { + private final CosmosDBManager manager; + PartitionMetricImpl(PartitionMetricInner inner, CosmosDBManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public CosmosDBManager manager() { + return this.manager; + } + + @Override + public DateTime endTime() { + return this.inner().endTime(); + } + + @Override + public List metricValues() { + return this.inner().metricValues(); + } + + @Override + public MetricName name() { + return this.inner().name(); + } + + @Override + public String partitionId() { + return this.inner().partitionId(); + } + + @Override + public String partitionKeyRangeId() { + return this.inner().partitionKeyRangeId(); + } + + @Override + public DateTime startTime() { + return this.inner().startTime(); + } + + @Override + public String timeGrain() { + return this.inner().timeGrain(); + } + + @Override + public UnitType unit() { + return this.inner().unit(); + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/PartitionMetricInner.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/PartitionMetricInner.java new file mode 100644 index 000000000000..810adeac8c5d --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/PartitionMetricInner.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.cosmosdb.v2015_04_08.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The metric values for a single partition. + */ +public class PartitionMetricInner extends MetricInner { + /** + * The partition id (GUID identifier) of the metric values. + */ + @JsonProperty(value = "partitionId", access = JsonProperty.Access.WRITE_ONLY) + private String partitionId; + + /** + * The partition key range id (integer identifier) of the metric values. + */ + @JsonProperty(value = "partitionKeyRangeId", access = JsonProperty.Access.WRITE_ONLY) + private String partitionKeyRangeId; + + /** + * Get the partition id (GUID identifier) of the metric values. + * + * @return the partitionId value + */ + public String partitionId() { + return this.partitionId; + } + + /** + * Get the partition key range id (integer identifier) of the metric values. + * + * @return the partitionKeyRangeId value + */ + public String partitionKeyRangeId() { + return this.partitionKeyRangeId; + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/PartitionUsageImpl.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/PartitionUsageImpl.java new file mode 100644 index 000000000000..a51ad2047a30 --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/PartitionUsageImpl.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.cosmosdb.v2015_04_08.implementation; + +import com.microsoft.azure.management.cosmosdb.v2015_04_08.PartitionUsage; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.MetricName; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.UnitType; + +class PartitionUsageImpl extends WrapperImpl implements PartitionUsage { + private final CosmosDBManager manager; + PartitionUsageImpl(PartitionUsageInner inner, CosmosDBManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public CosmosDBManager manager() { + return this.manager; + } + + @Override + public Long currentValue() { + return this.inner().currentValue(); + } + + @Override + public Long limit() { + return this.inner().limit(); + } + + @Override + public MetricName name() { + return this.inner().name(); + } + + @Override + public String partitionId() { + return this.inner().partitionId(); + } + + @Override + public String partitionKeyRangeId() { + return this.inner().partitionKeyRangeId(); + } + + @Override + public String quotaPeriod() { + return this.inner().quotaPeriod(); + } + + @Override + public UnitType unit() { + return this.inner().unit(); + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/PartitionUsageInner.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/PartitionUsageInner.java new file mode 100644 index 000000000000..f1f8b39f588a --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/PartitionUsageInner.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.cosmosdb.v2015_04_08.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The partition level usage data for a usage request. + */ +public class PartitionUsageInner extends UsageInner { + /** + * The partition id (GUID identifier) of the usages. + */ + @JsonProperty(value = "partitionId", access = JsonProperty.Access.WRITE_ONLY) + private String partitionId; + + /** + * The partition key range id (integer identifier) of the usages. + */ + @JsonProperty(value = "partitionKeyRangeId", access = JsonProperty.Access.WRITE_ONLY) + private String partitionKeyRangeId; + + /** + * Get the partition id (GUID identifier) of the usages. + * + * @return the partitionId value + */ + public String partitionId() { + return this.partitionId; + } + + /** + * Get the partition key range id (integer identifier) of the usages. + * + * @return the partitionKeyRangeId value + */ + public String partitionKeyRangeId() { + return this.partitionKeyRangeId; + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/PercentileMetricImpl.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/PercentileMetricImpl.java new file mode 100644 index 000000000000..1b0d1c08a5c4 --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/PercentileMetricImpl.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.cosmosdb.v2015_04_08.implementation; + +import com.microsoft.azure.management.cosmosdb.v2015_04_08.PercentileMetric; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import org.joda.time.DateTime; +import java.util.List; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.PercentileMetricValue; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.MetricName; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.UnitType; + +class PercentileMetricImpl extends WrapperImpl implements PercentileMetric { + private final CosmosDBManager manager; + PercentileMetricImpl(PercentileMetricInner inner, CosmosDBManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public CosmosDBManager manager() { + return this.manager; + } + + @Override + public DateTime endTime() { + return this.inner().endTime(); + } + + @Override + public List metricValues() { + return this.inner().metricValues(); + } + + @Override + public MetricName name() { + return this.inner().name(); + } + + @Override + public DateTime startTime() { + return this.inner().startTime(); + } + + @Override + public String timeGrain() { + return this.inner().timeGrain(); + } + + @Override + public UnitType unit() { + return this.inner().unit(); + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/PercentileMetricInner.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/PercentileMetricInner.java new file mode 100644 index 000000000000..33608b890cef --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/PercentileMetricInner.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.cosmosdb.v2015_04_08.implementation; + +import org.joda.time.DateTime; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.UnitType; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.MetricName; +import java.util.List; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.PercentileMetricValue; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Percentile Metric data. + */ +public class PercentileMetricInner { + /** + * The start time for the metric (ISO-8601 format). + */ + @JsonProperty(value = "startTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime startTime; + + /** + * The end time for the metric (ISO-8601 format). + */ + @JsonProperty(value = "endTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime endTime; + + /** + * The time grain to be used to summarize the metric values. + */ + @JsonProperty(value = "timeGrain", access = JsonProperty.Access.WRITE_ONLY) + private String timeGrain; + + /** + * The unit of the metric. Possible values include: 'Count', 'Bytes', + * 'Seconds', 'Percent', 'CountPerSecond', 'BytesPerSecond', + * 'Milliseconds'. + */ + @JsonProperty(value = "unit") + private UnitType unit; + + /** + * The name information for the metric. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private MetricName name; + + /** + * The percentile metric values for the specified time window and timestep. + */ + @JsonProperty(value = "metricValues", access = JsonProperty.Access.WRITE_ONLY) + private List metricValues; + + /** + * Get the start time for the metric (ISO-8601 format). + * + * @return the startTime value + */ + public DateTime startTime() { + return this.startTime; + } + + /** + * Get the end time for the metric (ISO-8601 format). + * + * @return the endTime value + */ + public DateTime endTime() { + return this.endTime; + } + + /** + * Get the time grain to be used to summarize the metric values. + * + * @return the timeGrain value + */ + public String timeGrain() { + return this.timeGrain; + } + + /** + * Get the unit of the metric. Possible values include: 'Count', 'Bytes', 'Seconds', 'Percent', 'CountPerSecond', 'BytesPerSecond', 'Milliseconds'. + * + * @return the unit value + */ + public UnitType unit() { + return this.unit; + } + + /** + * Set the unit of the metric. Possible values include: 'Count', 'Bytes', 'Seconds', 'Percent', 'CountPerSecond', 'BytesPerSecond', 'Milliseconds'. + * + * @param unit the unit value to set + * @return the PercentileMetricInner object itself. + */ + public PercentileMetricInner withUnit(UnitType unit) { + this.unit = unit; + return this; + } + + /** + * Get the name information for the metric. + * + * @return the name value + */ + public MetricName name() { + return this.name; + } + + /** + * Get the percentile metric values for the specified time window and timestep. + * + * @return the metricValues value + */ + public List metricValues() { + return this.metricValues; + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/PercentileSourceTargetsImpl.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/PercentileSourceTargetsImpl.java new file mode 100644 index 000000000000..cf82c2e6e028 --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/PercentileSourceTargetsImpl.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.cosmosdb.v2015_04_08.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.PercentileSourceTargets; +import rx.functions.Func1; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.PercentileMetric; + +class PercentileSourceTargetsImpl extends WrapperImpl implements PercentileSourceTargets { + private final CosmosDBManager manager; + + PercentileSourceTargetsImpl(CosmosDBManager manager) { + super(manager.inner().percentileSourceTargets()); + this.manager = manager; + } + + public CosmosDBManager manager() { + return this.manager; + } + + @Override + public Observable listMetricsAsync(String resourceGroupName, String accountName, String sourceRegion, String targetRegion, String filter) { + PercentileSourceTargetsInner client = this.inner(); + return client.listMetricsAsync(resourceGroupName, accountName, sourceRegion, targetRegion, filter) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public PercentileMetric call(PercentileMetricInner inner) { + return new PercentileMetricImpl(inner, manager()); + } + }); + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/PercentileSourceTargetsInner.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/PercentileSourceTargetsInner.java new file mode 100644 index 000000000000..67f71344a222 --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/PercentileSourceTargetsInner.java @@ -0,0 +1,173 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.cosmosdb.v2015_04_08.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 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.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in PercentileSourceTargets. + */ +public class PercentileSourceTargetsInner { + /** The Retrofit service to perform REST calls. */ + private PercentileSourceTargetsService service; + /** The service client containing this operation class. */ + private CosmosDBManagementClientImpl client; + + /** + * Initializes an instance of PercentileSourceTargetsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public PercentileSourceTargetsInner(Retrofit retrofit, CosmosDBManagementClientImpl client) { + this.service = retrofit.create(PercentileSourceTargetsService.class); + this.client = client; + } + + /** + * The interface defining all the services for PercentileSourceTargets to be + * used by Retrofit to perform actually REST calls. + */ + interface PercentileSourceTargetsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cosmosdb.v2015_04_08.PercentileSourceTargets listMetrics" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sourceRegion/{sourceRegion}/targetRegion/{targetRegion}/percentile/metrics") + Observable> listMetrics(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("sourceRegion") String sourceRegion, @Path("targetRegion") String targetRegion, @Query("api-version") String apiVersion, @Query("$filter") String filter, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Retrieves the metrics determined by the given filter for the given account, source and target region. This url is only for PBS and Replication Latency data. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param sourceRegion Source region from which data is written. Cosmos DB region, with spaces between words and each word capitalized. + * @param targetRegion Target region to which data is written. Cosmos DB region, with spaces between words and each word capitalized. + * @param filter An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq. + * @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 List<PercentileMetricInner> object if successful. + */ + public List listMetrics(String resourceGroupName, String accountName, String sourceRegion, String targetRegion, String filter) { + return listMetricsWithServiceResponseAsync(resourceGroupName, accountName, sourceRegion, targetRegion, filter).toBlocking().single().body(); + } + + /** + * Retrieves the metrics determined by the given filter for the given account, source and target region. This url is only for PBS and Replication Latency data. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param sourceRegion Source region from which data is written. Cosmos DB region, with spaces between words and each word capitalized. + * @param targetRegion Target region to which data is written. Cosmos DB region, with spaces between words and each word capitalized. + * @param filter An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq. + * @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> listMetricsAsync(String resourceGroupName, String accountName, String sourceRegion, String targetRegion, String filter, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listMetricsWithServiceResponseAsync(resourceGroupName, accountName, sourceRegion, targetRegion, filter), serviceCallback); + } + + /** + * Retrieves the metrics determined by the given filter for the given account, source and target region. This url is only for PBS and Replication Latency data. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param sourceRegion Source region from which data is written. Cosmos DB region, with spaces between words and each word capitalized. + * @param targetRegion Target region to which data is written. Cosmos DB region, with spaces between words and each word capitalized. + * @param filter An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<PercentileMetricInner> object + */ + public Observable> listMetricsAsync(String resourceGroupName, String accountName, String sourceRegion, String targetRegion, String filter) { + return listMetricsWithServiceResponseAsync(resourceGroupName, accountName, sourceRegion, targetRegion, filter).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Retrieves the metrics determined by the given filter for the given account, source and target region. This url is only for PBS and Replication Latency data. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param sourceRegion Source region from which data is written. Cosmos DB region, with spaces between words and each word capitalized. + * @param targetRegion Target region to which data is written. Cosmos DB region, with spaces between words and each word capitalized. + * @param filter An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<PercentileMetricInner> object + */ + public Observable>> listMetricsWithServiceResponseAsync(String resourceGroupName, String accountName, String sourceRegion, String targetRegion, String filter) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (sourceRegion == null) { + throw new IllegalArgumentException("Parameter sourceRegion is required and cannot be null."); + } + if (targetRegion == null) { + throw new IllegalArgumentException("Parameter targetRegion 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 (filter == null) { + throw new IllegalArgumentException("Parameter filter is required and cannot be null."); + } + return service.listMetrics(this.client.subscriptionId(), resourceGroupName, accountName, sourceRegion, targetRegion, this.client.apiVersion(), filter, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listMetricsDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listMetricsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/PercentileTargetsImpl.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/PercentileTargetsImpl.java new file mode 100644 index 000000000000..41e9fd238e5e --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/PercentileTargetsImpl.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.cosmosdb.v2015_04_08.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.PercentileTargets; +import rx.functions.Func1; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.PercentileMetric; + +class PercentileTargetsImpl extends WrapperImpl implements PercentileTargets { + private final CosmosDBManager manager; + + PercentileTargetsImpl(CosmosDBManager manager) { + super(manager.inner().percentileTargets()); + this.manager = manager; + } + + public CosmosDBManager manager() { + return this.manager; + } + + @Override + public Observable listMetricsAsync(String resourceGroupName, String accountName, String targetRegion, String filter) { + PercentileTargetsInner client = this.inner(); + return client.listMetricsAsync(resourceGroupName, accountName, targetRegion, filter) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public PercentileMetric call(PercentileMetricInner inner) { + return new PercentileMetricImpl(inner, manager()); + } + }); + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/PercentileTargetsInner.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/PercentileTargetsInner.java new file mode 100644 index 000000000000..8ef7c42c04c4 --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/PercentileTargetsInner.java @@ -0,0 +1,166 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.cosmosdb.v2015_04_08.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 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.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in PercentileTargets. + */ +public class PercentileTargetsInner { + /** The Retrofit service to perform REST calls. */ + private PercentileTargetsService service; + /** The service client containing this operation class. */ + private CosmosDBManagementClientImpl client; + + /** + * Initializes an instance of PercentileTargetsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public PercentileTargetsInner(Retrofit retrofit, CosmosDBManagementClientImpl client) { + this.service = retrofit.create(PercentileTargetsService.class); + this.client = client; + } + + /** + * The interface defining all the services for PercentileTargets to be + * used by Retrofit to perform actually REST calls. + */ + interface PercentileTargetsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cosmosdb.v2015_04_08.PercentileTargets listMetrics" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/targetRegion/{targetRegion}/percentile/metrics") + Observable> listMetrics(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("targetRegion") String targetRegion, @Query("api-version") String apiVersion, @Query("$filter") String filter, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Retrieves the metrics determined by the given filter for the given account target region. This url is only for PBS and Replication Latency data. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param targetRegion Target region to which data is written. Cosmos DB region, with spaces between words and each word capitalized. + * @param filter An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq. + * @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 List<PercentileMetricInner> object if successful. + */ + public List listMetrics(String resourceGroupName, String accountName, String targetRegion, String filter) { + return listMetricsWithServiceResponseAsync(resourceGroupName, accountName, targetRegion, filter).toBlocking().single().body(); + } + + /** + * Retrieves the metrics determined by the given filter for the given account target region. This url is only for PBS and Replication Latency data. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param targetRegion Target region to which data is written. Cosmos DB region, with spaces between words and each word capitalized. + * @param filter An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq. + * @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> listMetricsAsync(String resourceGroupName, String accountName, String targetRegion, String filter, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listMetricsWithServiceResponseAsync(resourceGroupName, accountName, targetRegion, filter), serviceCallback); + } + + /** + * Retrieves the metrics determined by the given filter for the given account target region. This url is only for PBS and Replication Latency data. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param targetRegion Target region to which data is written. Cosmos DB region, with spaces between words and each word capitalized. + * @param filter An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<PercentileMetricInner> object + */ + public Observable> listMetricsAsync(String resourceGroupName, String accountName, String targetRegion, String filter) { + return listMetricsWithServiceResponseAsync(resourceGroupName, accountName, targetRegion, filter).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Retrieves the metrics determined by the given filter for the given account target region. This url is only for PBS and Replication Latency data. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param targetRegion Target region to which data is written. Cosmos DB region, with spaces between words and each word capitalized. + * @param filter An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<PercentileMetricInner> object + */ + public Observable>> listMetricsWithServiceResponseAsync(String resourceGroupName, String accountName, String targetRegion, String filter) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (targetRegion == null) { + throw new IllegalArgumentException("Parameter targetRegion 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 (filter == null) { + throw new IllegalArgumentException("Parameter filter is required and cannot be null."); + } + return service.listMetrics(this.client.subscriptionId(), resourceGroupName, accountName, targetRegion, this.client.apiVersion(), filter, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listMetricsDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listMetricsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/PercentilesImpl.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/PercentilesImpl.java new file mode 100644 index 000000000000..003a11bf0f6d --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/PercentilesImpl.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.cosmosdb.v2015_04_08.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.Percentiles; +import rx.functions.Func1; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.PercentileMetric; + +class PercentilesImpl extends WrapperImpl implements Percentiles { + private final CosmosDBManager manager; + + PercentilesImpl(CosmosDBManager manager) { + super(manager.inner().percentiles()); + this.manager = manager; + } + + public CosmosDBManager manager() { + return this.manager; + } + + @Override + public Observable listMetricsAsync(String resourceGroupName, String accountName, String filter) { + PercentilesInner client = this.inner(); + return client.listMetricsAsync(resourceGroupName, accountName, filter) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public PercentileMetric call(PercentileMetricInner inner) { + return new PercentileMetricImpl(inner, manager()); + } + }); + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/PercentilesInner.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/PercentilesInner.java new file mode 100644 index 000000000000..fc9d65cc1e7a --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/PercentilesInner.java @@ -0,0 +1,159 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.cosmosdb.v2015_04_08.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 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.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Percentiles. + */ +public class PercentilesInner { + /** The Retrofit service to perform REST calls. */ + private PercentilesService service; + /** The service client containing this operation class. */ + private CosmosDBManagementClientImpl client; + + /** + * Initializes an instance of PercentilesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public PercentilesInner(Retrofit retrofit, CosmosDBManagementClientImpl client) { + this.service = retrofit.create(PercentilesService.class); + this.client = client; + } + + /** + * The interface defining all the services for Percentiles to be + * used by Retrofit to perform actually REST calls. + */ + interface PercentilesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cosmosdb.v2015_04_08.Percentiles listMetrics" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/percentile/metrics") + Observable> listMetrics(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Query("api-version") String apiVersion, @Query("$filter") String filter, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Retrieves the metrics determined by the given filter for the given database account. This url is only for PBS and Replication Latency data. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param filter An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq. + * @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 List<PercentileMetricInner> object if successful. + */ + public List listMetrics(String resourceGroupName, String accountName, String filter) { + return listMetricsWithServiceResponseAsync(resourceGroupName, accountName, filter).toBlocking().single().body(); + } + + /** + * Retrieves the metrics determined by the given filter for the given database account. This url is only for PBS and Replication Latency data. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param filter An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq. + * @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> listMetricsAsync(String resourceGroupName, String accountName, String filter, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listMetricsWithServiceResponseAsync(resourceGroupName, accountName, filter), serviceCallback); + } + + /** + * Retrieves the metrics determined by the given filter for the given database account. This url is only for PBS and Replication Latency data. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param filter An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<PercentileMetricInner> object + */ + public Observable> listMetricsAsync(String resourceGroupName, String accountName, String filter) { + return listMetricsWithServiceResponseAsync(resourceGroupName, accountName, filter).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Retrieves the metrics determined by the given filter for the given database account. This url is only for PBS and Replication Latency data. + * + * @param resourceGroupName Name of an Azure resource group. + * @param accountName Cosmos DB database account name. + * @param filter An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and timeGrain. The supported operator is eq. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<PercentileMetricInner> object + */ + public Observable>> listMetricsWithServiceResponseAsync(String resourceGroupName, String accountName, String filter) { + 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 (accountName == null) { + throw new IllegalArgumentException("Parameter accountName 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 (filter == null) { + throw new IllegalArgumentException("Parameter filter is required and cannot be null."); + } + return service.listMetrics(this.client.subscriptionId(), resourceGroupName, accountName, this.client.apiVersion(), filter, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listMetricsDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listMetricsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/SqlContainerImpl.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/SqlContainerImpl.java new file mode 100644 index 000000000000..c782512855d3 --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/SqlContainerImpl.java @@ -0,0 +1,192 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation; + +import com.microsoft.azure.management.cosmosdb.v2015_04_08.SqlContainer; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.SqlContainerCreateUpdateParameters; +import java.util.Map; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.ConflictResolutionPolicy; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.IndexingPolicy; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.ContainerPartitionKey; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.UniqueKeyPolicy; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.SqlContainerResource; +import rx.functions.Func1; + +class SqlContainerImpl extends CreatableUpdatableImpl implements SqlContainer, SqlContainer.Definition, SqlContainer.Update { + private final CosmosDBManager manager; + private String resourceGroupName; + private String accountName; + private String databaseName; + private String containerName; + private SqlContainerCreateUpdateParameters createOrUpdateParameter; + + SqlContainerImpl(String name, CosmosDBManager manager) { + super(name, new SqlContainerInner()); + this.manager = manager; + // Set resource name + this.containerName = name; + // + this.createOrUpdateParameter = new SqlContainerCreateUpdateParameters(); + } + + SqlContainerImpl(SqlContainerInner inner, CosmosDBManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.containerName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.accountName = IdParsingUtils.getValueFromIdByName(inner.id(), "databaseAccounts"); + this.databaseName = IdParsingUtils.getValueFromIdByName(inner.id(), "databases"); + this.containerName = IdParsingUtils.getValueFromIdByName(inner.id(), "containers"); + // + this.createOrUpdateParameter = new SqlContainerCreateUpdateParameters(); + } + + @Override + public CosmosDBManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + DatabaseAccountsInner client = this.manager().inner().databaseAccounts(); + return client.createUpdateSqlContainerAsync(this.resourceGroupName, this.accountName, this.databaseName, this.containerName, this.createOrUpdateParameter) + .map(new Func1() { + @Override + public SqlContainerInner call(SqlContainerInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + DatabaseAccountsInner client = this.manager().inner().databaseAccounts(); + return client.createUpdateSqlContainerAsync(this.resourceGroupName, this.accountName, this.databaseName, this.containerName, this.createOrUpdateParameter) + .map(new Func1() { + @Override + public SqlContainerInner call(SqlContainerInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + DatabaseAccountsInner client = this.manager().inner().databaseAccounts(); + return client.getSqlContainerAsync(this.resourceGroupName, this.accountName, this.databaseName, this.containerName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.createOrUpdateParameter = new SqlContainerCreateUpdateParameters(); + } + + @Override + public String _etag() { + return this.inner()._etag(); + } + + @Override + public String _rid() { + return this.inner()._rid(); + } + + @Override + public Object _ts() { + return this.inner()._ts(); + } + + @Override + public ConflictResolutionPolicy conflictResolutionPolicy() { + return this.inner().conflictResolutionPolicy(); + } + + @Override + public Integer defaultTtl() { + return this.inner().defaultTtl(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public IndexingPolicy indexingPolicy() { + return this.inner().indexingPolicy(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public ContainerPartitionKey partitionKey() { + return this.inner().partitionKey(); + } + + @Override + public String sqlContainerId() { + return this.inner().sqlContainerId(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public UniqueKeyPolicy uniqueKeyPolicy() { + return this.inner().uniqueKeyPolicy(); + } + + @Override + public SqlContainerImpl withExistingDatabasis(String resourceGroupName, String accountName, String databaseName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + this.databaseName = databaseName; + return this; + } + + @Override + public SqlContainerImpl withOptions(Map options) { + this.createOrUpdateParameter.withOptions(options); + return this; + } + + @Override + public SqlContainerImpl withResource(SqlContainerResource resource) { + this.createOrUpdateParameter.withResource(resource); + return this; + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/SqlContainerInner.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/SqlContainerInner.java new file mode 100644 index 000000000000..1d3e9f8f9300 --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/SqlContainerInner.java @@ -0,0 +1,266 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation; + +import com.microsoft.azure.management.cosmosdb.v2015_04_08.IndexingPolicy; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.ContainerPartitionKey; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.UniqueKeyPolicy; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.ConflictResolutionPolicy; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * An Azure Cosmos DB container. + */ +@JsonFlatten +@SkipParentValidation +public class SqlContainerInner extends Resource { + /** + * Name of the Cosmos DB SQL container. + */ + @JsonProperty(value = "properties.id", required = true) + private String sqlContainerId; + + /** + * The configuration of the indexing policy. By default, the indexing is + * automatic for all document paths within the container. + */ + @JsonProperty(value = "properties.indexingPolicy") + private IndexingPolicy indexingPolicy; + + /** + * The configuration of the partition key to be used for partitioning data + * into multiple partitions. + */ + @JsonProperty(value = "properties.partitionKey") + private ContainerPartitionKey partitionKey; + + /** + * Default time to live. + */ + @JsonProperty(value = "properties.defaultTtl") + private Integer defaultTtl; + + /** + * The unique key policy configuration for specifying uniqueness + * constraints on documents in the collection in the Azure Cosmos DB + * service. + */ + @JsonProperty(value = "properties.uniqueKeyPolicy") + private UniqueKeyPolicy uniqueKeyPolicy; + + /** + * The conflict resolution policy for the container. + */ + @JsonProperty(value = "properties.conflictResolutionPolicy") + private ConflictResolutionPolicy conflictResolutionPolicy; + + /** + * A system generated property. A unique identifier. + */ + @JsonProperty(value = "properties._rid") + private String _rid; + + /** + * A system generated property that denotes the last updated timestamp of + * the resource. + */ + @JsonProperty(value = "properties._ts") + private Object _ts; + + /** + * A system generated property representing the resource etag required for + * optimistic concurrency control. + */ + @JsonProperty(value = "properties._etag") + private String _etag; + + /** + * Get name of the Cosmos DB SQL container. + * + * @return the sqlContainerId value + */ + public String sqlContainerId() { + return this.sqlContainerId; + } + + /** + * Set name of the Cosmos DB SQL container. + * + * @param sqlContainerId the sqlContainerId value to set + * @return the SqlContainerInner object itself. + */ + public SqlContainerInner withSqlContainerId(String sqlContainerId) { + this.sqlContainerId = sqlContainerId; + return this; + } + + /** + * Get the configuration of the indexing policy. By default, the indexing is automatic for all document paths within the container. + * + * @return the indexingPolicy value + */ + public IndexingPolicy indexingPolicy() { + return this.indexingPolicy; + } + + /** + * Set the configuration of the indexing policy. By default, the indexing is automatic for all document paths within the container. + * + * @param indexingPolicy the indexingPolicy value to set + * @return the SqlContainerInner object itself. + */ + public SqlContainerInner withIndexingPolicy(IndexingPolicy indexingPolicy) { + this.indexingPolicy = indexingPolicy; + return this; + } + + /** + * Get the configuration of the partition key to be used for partitioning data into multiple partitions. + * + * @return the partitionKey value + */ + public ContainerPartitionKey partitionKey() { + return this.partitionKey; + } + + /** + * Set the configuration of the partition key to be used for partitioning data into multiple partitions. + * + * @param partitionKey the partitionKey value to set + * @return the SqlContainerInner object itself. + */ + public SqlContainerInner withPartitionKey(ContainerPartitionKey partitionKey) { + this.partitionKey = partitionKey; + return this; + } + + /** + * Get default time to live. + * + * @return the defaultTtl value + */ + public Integer defaultTtl() { + return this.defaultTtl; + } + + /** + * Set default time to live. + * + * @param defaultTtl the defaultTtl value to set + * @return the SqlContainerInner object itself. + */ + public SqlContainerInner withDefaultTtl(Integer defaultTtl) { + this.defaultTtl = defaultTtl; + return this; + } + + /** + * Get the unique key policy configuration for specifying uniqueness constraints on documents in the collection in the Azure Cosmos DB service. + * + * @return the uniqueKeyPolicy value + */ + public UniqueKeyPolicy uniqueKeyPolicy() { + return this.uniqueKeyPolicy; + } + + /** + * Set the unique key policy configuration for specifying uniqueness constraints on documents in the collection in the Azure Cosmos DB service. + * + * @param uniqueKeyPolicy the uniqueKeyPolicy value to set + * @return the SqlContainerInner object itself. + */ + public SqlContainerInner withUniqueKeyPolicy(UniqueKeyPolicy uniqueKeyPolicy) { + this.uniqueKeyPolicy = uniqueKeyPolicy; + return this; + } + + /** + * Get the conflict resolution policy for the container. + * + * @return the conflictResolutionPolicy value + */ + public ConflictResolutionPolicy conflictResolutionPolicy() { + return this.conflictResolutionPolicy; + } + + /** + * Set the conflict resolution policy for the container. + * + * @param conflictResolutionPolicy the conflictResolutionPolicy value to set + * @return the SqlContainerInner object itself. + */ + public SqlContainerInner withConflictResolutionPolicy(ConflictResolutionPolicy conflictResolutionPolicy) { + this.conflictResolutionPolicy = conflictResolutionPolicy; + return this; + } + + /** + * Get a system generated property. A unique identifier. + * + * @return the _rid value + */ + public String _rid() { + return this._rid; + } + + /** + * Set a system generated property. A unique identifier. + * + * @param _rid the _rid value to set + * @return the SqlContainerInner object itself. + */ + public SqlContainerInner with_rid(String _rid) { + this._rid = _rid; + return this; + } + + /** + * Get a system generated property that denotes the last updated timestamp of the resource. + * + * @return the _ts value + */ + public Object _ts() { + return this._ts; + } + + /** + * Set a system generated property that denotes the last updated timestamp of the resource. + * + * @param _ts the _ts value to set + * @return the SqlContainerInner object itself. + */ + public SqlContainerInner with_ts(Object _ts) { + this._ts = _ts; + return this; + } + + /** + * Get a system generated property representing the resource etag required for optimistic concurrency control. + * + * @return the _etag value + */ + public String _etag() { + return this._etag; + } + + /** + * Set a system generated property representing the resource etag required for optimistic concurrency control. + * + * @param _etag the _etag value to set + * @return the SqlContainerInner object itself. + */ + public SqlContainerInner with_etag(String _etag) { + this._etag = _etag; + return this; + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/SqlDatabaseImpl.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/SqlDatabaseImpl.java new file mode 100644 index 000000000000..b0175978d210 --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/SqlDatabaseImpl.java @@ -0,0 +1,170 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation; + +import com.microsoft.azure.management.cosmosdb.v2015_04_08.SqlDatabase; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.SqlDatabaseCreateUpdateParameters; +import java.util.Map; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.SqlDatabaseResource; +import rx.functions.Func1; + +class SqlDatabaseImpl extends CreatableUpdatableImpl implements SqlDatabase, SqlDatabase.Definition, SqlDatabase.Update { + private final CosmosDBManager manager; + private String resourceGroupName; + private String accountName; + private String databaseName; + private SqlDatabaseCreateUpdateParameters createOrUpdateParameter; + + SqlDatabaseImpl(String name, CosmosDBManager manager) { + super(name, new SqlDatabaseInner()); + this.manager = manager; + // Set resource name + this.databaseName = name; + // + this.createOrUpdateParameter = new SqlDatabaseCreateUpdateParameters(); + } + + SqlDatabaseImpl(SqlDatabaseInner inner, CosmosDBManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.databaseName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.accountName = IdParsingUtils.getValueFromIdByName(inner.id(), "databaseAccounts"); + this.databaseName = IdParsingUtils.getValueFromIdByName(inner.id(), "databases"); + // + this.createOrUpdateParameter = new SqlDatabaseCreateUpdateParameters(); + } + + @Override + public CosmosDBManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + DatabaseAccountsInner client = this.manager().inner().databaseAccounts(); + return client.createUpdateSqlDatabaseAsync(this.resourceGroupName, this.accountName, this.databaseName, this.createOrUpdateParameter) + .map(new Func1() { + @Override + public SqlDatabaseInner call(SqlDatabaseInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + DatabaseAccountsInner client = this.manager().inner().databaseAccounts(); + return client.createUpdateSqlDatabaseAsync(this.resourceGroupName, this.accountName, this.databaseName, this.createOrUpdateParameter) + .map(new Func1() { + @Override + public SqlDatabaseInner call(SqlDatabaseInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + DatabaseAccountsInner client = this.manager().inner().databaseAccounts(); + return null; // NOP getInnerAsync implementation as get is not supported + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.createOrUpdateParameter = new SqlDatabaseCreateUpdateParameters(); + } + + @Override + public String _colls() { + return this.inner()._colls(); + } + + @Override + public String _etag() { + return this.inner()._etag(); + } + + @Override + public String _rid() { + return this.inner()._rid(); + } + + @Override + public Object _ts() { + return this.inner()._ts(); + } + + @Override + public String _users() { + return this.inner()._users(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String sqlDatabaseId() { + return this.inner().sqlDatabaseId(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public SqlDatabaseImpl withExistingApi(String resourceGroupName, String accountName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + return this; + } + + @Override + public SqlDatabaseImpl withOptions(Map options) { + this.createOrUpdateParameter.withOptions(options); + return this; + } + + @Override + public SqlDatabaseImpl withResource(SqlDatabaseResource resource) { + this.createOrUpdateParameter.withResource(resource); + return this; + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/SqlDatabaseInner.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/SqlDatabaseInner.java new file mode 100644 index 000000000000..145ab47d32b4 --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/SqlDatabaseInner.java @@ -0,0 +1,182 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * An Azure Cosmos DB SQL database. + */ +@JsonFlatten +@SkipParentValidation +public class SqlDatabaseInner extends Resource { + /** + * Name of the Cosmos DB SQL database. + */ + @JsonProperty(value = "properties.id", required = true) + private String sqlDatabaseId; + + /** + * A system generated property. A unique identifier. + */ + @JsonProperty(value = "properties._rid") + private String _rid; + + /** + * A system generated property that denotes the last updated timestamp of + * the resource. + */ + @JsonProperty(value = "properties._ts") + private Object _ts; + + /** + * A system generated property representing the resource etag required for + * optimistic concurrency control. + */ + @JsonProperty(value = "properties._etag") + private String _etag; + + /** + * A system generated property that specified the addressable path of the + * collections resource. + */ + @JsonProperty(value = "properties._colls") + private String _colls; + + /** + * A system generated property that specifies the addressable path of the + * users resource. + */ + @JsonProperty(value = "properties._users") + private String _users; + + /** + * Get name of the Cosmos DB SQL database. + * + * @return the sqlDatabaseId value + */ + public String sqlDatabaseId() { + return this.sqlDatabaseId; + } + + /** + * Set name of the Cosmos DB SQL database. + * + * @param sqlDatabaseId the sqlDatabaseId value to set + * @return the SqlDatabaseInner object itself. + */ + public SqlDatabaseInner withSqlDatabaseId(String sqlDatabaseId) { + this.sqlDatabaseId = sqlDatabaseId; + return this; + } + + /** + * Get a system generated property. A unique identifier. + * + * @return the _rid value + */ + public String _rid() { + return this._rid; + } + + /** + * Set a system generated property. A unique identifier. + * + * @param _rid the _rid value to set + * @return the SqlDatabaseInner object itself. + */ + public SqlDatabaseInner with_rid(String _rid) { + this._rid = _rid; + return this; + } + + /** + * Get a system generated property that denotes the last updated timestamp of the resource. + * + * @return the _ts value + */ + public Object _ts() { + return this._ts; + } + + /** + * Set a system generated property that denotes the last updated timestamp of the resource. + * + * @param _ts the _ts value to set + * @return the SqlDatabaseInner object itself. + */ + public SqlDatabaseInner with_ts(Object _ts) { + this._ts = _ts; + return this; + } + + /** + * Get a system generated property representing the resource etag required for optimistic concurrency control. + * + * @return the _etag value + */ + public String _etag() { + return this._etag; + } + + /** + * Set a system generated property representing the resource etag required for optimistic concurrency control. + * + * @param _etag the _etag value to set + * @return the SqlDatabaseInner object itself. + */ + public SqlDatabaseInner with_etag(String _etag) { + this._etag = _etag; + return this; + } + + /** + * Get a system generated property that specified the addressable path of the collections resource. + * + * @return the _colls value + */ + public String _colls() { + return this._colls; + } + + /** + * Set a system generated property that specified the addressable path of the collections resource. + * + * @param _colls the _colls value to set + * @return the SqlDatabaseInner object itself. + */ + public SqlDatabaseInner with_colls(String _colls) { + this._colls = _colls; + return this; + } + + /** + * Get a system generated property that specifies the addressable path of the users resource. + * + * @return the _users value + */ + public String _users() { + return this._users; + } + + /** + * Set a system generated property that specifies the addressable path of the users resource. + * + * @param _users the _users value to set + * @return the SqlDatabaseInner object itself. + */ + public SqlDatabaseInner with_users(String _users) { + this._users = _users; + return this; + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/TableImpl.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/TableImpl.java new file mode 100644 index 000000000000..68d3cf4f1bcd --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/TableImpl.java @@ -0,0 +1,145 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation; + +import com.microsoft.azure.management.cosmosdb.v2015_04_08.Table; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.TableCreateUpdateParameters; +import java.util.Map; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.TableResource; +import rx.functions.Func1; + +class TableImpl extends CreatableUpdatableImpl implements Table, Table.Definition, Table.Update { + private final CosmosDBManager manager; + private String resourceGroupName; + private String accountName; + private String tableName; + private TableCreateUpdateParameters createOrUpdateParameter; + + TableImpl(String name, CosmosDBManager manager) { + super(name, new TableInner()); + this.manager = manager; + // Set resource name + this.tableName = name; + // + this.createOrUpdateParameter = new TableCreateUpdateParameters(); + } + + TableImpl(TableInner inner, CosmosDBManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.tableName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.accountName = IdParsingUtils.getValueFromIdByName(inner.id(), "databaseAccounts"); + this.tableName = IdParsingUtils.getValueFromIdByName(inner.id(), "tables"); + // + this.createOrUpdateParameter = new TableCreateUpdateParameters(); + } + + @Override + public CosmosDBManager manager() { + return this.manager; + } + + @Override + public Observable
createResourceAsync() { + DatabaseAccountsInner client = this.manager().inner().databaseAccounts(); + return client.createUpdateTableAsync(this.resourceGroupName, this.accountName, this.tableName, this.createOrUpdateParameter) + .map(new Func1() { + @Override + public TableInner call(TableInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable
updateResourceAsync() { + DatabaseAccountsInner client = this.manager().inner().databaseAccounts(); + return client.createUpdateTableAsync(this.resourceGroupName, this.accountName, this.tableName, this.createOrUpdateParameter) + .map(new Func1() { + @Override + public TableInner call(TableInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + DatabaseAccountsInner client = this.manager().inner().databaseAccounts(); + return null; // NOP getInnerAsync implementation as get is not supported + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.createOrUpdateParameter = new TableCreateUpdateParameters(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String tableId() { + return this.inner().tableId(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public TableImpl withExistingApi(String resourceGroupName, String accountName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + return this; + } + + @Override + public TableImpl withOptions(Map options) { + this.createOrUpdateParameter.withOptions(options); + return this; + } + + @Override + public TableImpl withResource(TableResource resource) { + this.createOrUpdateParameter.withResource(resource); + return this; + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/TableInner.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/TableInner.java new file mode 100644 index 000000000000..c3415273dea0 --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/TableInner.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.cosmosdb.v2015_04_08.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * An Azure Cosmos DB Table. + */ +@JsonFlatten +@SkipParentValidation +public class TableInner extends Resource { + /** + * Name of the Cosmos DB table. + */ + @JsonProperty(value = "properties.id", required = true) + private String tableId; + + /** + * Get name of the Cosmos DB table. + * + * @return the tableId value + */ + public String tableId() { + return this.tableId; + } + + /** + * Set name of the Cosmos DB table. + * + * @param tableId the tableId value to set + * @return the TableInner object itself. + */ + public TableInner withTableId(String tableId) { + this.tableId = tableId; + return this; + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/ThroughputImpl.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/ThroughputImpl.java new file mode 100644 index 000000000000..dce6928c5af9 --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/ThroughputImpl.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.cosmosdb.v2015_04_08.implementation; + +import com.microsoft.azure.management.cosmosdb.v2015_04_08.Throughput; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.Map; + +class ThroughputImpl extends WrapperImpl implements Throughput { + private final CosmosDBManager manager; + ThroughputImpl(ThroughputInner inner, CosmosDBManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public CosmosDBManager manager() { + return this.manager; + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public int throughput() { + return this.inner().throughput(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/ThroughputInner.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/ThroughputInner.java new file mode 100644 index 000000000000..94690342c2b2 --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/ThroughputInner.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.cosmosdb.v2015_04_08.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * An Azure Cosmos DB resource throughput. + */ +@JsonFlatten +@SkipParentValidation +public class ThroughputInner extends Resource { + /** + * Value of the Cosmos DB resource throughput. + */ + @JsonProperty(value = "properties.throughput", required = true) + private int throughput; + + /** + * Get value of the Cosmos DB resource throughput. + * + * @return the throughput value + */ + public int throughput() { + return this.throughput; + } + + /** + * Set value of the Cosmos DB resource throughput. + * + * @param throughput the throughput value to set + * @return the ThroughputInner object itself. + */ + public ThroughputInner withThroughput(int throughput) { + this.throughput = throughput; + return this; + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/UsageInner.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/UsageInner.java new file mode 100644 index 000000000000..6f7c33f24a37 --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/UsageInner.java @@ -0,0 +1,107 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation; + +import com.microsoft.azure.management.cosmosdb.v2015_04_08.UnitType; +import com.microsoft.azure.management.cosmosdb.v2015_04_08.MetricName; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The usage data for a usage request. + */ +public class UsageInner { + /** + * The unit of the metric. Possible values include: 'Count', 'Bytes', + * 'Seconds', 'Percent', 'CountPerSecond', 'BytesPerSecond', + * 'Milliseconds'. + */ + @JsonProperty(value = "unit") + private UnitType unit; + + /** + * The name information for the metric. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private MetricName name; + + /** + * The quota period used to summarize the usage values. + */ + @JsonProperty(value = "quotaPeriod", access = JsonProperty.Access.WRITE_ONLY) + private String quotaPeriod; + + /** + * Maximum value for this metric. + */ + @JsonProperty(value = "limit", access = JsonProperty.Access.WRITE_ONLY) + private Long limit; + + /** + * Current value for this metric. + */ + @JsonProperty(value = "currentValue", access = JsonProperty.Access.WRITE_ONLY) + private Long currentValue; + + /** + * Get the unit of the metric. Possible values include: 'Count', 'Bytes', 'Seconds', 'Percent', 'CountPerSecond', 'BytesPerSecond', 'Milliseconds'. + * + * @return the unit value + */ + public UnitType unit() { + return this.unit; + } + + /** + * Set the unit of the metric. Possible values include: 'Count', 'Bytes', 'Seconds', 'Percent', 'CountPerSecond', 'BytesPerSecond', 'Milliseconds'. + * + * @param unit the unit value to set + * @return the UsageInner object itself. + */ + public UsageInner withUnit(UnitType unit) { + this.unit = unit; + return this; + } + + /** + * Get the name information for the metric. + * + * @return the name value + */ + public MetricName name() { + return this.name; + } + + /** + * Get the quota period used to summarize the usage values. + * + * @return the quotaPeriod value + */ + public String quotaPeriod() { + return this.quotaPeriod; + } + + /** + * Get maximum value for this metric. + * + * @return the limit value + */ + public Long limit() { + return this.limit; + } + + /** + * Get current value for this metric. + * + * @return the currentValue value + */ + public Long currentValue() { + return this.currentValue; + } + +} diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/package-info.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/package-info.java new file mode 100644 index 000000000000..0ea175666c9c --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/package-info.java @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights 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 CosmosDBManagementClient. + * Azure Cosmos DB Database Service Resource Provider REST API. + */ +package com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation; diff --git a/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/package-info.java b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/package-info.java new file mode 100644 index 000000000000..1a3068f98e34 --- /dev/null +++ b/sdk/cosmosdb/mgmt-v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/package-info.java @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights 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 CosmosDBManagementClient. + * Azure Cosmos DB Database Service Resource Provider REST API. + */ +package com.microsoft.azure.management.cosmosdb.v2015_04_08;