viaduct/
mozilla.appservices.httpconfig.protobuf.rs

1#[allow(clippy::derive_partial_eq_without_eq)]
2#[derive(Clone, PartialEq, ::prost::Message)]
3pub struct Request {
4    #[prost(enumeration = "request::Method", required, tag = "1")]
5    pub method: i32,
6    #[prost(string, required, tag = "2")]
7    pub url: ::prost::alloc::string::String,
8    #[prost(bytes = "vec", optional, tag = "3")]
9    pub body: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
10    #[prost(map = "string, string", tag = "4")]
11    pub headers: ::std::collections::HashMap<
12        ::prost::alloc::string::String,
13        ::prost::alloc::string::String,
14    >,
15    #[prost(bool, required, tag = "5")]
16    pub follow_redirects: bool,
17    #[prost(bool, required, tag = "6")]
18    pub use_caches: bool,
19    #[prost(int32, required, tag = "7")]
20    pub connect_timeout_secs: i32,
21    #[prost(int32, required, tag = "8")]
22    pub read_timeout_secs: i32,
23}
24/// Nested message and enum types in `Request`.
25pub mod request {
26    #[derive(
27        Clone,
28        Copy,
29        Debug,
30        PartialEq,
31        Eq,
32        Hash,
33        PartialOrd,
34        Ord,
35        ::prost::Enumeration
36    )]
37    #[repr(i32)]
38    pub enum Method {
39        Get = 0,
40        Head = 1,
41        Post = 2,
42        Put = 3,
43        Delete = 4,
44        Connect = 5,
45        Options = 6,
46        Trace = 7,
47        Patch = 8,
48    }
49    impl Method {
50        /// String value of the enum field names used in the ProtoBuf definition.
51        ///
52        /// The values are not transformed in any way and thus are considered stable
53        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
54        pub fn as_str_name(&self) -> &'static str {
55            match self {
56                Method::Get => "GET",
57                Method::Head => "HEAD",
58                Method::Post => "POST",
59                Method::Put => "PUT",
60                Method::Delete => "DELETE",
61                Method::Connect => "CONNECT",
62                Method::Options => "OPTIONS",
63                Method::Trace => "TRACE",
64                Method::Patch => "PATCH",
65            }
66        }
67        /// Creates an enum from field names used in the ProtoBuf definition.
68        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
69            match value {
70                "GET" => Some(Self::Get),
71                "HEAD" => Some(Self::Head),
72                "POST" => Some(Self::Post),
73                "PUT" => Some(Self::Put),
74                "DELETE" => Some(Self::Delete),
75                "CONNECT" => Some(Self::Connect),
76                "OPTIONS" => Some(Self::Options),
77                "TRACE" => Some(Self::Trace),
78                "PATCH" => Some(Self::Patch),
79                _ => None,
80            }
81        }
82    }
83}
84#[allow(clippy::derive_partial_eq_without_eq)]
85#[derive(Clone, PartialEq, ::prost::Message)]
86pub struct Response {
87    /// If this is present, nothing else is.
88    #[prost(string, optional, tag = "1")]
89    pub exception_message: ::core::option::Option<::prost::alloc::string::String>,
90    #[prost(string, optional, tag = "2")]
91    pub url: ::core::option::Option<::prost::alloc::string::String>,
92    #[prost(int32, optional, tag = "3")]
93    pub status: ::core::option::Option<i32>,
94    #[prost(bytes = "vec", optional, tag = "4")]
95    pub body: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
96    #[prost(map = "string, string", tag = "5")]
97    pub headers: ::std::collections::HashMap<
98        ::prost::alloc::string::String,
99        ::prost::alloc::string::String,
100    >,
101}