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>,
}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.
Implementations§
Source§impl DeviceCodeRequestV1
impl DeviceCodeRequestV1
pub fn new(instance_version: impl Into<String>, os: EngineOs) -> Self
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).
pub fn validate(&self) -> Result<(), ValidationError>
Trait Implementations§
Source§impl Clone for DeviceCodeRequestV1
impl Clone for DeviceCodeRequestV1
Source§impl Debug for DeviceCodeRequestV1
impl Debug for DeviceCodeRequestV1
Source§impl<'de> Deserialize<'de> for DeviceCodeRequestV1
impl<'de> Deserialize<'de> for DeviceCodeRequestV1
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for DeviceCodeRequestV1
Source§impl PartialEq for DeviceCodeRequestV1
impl PartialEq for DeviceCodeRequestV1
Source§impl Serialize for DeviceCodeRequestV1
impl Serialize for DeviceCodeRequestV1
impl StructuralPartialEq for DeviceCodeRequestV1
Auto Trait Implementations§
impl Forget for DeviceCodeRequestV1
impl Freeze for DeviceCodeRequestV1
impl Move for DeviceCodeRequestV1
impl RefUnwindSafe for DeviceCodeRequestV1
impl Send for DeviceCodeRequestV1
impl Sync for DeviceCodeRequestV1
impl Unpin for DeviceCodeRequestV1
impl UnsafeUnpin for DeviceCodeRequestV1
impl UnwindSafe for DeviceCodeRequestV1
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more