lib/services/mediaServicesManagement/lib/operations/streamingLocators.js
/**
   * @summary Create a Streaming Locator
   *
   * Create a Streaming Locator in the Media Services account
   *
   * @param {string} resourceGroupName The name of the resource group within the
   * Azure subscription.
   *
   * @param {string} accountName The Media Services account name.
   *
   * @param {string} streamingLocatorName The Streaming Locator name.
   *
   * @param {object} parameters The request parameters
   *
   * @param {string} parameters.assetName Asset Name
   *
   * @param {date} [parameters.startTime] StartTime of Streaming Locator
   *
   * @param {date} [parameters.endTime] EndTime of Streaming Locator
   *
   * @param {uuid} [parameters.streamingLocatorId] StreamingLocatorId of
   * Streaming Locator
   *
   * @param {string} parameters.streamingPolicyName Streaming policy name used by
   * this streaming locator. Either specify the name of streaming policy you
   * created or use one of the predefined streaming polices. The predefined
   * streaming policies available are: 'Predefined_DownloadOnly',
   * 'Predefined_ClearStreamingOnly', 'Predefined_DownloadAndClearStreaming',
   * 'Predefined_ClearKey', 'Predefined_SecureStreaming' and
   * 'Predefined_SecureStreamingWithFairPlay'
   *
   * @param {string} [parameters.defaultContentKeyPolicyName] Default
   * ContentKeyPolicy used by this Streaming Locator
   *
   * @param {array} [parameters.contentKeys] ContentKeys used by this Streaming
   * Locator
   *
   * @param {string} [parameters.alternativeMediaId] An Alternative Media
   * Identifier associated with the StreamingLocator.  This identifier can be
   * used to distinguish different StreamingLocators for the same Asset for
   * authorization purposes in the CustomLicenseAcquisitionUrlTemplate or the
   * CustomKeyAcquisitionUrlTemplate of the StreamingPolicy specified in the
   * StreamingPolicyName field.
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @param {function} [optionalCallback] - The optional callback.
   *
   * @returns {function|Promise} If a callback was passed as the last parameter
   * then it returns the callback else returns a Promise.
   *
   * {Promise} A promise is returned
   *
   *                      @resolve {StreamingLocator} - The deserialized result object.
   *
   *                      @reject {Error} - The error object.
   *
   * {function} optionalCallback(err, result, request, response)
   *
   *                      {Error}  err        - The Error object if an error occurred, null otherwise.
   *
   *                      {object} [result]   - The deserialized result object if an error did not occur.
   *                      See {@link StreamingLocator} for more information.
   *
   *                      {object} [request]  - The HTTP Request object if an error did not occur.
   *
   *                      {stream} [response] - The HTTP Response stream if an error did not occur.
   */
@summary Create a Streaming Locator
Create a Streaming Locator in the Media Services account

@param {string} resourceGroupName The name of the resource group within the
Azure subscription.

@param {string} accountName The Media Services account name.

@param {string} streamingLocatorName The Streaming Locator name.

@param {object} parameters The request parameters

@param {string} parameters.assetName Asset Name

@param {date} [parameters.startTime] StartTime of Streaming Locator

@param {date} [parameters.endTime] EndTime of Streaming Locator

@param {uuid} [parameters.streamingLocatorId] StreamingLocatorId of
Streaming Locator

@param {string} parameters.streamingPolicyName Streaming policy name used by
this streaming locator. Either specify the name of streaming policy you
created or use one of the predefined streaming polices.

@param {string} [parameters.defaultContentKeyPolicyName] Default
ContentKeyPolicy used by this Streaming Locator

@param {array} [parameters.contentKeys] ContentKeys used by this Streaming
Locator

@param {string} [parameters.alternativeMediaId] An Alternative Media
Identifier associated with the StreamingLocator.  This identifier can be
used to distinguish different StreamingLocators for the same Asset for
authorization purposes in the CustomLicenseAcquisitionUrlTemplate or the
CustomKeyAcquisitionUrlTemplate of the StreamingPolicy specified in the
StreamingPolicyName field.

@param {object} [options] Optional Parameters.

