import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { NewVisitor } from '../../entity/NewVisitor';
import { CrudService } from './crud.service';
import { first, map } from 'rxjs/operators';
import { LineClient, LineMessagingAccount } from '../../entity/LineMessagingAccount';

const BASE_URL = (action: string = null) => { return `LineMessagingAccount${(action ? `/${action}` : '')}` }

const GET_URL_REFRESH_ALL_QUOTA = () => `LineMessagingAccount/RefreshAllQuota?`;
@Injectable({
  providedIn: 'root'
})
export class LineMessagingAccountService extends CrudService<LineMessagingAccount> {

  constructor(protected http: HttpClient) {
    super(http, BASE_URL);
  }

  refreshAllQuota() {
    return this.http.get<LineMessagingAccount>(GET_URL_REFRESH_ALL_QUOTA());
  }

}



const LINE_CLIENT_BASE_URL = (action: string = null) => { return `LineClient${(action ? `/${action}` : '')}` }

@Injectable({
  providedIn: 'root'
})
export class LineClientService extends CrudService<LineClient> {

  constructor(protected http: HttpClient) {
    super(http, LINE_CLIENT_BASE_URL);
  }

}

