<reponame>rodrigoalveslima/BuzzBlog<gh_stars>1-10
# Copyright (C) 2020 Georgia Tech Center for Experimental Research in Computer
# Systems

from buzzblog.gen import TAccountService
from buzzblog.base_client import BaseClient


class Client(BaseClient):
  def __init__(self, ip_address, port, timeout=30000, logger=None):
    super().__init__(TAccountService.Client, ip_address, port, timeout, logger)

  def authenticate_user(self, request_metadata, username, password):
    return self.rpc_wrapper(request_metadata.id, "account:authenticate_user")(
        self._tclient.authenticate_user, request_metadata=request_metadata,
        username=username, password=password)

  def create_account(self, request_metadata, username, password, first_name,
      last_name):
    return self.rpc_wrapper(request_metadata.id, "account:create_account")(
        self._tclient.create_account, request_metadata=request_metadata,
        username=username, password=password, first_name=first_name,
        last_name=last_name)

  def retrieve_standard_account(self, request_metadata, account_id):
    return self.rpc_wrapper(request_metadata.id, "account:retrieve_standard_account")(
        self._tclient.retrieve_standard_account,
        request_metadata=request_metadata, account_id=account_id)

  def retrieve_expanded_account(self, request_metadata, account_id):
    return self.rpc_wrapper(request_metadata.id, "account:retrieve_expanded_account")(
        self._tclient.retrieve_expanded_account,
        request_metadata=request_metadata, account_id=account_id)

  def update_account(self, request_metadata, account_id, password, first_name,
      last_name):
    return self.rpc_wrapper(request_metadata.id, "account:update_account")(
        self._tclient.update_account, request_metadata=request_metadata,
        account_id=account_id, password=password, first_name=first_name,
        last_name=last_name)

  def delete_account(self, request_metadata, account_id):
    return self.rpc_wrapper(request_metadata.id, "account:delete_account")(
        self._tclient.delete_account, request_metadata=request_metadata,
        account_id=account_id)

  def list_accounts(self, request_metadata, query, limit, offset):
    return self.rpc_wrapper(request_metadata.id, "account:list_accounts")(
        self._tclient.list_accounts, request_metadata=request_metadata,
        query=query, limit=limit, offset=offset)

# Copyright (C) 2020 Georgia Tech Center for Experimental Research in Computer
# Systems

from buzzblog.gen import TAccountService
from buzzblog.base_client import BaseClient


class Client(BaseClient):
  def __init__(self, ip_address, port, timeout=30000, logger=None):
    super().__init__(TAccountService.Client, ip_address, port, timeout, logger)

  def authenticate_user(self, request_metadata, username, password):
    return self.rpc_wrapper(request_metadata.id, "account:authenticate_user")(
        self._tclient.authenticate_user, request_metadata=request_metadata,
        username=username, password=password)

  def create_account(self, request_metadata, username, password, first_name,
      last_name):
    return self.rpc_wrapper(request_metadata.id, "account:create_account")(
        self._tclient.create_account, request_metadata=request_metadata,
        username=username, password=password, first_name=first_name,
        last_name=last_name)

  def retrieve_standard_account(self, request_metadata, account_id):
    return self.rpc_wrapper(request_metadata.id, "account:retrieve_standard_account")(
        self._tclient.retrieve_standard_account,
        request_metadata=request_metadata, account_id=account_id)

  def retrieve_expanded_account(self, request_metadata, account_id):
    return self.rpc_wrapper(request_metadata.id, "account:retrieve_expanded_account")(
        self._tclient.retrieve_expanded_account,
        request_metadata=request_metadata, account_id=account_id)

  def update_account(self, request_metadata, account_id, password, first_name,
      last_name):
    return self.rpc_wrapper(request_metadata.id, "account:update_account")(
        self._tclient.update_account, request_metadata=request_metadata,
        account_id=account_id, password=password, first_name=first_name,
        last_name=last_name)

  def delete_account(self, request_metadata, account_id):
    return self.rpc_wrapper(request_metadata.id, "account:delete_account")(
        self._tclient.delete_account, request_metadata=request_metadata,
        account_id=account_id)

  def list_accounts(self, request_metadata, query, limit, offset):
    return self.rpc_wrapper(request_metadata.id, "account:list_accounts")(
        self._tclient.list_accounts, request_metadata=request_metadata,
        query=query, limit=limit, offset=offset)
# Copyright (C) 2020 Georgia Tech Center for Experimental Research in Computer # Systems