vrm-spec 0.1.0

VRM data structures
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
//! Data structures for the [`VRM`](https://github.com/vrm-c/vrm-specification/tree/master/specification/0.0) 0.0 glTF Extension.

/// VRM extension name
pub const VRM: &str = "VRM";

#[cfg(feature = "rustc_hash")]
use rustc_hash::FxHashMap as HashMap;
use serde::{Deserialize, Serialize};
#[cfg(not(feature = "rustc_hash"))]
use std::collections::HashMap;

use crate::serde_utils::{
    deserialize_option_index, deserialize_option_map_and_skip_nullable,
    deserialize_option_map_index,
};

/// VRM extension is for 3d humanoid avatars (and models) in VR applications.
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct VRM0Schema {
    #[serde(skip_serializing_if = "Option::is_none")]
    pub blend_shape_master: Option<VRMBlendShape>,

    /// Version of exporter that vrm created. UniVRM-0.46
    #[serde(skip_serializing_if = "Option::is_none")]
    pub exporter_version: Option<String>,

    #[serde(skip_serializing_if = "Option::is_none")]
    pub first_person: Option<VRMFirstPerson>,

    #[serde(skip_serializing_if = "Option::is_none")]
    pub humanoid: Option<VRMHumanoid>,

    #[serde(skip_serializing_if = "Option::is_none")]
    pub material_properties: Option<Vec<VRMMaterial>>,

    #[serde(skip_serializing_if = "Option::is_none")]
    pub meta: Option<VRMMeta>,

    #[serde(skip_serializing_if = "Option::is_none")]
    pub secondary_animation: Option<VRMSecondaryAnimation>,

    /// Version of VRM specification. 0.0
    #[serde(skip_serializing_if = "Option::is_none")]
    pub spec_version: Option<String>,
}

