sylphx 0.3.2

The Sylphx SDK: one API, one key, every Sylphx service. Generated from the Sylphx schema registry.
Documentation
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
// @generated by sylphx-gen 0.1.0 from contracts@c8a7361c53e572321b0ec9fb014fd1e8279b007b62562423038e0d0e5b9d767a. Do not edit.
//! `sylphx.assets.v1`.

#![allow(clippy::all)]

/// The request of ApproveVariant.
#[derive(Debug, Clone, Default, PartialEq, serde::Serialize, serde::Deserialize)]
#[non_exhaustive]
pub struct ApproveVariantRequest {
    /// The name of the asset.
    ///
    /// Field behavior: `required`.
    #[serde(default, skip_serializing_if = "crate::runtime::is_default")]
    pub name: String,
    /// The content hash of the variant, 64 lowercase hex characters.
    ///
    /// Field behavior: `required`.
    #[serde(
        default,
        skip_serializing_if = "crate::runtime::is_default",
        alias = "contentHash"
    )]
    pub content_hash: String,
}

/// An Asset is one declared asset and its generated variants. Its id is the
/// 16-hex logical key of the recipe, so the same recipe is always the same
/// Asset. There is no create, update or delete: the key is immutable, and
/// `:generate` writes the record.
#[derive(Debug, Clone, Default, PartialEq, serde::Serialize, serde::Deserialize)]
#[non_exhaustive]
pub struct Asset {
    /// `orgs/{org}/projects/{project}/envs/{env}/assets/{asset}`, where `{asset}`
    /// is the 16-hex logical key.
    ///
    /// Field behavior: `identifier`.
    #[serde(default, skip_serializing_if = "crate::runtime::is_default")]
    pub name: String,
    /// `ast_<cell><ulid>`; never reused.
    ///
    /// Field behavior: `output_only`.
    #[serde(default, skip_serializing_if = "crate::runtime::is_default")]
    pub uid: String,
    /// Resource metadata.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub meta: Option<crate::common::ResourceMeta>,
    /// The logical key: 16 lowercase hex characters computed from the recipe.
    ///
    /// Field behavior: `output_only`.
    #[serde(default, skip_serializing_if = "crate::runtime::is_default")]
    pub key: String,
    /// What kind of asset this is.
    ///
    /// Field behavior: `output_only`.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub kind: Option<AssetKind>,
    /// The recipe the asset was declared with.
    ///
    /// Field behavior: `output_only`.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub recipe: Option<AssetRecipe>,
    /// The exact text the key is the hash of.
    ///
    /// Field behavior: `output_only`.
    #[serde(default, skip_serializing_if = "crate::runtime::is_default")]
    pub canonical: String,
    /// How many variants the recipe asks for.
    ///
    /// Field behavior: `output_only`.
    #[serde(
        default,
        skip_serializing_if = "crate::runtime::is_default",
        alias = "variantsWanted"
    )]
    pub variants_wanted: i32,
    /// Where the asset is in its life.
    ///
    /// Field behavior: `output_only`.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub state: Option<AssetState>,
    /// Ready, Reconciling, Stalled.
    ///
    /// Field behavior: `output_only`.
    #[serde(default, skip_serializing_if = "Vec::is_empty")]
    pub conditions: Vec<crate::common::Condition>,
    /// The seed of the asset, a decimal integer as a string.
    ///
    /// Field behavior: `output_only`.
    #[serde(default, skip_serializing_if = "crate::runtime::is_default")]
    pub seed: String,
    /// The stored variants, ordered by slot.
    ///
    /// Field behavior: `output_only`.
    #[serde(default, skip_serializing_if = "Vec::is_empty")]
    pub variants: Vec<Variant>,
    /// When the asset was first generated.
    ///
    /// Field behavior: `output_only`.
    #[serde(
        default,
        skip_serializing_if = "crate::runtime::is_default",
        alias = "createTime"
    )]
    pub create_time: String,
    /// When the asset last changed.
    ///
    /// Field behavior: `output_only`.
    #[serde(
        default,
        skip_serializing_if = "crate::runtime::is_default",
        alias = "updateTime"
    )]
    pub update_time: String,
}

/// An AssetRecipe is what the code declares for one asset. The logical key is
/// derived from it.
#[derive(Debug, Clone, Default, PartialEq, serde::Serialize, serde::Deserialize)]
#[non_exhaustive]
pub struct AssetRecipe {
    /// What kind of asset to make.
    ///
    /// Field behavior: `required`.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub kind: Option<AssetKind>,
    /// What to make, at most 8000 bytes. Empty only for `ASSET_KIND_CHARACTER`.
    ///
    /// Field behavior: `required`.
    #[serde(default, skip_serializing_if = "crate::runtime::is_default")]
    pub prompt: String,
    /// The locale of the asset, a BCP 47 tag; empty for images.
    #[serde(default, skip_serializing_if = "crate::runtime::is_default")]
    pub locale: String,
    /// The character this asset shows; only for `ASSET_KIND_CHARACTER`, encoded
    /// in the canonical text as `id=`.
    #[serde(
        default,
        skip_serializing_if = "crate::runtime::is_default",
        alias = "characterId"
    )]
    pub character_id: String,
    /// Kind-specific parameters in canonical text form, such as `"2"`,
    /// `"1024x768"`, `"true"` or a 16-hex key. At most 16 pairs; keys are
    /// `[a-z_]` up to 32 characters, values up to 256 characters.
    #[serde(default, skip_serializing_if = "std::collections::BTreeMap::is_empty")]
    pub params: std::collections::BTreeMap<String, String>,
    /// The key the caller computed, 16 lowercase hex characters. When it differs
    /// from the server's, the call is refused with `INVALID_FIELD` and the
    /// problem carries the server's canonical text, which catches encoder drift.
    #[serde(default, skip_serializing_if = "crate::runtime::is_default")]
    pub key: String,
}

