How to use the @azure/core-http.ServiceClient function in @azure/core-http

To help you get started, we’ve selected a few @azure/core-http 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 / autorest.typescript / test / vanilla / generated / BodyDateTimeRfc1123 / autoRestRFC1123DateTimeTestServiceContext.ts View on Github external
* Copyright (c) Microsoft Corporation. All rights reserved.
 * 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 coreHttp from "@azure/core-http";
import * as Models from "./models";

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

export class AutoRestRFC1123DateTimeTestServiceContext extends coreHttp.ServiceClient {

  /**
   * Initializes a new instance of the AutoRestRFC1123DateTimeTestServiceContext class.
   * @param [options] The parameter options
   */
  constructor(options?: Models.AutoRestRFC1123DateTimeTestServiceOptions) {
    if (!options) {
      options = {};
    }

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

    super(undefined, options);
github Azure / autorest.typescript / test / vanilla / generated / Validation / autoRestValidationTestContext.ts View on Github external
* Copyright (c) Microsoft Corporation. All rights reserved.
 * 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 coreHttp from "@azure/core-http";
import * as Models from "./models";

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

export class AutoRestValidationTestContext extends coreHttp.ServiceClient {
  subscriptionId: string;
  apiVersion: string;

  /**
   * Initializes a new instance of the AutoRestValidationTestContext class.
   * @param subscriptionId Subscription ID.
   * @param apiVersion Required string following pattern \d{2}-\d{2}-\d{4}
   * @param [options] The parameter options
   */
  constructor(subscriptionId: string, apiVersion: string, options?: Models.AutoRestValidationTestOptions) {
    if (subscriptionId == undefined) {
      throw new Error("'subscriptionId' cannot be null.");
    }
    if (apiVersion == undefined) {
      throw new Error("'apiVersion' cannot be null.");
    }
github Azure / autorest.typescript / test / vanilla / generated / BodyInteger / autoRestIntegerTestServiceContext.ts View on Github external
* Copyright (c) Microsoft Corporation. All rights reserved.
 * 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 coreHttp from "@azure/core-http";
import * as Models from "./models";

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

export class AutoRestIntegerTestServiceContext extends coreHttp.ServiceClient {

  /**
   * Initializes a new instance of the AutoRestIntegerTestServiceContext class.
   * @param [options] The parameter options
   */
  constructor(options?: Models.AutoRestIntegerTestServiceOptions) {
    if (!options) {
      options = {};
    }

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

    super(undefined, options);
github Azure / autorest.typescript / test / vanilla / generated / ParameterFlattening / autoRestParameterFlatteningContext.ts View on Github external
* Copyright (c) Microsoft Corporation. All rights reserved.
 * 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 coreHttp from "@azure/core-http";
import * as Models from "./models";

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

export class AutoRestParameterFlatteningContext extends coreHttp.ServiceClient {

  /**
   * Initializes a new instance of the AutoRestParameterFlatteningContext class.
   * @param [options] The parameter options
   */
  constructor(options?: Models.AutoRestParameterFlatteningOptions) {
    if (!options) {
      options = {};
    }

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

    super(undefined, options);
github Azure / autorest.typescript / test / vanilla / generated / CustomBaseUri / autoRestParameterizedHostTestClientContext.ts View on Github external
* Copyright (c) Microsoft Corporation. All rights reserved.
 * 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 coreHttp from "@azure/core-http";
import * as Models from "./models";

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

export class AutoRestParameterizedHostTestClientContext extends coreHttp.ServiceClient {
  host?: string;

  /**
   * Initializes a new instance of the AutoRestParameterizedHostTestClientContext class.
   * @param [options] The parameter options
   */
  constructor(options?: Models.AutoRestParameterizedHostTestClientOptions) {
    if (!options) {
      options = {};
    }

    if (!options.userAgent) {
      const defaultUserAgent = coreHttp.getDefaultUserAgentValue();
      options.userAgent = `${packageName}/${packageVersion} ${defaultUserAgent}`;
    }
github Azure / autorest.typescript / test / vanilla / generated / CompositeBoolIntClient / compositeBoolIntContext.ts View on Github external
* Copyright (c) Microsoft Corporation. All rights reserved.
 * 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 coreHttp from "@azure/core-http";
import * as Models from "./models";

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

export class CompositeBoolIntContext extends coreHttp.ServiceClient {

  /**
   * Initializes a new instance of the CompositeBoolIntContext class.
   * @param [options] The parameter options
   */
  constructor(options?: Models.CompositeBoolIntOptions) {
    if (!options) {
      options = {};
    }

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

    super(undefined, options);
github Azure / autorest.typescript / test / vanilla / generated / BodyComplex / autoRestComplexTestServiceContext.ts View on Github external
* Copyright (c) Microsoft Corporation. All rights reserved.
 * 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 coreHttp from "@azure/core-http";
import * as Models from "./models";

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

export class AutoRestComplexTestServiceContext extends coreHttp.ServiceClient {
  apiVersion: string;

  /**
   * Initializes a new instance of the AutoRestComplexTestServiceContext class.
   * @param [options] The parameter options
   */
  constructor(options?: Models.AutoRestComplexTestServiceOptions) {
    if (!options) {
      options = {};
    }

    if (!options.userAgent) {
      const defaultUserAgent = coreHttp.getDefaultUserAgentValue();
      options.userAgent = `${packageName}/${packageVersion} ${defaultUserAgent}`;
    }
github Azure / autorest.typescript / test / vanilla / generated / BodyBoolean / autoRestBoolTestServiceContext.ts View on Github external
* Copyright (c) Microsoft Corporation. All rights reserved.
 * 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 coreHttp from "@azure/core-http";
import * as Models from "./models";

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

export class AutoRestBoolTestServiceContext extends coreHttp.ServiceClient {

  /**
   * Initializes a new instance of the AutoRestBoolTestServiceContext class.
   * @param [options] The parameter options
   */
  constructor(options?: Models.AutoRestBoolTestServiceOptions) {
    if (!options) {
      options = {};
    }

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

    super(undefined, options);
github Azure / autorest.typescript / test / vanilla / generated / Url / autoRestUrlTestServiceContext.ts View on Github external
* Copyright (c) Microsoft Corporation. All rights reserved.
 * 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 coreHttp from "@azure/core-http";
import * as Models from "./models";

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

export class AutoRestUrlTestServiceContext extends coreHttp.ServiceClient {
  globalStringPath: string;
  globalStringQuery?: string;

  /**
   * Initializes a new instance of the AutoRestUrlTestServiceContext class.
   * @param globalStringPath A string value 'globalItemStringPath' that appears in the path
   * @param [options] The parameter options
   */
  constructor(globalStringPath: string, options?: Models.AutoRestUrlTestServiceOptions) {
    if (globalStringPath == undefined) {
      throw new Error("'globalStringPath' cannot be null.");
    }

    if (!options) {
      options = {};
    }
github Azure / azure-sdk-for-js / sdk / storage / storage-queue / src / generated / lib / storageClientContext.ts View on Github external
/*
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * 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 msRest from "@azure/core-http";

const packageName = "azure-storage-queue";
const packageVersion = "1.0.0";

export class StorageClientContext extends msRest.ServiceClient {
  url: string;
  version: string;

  /**
   * Initializes a new instance of the StorageClientContext class.
   * @param url The URL of the service account, queue or message that is the targe of the desired
   * operation.
   * @param [options] The parameter options
   */
  constructor(url: string, options?: msRest.ServiceClientOptions) {
    if (url === null || url === undefined) {
      throw new Error('\'url\' cannot be null.');
    }

    if (!options) {
      options = {};