/// BlendShapeAvatar of UniVRM
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct VRMBlendShape {
    #[serde(skip_serializing_if = "Option::is_none")]
    pub blend_shape_groups: Option<Vec<VRMBlendShapeGroup>>,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct VRMBlendShapeGroup {
    /// Low level blendshape references.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub binds: Option<Vec<VRMBlendShapeBind>>,

    /// 0 or 1. Do not allow an intermediate value. Value should rounded
    #[serde(skip_serializing_if = "Option::is_none")]
    pub is_binary: Option<bool>,

    /// Material animation references.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub material_values: Option<Vec<VRMBlendShapeMaterialBind>>,

    /// Expression name
    #[serde(skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,

    /// Predefined Expression name
    #[serde(skip_serializing_if = "Option::is_none")]
    pub preset_name: Option<PresetName>,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct VRMBlendShapeBind {
    #[serde(skip_serializing_if = "Option::is_none")]
    pub index: Option<i64>,

    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        deserialize_with = "deserialize_option_index::<_, gltf::json::Mesh>"
    )]
    #[cfg(feature = "gltf_index")]
    pub mesh: Option<gltf::json::Index<gltf::json::Mesh>>,
    #[cfg(not(feature = "gltf_index"))]
    pub mesh: Option<i64>,

    /// SkinnedMeshRenderer.SetBlendShapeWeight
    #[serde(skip_serializing_if = "Option::is_none")]
    pub weight: Option<f64>,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct VRMBlendShapeMaterialBind {
    #[serde(skip_serializing_if = "Option::is_none")]
    pub material_name: Option<String>,

    #[serde(skip_serializing_if = "Option::is_none")]
    pub property_name: Option<String>,

    #[serde(skip_serializing_if = "Option::is_none")]
    pub target_value: Option<Vec<f64>>,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct VRMFirstPerson {
    /// The bone whose rendering should be turned off in first-person view. Usually Head is
    /// specified.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        deserialize_with = "deserialize_option_index::<_, gltf::json::Node>"
    )]
    #[cfg(feature = "gltf_index")]
    pub first_person_bone: Option<gltf::json::Index<gltf::json::Node>>,
    #[cfg(not(feature = "gltf_index"))]
    pub first_person_bone: Option<i64>,

    /// The target position of the VR headset in first-person view. It is assumed that an offset
    /// from the head bone to the VR headset is added.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub first_person_bone_offset: Option<FirstPersonBoneOffset>,

    #[serde(skip_serializing_if = "Option::is_none")]
    pub look_at_horizontal_inner: Option<VRMFirstPersonDegreeMap>,

    #[serde(skip_serializing_if = "Option::is_none")]
    pub look_at_horizontal_outer: Option<VRMFirstPersonDegreeMap>,

    /// Eye controller mode.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub look_at_type_name: Option<LookAtTypeName>,

    #[serde(skip_serializing_if = "Option::is_none")]
    pub look_at_vertical_down: Option<VRMFirstPersonDegreeMap>,

    #[serde(skip_serializing_if = "Option::is_none")]
    pub look_at_vertical_up: Option<VRMFirstPersonDegreeMap>,

    /// Switch display / undisplay for each mesh in first-person view or the others.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub mesh_annotations: Option<Vec<VRMFirstPersonMeshAnnotation>>,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
/// Vector3 but has optional x,y,z.
///
/// normally x,y,z should not be optional but the VRM 0.0 spec allows it
pub struct OptionalVector3 {
    #[serde(skip_serializing_if = "Option::is_none")]
    pub x: Option<f64>,

    #[serde(skip_serializing_if = "Option::is_none")]
    pub y: Option<f64>,

    #[serde(skip_serializing_if = "Option::is_none")]
    pub z: Option<f64>,
}

/// The target position of the VR headset in first-person view. It is assumed that an offset
/// from the head bone to the VR headset is added.
pub type FirstPersonBoneOffset = OptionalVector3;

/// Eye controller setting.
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct VRMFirstPersonDegreeMap {
    /// None linear mapping params. time, value, inTangent, outTangent
    #[serde(skip_serializing_if = "Option::is_none")]
    pub curve: Option<Vec<f64>>,

    /// Look at input clamp range degree.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub x_range: Option<f64>,

    /// Look at map range degree from xRange.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub y_range: Option<f64>,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct VRMFirstPersonMeshAnnotation {
    #[serde(skip_serializing_if = "Option::is_none")]
    pub first_person_flag: Option<String>,

    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        deserialize_with = "deserialize_option_index::<_, gltf::json::Mesh>"
    )]
    #[cfg(feature = "gltf_index")]
    pub mesh: Option<gltf::json::Index<gltf::json::Mesh>>,
    #[cfg(not(feature = "gltf_index"))]
    pub mesh: Option<i64>,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct VRMHumanoid {
    /// Unity's HumanDescription.armStretch
    #[serde(skip_serializing_if = "Option::is_none")]
    pub arm_stretch: Option<f64>,

    /// Unity's HumanDescription.feetSpacing
    #[serde(skip_serializing_if = "Option::is_none")]
    pub feet_spacing: Option<f64>,

    /// Unity's HumanDescription.hasTranslationDoF
    #[serde(skip_serializing_if = "Option::is_none")]
    pub has_translation_do_f: Option<bool>,

    #[serde(skip_serializing_if = "Option::is_none")]
    pub human_bones: Option<Vec<VRMHumanoidBone>>,

    /// Unity's HumanDescription.legStretch
    #[serde(skip_serializing_if = "Option::is_none")]
    pub leg_stretch: Option<f64>,

    /// Unity's HumanDescription.lowerArmTwist
    #[serde(skip_serializing_if = "Option::is_none")]
    pub lower_arm_twist: Option<f64>,

    /// Unity's HumanDescription.lowerLegTwist
    #[serde(skip_serializing_if = "Option::is_none")]
    pub lower_leg_twist: Option<f64>,

    /// Unity's HumanDescription.upperArmTwist
    #[serde(skip_serializing_if = "Option::is_none")]
    pub upper_arm_twist: Option<f64>,

    /// Unity's HumanDescription.upperLegTwist
    #[serde(skip_serializing_if = "Option::is_none")]
    pub upper_leg_twist: Option<f64>,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct VRMHumanoidBone {
    /// Unity's HumanLimit.axisLength
    #[serde(skip_serializing_if = "Option::is_none")]
    pub axis_length: Option<f64>,

    /// Human bone name.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub bone: Option<Bone>,

    /// Unity's HumanLimit.center
    #[serde(skip_serializing_if = "Option::is_none")]
    pub center: Option<Center>,

    /// Unity's HumanLimit.max
    #[serde(skip_serializing_if = "Option::is_none")]
    pub max: Option<Max>,

    /// Unity's HumanLimit.min
    #[serde(skip_serializing_if = "Option::is_none")]
    pub min: Option<Min>,

    /// Reference node index
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        deserialize_with = "deserialize_option_index::<_, gltf::json::Node>"
    )]
    #[cfg(feature = "gltf_index")]
    pub node: Option<gltf::json::Index<gltf::json::Node>>,
    #[cfg(not(feature = "gltf_index"))]
    pub node: Option<i64>,

    /// Unity's HumanLimit.useDefaultValues
    #[serde(skip_serializing_if = "Option::is_none")]
    pub use_default_values: Option<bool>,
}

