pub struct DeviceCodeRequestV1 {
pub schema: String,
pub client_id: String,
pub instance_version: String,
pub os: EngineOs,
pub instance_label: Option<String>,
pub intent: Option<DeviceIntent>,
pub plan: Option<TrialPlan>,
pub app_keys: Vec<AppKeyAnnouncementV1>,
}Expand description
POST /v1/device/code.
Fields§
§schema: String§client_id: StringAlways CLOUD_ENGINE_CLIENT_ID.
instance_version: String§os: EngineOs§instance_label: Option<String>The name the user gave this engine (--label), shown on the approval
page and prefilled as its name (Cloud task #11). Like instance_version
and os it is the requester’s claim. Absent when the user gave none:
the host-name default goes only into DeviceTokenRequestV1.
intent: Option<DeviceIntent>One-step trial (lean-ctx cloud connect --trial): why the code is
asked for. Absent for a sign-in, so a Cloud that does not know the
member (it refuses unknown fields) still serves every plain connect.
plan: Option<TrialPlan>Only with intent: "trial": the plan whose trial the browser starts.
app_keys: Vec<AppKeyAnnouncementV1>f3129 S2: the app keys this pairing binds, sorted by kind, one per
kind. Sent before the code answer shows FEATURE_DEVICE_APP_KEYS:
a Cloud without it refuses the unknown member and nothing is bound.
Absent when empty, so every older request stays byte-identical.
Implementations§
Source§impl DeviceCodeRequestV1
impl DeviceCodeRequestV1
pub fn new(instance_version: impl Into<String>, os: EngineOs) -> Self
Sourcepub fn with_app_keys(self, keys: Vec<AppKeyAnnouncementV1>) -> Self
pub fn with_app_keys(self, keys: Vec<AppKeyAnnouncementV1>) -> Self
The same request announcing keys (f3129 S2), sorted by kind.
Sourcepub fn with_label(self, label: Option<String>) -> Self
pub fn with_label(self, label: Option<String>) -> Self
The same request naming the engine (--label).
Sourcepub fn with_trial(self, plan: Option<TrialPlan>) -> Self
pub fn with_trial(self, plan: Option<TrialPlan>) -> Self
The same request asking for a one-step trial of plan (None: a
plain sign-in, which sends neither member).