/// An AssetSummary is the progress of one asset in a `:generate` call.
#[derive(Debug, Clone, Default, PartialEq, serde::Serialize, serde::Deserialize)]
#[non_exhaustive]
pub struct AssetSummary {
    /// The logical key.
    #[serde(default, skip_serializing_if = "crate::runtime::is_default")]
    pub key: String,
    /// The asset's resource name.
    #[serde(default, skip_serializing_if = "crate::runtime::is_default")]
    pub name: String,
    /// Where the asset is in its life.
    ///
    /// Field behavior: `output_only`.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub state: Option<AssetState>,
    /// How many variants are stored.
    #[serde(
        default,
        skip_serializing_if = "crate::runtime::is_default",
        alias = "variantsReady"
    )]
    pub variants_ready: i32,
    /// How many variants the recipe asks for.
    #[serde(
        default,
        skip_serializing_if = "crate::runtime::is_default",
        alias = "variantsWanted"
    )]
    pub variants_wanted: i32,
}

/// The request of ExportAssets.
#[derive(Debug, Clone, Default, PartialEq, serde::Serialize, serde::Deserialize)]
#[non_exhaustive]
pub struct ExportAssetsRequest {
    /// The environment to export from.
    ///
    /// Field behavior: `required`.
    #[serde(default, skip_serializing_if = "crate::runtime::is_default")]
    pub parent: String,
    /// At most this many items; default 100, clamped to 1000.
    #[serde(
        default,
        skip_serializing_if = "crate::runtime::is_default",
        alias = "pageSize"
    )]
    pub page_size: i32,
    /// `next_page_token` of the previous page.
    #[serde(
        default,
        skip_serializing_if = "crate::runtime::is_default",
        alias = "pageToken"
    )]
    pub page_token: String,
    /// AIP-160 filter, limited to `kind` and `review_state`; for example
    /// `kind = ASSET_KIND_IMAGE`. Without a `review_state` term, rejected and
    /// retired variants are left out.
    #[serde(default, skip_serializing_if = "crate::runtime::is_default")]
    pub filter: String,
}

/// The response of ExportAssets.
#[derive(Debug, Clone, Default, PartialEq, serde::Serialize, serde::Deserialize)]
#[non_exhaustive]
pub struct ExportAssetsResponse {
    /// The page, oldest variant first.
    #[serde(default, skip_serializing_if = "Vec::is_empty")]
    pub items: Vec<ExportedAsset>,
    /// The token of the next page; empty on the last page.
    #[serde(
        default,
        skip_serializing_if = "crate::runtime::is_default",
        alias = "nextPageToken"
    )]
    pub next_page_token: String,
    /// On the last page only: `sha256:` and the hex SHA-256 of the `content_hash`
    /// of every item the filter matches (one line per item, sorted, each ended
    /// by a line feed). A client that downloaded every page recomputes it from
    /// the items it holds.
    #[serde(
        default,
        skip_serializing_if = "crate::runtime::is_default",
        alias = "manifestDigest"
    )]
    pub manifest_digest: String,
}

/// An ExportedAsset is one variant in the flat export manifest. Download the
/// bytes from `url` and check them against `content_hash`.
#[derive(Debug, Clone, Default, PartialEq, serde::Serialize, serde::Deserialize)]
#[non_exhaustive]
pub struct ExportedAsset {
    /// The logical key of the asset the variant belongs to.
    #[serde(
        default,
        skip_serializing_if = "crate::runtime::is_default",
        alias = "assetKey"
    )]
    pub asset_key: String,
    /// The asset's immutable uid.
    #[serde(
        default,
        skip_serializing_if = "crate::runtime::is_default",
        alias = "assetUid"
    )]
    pub asset_uid: String,
    /// What the asset is.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub kind: Option<AssetKind>,
    /// SHA-256 of the file, 64 lowercase hex characters.
    #[serde(
        default,
        skip_serializing_if = "crate::runtime::is_default",
        alias = "contentHash"
    )]
    pub content_hash: String,
    /// The file extension, without the dot.
    #[serde(default, skip_serializing_if = "crate::runtime::is_default")]
    pub ext: String,
    /// The IANA media type.
    #[serde(
        default,
        skip_serializing_if = "crate::runtime::is_default",
        alias = "mediaType"
    )]
    pub media_type: String,
    /// The file size in bytes.
    #[serde(
        default,
        skip_serializing_if = "crate::runtime::is_default",
        with = "crate::runtime::int64"
    )]
    pub bytes: i64,
    /// Pixel width.
    #[serde(default, skip_serializing_if = "crate::runtime::is_default")]
    pub width: i32,
    /// Pixel height.
    #[serde(default, skip_serializing_if = "crate::runtime::is_default")]
    pub height: i32,
    /// The public, content-addressed, immutable download URL.
    #[serde(default, skip_serializing_if = "crate::runtime::is_default")]
    pub url: String,
    /// The human review of the variant.
    ///
    /// Field behavior: `output_only`.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        alias = "reviewState"
    )]
    pub review_state: Option<ReviewState>,
    /// Who approved the variant; empty until approved.
    #[serde(
        default,
        skip_serializing_if = "crate::runtime::is_default",
        alias = "approvedBy"
    )]
    pub approved_by: String,
    /// The recorded model id; informational.
    #[serde(default, skip_serializing_if = "crate::runtime::is_default")]
    pub model: String,
    /// The seed, an unsigned decimal string.
    #[serde(default, skip_serializing_if = "crate::runtime::is_default")]
    pub seed: String,
}

