Skip to content
This repository has been archived by the owner on Oct 3, 2024. It is now read-only.

Commit

Permalink
Updates to client
Browse files Browse the repository at this point in the history
  • Loading branch information
rnijveld committed Jun 11, 2024
1 parent 6a22be0 commit 0a43fa2
Show file tree
Hide file tree
Showing 13 changed files with 575 additions and 84 deletions.
19 changes: 12 additions & 7 deletions src/cli/main.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
use openadr::wire::program::ProgramContent;
use openadr::Target;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = openadr::Client::new("http://localhost:3000/".try_into()?);
let created_program = client.create_program(ProgramContent::new("name")).await?;
let created_program_1 = client.create_program(ProgramContent::new("name1")).await?;
dbg!(created_program);
dbg!(created_program_1);
let _program = client.get_program_by_name("name").await?;
// let events = program.get_all_events().await?;
// let created_program = client.create_program(ProgramContent::new("name")).await?;
// let created_program_1 = client.create_program(ProgramContent::new("name1")).await?;
let program = client.get_program(Target::Program("name")).await?;
// let created_event = program
// .create_event(program.new_event().with_event_name("prices3").with_priority(0))
// .await?;
let events = program.get_all_events().await?;
let reports = events[0].get_all_reports().await?;
// let event = program.get_event(Target::Event("prices3")).await?;
dbg!(events);
dbg!(reports);

// let programs: Vec<Program> = client.get_all_programs()?;
// let programs = client.get_programs(TargetLabel::ProgramName, &["name"])?;
Expand Down
Loading

0 comments on commit 0a43fa2

Please sign in to comment.