@param {object} [options.customHeaders] Headers that will be added to the
request

@param {function} [optionalCallback] - The optional callback.

@returns {function|Promise} If a callback was passed as the last parameter
then it returns the callback else returns a Promise.

{Promise} A promise is returned

@resolve {StreamingLocator} - The deserialized result object.

@reject {Error} - The error object.

{function} optionalCallback(err, result, request, response)

{Error}  err        - The Error object if an error occurred, null otherwise.

{object} [result]   - The deserialized result object if an error did not occur.
See  StreamingLocator for more information.

{object} [request]  - The HTTP Request object if an error did not occur.

{stream} [response] - The HTTP Response stream if an error did not occur.
@summary Create a Streaming Locator Create a Streaming Locator in the Media Services account @param { string } resourceGroupName The name of the resource group within the Azure subscription . @param { string } accountName The Media Services account name . @param { string } streamingLocatorName The Streaming Locator name . @param { object } parameters The request parameters @param { string } parameters . assetName Asset Name @param { date } [ parameters . startTime ] StartTime of Streaming Locator @param { date } [ parameters . endTime ] EndTime of Streaming Locator @param { uuid } [ parameters . streamingLocatorId ] StreamingLocatorId of Streaming Locator @param { string } parameters . streamingPolicyName Streaming policy name used by this streaming locator . Either specify the name of streaming policy you created or use one of the predefined streaming polices . @param { string } [ parameters . defaultContentKeyPolicyName ] Default ContentKeyPolicy used by this Streaming Locator @param { array } [ parameters . contentKeys ] ContentKeys used by this Streaming Locator @param { string } [ parameters . alternativeMediaId ] An Alternative Media Identifier associated with the StreamingLocator . This identifier can be used to distinguish different StreamingLocators for the same Asset for authorization purposes in the CustomLicenseAcquisitionUrlTemplate or the CustomKeyAcquisitionUrlTemplate of the StreamingPolicy specified in the StreamingPolicyName field . @param { object } [ options ] Optional Parameters . @param { object } [ options . customHeaders ] Headers that will be added to the request @param { function } [ optionalCallback ] - The optional callback . @returns { function|Promise } If a callback was passed as the last parameter then it returns the callback else returns a Promise . { Promise } A promise is returned @resolve { StreamingLocator } - The deserialized result object . @reject { Error } - The error object . { function } optionalCallback ( err result request response ) { Error } err - The Error object if an error occurred null otherwise . { object } [ result ] - The deserialized result object if an error did not occur . See StreamingLocator for more information . { object } [ request ] - The HTTP Request object if an error did not occur . { stream } [ response ] - The HTTP Response stream if an error did not occur .
create(resourceGroupName, accountName, streamingLocatorName, parameters, options, optionalCallback) {
    let client = this.client;
    let self = this;
    if (!optionalCallback && typeof options === 'function') {
      optionalCallback = options;
      options = null;
    }
    if (!optionalCallback) {
      return new Promise((resolve, reject) => {
        self._create(resourceGroupName, accountName, streamingLocatorName, parameters, options, (err, result, request, response) => {
          if (err) { reject(err); }
          else { resolve(result); }
          return;
        });
      });
    } else {
      return self._create(resourceGroupName, accountName, streamingLocatorName, parameters, options, optionalCallback);
    }
  }
create ( resourceGroupName , accountName , streamingLocatorName , parameters , options , optionalCallback ) { let client = this . client ; let self = this ; if ( ! optionalCallback && typeof options === 'function' ) { optionalCallback = options ; options = null ; } if ( ! optionalCallback ) { return new Promise ( ( resolve , reject ) => { self . _create ( resourceGroupName , accountName , streamingLocatorName , parameters , options , ( err , result , request , response ) => { if ( err ) { reject ( err ) ; } else { resolve ( result ) ; } return ; } ) ; } ) ; } else { return self . _create ( resourceGroupName , accountName , streamingLocatorName , parameters , options , optionalCallback ) ; } }
@summary Create a Streaming Locator
 Create a Streaming Locator in the Media Services account
@summary Create a Streaming Locator Create a Streaming Locator in the Media Services account