/// The request of GenerateAssets.
#[derive(Debug, Clone, Default, PartialEq, serde::Serialize, serde::Deserialize)]
#[non_exhaustive]
pub struct GenerateAssetsRequest {
    /// The environment to generate in.
    ///
    /// Field behavior: `required`.
    #[serde(default, skip_serializing_if = "crate::runtime::is_default")]
    pub parent: String,
    /// The recipes the code declares; 1 to 1000.
    ///
    /// Field behavior: `required`.
    #[serde(default, skip_serializing_if = "Vec::is_empty")]
    pub recipes: Vec<AssetRecipe>,
    /// Validate the recipes and return the counts without writing or
    /// generating anything.
    #[serde(
        default,
        skip_serializing_if = "crate::runtime::is_default",
        alias = "validateOnly"
    )]
    pub validate_only: bool,
}

/// The response of GenerateAssets.
#[derive(Debug, Clone, Default, PartialEq, serde::Serialize, serde::Deserialize)]
#[non_exhaustive]
pub struct GenerateAssetsResponse {
    /// Assets new in this call.
    #[serde(default, skip_serializing_if = "crate::runtime::is_default")]
    pub created: i32,
    /// Assets that already existed with the same key.
    #[serde(default, skip_serializing_if = "crate::runtime::is_default")]
    pub unchanged: i32,
    /// Variants stored by this call.
    #[serde(default, skip_serializing_if = "crate::runtime::is_default")]
    pub generated: i32,
    /// Variants still to generate; call again until it is 0.
    #[serde(default, skip_serializing_if = "crate::runtime::is_default")]
    pub pending: i32,
    /// Assets whose slots still fail after their attempts.
    #[serde(default, skip_serializing_if = "crate::runtime::is_default")]
    pub failed: i32,
    /// Assets refused, for example by moderation.
    #[serde(default, skip_serializing_if = "crate::runtime::is_default")]
    pub refused: i32,
    /// Assets of a kind the service does not generate yet.
    #[serde(default, skip_serializing_if = "crate::runtime::is_default")]
    pub unsupported: i32,
    /// One summary per recipe, in the order sent.
    #[serde(default, skip_serializing_if = "Vec::is_empty")]
    pub assets: Vec<AssetSummary>,
    /// What this call used.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub usage: Option<Usage>,
}

/// The request of GetAsset.
#[derive(Debug, Clone, Default, PartialEq, serde::Serialize, serde::Deserialize)]
#[non_exhaustive]
pub struct GetAssetRequest {
    /// The name of the asset to get.
    ///
    /// Field behavior: `required`.
    #[serde(default, skip_serializing_if = "crate::runtime::is_default")]
    pub name: String,
}

/// The request of ListAssets.
#[derive(Debug, Clone, Default, PartialEq, serde::Serialize, serde::Deserialize)]
#[non_exhaustive]
pub struct ListAssetsRequest {
    /// The parent to list in.
    ///
    /// Field behavior: `required`.
    #[serde(default, skip_serializing_if = "crate::runtime::is_default")]
    pub parent: String,
    /// At most this many; default 50, clamped to 1000.
    #[serde(
        default,
        skip_serializing_if = "crate::runtime::is_default",
        alias = "pageSize"
    )]
    pub page_size: i32,
    /// `next_page_token` of the previous page.
    #[serde(
        default,
        skip_serializing_if = "crate::runtime::is_default",
        alias = "pageToken"
    )]
    pub page_token: String,
    /// AIP-160 filter, limited to `kind`, `state`, and `review_state`; for
    /// example `kind = ASSET_KIND_IMAGE AND state = ASSET_STATE_READY`.
    #[serde(default, skip_serializing_if = "crate::runtime::is_default")]
    pub filter: String,
}

/// The response of ListAssets.
#[derive(Debug, Clone, Default, PartialEq, serde::Serialize, serde::Deserialize)]
#[non_exhaustive]
pub struct ListAssetsResponse {
    /// The page.
    #[serde(default, skip_serializing_if = "Vec::is_empty")]
    pub assets: Vec<Asset>,
    /// The token of the next page; empty on the last page.
    #[serde(
        default,
        skip_serializing_if = "crate::runtime::is_default",
        alias = "nextPageToken"
    )]
    pub next_page_token: String,
}

/// The request of LockAssets.
#[derive(Debug, Clone, Default, PartialEq, serde::Serialize, serde::Deserialize)]
#[non_exhaustive]
pub struct LockAssetsRequest {
    /// The environment to read from.
    ///
    /// Field behavior: `required`.
    #[serde(default, skip_serializing_if = "crate::runtime::is_default")]
    pub parent: String,
    /// The logical keys the code declares, 1 to 5000, each 16 lowercase hex
    /// characters. The lock holds only these, so a removed recipe drops out.
    ///
    /// Field behavior: `required`.
    #[serde(default, skip_serializing_if = "Vec::is_empty")]
    pub keys: Vec<String>,
}

/// The response of LockAssets.
#[derive(Debug, Clone, Default, PartialEq, serde::Serialize, serde::Deserialize)]
#[non_exhaustive]
pub struct LockAssetsResponse {
    /// The lock entries of the keys that have a complete record, sorted by key.
    #[serde(default, skip_serializing_if = "Vec::is_empty")]
    pub entries: Vec<LockEntry>,
    /// Keys with no record.
    #[serde(default, skip_serializing_if = "Vec::is_empty")]
    pub missing: Vec<String>,
    /// Keys whose stored variants are fewer than wanted, or whose state is
    /// neither ready nor approved.
    #[serde(default, skip_serializing_if = "Vec::is_empty")]
    pub incomplete: Vec<String>,
    /// The canonical `assets.lock` text, version 1.
    #[serde(default, skip_serializing_if = "crate::runtime::is_default")]
    pub content: String,
}

