Verified Commit e0719887 authored by Grokafar's avatar Grokafar
Browse files

Put reqwest implementation in a feature

parent 4653f26f
......@@ -13,16 +13,23 @@ keywords = ["gitlab", "api"]
categories = ["web-programming", "api-bindings"]
edition = "2018"
[features]
default = ["client_api"]
client_api = ["itertools", "percent-encoding", "reqwest", "thiserror", "graphql_client"]
[dependencies]
derive_builder = "~0.9"
itertools = "~0.8"
itertools = { version = "~0.8", optional = true }
log = "~0.4"
percent-encoding = "^2.0"
reqwest = { version = "~0.10", features = ["blocking", "json"] }
thiserror = "^1.0.2"
percent-encoding = { version = "^2.0", optional = true }
reqwest = { version = "~0.10", features = ["blocking", "json"], optional = true }
thiserror = { version = "^1.0.2", optional = true }
url = "^2.1"
chrono = { version = "~0.4", features = ["serde"] }
graphql_client = "~0.8"
graphql_client = { version = "~0.8", optional = true }
serde = { version = "~1.0", features = ["derive"] }
serde_json = "^1.0"
[dev-dependencies]
itertools = { version = "~0.8" }
......@@ -23,6 +23,12 @@ use thiserror::Error;
use crate::types::*;
macro_rules! query_param_slice {
( $( $x:expr ),* ) => (
&[$($x),*] as QueryParamSlice
)
}
const PATH_SEGMENT_ENCODE_SET: &AsciiSet = &CONTROLS
.add(b' ')
.add(b'"')
......
......@@ -11,6 +11,7 @@
#[macro_use]
mod macros;
#[cfg(feature = "client_api")]
mod gitlab;
pub mod hooks;
......@@ -18,12 +19,10 @@ pub mod systemhooks;
pub mod types;
pub mod webhooks;
pub use crate::gitlab::CommitStatusInfo;
pub use crate::gitlab::Gitlab;
pub use crate::gitlab::GitlabBuilder;
pub use crate::gitlab::GitlabError;
pub use crate::gitlab::MergeRequestStateFilter;
pub use crate::gitlab::TokenError;
#[cfg(feature = "client_api")]
pub use crate::gitlab::{
CommitStatusInfo, Gitlab, GitlabBuilder, GitlabError, MergeRequestStateFilter, TokenError,
};
pub use crate::types::*;
#[cfg(test)]
......
......@@ -87,9 +87,3 @@ macro_rules! get_event {
}
};
}
macro_rules! query_param_slice {
( $( $x:expr ),* ) => (
&[$($x),*] as QueryParamSlice
)
}
......@@ -18,10 +18,10 @@ use std::str::FromStr;
use chrono::{DateTime, NaiveDate, Utc};
use derive_builder::Builder;
use log::error;
use reqwest::Url;
use serde::de::{DeserializeOwned, Error, Unexpected};
use serde::{Deserialize, Deserializer, Serialize, Serializer};
use serde_json::{self, Value};
use url::Url;
// This is only used in internal API calls.
//#[derive(Serialize, Deserialize, Debug, Clone)]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment