Struct Workspaces

Source
pub struct Workspaces(pub String, pub String);

Tuple Fields§

§0: String§1: String

Implementations§

Source§

impl Workspaces

Source

pub fn get(self) -> Result<Workspace>

Examples found in repository?
examples/simple.rs (line 6)
3fn main() {
4    let seamapi = Seam::new(None, None).unwrap();
5
6    let workspace = seamapi.workspace().get().unwrap();
7
8    println!("{:?}", workspace);
9}
Source

pub fn reset_sandbox(self) -> Result<()>

Examples found in repository?
examples/interactive_set_access_codes.rs (line 19)
4fn main() {
5    println!("This will reset your workspace sandbox, continure? (Y/n)");
6    let mut guess = String::new();
7    io::stdin()
8        .read_line(&mut guess)
9        .expect("failed to read line");
10
11    println!("{guess}");
12    if guess != "Y\n" {
13        panic!();
14    }
15
16    let seam = Seam::new(None, None).unwrap();
17
18    println!("Reseting sandbox...");
19    seam.workspace().reset_sandbox();
20
21    println!("creating a Connect Webview...");
22    let webview = seam
23        .connect_webviews()
24        .create(vec!["august".to_string()], None, None)
25        .unwrap();
26
27    println!("This is my webview: \n{:?}", webview);
28
29    println!(
30        "Got the URL below and login\n\n{}\n\njane@example.com\n123\n\n",
31        webview.url
32    );
33
34    let mut enter = String::new();
35    io::stdin()
36        .read_line(&mut enter)
37        .expect("failed to read line");
38
39    let updated_webview = seam
40        .connect_webviews()
41        .get(webview.connect_webview_id)
42        .unwrap();
43
44    print!("This is my updated webview: \n {:?}", updated_webview);
45
46    if updated_webview.login_successful {
47        println!("Successfully logged in!");
48    } else {
49        panic!("Webview wasn't logged in");
50    }
51
52    let locks = seam.locks().list().unwrap();
53    println!(
54        "Listing all the connected locks for our new account: {:?}",
55        locks
56    );
57
58    let mut front_door = String::new();
59    for lock in locks {
60        if lock.properties.august_metadata.unwrap().device_name == "FRONT DOOR" {
61            front_door = lock.device_id;
62        }
63    }
64
65    println!("Settings the code 123459 on FRONT DOOR");
66    seam.access_codes()
67        .create(
68            front_door.clone(),
69            Some("My personal entry code".to_string()),
70            Some("123459".to_string()),
71            None,
72            None,
73        )
74        .unwrap();
75
76    let all_access_codes_on_front_door = seam.access_codes().list(front_door.clone()).unwrap();
77    println!("{:?}", all_access_codes_on_front_door);
78}
Source

pub fn list(self, workspace: Option<String>) -> Result<Vec<Workspace>>

The /workspaces/list API isn’t documented, but shows up in the SDK’s

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,