synd_term/client/synd_api/generated/
mutation.rs

1#![allow(clippy::all, warnings)]
2pub struct SubscribeFeed;
3pub mod subscribe_feed {
4    #![allow(dead_code)]
5    use std::result::Result;
6    pub const OPERATION_NAME: &str = "SubscribeFeed";
7    pub const QUERY : & str = "mutation SubscribeFeed($subscribeInput: SubscribeFeedInput!) {\n  subscribeFeed(input: $subscribeInput) {\n    __typename\n    ... on SubscribeFeedSuccess {\n      feed {\n        ...Feed\n      }\n      status {\n        code\n      }\n    }\n    ... on SubscribeFeedError {\n      status {\n        code\n      }\n      message\n    }\n  }\n}\n\nmutation UnsubscribeFeed($unsubscribeInput: UnsubscribeFeedInput!) {\n  unsubscribeFeed(input: $unsubscribeInput) {\n    __typename\n    ... on UnsubscribeFeedSuccess {\n      status {\n        code\n      }\n    }\n    ... on UnsubscribeFeedError {\n      status {\n        code\n      }\n    }\n  }\n}\n\nfragment Feed on Feed {\n  id\n  type\n  title\n  url\n  updated\n  websiteUrl\n  description\n  generator\n  requirement\n  category\n  entries(first: 20) {\n    nodes {\n      ...EntryMeta\n    }\n  }\n  links {\n    nodes {\n      ...Link\n    }\n  }\n  authors {\n    nodes\n  }\n}\n\nfragment EntryMeta on Entry {\n    title\n    published\n    updated\n    summary\n}\n\nfragment Link on Link {\n  href\n  rel\n  mediaType\n  title  \n}\n" ;
8    use super::*;
9    use serde::{Deserialize, Serialize};
10    #[allow(dead_code)]
11    type Boolean = bool;
12    #[allow(dead_code)]
13    type Float = f64;
14    #[allow(dead_code)]
15    type Int = i64;
16    #[allow(dead_code)]
17    type ID = String;
18    type Category = crate::client::synd_api::scalar::Category;
19    type FeedUrl = crate::client::synd_api::scalar::FeedUrl;
20    type Rfc3339Time = crate::client::synd_api::scalar::Rfc3339Time;
21    #[derive(Clone, Debug, Eq, PartialEq)]
22    pub enum FeedType {
23        ATOM,
24        JSON,
25        RSS0,
26        RSS1,
27        RSS2,
28        Other(String),
29    }
30    impl ::serde::Serialize for FeedType {
31        fn serialize<S: serde::Serializer>(&self, ser: S) -> Result<S::Ok, S::Error> {
32            ser.serialize_str(match *self {
33                FeedType::ATOM => "ATOM",
34                FeedType::JSON => "JSON",
35                FeedType::RSS0 => "RSS0",
36                FeedType::RSS1 => "RSS1",
37                FeedType::RSS2 => "RSS2",
38                FeedType::Other(ref s) => &s,
39            })
40        }
41    }
42    impl<'de> ::serde::Deserialize<'de> for FeedType {
43        fn deserialize<D: ::serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
44            let s: String = ::serde::Deserialize::deserialize(deserializer)?;
45            match s.as_str() {
46                "ATOM" => Ok(FeedType::ATOM),
47                "JSON" => Ok(FeedType::JSON),
48                "RSS0" => Ok(FeedType::RSS0),
49                "RSS1" => Ok(FeedType::RSS1),
50                "RSS2" => Ok(FeedType::RSS2),
51                _ => Ok(FeedType::Other(s)),
52            }
53        }
54    }
55    #[derive(Clone, Debug, Eq, PartialEq)]
56    pub enum Requirement {
57        MUST,
58        SHOULD,
59        MAY,
60        Other(String),
61    }
62    impl ::serde::Serialize for Requirement {
63        fn serialize<S: serde::Serializer>(&self, ser: S) -> Result<S::Ok, S::Error> {
64            ser.serialize_str(match *self {
65                Requirement::MUST => "MUST",
66                Requirement::SHOULD => "SHOULD",
67                Requirement::MAY => "MAY",
68                Requirement::Other(ref s) => &s,
69            })
70        }
71    }
72    impl<'de> ::serde::Deserialize<'de> for Requirement {
73        fn deserialize<D: ::serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
74            let s: String = ::serde::Deserialize::deserialize(deserializer)?;
75            match s.as_str() {
76                "MUST" => Ok(Requirement::MUST),
77                "SHOULD" => Ok(Requirement::SHOULD),
78                "MAY" => Ok(Requirement::MAY),
79                _ => Ok(Requirement::Other(s)),
80            }
81        }
82    }
83    #[derive(Clone, Debug, Eq, PartialEq)]
84    pub enum ResponseCode {
85        OK,
86        UNAUTHORIZED,
87        INVALID_FEED_URL,
88        FEED_UNAVAILABLE,
89        INTERNAL_ERROR,
90        Other(String),
91    }
92    impl ::serde::Serialize for ResponseCode {
93        fn serialize<S: serde::Serializer>(&self, ser: S) -> Result<S::Ok, S::Error> {
94            ser.serialize_str(match *self {
95                ResponseCode::OK => "OK",
96                ResponseCode::UNAUTHORIZED => "UNAUTHORIZED",
97                ResponseCode::INVALID_FEED_URL => "INVALID_FEED_URL",
98                ResponseCode::FEED_UNAVAILABLE => "FEED_UNAVAILABLE",
99                ResponseCode::INTERNAL_ERROR => "INTERNAL_ERROR",
100                ResponseCode::Other(ref s) => &s,
101            })
102        }
103    }
104    impl<'de> ::serde::Deserialize<'de> for ResponseCode {
105        fn deserialize<D: ::serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
106            let s: String = ::serde::Deserialize::deserialize(deserializer)?;
107            match s.as_str() {
108                "OK" => Ok(ResponseCode::OK),
109                "UNAUTHORIZED" => Ok(ResponseCode::UNAUTHORIZED),
110                "INVALID_FEED_URL" => Ok(ResponseCode::INVALID_FEED_URL),
111                "FEED_UNAVAILABLE" => Ok(ResponseCode::FEED_UNAVAILABLE),
112                "INTERNAL_ERROR" => Ok(ResponseCode::INTERNAL_ERROR),
113                _ => Ok(ResponseCode::Other(s)),
114            }
115        }
116    }
117    #[derive(Serialize, Debug, Clone, PartialEq, Eq)]
118    pub struct SubscribeFeedInput {
119        pub url: FeedUrl,
120        pub requirement: Option<Requirement>,
121        pub category: Option<Category>,
122    }
123    #[derive(Serialize, Debug, Clone, PartialEq, Eq)]
124    pub struct Variables {
125        #[serde(rename = "subscribeInput")]
126        pub subscribe_input: SubscribeFeedInput,
127    }
128    impl Variables {}
129    #[derive(Deserialize, Debug, Clone, PartialEq, Eq)]
130    pub struct Feed {
131        pub id: ID,
132        #[serde(rename = "type")]
133        pub type_: FeedType,
134        pub title: Option<String>,
135        pub url: FeedUrl,
136        pub updated: Option<Rfc3339Time>,
137        #[serde(rename = "websiteUrl")]
138        pub website_url: Option<String>,
139        pub description: Option<String>,
140        pub generator: Option<String>,
141        pub requirement: Option<Requirement>,
142        pub category: Option<Category>,
143        pub entries: FeedEntries,
144        pub links: FeedLinks,
145        pub authors: FeedAuthors,
146    }
147    #[derive(Deserialize, Debug, Clone, PartialEq, Eq)]
148    pub struct FeedEntries {
149        pub nodes: Vec<FeedEntriesNodes>,
150    }
151    pub type FeedEntriesNodes = EntryMeta;
152    #[derive(Deserialize, Debug, Clone, PartialEq, Eq)]
153    pub struct FeedLinks {
154        pub nodes: Vec<FeedLinksNodes>,
155    }
156    pub type FeedLinksNodes = Link;
157    #[derive(Deserialize, Debug, Clone, PartialEq, Eq)]
158    pub struct FeedAuthors {
159        pub nodes: Vec<String>,
160    }
161    #[derive(Deserialize, Debug, Clone, PartialEq, Eq)]
162    pub struct EntryMeta {
163        pub title: Option<String>,
164        pub published: Option<Rfc3339Time>,
165        pub updated: Option<Rfc3339Time>,
166        pub summary: Option<String>,
167    }
168    #[derive(Deserialize, Debug, Clone, PartialEq, Eq)]
169    pub struct Link {
170        pub href: String,
171        pub rel: Option<String>,
172        #[serde(rename = "mediaType")]
173        pub media_type: Option<String>,
174        pub title: Option<String>,
175    }
176    #[derive(Deserialize, Debug, Clone, PartialEq, Eq)]
177    pub struct ResponseData {
178        #[serde(rename = "subscribeFeed")]
179        pub subscribe_feed: SubscribeFeedSubscribeFeed,
180    }
181    #[derive(Deserialize, Debug, Clone, PartialEq, Eq)]
182    #[serde(tag = "__typename")]
183    pub enum SubscribeFeedSubscribeFeed {
184        SubscribeFeedSuccess(SubscribeFeedSubscribeFeedOnSubscribeFeedSuccess),
185        SubscribeFeedError(SubscribeFeedSubscribeFeedOnSubscribeFeedError),
186    }
187    #[derive(Deserialize, Debug, Clone, PartialEq, Eq)]
188    pub struct SubscribeFeedSubscribeFeedOnSubscribeFeedSuccess {
189        pub feed: SubscribeFeedSubscribeFeedOnSubscribeFeedSuccessFeed,
190        pub status: SubscribeFeedSubscribeFeedOnSubscribeFeedSuccessStatus,
191    }
192    pub type SubscribeFeedSubscribeFeedOnSubscribeFeedSuccessFeed = Feed;
193    #[derive(Deserialize, Debug, Clone, PartialEq, Eq)]
194    pub struct SubscribeFeedSubscribeFeedOnSubscribeFeedSuccessStatus {
195        pub code: ResponseCode,
196    }
197    #[derive(Deserialize, Debug, Clone, PartialEq, Eq)]
198    pub struct SubscribeFeedSubscribeFeedOnSubscribeFeedError {
199        pub status: SubscribeFeedSubscribeFeedOnSubscribeFeedErrorStatus,
200        pub message: String,
201    }
202    #[derive(Deserialize, Debug, Clone, PartialEq, Eq)]
203    pub struct SubscribeFeedSubscribeFeedOnSubscribeFeedErrorStatus {
204        pub code: ResponseCode,
205    }
206}
207impl graphql_client::GraphQLQuery for SubscribeFeed {
208    type Variables = subscribe_feed::Variables;
209    type ResponseData = subscribe_feed::ResponseData;
210    fn build_query(variables: Self::Variables) -> ::graphql_client::QueryBody<Self::Variables> {
211        graphql_client::QueryBody {
212            variables,
213            query: subscribe_feed::QUERY,
214            operation_name: subscribe_feed::OPERATION_NAME,
215        }
216    }
217}
218pub struct UnsubscribeFeed;
219pub mod unsubscribe_feed {
220    #![allow(dead_code)]
221    use std::result::Result;
222    pub const OPERATION_NAME: &str = "UnsubscribeFeed";
223    pub const QUERY : & str = "mutation SubscribeFeed($subscribeInput: SubscribeFeedInput!) {\n  subscribeFeed(input: $subscribeInput) {\n    __typename\n    ... on SubscribeFeedSuccess {\n      feed {\n        ...Feed\n      }\n      status {\n        code\n      }\n    }\n    ... on SubscribeFeedError {\n      status {\n        code\n      }\n      message\n    }\n  }\n}\n\nmutation UnsubscribeFeed($unsubscribeInput: UnsubscribeFeedInput!) {\n  unsubscribeFeed(input: $unsubscribeInput) {\n    __typename\n    ... on UnsubscribeFeedSuccess {\n      status {\n        code\n      }\n    }\n    ... on UnsubscribeFeedError {\n      status {\n        code\n      }\n    }\n  }\n}\n\nfragment Feed on Feed {\n  id\n  type\n  title\n  url\n  updated\n  websiteUrl\n  description\n  generator\n  requirement\n  category\n  entries(first: 20) {\n    nodes {\n      ...EntryMeta\n    }\n  }\n  links {\n    nodes {\n      ...Link\n    }\n  }\n  authors {\n    nodes\n  }\n}\n\nfragment EntryMeta on Entry {\n    title\n    published\n    updated\n    summary\n}\n\nfragment Link on Link {\n  href\n  rel\n  mediaType\n  title  \n}\n" ;
224    use super::*;
225    use serde::{Deserialize, Serialize};
226    #[allow(dead_code)]
227    type Boolean = bool;
228    #[allow(dead_code)]
229    type Float = f64;
230    #[allow(dead_code)]
231    type Int = i64;
232    #[allow(dead_code)]
233    type ID = String;
234    type FeedUrl = crate::client::synd_api::scalar::FeedUrl;
235    #[derive(Clone, Debug, Eq, PartialEq)]
236    pub enum ResponseCode {
237        OK,
238        UNAUTHORIZED,
239        INVALID_FEED_URL,
240        FEED_UNAVAILABLE,
241        INTERNAL_ERROR,
242        Other(String),
243    }
244    impl ::serde::Serialize for ResponseCode {
245        fn serialize<S: serde::Serializer>(&self, ser: S) -> Result<S::Ok, S::Error> {
246            ser.serialize_str(match *self {
247                ResponseCode::OK => "OK",
248                ResponseCode::UNAUTHORIZED => "UNAUTHORIZED",
249                ResponseCode::INVALID_FEED_URL => "INVALID_FEED_URL",
250                ResponseCode::FEED_UNAVAILABLE => "FEED_UNAVAILABLE",
251                ResponseCode::INTERNAL_ERROR => "INTERNAL_ERROR",
252                ResponseCode::Other(ref s) => &s,
253            })
254        }
255    }
256    impl<'de> ::serde::Deserialize<'de> for ResponseCode {
257        fn deserialize<D: ::serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
258            let s: String = ::serde::Deserialize::deserialize(deserializer)?;
259            match s.as_str() {
260                "OK" => Ok(ResponseCode::OK),
261                "UNAUTHORIZED" => Ok(ResponseCode::UNAUTHORIZED),
262                "INVALID_FEED_URL" => Ok(ResponseCode::INVALID_FEED_URL),
263                "FEED_UNAVAILABLE" => Ok(ResponseCode::FEED_UNAVAILABLE),
264                "INTERNAL_ERROR" => Ok(ResponseCode::INTERNAL_ERROR),
265                _ => Ok(ResponseCode::Other(s)),
266            }
267        }
268    }
269    #[derive(Serialize, Debug, Clone, PartialEq, Eq)]
270    pub struct UnsubscribeFeedInput {
271        pub url: FeedUrl,
272    }
273    #[derive(Serialize, Debug, Clone, PartialEq, Eq)]
274    pub struct Variables {
275        #[serde(rename = "unsubscribeInput")]
276        pub unsubscribe_input: UnsubscribeFeedInput,
277    }
278    impl Variables {}
279    #[derive(Deserialize, Debug, Clone, PartialEq, Eq)]
280    pub struct ResponseData {
281        #[serde(rename = "unsubscribeFeed")]
282        pub unsubscribe_feed: UnsubscribeFeedUnsubscribeFeed,
283    }
284    #[derive(Deserialize, Debug, Clone, PartialEq, Eq)]
285    #[serde(tag = "__typename")]
286    pub enum UnsubscribeFeedUnsubscribeFeed {
287        UnsubscribeFeedSuccess(UnsubscribeFeedUnsubscribeFeedOnUnsubscribeFeedSuccess),
288        UnsubscribeFeedError(UnsubscribeFeedUnsubscribeFeedOnUnsubscribeFeedError),
289    }
290    #[derive(Deserialize, Debug, Clone, PartialEq, Eq)]
291    pub struct UnsubscribeFeedUnsubscribeFeedOnUnsubscribeFeedSuccess {
292        pub status: UnsubscribeFeedUnsubscribeFeedOnUnsubscribeFeedSuccessStatus,
293    }
294    #[derive(Deserialize, Debug, Clone, PartialEq, Eq)]
295    pub struct UnsubscribeFeedUnsubscribeFeedOnUnsubscribeFeedSuccessStatus {
296        pub code: ResponseCode,
297    }
298    #[derive(Deserialize, Debug, Clone, PartialEq, Eq)]
299    pub struct UnsubscribeFeedUnsubscribeFeedOnUnsubscribeFeedError {
300        pub status: UnsubscribeFeedUnsubscribeFeedOnUnsubscribeFeedErrorStatus,
301    }
302    #[derive(Deserialize, Debug, Clone, PartialEq, Eq)]
303    pub struct UnsubscribeFeedUnsubscribeFeedOnUnsubscribeFeedErrorStatus {
304        pub code: ResponseCode,
305    }
306}
307impl graphql_client::GraphQLQuery for UnsubscribeFeed {
308    type Variables = unsubscribe_feed::Variables;
309    type ResponseData = unsubscribe_feed::ResponseData;
310    fn build_query(variables: Self::Variables) -> ::graphql_client::QueryBody<Self::Variables> {
311        graphql_client::QueryBody {
312            variables,
313            query: unsubscribe_feed::QUERY,
314            operation_name: unsubscribe_feed::OPERATION_NAME,
315        }
316    }
317}