Debian Codegraph @

crt/aws-c-sdkutils/tests/resources/valid-rules/fns.json

raw symbols SCIP
1 {
2 "documentation": "functions in more places",
3 "parameters": {
4 "Uri": {
5 "type": "string",
6 "documentation": "A URI to use"
7 },
8 "Arn": {
9 "type": "string",
10 "documentation": "an ARN to extract fields from"
11 },
12 "CustomError": {
13 "type": "string",
14 "documentation": "when set, a custom error message"
15 }
16 },
17 "rules": [
18 {
19 "documentation": "when URI is set, use it directly",
20 "conditions": [
21 {
22 "fn": "isSet",
23 "argv": [
24 {
25 "ref": "Uri"
26 }
27 ]
28 },
29 {
30 "fn": "isSet",
31 "argv": [
32 {
33 "ref": "Arn"
34 }
35 ]
36 },
37 {
38 "fn": "aws.parseArn",
39 "argv": [
40 {
41 "ref": "Arn"
42 }
43 ],
44 "assign": "parsedArn"
45 }
46 ],
47 "endpoint": {
48 "url": {
49 "ref": "Uri"
50 },
51 "headers": {
52 "x-uri": [
53 {
54 "ref": "Uri"
55 }
56 ],
57 "x-arn-region": [
58 {
59 "fn": "getAttr",
60 "argv": [
61 {
62 "ref": "parsedArn"
63 },
64 "region"
65 ]
66 }
67 ]
68 }
69 },
70 "type": "endpoint"
71 },
72 {
73 "documentation": "A custom error",
74 "conditions": [
75 {
76 "fn": "isSet",
77 "argv": [
78 {
79 "ref": "CustomError"
80 }
81 ]
82 }
83 ],
84 "type": "error",
85 "error": {
86 "ref": "CustomError"
87 }
88 },
89 {
90 "type": "error",
91 "conditions": [
92 {
93 "fn": "isSet",
94 "argv": [
95 {
96 "ref": "Arn"
97 }
98 ]
99 },
100 {
101 "fn": "aws.parseArn",
102 "argv": [
103 {
104 "ref": "Arn"
105 }
106 ],
107 "assign": "parsedArn"
108 }
109 ],
110 "error": {
111 "fn": "getAttr",
112 "argv": [
113 {
114 "ref": "parsedArn"
115 },
116 "partition"
117 ]
118 }
119 },
120 {
121 "documentation": "fallback when nothing is set",
122 "conditions": [],
123 "error": "No fields were set",
124 "type": "error"
125 }
126 ],
127 "version": "1.3"
128 }