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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
use serde::{Deserialize, Serialize};
use super::id::*;
use super::status::*;
use super::{Resource, ResourceCommon};
#[derive(Clone, Debug, Deserialize, Resource, Serialize)]
#[api_name = "library"]
pub struct Library {
#[serde(flatten)]
pub common: ResourceCommon,
pub resource: Id<Library>,
pub status: GenericStatus,
pub source_code: String,
#[serde(skip)]
_placeholder: (),
}
#[derive(Debug, Serialize)]
pub struct Args {
#[serde(skip_serializing_if = "Option::is_none")]
pub category: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(skip_serializing_if = "Vec::is_empty")]
pub imports: Vec<Id<Library>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
pub source_code: String,
#[serde(skip_serializing_if = "Vec::is_empty")]
pub tags: Vec<String>,
#[serde(skip)]
_placeholder: (),
}
impl Args {
pub fn new<S: Into<String>>(source_code: S) -> Args {
Args {
category: Default::default(),
description: Default::default(),
imports: Default::default(),
name: Default::default(),
source_code: source_code.into(),
tags: Default::default(),
_placeholder: (),
}
}
}
impl super::Args for Args {
type Resource = Library;
}