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
/*
* Antimatter Public API
*
* Interact with the Antimatter Cloud API
*
* The version of the OpenAPI document: 2.0.13
* Contact: support@antimatter.io
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
/// CapabilityDefinition : A capability is attached to authenticated domain identities by an identity provider, and confers additional permissions upon the identity. This is done by writing domain policy rules that reference the capability.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct CapabilityDefinition {
/// An identifier for a capability that might be imported from a peer domain. If it is, it will bear an imported resource prefix (either a domain identifier or an alias, followed by ::)
#[serde(rename = "name")]
pub name: String,
/// a unary capability does not have a value
#[serde(rename = "unary")]
pub unary: bool,
/// A short, single sentence description of this capability
#[serde(rename = "summary")]
pub summary: String,
/// A longer form description of this capability
#[serde(rename = "description")]
pub description: String,
/// Is this capability imported from a peer domain. Imported capabilities cannot be assigned to users, but can be referenced from domain policy rules
#[serde(rename = "imported")]
pub imported: bool,
/// A globally unique identifier for a domain
#[serde(rename = "sourceDomainID", skip_serializing_if = "Option::is_none")]
pub source_domain_id: Option<String>,
#[serde(rename = "sourceDomainName", skip_serializing_if = "Option::is_none")]
pub source_domain_name: Option<String>,
}
impl CapabilityDefinition {
/// A capability is attached to authenticated domain identities by an identity provider, and confers additional permissions upon the identity. This is done by writing domain policy rules that reference the capability.
pub fn new(name: String, unary: bool, summary: String, description: String, imported: bool) -> CapabilityDefinition {
CapabilityDefinition {
name,
unary,
summary,
description,
imported,
source_domain_id: None,
source_domain_name: None,
}
}
}