Metadata-Version: 2.4
Name: reminder-main-api-client
Version: 0.1.3
Summary: Python client library that proxies reminder operations to the main Reminder API Gateway (Lambda backend).
Author: H-Lab B-Side
License: UNLICENSED
Keywords: reminder,lambda,apigateway,x-api-key,python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Intended Audience :: Developers
Requires-Python: >=3.9
Description-Content-Type: text/markdown

# reminder-main-api-client

메인 Reminder API Gateway(CRUD Lambda)로 요청을 전달하는 Python 클라이언트입니다.

기존 프로젝트에서 `pip install` 후, 객체 생성 시 `x-api-key`를 주입해서
메인 Lambda에서 실제 처리를 수행하도록 사용할 수 있습니다.

## Installation

```bash
pip install reminder-main-api-client
```

## Usage

```python
from reminder_main_api_client import ReminderMainApiClient

client = ReminderMainApiClient(
    api_base_url="https://<api-id>.execute-api.ap-northeast-2.amazonaws.com/prod",
    api_key="<issued-x-api-key>",
)

# 시간 입력 규칙:
# - "2026-05-20T10:00:00" 처럼 타임존이 없으면 한국시간(KST)으로 간주
# - "2026-05-20T10:00:00+09:00", "2026-05-20T01:00:00Z" 같은 값도 허용
# - 내부적으로 UTC("...Z")로 변환되어 메인 API에 전달됨

# EventBridge 스케줄 생성(메인 Lambda의 POST /reminders 호출)
create_res = client.create_event_bridge(
    user_id="20240001",
    title="회의 준비",
    scheduled_at="2026-05-20T10:00:00",  # KST 오전 10시
    early_alert_minutes=10,
)

# EventBridge 스케줄 삭제(메인 Lambda의 DELETE /reminders/{id} 호출)
delete_res = client.delete_event_bridge(
    reminder_id="<reminder-id>",
    user_id="20240001",
)

# Teams 즉시 발송(메인 Lambda의 POST /alerts/send 호출)
# 주의: 이 라우트는 백엔드에 구현되어 있어야 동작합니다.
send_res = client.send_teams(
    user_id="20240001",
    title="즉시 알림",
    scheduled_at="2026-05-20T10:00:00",  # KST 오전 10시
)

# 특정 리마인더 최신 상태 조회
item = client.get_reminder(user_id="20240001", reminder_id="<reminder-id>")
status = client.get_reminder_status(user_id="20240001", reminder_id="<reminder-id>")
print(item["isCompleted"])
```

## Notes

- 이 패키지는 Teams API/EventBridge를 직접 호출하지 않습니다.
- 모든 동작은 메인 API에 위임됩니다.
- 따라서 권한/감사/로깅/서비스 매핑(`x-api-key`)은 메인 Lambda 정책을 그대로 따릅니다.
- `get_reminder`는 단건 조회 API(`GET /reminders/{id}`)를 우선 사용하고,
  구버전 백엔드에서는 목록 조회(`GET /reminders`) fallback으로 동작합니다.
