mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-18 17:22:45 -05:00
Azure Arc extension (#10400)
Adds an extension for Azure Arc with some initial Postgres pages
This commit is contained in:
43
extensions/arc/src/controller/generated/v1/api/apis.ts
Normal file
43
extensions/arc/src/controller/generated/v1/api/apis.ts
Normal file
@@ -0,0 +1,43 @@
|
||||
export * from './controlRouterApi';
|
||||
export * from './endpointsRouterApi';
|
||||
export * from './homeRouterApi';
|
||||
export * from './hybridDataHomeRouterApi';
|
||||
export * from './infoRouterApi';
|
||||
export * from './logsRouterApi';
|
||||
export * from './metricRouterApi';
|
||||
export * from './registrationRouterApi';
|
||||
export * from './sqlInstanceRouterApi';
|
||||
export * from './sqlOperatorUpgradeRouterApi';
|
||||
export * from './tokenRouterApi';
|
||||
import * as fs from 'fs';
|
||||
import * as http from 'http';
|
||||
import { ControlRouterApi } from './controlRouterApi';
|
||||
import { EndpointsRouterApi } from './endpointsRouterApi';
|
||||
import { HomeRouterApi } from './homeRouterApi';
|
||||
import { HybridDataHomeRouterApi } from './hybridDataHomeRouterApi';
|
||||
import { InfoRouterApi } from './infoRouterApi';
|
||||
import { LogsRouterApi } from './logsRouterApi';
|
||||
import { MetricRouterApi } from './metricRouterApi';
|
||||
import { RegistrationRouterApi } from './registrationRouterApi';
|
||||
import { SqlInstanceRouterApi } from './sqlInstanceRouterApi';
|
||||
import { SqlOperatorUpgradeRouterApi } from './sqlOperatorUpgradeRouterApi';
|
||||
import { TokenRouterApi } from './tokenRouterApi';
|
||||
|
||||
export class HttpError extends Error {
|
||||
constructor (public response: http.IncomingMessage, public body: any, public statusCode?: number) {
|
||||
super('HTTP request failed');
|
||||
this.name = 'HttpError';
|
||||
}
|
||||
}
|
||||
|
||||
export interface RequestDetailedFile {
|
||||
value: Buffer;
|
||||
options?: {
|
||||
filename?: string;
|
||||
contentType?: string;
|
||||
}
|
||||
}
|
||||
|
||||
export type RequestFile = string | Buffer | fs.ReadStream | RequestDetailedFile;
|
||||
|
||||
export const APIS = [ControlRouterApi, EndpointsRouterApi, HomeRouterApi, HybridDataHomeRouterApi, InfoRouterApi, LogsRouterApi, MetricRouterApi, RegistrationRouterApi, SqlInstanceRouterApi, SqlOperatorUpgradeRouterApi, TokenRouterApi];
|
||||
@@ -0,0 +1,396 @@
|
||||
/**
|
||||
* SQL Server Big Data Cluster API
|
||||
* OpenAPI specification for **SQL Server Big Data Cluster**.
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import localVarRequest = require('request');
|
||||
import http = require('http');
|
||||
|
||||
/* tslint:disable:no-unused-locals */
|
||||
import { ClusterPatchModel } from '../model/clusterPatchModel';
|
||||
import { Authentication, HttpBasicAuth, HttpBearerAuth, Interceptor, ObjectSerializer, VoidAuth } from '../model/models';
|
||||
import { ResourceStatusModel } from '../model/resourceStatusModel';
|
||||
import { ServiceStatusModel } from '../model/serviceStatusModel';
|
||||
import { HttpError } from './apis';
|
||||
|
||||
|
||||
|
||||
let defaultBasePath = 'https://0.0.0.0:30080';
|
||||
|
||||
// ===============================================
|
||||
// This file is autogenerated - Please do not edit
|
||||
// ===============================================
|
||||
|
||||
export enum ControlRouterApiApiKeys {
|
||||
}
|
||||
|
||||
export class ControlRouterApi {
|
||||
protected _basePath = defaultBasePath;
|
||||
protected _defaultHeaders : any = {};
|
||||
protected _useQuerystring : boolean = false;
|
||||
|
||||
protected authentications = {
|
||||
'default': <Authentication>new VoidAuth(),
|
||||
'BasicAuth': new HttpBasicAuth(),
|
||||
'BearerAuth': new HttpBearerAuth(),
|
||||
}
|
||||
|
||||
protected interceptors: Interceptor[] = [];
|
||||
|
||||
constructor(basePath?: string);
|
||||
constructor(username: string, password: string, basePath?: string);
|
||||
constructor(basePathOrUsername: string, password?: string, basePath?: string) {
|
||||
if (password) {
|
||||
this.username = basePathOrUsername;
|
||||
this.password = password
|
||||
if (basePath) {
|
||||
this.basePath = basePath;
|
||||
}
|
||||
} else {
|
||||
if (basePathOrUsername) {
|
||||
this.basePath = basePathOrUsername
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
set useQuerystring(value: boolean) {
|
||||
this._useQuerystring = value;
|
||||
}
|
||||
|
||||
set basePath(basePath: string) {
|
||||
this._basePath = basePath;
|
||||
}
|
||||
|
||||
set defaultHeaders(defaultHeaders: any) {
|
||||
this._defaultHeaders = defaultHeaders;
|
||||
}
|
||||
|
||||
get defaultHeaders() {
|
||||
return this._defaultHeaders;
|
||||
}
|
||||
|
||||
get basePath() {
|
||||
return this._basePath;
|
||||
}
|
||||
|
||||
public setDefaultAuthentication(auth: Authentication) {
|
||||
this.authentications.default = auth;
|
||||
}
|
||||
|
||||
public setApiKey(key: ControlRouterApiApiKeys, value: string) {
|
||||
(this.authentications as any)[ControlRouterApiApiKeys[key]].apiKey = value;
|
||||
}
|
||||
|
||||
set username(username: string) {
|
||||
this.authentications.BasicAuth.username = username;
|
||||
}
|
||||
|
||||
set password(password: string) {
|
||||
this.authentications.BasicAuth.password = password;
|
||||
}
|
||||
|
||||
set accessToken(accessToken: string | (() => string)) {
|
||||
this.authentications.BearerAuth.accessToken = accessToken;
|
||||
}
|
||||
|
||||
public addInterceptor(interceptor: Interceptor) {
|
||||
this.interceptors.push(interceptor);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @summary Redirects to the dashboard UI of the specified instance.
|
||||
* @param instanceName The name of the instance for which you want the dashboard.
|
||||
* @param linkType The name of the dashboard UI you would like.
|
||||
*/
|
||||
public async apiV1ControlInstancesInstanceNameStatusLinkTypeUiGet (instanceName: string, linkType: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
|
||||
const localVarPath = this.basePath + '/api/v1/control/instances/{instanceName}/status/{linkType}/ui'
|
||||
.replace('{' + 'instanceName' + '}', encodeURIComponent(String(instanceName)))
|
||||
.replace('{' + 'linkType' + '}', encodeURIComponent(String(linkType)));
|
||||
let localVarQueryParameters: any = {};
|
||||
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
||||
let localVarFormParams: any = {};
|
||||
|
||||
// verify required parameter 'instanceName' is not null or undefined
|
||||
if (instanceName === null || instanceName === undefined) {
|
||||
throw new Error('Required parameter instanceName was null or undefined when calling apiV1ControlInstancesInstanceNameStatusLinkTypeUiGet.');
|
||||
}
|
||||
|
||||
// verify required parameter 'linkType' is not null or undefined
|
||||
if (linkType === null || linkType === undefined) {
|
||||
throw new Error('Required parameter linkType was null or undefined when calling apiV1ControlInstancesInstanceNameStatusLinkTypeUiGet.');
|
||||
}
|
||||
|
||||
(<any>Object).assign(localVarHeaderParams, options.headers);
|
||||
|
||||
let localVarUseFormData = false;
|
||||
|
||||
let localVarRequestOptions: localVarRequest.Options = {
|
||||
method: 'GET',
|
||||
qs: localVarQueryParameters,
|
||||
headers: localVarHeaderParams,
|
||||
uri: localVarPath,
|
||||
useQuerystring: this._useQuerystring,
|
||||
json: true,
|
||||
};
|
||||
|
||||
let authenticationPromise = Promise.resolve();
|
||||
if (this.authentications.BasicAuth.username && this.authentications.BasicAuth.password) {
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.BasicAuth.applyToRequest(localVarRequestOptions));
|
||||
}
|
||||
if (this.authentications.BearerAuth.accessToken) {
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.BearerAuth.applyToRequest(localVarRequestOptions));
|
||||
}
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
||||
|
||||
let interceptorPromise = authenticationPromise;
|
||||
for (const interceptor of this.interceptors) {
|
||||
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
||||
}
|
||||
|
||||
return interceptorPromise.then(() => {
|
||||
if (Object.keys(localVarFormParams).length) {
|
||||
if (localVarUseFormData) {
|
||||
(<any>localVarRequestOptions).formData = localVarFormParams;
|
||||
} else {
|
||||
localVarRequestOptions.form = localVarFormParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => {
|
||||
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
} else {
|
||||
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
||||
resolve({ response: response, body: body });
|
||||
} else {
|
||||
reject(new HttpError(response, body, response.statusCode));
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @summary Upgrades the control plane.
|
||||
* @param clusterPatchModel
|
||||
*/
|
||||
public async apiV1ControlPatch (clusterPatchModel?: ClusterPatchModel, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
|
||||
const localVarPath = this.basePath + '/api/v1/control';
|
||||
let localVarQueryParameters: any = {};
|
||||
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
||||
let localVarFormParams: any = {};
|
||||
|
||||
(<any>Object).assign(localVarHeaderParams, options.headers);
|
||||
|
||||
let localVarUseFormData = false;
|
||||
|
||||
let localVarRequestOptions: localVarRequest.Options = {
|
||||
method: 'PATCH',
|
||||
qs: localVarQueryParameters,
|
||||
headers: localVarHeaderParams,
|
||||
uri: localVarPath,
|
||||
useQuerystring: this._useQuerystring,
|
||||
json: true,
|
||||
body: ObjectSerializer.serialize(clusterPatchModel, "ClusterPatchModel")
|
||||
};
|
||||
|
||||
let authenticationPromise = Promise.resolve();
|
||||
if (this.authentications.BasicAuth.username && this.authentications.BasicAuth.password) {
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.BasicAuth.applyToRequest(localVarRequestOptions));
|
||||
}
|
||||
if (this.authentications.BearerAuth.accessToken) {
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.BearerAuth.applyToRequest(localVarRequestOptions));
|
||||
}
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
||||
|
||||
let interceptorPromise = authenticationPromise;
|
||||
for (const interceptor of this.interceptors) {
|
||||
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
||||
}
|
||||
|
||||
return interceptorPromise.then(() => {
|
||||
if (Object.keys(localVarFormParams).length) {
|
||||
if (localVarUseFormData) {
|
||||
(<any>localVarRequestOptions).formData = localVarFormParams;
|
||||
} else {
|
||||
localVarRequestOptions.form = localVarFormParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => {
|
||||
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
} else {
|
||||
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
||||
resolve({ response: response, body: body });
|
||||
} else {
|
||||
reject(new HttpError(response, body, response.statusCode));
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @summary Gets the status of the specified resource within the control plane.
|
||||
* @param resourceName The name of the resource you would like the status of.
|
||||
* @param all Whether you want all instances of all resources.
|
||||
*/
|
||||
public async apiV1ControlResourcesResourceNameStatusGet (resourceName: string, all?: boolean, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ResourceStatusModel; }> {
|
||||
const localVarPath = this.basePath + '/api/v1/control/resources/{resourceName}/status'
|
||||
.replace('{' + 'resourceName' + '}', encodeURIComponent(String(resourceName)));
|
||||
let localVarQueryParameters: any = {};
|
||||
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
||||
const produces = ['text/plain', 'application/json', 'text/json'];
|
||||
// give precedence to 'application/json'
|
||||
if (produces.indexOf('application/json') >= 0) {
|
||||
localVarHeaderParams.Accept = 'application/json';
|
||||
} else {
|
||||
localVarHeaderParams.Accept = produces.join(',');
|
||||
}
|
||||
let localVarFormParams: any = {};
|
||||
|
||||
// verify required parameter 'resourceName' is not null or undefined
|
||||
if (resourceName === null || resourceName === undefined) {
|
||||
throw new Error('Required parameter resourceName was null or undefined when calling apiV1ControlResourcesResourceNameStatusGet.');
|
||||
}
|
||||
|
||||
if (all !== undefined) {
|
||||
localVarQueryParameters['all'] = ObjectSerializer.serialize(all, "boolean");
|
||||
}
|
||||
|
||||
(<any>Object).assign(localVarHeaderParams, options.headers);
|
||||
|
||||
let localVarUseFormData = false;
|
||||
|
||||
let localVarRequestOptions: localVarRequest.Options = {
|
||||
method: 'GET',
|
||||
qs: localVarQueryParameters,
|
||||
headers: localVarHeaderParams,
|
||||
uri: localVarPath,
|
||||
useQuerystring: this._useQuerystring,
|
||||
json: true,
|
||||
};
|
||||
|
||||
let authenticationPromise = Promise.resolve();
|
||||
if (this.authentications.BasicAuth.username && this.authentications.BasicAuth.password) {
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.BasicAuth.applyToRequest(localVarRequestOptions));
|
||||
}
|
||||
if (this.authentications.BearerAuth.accessToken) {
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.BearerAuth.applyToRequest(localVarRequestOptions));
|
||||
}
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
||||
|
||||
let interceptorPromise = authenticationPromise;
|
||||
for (const interceptor of this.interceptors) {
|
||||
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
||||
}
|
||||
|
||||
return interceptorPromise.then(() => {
|
||||
if (Object.keys(localVarFormParams).length) {
|
||||
if (localVarUseFormData) {
|
||||
(<any>localVarRequestOptions).formData = localVarFormParams;
|
||||
} else {
|
||||
localVarRequestOptions.form = localVarFormParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.IncomingMessage; body: ResourceStatusModel; }>((resolve, reject) => {
|
||||
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
} else {
|
||||
body = ObjectSerializer.deserialize(body, "ResourceStatusModel");
|
||||
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
||||
resolve({ response: response, body: body });
|
||||
} else {
|
||||
reject(new HttpError(response, body, response.statusCode));
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @summary Gets the status of the control plane.
|
||||
* @param all Whether you want all instances of all resources.
|
||||
*/
|
||||
public async apiV1ControlStatusGet (all?: boolean, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Array<ServiceStatusModel>; }> {
|
||||
const localVarPath = this.basePath + '/api/v1/control/status';
|
||||
let localVarQueryParameters: any = {};
|
||||
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
||||
const produces = ['text/plain', 'application/json', 'text/json'];
|
||||
// give precedence to 'application/json'
|
||||
if (produces.indexOf('application/json') >= 0) {
|
||||
localVarHeaderParams.Accept = 'application/json';
|
||||
} else {
|
||||
localVarHeaderParams.Accept = produces.join(',');
|
||||
}
|
||||
let localVarFormParams: any = {};
|
||||
|
||||
if (all !== undefined) {
|
||||
localVarQueryParameters['all'] = ObjectSerializer.serialize(all, "boolean");
|
||||
}
|
||||
|
||||
(<any>Object).assign(localVarHeaderParams, options.headers);
|
||||
|
||||
let localVarUseFormData = false;
|
||||
|
||||
let localVarRequestOptions: localVarRequest.Options = {
|
||||
method: 'GET',
|
||||
qs: localVarQueryParameters,
|
||||
headers: localVarHeaderParams,
|
||||
uri: localVarPath,
|
||||
useQuerystring: this._useQuerystring,
|
||||
json: true,
|
||||
};
|
||||
|
||||
let authenticationPromise = Promise.resolve();
|
||||
if (this.authentications.BasicAuth.username && this.authentications.BasicAuth.password) {
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.BasicAuth.applyToRequest(localVarRequestOptions));
|
||||
}
|
||||
if (this.authentications.BearerAuth.accessToken) {
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.BearerAuth.applyToRequest(localVarRequestOptions));
|
||||
}
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
||||
|
||||
let interceptorPromise = authenticationPromise;
|
||||
for (const interceptor of this.interceptors) {
|
||||
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
||||
}
|
||||
|
||||
return interceptorPromise.then(() => {
|
||||
if (Object.keys(localVarFormParams).length) {
|
||||
if (localVarUseFormData) {
|
||||
(<any>localVarRequestOptions).formData = localVarFormParams;
|
||||
} else {
|
||||
localVarRequestOptions.form = localVarFormParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.IncomingMessage; body: Array<ServiceStatusModel>; }>((resolve, reject) => {
|
||||
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
} else {
|
||||
body = ObjectSerializer.deserialize(body, "Array<ServiceStatusModel>");
|
||||
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
||||
resolve({ response: response, body: body });
|
||||
} else {
|
||||
reject(new HttpError(response, body, response.statusCode));
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,248 @@
|
||||
/**
|
||||
* SQL Server Big Data Cluster API
|
||||
* OpenAPI specification for **SQL Server Big Data Cluster**.
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import localVarRequest = require('request');
|
||||
import http = require('http');
|
||||
|
||||
/* tslint:disable:no-unused-locals */
|
||||
import { EndpointModel } from '../model/endpointModel';
|
||||
import { Authentication, HttpBasicAuth, HttpBearerAuth, Interceptor, ObjectSerializer, VoidAuth } from '../model/models';
|
||||
import { HttpError } from './apis';
|
||||
|
||||
|
||||
|
||||
let defaultBasePath = 'https://0.0.0.0:30080';
|
||||
|
||||
// ===============================================
|
||||
// This file is autogenerated - Please do not edit
|
||||
// ===============================================
|
||||
|
||||
export enum EndpointsRouterApiApiKeys {
|
||||
}
|
||||
|
||||
export class EndpointsRouterApi {
|
||||
protected _basePath = defaultBasePath;
|
||||
protected _defaultHeaders : any = {};
|
||||
protected _useQuerystring : boolean = false;
|
||||
|
||||
protected authentications = {
|
||||
'default': <Authentication>new VoidAuth(),
|
||||
'BasicAuth': new HttpBasicAuth(),
|
||||
'BearerAuth': new HttpBearerAuth(),
|
||||
}
|
||||
|
||||
protected interceptors: Interceptor[] = [];
|
||||
|
||||
constructor(basePath?: string);
|
||||
constructor(username: string, password: string, basePath?: string);
|
||||
constructor(basePathOrUsername: string, password?: string, basePath?: string) {
|
||||
if (password) {
|
||||
this.username = basePathOrUsername;
|
||||
this.password = password
|
||||
if (basePath) {
|
||||
this.basePath = basePath;
|
||||
}
|
||||
} else {
|
||||
if (basePathOrUsername) {
|
||||
this.basePath = basePathOrUsername
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
set useQuerystring(value: boolean) {
|
||||
this._useQuerystring = value;
|
||||
}
|
||||
|
||||
set basePath(basePath: string) {
|
||||
this._basePath = basePath;
|
||||
}
|
||||
|
||||
set defaultHeaders(defaultHeaders: any) {
|
||||
this._defaultHeaders = defaultHeaders;
|
||||
}
|
||||
|
||||
get defaultHeaders() {
|
||||
return this._defaultHeaders;
|
||||
}
|
||||
|
||||
get basePath() {
|
||||
return this._basePath;
|
||||
}
|
||||
|
||||
public setDefaultAuthentication(auth: Authentication) {
|
||||
this.authentications.default = auth;
|
||||
}
|
||||
|
||||
public setApiKey(key: EndpointsRouterApiApiKeys, value: string) {
|
||||
(this.authentications as any)[EndpointsRouterApiApiKeys[key]].apiKey = value;
|
||||
}
|
||||
|
||||
set username(username: string) {
|
||||
this.authentications.BasicAuth.username = username;
|
||||
}
|
||||
|
||||
set password(password: string) {
|
||||
this.authentications.BasicAuth.password = password;
|
||||
}
|
||||
|
||||
set accessToken(accessToken: string | (() => string)) {
|
||||
this.authentications.BearerAuth.accessToken = accessToken;
|
||||
}
|
||||
|
||||
public addInterceptor(interceptor: Interceptor) {
|
||||
this.interceptors.push(interceptor);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @summary Gets the endpoint with the specified name.
|
||||
* @param endpointName The name of the endpoint you want.
|
||||
*/
|
||||
public async apiV1BdcEndpointsEndpointNameGet (endpointName: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: EndpointModel; }> {
|
||||
const localVarPath = this.basePath + '/api/v1/bdc/endpoints/{endpointName}'
|
||||
.replace('{' + 'endpointName' + '}', encodeURIComponent(String(endpointName)));
|
||||
let localVarQueryParameters: any = {};
|
||||
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
||||
const produces = ['text/plain', 'application/json', 'text/json'];
|
||||
// give precedence to 'application/json'
|
||||
if (produces.indexOf('application/json') >= 0) {
|
||||
localVarHeaderParams.Accept = 'application/json';
|
||||
} else {
|
||||
localVarHeaderParams.Accept = produces.join(',');
|
||||
}
|
||||
let localVarFormParams: any = {};
|
||||
|
||||
// verify required parameter 'endpointName' is not null or undefined
|
||||
if (endpointName === null || endpointName === undefined) {
|
||||
throw new Error('Required parameter endpointName was null or undefined when calling apiV1BdcEndpointsEndpointNameGet.');
|
||||
}
|
||||
|
||||
(<any>Object).assign(localVarHeaderParams, options.headers);
|
||||
|
||||
let localVarUseFormData = false;
|
||||
|
||||
let localVarRequestOptions: localVarRequest.Options = {
|
||||
method: 'GET',
|
||||
qs: localVarQueryParameters,
|
||||
headers: localVarHeaderParams,
|
||||
uri: localVarPath,
|
||||
useQuerystring: this._useQuerystring,
|
||||
json: true,
|
||||
};
|
||||
|
||||
let authenticationPromise = Promise.resolve();
|
||||
if (this.authentications.BasicAuth.username && this.authentications.BasicAuth.password) {
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.BasicAuth.applyToRequest(localVarRequestOptions));
|
||||
}
|
||||
if (this.authentications.BearerAuth.accessToken) {
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.BearerAuth.applyToRequest(localVarRequestOptions));
|
||||
}
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
||||
|
||||
let interceptorPromise = authenticationPromise;
|
||||
for (const interceptor of this.interceptors) {
|
||||
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
||||
}
|
||||
|
||||
return interceptorPromise.then(() => {
|
||||
if (Object.keys(localVarFormParams).length) {
|
||||
if (localVarUseFormData) {
|
||||
(<any>localVarRequestOptions).formData = localVarFormParams;
|
||||
} else {
|
||||
localVarRequestOptions.form = localVarFormParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.IncomingMessage; body: EndpointModel; }>((resolve, reject) => {
|
||||
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
} else {
|
||||
body = ObjectSerializer.deserialize(body, "EndpointModel");
|
||||
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
||||
resolve({ response: response, body: body });
|
||||
} else {
|
||||
reject(new HttpError(response, body, response.statusCode));
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @summary Gets the endpoints of the cluster.
|
||||
*/
|
||||
public async apiV1BdcEndpointsGet (options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Array<EndpointModel>; }> {
|
||||
const localVarPath = this.basePath + '/api/v1/bdc/endpoints';
|
||||
let localVarQueryParameters: any = {};
|
||||
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
||||
const produces = ['text/plain', 'application/json', 'text/json'];
|
||||
// give precedence to 'application/json'
|
||||
if (produces.indexOf('application/json') >= 0) {
|
||||
localVarHeaderParams.Accept = 'application/json';
|
||||
} else {
|
||||
localVarHeaderParams.Accept = produces.join(',');
|
||||
}
|
||||
let localVarFormParams: any = {};
|
||||
|
||||
(<any>Object).assign(localVarHeaderParams, options.headers);
|
||||
|
||||
let localVarUseFormData = false;
|
||||
|
||||
let localVarRequestOptions: localVarRequest.Options = {
|
||||
method: 'GET',
|
||||
qs: localVarQueryParameters,
|
||||
headers: localVarHeaderParams,
|
||||
uri: localVarPath,
|
||||
useQuerystring: this._useQuerystring,
|
||||
json: true,
|
||||
};
|
||||
|
||||
let authenticationPromise = Promise.resolve();
|
||||
if (this.authentications.BasicAuth.username && this.authentications.BasicAuth.password) {
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.BasicAuth.applyToRequest(localVarRequestOptions));
|
||||
}
|
||||
if (this.authentications.BearerAuth.accessToken) {
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.BearerAuth.applyToRequest(localVarRequestOptions));
|
||||
}
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
||||
|
||||
let interceptorPromise = authenticationPromise;
|
||||
for (const interceptor of this.interceptors) {
|
||||
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
||||
}
|
||||
|
||||
return interceptorPromise.then(() => {
|
||||
if (Object.keys(localVarFormParams).length) {
|
||||
if (localVarUseFormData) {
|
||||
(<any>localVarRequestOptions).formData = localVarFormParams;
|
||||
} else {
|
||||
localVarRequestOptions.form = localVarFormParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.IncomingMessage; body: Array<EndpointModel>; }>((resolve, reject) => {
|
||||
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
} else {
|
||||
body = ObjectSerializer.deserialize(body, "Array<EndpointModel>");
|
||||
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
||||
resolve({ response: response, body: body });
|
||||
} else {
|
||||
reject(new HttpError(response, body, response.statusCode));
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
224
extensions/arc/src/controller/generated/v1/api/homeRouterApi.ts
Normal file
224
extensions/arc/src/controller/generated/v1/api/homeRouterApi.ts
Normal file
@@ -0,0 +1,224 @@
|
||||
/**
|
||||
* SQL Server Big Data Cluster API
|
||||
* OpenAPI specification for **SQL Server Big Data Cluster**.
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import localVarRequest = require('request');
|
||||
import http = require('http');
|
||||
|
||||
/* tslint:disable:no-unused-locals */
|
||||
|
||||
import { Authentication, HttpBasicAuth, HttpBearerAuth, Interceptor, VoidAuth } from '../model/models';
|
||||
import { HttpError } from './apis';
|
||||
|
||||
|
||||
let defaultBasePath = 'https://0.0.0.0:30080';
|
||||
|
||||
// ===============================================
|
||||
// This file is autogenerated - Please do not edit
|
||||
// ===============================================
|
||||
|
||||
export enum HomeRouterApiApiKeys {
|
||||
}
|
||||
|
||||
export class HomeRouterApi {
|
||||
protected _basePath = defaultBasePath;
|
||||
protected _defaultHeaders : any = {};
|
||||
protected _useQuerystring : boolean = false;
|
||||
|
||||
protected authentications = {
|
||||
'default': <Authentication>new VoidAuth(),
|
||||
'BasicAuth': new HttpBasicAuth(),
|
||||
'BearerAuth': new HttpBearerAuth(),
|
||||
}
|
||||
|
||||
protected interceptors: Interceptor[] = [];
|
||||
|
||||
constructor(basePath?: string);
|
||||
constructor(username: string, password: string, basePath?: string);
|
||||
constructor(basePathOrUsername: string, password?: string, basePath?: string) {
|
||||
if (password) {
|
||||
this.username = basePathOrUsername;
|
||||
this.password = password
|
||||
if (basePath) {
|
||||
this.basePath = basePath;
|
||||
}
|
||||
} else {
|
||||
if (basePathOrUsername) {
|
||||
this.basePath = basePathOrUsername
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
set useQuerystring(value: boolean) {
|
||||
this._useQuerystring = value;
|
||||
}
|
||||
|
||||
set basePath(basePath: string) {
|
||||
this._basePath = basePath;
|
||||
}
|
||||
|
||||
set defaultHeaders(defaultHeaders: any) {
|
||||
this._defaultHeaders = defaultHeaders;
|
||||
}
|
||||
|
||||
get defaultHeaders() {
|
||||
return this._defaultHeaders;
|
||||
}
|
||||
|
||||
get basePath() {
|
||||
return this._basePath;
|
||||
}
|
||||
|
||||
public setDefaultAuthentication(auth: Authentication) {
|
||||
this.authentications.default = auth;
|
||||
}
|
||||
|
||||
public setApiKey(key: HomeRouterApiApiKeys, value: string) {
|
||||
(this.authentications as any)[HomeRouterApiApiKeys[key]].apiKey = value;
|
||||
}
|
||||
|
||||
set username(username: string) {
|
||||
this.authentications.BasicAuth.username = username;
|
||||
}
|
||||
|
||||
set password(password: string) {
|
||||
this.authentications.BasicAuth.password = password;
|
||||
}
|
||||
|
||||
set accessToken(accessToken: string | (() => string)) {
|
||||
this.authentications.BearerAuth.accessToken = accessToken;
|
||||
}
|
||||
|
||||
public addInterceptor(interceptor: Interceptor) {
|
||||
this.interceptors.push(interceptor);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @summary Retrieves home page of controller service.
|
||||
*/
|
||||
public async apiV1Get (options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
|
||||
const localVarPath = this.basePath + '/api/v1';
|
||||
let localVarQueryParameters: any = {};
|
||||
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
||||
let localVarFormParams: any = {};
|
||||
|
||||
(<any>Object).assign(localVarHeaderParams, options.headers);
|
||||
|
||||
let localVarUseFormData = false;
|
||||
|
||||
let localVarRequestOptions: localVarRequest.Options = {
|
||||
method: 'GET',
|
||||
qs: localVarQueryParameters,
|
||||
headers: localVarHeaderParams,
|
||||
uri: localVarPath,
|
||||
useQuerystring: this._useQuerystring,
|
||||
json: true,
|
||||
};
|
||||
|
||||
let authenticationPromise = Promise.resolve();
|
||||
if (this.authentications.BasicAuth.username && this.authentications.BasicAuth.password) {
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.BasicAuth.applyToRequest(localVarRequestOptions));
|
||||
}
|
||||
if (this.authentications.BearerAuth.accessToken) {
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.BearerAuth.applyToRequest(localVarRequestOptions));
|
||||
}
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
||||
|
||||
let interceptorPromise = authenticationPromise;
|
||||
for (const interceptor of this.interceptors) {
|
||||
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
||||
}
|
||||
|
||||
return interceptorPromise.then(() => {
|
||||
if (Object.keys(localVarFormParams).length) {
|
||||
if (localVarUseFormData) {
|
||||
(<any>localVarRequestOptions).formData = localVarFormParams;
|
||||
} else {
|
||||
localVarRequestOptions.form = localVarFormParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => {
|
||||
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
} else {
|
||||
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
||||
resolve({ response: response, body: body });
|
||||
} else {
|
||||
reject(new HttpError(response, body, response.statusCode));
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @summary Determines if the controller is available.
|
||||
*/
|
||||
public async apiV1PingGet (options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
|
||||
const localVarPath = this.basePath + '/api/v1/ping';
|
||||
let localVarQueryParameters: any = {};
|
||||
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
||||
let localVarFormParams: any = {};
|
||||
|
||||
(<any>Object).assign(localVarHeaderParams, options.headers);
|
||||
|
||||
let localVarUseFormData = false;
|
||||
|
||||
let localVarRequestOptions: localVarRequest.Options = {
|
||||
method: 'GET',
|
||||
qs: localVarQueryParameters,
|
||||
headers: localVarHeaderParams,
|
||||
uri: localVarPath,
|
||||
useQuerystring: this._useQuerystring,
|
||||
json: true,
|
||||
};
|
||||
|
||||
let authenticationPromise = Promise.resolve();
|
||||
if (this.authentications.BasicAuth.username && this.authentications.BasicAuth.password) {
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.BasicAuth.applyToRequest(localVarRequestOptions));
|
||||
}
|
||||
if (this.authentications.BearerAuth.accessToken) {
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.BearerAuth.applyToRequest(localVarRequestOptions));
|
||||
}
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
||||
|
||||
let interceptorPromise = authenticationPromise;
|
||||
for (const interceptor of this.interceptors) {
|
||||
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
||||
}
|
||||
|
||||
return interceptorPromise.then(() => {
|
||||
if (Object.keys(localVarFormParams).length) {
|
||||
if (localVarUseFormData) {
|
||||
(<any>localVarRequestOptions).formData = localVarFormParams;
|
||||
} else {
|
||||
localVarRequestOptions.form = localVarFormParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => {
|
||||
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
} else {
|
||||
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
||||
resolve({ response: response, body: body });
|
||||
} else {
|
||||
reject(new HttpError(response, body, response.statusCode));
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,222 @@
|
||||
/**
|
||||
* SQL Server Big Data Cluster API
|
||||
* OpenAPI specification for **SQL Server Big Data Cluster**.
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import localVarRequest = require('request');
|
||||
import http = require('http');
|
||||
|
||||
/* tslint:disable:no-unused-locals */
|
||||
|
||||
import { Authentication, HttpBasicAuth, HttpBearerAuth, Interceptor, VoidAuth } from '../model/models';
|
||||
import { HttpError } from './apis';
|
||||
|
||||
|
||||
let defaultBasePath = 'https://0.0.0.0:30080';
|
||||
|
||||
// ===============================================
|
||||
// This file is autogenerated - Please do not edit
|
||||
// ===============================================
|
||||
|
||||
export enum HybridDataHomeRouterApiApiKeys {
|
||||
}
|
||||
|
||||
export class HybridDataHomeRouterApi {
|
||||
protected _basePath = defaultBasePath;
|
||||
protected _defaultHeaders : any = {};
|
||||
protected _useQuerystring : boolean = false;
|
||||
|
||||
protected authentications = {
|
||||
'default': <Authentication>new VoidAuth(),
|
||||
'BasicAuth': new HttpBasicAuth(),
|
||||
'BearerAuth': new HttpBearerAuth(),
|
||||
}
|
||||
|
||||
protected interceptors: Interceptor[] = [];
|
||||
|
||||
constructor(basePath?: string);
|
||||
constructor(username: string, password: string, basePath?: string);
|
||||
constructor(basePathOrUsername: string, password?: string, basePath?: string) {
|
||||
if (password) {
|
||||
this.username = basePathOrUsername;
|
||||
this.password = password
|
||||
if (basePath) {
|
||||
this.basePath = basePath;
|
||||
}
|
||||
} else {
|
||||
if (basePathOrUsername) {
|
||||
this.basePath = basePathOrUsername
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
set useQuerystring(value: boolean) {
|
||||
this._useQuerystring = value;
|
||||
}
|
||||
|
||||
set basePath(basePath: string) {
|
||||
this._basePath = basePath;
|
||||
}
|
||||
|
||||
set defaultHeaders(defaultHeaders: any) {
|
||||
this._defaultHeaders = defaultHeaders;
|
||||
}
|
||||
|
||||
get defaultHeaders() {
|
||||
return this._defaultHeaders;
|
||||
}
|
||||
|
||||
get basePath() {
|
||||
return this._basePath;
|
||||
}
|
||||
|
||||
public setDefaultAuthentication(auth: Authentication) {
|
||||
this.authentications.default = auth;
|
||||
}
|
||||
|
||||
public setApiKey(key: HybridDataHomeRouterApiApiKeys, value: string) {
|
||||
(this.authentications as any)[HybridDataHomeRouterApiApiKeys[key]].apiKey = value;
|
||||
}
|
||||
|
||||
set username(username: string) {
|
||||
this.authentications.BasicAuth.username = username;
|
||||
}
|
||||
|
||||
set password(password: string) {
|
||||
this.authentications.BasicAuth.password = password;
|
||||
}
|
||||
|
||||
set accessToken(accessToken: string | (() => string)) {
|
||||
this.authentications.BearerAuth.accessToken = accessToken;
|
||||
}
|
||||
|
||||
public addInterceptor(interceptor: Interceptor) {
|
||||
this.interceptors.push(interceptor);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public async apiV1HybridGet (options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
|
||||
const localVarPath = this.basePath + '/api/v1/hybrid';
|
||||
let localVarQueryParameters: any = {};
|
||||
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
||||
let localVarFormParams: any = {};
|
||||
|
||||
(<any>Object).assign(localVarHeaderParams, options.headers);
|
||||
|
||||
let localVarUseFormData = false;
|
||||
|
||||
let localVarRequestOptions: localVarRequest.Options = {
|
||||
method: 'GET',
|
||||
qs: localVarQueryParameters,
|
||||
headers: localVarHeaderParams,
|
||||
uri: localVarPath,
|
||||
useQuerystring: this._useQuerystring,
|
||||
json: true,
|
||||
};
|
||||
|
||||
let authenticationPromise = Promise.resolve();
|
||||
if (this.authentications.BasicAuth.username && this.authentications.BasicAuth.password) {
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.BasicAuth.applyToRequest(localVarRequestOptions));
|
||||
}
|
||||
if (this.authentications.BearerAuth.accessToken) {
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.BearerAuth.applyToRequest(localVarRequestOptions));
|
||||
}
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
||||
|
||||
let interceptorPromise = authenticationPromise;
|
||||
for (const interceptor of this.interceptors) {
|
||||
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
||||
}
|
||||
|
||||
return interceptorPromise.then(() => {
|
||||
if (Object.keys(localVarFormParams).length) {
|
||||
if (localVarUseFormData) {
|
||||
(<any>localVarRequestOptions).formData = localVarFormParams;
|
||||
} else {
|
||||
localVarRequestOptions.form = localVarFormParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => {
|
||||
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
} else {
|
||||
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
||||
resolve({ response: response, body: body });
|
||||
} else {
|
||||
reject(new HttpError(response, body, response.statusCode));
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public async apiV1HybridPingGet (options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
|
||||
const localVarPath = this.basePath + '/api/v1/hybrid/ping';
|
||||
let localVarQueryParameters: any = {};
|
||||
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
||||
let localVarFormParams: any = {};
|
||||
|
||||
(<any>Object).assign(localVarHeaderParams, options.headers);
|
||||
|
||||
let localVarUseFormData = false;
|
||||
|
||||
let localVarRequestOptions: localVarRequest.Options = {
|
||||
method: 'GET',
|
||||
qs: localVarQueryParameters,
|
||||
headers: localVarHeaderParams,
|
||||
uri: localVarPath,
|
||||
useQuerystring: this._useQuerystring,
|
||||
json: true,
|
||||
};
|
||||
|
||||
let authenticationPromise = Promise.resolve();
|
||||
if (this.authentications.BasicAuth.username && this.authentications.BasicAuth.password) {
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.BasicAuth.applyToRequest(localVarRequestOptions));
|
||||
}
|
||||
if (this.authentications.BearerAuth.accessToken) {
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.BearerAuth.applyToRequest(localVarRequestOptions));
|
||||
}
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
||||
|
||||
let interceptorPromise = authenticationPromise;
|
||||
for (const interceptor of this.interceptors) {
|
||||
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
||||
}
|
||||
|
||||
return interceptorPromise.then(() => {
|
||||
if (Object.keys(localVarFormParams).length) {
|
||||
if (localVarUseFormData) {
|
||||
(<any>localVarRequestOptions).formData = localVarFormParams;
|
||||
} else {
|
||||
localVarRequestOptions.form = localVarFormParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => {
|
||||
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
} else {
|
||||
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
||||
resolve({ response: response, body: body });
|
||||
} else {
|
||||
reject(new HttpError(response, body, response.statusCode));
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
164
extensions/arc/src/controller/generated/v1/api/infoRouterApi.ts
Normal file
164
extensions/arc/src/controller/generated/v1/api/infoRouterApi.ts
Normal file
@@ -0,0 +1,164 @@
|
||||
/**
|
||||
* SQL Server Big Data Cluster API
|
||||
* OpenAPI specification for **SQL Server Big Data Cluster**.
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import localVarRequest = require('request');
|
||||
import http = require('http');
|
||||
|
||||
/* tslint:disable:no-unused-locals */
|
||||
|
||||
import { Authentication, HttpBasicAuth, HttpBearerAuth, Interceptor, VoidAuth } from '../model/models';
|
||||
import { HttpError } from './apis';
|
||||
|
||||
|
||||
let defaultBasePath = 'https://0.0.0.0:30080';
|
||||
|
||||
// ===============================================
|
||||
// This file is autogenerated - Please do not edit
|
||||
// ===============================================
|
||||
|
||||
export enum InfoRouterApiApiKeys {
|
||||
}
|
||||
|
||||
export class InfoRouterApi {
|
||||
protected _basePath = defaultBasePath;
|
||||
protected _defaultHeaders : any = {};
|
||||
protected _useQuerystring : boolean = false;
|
||||
|
||||
protected authentications = {
|
||||
'default': <Authentication>new VoidAuth(),
|
||||
'BasicAuth': new HttpBasicAuth(),
|
||||
'BearerAuth': new HttpBearerAuth(),
|
||||
}
|
||||
|
||||
protected interceptors: Interceptor[] = [];
|
||||
|
||||
constructor(basePath?: string);
|
||||
constructor(username: string, password: string, basePath?: string);
|
||||
constructor(basePathOrUsername: string, password?: string, basePath?: string) {
|
||||
if (password) {
|
||||
this.username = basePathOrUsername;
|
||||
this.password = password
|
||||
if (basePath) {
|
||||
this.basePath = basePath;
|
||||
}
|
||||
} else {
|
||||
if (basePathOrUsername) {
|
||||
this.basePath = basePathOrUsername
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
set useQuerystring(value: boolean) {
|
||||
this._useQuerystring = value;
|
||||
}
|
||||
|
||||
set basePath(basePath: string) {
|
||||
this._basePath = basePath;
|
||||
}
|
||||
|
||||
set defaultHeaders(defaultHeaders: any) {
|
||||
this._defaultHeaders = defaultHeaders;
|
||||
}
|
||||
|
||||
get defaultHeaders() {
|
||||
return this._defaultHeaders;
|
||||
}
|
||||
|
||||
get basePath() {
|
||||
return this._basePath;
|
||||
}
|
||||
|
||||
public setDefaultAuthentication(auth: Authentication) {
|
||||
this.authentications.default = auth;
|
||||
}
|
||||
|
||||
public setApiKey(key: InfoRouterApiApiKeys, value: string) {
|
||||
(this.authentications as any)[InfoRouterApiApiKeys[key]].apiKey = value;
|
||||
}
|
||||
|
||||
set username(username: string) {
|
||||
this.authentications.BasicAuth.username = username;
|
||||
}
|
||||
|
||||
set password(password: string) {
|
||||
this.authentications.BasicAuth.password = password;
|
||||
}
|
||||
|
||||
set accessToken(accessToken: string | (() => string)) {
|
||||
this.authentications.BearerAuth.accessToken = accessToken;
|
||||
}
|
||||
|
||||
public addInterceptor(interceptor: Interceptor) {
|
||||
this.interceptors.push(interceptor);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @summary Get cluster info.
|
||||
*/
|
||||
public async apiV1InfoGet (options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
|
||||
const localVarPath = this.basePath + '/api/v1/info';
|
||||
let localVarQueryParameters: any = {};
|
||||
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
||||
let localVarFormParams: any = {};
|
||||
|
||||
(<any>Object).assign(localVarHeaderParams, options.headers);
|
||||
|
||||
let localVarUseFormData = false;
|
||||
|
||||
let localVarRequestOptions: localVarRequest.Options = {
|
||||
method: 'GET',
|
||||
qs: localVarQueryParameters,
|
||||
headers: localVarHeaderParams,
|
||||
uri: localVarPath,
|
||||
useQuerystring: this._useQuerystring,
|
||||
json: true,
|
||||
};
|
||||
|
||||
let authenticationPromise = Promise.resolve();
|
||||
if (this.authentications.BasicAuth.username && this.authentications.BasicAuth.password) {
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.BasicAuth.applyToRequest(localVarRequestOptions));
|
||||
}
|
||||
if (this.authentications.BearerAuth.accessToken) {
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.BearerAuth.applyToRequest(localVarRequestOptions));
|
||||
}
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
||||
|
||||
let interceptorPromise = authenticationPromise;
|
||||
for (const interceptor of this.interceptors) {
|
||||
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
||||
}
|
||||
|
||||
return interceptorPromise.then(() => {
|
||||
if (Object.keys(localVarFormParams).length) {
|
||||
if (localVarUseFormData) {
|
||||
(<any>localVarRequestOptions).formData = localVarFormParams;
|
||||
} else {
|
||||
localVarRequestOptions.form = localVarFormParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => {
|
||||
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
} else {
|
||||
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
||||
resolve({ response: response, body: body });
|
||||
} else {
|
||||
reject(new HttpError(response, body, response.statusCode));
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
175
extensions/arc/src/controller/generated/v1/api/logsRouterApi.ts
Normal file
175
extensions/arc/src/controller/generated/v1/api/logsRouterApi.ts
Normal file
@@ -0,0 +1,175 @@
|
||||
/**
|
||||
* SQL Server Big Data Cluster API
|
||||
* OpenAPI specification for **SQL Server Big Data Cluster**.
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import localVarRequest = require('request');
|
||||
import http = require('http');
|
||||
|
||||
/* tslint:disable:no-unused-locals */
|
||||
import { LogsRequest } from '../model/logsRequest';
|
||||
import { Authentication, HttpBasicAuth, HttpBearerAuth, Interceptor, ObjectSerializer, VoidAuth } from '../model/models';
|
||||
import { HttpError } from './apis';
|
||||
|
||||
|
||||
|
||||
let defaultBasePath = 'https://0.0.0.0:30080';
|
||||
|
||||
// ===============================================
|
||||
// This file is autogenerated - Please do not edit
|
||||
// ===============================================
|
||||
|
||||
export enum LogsRouterApiApiKeys {
|
||||
}
|
||||
|
||||
export class LogsRouterApi {
|
||||
protected _basePath = defaultBasePath;
|
||||
protected _defaultHeaders : any = {};
|
||||
protected _useQuerystring : boolean = false;
|
||||
|
||||
protected authentications = {
|
||||
'default': <Authentication>new VoidAuth(),
|
||||
'BasicAuth': new HttpBasicAuth(),
|
||||
'BearerAuth': new HttpBearerAuth(),
|
||||
}
|
||||
|
||||
protected interceptors: Interceptor[] = [];
|
||||
|
||||
constructor(basePath?: string);
|
||||
constructor(username: string, password: string, basePath?: string);
|
||||
constructor(basePathOrUsername: string, password?: string, basePath?: string) {
|
||||
if (password) {
|
||||
this.username = basePathOrUsername;
|
||||
this.password = password
|
||||
if (basePath) {
|
||||
this.basePath = basePath;
|
||||
}
|
||||
} else {
|
||||
if (basePathOrUsername) {
|
||||
this.basePath = basePathOrUsername
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
set useQuerystring(value: boolean) {
|
||||
this._useQuerystring = value;
|
||||
}
|
||||
|
||||
set basePath(basePath: string) {
|
||||
this._basePath = basePath;
|
||||
}
|
||||
|
||||
set defaultHeaders(defaultHeaders: any) {
|
||||
this._defaultHeaders = defaultHeaders;
|
||||
}
|
||||
|
||||
get defaultHeaders() {
|
||||
return this._defaultHeaders;
|
||||
}
|
||||
|
||||
get basePath() {
|
||||
return this._basePath;
|
||||
}
|
||||
|
||||
public setDefaultAuthentication(auth: Authentication) {
|
||||
this.authentications.default = auth;
|
||||
}
|
||||
|
||||
public setApiKey(key: LogsRouterApiApiKeys, value: string) {
|
||||
(this.authentications as any)[LogsRouterApiApiKeys[key]].apiKey = value;
|
||||
}
|
||||
|
||||
set username(username: string) {
|
||||
this.authentications.BasicAuth.username = username;
|
||||
}
|
||||
|
||||
set password(password: string) {
|
||||
this.authentications.BasicAuth.password = password;
|
||||
}
|
||||
|
||||
set accessToken(accessToken: string | (() => string)) {
|
||||
this.authentications.BearerAuth.accessToken = accessToken;
|
||||
}
|
||||
|
||||
public addInterceptor(interceptor: Interceptor) {
|
||||
this.interceptors.push(interceptor);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @summary Gets logs from Elasticsearch.
|
||||
* @param logsRequest
|
||||
*/
|
||||
public async apiV1LogsPost (logsRequest?: LogsRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: object; }> {
|
||||
const localVarPath = this.basePath + '/api/v1/logs';
|
||||
let localVarQueryParameters: any = {};
|
||||
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
||||
const produces = ['application/json'];
|
||||
// give precedence to 'application/json'
|
||||
if (produces.indexOf('application/json') >= 0) {
|
||||
localVarHeaderParams.Accept = 'application/json';
|
||||
} else {
|
||||
localVarHeaderParams.Accept = produces.join(',');
|
||||
}
|
||||
let localVarFormParams: any = {};
|
||||
|
||||
(<any>Object).assign(localVarHeaderParams, options.headers);
|
||||
|
||||
let localVarUseFormData = false;
|
||||
|
||||
let localVarRequestOptions: localVarRequest.Options = {
|
||||
method: 'POST',
|
||||
qs: localVarQueryParameters,
|
||||
headers: localVarHeaderParams,
|
||||
uri: localVarPath,
|
||||
useQuerystring: this._useQuerystring,
|
||||
json: true,
|
||||
body: ObjectSerializer.serialize(logsRequest, "LogsRequest")
|
||||
};
|
||||
|
||||
let authenticationPromise = Promise.resolve();
|
||||
if (this.authentications.BasicAuth.username && this.authentications.BasicAuth.password) {
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.BasicAuth.applyToRequest(localVarRequestOptions));
|
||||
}
|
||||
if (this.authentications.BearerAuth.accessToken) {
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.BearerAuth.applyToRequest(localVarRequestOptions));
|
||||
}
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
||||
|
||||
let interceptorPromise = authenticationPromise;
|
||||
for (const interceptor of this.interceptors) {
|
||||
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
||||
}
|
||||
|
||||
return interceptorPromise.then(() => {
|
||||
if (Object.keys(localVarFormParams).length) {
|
||||
if (localVarUseFormData) {
|
||||
(<any>localVarRequestOptions).formData = localVarFormParams;
|
||||
} else {
|
||||
localVarRequestOptions.form = localVarFormParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.IncomingMessage; body: object; }>((resolve, reject) => {
|
||||
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
} else {
|
||||
body = ObjectSerializer.deserialize(body, "object");
|
||||
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
||||
resolve({ response: response, body: body });
|
||||
} else {
|
||||
reject(new HttpError(response, body, response.statusCode));
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,171 @@
|
||||
/**
|
||||
* SQL Server Big Data Cluster API
|
||||
* OpenAPI specification for **SQL Server Big Data Cluster**.
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import localVarRequest = require('request');
|
||||
import http = require('http');
|
||||
|
||||
/* tslint:disable:no-unused-locals */
|
||||
|
||||
import { Authentication, HttpBasicAuth, HttpBearerAuth, Interceptor, ObjectSerializer, VoidAuth } from '../model/models';
|
||||
import { HttpError } from './apis';
|
||||
|
||||
|
||||
let defaultBasePath = 'https://0.0.0.0:30080';
|
||||
|
||||
// ===============================================
|
||||
// This file is autogenerated - Please do not edit
|
||||
// ===============================================
|
||||
|
||||
export enum MetricRouterApiApiKeys {
|
||||
}
|
||||
|
||||
export class MetricRouterApi {
|
||||
protected _basePath = defaultBasePath;
|
||||
protected _defaultHeaders : any = {};
|
||||
protected _useQuerystring : boolean = false;
|
||||
|
||||
protected authentications = {
|
||||
'default': <Authentication>new VoidAuth(),
|
||||
'BasicAuth': new HttpBasicAuth(),
|
||||
'BearerAuth': new HttpBearerAuth(),
|
||||
}
|
||||
|
||||
protected interceptors: Interceptor[] = [];
|
||||
|
||||
constructor(basePath?: string);
|
||||
constructor(username: string, password: string, basePath?: string);
|
||||
constructor(basePathOrUsername: string, password?: string, basePath?: string) {
|
||||
if (password) {
|
||||
this.username = basePathOrUsername;
|
||||
this.password = password
|
||||
if (basePath) {
|
||||
this.basePath = basePath;
|
||||
}
|
||||
} else {
|
||||
if (basePathOrUsername) {
|
||||
this.basePath = basePathOrUsername
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
set useQuerystring(value: boolean) {
|
||||
this._useQuerystring = value;
|
||||
}
|
||||
|
||||
set basePath(basePath: string) {
|
||||
this._basePath = basePath;
|
||||
}
|
||||
|
||||
set defaultHeaders(defaultHeaders: any) {
|
||||
this._defaultHeaders = defaultHeaders;
|
||||
}
|
||||
|
||||
get defaultHeaders() {
|
||||
return this._defaultHeaders;
|
||||
}
|
||||
|
||||
get basePath() {
|
||||
return this._basePath;
|
||||
}
|
||||
|
||||
public setDefaultAuthentication(auth: Authentication) {
|
||||
this.authentications.default = auth;
|
||||
}
|
||||
|
||||
public setApiKey(key: MetricRouterApiApiKeys, value: string) {
|
||||
(this.authentications as any)[MetricRouterApiApiKeys[key]].apiKey = value;
|
||||
}
|
||||
|
||||
set username(username: string) {
|
||||
this.authentications.BasicAuth.username = username;
|
||||
}
|
||||
|
||||
set password(password: string) {
|
||||
this.authentications.BasicAuth.password = password;
|
||||
}
|
||||
|
||||
set accessToken(accessToken: string | (() => string)) {
|
||||
this.authentications.BearerAuth.accessToken = accessToken;
|
||||
}
|
||||
|
||||
public addInterceptor(interceptor: Interceptor) {
|
||||
this.interceptors.push(interceptor);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public async apiV1MetricsPost (options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: object; }> {
|
||||
const localVarPath = this.basePath + '/api/v1/metrics';
|
||||
let localVarQueryParameters: any = {};
|
||||
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
||||
const produces = ['application/json'];
|
||||
// give precedence to 'application/json'
|
||||
if (produces.indexOf('application/json') >= 0) {
|
||||
localVarHeaderParams.Accept = 'application/json';
|
||||
} else {
|
||||
localVarHeaderParams.Accept = produces.join(',');
|
||||
}
|
||||
let localVarFormParams: any = {};
|
||||
|
||||
(<any>Object).assign(localVarHeaderParams, options.headers);
|
||||
|
||||
let localVarUseFormData = false;
|
||||
|
||||
let localVarRequestOptions: localVarRequest.Options = {
|
||||
method: 'POST',
|
||||
qs: localVarQueryParameters,
|
||||
headers: localVarHeaderParams,
|
||||
uri: localVarPath,
|
||||
useQuerystring: this._useQuerystring,
|
||||
json: true,
|
||||
};
|
||||
|
||||
let authenticationPromise = Promise.resolve();
|
||||
if (this.authentications.BasicAuth.username && this.authentications.BasicAuth.password) {
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.BasicAuth.applyToRequest(localVarRequestOptions));
|
||||
}
|
||||
if (this.authentications.BearerAuth.accessToken) {
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.BearerAuth.applyToRequest(localVarRequestOptions));
|
||||
}
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
||||
|
||||
let interceptorPromise = authenticationPromise;
|
||||
for (const interceptor of this.interceptors) {
|
||||
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
||||
}
|
||||
|
||||
return interceptorPromise.then(() => {
|
||||
if (Object.keys(localVarFormParams).length) {
|
||||
if (localVarUseFormData) {
|
||||
(<any>localVarRequestOptions).formData = localVarFormParams;
|
||||
} else {
|
||||
localVarRequestOptions.form = localVarFormParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.IncomingMessage; body: object; }>((resolve, reject) => {
|
||||
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
} else {
|
||||
body = ObjectSerializer.deserialize(body, "object");
|
||||
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
||||
resolve({ response: response, body: body });
|
||||
} else {
|
||||
reject(new HttpError(response, body, response.statusCode));
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,321 @@
|
||||
/**
|
||||
* SQL Server Big Data Cluster API
|
||||
* OpenAPI specification for **SQL Server Big Data Cluster**.
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import localVarRequest = require('request');
|
||||
import http = require('http');
|
||||
|
||||
/* tslint:disable:no-unused-locals */
|
||||
import { CreateRegistrationRequest } from '../model/createRegistrationRequest';
|
||||
import { Authentication, HttpBasicAuth, HttpBearerAuth, Interceptor, ObjectSerializer, VoidAuth } from '../model/models';
|
||||
import { RegistrationResponse } from '../model/registrationResponse';
|
||||
import { HttpError } from './apis';
|
||||
|
||||
|
||||
|
||||
let defaultBasePath = 'https://0.0.0.0:30080';
|
||||
|
||||
// ===============================================
|
||||
// This file is autogenerated - Please do not edit
|
||||
// ===============================================
|
||||
|
||||
export enum RegistrationRouterApiApiKeys {
|
||||
}
|
||||
|
||||
export class RegistrationRouterApi {
|
||||
protected _basePath = defaultBasePath;
|
||||
protected _defaultHeaders : any = {};
|
||||
protected _useQuerystring : boolean = false;
|
||||
|
||||
protected authentications = {
|
||||
'default': <Authentication>new VoidAuth(),
|
||||
'BasicAuth': new HttpBasicAuth(),
|
||||
'BearerAuth': new HttpBearerAuth(),
|
||||
}
|
||||
|
||||
protected interceptors: Interceptor[] = [];
|
||||
|
||||
constructor(basePath?: string);
|
||||
constructor(username: string, password: string, basePath?: string);
|
||||
constructor(basePathOrUsername: string, password?: string, basePath?: string) {
|
||||
if (password) {
|
||||
this.username = basePathOrUsername;
|
||||
this.password = password
|
||||
if (basePath) {
|
||||
this.basePath = basePath;
|
||||
}
|
||||
} else {
|
||||
if (basePathOrUsername) {
|
||||
this.basePath = basePathOrUsername
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
set useQuerystring(value: boolean) {
|
||||
this._useQuerystring = value;
|
||||
}
|
||||
|
||||
set basePath(basePath: string) {
|
||||
this._basePath = basePath;
|
||||
}
|
||||
|
||||
set defaultHeaders(defaultHeaders: any) {
|
||||
this._defaultHeaders = defaultHeaders;
|
||||
}
|
||||
|
||||
get defaultHeaders() {
|
||||
return this._defaultHeaders;
|
||||
}
|
||||
|
||||
get basePath() {
|
||||
return this._basePath;
|
||||
}
|
||||
|
||||
public setDefaultAuthentication(auth: Authentication) {
|
||||
this.authentications.default = auth;
|
||||
}
|
||||
|
||||
public setApiKey(key: RegistrationRouterApiApiKeys, value: string) {
|
||||
(this.authentications as any)[RegistrationRouterApiApiKeys[key]].apiKey = value;
|
||||
}
|
||||
|
||||
set username(username: string) {
|
||||
this.authentications.BasicAuth.username = username;
|
||||
}
|
||||
|
||||
set password(password: string) {
|
||||
this.authentications.BasicAuth.password = password;
|
||||
}
|
||||
|
||||
set accessToken(accessToken: string | (() => string)) {
|
||||
this.authentications.BearerAuth.accessToken = accessToken;
|
||||
}
|
||||
|
||||
public addInterceptor(interceptor: Interceptor) {
|
||||
this.interceptors.push(interceptor);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param createRegistrationRequest
|
||||
*/
|
||||
public async apiV1RegistrationCreatePut (createRegistrationRequest?: CreateRegistrationRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
|
||||
const localVarPath = this.basePath + '/api/v1/registration/create';
|
||||
let localVarQueryParameters: any = {};
|
||||
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
||||
let localVarFormParams: any = {};
|
||||
|
||||
(<any>Object).assign(localVarHeaderParams, options.headers);
|
||||
|
||||
let localVarUseFormData = false;
|
||||
|
||||
let localVarRequestOptions: localVarRequest.Options = {
|
||||
method: 'PUT',
|
||||
qs: localVarQueryParameters,
|
||||
headers: localVarHeaderParams,
|
||||
uri: localVarPath,
|
||||
useQuerystring: this._useQuerystring,
|
||||
json: true,
|
||||
body: ObjectSerializer.serialize(createRegistrationRequest, "CreateRegistrationRequest")
|
||||
};
|
||||
|
||||
let authenticationPromise = Promise.resolve();
|
||||
if (this.authentications.BasicAuth.username && this.authentications.BasicAuth.password) {
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.BasicAuth.applyToRequest(localVarRequestOptions));
|
||||
}
|
||||
if (this.authentications.BearerAuth.accessToken) {
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.BearerAuth.applyToRequest(localVarRequestOptions));
|
||||
}
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
||||
|
||||
let interceptorPromise = authenticationPromise;
|
||||
for (const interceptor of this.interceptors) {
|
||||
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
||||
}
|
||||
|
||||
return interceptorPromise.then(() => {
|
||||
if (Object.keys(localVarFormParams).length) {
|
||||
if (localVarUseFormData) {
|
||||
(<any>localVarRequestOptions).formData = localVarFormParams;
|
||||
} else {
|
||||
localVarRequestOptions.form = localVarFormParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => {
|
||||
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
} else {
|
||||
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
||||
resolve({ response: response, body: body });
|
||||
} else {
|
||||
reject(new HttpError(response, body, response.statusCode));
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param ns
|
||||
*/
|
||||
public async apiV1RegistrationListResourcesNsGet (ns: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Array<RegistrationResponse>; }> {
|
||||
const localVarPath = this.basePath + '/api/v1/registration/listResources/{ns}'
|
||||
.replace('{' + 'ns' + '}', encodeURIComponent(String(ns)));
|
||||
let localVarQueryParameters: any = {};
|
||||
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
||||
const produces = ['text/plain', 'application/json', 'text/json'];
|
||||
// give precedence to 'application/json'
|
||||
if (produces.indexOf('application/json') >= 0) {
|
||||
localVarHeaderParams.Accept = 'application/json';
|
||||
} else {
|
||||
localVarHeaderParams.Accept = produces.join(',');
|
||||
}
|
||||
let localVarFormParams: any = {};
|
||||
|
||||
// verify required parameter 'ns' is not null or undefined
|
||||
if (ns === null || ns === undefined) {
|
||||
throw new Error('Required parameter ns was null or undefined when calling apiV1RegistrationListResourcesNsGet.');
|
||||
}
|
||||
|
||||
(<any>Object).assign(localVarHeaderParams, options.headers);
|
||||
|
||||
let localVarUseFormData = false;
|
||||
|
||||
let localVarRequestOptions: localVarRequest.Options = {
|
||||
method: 'GET',
|
||||
qs: localVarQueryParameters,
|
||||
headers: localVarHeaderParams,
|
||||
uri: localVarPath,
|
||||
useQuerystring: this._useQuerystring,
|
||||
json: true,
|
||||
};
|
||||
|
||||
let authenticationPromise = Promise.resolve();
|
||||
if (this.authentications.BasicAuth.username && this.authentications.BasicAuth.password) {
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.BasicAuth.applyToRequest(localVarRequestOptions));
|
||||
}
|
||||
if (this.authentications.BearerAuth.accessToken) {
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.BearerAuth.applyToRequest(localVarRequestOptions));
|
||||
}
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
||||
|
||||
let interceptorPromise = authenticationPromise;
|
||||
for (const interceptor of this.interceptors) {
|
||||
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
||||
}
|
||||
|
||||
return interceptorPromise.then(() => {
|
||||
if (Object.keys(localVarFormParams).length) {
|
||||
if (localVarUseFormData) {
|
||||
(<any>localVarRequestOptions).formData = localVarFormParams;
|
||||
} else {
|
||||
localVarRequestOptions.form = localVarFormParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.IncomingMessage; body: Array<RegistrationResponse>; }>((resolve, reject) => {
|
||||
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
} else {
|
||||
body = ObjectSerializer.deserialize(body, "Array<RegistrationResponse>");
|
||||
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
||||
resolve({ response: response, body: body });
|
||||
} else {
|
||||
reject(new HttpError(response, body, response.statusCode));
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param ns
|
||||
* @param name
|
||||
* @param isDeleted
|
||||
*/
|
||||
public async apiV1RegistrationNsNameIsDeletedDelete (ns: string, name: string, isDeleted: boolean, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
|
||||
const localVarPath = this.basePath + '/api/v1/registration/{ns}/{name}/{isDeleted}'
|
||||
.replace('{' + 'ns' + '}', encodeURIComponent(String(ns)))
|
||||
.replace('{' + 'name' + '}', encodeURIComponent(String(name)))
|
||||
.replace('{' + 'isDeleted' + '}', encodeURIComponent(String(isDeleted)));
|
||||
let localVarQueryParameters: any = {};
|
||||
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
||||
let localVarFormParams: any = {};
|
||||
|
||||
// verify required parameter 'ns' is not null or undefined
|
||||
if (ns === null || ns === undefined) {
|
||||
throw new Error('Required parameter ns was null or undefined when calling apiV1RegistrationNsNameIsDeletedDelete.');
|
||||
}
|
||||
|
||||
// verify required parameter 'name' is not null or undefined
|
||||
if (name === null || name === undefined) {
|
||||
throw new Error('Required parameter name was null or undefined when calling apiV1RegistrationNsNameIsDeletedDelete.');
|
||||
}
|
||||
|
||||
// verify required parameter 'isDeleted' is not null or undefined
|
||||
if (isDeleted === null || isDeleted === undefined) {
|
||||
throw new Error('Required parameter isDeleted was null or undefined when calling apiV1RegistrationNsNameIsDeletedDelete.');
|
||||
}
|
||||
|
||||
(<any>Object).assign(localVarHeaderParams, options.headers);
|
||||
|
||||
let localVarUseFormData = false;
|
||||
|
||||
let localVarRequestOptions: localVarRequest.Options = {
|
||||
method: 'DELETE',
|
||||
qs: localVarQueryParameters,
|
||||
headers: localVarHeaderParams,
|
||||
uri: localVarPath,
|
||||
useQuerystring: this._useQuerystring,
|
||||
json: true,
|
||||
};
|
||||
|
||||
let authenticationPromise = Promise.resolve();
|
||||
if (this.authentications.BasicAuth.username && this.authentications.BasicAuth.password) {
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.BasicAuth.applyToRequest(localVarRequestOptions));
|
||||
}
|
||||
if (this.authentications.BearerAuth.accessToken) {
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.BearerAuth.applyToRequest(localVarRequestOptions));
|
||||
}
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
||||
|
||||
let interceptorPromise = authenticationPromise;
|
||||
for (const interceptor of this.interceptors) {
|
||||
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
||||
}
|
||||
|
||||
return interceptorPromise.then(() => {
|
||||
if (Object.keys(localVarFormParams).length) {
|
||||
if (localVarUseFormData) {
|
||||
(<any>localVarRequestOptions).formData = localVarFormParams;
|
||||
} else {
|
||||
localVarRequestOptions.form = localVarFormParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => {
|
||||
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
} else {
|
||||
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
||||
resolve({ response: response, body: body });
|
||||
} else {
|
||||
reject(new HttpError(response, body, response.statusCode));
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,496 @@
|
||||
/**
|
||||
* SQL Server Big Data Cluster API
|
||||
* OpenAPI specification for **SQL Server Big Data Cluster**.
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import localVarRequest = require('request');
|
||||
import http = require('http');
|
||||
|
||||
/* tslint:disable:no-unused-locals */
|
||||
import { CreateSqlInstanceMessage } from '../model/createSqlInstanceMessage';
|
||||
import { Authentication, HttpBasicAuth, HttpBearerAuth, Interceptor, ObjectSerializer, VoidAuth } from '../model/models';
|
||||
import { HttpError } from './apis';
|
||||
|
||||
|
||||
|
||||
let defaultBasePath = 'https://0.0.0.0:30080';
|
||||
|
||||
// ===============================================
|
||||
// This file is autogenerated - Please do not edit
|
||||
// ===============================================
|
||||
|
||||
export enum SqlInstanceRouterApiApiKeys {
|
||||
}
|
||||
|
||||
export class SqlInstanceRouterApi {
|
||||
protected _basePath = defaultBasePath;
|
||||
protected _defaultHeaders : any = {};
|
||||
protected _useQuerystring : boolean = false;
|
||||
|
||||
protected authentications = {
|
||||
'default': <Authentication>new VoidAuth(),
|
||||
'BasicAuth': new HttpBasicAuth(),
|
||||
'BearerAuth': new HttpBearerAuth(),
|
||||
}
|
||||
|
||||
protected interceptors: Interceptor[] = [];
|
||||
|
||||
constructor(basePath?: string);
|
||||
constructor(username: string, password: string, basePath?: string);
|
||||
constructor(basePathOrUsername: string, password?: string, basePath?: string) {
|
||||
if (password) {
|
||||
this.username = basePathOrUsername;
|
||||
this.password = password
|
||||
if (basePath) {
|
||||
this.basePath = basePath;
|
||||
}
|
||||
} else {
|
||||
if (basePathOrUsername) {
|
||||
this.basePath = basePathOrUsername
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
set useQuerystring(value: boolean) {
|
||||
this._useQuerystring = value;
|
||||
}
|
||||
|
||||
set basePath(basePath: string) {
|
||||
this._basePath = basePath;
|
||||
}
|
||||
|
||||
set defaultHeaders(defaultHeaders: any) {
|
||||
this._defaultHeaders = defaultHeaders;
|
||||
}
|
||||
|
||||
get defaultHeaders() {
|
||||
return this._defaultHeaders;
|
||||
}
|
||||
|
||||
get basePath() {
|
||||
return this._basePath;
|
||||
}
|
||||
|
||||
public setDefaultAuthentication(auth: Authentication) {
|
||||
this.authentications.default = auth;
|
||||
}
|
||||
|
||||
public setApiKey(key: SqlInstanceRouterApiApiKeys, value: string) {
|
||||
(this.authentications as any)[SqlInstanceRouterApiApiKeys[key]].apiKey = value;
|
||||
}
|
||||
|
||||
set username(username: string) {
|
||||
this.authentications.BasicAuth.username = username;
|
||||
}
|
||||
|
||||
set password(password: string) {
|
||||
this.authentications.BasicAuth.password = password;
|
||||
}
|
||||
|
||||
set accessToken(accessToken: string | (() => string)) {
|
||||
this.authentications.BearerAuth.accessToken = accessToken;
|
||||
}
|
||||
|
||||
public addInterceptor(interceptor: Interceptor) {
|
||||
this.interceptors.push(interceptor);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param createSqlInstanceMessage
|
||||
*/
|
||||
public async apiV1HybridSqlCreatePost (createSqlInstanceMessage?: CreateSqlInstanceMessage, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
|
||||
const localVarPath = this.basePath + '/api/v1/hybrid/sql/create';
|
||||
let localVarQueryParameters: any = {};
|
||||
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
||||
let localVarFormParams: any = {};
|
||||
|
||||
(<any>Object).assign(localVarHeaderParams, options.headers);
|
||||
|
||||
let localVarUseFormData = false;
|
||||
|
||||
let localVarRequestOptions: localVarRequest.Options = {
|
||||
method: 'POST',
|
||||
qs: localVarQueryParameters,
|
||||
headers: localVarHeaderParams,
|
||||
uri: localVarPath,
|
||||
useQuerystring: this._useQuerystring,
|
||||
json: true,
|
||||
body: ObjectSerializer.serialize(createSqlInstanceMessage, "CreateSqlInstanceMessage")
|
||||
};
|
||||
|
||||
let authenticationPromise = Promise.resolve();
|
||||
if (this.authentications.BasicAuth.username && this.authentications.BasicAuth.password) {
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.BasicAuth.applyToRequest(localVarRequestOptions));
|
||||
}
|
||||
if (this.authentications.BearerAuth.accessToken) {
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.BearerAuth.applyToRequest(localVarRequestOptions));
|
||||
}
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
||||
|
||||
let interceptorPromise = authenticationPromise;
|
||||
for (const interceptor of this.interceptors) {
|
||||
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
||||
}
|
||||
|
||||
return interceptorPromise.then(() => {
|
||||
if (Object.keys(localVarFormParams).length) {
|
||||
if (localVarUseFormData) {
|
||||
(<any>localVarRequestOptions).formData = localVarFormParams;
|
||||
} else {
|
||||
localVarRequestOptions.form = localVarFormParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => {
|
||||
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
} else {
|
||||
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
||||
resolve({ response: response, body: body });
|
||||
} else {
|
||||
reject(new HttpError(response, body, response.statusCode));
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param ns
|
||||
*/
|
||||
public async apiV1HybridSqlNsGet (ns: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
|
||||
const localVarPath = this.basePath + '/api/v1/hybrid/sql/{ns}'
|
||||
.replace('{' + 'ns' + '}', encodeURIComponent(String(ns)));
|
||||
let localVarQueryParameters: any = {};
|
||||
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
||||
let localVarFormParams: any = {};
|
||||
|
||||
// verify required parameter 'ns' is not null or undefined
|
||||
if (ns === null || ns === undefined) {
|
||||
throw new Error('Required parameter ns was null or undefined when calling apiV1HybridSqlNsGet.');
|
||||
}
|
||||
|
||||
(<any>Object).assign(localVarHeaderParams, options.headers);
|
||||
|
||||
let localVarUseFormData = false;
|
||||
|
||||
let localVarRequestOptions: localVarRequest.Options = {
|
||||
method: 'GET',
|
||||
qs: localVarQueryParameters,
|
||||
headers: localVarHeaderParams,
|
||||
uri: localVarPath,
|
||||
useQuerystring: this._useQuerystring,
|
||||
json: true,
|
||||
};
|
||||
|
||||
let authenticationPromise = Promise.resolve();
|
||||
if (this.authentications.BasicAuth.username && this.authentications.BasicAuth.password) {
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.BasicAuth.applyToRequest(localVarRequestOptions));
|
||||
}
|
||||
if (this.authentications.BearerAuth.accessToken) {
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.BearerAuth.applyToRequest(localVarRequestOptions));
|
||||
}
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
||||
|
||||
let interceptorPromise = authenticationPromise;
|
||||
for (const interceptor of this.interceptors) {
|
||||
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
||||
}
|
||||
|
||||
return interceptorPromise.then(() => {
|
||||
if (Object.keys(localVarFormParams).length) {
|
||||
if (localVarUseFormData) {
|
||||
(<any>localVarRequestOptions).formData = localVarFormParams;
|
||||
} else {
|
||||
localVarRequestOptions.form = localVarFormParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => {
|
||||
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
} else {
|
||||
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
||||
resolve({ response: response, body: body });
|
||||
} else {
|
||||
reject(new HttpError(response, body, response.statusCode));
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param ns
|
||||
* @param name
|
||||
*/
|
||||
public async apiV1HybridSqlNsNameDelete (ns: string, name: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
|
||||
const localVarPath = this.basePath + '/api/v1/hybrid/sql/{ns}/{name}'
|
||||
.replace('{' + 'ns' + '}', encodeURIComponent(String(ns)))
|
||||
.replace('{' + 'name' + '}', encodeURIComponent(String(name)));
|
||||
let localVarQueryParameters: any = {};
|
||||
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
||||
let localVarFormParams: any = {};
|
||||
|
||||
// verify required parameter 'ns' is not null or undefined
|
||||
if (ns === null || ns === undefined) {
|
||||
throw new Error('Required parameter ns was null or undefined when calling apiV1HybridSqlNsNameDelete.');
|
||||
}
|
||||
|
||||
// verify required parameter 'name' is not null or undefined
|
||||
if (name === null || name === undefined) {
|
||||
throw new Error('Required parameter name was null or undefined when calling apiV1HybridSqlNsNameDelete.');
|
||||
}
|
||||
|
||||
(<any>Object).assign(localVarHeaderParams, options.headers);
|
||||
|
||||
let localVarUseFormData = false;
|
||||
|
||||
let localVarRequestOptions: localVarRequest.Options = {
|
||||
method: 'DELETE',
|
||||
qs: localVarQueryParameters,
|
||||
headers: localVarHeaderParams,
|
||||
uri: localVarPath,
|
||||
useQuerystring: this._useQuerystring,
|
||||
json: true,
|
||||
};
|
||||
|
||||
let authenticationPromise = Promise.resolve();
|
||||
if (this.authentications.BasicAuth.username && this.authentications.BasicAuth.password) {
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.BasicAuth.applyToRequest(localVarRequestOptions));
|
||||
}
|
||||
if (this.authentications.BearerAuth.accessToken) {
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.BearerAuth.applyToRequest(localVarRequestOptions));
|
||||
}
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
||||
|
||||
let interceptorPromise = authenticationPromise;
|
||||
for (const interceptor of this.interceptors) {
|
||||
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
||||
}
|
||||
|
||||
return interceptorPromise.then(() => {
|
||||
if (Object.keys(localVarFormParams).length) {
|
||||
if (localVarUseFormData) {
|
||||
(<any>localVarRequestOptions).formData = localVarFormParams;
|
||||
} else {
|
||||
localVarRequestOptions.form = localVarFormParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => {
|
||||
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
} else {
|
||||
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
||||
resolve({ response: response, body: body });
|
||||
} else {
|
||||
reject(new HttpError(response, body, response.statusCode));
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param ns
|
||||
* @param name
|
||||
*/
|
||||
public async apiV1HybridSqlNsNameGet (ns: string, name: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
|
||||
const localVarPath = this.basePath + '/api/v1/hybrid/sql/{ns}/{name}'
|
||||
.replace('{' + 'ns' + '}', encodeURIComponent(String(ns)))
|
||||
.replace('{' + 'name' + '}', encodeURIComponent(String(name)));
|
||||
let localVarQueryParameters: any = {};
|
||||
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
||||
let localVarFormParams: any = {};
|
||||
|
||||
// verify required parameter 'ns' is not null or undefined
|
||||
if (ns === null || ns === undefined) {
|
||||
throw new Error('Required parameter ns was null or undefined when calling apiV1HybridSqlNsNameGet.');
|
||||
}
|
||||
|
||||
// verify required parameter 'name' is not null or undefined
|
||||
if (name === null || name === undefined) {
|
||||
throw new Error('Required parameter name was null or undefined when calling apiV1HybridSqlNsNameGet.');
|
||||
}
|
||||
|
||||
(<any>Object).assign(localVarHeaderParams, options.headers);
|
||||
|
||||
let localVarUseFormData = false;
|
||||
|
||||
let localVarRequestOptions: localVarRequest.Options = {
|
||||
method: 'GET',
|
||||
qs: localVarQueryParameters,
|
||||
headers: localVarHeaderParams,
|
||||
uri: localVarPath,
|
||||
useQuerystring: this._useQuerystring,
|
||||
json: true,
|
||||
};
|
||||
|
||||
let authenticationPromise = Promise.resolve();
|
||||
if (this.authentications.BasicAuth.username && this.authentications.BasicAuth.password) {
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.BasicAuth.applyToRequest(localVarRequestOptions));
|
||||
}
|
||||
if (this.authentications.BearerAuth.accessToken) {
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.BearerAuth.applyToRequest(localVarRequestOptions));
|
||||
}
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
||||
|
||||
let interceptorPromise = authenticationPromise;
|
||||
for (const interceptor of this.interceptors) {
|
||||
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
||||
}
|
||||
|
||||
return interceptorPromise.then(() => {
|
||||
if (Object.keys(localVarFormParams).length) {
|
||||
if (localVarUseFormData) {
|
||||
(<any>localVarRequestOptions).formData = localVarFormParams;
|
||||
} else {
|
||||
localVarRequestOptions.form = localVarFormParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => {
|
||||
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
} else {
|
||||
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
||||
resolve({ response: response, body: body });
|
||||
} else {
|
||||
reject(new HttpError(response, body, response.statusCode));
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public async apiV1HybridSqlPingpostsqlPost (options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
|
||||
const localVarPath = this.basePath + '/api/v1/hybrid/sql/pingpostsql';
|
||||
let localVarQueryParameters: any = {};
|
||||
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
||||
let localVarFormParams: any = {};
|
||||
|
||||
(<any>Object).assign(localVarHeaderParams, options.headers);
|
||||
|
||||
let localVarUseFormData = false;
|
||||
|
||||
let localVarRequestOptions: localVarRequest.Options = {
|
||||
method: 'POST',
|
||||
qs: localVarQueryParameters,
|
||||
headers: localVarHeaderParams,
|
||||
uri: localVarPath,
|
||||
useQuerystring: this._useQuerystring,
|
||||
json: true,
|
||||
};
|
||||
|
||||
let authenticationPromise = Promise.resolve();
|
||||
if (this.authentications.BasicAuth.username && this.authentications.BasicAuth.password) {
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.BasicAuth.applyToRequest(localVarRequestOptions));
|
||||
}
|
||||
if (this.authentications.BearerAuth.accessToken) {
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.BearerAuth.applyToRequest(localVarRequestOptions));
|
||||
}
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
||||
|
||||
let interceptorPromise = authenticationPromise;
|
||||
for (const interceptor of this.interceptors) {
|
||||
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
||||
}
|
||||
|
||||
return interceptorPromise.then(() => {
|
||||
if (Object.keys(localVarFormParams).length) {
|
||||
if (localVarUseFormData) {
|
||||
(<any>localVarRequestOptions).formData = localVarFormParams;
|
||||
} else {
|
||||
localVarRequestOptions.form = localVarFormParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => {
|
||||
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
} else {
|
||||
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
||||
resolve({ response: response, body: body });
|
||||
} else {
|
||||
reject(new HttpError(response, body, response.statusCode));
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public async apiV1HybridSqlPingsqlGet (options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
|
||||
const localVarPath = this.basePath + '/api/v1/hybrid/sql/pingsql';
|
||||
let localVarQueryParameters: any = {};
|
||||
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
||||
let localVarFormParams: any = {};
|
||||
|
||||
(<any>Object).assign(localVarHeaderParams, options.headers);
|
||||
|
||||
let localVarUseFormData = false;
|
||||
|
||||
let localVarRequestOptions: localVarRequest.Options = {
|
||||
method: 'GET',
|
||||
qs: localVarQueryParameters,
|
||||
headers: localVarHeaderParams,
|
||||
uri: localVarPath,
|
||||
useQuerystring: this._useQuerystring,
|
||||
json: true,
|
||||
};
|
||||
|
||||
let authenticationPromise = Promise.resolve();
|
||||
if (this.authentications.BasicAuth.username && this.authentications.BasicAuth.password) {
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.BasicAuth.applyToRequest(localVarRequestOptions));
|
||||
}
|
||||
if (this.authentications.BearerAuth.accessToken) {
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.BearerAuth.applyToRequest(localVarRequestOptions));
|
||||
}
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
||||
|
||||
let interceptorPromise = authenticationPromise;
|
||||
for (const interceptor of this.interceptors) {
|
||||
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
||||
}
|
||||
|
||||
return interceptorPromise.then(() => {
|
||||
if (Object.keys(localVarFormParams).length) {
|
||||
if (localVarUseFormData) {
|
||||
(<any>localVarRequestOptions).formData = localVarFormParams;
|
||||
} else {
|
||||
localVarRequestOptions.form = localVarFormParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => {
|
||||
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
} else {
|
||||
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
||||
resolve({ response: response, body: body });
|
||||
} else {
|
||||
reject(new HttpError(response, body, response.statusCode));
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,166 @@
|
||||
/**
|
||||
* SQL Server Big Data Cluster API
|
||||
* OpenAPI specification for **SQL Server Big Data Cluster**.
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import localVarRequest = require('request');
|
||||
import http = require('http');
|
||||
|
||||
/* tslint:disable:no-unused-locals */
|
||||
import { ClusterPatchModel } from '../model/clusterPatchModel';
|
||||
import { Authentication, HttpBasicAuth, HttpBearerAuth, Interceptor, ObjectSerializer, VoidAuth } from '../model/models';
|
||||
import { HttpError } from './apis';
|
||||
|
||||
|
||||
|
||||
let defaultBasePath = 'https://0.0.0.0:30080';
|
||||
|
||||
// ===============================================
|
||||
// This file is autogenerated - Please do not edit
|
||||
// ===============================================
|
||||
|
||||
export enum SqlOperatorUpgradeRouterApiApiKeys {
|
||||
}
|
||||
|
||||
export class SqlOperatorUpgradeRouterApi {
|
||||
protected _basePath = defaultBasePath;
|
||||
protected _defaultHeaders : any = {};
|
||||
protected _useQuerystring : boolean = false;
|
||||
|
||||
protected authentications = {
|
||||
'default': <Authentication>new VoidAuth(),
|
||||
'BasicAuth': new HttpBasicAuth(),
|
||||
'BearerAuth': new HttpBearerAuth(),
|
||||
}
|
||||
|
||||
protected interceptors: Interceptor[] = [];
|
||||
|
||||
constructor(basePath?: string);
|
||||
constructor(username: string, password: string, basePath?: string);
|
||||
constructor(basePathOrUsername: string, password?: string, basePath?: string) {
|
||||
if (password) {
|
||||
this.username = basePathOrUsername;
|
||||
this.password = password
|
||||
if (basePath) {
|
||||
this.basePath = basePath;
|
||||
}
|
||||
} else {
|
||||
if (basePathOrUsername) {
|
||||
this.basePath = basePathOrUsername
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
set useQuerystring(value: boolean) {
|
||||
this._useQuerystring = value;
|
||||
}
|
||||
|
||||
set basePath(basePath: string) {
|
||||
this._basePath = basePath;
|
||||
}
|
||||
|
||||
set defaultHeaders(defaultHeaders: any) {
|
||||
this._defaultHeaders = defaultHeaders;
|
||||
}
|
||||
|
||||
get defaultHeaders() {
|
||||
return this._defaultHeaders;
|
||||
}
|
||||
|
||||
get basePath() {
|
||||
return this._basePath;
|
||||
}
|
||||
|
||||
public setDefaultAuthentication(auth: Authentication) {
|
||||
this.authentications.default = auth;
|
||||
}
|
||||
|
||||
public setApiKey(key: SqlOperatorUpgradeRouterApiApiKeys, value: string) {
|
||||
(this.authentications as any)[SqlOperatorUpgradeRouterApiApiKeys[key]].apiKey = value;
|
||||
}
|
||||
|
||||
set username(username: string) {
|
||||
this.authentications.BasicAuth.username = username;
|
||||
}
|
||||
|
||||
set password(password: string) {
|
||||
this.authentications.BasicAuth.password = password;
|
||||
}
|
||||
|
||||
set accessToken(accessToken: string | (() => string)) {
|
||||
this.authentications.BearerAuth.accessToken = accessToken;
|
||||
}
|
||||
|
||||
public addInterceptor(interceptor: Interceptor) {
|
||||
this.interceptors.push(interceptor);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param clusterPatchModel
|
||||
*/
|
||||
public async apiV1HybridSqlPatch (clusterPatchModel?: ClusterPatchModel, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
|
||||
const localVarPath = this.basePath + '/api/v1/hybrid/sql';
|
||||
let localVarQueryParameters: any = {};
|
||||
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
||||
let localVarFormParams: any = {};
|
||||
|
||||
(<any>Object).assign(localVarHeaderParams, options.headers);
|
||||
|
||||
let localVarUseFormData = false;
|
||||
|
||||
let localVarRequestOptions: localVarRequest.Options = {
|
||||
method: 'PATCH',
|
||||
qs: localVarQueryParameters,
|
||||
headers: localVarHeaderParams,
|
||||
uri: localVarPath,
|
||||
useQuerystring: this._useQuerystring,
|
||||
json: true,
|
||||
body: ObjectSerializer.serialize(clusterPatchModel, "ClusterPatchModel")
|
||||
};
|
||||
|
||||
let authenticationPromise = Promise.resolve();
|
||||
if (this.authentications.BasicAuth.username && this.authentications.BasicAuth.password) {
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.BasicAuth.applyToRequest(localVarRequestOptions));
|
||||
}
|
||||
if (this.authentications.BearerAuth.accessToken) {
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.BearerAuth.applyToRequest(localVarRequestOptions));
|
||||
}
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
||||
|
||||
let interceptorPromise = authenticationPromise;
|
||||
for (const interceptor of this.interceptors) {
|
||||
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
||||
}
|
||||
|
||||
return interceptorPromise.then(() => {
|
||||
if (Object.keys(localVarFormParams).length) {
|
||||
if (localVarUseFormData) {
|
||||
(<any>localVarRequestOptions).formData = localVarFormParams;
|
||||
} else {
|
||||
localVarRequestOptions.form = localVarFormParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => {
|
||||
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
} else {
|
||||
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
||||
resolve({ response: response, body: body });
|
||||
} else {
|
||||
reject(new HttpError(response, body, response.statusCode));
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
172
extensions/arc/src/controller/generated/v1/api/tokenRouterApi.ts
Normal file
172
extensions/arc/src/controller/generated/v1/api/tokenRouterApi.ts
Normal file
@@ -0,0 +1,172 @@
|
||||
/**
|
||||
* SQL Server Big Data Cluster API
|
||||
* OpenAPI specification for **SQL Server Big Data Cluster**.
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import localVarRequest = require('request');
|
||||
import http = require('http');
|
||||
|
||||
/* tslint:disable:no-unused-locals */
|
||||
import { Authentication, HttpBasicAuth, HttpBearerAuth, Interceptor, ObjectSerializer, VoidAuth } from '../model/models';
|
||||
import { TokenModel } from '../model/tokenModel';
|
||||
import { HttpError } from './apis';
|
||||
|
||||
|
||||
|
||||
let defaultBasePath = 'https://0.0.0.0:30080';
|
||||
|
||||
// ===============================================
|
||||
// This file is autogenerated - Please do not edit
|
||||
// ===============================================
|
||||
|
||||
export enum TokenRouterApiApiKeys {
|
||||
}
|
||||
|
||||
export class TokenRouterApi {
|
||||
protected _basePath = defaultBasePath;
|
||||
protected _defaultHeaders : any = {};
|
||||
protected _useQuerystring : boolean = false;
|
||||
|
||||
protected authentications = {
|
||||
'default': <Authentication>new VoidAuth(),
|
||||
'BasicAuth': new HttpBasicAuth(),
|
||||
'BearerAuth': new HttpBearerAuth(),
|
||||
}
|
||||
|
||||
protected interceptors: Interceptor[] = [];
|
||||
|
||||
constructor(basePath?: string);
|
||||
constructor(username: string, password: string, basePath?: string);
|
||||
constructor(basePathOrUsername: string, password?: string, basePath?: string) {
|
||||
if (password) {
|
||||
this.username = basePathOrUsername;
|
||||
this.password = password
|
||||
if (basePath) {
|
||||
this.basePath = basePath;
|
||||
}
|
||||
} else {
|
||||
if (basePathOrUsername) {
|
||||
this.basePath = basePathOrUsername
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
set useQuerystring(value: boolean) {
|
||||
this._useQuerystring = value;
|
||||
}
|
||||
|
||||
set basePath(basePath: string) {
|
||||
this._basePath = basePath;
|
||||
}
|
||||
|
||||
set defaultHeaders(defaultHeaders: any) {
|
||||
this._defaultHeaders = defaultHeaders;
|
||||
}
|
||||
|
||||
get defaultHeaders() {
|
||||
return this._defaultHeaders;
|
||||
}
|
||||
|
||||
get basePath() {
|
||||
return this._basePath;
|
||||
}
|
||||
|
||||
public setDefaultAuthentication(auth: Authentication) {
|
||||
this.authentications.default = auth;
|
||||
}
|
||||
|
||||
public setApiKey(key: TokenRouterApiApiKeys, value: string) {
|
||||
(this.authentications as any)[TokenRouterApiApiKeys[key]].apiKey = value;
|
||||
}
|
||||
|
||||
set username(username: string) {
|
||||
this.authentications.BasicAuth.username = username;
|
||||
}
|
||||
|
||||
set password(password: string) {
|
||||
this.authentications.BasicAuth.password = password;
|
||||
}
|
||||
|
||||
set accessToken(accessToken: string | (() => string)) {
|
||||
this.authentications.BearerAuth.accessToken = accessToken;
|
||||
}
|
||||
|
||||
public addInterceptor(interceptor: Interceptor) {
|
||||
this.interceptors.push(interceptor);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public async apiV1TokenPost (options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: TokenModel; }> {
|
||||
const localVarPath = this.basePath + '/api/v1/token';
|
||||
let localVarQueryParameters: any = {};
|
||||
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
||||
const produces = ['application/json'];
|
||||
// give precedence to 'application/json'
|
||||
if (produces.indexOf('application/json') >= 0) {
|
||||
localVarHeaderParams.Accept = 'application/json';
|
||||
} else {
|
||||
localVarHeaderParams.Accept = produces.join(',');
|
||||
}
|
||||
let localVarFormParams: any = {};
|
||||
|
||||
(<any>Object).assign(localVarHeaderParams, options.headers);
|
||||
|
||||
let localVarUseFormData = false;
|
||||
|
||||
let localVarRequestOptions: localVarRequest.Options = {
|
||||
method: 'POST',
|
||||
qs: localVarQueryParameters,
|
||||
headers: localVarHeaderParams,
|
||||
uri: localVarPath,
|
||||
useQuerystring: this._useQuerystring,
|
||||
json: true,
|
||||
};
|
||||
|
||||
let authenticationPromise = Promise.resolve();
|
||||
if (this.authentications.BasicAuth.username && this.authentications.BasicAuth.password) {
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.BasicAuth.applyToRequest(localVarRequestOptions));
|
||||
}
|
||||
if (this.authentications.BearerAuth.accessToken) {
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.BearerAuth.applyToRequest(localVarRequestOptions));
|
||||
}
|
||||
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
||||
|
||||
let interceptorPromise = authenticationPromise;
|
||||
for (const interceptor of this.interceptors) {
|
||||
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
||||
}
|
||||
|
||||
return interceptorPromise.then(() => {
|
||||
if (Object.keys(localVarFormParams).length) {
|
||||
if (localVarUseFormData) {
|
||||
(<any>localVarRequestOptions).formData = localVarFormParams;
|
||||
} else {
|
||||
localVarRequestOptions.form = localVarFormParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.IncomingMessage; body: TokenModel; }>((resolve, reject) => {
|
||||
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
} else {
|
||||
body = ObjectSerializer.deserialize(body, "TokenModel");
|
||||
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
||||
resolve({ response: response, body: body });
|
||||
} else {
|
||||
reject(new HttpError(response, body, response.statusCode));
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user