/// Unity's HumanLimit.center
pub type Center = OptionalVector3;

/// Unity's HumanLimit.max
pub type Max = OptionalVector3;

/// Unity's HumanLimit.min
pub type Min = OptionalVector3;

#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct VRMMaterial {
    #[serde(
        skip_serializing_if = "Option::is_none",
        deserialize_with = "deserialize_option_map_and_skip_nullable::<_, String, f64>"
    )]
    pub float_properties: Option<HashMap<String, f64>>,

    #[serde(skip_serializing_if = "Option::is_none")]
    pub keyword_map: Option<HashMap<String, bool>>,

    #[serde(skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,

    #[serde(skip_serializing_if = "Option::is_none")]
    pub render_queue: Option<i64>,

    /// This contains shader name.  VRM/MToon, VRM/UnlitTransparentZWrite, and VRM_USE_GLTFSHADER
    /// (and legacy materials as Standard, UniGLTF/UniUnlit, VRM/UnlitTexture, VRM/UnlitCutout,
    /// VRM/UnlitTransparent) . If VRM_USE_GLTFSHADER is specified, use same index of gltf's
    /// material settings
    #[serde(skip_serializing_if = "Option::is_none")]
    pub shader: Option<String>,

    #[serde(skip_serializing_if = "Option::is_none")]
    pub tag_map: Option<HashMap<String, String>>,

    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        deserialize_with = "deserialize_option_map_index::<_, gltf::json::Texture>"
    )]
    #[cfg(feature = "gltf_index")]
    pub texture_properties: Option<HashMap<String, gltf::json::Index<gltf::json::Texture>>>,
    #[cfg(not(feature = "gltf_index"))]
    pub texture_properties: Option<HashMap<String, usize>>,

    #[serde(skip_serializing_if = "Option::is_none")]
    pub vector_properties: Option<HashMap<String, Vec<f64>>>,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct VRMMeta {
    /// A person who can perform with this avatar
    #[serde(skip_serializing_if = "Option::is_none")]
    pub allowed_user_name: Option<AllowedUserName>,

    /// Author of VRM model
    #[serde(skip_serializing_if = "Option::is_none")]
    pub author: Option<String>,

    /// For commercial use
    #[serde(skip_serializing_if = "Option::is_none")]
    pub commercial_ussage_name: Option<UssageName>,

    /// Contact Information of VRM model author
    #[serde(skip_serializing_if = "Option::is_none")]
    pub contact_information: Option<String>,

    /// License type
    #[serde(skip_serializing_if = "Option::is_none")]
    pub license_name: Option<LicenseName>,

    /// If “Other” is selected, put the URL link of the license document here.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub other_license_url: Option<String>,

    /// If there are any conditions not mentioned above, put the URL link of the license document
    /// here.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub other_permission_url: Option<String>,

    /// Reference of VRM model
    #[serde(skip_serializing_if = "Option::is_none")]
    pub reference: Option<String>,

    /// Permission to perform sexual acts with this avatar
    #[serde(skip_serializing_if = "Option::is_none")]
    pub sexual_ussage_name: Option<UssageName>,

    /// Thumbnail of VRM model
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        deserialize_with = "deserialize_option_index::<_, gltf::json::Texture>"
    )]
    #[cfg(feature = "gltf_index")]
    pub texture: Option<gltf::json::Index<gltf::json::Texture>>,
    #[cfg(not(feature = "gltf_index"))]
    pub texture: Option<i64>,

    /// Title of VRM model
    #[serde(skip_serializing_if = "Option::is_none")]
    pub title: Option<String>,

    /// Version of VRM model
    #[serde(skip_serializing_if = "Option::is_none")]
    pub version: Option<String>,

    /// Permission to perform violent acts with this avatar
    #[serde(skip_serializing_if = "Option::is_none")]
    pub violent_ussage_name: Option<UssageName>,
}

