Skip to content

Commit

Permalink
CodeGen from PR 13710 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
Merge ac1168040529eb41c9998840e79bbc1c18ae28df into 7a2cc29033fe4027ef421267f1684efbd0d40a93
  • Loading branch information
SDKAuto committed Apr 15, 2021
1 parent 510acb8 commit 2e5b392
Show file tree
Hide file tree
Showing 40 changed files with 9,599 additions and 1,594 deletions.
120 changes: 120 additions & 0 deletions sdk/cosmosdb/arm-cosmosdb/src/cosmosDBManagementClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import * as msRest from "@azure/ms-rest-js";
import * as Models from "./models";
import * as Mappers from "./models/mappers";
import * as Parameters from "./models/parameters";
import * as operations from "./operations";
import { CosmosDBManagementClientContext } from "./cosmosDBManagementClientContext";

Expand All @@ -34,9 +35,19 @@ class CosmosDBManagementClient extends CosmosDBManagementClientContext {
tableResources: operations.TableResources;
cassandraResources: operations.CassandraResources;
gremlinResources: operations.GremlinResources;
restorableDatabaseAccounts: operations.RestorableDatabaseAccounts;
notebookWorkspaces: operations.NotebookWorkspaces;
restorableSqlDatabases: operations.RestorableSqlDatabases;
restorableSqlContainers: operations.RestorableSqlContainers;
restorableSqlResources: operations.RestorableSqlResources;
restorableMongodbDatabases: operations.RestorableMongodbDatabases;
restorableMongodbCollections: operations.RestorableMongodbCollections;
restorableMongodbResources: operations.RestorableMongodbResources;
cassandraClusters: operations.CassandraClusters;
cassandraDataCenters: operations.CassandraDataCenters;
privateLinkResources: operations.PrivateLinkResources;
privateEndpointConnections: operations.PrivateEndpointConnections;
service: operations.Service;

/**
* Initializes a new instance of the CosmosDBManagementClient class.
Expand Down Expand Up @@ -64,13 +75,122 @@ class CosmosDBManagementClient extends CosmosDBManagementClientContext {
this.tableResources = new operations.TableResources(this);
this.cassandraResources = new operations.CassandraResources(this);
this.gremlinResources = new operations.GremlinResources(this);
this.restorableDatabaseAccounts = new operations.RestorableDatabaseAccounts(this);
this.notebookWorkspaces = new operations.NotebookWorkspaces(this);
this.restorableSqlDatabases = new operations.RestorableSqlDatabases(this);
this.restorableSqlContainers = new operations.RestorableSqlContainers(this);
this.restorableSqlResources = new operations.RestorableSqlResources(this);
this.restorableMongodbDatabases = new operations.RestorableMongodbDatabases(this);
this.restorableMongodbCollections = new operations.RestorableMongodbCollections(this);
this.restorableMongodbResources = new operations.RestorableMongodbResources(this);
this.cassandraClusters = new operations.CassandraClusters(this);
this.cassandraDataCenters = new operations.CassandraDataCenters(this);
this.privateLinkResources = new operations.PrivateLinkResources(this);
this.privateEndpointConnections = new operations.PrivateEndpointConnections(this);
this.service = new operations.Service(this);
}

/**
* List Cosmos DB locations and their properties
* @param [options] The optional parameters
* @returns Promise<Models.LocationListResponse>
*/
locationList(options?: msRest.RequestOptionsBase): Promise<Models.LocationListResponse>;
/**
* @param callback The callback
*/
locationList(callback: msRest.ServiceCallback<Models.LocationListResult>): void;
/**
* @param options The optional parameters
* @param callback The callback
*/
locationList(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<Models.LocationListResult>): void;
locationList(options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.LocationListResult>, callback?: msRest.ServiceCallback<Models.LocationListResult>): Promise<Models.LocationListResponse> {
return this.sendOperationRequest(
{
options
},
locationListOperationSpec,
callback) as Promise<Models.LocationListResponse>;
}

/**
* Get the properties of an existing Cosmos DB location
* @param location Cosmos DB region, with spaces between words and each word capitalized.
* @param [options] The optional parameters
* @returns Promise<Models.LocationGetResponse>
*/
locationGet(location: string, options?: msRest.RequestOptionsBase): Promise<Models.LocationGetResponse>;
/**
* @param location Cosmos DB region, with spaces between words and each word capitalized.
* @param callback The callback
*/
locationGet(location: string, callback: msRest.ServiceCallback<Models.LocationGetResult>): void;
/**
* @param location Cosmos DB region, with spaces between words and each word capitalized.
* @param options The optional parameters
* @param callback The callback
*/
locationGet(location: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<Models.LocationGetResult>): void;
locationGet(location: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.LocationGetResult>, callback?: msRest.ServiceCallback<Models.LocationGetResult>): Promise<Models.LocationGetResponse> {
return this.sendOperationRequest(
{
location,
options
},
locationGetOperationSpec,
callback) as Promise<Models.LocationGetResponse>;
}
}

