createSession(createSessionRequest) {
    if (!createSessionRequest) {
      return Promise.reject(new Error('OKTA API createSession parameter createSessionRequest is required.'));
    }
    let url = `${this.baseUrl}/api/v1/sessions`;

    const resources = [];

    const request = this.http.postJson(
      url,
      {
        body: createSessionRequest
      },
      { resources }
    );
    return request.then(jsonRes => new models.Session(jsonRes, this));
  }
/**
   *
   * @param {CreateSessionRequest} createSessionRequest
   * @description
   * Creates a new session for a user with a valid session token. Use this API if, for example, you want to set the session cookie yourself instead of allowing Okta to set it, or want to hold the session ID in order to delete a session via the API instead of visiting the logout URL.
   * @returns {Promise<Session>}
   */
@param {CreateSessionRequest} createSessionRequest
@description
Creates a new session for a user with a valid session token. Use this API if, for example, you want to set the session cookie yourself instead of allowing Okta to set it, or want to hold the session ID in order to delete a session via the API instead of visiting the logout URL.
@returns {Promise}
@param { CreateSessionRequest } createSessionRequest @description Creates a new session for a user with a valid session token . Use this API if for example you want to set the session cookie yourself instead of allowing Okta to set it or want to hold the session ID in order to delete a session via the API instead of visiting the logout URL . @returns { Promise }
createSession(createSessionRequest) {
    if (!createSessionRequest) {
      return Promise.reject(new Error('OKTA API createSession parameter createSessionRequest is required.'));
    }
    let url = `${this.baseUrl}/api/v1/sessions`;
    const resources = [];
    const request = this.http.postJson(
      url,
      {
        body: createSessionRequest
      },
      { resources }
    );
    return request.then(jsonRes => new models.Session(jsonRes, this));
  }
createSession ( createSessionRequest ) { if ( ! createSessionRequest ) { return Promise . reject ( new Error ( 'OKTA API createSession parameter createSessionRequest is required.' ) ) ; } let url = ` ${ this . baseUrl } ` ; const resources = [ ] ; const request = this . http . postJson ( url , { body : createSessionRequest } , { resources } ) ; return request . then ( jsonRes => new models . Session ( jsonRes , this ) ) ; }
@param {CreateSessionRequest} createSessionRequest
 @description
 Creates a new session for a user with a valid session token.
@param { CreateSessionRequest } createSessionRequest @description Creates a new session for a user with a valid session token .