@azure/arm-resourcegraph
Version:
ResourceGraphClient Library with typescript type definitions for node.js and browser.
55 lines • 2.56 kB
JavaScript
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is
* regenerated.
*/
import { __extends } from "tslib";
import * as msRestAzure from "@azure/ms-rest-azure-js";
var packageName = "@azure/arm-resourcegraph";
var packageVersion = "4.2.1";
var ResourceGraphClientContext = /** @class */ (function (_super) {
__extends(ResourceGraphClientContext, _super);
/**
* Initializes a new instance of the ResourceGraphClient class.
* @param credentials Credentials needed for the client to connect to Azure. Credentials
* implementing the TokenCredential interface from the @azure/identity package are recommended. For
* more information about these credentials, see
* {@link https://www.npmjs.com/package/@azure/identity}. Credentials implementing the
* ServiceClientCredentials interface from the older packages @azure/ms-rest-nodeauth and
* @azure/ms-rest-browserauth are also supported.
* @param [options] The parameter options
*/
function ResourceGraphClientContext(credentials, options) {
var _this = this;
if (credentials == undefined) {
throw new Error("'credentials' cannot be null.");
}
if (!options) {
options = {};
}
if (!options.userAgent) {
var defaultUserAgent = msRestAzure.getDefaultUserAgentValue();
options.userAgent = packageName + "/" + packageVersion + " " + defaultUserAgent;
}
_this = _super.call(this, credentials, options) || this;
_this.acceptLanguage = "en-US";
_this.longRunningOperationRetryTimeout = 30;
_this.baseUri = options.baseUri || _this.baseUri || "https://management.azure.com";
_this.requestContentType = "application/json; charset=utf-8";
_this.credentials = credentials;
if (options.acceptLanguage !== null && options.acceptLanguage !== undefined) {
_this.acceptLanguage = options.acceptLanguage;
}
if (options.longRunningOperationRetryTimeout !== null &&
options.longRunningOperationRetryTimeout !== undefined) {
_this.longRunningOperationRetryTimeout = options.longRunningOperationRetryTimeout;
}
return _this;
}
return ResourceGraphClientContext;
}(msRestAzure.AzureServiceClient));
export { ResourceGraphClientContext };
//# sourceMappingURL=resourceGraphClientContext.js.map