1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
//! This is an unofficial Rust client for [OpsGenie API v2](https://docs.opsgenie.com/docs/api-overview).
//!
//! The client is autogenerated from the OpenAPI definition found in the
//! [OpsGenie Python SDK repository](https://github.com/opsgenie/opsgenie-python-sdk/blob/master/opsgenie-oas.yml).
//!
//! Please consult the [official OpsGenie API documentation](https://docs.opsgenie.com/docs/api-overview).
//!
//! For using this crate, you may want to start by exploring the [`apis`] submodules.
//!
//! ## Quick example
//!
//! The example below shows how to make a basic call to list open alerts.
//!
//! Note the `base_path` in the `Configuration`. This allows connecting to a non-US datacenter.
//! You may omit it when connecting to the default US datacenter.
//!
//! ```no_run
//! use opsgenie_rs::apis::alert_api::list_alerts;
//! use opsgenie_rs::apis::configuration::{ApiKey, Configuration};
//!
//! #[tokio::main]
//! async fn main() {
//!     let api_key = Some(ApiKey {
//!         prefix: Some("GenieKey".to_string()),
//!         key: "12345678-abcd-1234-abcd-1234567890ab".to_string(),
//!     });
//!
//!     let configuration = Configuration {
//!         api_key,
//!         base_path: "https://api.eu.opsgenie.com".to_owned(),
//!         ..Default::default()
//!     };
//!
//!     let result = list_alerts(
//!         &configuration,
//!         Some("state=open"),
//!         None,
//!         None,
//!         None,
//!         Some(10),
//!         Some("created_at"),
//!         Some("asc"),
//!     )
//!         .await;
//!
//!     match result {
//!         Err(e) => println!("Something went wrong: {}", e),
//!         Ok(response) => println!("{:#?}", response),
//!     }
//! }
//!  ```


#[macro_use]
extern crate serde_derive;

extern crate serde;
extern crate serde_json;
extern crate url;
extern crate reqwest;

pub mod apis;
pub mod models;