How to use @azure/ms-rest-azure-js - 10 common examples

To help you get started, we’ve selected a few @azure/ms-rest-azure-js examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Azure-Samples / cognitive-services-personalizer-samples / quickstarts / node / sample.js View on Github external
async function main() {

  // 
  // The key specific to your personalization service instance; e.g. "0123456789abcdef0123456789ABCDEF"
  let serviceKey = process.env.PERSONALIZER_KEY;

  // The endpoint specific to your personalization service instance; 
  // e.g. https://westus2.api.cognitive.microsoft.com
  let baseUri = process.env.PERSONALIZER_ENDPOINT;
  // 

  // 
  let credentials = new CognitiveServicesCredentials(serviceKey);

  // Initialize Personalization client.
  let personalizerClient = new Personalizer.PersonalizerClient(credentials, baseUri);
  // 


  // 
  let runLoop = true;

  do {

    // 
    let rankRequest = {}

    // Generate an ID to associate with the request.
    rankRequest.eventId = uuidv1();
github Azure-Samples / cognitive-services-quickstart-code / javascript / Personalizer / sample.js View on Github external
async function main() {

  // 
  // The key specific to your personalization service instance; e.g. "0123456789abcdef0123456789ABCDEF"
  const serviceKey = "REPLACE-WITH-YOUR-PERSONALIZER-KEY";

  // The endpoint specific to your personalization service instance; 
  // e.g. https://.cognitiveservices.azure.com
  const baseUri = "https://REPLACE-WITH-YOUR-PERSONALIZER-RESOURCE-NAME.cognitiveservices.azure.com";
  // 

  // 
  const credentials = new CognitiveServicesCredentials(serviceKey);

  // Initialize Personalization client.
  const personalizerClient = new Personalizer.PersonalizerClient(credentials, baseUri);
  // 


  // 
  let runLoop = true;

  do {

    // 
    let rankRequest = {}

    // Generate an ID to associate with the request.
    rankRequest.eventId = uuidv1();
github Azure / autorest.typescript / test / azure / generated / SubscriptionIdApiVersion / microsoftAzureTestUrlContext.ts View on Github external
* Licensed under the MIT License. See License.txt in the project root for
 * license information.
 *
 * Code generated by Microsoft (R) AutoRest Code Generator.
 * Changes may cause incorrect behavior and will be lost if the code is
 * regenerated.
 */

import * as Models from "./models";
import * as coreHttp from "@azure/core-http";
import * as msRestAzure from "@azure/ms-rest-azure-js";

const packageName = "";
const packageVersion = "";

export class MicrosoftAzureTestUrlContext extends msRestAzure.AzureServiceClient {
  credentials: coreHttp.ServiceClientCredentials | coreHttp.TokenCredential;
  subscriptionId: string;
  apiVersion?: string;

  /**
   * Initializes a new instance of the MicrosoftAzureTestUrl class.
   * @param credentials Credentials needed for the client to connect to Azure.
   * @param subscriptionId Subscription Id.
   * @param [options] The parameter options
   */
  constructor(credentials: coreHttp.ServiceClientCredentials | coreHttp.TokenCredential, subscriptionId: string, options?: Models.MicrosoftAzureTestUrlOptions) {
    if (credentials == undefined) {
      throw new Error('\'credentials\' cannot be null.');
    }
    if (subscriptionId == undefined) {
      throw new Error('\'subscriptionId\' cannot be null.');
github Azure / azure-sdk-for-js / sdk / resourcehealth / arm-resourcehealth / src / microsoftResourceHealthContext.ts View on Github external
constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, options?: Models.MicrosoftResourceHealthOptions) {
    if (credentials == undefined) {
      throw new Error('\'credentials\' cannot be null.');
    }
    if (subscriptionId == undefined) {
      throw new Error('\'subscriptionId\' cannot be null.');
    }

    if (!options) {
      options = {};
    }
    if(!options.userAgent) {
      const defaultUserAgent = msRestAzure.getDefaultUserAgentValue();
      options.userAgent = `${packageName}/${packageVersion} ${defaultUserAgent}`;
    }

    super(credentials, options);

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

    if(options.acceptLanguage !== null && options.acceptLanguage !== undefined) {
      this.acceptLanguage = options.acceptLanguage;
    }
github Azure / azure-sdk-for-js / sdk / storagesync / arm-storagesync / src / storageSyncManagementClientContext.ts View on Github external
constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, options?: Models.StorageSyncManagementClientOptions) {
    if (credentials == undefined) {
      throw new Error('\'credentials\' cannot be null.');
    }
    if (subscriptionId == undefined) {
      throw new Error('\'subscriptionId\' cannot be null.');
    }

    if (!options) {
      options = {};
    }
    if(!options.userAgent) {
      const defaultUserAgent = msRestAzure.getDefaultUserAgentValue();
      options.userAgent = `${packageName}/${packageVersion} ${defaultUserAgent}`;
    }

    super(credentials, options);

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

    if(options.acceptLanguage !== null && options.acceptLanguage !== undefined) {
      this.acceptLanguage = options.acceptLanguage;
    }
github Azure / azure-sdk-for-js / sdk / managedapplications / arm-managedapplications / src / managedApplicationClientContext.ts View on Github external
constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, options?: Models.ManagedApplicationClientOptions) {
    if (credentials == undefined) {
      throw new Error('\'credentials\' cannot be null.');
    }
    if (subscriptionId == undefined) {
      throw new Error('\'subscriptionId\' cannot be null.');
    }

    if (!options) {
      options = {};
    }
    if(!options.userAgent) {
      const defaultUserAgent = msRestAzure.getDefaultUserAgentValue();
      options.userAgent = `${packageName}/${packageVersion} ${defaultUserAgent}`;
    }

    super(credentials, options);

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

    if(options.acceptLanguage !== null && options.acceptLanguage !== undefined) {
      this.acceptLanguage = options.acceptLanguage;
    }
github Azure / azure-sdk-for-js / packages / @azure / arm-recoveryservices-siterecovery / lib / siteRecoveryManagementClientContext.ts View on Github external
}
    if (subscriptionId == undefined) {
      throw new Error('\'subscriptionId\' cannot be null.');
    }
    if (resourceGroupName == undefined) {
      throw new Error('\'resourceGroupName\' cannot be null.');
    }
    if (resourceName == undefined) {
      throw new Error('\'resourceName\' cannot be null.');
    }

    if (!options) {
      options = {};
    }
    if(!options.userAgent) {
      const defaultUserAgent = msRestAzure.getDefaultUserAgentValue();
      options.userAgent = `${packageName}/${packageVersion} ${defaultUserAgent}`;
    }

    super(credentials, options);

    this.apiVersion = '2018-01-10';
    this.acceptLanguage = 'en-US';
    this.longRunningOperationRetryTimeout = 30;
    this.baseUri = options.baseUri || this.baseUri || "https://management.azure.com";
    this.requestContentType = "application/json; charset=utf-8";
    this.credentials = credentials;
    this.subscriptionId = subscriptionId;
    this.resourceGroupName = resourceGroupName;
    this.resourceName = resourceName;

    if(options.acceptLanguage !== null && options.acceptLanguage !== undefined) {
github Azure / azure-sdk-for-js / sdk / security / arm-security / src / securityCenterContext.ts View on Github external
constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, ascLocation: string, options?: Models.SecurityCenterOptions) {
    if (credentials == undefined) {
      throw new Error('\'credentials\' cannot be null.');
    }
    if (subscriptionId == undefined) {
      throw new Error('\'subscriptionId\' cannot be null.');
    }
    if (ascLocation == undefined) {
      throw new Error('\'ascLocation\' cannot be null.');
    }

    if (!options) {
      options = {};
    }
    if(!options.userAgent) {
      const defaultUserAgent = msRestAzure.getDefaultUserAgentValue();
      options.userAgent = `${packageName}/${packageVersion} ${defaultUserAgent}`;
    }

    super(credentials, options);

    this.acceptLanguage = 'en-US';
    this.longRunningOperationRetryTimeout = 30;
    this.baseUri = options.baseUri || this.baseUri || "https://management.azure.com";
    this.requestContentType = "application/json; charset=utf-8";
    this.credentials = credentials;
    this.subscriptionId = subscriptionId;
    this.ascLocation = ascLocation;

    if(options.acceptLanguage !== null && options.acceptLanguage !== undefined) {
      this.acceptLanguage = options.acceptLanguage;
    }
github Azure / azure-sdk-for-js / packages / @azure / arm-customerinsights / lib / customerInsightsManagementClientContext.ts View on Github external
constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, options?: Models.CustomerInsightsManagementClientOptions) {
    if (credentials == undefined) {
      throw new Error('\'credentials\' cannot be null.');
    }
    if (subscriptionId == undefined) {
      throw new Error('\'subscriptionId\' cannot be null.');
    }

    if (!options) {
      options = {};
    }
    if(!options.userAgent) {
      const defaultUserAgent = msRestAzure.getDefaultUserAgentValue();
      options.userAgent = `${packageName}/${packageVersion} ${defaultUserAgent}`;
    }

    super(credentials, options);

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

    if(options.acceptLanguage !== null && options.acceptLanguage !== undefined) {
      this.acceptLanguage = options.acceptLanguage;
    }
github Azure / azure-sdk-for-js / packages / @azure / arm-timeseriesinsights / lib / timeSeriesInsightsClientContext.ts View on Github external
constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, options?: Models.TimeSeriesInsightsClientOptions) {
    if (credentials == undefined) {
      throw new Error('\'credentials\' cannot be null.');
    }
    if (subscriptionId == undefined) {
      throw new Error('\'subscriptionId\' cannot be null.');
    }

    if (!options) {
      options = {};
    }
    if(!options.userAgent) {
      const defaultUserAgent = msRestAzure.getDefaultUserAgentValue();
      options.userAgent = `${packageName}/${packageVersion} ${defaultUserAgent}`;
    }

    super(credentials, options);

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

    if(options.acceptLanguage !== null && options.acceptLanguage !== undefined) {
      this.acceptLanguage = options.acceptLanguage;
    }

@azure/ms-rest-azure-js

Isomorphic Azure client runtime for Typescript/node.js/browser javascript client libraries generated using AutoRest

MIT
Latest version published 4 years ago

Package Health Score

56 / 100
Full package analysis