Module sktmls.clients.client

Classes

class Client (**kwargs)

MLS 클라이언트 클래스입니다. Client는 MLS 연동에 필요한 클라이언트 정보를 가지는 클래스이며 MLSClient와는 별개의 개념입니다.

Args

  • kwargs
    • id: (int) 클라이언트 고유 ID
    • name: (str) 클라이언트 이름
    • apikey: (str) API Key
    • user: (str) 클라이언트 소유 계정명

Returns

Client

Methods

def get(self)
def reset(self, **kwargs)
class ClientClient (env: MLSENV = None, runtime_env: MLSRuntimeENV = None, username: str = None, password: str = None)

MLS 클라이언트 관련 기능들을 제공하는 클라이언트입니다.

Args

아래의 환경 변수가 정의된 경우 해당 파라미터를 생략 가능합니다.

  • $MLS_ENV: env
  • $MLS_RUNTIME_ENV: runtime_env
  • $MLS_USERNAME: username
  • $MLS_PASSWORD: password

Returns

ClientClient

Example

client_client = ClientClient(env=MLSENV.STG, runtime_env=MLSRuntimeENV.YE, username="mls_account", password="mls_password")

Ancestors

Methods

def create_client(self, name: str, apikey: str = None) ‑> Client

클라이언트를 생성합니다.

Args

  • name: (str) 클라이언트 이름
  • apikey: (optional) (str) 길이 40의 API Key. 전달되지 않을 경우 자동 생성

Returns

Client

  • id: (int) 클라이언트 고유 ID
  • name: (str) 클라이언트 이름
  • apikey: (str) API Key
  • user: (str) 클라이언트 소유 계정명

Example

client = client_client.create_client(name="my_mls_client")
def delete_client(self, client: Client) ‑> MLSResponse

클라이언트를 삭제합니다.

Args

  • client: (Client) 클라이언트 객체

Returns

MLSResponse

Example

client_client.delete_client(my_client)
def get_client(self, id: int = None, name: str = None) ‑> Client

클라이언트 정보를 가져옵니다.

Args: id 또는 name 중 한 개 이상의 값이 반드시 전달되어야 합니다.

  • id: (int) 클라이언트 고유 ID
  • name: (str) 클라이언트 이름

Returns

Client

  • id: (int) 클라이언트 고유 ID
  • name: (str) 클라이언트 이름
  • apikey: (str) API Key
  • user: (str) 클라이언트 소유 계정명

Example

client_by_id = client_client.get_client(id=3)
client_by_name = client_client.get_client(name="my_client")
def list_clients(self, **kwargs) ‑> List[Client]

클라이언트 리스트를 가져옵니다.

Args

  • kwargs: (optional) (dict) 쿼리 조건
    • id: (int) 클라이언트 고유 ID
    • name: (str) 클라이언트 이름
    • query: (str) 검색 문자
    • page: (int) 페이지 번호

Returns

list(Client)

  • id: (int) 클라이언트 고유 ID
  • name: (str) 클라이언트 이름
  • apikey: (str) API Key
  • user: (str) 클라이언트 소유 계정명

Example

all_my_clients = client_client.list_clients()