How to use the @azure/core-http.getDefaultUserAgentValue 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 / Validation / autoRestValidationTestContext.ts View on Github external
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.");
    }

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

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

    super(undefined, options);

    this.baseUri = options.baseUri || this.baseUri || "http://localhost:3000";
    this.requestContentType = "application/json; charset=utf-8";
    this.subscriptionId = subscriptionId;
    this.apiVersion = apiVersion;
  }
}
github Azure / autorest.typescript / test / vanilla / generated / CustomBaseUriMoreOptions / autoRestParameterizedCustomHostTestClientContext.ts View on Github external
constructor(subscriptionId: string, options?: Models.AutoRestParameterizedCustomHostTestClientOptions) {
    if (subscriptionId == undefined) {
      throw new Error("'subscriptionId' cannot be null.");
    }

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

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

    super(undefined, options);

    this.dnsSuffix = 'host';
    this.baseUri = "{vault}{secret}{dnsSuffix}";
    this.requestContentType = "application/json; charset=utf-8";
    this.subscriptionId = subscriptionId;
    if (options.dnsSuffix !== null && options.dnsSuffix !== undefined) {
      this.dnsSuffix = options.dnsSuffix;
    }
  }
}
github Azure / autorest.typescript / test / vanilla / generated / BodyDateTime / autoRestDateTimeTestServiceContext.ts View on Github external
constructor(options?: Models.AutoRestDateTimeTestServiceOptions) {
    if (!options) {
      options = {};
    }

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

    super(undefined, options);

    this.baseUri = options.baseUri || this.baseUri || "http://localhost:3000";
    this.requestContentType = "application/json; charset=utf-8";
  }
}
github Azure / autorest.typescript / test / vanilla / generated / CustomBaseUri / autoRestParameterizedHostTestClientContext.ts View on Github external
constructor(options?: Models.AutoRestParameterizedHostTestClientOptions) {
    if (!options) {
      options = {};
    }

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

    super(undefined, options);

    this.host = 'host';
    this.baseUri = "http://{accountName}{host}";
    this.requestContentType = "application/json; charset=utf-8";
    if (options.host !== null && options.host !== undefined) {
      this.host = options.host;
    }
  }
}
github Azure / autorest.typescript / test / vanilla / generated / BodyDictionary / autoRestSwaggerBATdictionaryServiceContext.ts View on Github external
constructor(options?: Models.AutoRestSwaggerBATdictionaryServiceOptions) {
    if (!options) {
      options = {};
    }

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

    super(undefined, options);

    this.baseUri = options.baseUri || this.baseUri || "http://localhost:3000";
    this.requestContentType = "application/json; charset=utf-8";
  }
}
github Azure / autorest.typescript / test / vanilla / generated / ComplexModelClient / complexModelClientContext.ts View on Github external
constructor(options?: Models.ComplexModelClientOptions) {
    if (!options) {
      options = {};
    }

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

    super(undefined, options);

    this.subscriptionId = '123456';
    this.apiVersion = '2014-04-01-preview';
    this.baseUri = options.baseUri || this.baseUri || "http://localhost:3000";
    this.requestContentType = "application/json; charset=utf-8";
  }
}
github Azure / autorest.typescript / test / vanilla / generated / XMSErrorResponses / xMSErrorResponseExtensionsContext.ts View on Github external
constructor(options?: Models.XMSErrorResponseExtensionsOptions) {
    if (!options) {
      options = {};
    }

    if (!options.userAgent) {
      const defaultUserAgent = coreHttp.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 / autorest.typescript / test / vanilla / generated / BodyByte / autoRestSwaggerBATByteServiceContext.ts View on Github external
constructor(options?: Models.AutoRestSwaggerBATByteServiceOptions) {
    if (!options) {
      options = {};
    }

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

    super(undefined, options);

    this.baseUri = options.baseUri || this.baseUri || "http://localhost:3000";
    this.requestContentType = "application/json; charset=utf-8";
  }
}
github Azure / azure-sdk-for-js / sdk / keyvault / keyvault-secrets / src / core / keyVaultClientContext.ts View on Github external
apiVersion: string,
    options?: coreHttp.ServiceClientOptions
  ) {
    if (apiVersion == undefined) {
      throw new Error("'apiVersion' cannot be null.");
    }
    if (credentials == undefined) {
      throw new Error("'credentials' cannot be null.");
    }

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

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

    super(credentials, options);

    this.baseUri = "{vaultBaseUrl}";
    this.requestContentType = "application/json; charset=utf-8";
    this.apiVersion = apiVersion;
    this.credentials = credentials;
  }
}
github Azure / azure-sdk-for-js / sdk / keyvault / keyvault-keys / src / core / keyVaultClientContext.ts View on Github external
apiVersion: string,
    options?: coreHttp.ServiceClientOptions
  ) {
    if (apiVersion == undefined) {
      throw new Error("'apiVersion' cannot be null.");
    }
    if (credentials == undefined) {
      throw new Error("'credentials' cannot be null.");
    }

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

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

    super(credentials, options);

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