/// A LockEntry is one asset as it appears in `assets.lock`.
#[derive(Debug, Clone, Default, PartialEq, serde::Serialize, serde::Deserialize)]
#[non_exhaustive]
pub struct LockEntry {
    /// The logical key.
    ///
    /// Field behavior: `output_only`.
    #[serde(default, skip_serializing_if = "crate::runtime::is_default")]
    pub key: String,
    /// What kind of asset this is.
    ///
    /// Field behavior: `output_only`.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub kind: Option<AssetKind>,
    /// The seed, a decimal integer as a string.
    ///
    /// Field behavior: `output_only`.
    #[serde(default, skip_serializing_if = "crate::runtime::is_default")]
    pub seed: String,
    /// The variants, ordered by slot.
    ///
    /// Field behavior: `output_only`.
    #[serde(default, skip_serializing_if = "Vec::is_empty")]
    pub variants: Vec<LockVariant>,
}

/// A LockVariant is one variant as it appears in `assets.lock`. Its URL is the
/// lock's base URL, the content hash, a dot, and the extension.
#[derive(Debug, Clone, Default, PartialEq, serde::Serialize, serde::Deserialize)]
#[non_exhaustive]
pub struct LockVariant {
    /// The SHA-256 of the file's bytes, 64 lowercase hex characters.
    ///
    /// Field behavior: `output_only`.
    #[serde(
        default,
        skip_serializing_if = "crate::runtime::is_default",
        alias = "contentHash"
    )]
    pub content_hash: String,
    /// The file's extension without the dot.
    ///
    /// Field behavior: `output_only`.
    #[serde(default, skip_serializing_if = "crate::runtime::is_default")]
    pub ext: String,
    /// The file's media type.
    ///
    /// Field behavior: `output_only`.
    #[serde(
        default,
        skip_serializing_if = "crate::runtime::is_default",
        alias = "mediaType"
    )]
    pub media_type: String,
    /// Width in pixels.
    ///
    /// Field behavior: `output_only`.
    #[serde(default, skip_serializing_if = "crate::runtime::is_default")]
    pub width: i32,
    /// Height in pixels.
    ///
    /// Field behavior: `output_only`.
    #[serde(default, skip_serializing_if = "crate::runtime::is_default")]
    pub height: i32,
    /// The file's size in bytes.
    ///
    /// Field behavior: `output_only`.
    #[serde(
        default,
        skip_serializing_if = "crate::runtime::is_default",
        with = "crate::runtime::int64"
    )]
    pub bytes: i64,
    /// The model that made this variant.
    ///
    /// Field behavior: `output_only`.
    #[serde(default, skip_serializing_if = "crate::runtime::is_default")]
    pub model: String,
    /// The principal that approved the variant; empty when unreviewed.
    ///
    /// Field behavior: `output_only`.
    #[serde(
        default,
        skip_serializing_if = "crate::runtime::is_default",
        alias = "approvedBy"
    )]
    pub approved_by: String,
}

/// A QaFinding is one problem QA found in a variant.
#[derive(Debug, Clone, Default, PartialEq, serde::Serialize, serde::Deserialize)]
#[non_exhaustive]
pub struct QaFinding {
    /// The check that found it.
    ///
    /// Field behavior: `output_only`.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub check: Option<QaCheck>,
    /// How serious it is.
    ///
    /// Field behavior: `output_only`.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub severity: Option<QaSeverity>,
    /// What is wrong.
    ///
    /// Field behavior: `output_only`.
    #[serde(default, skip_serializing_if = "crate::runtime::is_default")]
    pub message: String,
}

/// The request of RejectVariant.
#[derive(Debug, Clone, Default, PartialEq, serde::Serialize, serde::Deserialize)]
#[non_exhaustive]
pub struct RejectVariantRequest {
    /// The name of the asset.
    ///
    /// Field behavior: `required`.
    #[serde(default, skip_serializing_if = "crate::runtime::is_default")]
    pub name: String,
    /// The content hash of the variant, 64 lowercase hex characters.
    ///
    /// Field behavior: `required`.
    #[serde(
        default,
        skip_serializing_if = "crate::runtime::is_default",
        alias = "contentHash"
    )]
    pub content_hash: String,
}

/// The request of RetireVariant.
#[derive(Debug, Clone, Default, PartialEq, serde::Serialize, serde::Deserialize)]
#[non_exhaustive]
pub struct RetireVariantRequest {
    /// The name of the asset.
    ///
    /// Field behavior: `required`.
    #[serde(default, skip_serializing_if = "crate::runtime::is_default")]
    pub name: String,
    /// The content hash of the variant, 64 lowercase hex characters.
    ///
    /// Field behavior: `required`.
    #[serde(
        default,
        skip_serializing_if = "crate::runtime::is_default",
        alias = "contentHash"
    )]
    pub content_hash: String,
    /// Why the variant is retired, at most 500 characters.
    #[serde(default, skip_serializing_if = "crate::runtime::is_default")]
    pub reason: String,
}

/// Usage is what one call consumed.
#[derive(Debug, Clone, Default, PartialEq, serde::Serialize, serde::Deserialize)]
#[non_exhaustive]
pub struct Usage {
    /// Images stored by this call, the billed quantity.
    #[serde(
        default,
        skip_serializing_if = "crate::runtime::is_default",
        with = "crate::runtime::int64"
    )]
    pub images: i64,
}

