-
Notifications
You must be signed in to change notification settings - Fork 252
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move IoT Hub to operation builder pattern #960
Merged
Merged
Changes from 12 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
9a05a49
Move ApplyOnEdgeDevice
rylev f65ae63
Move CreateOrUpdateConfiguration
rylev 619fc60
CreateOrUpdateDeviceIdentity
rylev 390a6ce
CreateOrUpdateModuleIdentity
rylev a17c08b
Delete
rylev 85ac5d8
GetConfiguration
rylev b8fa3c7
InvokeMethod
rylev dfde895
Query
rylev 3f32aaf
GetIdentity
rylev 14f777f
GetTwin
rylev 9d4a874
Fix examples
rylev 8348515
Fix clippy errors
rylev 896c9d9
Rename module
rylev 4322bf9
Fix doc tests
rylev File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
use azure_iot_hub::service::ServiceClient; | ||
use azure_iot_hub::service::{resources::Configuration, ServiceClient}; | ||
use std::error::Error; | ||
|
||
#[tokio::main] | ||
|
@@ -29,7 +29,7 @@ async fn main() -> Result<(), Box<dyn Error + Send + Sync>> { | |
"metric1", | ||
"SELECT deviceId FROM devices WHERE properties.reported.lastDesiredStatus.code = 200", | ||
) | ||
.execute() | ||
.into_future() | ||
.await?; | ||
|
||
println!( | ||
|
@@ -38,7 +38,11 @@ async fn main() -> Result<(), Box<dyn Error + Send + Sync>> { | |
); | ||
|
||
println!("Getting configuration: {}", configuration_id); | ||
let configuration = service_client.get_configuration(configuration_id).await?; | ||
let configuration = service_client | ||
.get_configuration(configuration_id) | ||
.into_future() | ||
.await?; | ||
let configuration: Configuration = configuration.try_into()?; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a bit of a shame that we are now returning an unstructured type. |
||
|
||
println!( | ||
"Successfully retrieved the new configuration '{:?}'", | ||
|
@@ -65,10 +69,10 @@ async fn main() -> Result<(), Box<dyn Error + Send + Sync>> { | |
})) | ||
.labels(configuration.labels) | ||
.metrics(configuration.metrics.queries) | ||
.execute() | ||
.into_future() | ||
.await?; | ||
|
||
let multiple_configurations = service_client.get_configurations().await?; | ||
let multiple_configurations = service_client.get_configurations().into_future().await?; | ||
println!( | ||
"Successfully retrieved all configurations '{:?}'", | ||
multiple_configurations | ||
|
@@ -86,7 +90,7 @@ async fn main() -> Result<(), Box<dyn Error + Send + Sync>> { | |
|
||
service_client | ||
.delete_configuration(&configuration.id, configuration.etag) | ||
.execute() | ||
.into_future() | ||
.await?; | ||
|
||
println!( | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