Skip to main content

akeyless_api/models/
policy_create_keys.rs

1/*
2 * Akeyless API
3 *
4 * The purpose of this application is to provide access to Akeyless API.
5 *
6 * The version of the OpenAPI document: 3.0
7 * Contact: support@akeyless.io
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct PolicyCreateKeys {
16    /// Specify allowed key algorithms (e.g., [RSA2048,AES128GCM])
17    #[serde(rename = "allowed-algorithms", skip_serializing_if = "Option::is_none")]
18    pub allowed_algorithms: Option<Vec<String>>,
19    /// Specify allowed protection key names. To enforce using the account's default protection key, use 'default-account-key'
20    #[serde(rename = "allowed-key-names", skip_serializing_if = "Option::is_none")]
21    pub allowed_key_names: Option<Vec<String>>,
22    /// Specify allowed key protection types (dfc, classic-key)
23    #[serde(rename = "allowed-key-types", skip_serializing_if = "Option::is_none")]
24    pub allowed_key_types: Option<Vec<String>>,
25    /// Set output format to JSON
26    #[serde(rename = "json", skip_serializing_if = "Option::is_none")]
27    pub json: Option<bool>,
28    /// Set the maximum rotation interval for automatic key rotation.
29    #[serde(rename = "max-rotation-interval-days", skip_serializing_if = "Option::is_none")]
30    pub max_rotation_interval_days: Option<i32>,
31    /// The object types this policy will apply to (items, targets). If not provided, defaults to [items, targets].
32    #[serde(rename = "object-types", skip_serializing_if = "Option::is_none")]
33    pub object_types: Option<Vec<String>>,
34    /// The path the policy refers to
35    #[serde(rename = "path")]
36    pub path: String,
37    /// Authentication token (see `/auth` and `/configure`)
38    #[serde(rename = "token", skip_serializing_if = "Option::is_none")]
39    pub token: Option<String>,
40    /// The universal identity token, Required only for universal_identity authentication
41    #[serde(rename = "uid-token", skip_serializing_if = "Option::is_none")]
42    pub uid_token: Option<String>,
43}
44
45impl PolicyCreateKeys {
46    pub fn new(path: String) -> PolicyCreateKeys {
47        PolicyCreateKeys {
48            allowed_algorithms: None,
49            allowed_key_names: None,
50            allowed_key_types: None,
51            json: None,
52            max_rotation_interval_days: None,
53            object_types: None,
54            path,
55            token: None,
56            uid_token: None,
57        }
58    }
59}
60