/// A Variant is one stored result for an asset: a file addressed by the hash of
/// its bytes. A variant is immutable; only its review changes.
#[derive(Debug, Clone, Default, PartialEq, serde::Serialize, serde::Deserialize)]
#[non_exhaustive]
pub struct Variant {
    /// The slot the variant fills, from 0.
    ///
    /// Field behavior: `output_only`.
    #[serde(default, skip_serializing_if = "crate::runtime::is_default")]
    pub slot: i32,
    /// The SHA-256 of the file's bytes, 64 lowercase hex characters.
    ///
    /// Field behavior: `output_only`.
    #[serde(
        default,
        skip_serializing_if = "crate::runtime::is_default",
        alias = "contentHash"
    )]
    pub content_hash: String,
    /// The immutable public URL: the project's base URL, then the content hash
    /// and extension.
    ///
    /// Field behavior: `output_only`.
    #[serde(default, skip_serializing_if = "crate::runtime::is_default")]
    pub url: String,
    /// The file's media type, such as `image/png`.
    ///
    /// Field behavior: `output_only`.
    #[serde(
        default,
        skip_serializing_if = "crate::runtime::is_default",
        alias = "mediaType"
    )]
    pub media_type: String,
    /// The file's extension without the dot, such as `png`.
    ///
    /// Field behavior: `output_only`.
    #[serde(default, skip_serializing_if = "crate::runtime::is_default")]
    pub ext: String,
    /// Width in pixels.
    ///
    /// Field behavior: `output_only`.
    #[serde(default, skip_serializing_if = "crate::runtime::is_default")]
    pub width: i32,
    /// Height in pixels.
    ///
    /// Field behavior: `output_only`.
    #[serde(default, skip_serializing_if = "crate::runtime::is_default")]
    pub height: i32,
    /// The file's size in bytes.
    ///
    /// Field behavior: `output_only`.
    #[serde(
        default,
        skip_serializing_if = "crate::runtime::is_default",
        with = "crate::runtime::int64"
    )]
    pub bytes: i64,
    /// The model that made this variant.
    ///
    /// Field behavior: `output_only`.
    #[serde(default, skip_serializing_if = "crate::runtime::is_default")]
    pub model: String,
    /// The seed this variant was made with, a decimal integer as a string.
    ///
    /// Field behavior: `output_only`.
    #[serde(default, skip_serializing_if = "crate::runtime::is_default")]
    pub seed: String,
    /// The human review of the variant.
    ///
    /// Field behavior: `output_only`.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        alias = "reviewState"
    )]
    pub review_state: Option<ReviewState>,
    /// The result of QA on the file.
    ///
    /// Field behavior: `output_only`.
    #[serde(default, skip_serializing_if = "Option::is_none", alias = "qaState")]
    pub qa_state: Option<QaState>,
    /// What QA found.
    ///
    /// Field behavior: `output_only`.
    #[serde(default, skip_serializing_if = "Vec::is_empty")]
    pub findings: Vec<QaFinding>,
    /// Whether the file carries content credentials.
    ///
    /// Field behavior: `output_only`.
    #[serde(
        default,
        skip_serializing_if = "crate::runtime::is_default",
        alias = "contentCredentials"
    )]
    pub content_credentials: bool,
    /// The principal that approved the variant; empty until it is approved.
    ///
    /// Field behavior: `output_only`.
    #[serde(
        default,
        skip_serializing_if = "crate::runtime::is_default",
        alias = "approvedBy"
    )]
    pub approved_by: String,
    /// When the variant was stored.
    ///
    /// Field behavior: `output_only`.
    #[serde(
        default,
        skip_serializing_if = "crate::runtime::is_default",
        alias = "createTime"
    )]
    pub create_time: String,
}

/// AssetKind is what an asset is.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
#[non_exhaustive]
pub enum AssetKind {
    /// A still image.
    Image,
    /// A sound effect.
    Sfx,
    /// A piece of music.
    Music,
    /// A video clip.
    Video,
    /// A character, the reference other assets show.
    Character,
    /// A spoken voice line.
    Voice,
    /// A value this SDK version does not know.
    Unknown(String),
}

impl AssetKind {
    /// The wire string.
    pub fn as_str(&self) -> &str {
        match self {
            Self::Image => "image",
            Self::Sfx => "sfx",
            Self::Music => "music",
            Self::Video => "video",
            Self::Character => "character",
            Self::Voice => "voice",
            Self::Unknown(s) => s.as_str(),
        }
    }

    /// Parses a wire string; unknown values are kept.
    pub fn from_wire(s: &str) -> Self {
        match s {
            "image" => Self::Image,
            "sfx" => Self::Sfx,
            "music" => Self::Music,
            "video" => Self::Video,
            "character" => Self::Character,
            "voice" => Self::Voice,
            other => Self::Unknown(other.to_string()),
        }
    }
}

impl serde::Serialize for AssetKind {
    fn serialize<S: serde::Serializer>(&self, s: S) -> Result<S::Ok, S::Error> {
        s.serialize_str(self.as_str())
    }
}

impl<'de> serde::Deserialize<'de> for AssetKind {
    fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
        let s = <String as serde::Deserialize>::deserialize(d)?;
        Ok(Self::from_wire(&s))
    }
}

impl crate::runtime::QueryValue for AssetKind {
    fn query_value(&self) -> Option<String> {
        Some(self.as_str().to_string())
    }
}

/// AssetState is where an asset is in its life.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
#[non_exhaustive]
pub enum AssetState {
    /// Variants are still to generate.
    Pending,
    /// Every wanted variant is stored and none is approved yet.
    Ready,
    /// Every wanted variant is stored and approved.
    Approved,
    /// A slot still fails after its attempts; change the prompt.
    Failed,
    /// The recipe was refused, for example by moderation.
    Refused,
    /// The service does not generate this kind yet; nothing is billed.
    Unsupported,
    /// A value this SDK version does not know.
    Unknown(String),
}

