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
//! # pexels_client
//!
//! The `pexels_client` crate is a convenient wrapper around
//! [Pexels API](https://www.pexels.com/api/documentation).
//!
//! # Basic Usage
//!
//! ## Create a client
//! Creates pexels client taking authorization key as argument. You can get your authorization key [here](https://www.pexels.com/api/new/). You can make multiple requests using same client.
//! ```rust
//! use pexels_client::PexelsClient;
//!
//! fn main() {
//! let client = PexelsClient::new("auth_key".to_string()).unwrap();
//! }
//! ```
//!
//! ## Search for photos
//!Returns photos of requested query.
//! ```rust
//! use pexels_client::{PexelsClient, photos::PhotoSearchQuery};
//!
//! async fn test() {
//! let client = PexelsClient::new("auth_key".to_string()).unwrap();
//! let response = client
//! .photo_search(PhotoSearchQuery::new("tigers".to_string()))
//! .await
//! .unwrap();
//! }
//! ```
//!
//! ## Search for photos with filters
//!Returns photos of requested query with filters.
//! ```rust
//! use pexels_client::{*, photos::PhotoSearchQuery};
//!
//! async fn test() {
//! let client = PexelsClient::new("auth_key".to_string()).unwrap();
//! let query = PhotoSearchQuery::new("tigers".to_string())
//! .orientation(Orientation::Portrait)
//! .size(Size::Large)
//! .color(Color::Blue)
//! .per_page(5);
//! let response = client.photo_search(query).await.unwrap();
//! }
//! ```
pub use *;
pub use PexelsClient;