Skip to main content

postman_collection/v2_1_0/
mod.rs

1#![allow(clippy::large_enum_variant)]
2
3use serde::{Deserialize, Serialize};
4
5#[derive(Clone, Debug, Deserialize, Serialize, PartialEq, Default)]
6pub struct Spec {
7    #[serde(rename = "auth")]
8    pub auth: Option<Auth>,
9
10    #[serde(rename = "event")]
11    pub event: Option<Vec<Event>>,
12
13    #[serde(rename = "info")]
14    pub info: Information,
15
16    /// Items are the basic unit for a Postman collection. You can think of them as corresponding
17    /// to a single API endpoint. Each Item has one request and may have multiple API responses
18    /// associated with it.
19    #[serde(rename = "item")]
20    pub item: Vec<Items>,
21
22    #[serde(rename = "variable")]
23    pub variable: Option<Vec<Variable>>,
24}
25
26/// Represents authentication helpers provided by Postman
27#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)]
28pub struct Auth {
29    /// The attributes for [API key Auth](https://en.wikipedia.org/wiki/API_key).
30    #[serde(rename = "apikey")]
31    pub api_key: Option<Vec<AuthAttribute>>,
32
33    /// The attributes for [AWS
34    /// Auth](http://docs.aws.amazon.com/AmazonS3/latest/dev/RESTAuthentication.html).
35    #[serde(rename = "awsv4")]
36    pub awsv4: Option<Vec<AuthAttribute>>,
37
38    /// The attributes for [Basic
39    /// Authentication](https://en.wikipedia.org/wiki/Basic_access_authentication).
40    #[serde(rename = "basic")]
41    pub basic: Option<Vec<AuthAttribute>>,
42
43    /// The helper attributes for [Bearer Token
44    /// Authentication](https://tools.ietf.org/html/rfc6750)
45    #[serde(rename = "bearer")]
46    pub bearer: Option<Vec<AuthAttribute>>,
47
48    /// The attributes for [Digest
49    /// Authentication](https://en.wikipedia.org/wiki/Digest_access_authentication).
50    #[serde(rename = "digest")]
51    pub digest: Option<Vec<AuthAttribute>>,
52
53    /// The attributes for [Akamai EdgeGrid Authentication](https://techdocs.akamai.com/developer/docs/set-up-authentication-credentials).
54    #[serde(rename = "edgegrid")]
55    pub edgegrid: Option<Vec<AuthAttribute>>,
56
57    /// The attributes for [Hawk Authentication](https://github.com/hueniverse/hawk)
58    #[serde(rename = "hawk")]
59    pub hawk: Option<Vec<AuthAttribute>>,
60
61    #[serde(rename = "noauth")]
62    pub noauth: Option<serde_json::Value>,
63
64    /// The attributes for [NTLM
65    /// Authentication](https://msdn.microsoft.com/en-us/library/cc237488.aspx)
66    #[serde(rename = "ntlm")]
67    pub ntlm: Option<Vec<AuthAttribute>>,
68
69    /// The attributes for [OAuth2](https://oauth.net/1/)
70    #[serde(rename = "oauth1")]
71    pub oauth1: Option<Vec<AuthAttribute>>,
72
73    /// Helper attributes for [OAuth2](https://oauth.net/2/)
74    #[serde(rename = "oauth2")]
75    pub oauth2: Option<Vec<AuthAttribute>>,
76
77    #[serde(rename = "type")]
78    pub auth_type: AuthType,
79}
80
81/// Represents an attribute for any authorization method provided by Postman. For example
82/// `username` and `password` are set as auth attributes for Basic Authentication method.
83#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)]
84pub struct AuthAttribute {
85    #[serde(rename = "key")]
86    pub key: String,
87
88    #[serde(rename = "type")]
89    pub auth_type: Option<String>,
90
91    #[serde(rename = "value")]
92    pub value: Option<serde_json::Value>,
93}
94
95/// Postman allows you to configure scripts to run when specific events occur. These scripts
96/// are stored here, and can be referenced in the collection by their ID.
97///
98/// Defines a script associated with an associated event name
99#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)]
100pub struct Event {
101    /// Indicates whether the event is disabled. If absent, the event is assumed to be enabled.
102    #[serde(rename = "disabled")]
103    pub disabled: Option<bool>,
104
105    /// A unique identifier for the enclosing event.
106    #[serde(rename = "id")]
107    pub id: Option<String>,
108
109    /// Can be set to `test` or `prerequest` for test scripts or pre-request scripts respectively.
110    #[serde(rename = "listen")]
111    pub listen: String,
112
113    #[serde(rename = "script")]
114    pub script: Option<Script>,
115}
116
117/// A script is a snippet of Javascript code that can be used to to perform setup or teardown
118/// operations on a particular response.
119#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)]
120pub struct Script {
121    #[serde(rename = "exec")]
122    pub exec: Option<Host>,
123
124    /// A unique, user defined identifier that can  be used to refer to this script from requests.
125    #[serde(rename = "id")]
126    pub id: Option<String>,
127
128    /// Script name
129    #[serde(rename = "name")]
130    pub name: Option<String>,
131
132    #[serde(rename = "src")]
133    pub src: Option<Url>,
134
135    /// Type of the script. E.g: 'text/javascript'
136    #[serde(rename = "type")]
137    pub script_type: Option<String>,
138}
139
140#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)]
141pub struct UrlClass {
142    /// Contains the URL fragment (if any). Usually this is not transmitted over the network, but
143    /// it could be useful to store this in some cases.
144    #[serde(rename = "hash")]
145    pub hash: Option<String>,
146
147    /// The host for the URL, E.g: api.yourdomain.com. Can be stored as a string or as an array
148    /// of strings.
149    #[serde(rename = "host")]
150    pub host: Option<Host>,
151
152    #[serde(rename = "path")]
153    pub path: Option<UrlPath>,
154
155    /// The port number present in this URL. An empty value implies 80/443 depending on whether
156    /// the protocol field contains http/https.
157    #[serde(rename = "port")]
158    pub port: Option<String>,
159
160    /// The protocol associated with the request, E.g: 'http'
161    #[serde(rename = "protocol")]
162    pub protocol: Option<String>,
163
164    /// An array of QueryParams, which is basically the query string part of the URL, parsed into
165    /// separate variables
166    #[serde(rename = "query")]
167    pub query: Option<Vec<QueryParam>>,
168
169    /// The string representation of the request URL, including the protocol, host, path, hash,
170    /// query parameter(s) and path variable(s).
171    #[serde(rename = "raw")]
172    pub raw: Option<String>,
173
174    /// Postman supports path variables with the syntax `/path/:variableName/to/somewhere`. These
175    /// variables are stored in this field.
176    #[serde(rename = "variable")]
177    pub variable: Option<Vec<Variable>>,
178}
179
180#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)]
181pub struct PathClass {
182    #[serde(rename = "type")]
183    pub path_type: Option<String>,
184
185    #[serde(rename = "value")]
186    pub value: Option<String>,
187}
188
189#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)]
190pub struct QueryParam {
191    #[serde(rename = "description")]
192    pub description: Option<DescriptionUnion>,
193
194    /// If set to true, the current query parameter will not be sent with the request.
195    #[serde(rename = "disabled")]
196    pub disabled: Option<bool>,
197
198    #[serde(rename = "key")]
199    pub key: Option<String>,
200
201    #[serde(rename = "value")]
202    pub value: Option<String>,
203}
204
205#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)]
206pub struct Description {
207    /// The content of the description goes here, as a raw string.
208    #[serde(rename = "content")]
209    pub content: Option<String>,
210
211    /// Holds the mime type of the raw description content. E.g: 'text/markdown' or 'text/html'.
212    /// The type is used to correctly render the description when generating documentation, or in
213    /// the Postman app.
214    #[serde(rename = "type")]
215    pub description_type: Option<String>,
216
217    /// Description can have versions associated with it, which should be put in this property.
218    #[serde(rename = "version")]
219    pub version: Option<serde_json::Value>,
220}
221
222/// Collection variables allow you to define a set of variables, that are a *part of the
223/// collection*, as opposed to environments, which are separate entities.
224/// *Note: Collection variables must not contain any sensitive information.*
225///
226/// Using variables in your Postman requests eliminates the need to duplicate requests, which
227/// can save a lot of time. Variables can be defined, and referenced to from any part of a
228/// request.
229#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)]
230pub struct Variable {
231    #[serde(rename = "description")]
232    pub description: Option<DescriptionUnion>,
233
234    #[serde(rename = "disabled")]
235    pub disabled: Option<bool>,
236
237    /// A variable ID is a unique user-defined value that identifies the variable within a
238    /// collection. In traditional terms, this would be a variable name.
239    #[serde(rename = "id")]
240    pub id: Option<String>,
241
242    /// A variable key is a human friendly value that identifies the variable within a
243    /// collection. In traditional terms, this would be a variable name.
244    #[serde(rename = "key")]
245    pub key: Option<String>,
246
247    /// Variable name
248    #[serde(rename = "name")]
249    pub name: Option<String>,
250
251    /// When set to true, indicates that this variable has been set by Postman
252    #[serde(rename = "system")]
253    pub system: Option<bool>,
254
255    /// A variable may have multiple types. This field specifies the type of the variable.
256    #[serde(rename = "type")]
257    pub variable_type: Option<VariableType>,
258
259    /// The value that a variable holds in this collection. Ultimately, the variables will be
260    /// replaced by this value, when say running a set of requests from a collection
261    #[serde(rename = "value")]
262    pub value: Option<serde_json::Value>,
263}
264
265/// Detailed description of the info block
266#[derive(Clone, Debug, Deserialize, Serialize, PartialEq, Default)]
267pub struct Information {
268    /// Every collection is identified by the unique value of this field. The value of this field
269    /// is usually easiest to generate using a UID generator function. If you already have a
270    /// collection, it is recommended that you maintain the same id since changing the id usually
271    /// implies that is a different collection than it was originally.
272    /// *Note: This field exists for compatibility reasons with Collection Format V1.*
273    #[serde(rename = "_postman_id")]
274    pub postman_id: Option<String>,
275
276    #[serde(rename = "description")]
277    pub description: Option<DescriptionUnion>,
278
279    /// A collection's friendly name is defined by this field. You would want to set this field
280    /// to a value that would allow you to easily identify this collection among a bunch of other
281    /// collections, as such outlining its usage or content.
282    #[serde(rename = "name")]
283    pub name: String,
284
285    /// This should ideally hold a link to the Postman schema that is used to validate this
286    /// collection. E.g: https://schema.getpostman.com/collection/v1
287    #[serde(rename = "schema")]
288    pub schema: String,
289
290    #[serde(rename = "version")]
291    pub version: Option<CollectionVersion>,
292}
293
294#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)]
295pub struct CollectionVersionClass {
296    /// A human friendly identifier to make sense of the version numbers. E.g: 'beta-3'
297    #[serde(rename = "identifier")]
298    pub identifier: Option<String>,
299
300    /// Increment this number if you make changes to the collection that changes its behaviour.
301    /// E.g: Removing or adding new test scripts. (partly or completely).
302    #[serde(rename = "major")]
303    pub major: i64,
304
305    #[serde(rename = "meta")]
306    pub meta: Option<serde_json::Value>,
307
308    /// You should increment this number if you make changes that will not break anything that
309    /// uses the collection. E.g: removing a folder.
310    #[serde(rename = "minor")]
311    pub minor: i64,
312
313    /// Ideally, minor changes to a collection should result in the increment of this number.
314    #[serde(rename = "patch")]
315    pub patch: i64,
316}
317
318#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)]
319#[serde(untagged)]
320pub enum Items {
321    Item(Item),
322
323    ItemGroup(ItemGroup),
324}
325
326/// Items are entities which contain an actual HTTP request, and sample responses attached to
327/// it.
328#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)]
329pub struct Item {
330    #[serde(rename = "description")]
331    pub description: Option<DescriptionUnion>,
332
333    #[serde(rename = "event")]
334    pub event: Option<Vec<Event>>,
335
336    /// A unique ID that is used to identify collections internally
337    #[serde(rename = "id")]
338    pub id: Option<String>,
339
340    /// A human readable identifier for the current item.
341    ///
342    /// A folder's friendly name is defined by this field. You would want to set this field to a
343    /// value that would allow you to easily identify this folder.
344    #[serde(rename = "name")]
345    pub name: Option<String>,
346
347    /// Set of configurations used to alter the usual behavior of sending the request
348    #[serde(rename = "protocolProfileBehavior")]
349    pub protocol_profile_behavior: Option<ProtocolProfileBehavior>,
350
351    #[serde(rename = "request")]
352    pub request: RequestUnion,
353
354    #[serde(rename = "response")]
355    pub response: Option<Vec<ResponseClass>>,
356
357    #[serde(rename = "variable")]
358    pub variable: Option<Vec<Variable>>,
359}
360
361/// One of the primary goals of Postman is to organize the development of APIs. To this end,
362/// it is necessary to be able to group requests together. This can be achived using
363/// 'Folders'. A folder just is an ordered set of requests.
364#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)]
365pub struct ItemGroup {
366    #[serde(rename = "auth")]
367    pub auth: Option<Auth>,
368
369    #[serde(rename = "description")]
370    pub description: Option<DescriptionUnion>,
371
372    #[serde(rename = "event")]
373    pub event: Option<Vec<Event>>,
374
375    /// Items are entities which contain an actual HTTP request, and sample responses attached to
376    /// it. Folders may contain many items.
377    #[serde(rename = "item")]
378    pub item: Vec<Items>,
379
380    /// A folder's friendly name is defined by this field. You would want to set this field to a
381    /// value that would allow you to easily identify this folder.
382    #[serde(rename = "name")]
383    pub name: Option<String>,
384
385    #[serde(rename = "variable")]
386    pub variable: Option<Vec<Variable>>,
387}
388
389/// Set of configurations used to alter the usual behavior of sending the request
390#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)]
391pub struct ProtocolProfileBehavior {
392    /// Disable body pruning for GET, COPY, HEAD, PURGE and UNLOCK request methods.
393    #[serde(rename = "disableBodyPruning")]
394    pub disable_body_pruning: Option<bool>,
395}
396
397#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)]
398pub struct RequestClass {
399    #[serde(rename = "auth")]
400    pub auth: Option<Auth>,
401
402    #[serde(rename = "body")]
403    pub body: Option<Body>,
404
405    #[serde(rename = "certificate")]
406    pub certificate: Option<Certificate>,
407
408    #[serde(rename = "description")]
409    pub description: Option<DescriptionUnion>,
410
411    #[serde(rename = "header")]
412    pub header: Option<HeaderUnion>,
413
414    #[serde(rename = "method")]
415    pub method: Option<String>,
416
417    #[serde(rename = "proxy")]
418    pub proxy: Option<ProxyConfig>,
419
420    #[serde(rename = "url")]
421    pub url: Option<Url>,
422}
423
424/// This field contains the data usually contained in the request body.
425#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)]
426pub struct Body {
427    /// When set to true, prevents request body from being sent.
428    #[serde(rename = "disabled")]
429    pub disabled: Option<bool>,
430
431    #[serde(rename = "file")]
432    pub file: Option<File>,
433
434    #[serde(rename = "formdata")]
435    pub formdata: Option<Vec<FormParameter>>,
436
437    /// GraphQL request payload as stored by Postman.
438    #[serde(rename = "graphql")]
439    pub graphql: Option<serde_json::Value>,
440
441    /// Postman stores the type of data associated with this request in this field.
442    #[serde(rename = "mode")]
443    pub mode: Option<Mode>,
444
445    /// Additional configurations and options set for various body modes.
446    #[serde(rename = "options")]
447    pub options: Option<serde_json::Value>,
448
449    #[serde(rename = "raw")]
450    pub raw: Option<String>,
451
452    #[serde(rename = "urlencoded")]
453    pub urlencoded: Option<Vec<UrlEncodedParameter>>,
454}
455
456#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)]
457pub struct File {
458    #[serde(rename = "content")]
459    pub content: Option<String>,
460
461    #[serde(rename = "src")]
462    pub src: Option<String>,
463}
464
465#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)]
466pub struct FormParameter {
467    /// Override Content-Type header of this form data entity.
468    #[serde(rename = "contentType")]
469    pub content_type: Option<String>,
470
471    #[serde(rename = "description")]
472    pub description: Option<DescriptionUnion>,
473
474    /// When set to true, prevents this form data entity from being sent.
475    #[serde(rename = "disabled")]
476    pub disabled: Option<bool>,
477
478    #[serde(rename = "key")]
479    pub key: String,
480
481    #[serde(rename = "type")]
482    pub form_parameter_type: Option<String>,
483
484    #[serde(rename = "value")]
485    pub value: Option<String>,
486
487    #[serde(rename = "src")]
488    pub src: Option<FormParameterSrcUnion>,
489}
490
491#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)]
492#[serde(untagged)]
493pub enum FormParameterSrcUnion {
494    File(String),
495
496    Files(Vec<String>),
497}
498
499#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)]
500pub struct UrlEncodedParameter {
501    #[serde(rename = "description")]
502    pub description: Option<DescriptionUnion>,
503
504    #[serde(rename = "disabled")]
505    pub disabled: Option<bool>,
506
507    #[serde(rename = "key")]
508    pub key: String,
509
510    #[serde(rename = "type")]
511    pub parameter_type: Option<String>,
512
513    #[serde(rename = "value")]
514    pub value: Option<String>,
515}
516
517/// A representation of an ssl certificate
518#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)]
519pub struct Certificate {
520    /// An object containing path to file certificate, on the file system
521    #[serde(rename = "cert")]
522    pub cert: Option<Cert>,
523
524    /// An object containing path to file containing private key, on the file system
525    #[serde(rename = "key")]
526    pub key: Option<Key>,
527
528    /// A list of Url match pattern strings, to identify Urls this certificate can be used for.
529    #[serde(rename = "matches")]
530    pub matches: Option<Vec<Option<serde_json::Value>>>,
531
532    /// A name for the certificate for user reference
533    #[serde(rename = "name")]
534    pub name: Option<String>,
535
536    /// The passphrase for the certificate
537    #[serde(rename = "passphrase")]
538    pub passphrase: Option<String>,
539}
540
541/// An object containing path to file certificate, on the file system
542#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)]
543pub struct Cert {
544    /// The path to file containing key for certificate, on the file system
545    #[serde(rename = "src")]
546    pub src: Option<serde_json::Value>,
547}
548
549/// An object containing path to file containing private key, on the file system
550#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)]
551pub struct Key {
552    /// The path to file containing key for certificate, on the file system
553    #[serde(rename = "src")]
554    pub src: Option<serde_json::Value>,
555}
556
557/// A representation for a list of headers
558///
559/// Represents a single HTTP Header
560#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)]
561pub struct Header {
562    #[serde(rename = "description")]
563    pub description: Option<DescriptionUnion>,
564
565    /// If set to true, the current header will not be sent with requests.
566    #[serde(rename = "disabled")]
567    pub disabled: Option<bool>,
568
569    /// This holds the LHS of the HTTP Header, e.g ``Content-Type`` or ``X-Custom-Header``
570    #[serde(rename = "key")]
571    pub key: String,
572
573    /// The value (or the RHS) of the Header is stored in this field.
574    #[serde(rename = "value")]
575    pub value: String,
576}
577
578/// Using the Proxy, you can configure your custom proxy into the postman for particular url
579/// match
580#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)]
581pub struct ProxyConfig {
582    /// When set to true, ignores this proxy configuration entity
583    #[serde(rename = "disabled")]
584    pub disabled: Option<bool>,
585
586    /// The proxy server host
587    #[serde(rename = "host")]
588    pub host: Option<String>,
589
590    /// The Url match for which the proxy config is defined
591    #[serde(rename = "match")]
592    pub proxy_config_match: Option<String>,
593
594    /// The proxy server port
595    #[serde(rename = "port")]
596    pub port: Option<i64>,
597
598    /// The tunneling details for the proxy config
599    #[serde(rename = "tunnel")]
600    pub tunnel: Option<bool>,
601}
602
603#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)]
604pub struct ResponseClass {
605    /// The raw text of the response.
606    #[serde(rename = "body")]
607    pub body: Option<String>,
608
609    /// The numerical response code, example: 200, 201, 404, etc.
610    #[serde(rename = "code")]
611    pub code: Option<i64>,
612
613    #[serde(rename = "cookie")]
614    pub cookie: Option<Vec<Cookie>>,
615
616    #[serde(rename = "header")]
617    pub header: Option<Headers>,
618
619    /// A unique, user defined identifier that can  be used to refer to this response from
620    /// requests.
621    #[serde(rename = "id")]
622    pub id: Option<String>,
623
624    /// A friendly name for the saved response.
625    #[serde(rename = "name")]
626    pub name: Option<String>,
627
628    #[serde(rename = "originalRequest")]
629    pub original_request: Option<RequestUnion>,
630
631    /// The time taken by the request to complete. If a number, the unit is milliseconds. If the
632    /// response is manually created, this can be set to `null`.
633    #[serde(rename = "responseTime")]
634    pub response_time: Option<ResponseTime>,
635
636    /// Set of timing information related to request and response in milliseconds.
637    #[serde(rename = "timings")]
638    pub timings: Option<serde_json::Value>,
639
640    /// The response status, e.g: '200 OK'
641    #[serde(rename = "status")]
642    pub status: Option<String>,
643}
644
645/// A Cookie, that follows the [Google Chrome
646/// format](https://developer.chrome.com/extensions/cookies)
647#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)]
648pub struct Cookie {
649    /// The domain for which this cookie is valid.
650    #[serde(rename = "domain")]
651    pub domain: String,
652
653    /// When the cookie expires.
654    #[serde(rename = "expires")]
655    pub expires: Option<String>,
656
657    /// Custom attributes for a cookie go here, such as the [Priority
658    /// Field](https://code.google.com/p/chromium/issues/detail?id=232693)
659    #[serde(rename = "extensions")]
660    pub extensions: Option<Vec<Option<serde_json::Value>>>,
661
662    /// True if the cookie is a host-only cookie. (i.e. a request's URL domain must exactly match
663    /// the domain of the cookie).
664    #[serde(rename = "hostOnly")]
665    pub host_only: Option<bool>,
666
667    /// Indicates if this cookie is HTTP Only. (if True, the cookie is inaccessible to
668    /// client-side scripts)
669    #[serde(rename = "httpOnly")]
670    pub http_only: Option<bool>,
671
672    #[serde(rename = "maxAge")]
673    pub max_age: Option<String>,
674
675    /// This is the name of the Cookie.
676    #[serde(rename = "name")]
677    pub name: Option<String>,
678
679    /// The path associated with the Cookie.
680    #[serde(rename = "path")]
681    pub path: String,
682
683    /// Indicates if the 'secure' flag is set on the Cookie, meaning that it is transmitted over
684    /// secure connections only. (typically HTTPS)
685    #[serde(rename = "secure")]
686    pub secure: Option<bool>,
687
688    /// True if the cookie is a session cookie.
689    #[serde(rename = "session")]
690    pub session: Option<bool>,
691
692    /// The value of the Cookie.
693    #[serde(rename = "value")]
694    pub value: Option<String>,
695}
696
697/// The host for the URL, E.g: api.yourdomain.com. Can be stored as a string or as an array
698/// of strings.
699#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)]
700#[serde(untagged)]
701pub enum Host {
702    String(String),
703
704    StringArray(Vec<String>),
705}
706
707/// If object, contains the complete broken-down URL for this request. If string, contains
708/// the literal request URL.
709#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)]
710#[serde(untagged)]
711pub enum Url {
712    String(String),
713
714    UrlClass(UrlClass),
715}
716
717#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)]
718#[serde(untagged)]
719pub enum UrlPath {
720    String(String),
721
722    UnionArray(Vec<PathElement>),
723}
724
725/// The complete path of the current url, broken down into segments. A segment could be a
726/// string, or a path variable.
727#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)]
728#[serde(untagged)]
729pub enum PathElement {
730    PathClass(PathClass),
731
732    String(String),
733}
734
735/// A Description can be a raw text, or be an object, which holds the description along with
736/// its format.
737#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)]
738#[serde(untagged)]
739pub enum DescriptionUnion {
740    Description(Description),
741
742    String(String),
743}
744
745/// Postman allows you to version your collections as they grow, and this field holds the
746/// version number. While optional, it is recommended that you use this field to its fullest
747/// extent!
748#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)]
749#[serde(untagged)]
750pub enum CollectionVersion {
751    CollectionVersionClass(CollectionVersionClass),
752
753    String(String),
754}
755
756/// A request represents an HTTP request. If a string, the string is assumed to be the
757/// request URL and the method is assumed to be 'GET'.
758#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)]
759#[serde(untagged)]
760pub enum RequestUnion {
761    RequestClass(RequestClass),
762
763    String(String),
764}
765
766#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)]
767#[serde(untagged)]
768pub enum HeaderUnion {
769    HeaderArray(Vec<Header>),
770
771    String(String),
772}
773
774/// A response represents an HTTP response.
775#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)]
776#[serde(untagged)]
777pub enum Response {
778    AnythingArray(Vec<Option<serde_json::Value>>),
779
780    Bool(bool),
781
782    Double(f64),
783
784    Integer(i64),
785
786    ResponseClass(ResponseClass),
787
788    String(String),
789}
790
791#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)]
792#[serde(untagged)]
793pub enum Headers {
794    String(String),
795
796    UnionArray(Vec<HeaderElement>),
797}
798
799/// No HTTP request is complete without its headers, and the same is true for a Postman
800/// request. This field is an array containing all the headers.
801#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)]
802#[serde(untagged)]
803pub enum HeaderElement {
804    Header(Header),
805
806    String(String),
807}
808
809/// The time taken by the request to complete. If a number, the unit is milliseconds. If the
810/// response is manually created, this can be set to `null`.
811#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)]
812#[serde(untagged)]
813pub enum ResponseTime {
814    Integer(i64),
815
816    Double(f64),
817
818    String(String),
819}
820
821#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)]
822pub enum AuthType {
823    #[serde(rename = "apikey")]
824    Apikey,
825
826    #[serde(rename = "awsv4")]
827    Awsv4,
828
829    #[serde(rename = "basic")]
830    Basic,
831
832    #[serde(rename = "bearer")]
833    Bearer,
834
835    #[serde(rename = "digest")]
836    Digest,
837
838    #[serde(rename = "edgegrid")]
839    Edgegrid,
840
841    #[serde(rename = "hawk")]
842    Hawk,
843
844    #[serde(rename = "noauth")]
845    Noauth,
846
847    #[serde(rename = "ntlm")]
848    Ntlm,
849
850    #[serde(rename = "oauth1")]
851    Oauth1,
852
853    #[serde(rename = "oauth2")]
854    Oauth2,
855}
856
857/// Returns `Noauth` for AuthType by default
858impl Default for AuthType {
859    fn default() -> AuthType {
860        AuthType::Noauth
861    }
862}
863
864/// A variable may have multiple types. This field specifies the type of the variable.
865#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)]
866pub enum VariableType {
867    #[serde(rename = "any")]
868    Any,
869
870    #[serde(rename = "boolean")]
871    Boolean,
872
873    #[serde(rename = "number")]
874    Number,
875
876    #[serde(rename = "string")]
877    String,
878}
879
880/// Postman stores the type of data associated with this request in this field.
881#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)]
882pub enum Mode {
883    #[serde(rename = "file")]
884    File,
885
886    #[serde(rename = "formdata")]
887    Formdata,
888
889    #[serde(rename = "graphql")]
890    Graphql,
891
892    #[serde(rename = "raw")]
893    Raw,
894
895    #[serde(rename = "urlencoded")]
896    Urlencoded,
897}