impl AssetState {
    /// The wire string.
    pub fn as_str(&self) -> &str {
        match self {
            Self::Pending => "pending",
            Self::Ready => "ready",
            Self::Approved => "approved",
            Self::Failed => "failed",
            Self::Refused => "refused",
            Self::Unsupported => "unsupported",
            Self::Unknown(s) => s.as_str(),
        }
    }

    /// Parses a wire string; unknown values are kept.
    pub fn from_wire(s: &str) -> Self {
        match s {
            "pending" => Self::Pending,
            "ready" => Self::Ready,
            "approved" => Self::Approved,
            "failed" => Self::Failed,
            "refused" => Self::Refused,
            "unsupported" => Self::Unsupported,
            other => Self::Unknown(other.to_string()),
        }
    }
}

impl serde::Serialize for AssetState {
    fn serialize<S: serde::Serializer>(&self, s: S) -> Result<S::Ok, S::Error> {
        s.serialize_str(self.as_str())
    }
}

impl<'de> serde::Deserialize<'de> for AssetState {
    fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
        let s = <String as serde::Deserialize>::deserialize(d)?;
        Ok(Self::from_wire(&s))
    }
}

impl crate::runtime::QueryValue for AssetState {
    fn query_value(&self) -> Option<String> {
        Some(self.as_str().to_string())
    }
}

/// QaCheck is a QA check.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
#[non_exhaustive]
pub enum QaCheck {
    /// The file is not a valid file of the expected format.
    Format,
    /// The file's dimensions are outside what the recipe asks for.
    Size,
    /// The content credentials are missing or do not verify.
    ContentCredentials,
    /// The content was flagged by moderation.
    Moderation,
    /// A value this SDK version does not know.
    Unknown(String),
}

impl QaCheck {
    /// The wire string.
    pub fn as_str(&self) -> &str {
        match self {
            Self::Format => "format",
            Self::Size => "size",
            Self::ContentCredentials => "content_credentials",
            Self::Moderation => "moderation",
            Self::Unknown(s) => s.as_str(),
        }
    }

    /// Parses a wire string; unknown values are kept.
    pub fn from_wire(s: &str) -> Self {
        match s {
            "format" => Self::Format,
            "size" => Self::Size,
            "content_credentials" => Self::ContentCredentials,
            "moderation" => Self::Moderation,
            other => Self::Unknown(other.to_string()),
        }
    }
}

impl serde::Serialize for QaCheck {
    fn serialize<S: serde::Serializer>(&self, s: S) -> Result<S::Ok, S::Error> {
        s.serialize_str(self.as_str())
    }
}

impl<'de> serde::Deserialize<'de> for QaCheck {
    fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
        let s = <String as serde::Deserialize>::deserialize(d)?;
        Ok(Self::from_wire(&s))
    }
}

impl crate::runtime::QueryValue for QaCheck {
    fn query_value(&self) -> Option<String> {
        Some(self.as_str().to_string())
    }
}

/// QaSeverity is how serious a QA finding is.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
#[non_exhaustive]
pub enum QaSeverity {
    /// The variant fails QA.
    Error,
    /// The variant is still served.
    Warning,
    /// A value this SDK version does not know.
    Unknown(String),
}

impl QaSeverity {
    /// The wire string.
    pub fn as_str(&self) -> &str {
        match self {
            Self::Error => "error",
            Self::Warning => "warning",
            Self::Unknown(s) => s.as_str(),
        }
    }

    /// Parses a wire string; unknown values are kept.
    pub fn from_wire(s: &str) -> Self {
        match s {
            "error" => Self::Error,
            "warning" => Self::Warning,
            other => Self::Unknown(other.to_string()),
        }
    }
}

impl serde::Serialize for QaSeverity {
    fn serialize<S: serde::Serializer>(&self, s: S) -> Result<S::Ok, S::Error> {
        s.serialize_str(self.as_str())
    }
}

impl<'de> serde::Deserialize<'de> for QaSeverity {
    fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
        let s = <String as serde::Deserialize>::deserialize(d)?;
        Ok(Self::from_wire(&s))
    }
}

impl crate::runtime::QueryValue for QaSeverity {
    fn query_value(&self) -> Option<String> {
        Some(self.as_str().to_string())
    }
}

/// QaState is the QA result of a variant.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
#[non_exhaustive]
pub enum QaState {
    /// No findings.
    Passed,
    /// Warnings only; the variant is served.
    Warning,
    /// At least one error.
    Failed,
    /// A value this SDK version does not know.
    Unknown(String),
}

impl QaState {
    /// The wire string.
    pub fn as_str(&self) -> &str {
        match self {
            Self::Passed => "passed",
            Self::Warning => "warning",
            Self::Failed => "failed",
            Self::Unknown(s) => s.as_str(),
        }
    }

    /// Parses a wire string; unknown values are kept.
    pub fn from_wire(s: &str) -> Self {
        match s {
            "passed" => Self::Passed,
            "warning" => Self::Warning,
            "failed" => Self::Failed,
            other => Self::Unknown(other.to_string()),
        }
    }
}

impl serde::Serialize for QaState {
    fn serialize<S: serde::Serializer>(&self, s: S) -> Result<S::Ok, S::Error> {
        s.serialize_str(self.as_str())
    }
}

impl<'de> serde::Deserialize<'de> for QaState {
    fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
        let s = <String as serde::Deserialize>::deserialize(d)?;
        Ok(Self::from_wire(&s))
    }
}

