static fromSharedAccessSignature()

in src/job_client.ts [421:434]


  static fromSharedAccessSignature(sharedAccessSignature: string): JobClient {
    /*Codes_SRS_NODE_JOB_CLIENT_16_004: [The `fromSharedAccessSignature` method shall throw a `ReferenceError` if `sharedAccessSignature` is falsy.]*/
    if (!sharedAccessSignature) throw new ReferenceError('sharedAccessSignature cannot be \'' + sharedAccessSignature + '\'');

    const sas = SharedAccessSignature.parse(sharedAccessSignature);
    const config = {
      host: sas.sr,
      sharedAccessSignature: sharedAccessSignature,
      tokenCredential: undefined
    };

    /*Codes_SRS_NODE_JOB_CLIENT_16_005: [The `fromSharedAccessSignature` method shall return a new `JobClient` instance.]*/
    return new JobClient(new RestApiClient(config, packageJson.name + '/' + packageJson.version));
  }