/// The setting of automatic animation of string-like objects such as tails and hairs.
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct VRMSecondaryAnimation {
    #[serde(skip_serializing_if = "Option::is_none")]
    pub bone_groups: Option<Vec<VRMSecondaryAnimationSpring>>,

    #[serde(skip_serializing_if = "Option::is_none")]
    pub collider_groups: Option<Vec<VRMSecondaryAnimationColliderGroup>>,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct VRMSecondaryAnimationSpring {
    /// Specify the node index of the root bone of the swaying object.
    #[serde(skip_serializing_if = "Option::is_none")]
    #[cfg(feature = "gltf_index")]
    pub bones: Option<Vec<gltf::json::Index<gltf::json::Node>>>,
    #[cfg(not(feature = "gltf_index"))]
    pub bones: Option<Vec<i64>>,

    /// The reference point of a swaying object can be set at any location except the origin.
    /// When implementing UI moving with warp, the parent node to move with warp can be specified
    /// if you don't want to make the object swaying with warp movement.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        deserialize_with = "deserialize_option_index::<_, gltf::json::Node>"
    )]
    #[cfg(feature = "gltf_index")]
    pub center: Option<gltf::json::Index<gltf::json::Node>>,
    #[cfg(not(feature = "gltf_index"))]
    pub center: Option<i64>,

    /// Specify the index of the collider group for collisions with swaying objects.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub collider_groups: Option<Vec<i64>>,

    /// Annotation comment
    #[serde(skip_serializing_if = "Option::is_none")]
    pub comment: Option<String>,

    /// The resistance (deceleration) of automatic animation.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub drag_force: Option<f64>,

    /// The direction of gravity. Set (0, -1, 0) for simulating the gravity. Set (1, 0, 0) for
    /// simulating the wind.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub gravity_dir: Option<GravityDir>,

    /// The strength of gravity.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub gravity_power: Option<f64>,

    /// The radius of the sphere used for the collision detection with colliders.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub hit_radius: Option<f64>,

    /// The resilience of the swaying object (the power of returning to the initial pose).
    #[serde(skip_serializing_if = "Option::is_none")]
    pub stiffiness: Option<f64>,
}