impl crate::runtime::QueryValue for QaState {
    fn query_value(&self) -> Option<String> {
        Some(self.as_str().to_string())
    }
}

/// ReviewState is the human review of a variant.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
#[non_exhaustive]
pub enum ReviewState {
    /// Nobody has reviewed the variant.
    Unreviewed,
    /// A person approved the variant.
    Approved,
    /// A person rejected the variant; its slot is generated again and its URL
    /// keeps serving.
    Rejected,
    /// A person retired the variant; its URL answers 404 and its slot is
    /// generated again.
    Retired,
    /// A value this SDK version does not know.
    Unknown(String),
}

impl ReviewState {
    /// The wire string.
    pub fn as_str(&self) -> &str {
        match self {
            Self::Unreviewed => "unreviewed",
            Self::Approved => "approved",
            Self::Rejected => "rejected",
            Self::Retired => "retired",
            Self::Unknown(s) => s.as_str(),
        }
    }

    /// Parses a wire string; unknown values are kept.
    pub fn from_wire(s: &str) -> Self {
        match s {
            "unreviewed" => Self::Unreviewed,
            "approved" => Self::Approved,
            "rejected" => Self::Rejected,
            "retired" => Self::Retired,
            other => Self::Unknown(other.to_string()),
        }
    }
}

impl serde::Serialize for ReviewState {
    fn serialize<S: serde::Serializer>(&self, s: S) -> Result<S::Ok, S::Error> {
        s.serialize_str(self.as_str())
    }
}

impl<'de> serde::Deserialize<'de> for ReviewState {
    fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
        let s = <String as serde::Deserialize>::deserialize(d)?;
        Ok(Self::from_wire(&s))
    }
}

impl crate::runtime::QueryValue for ReviewState {
    fn query_value(&self) -> Option<String> {
        Some(self.as_str().to_string())
    }
}

impl<T: crate::runtime::Transport> crate::runtime::Client<T> {
    /// Sylphx Generated Assets (`preview`).
    pub fn assets(&self) -> AssetsApi<'_, T> {
        AssetsApi { client: self }
    }
}

/// AssetsService is Sylphx Generated Assets: declare images in code, generate
/// them once, lock them, and serve them from a CDN by content hash. An Asset
/// holds a recipe and its variants; `:generate` makes what is missing, and
/// `:lock` returns the `assets.lock` text a build commits. Generation happens
/// only in these calls, never at build or run time.
///
/// Namespace of Sylphx Generated Assets on the client.
pub struct AssetsApi<'a, T> {
    client: &'a crate::runtime::Client<T>,
}

impl<'a, T: crate::runtime::Transport> AssetsApi<'a, T> {
    /// The `assets` collection.
    pub fn assets(&self) -> AssetsCollection<'a, T> {
        AssetsCollection {
            client: self.client,
        }
    }
}

/// `assets` of Sylphx Generated Assets: Resource type `assets.sylphx.com/Asset`.
pub struct AssetsCollection<'a, T> {
    client: &'a crate::runtime::Client<T>,
}

impl<'a, T: crate::runtime::Transport> AssetsCollection<'a, T> {
    /// Gets an asset.
    ///
    /// `GET /v1/{name=orgs/*/projects/*/envs/*/assets/*}` · permission `assets:read` · effect `read`
    ///
    /// Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`.
    pub async fn get(&self, request: GetAssetRequest) -> Result<Asset, crate::runtime::Error> {
        let path = format!(
            "/v1/{}",
            crate::runtime::path_param(&request.name, "orgs/*/projects/*/envs/*/assets/*", "name")?
        );
        let query = crate::runtime::Query::default();
        let http = crate::runtime::HttpRequest {
            method: "GET",
            path,
            query: query.0,
            body: None,
            mutation: false,
            origin: None,
            effect_ids: false,
        };
        self.client.call(http).await
    }

    /// Lists assets. The filter is limited to `kind`, `state`, and
    /// `review_state`.
    ///
    /// `GET /v1/{parent=orgs/*/projects/*/envs/*}/assets` · permission `assets:read` · effect `read`
    ///
    /// Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `PAGE_TOKEN_MISMATCH`.
    pub async fn list(
        &self,
        request: ListAssetsRequest,
    ) -> Result<ListAssetsResponse, crate::runtime::Error> {
        let path = format!(
            "/v1/{}/assets",
            crate::runtime::path_param(&request.parent, "orgs/*/projects/*/envs/*", "parent")?
        );
        let mut query = crate::runtime::Query::default();
        query.push("page_size", &request.page_size);
        query.push("page_token", &request.page_token);
        query.push("filter", &request.filter);
        let http = crate::runtime::HttpRequest {
            method: "GET",
            path,
            query: query.0,
            body: None,
            mutation: false,
            origin: None,
            effect_ids: false,
        };
        self.client.call(http).await
    }

    /// Every page of [`Self::list`], collected.
    pub async fn list_all(
        &self,
        mut request: ListAssetsRequest,
    ) -> Result<Vec<Asset>, crate::runtime::Error> {
        let mut items = Vec::new();
        loop {
            let page = self.list(request.clone()).await?;
            items.extend(page.assets);
            if page.next_page_token.is_empty() {
                return Ok(items);
            }
            request.page_token = page.next_page_token;
        }
    }

