<commit_before>import {Injectable, Inject, Optional} from 'angular2/core';
import {Http, Headers, Response, Request} from 'angular2/http'
import {Observable} from 'rxjs/observable';
import 'rxjs/Rx';

export interface SpotifyConfig {
  clientId: string,
  redirectUri: string,
  scope: string,
  authToken?: string,
  apiBase: string,
}

export interface SpotifyOptions {
  limit?: number,
  offset?: number,
  market?: string,
  album_type?: string,
  country?: string,
  type?: string,
  q?: string,
  timestamp?: string,
  locale?: string,
  public?: boolean,
  name?: string,
}

interface HttpRequestOptions {
  method?: string,
  url: string,
  search?: Object,
  body?: Object,
  headers?: Headers,
}

@Injectable()
export default class SpotifyService {
  constructor( @Inject("SpotifyConfig") private config: SpotifyConfig, private http: Http) {
    config.apiBase = 'https://api.spotify.com/v1';
  }

  //#region albums

  /**
* Gets an album
* Pass in album id or spotify uri
*/
  getAlbum(album: string) {
    album = this.getIdFromUri(album);
    return this.api({
      method: 'get',
      url: `/albums/${album}`
    }).map(res => res.json());
  }

  /**
* Gets albums
* Pass in comma separated string or array of album ids
*/
  getAlbums(albums: string | Array<string>) {
    var albumList = this.mountItemList(albums);
    return this.api({
      method: 'get',
      url: `/albums`,
      search: { ids: albumList.toString() }
    }).map(res => res.json());<commit_msg>update import path to angular 2.x.x final<commit_after>import {Injectable, Inject, Optional} from '@angular/core';
import {Http, Headers, Response, Request} from '@angular/http'
import {Observable} from 'rxjs/Observable';
import 'rxjs/Rx';

export interface SpotifyConfig {
  clientId: string,
  redirectUri: string,
  scope: string,
  authToken?: string,
  apiBase: string,
}

export interface SpotifyOptions {
  limit?: number,
  offset?: number,
  market?: string,
  album_type?: string,
  country?: string,
  type?: string,
  q?: string,
  timestamp?: string,
  locale?: string,
  public?: boolean,
  name?: string,
}

interface HttpRequestOptions {
  method?: string,
  url: string,
  search?: Object,
  body?: Object,
  headers?: Headers,
}

@Injectable()
//export default class SpotifyService {
export class SpotifyService {
  constructor( @Inject("SpotifyConfig") private config: SpotifyConfig, private http: Http) {
    config.apiBase = 'https://api.spotify.com/v1';
  }

  //#region albums

  /**
* Gets an album
* Pass in album id or spotify uri
*/
  getAlbum(album: string) {
    album = this.getIdFromUri(album);
    return this.api({
      method: 'get',
      url: `/albums/${album}`
    }).map(res => res.json());
  }

  /**
* Gets albums
* Pass in comma separated string or array of album ids
*/
  getAlbums(albums: string | Array<string>) {
    var albumList = this.mountItemList(albums);
    return this.api({
      method: 'get',
      url: `/albums`,
      search: { ids: albumList.toString() }
    }).map(res => res.json());
{'fraction_non_alphanumeric': 0.14412928759894458, 'fraction_numerical': 0.0016490765171503958, 'mean_word_length': 3.702325581395349, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1733446', 'n_tokens_mistral': 982, 'n_tokens_neox': 978, 'n_words': 282}