/// The direction of gravity. Set (0, -1, 0) for simulating the gravity. Set (1, 0, 0) for
/// simulating the wind.
pub type GravityDir = OptionalVector3;

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct VRMSecondaryAnimationColliderGroup {
    #[serde(skip_serializing_if = "Option::is_none")]
    pub colliders: Option<Vec<Collider>>,

    /// The node of the collider group for setting up collision detections.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        deserialize_with = "deserialize_option_index::<_, gltf::json::Node>"
    )]
    pub node: Option<gltf::json::Index<gltf::json::Node>>,
    #[cfg(not(feature = "gltf_index"))]
    pub node: Option<i64>,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Collider {
    /// The local coordinate from the node of the collider group in *left-handed* Y-up coordinate.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub offset: Option<Offset>,

    /// The radius of the collider.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub radius: Option<f64>,
}

/// The local coordinate from the node of the collider group in *left-handed* Y-up coordinate.
pub type Offset = OptionalVector3;

/// Predefined Expression name.
#[derive(Debug, Clone, Copy, Hash, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")]
pub enum PresetName {
    A,
    Angry,
    Blink,
    BlinkL,
    BlinkR,
    E,
    Fun,
    I,
    Joy,
    Lookdown,
    Lookleft,
    Lookright,
    Lookup,
    Neutral,
    O,
    Sorrow,
    U,
    Unknown,
}

/// Eye controller mode.
#[derive(Debug, Clone, Copy, Hash, Serialize, Deserialize)]
pub enum LookAtTypeName {
    BlendShape,
    Bone,
}

/// Human bone name.
#[derive(Debug, Clone, Copy, Hash, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub enum Bone {
    Chest,
    Head,
    Hips,
    Jaw,
    LeftEye,
    LeftFoot,
    LeftHand,
    LeftIndexDistal,
    LeftIndexIntermediate,
    LeftIndexProximal,
    LeftLittleDistal,
    LeftLittleIntermediate,
    LeftLittleProximal,
    LeftLowerArm,
    LeftLowerLeg,
    LeftMiddleDistal,
    LeftMiddleIntermediate,
    LeftMiddleProximal,
    LeftRingDistal,
    LeftRingIntermediate,
    LeftRingProximal,
    LeftShoulder,
    LeftThumbDistal,
    LeftThumbIntermediate,
    LeftThumbProximal,
    LeftToes,
    LeftUpperArm,
    LeftUpperLeg,
    Neck,
    RightEye,
    RightFoot,
    RightHand,
    RightIndexDistal,
    RightIndexIntermediate,
    RightIndexProximal,
    RightLittleDistal,
    RightLittleIntermediate,
    RightLittleProximal,
    RightLowerArm,
    RightLowerLeg,
    RightMiddleDistal,
    RightMiddleIntermediate,
    RightMiddleProximal,
    RightRingDistal,
    RightRingIntermediate,
    RightRingProximal,
    RightShoulder,
    RightThumbDistal,
    RightThumbIntermediate,
    RightThumbProximal,
    RightToes,
    RightUpperArm,
    RightUpperLeg,
    Spine,
    UpperChest,
}

/// A person who can perform with this avatar.
#[derive(Debug, Clone, Copy, Hash, Serialize, Deserialize)]
pub enum AllowedUserName {
    Everyone,
    ExplicitlyLicensedPerson,
    OnlyAuthor,
}

/// Usage Permission.
///
/// NOTE: the typo is intended following the spec.
#[derive(Debug, Clone, Copy, Hash, Serialize, Deserialize)]
pub enum UssageName {
    Allow,
    Disallow,
}

/// License type.
#[derive(Debug, Clone, Copy, Hash, Serialize, Deserialize)]
pub enum LicenseName {
    #[serde(rename = "CC0")]
    Cc0,

    #[serde(rename = "CC_BY")]
    CcBy,

    #[serde(rename = "CC_BY_NC")]
    CcByNc,

    #[serde(rename = "CC_BY_NC_ND")]
    CcByNcNd,

    #[serde(rename = "CC_BY_NC_SA")]
    CcByNcSa,

    #[serde(rename = "CC_BY_ND")]
    CcByNd,

    #[serde(rename = "CC_BY_SA")]
    CcBySa,

    #[serde(rename = "Redistribution_Prohibited")]
    RedistributionProhibited,

    Other,
}