pub struct Seam { /* private fields */ }
Implementations§
Source§impl Seam
impl Seam
Sourcepub fn new(api_key: Option<&str>, api_url: Option<&str>) -> Result<Self>
pub fn new(api_key: Option<&str>, api_url: Option<&str>) -> Result<Self>
Examples found in repository?
More examples
examples/locks.rs (line 4)
3fn main() {
4 let seam = Seam::new(None, None).unwrap();
5
6 let all_locks = seam.locks().list().unwrap();
7 if all_locks.len() != 0 {
8 let some_lock = &all_locks[0];
9
10 println!("{:?}", some_lock);
11 } else {
12 println!("No locks");
13 }
14}
examples/interactive_set_access_codes.rs (line 16)
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}
Sourcepub fn workspace(self) -> Workspaces
pub fn workspace(self) -> Workspaces
Examples found in repository?
More examples
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}
pub fn connected_accounts(self) -> ConnectedAccounts
Sourcepub fn connect_webviews(self) -> ConnectWebviews
pub fn connect_webviews(self) -> ConnectWebviews
Examples found in repository?
examples/interactive_set_access_codes.rs (line 23)
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}
Sourcepub fn locks(self) -> Locks
pub fn locks(self) -> Locks
Examples found in repository?
More examples
examples/locks.rs (line 6)
3fn main() {
4 let seam = Seam::new(None, None).unwrap();
5
6 let all_locks = seam.locks().list().unwrap();
7 if all_locks.len() != 0 {
8 let some_lock = &all_locks[0];
9
10 println!("{:?}", some_lock);
11 } else {
12 println!("No locks");
13 }
14}
examples/interactive_set_access_codes.rs (line 52)
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}
Sourcepub fn access_codes(self) -> AccessCodes
pub fn access_codes(self) -> AccessCodes
Examples found in repository?
examples/interactive_set_access_codes.rs (line 66)
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}
pub fn action_attempts(self) -> ActionAttempts
pub fn events(self) -> Events
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Seam
impl RefUnwindSafe for Seam
impl Send for Seam
impl Sync for Seam
impl Unpin for Seam
impl UnwindSafe for Seam
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