UpdateAPIKey 单接口聚合更新,仅传需要变更的字段;nil 字段不修改。
UpdateAPIKeyRequest 聚合更新;nil 字段表示不修改。
channel_source_id: has_channel_source_id=false 不修改;has_channel_source_id=true && channel_source_id=0 表示解绑。
expires_at: has_expires_at=false 不修改;has_expires_at=true && expires_at=nil 表示永久。
scopes 为空切片 = 清空;nil 字段(未传)= 不更新。 这里用 has_scopes 显式区分。
使用 wrapper-style:proto3 默认值无法区分"未传"与"清空",因此用 optional 标记,需要明确传 nil 才不更新。
OK
APIKeyInfo API Key 元数据;plaintext key 仅在 Create/Rotate 时一次性返回。