    /// Exports every servable variant in the environment as one flat, paged
    /// manifest, independent of the keys the code declares. Rejected and retired
    /// variants are left out unless `filter` asks for their `review_state`. The
    /// last page carries a digest a client checks to know it holds the whole set.
    ///
    /// `GET /v1/{parent=orgs/*/projects/*/envs/*}/assets:export` · permission `assets:read` · effect `read`
    ///
    /// Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `PAGE_TOKEN_MISMATCH`.
    pub async fn export(
        &self,
        request: ExportAssetsRequest,
    ) -> Result<ExportAssetsResponse, crate::runtime::Error> {
        let path = format!(
            "/v1/{}/assets:export",
            crate::runtime::path_param(&request.parent, "orgs/*/projects/*/envs/*", "parent")?
        );
        let mut query = crate::runtime::Query::default();
        query.push("page_size", &request.page_size);
        query.push("page_token", &request.page_token);
        query.push("filter", &request.filter);
        let http = crate::runtime::HttpRequest {
            method: "GET",
            path,
            query: query.0,
            body: None,
            mutation: false,
            origin: None,
            effect_ids: false,
        };
        self.client.call(http).await
    }

    /// Records the recipes as assets and generates the variants that are
    /// missing. Each call is idempotent and works within a bounded time; call
    /// again until `pending` is 0.
    ///
    /// `POST /v1/{parent=orgs/*/projects/*/envs/*}/assets:generate` · permission `assets:write` · effect `write`
    ///
    /// Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `INVALID_FIELD`, `RATE_LIMITED`, `SPEND_LIMIT_REACHED`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
    pub async fn generate(
        &self,
        request: GenerateAssetsRequest,
    ) -> Result<GenerateAssetsResponse, crate::runtime::Error> {
        let path = format!(
            "/v1/{}/assets:generate",
            crate::runtime::path_param(&request.parent, "orgs/*/projects/*/envs/*", "parent")?
        );
        let query = crate::runtime::Query::default();
        let http = crate::runtime::HttpRequest {
            method: "POST",
            path,
            query: query.0,
            body: Some(crate::runtime::body_without(&request, &["parent"])?),
            mutation: true,
            origin: None,
            effect_ids: false,
        };
        self.client.call(http).await
    }

    /// Returns the `assets.lock` entries and canonical text for the keys the call
    /// names, and only those. A read with a request body, like a query.
    ///
    /// `POST /v1/{parent=orgs/*/projects/*/envs/*}/assets:lock` · permission `assets:read` · effect `read`
    ///
    /// Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`.
    pub async fn lock(
        &self,
        request: LockAssetsRequest,
    ) -> Result<LockAssetsResponse, crate::runtime::Error> {
        let path = format!(
            "/v1/{}/assets:lock",
            crate::runtime::path_param(&request.parent, "orgs/*/projects/*/envs/*", "parent")?
        );
        let query = crate::runtime::Query::default();
        let http = crate::runtime::HttpRequest {
            method: "POST",
            path,
            query: query.0,
            body: Some(crate::runtime::body_without(&request, &["parent"])?),
            mutation: true,
            origin: None,
            effect_ids: false,
        };
        self.client.call(http).await
    }

    /// Approves one variant and records who approved it.
    ///
    /// `POST /v1/{name=orgs/*/projects/*/envs/*/assets/*}:approveVariant` · permission `assets:write` · effect `write`
    ///
    /// Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `INVALID_FIELD`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
    pub async fn approve_variant(
        &self,
        request: ApproveVariantRequest,
    ) -> Result<Asset, crate::runtime::Error> {
        let path = format!(
            "/v1/{}:approveVariant",
            crate::runtime::path_param(&request.name, "orgs/*/projects/*/envs/*/assets/*", "name")?
        );
        let query = crate::runtime::Query::default();
        let http = crate::runtime::HttpRequest {
            method: "POST",
            path,
            query: query.0,
            body: Some(crate::runtime::body_without(&request, &["name"])?),
            mutation: true,
            origin: None,
            effect_ids: false,
        };
        self.client.call(http).await
    }

    /// Rejects one variant. Its slot is freed and the next `:generate` fills it;
    /// the rejected file keeps serving at its URL.
    ///
    /// `POST /v1/{name=orgs/*/projects/*/envs/*/assets/*}:rejectVariant` · permission `assets:write` · effect `write`
    ///
    /// Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `INVALID_FIELD`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
    pub async fn reject_variant(
        &self,
        request: RejectVariantRequest,
    ) -> Result<Asset, crate::runtime::Error> {
        let path = format!(
            "/v1/{}:rejectVariant",
            crate::runtime::path_param(&request.name, "orgs/*/projects/*/envs/*/assets/*", "name")?
        );
        let query = crate::runtime::Query::default();
        let http = crate::runtime::HttpRequest {
            method: "POST",
            path,
            query: query.0,
            body: Some(crate::runtime::body_without(&request, &["name"])?),
            mutation: true,
            origin: None,
            effect_ids: false,
        };
        self.client.call(http).await
    }

    /// Retires one variant. Its URL answers 404 from then on and its slot is
    /// freed.
    ///
    /// `POST /v1/{name=orgs/*/projects/*/envs/*/assets/*}:retireVariant` · permission `assets:write` · effect `destructive`
    ///
    /// Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `INVALID_FIELD`, `INVALID_STATE`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
    pub async fn retire_variant(
        &self,
        request: RetireVariantRequest,
    ) -> Result<Asset, crate::runtime::Error> {
        let path = format!(
            "/v1/{}:retireVariant",
            crate::runtime::path_param(&request.name, "orgs/*/projects/*/envs/*/assets/*", "name")?
        );
        let query = crate::runtime::Query::default();
        let http = crate::runtime::HttpRequest {
            method: "POST",
            path,
            query: query.0,
            body: Some(crate::runtime::body_without(&request, &["name"])?),
            mutation: true,
            origin: None,
            effect_ids: false,
        };
        self.client.call(http).await
    }
}