// Operation Specifications
const serializer = new msRest.Serializer(Mappers);
const locationListOperationSpec: msRest.OperationSpec = {
httpMethod: "GET",
path: "subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations",
urlParameters: [
Parameters.subscriptionId
],
queryParameters: [
Parameters.apiVersion
],
headerParameters: [
Parameters.acceptLanguage
],
responses: {
200: {
bodyMapper: Mappers.LocationListResult
},
default: {
bodyMapper: Mappers.CloudError
}
},
serializer
};

const locationGetOperationSpec: msRest.OperationSpec = {
httpMethod: "GET",
path: "subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}",
urlParameters: [
Parameters.subscriptionId,
Parameters.location
],
queryParameters: [
Parameters.apiVersion
],
headerParameters: [
Parameters.acceptLanguage
],
responses: {
200: {
bodyMapper: Mappers.LocationGetResult
},
default: {
bodyMapper: Mappers.CloudError
}
},
serializer
};

export {
CosmosDBManagementClient,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,25 +36,25 @@ export class CosmosDBManagementClientContext extends msRestAzure.AzureServiceCli
if (!options) {
options = {};
}
if (!options.userAgent) {
if(!options.userAgent) {
const defaultUserAgent = msRestAzure.getDefaultUserAgentValue();
options.userAgent = `${packageName}/${packageVersion} ${defaultUserAgent}`;
}

super(credentials, options);

this.apiVersion = '2021-03-15';
this.apiVersion = '2021-04-01-preview';
this.acceptLanguage = 'en-US';
this.longRunningOperationRetryTimeout = 30;
this.baseUri = options.baseUri || this.baseUri || "https://management.azure.com";
this.requestContentType = "application/json; charset=utf-8";
this.credentials = credentials;
this.subscriptionId = subscriptionId;

if (options.acceptLanguage !== null && options.acceptLanguage !== undefined) {
if(options.acceptLanguage !== null && options.acceptLanguage !== undefined) {
this.acceptLanguage = options.acceptLanguage;
}
if (options.longRunningOperationRetryTimeout !== null && options.longRunningOperationRetryTimeout !== undefined) {
if(options.longRunningOperationRetryTimeout !== null && options.longRunningOperationRetryTimeout !== undefined) {
this.longRunningOperationRetryTimeout = options.longRunningOperationRetryTimeout;
}
}
Expand Down
157 changes: 157 additions & 0 deletions sdk/cosmosdb/arm-cosmosdb/src/models/cassandraClustersMappers.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/

export {
discriminators,
ApiProperties,
ARMProxyResource,
ARMResourceProperties,
AutoscaleSettings,
AutoscaleSettingsResource,
AutoUpgradePolicyResource,
AzureEntityResource,
BackupPolicy,
BackupResource,
BackupResourceProperties,
BaseResource,
Capability,
CassandraKeyspaceCreateUpdateParameters,
CassandraKeyspaceGetPropertiesOptions,
CassandraKeyspaceGetPropertiesResource,
CassandraKeyspaceGetResults,
CassandraKeyspaceResource,
CassandraPartitionKey,
CassandraSchema,
CassandraTableCreateUpdateParameters,
CassandraTableGetPropertiesOptions,
CassandraTableGetPropertiesResource,
CassandraTableGetResults,
CassandraTableResource,
Certificate,
CloudError,
ClusterKey,
ClusterNodeStatus,
ClusterNodeStatusNodesItem,
ClusterResource,
ClusterResourceProperties,
Column,
CompositePath,
ConflictResolutionPolicy,
ConsistencyPolicy,
ContainerPartitionKey,
ContinuousModeBackupPolicy,
CorsPolicy,
CreateUpdateOptions,
DatabaseAccountCreateUpdateParameters,
DatabaseAccountCreateUpdateProperties,
DatabaseAccountGetResults,
DatabaseRestoreResource,
DataCenterResource,
DataCenterResourceProperties,
DataTransferRegionalServiceResource,
DataTransferServiceResource,
DefaultRequestDatabaseAccountCreateUpdateProperties,
ErrorResponse,
ExcludedPath,
FailoverPolicy,
GremlinDatabaseCreateUpdateParameters,
GremlinDatabaseGetPropertiesOptions,
GremlinDatabaseGetPropertiesResource,
GremlinDatabaseGetResults,
GremlinDatabaseResource,
GremlinGraphCreateUpdateParameters,
GremlinGraphGetPropertiesOptions,
GremlinGraphGetPropertiesResource,
GremlinGraphGetResults,
GremlinGraphResource,
IncludedPath,
Indexes,
IndexingPolicy,
IpAddressOrRange,
ListBackups,
ListClusters,
Location,
LocationGetResult,
LocationProperties,
ManagedServiceIdentity,
ManagedServiceIdentityUserAssignedIdentitiesValue,
MongoDBCollectionCreateUpdateParameters,
MongoDBCollectionGetPropertiesOptions,
MongoDBCollectionGetPropertiesResource,
MongoDBCollectionGetResults,
MongoDBCollectionResource,
MongoDBDatabaseCreateUpdateParameters,
MongoDBDatabaseGetPropertiesOptions,
MongoDBDatabaseGetPropertiesResource,
MongoDBDatabaseGetResults,
MongoDBDatabaseResource,
MongoIndex,
MongoIndexKeys,
MongoIndexOptions,
NotebookWorkspace,
NotebookWorkspaceCreateUpdateParameters,
OptionsResource,
PeriodicModeBackupPolicy,
PeriodicModeProperties,
Permission,
PrivateEndpointConnection,
PrivateEndpointProperty,
PrivateLinkResource,
PrivateLinkServiceConnectionStateProperty,
ProxyResource,
RegionalServiceResource,
RepairPostBody,
Resource,
RestoreParameters,
RestoreReqeustDatabaseAccountCreateUpdateProperties,
SeedNode,
ServiceResource,
ServicesCreateUpdateParameters,
SpatialSpec,
SqlContainerCreateUpdateParameters,
SqlContainerGetPropertiesOptions,
SqlContainerGetPropertiesResource,
SqlContainerGetResults,
SqlContainerResource,
SqlDatabaseCreateUpdateParameters,
SqlDatabaseGetPropertiesOptions,
SqlDatabaseGetPropertiesResource,
SqlDatabaseGetResults,
SqlDatabaseResource,
SqlDedicatedGatewayRegionalServiceResource,
SqlDedicatedGatewayServiceResource,
SqlRoleAssignmentGetResults,
SqlRoleDefinitionGetResults,
SqlStoredProcedureCreateUpdateParameters,
SqlStoredProcedureGetPropertiesResource,
SqlStoredProcedureGetResults,
SqlStoredProcedureResource,
SqlTriggerCreateUpdateParameters,
SqlTriggerGetPropertiesResource,
SqlTriggerGetResults,
SqlTriggerResource,
SqlUserDefinedFunctionCreateUpdateParameters,
SqlUserDefinedFunctionGetPropertiesResource,
SqlUserDefinedFunctionGetResults,
SqlUserDefinedFunctionResource,
SystemData,
TableCreateUpdateParameters,
TableGetPropertiesOptions,
TableGetPropertiesResource,
TableGetResults,
TableResource,
ThroughputPolicyResource,
ThroughputSettingsGetPropertiesResource,
ThroughputSettingsGetResults,
ThroughputSettingsResource,
ThroughputSettingsUpdateParameters,
TrackedResource,
UniqueKey,
UniqueKeyPolicy,
VirtualNetworkRule
} from "../models/mappers";
Loading

0 comments on commit 2e5b392

Please sign in to comment.