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
Methods
def get(self)
def reset(self, **kwargs)
- kwargs
class ClientClient (env: MLSENV = None, runtime_env: MLSRuntimeENV = None, username: str = None, password: str = None)
-
MLS 클라이언트 관련 기능들을 제공하는 클라이언트입니다.
Args
- env: (
MLSENV
) 접근할 MLS 환경 (MLSENV.DEV
|MLSENV.STG
|MLSENV.PRD
) (기본값:MLSENV.STG
) - runtime_env: (
MLSRuntimeENV
) 클라이언트가 실행되는 환경 (MLSRuntimeENV.YE
|MLSRuntimeENV.EDD
|MLSRuntimeENV.LOCAL
) (기본값:MLSRuntimeENV.LOCAL
) - username: (str) MLS 계정명 (기본값: $MLS_USERNAME)
- password: (str) MLS 계정 비밀번호 (기본값: $MLS_PASSWORD)
아래의 환경 변수가 정의된 경우 해당 파라미터를 생략 가능합니다.
- $MLS_ENV: env
- $MLS_RUNTIME_ENV: runtime_env
- $MLS_USERNAME: username
- $MLS_PASSWORD: password
Returns
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
- 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
def get_client(self, id: int = None, name: str = None) ‑> Client
-
클라이언트 정보를 가져옵니다.
Args:
id
또는name
중 한 개 이상의 값이 반드시 전달되어야 합니다.- id: (int) 클라이언트 고유 ID
- name: (str) 클라이언트 이름
Returns
- 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()
- kwargs: (optional) (dict) 쿼리 조건
- env: (