How to use the @azure/ms-rest-js.getDefaultUserAgentValue function in @azure/ms-rest-js

To help you get started, we’ve selected a few @azure/ms-rest-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 / azure-sdk-for-js / sdk / cognitiveservices / cognitiveservices-videosearch / src / videoSearchClientContext.ts View on Github external
constructor(credentials: msRest.ServiceClientCredentials, options?: Models.VideoSearchClientOptions) {
    if (credentials == undefined) {
      throw new Error("'credentials' cannot be null.");
    }

    if (!options) {
      options = {};
    }

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

    super(credentials, options);

    this.endpoint = 'https://api.cognitive.microsoft.com';
    this.baseUri = "{Endpoint}/bing/v7.0";
    this.requestContentType = "application/json; charset=utf-8";
    this.credentials = credentials;
    if (options.endpoint !== null && options.endpoint !== undefined) {
      this.endpoint = options.endpoint;
    }
  }
}
github Azure / azure-sdk-for-js / sdk / cognitiveservices / cognitiveservices-anomalydetector / src / anomalyDetectorClientContext.ts View on Github external
constructor(credentials: msRest.ServiceClientCredentials, endpoint: string, options?: msRest.ServiceClientOptions) {
    if (endpoint == undefined) {
      throw new Error("'endpoint' cannot be null.");
    }
    if (credentials == undefined) {
      throw new Error("'credentials' cannot be null.");
    }

    if (!options) {
      options = {};
    }

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

    super(credentials, options);

    this.baseUri = "{Endpoint}/anomalydetector/v1.0";
    this.requestContentType = "application/json; charset=utf-8";
    this.endpoint = endpoint;
    this.credentials = credentials;
  }
}
github Azure / Industrial-IoT / api / generated / typescript / azure-iiot-opc-twin / lib / azureOpcTwinClientContext.ts View on Github external
constructor(credentials: msRest.ServiceClientCredentials, options?: Models.AzureOpcTwinClientOptions) {
    if (credentials === null || credentials === undefined) {
      throw new Error('\'credentials\' cannot be null.');
    }

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

    super(credentials, options);

    this.baseUri = options.baseUri || this.baseUri || "http://localhost";
    this.requestContentType = "application/json-patch+json; charset=utf-8";
    this.credentials = credentials;

  }
}
github Azure / azure-sdk-for-js / sdk / cognitiveservices / cognitiveservices-customvision-prediction / src / predictionAPIClientContext.ts View on Github external
constructor(apiKey: string, endpoint: string, options?: msRest.ServiceClientOptions) {
    if (apiKey == undefined) {
      throw new Error("'apiKey' cannot be null.");
    }
    if (endpoint == undefined) {
      throw new Error("'endpoint' cannot be null.");
    }

    if (!options) {
      options = {};
    }

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

    super(undefined, options);

    this.baseUri = "{Endpoint}/customvision/v3.0/prediction";
    this.requestContentType = "application/json; charset=utf-8";
    this.apiKey = apiKey;
    this.endpoint = endpoint;
  }
}
github Azure / azure-sdk-for-js / sdk / cognitiveservices / cognitiveservices-entitysearch / src / entitySearchClientContext.ts View on Github external
constructor(credentials: msRest.ServiceClientCredentials, options?: Models.EntitySearchClientOptions) {
    if (credentials == undefined) {
      throw new Error("'credentials' cannot be null.");
    }

    if (!options) {
      options = {};
    }

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

    super(credentials, options);

    this.endpoint = 'https://api.cognitive.microsoft.com';
    this.baseUri = "{Endpoint}/bing/v7.0";
    this.requestContentType = "application/json; charset=utf-8";
    this.credentials = credentials;
    if (options.endpoint !== null && options.endpoint !== undefined) {
      this.endpoint = options.endpoint;
    }
  }
}
github microsoft / botbuilder-tools / packages / LUIS / src / luisAuthoringContext.ts View on Github external
constructor(endpoint: string, credentials: msRest.ServiceClientCredentials, options?: msRest.ServiceClientOptions) {
    if (endpoint === null || endpoint === undefined) {
      throw new Error('\'endpoint\' cannot be null.');
    }
    if (credentials === null || credentials === undefined) {
      throw new Error('\'credentials\' cannot be null.');
    }

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

    super(credentials, options);

    this.baseUri = "{Endpoint}";
    this.requestContentType = "application/json; charset=utf-8";
    this.endpoint = endpoint;
    this.credentials = credentials;

  }
}
github Azure / azure-sdk-for-js / sdk / cognitiveservices / cognitiveservices-autosuggest / src / autoSuggestClientContext.ts View on Github external
constructor(credentials: msRest.ServiceClientCredentials, options?: Models.AutoSuggestClientOptions) {
    if (credentials == undefined) {
      throw new Error("'credentials' cannot be null.");
    }

    if (!options) {
      options = {};
    }

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

    super(credentials, options);

    this.endpoint = 'https://api.cognitive.microsoft.com';
    this.baseUri = "{Endpoint}/bing/v7.0";
    this.requestContentType = "application/json; charset=utf-8";
    this.credentials = credentials;
    if (options.endpoint !== null && options.endpoint !== undefined) {
      this.endpoint = options.endpoint;
    }
  }
}
github btmorr / leifdb / ui / src / leifDbClientAPIContext.ts View on Github external
constructor(options?: Models.LeifDbClientAPIOptions) {
    if (!options) {
      options = {};
    }

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

    super(undefined, options);

    this.baseUri = options.baseUri || this.baseUri || "http://localhost";
    this.requestContentType = "application/json; charset=utf-8";
  }
}
github Azure / azure-sdk-for-js / packages / @azure / cognitiveservices-videosearch / lib / videoSearchClientContext.ts View on Github external
constructor(credentials: msRest.ServiceClientCredentials, options?: Models.VideoSearchClientOptions) {
    if (credentials === null || credentials === undefined) {
      throw new Error('\'credentials\' cannot be null.');
    }

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

    super(credentials, options);

    this.endpoint = 'https://api.cognitive.microsoft.com';
    this.baseUri = "{Endpoint}";
    this.requestContentType = "application/json; charset=utf-8";
    this.credentials = credentials;

    if(options.endpoint !== null && options.endpoint !== undefined) {
      this.endpoint = options.endpoint;
    }
  }
}
github Azure / azure-sdk-for-js / sdk / cognitiveservices / cognitiveservices-formrecognizer / src / formRecognizerClientContext.ts View on Github external
constructor(credentials: msRest.ServiceClientCredentials, endpoint: string, options?: msRest.ServiceClientOptions) {
    if (endpoint == undefined) {
      throw new Error("'endpoint' cannot be null.");
    }
    if (credentials == undefined) {
      throw new Error("'credentials' cannot be null.");
    }

    if (!options) {
      options = {};
    }

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

    super(credentials, options);

    this.baseUri = "{Endpoint}/formrecognizer/v1.0-preview";
    this.requestContentType = "application/json; charset=utf-8";
    this.endpoint = endpoint;
    this.credentials = credentials;
  }
}