/* AUTOGENERATED FILE Do not manually edit Run "npm run generateARMClients" to regenerate */ import * as Types from "./types"; export class CassandraResourcesClient { private readonly baseUrl = "https://management.azure.com"; private readonly basePath = `/subscriptions/${this.subscriptionId}/resourceGroups/${this.resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/${this.accountName}/cassandraKeyspaces`; constructor( private readonly subscriptionId: string, private readonly resourceGroupName: string, private readonly accountName: string ) {} /* Lists the Cassandra keyspaces under an existing Azure Cosmos DB database account. */ async listCassandraKeyspaces(): Promise { const path = ``; return window.fetch(this.baseUrl + this.basePath + path, { method: "get" }).then(response => response.json()); } /* Gets the Cassandra keyspaces under an existing Azure Cosmos DB database account with the provided name. */ async getCassandraKeyspace(keyspaceName: string): Promise { const path = `/${keyspaceName}`; return window.fetch(this.baseUrl + this.basePath + path, { method: "get" }).then(response => response.json()); } /* Create or update an Azure Cosmos DB Cassandra keyspace */ async createUpdateCassandraKeyspace( keyspaceName: string, body: Types.CassandraKeyspaceCreateUpdateParameters ): Promise { const path = `/${keyspaceName}`; return window .fetch(this.baseUrl + this.basePath + path, { method: "put", body: JSON.stringify(body) }) .then(response => response.json()); } /* Deletes an existing Azure Cosmos DB Cassandra keyspace. */ async deleteCassandraKeyspace(keyspaceName: string): Promise { const path = `/${keyspaceName}`; return window.fetch(this.baseUrl + this.basePath + path, { method: "delete" }).then(response => response.json()); } /* Lists the Cassandra table under an existing Azure Cosmos DB database account. */ async listCassandraTables(keyspaceName: string): Promise { const path = `/${keyspaceName}/tables`; return window.fetch(this.baseUrl + this.basePath + path, { method: "get" }).then(response => response.json()); } /* Gets the Cassandra table under an existing Azure Cosmos DB database account. */ async getCassandraTable(keyspaceName: string, tableName: string): Promise { const path = `/${keyspaceName}/tables/${tableName}`; return window.fetch(this.baseUrl + this.basePath + path, { method: "get" }).then(response => response.json()); } /* Create or update an Azure Cosmos DB Cassandra Table */ async createUpdateCassandraTable( keyspaceName: string, tableName: string, body: Types.CassandraTableCreateUpdateParameters ): Promise { const path = `/${keyspaceName}/tables/${tableName}`; return window .fetch(this.baseUrl + this.basePath + path, { method: "put", body: JSON.stringify(body) }) .then(response => response.json()); } /* Deletes an existing Azure Cosmos DB Cassandra table. */ async deleteCassandraTable(keyspaceName: string, tableName: string): Promise { const path = `/${keyspaceName}/tables/${tableName}`; return window.fetch(this.baseUrl + this.basePath + path, { method: "delete" }).then(response => response.json()); } /* Gets the RUs per second of the Cassandra table under an existing Azure Cosmos DB database account with the provided name. */ async getCassandraTableThroughput( keyspaceName: string, tableName: string ): Promise { const path = `/${keyspaceName}/tables/${tableName}/throughputSettings/default`; return window.fetch(this.baseUrl + this.basePath + path, { method: "get" }).then(response => response.json()); } /* Update RUs per second of an Azure Cosmos DB Cassandra table */ async updateCassandraTableThroughput( keyspaceName: string, tableName: string, body: Types.ThroughputSettingsUpdateParameters ): Promise { const path = `/${keyspaceName}/tables/${tableName}/throughputSettings/default`; return window .fetch(this.baseUrl + this.basePath + path, { method: "put", body: JSON.stringify(body) }) .then(response => response.json()); } /* Gets the RUs per second of the Cassandra Keyspace under an existing Azure Cosmos DB database account with the provided name. */ async getCassandraKeyspaceThroughput(keyspaceName: string): Promise { const path = `/${keyspaceName}/throughputSettings/default`; return window.fetch(this.baseUrl + this.basePath + path, { method: "get" }).then(response => response.json()); } /* Update RUs per second of an Azure Cosmos DB Cassandra Keyspace */ async updateCassandraKeyspaceThroughput( keyspaceName: string, body: Types.ThroughputSettingsUpdateParameters ): Promise { const path = `/${keyspaceName}/throughputSettings/default`; return window .fetch(this.baseUrl + this.basePath + path, { method: "put", body: JSON.stringify(body) }) .then(response => response.json()); } }