azure_svc_keyvault/package_7_5/
models.rs

1#![allow(non_camel_case_types)]
2#![allow(unused_imports)]
3use serde::de::{value, Deserializer, IntoDeserializer};
4use serde::{Deserialize, Serialize, Serializer};
5use std::str::FromStr;
6#[doc = "The action that will be executed."]
7#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
8pub struct Action {
9    #[doc = "The type of the action."]
10    #[serde(default, skip_serializing_if = "Option::is_none")]
11    pub action_type: Option<action::ActionType>,
12}
13impl Action {
14    pub fn new() -> Self {
15        Self::default()
16    }
17}
18pub mod action {
19    use super::*;
20    #[doc = "The type of the action."]
21    #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
22    pub enum ActionType {
23        EmailContacts,
24        AutoRenew,
25    }
26}
27#[doc = "Details of the organization administrator of the certificate issuer."]
28#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
29pub struct AdministratorDetails {
30    #[doc = "First name."]
31    #[serde(default, skip_serializing_if = "Option::is_none")]
32    pub first_name: Option<String>,
33    #[doc = "Last name."]
34    #[serde(default, skip_serializing_if = "Option::is_none")]
35    pub last_name: Option<String>,
36    #[doc = "Email address."]
37    #[serde(default, skip_serializing_if = "Option::is_none")]
38    pub email: Option<String>,
39    #[doc = "Phone number."]
40    #[serde(default, skip_serializing_if = "Option::is_none")]
41    pub phone: Option<String>,
42}
43impl AdministratorDetails {
44    pub fn new() -> Self {
45        Self::default()
46    }
47}
48#[doc = "The object attributes managed by the KeyVault service."]
49#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
50pub struct Attributes {
51    #[doc = "Determines whether the object is enabled."]
52    #[serde(default, skip_serializing_if = "Option::is_none")]
53    pub enabled: Option<bool>,
54    #[doc = "Not before date in UTC."]
55    #[serde(default, skip_serializing_if = "Option::is_none")]
56    pub nbf: Option<i64>,
57    #[doc = "Expiry date in UTC."]
58    #[serde(default, skip_serializing_if = "Option::is_none")]
59    pub exp: Option<i64>,
60    #[doc = "Creation time in UTC."]
61    #[serde(default, skip_serializing_if = "Option::is_none")]
62    pub created: Option<i64>,
63    #[doc = "Last updated time in UTC."]
64    #[serde(default, skip_serializing_if = "Option::is_none")]
65    pub updated: Option<i64>,
66}
67impl Attributes {
68    pub fn new() -> Self {
69        Self::default()
70    }
71}
72#[doc = "The backup certificate result, containing the backup blob."]
73#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
74pub struct BackupCertificateResult {
75    #[doc = "The backup blob containing the backed up certificate."]
76    #[serde(default, skip_serializing_if = "Option::is_none")]
77    pub value: Option<String>,
78}
79impl BackupCertificateResult {
80    pub fn new() -> Self {
81        Self::default()
82    }
83}
84#[doc = "The backup key result, containing the backup blob."]
85#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
86pub struct BackupKeyResult {
87    #[doc = "The backup blob containing the backed up key."]
88    #[serde(default, skip_serializing_if = "Option::is_none")]
89    pub value: Option<String>,
90}
91impl BackupKeyResult {
92    pub fn new() -> Self {
93        Self::default()
94    }
95}
96#[doc = "The backup secret result, containing the backup blob."]
97#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
98pub struct BackupSecretResult {
99    #[doc = "The backup blob containing the backed up secret."]
100    #[serde(default, skip_serializing_if = "Option::is_none")]
101    pub value: Option<String>,
102}
103impl BackupSecretResult {
104    pub fn new() -> Self {
105        Self::default()
106    }
107}
108#[doc = "The backup storage result, containing the backup blob."]
109#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
110pub struct BackupStorageResult {
111    #[doc = "The backup blob containing the backed up storage account."]
112    #[serde(default, skip_serializing_if = "Option::is_none")]
113    pub value: Option<String>,
114}
115impl BackupStorageResult {
116    pub fn new() -> Self {
117        Self::default()
118    }
119}
120#[doc = "The certificate management attributes."]
121#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
122pub struct CertificateAttributes {
123    #[serde(flatten)]
124    pub attributes: Attributes,
125    #[doc = "softDelete data retention days. Value should be >=7 and <=90 when softDelete enabled, otherwise 0."]
126    #[serde(rename = "recoverableDays", default, skip_serializing_if = "Option::is_none")]
127    pub recoverable_days: Option<i32>,
128    #[doc = "Reflects the deletion recovery level currently in effect for certificates in the current vault. If it contains 'Purgeable', the certificate can be permanently deleted by a privileged user; otherwise, only the system can purge the certificate, at the end of the retention interval."]
129    #[serde(rename = "recoveryLevel", default, skip_serializing_if = "Option::is_none")]
130    pub recovery_level: Option<certificate_attributes::RecoveryLevel>,
131}
132impl CertificateAttributes {
133    pub fn new() -> Self {
134        Self::default()
135    }
136}
137pub mod certificate_attributes {
138    use super::*;
139    #[doc = "Reflects the deletion recovery level currently in effect for certificates in the current vault. If it contains 'Purgeable', the certificate can be permanently deleted by a privileged user; otherwise, only the system can purge the certificate, at the end of the retention interval."]
140    #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
141    #[serde(remote = "RecoveryLevel")]
142    pub enum RecoveryLevel {
143        Purgeable,
144        #[serde(rename = "Recoverable+Purgeable")]
145        RecoverablePurgeable,
146        Recoverable,
147        #[serde(rename = "Recoverable+ProtectedSubscription")]
148        RecoverableProtectedSubscription,
149        #[serde(rename = "CustomizedRecoverable+Purgeable")]
150        CustomizedRecoverablePurgeable,
151        CustomizedRecoverable,
152        #[serde(rename = "CustomizedRecoverable+ProtectedSubscription")]
153        CustomizedRecoverableProtectedSubscription,
154        #[serde(skip_deserializing)]
155        UnknownValue(String),
156    }
157    impl FromStr for RecoveryLevel {
158        type Err = value::Error;
159        fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
160            Self::deserialize(s.into_deserializer())
161        }
162    }
163    impl<'de> Deserialize<'de> for RecoveryLevel {
164        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
165        where
166            D: Deserializer<'de>,
167        {
168            let s = String::deserialize(deserializer)?;
169            let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s));
170            Ok(deserialized)
171        }
172    }
173    impl Serialize for RecoveryLevel {
174        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
175        where
176            S: Serializer,
177        {
178            match self {
179                Self::Purgeable => serializer.serialize_unit_variant("RecoveryLevel", 0u32, "Purgeable"),
180                Self::RecoverablePurgeable => serializer.serialize_unit_variant("RecoveryLevel", 1u32, "Recoverable+Purgeable"),
181                Self::Recoverable => serializer.serialize_unit_variant("RecoveryLevel", 2u32, "Recoverable"),
182                Self::RecoverableProtectedSubscription => {
183                    serializer.serialize_unit_variant("RecoveryLevel", 3u32, "Recoverable+ProtectedSubscription")
184                }
185                Self::CustomizedRecoverablePurgeable => {
186                    serializer.serialize_unit_variant("RecoveryLevel", 4u32, "CustomizedRecoverable+Purgeable")
187                }
188                Self::CustomizedRecoverable => serializer.serialize_unit_variant("RecoveryLevel", 5u32, "CustomizedRecoverable"),
189                Self::CustomizedRecoverableProtectedSubscription => {
190                    serializer.serialize_unit_variant("RecoveryLevel", 6u32, "CustomizedRecoverable+ProtectedSubscription")
191                }
192                Self::UnknownValue(s) => serializer.serialize_str(s.as_str()),
193            }
194        }
195    }
196}
197#[doc = "A certificate bundle consists of a certificate (X509) plus its attributes."]
198#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
199pub struct CertificateBundle {
200    #[doc = "The certificate id."]
201    #[serde(default, skip_serializing_if = "Option::is_none")]
202    pub id: Option<String>,
203    #[doc = "The key id."]
204    #[serde(default, skip_serializing_if = "Option::is_none")]
205    pub kid: Option<String>,
206    #[doc = "The secret id."]
207    #[serde(default, skip_serializing_if = "Option::is_none")]
208    pub sid: Option<String>,
209    #[doc = "Thumbprint of the certificate."]
210    #[serde(default, skip_serializing_if = "Option::is_none")]
211    pub x5t: Option<String>,
212    #[doc = "Management policy for a certificate."]
213    #[serde(default, skip_serializing_if = "Option::is_none")]
214    pub policy: Option<CertificatePolicy>,
215    #[doc = "CER contents of x509 certificate."]
216    #[serde(default, skip_serializing_if = "Option::is_none")]
217    pub cer: Option<String>,
218    #[doc = "The content type of the secret. eg. 'application/x-pem-file' or 'application/x-pkcs12', "]
219    #[serde(rename = "contentType", default, skip_serializing_if = "Option::is_none")]
220    pub content_type: Option<String>,
221    #[doc = "The certificate management attributes."]
222    #[serde(default, skip_serializing_if = "Option::is_none")]
223    pub attributes: Option<CertificateAttributes>,
224    #[doc = "Application specific metadata in the form of key-value pairs"]
225    #[serde(default, skip_serializing_if = "Option::is_none")]
226    pub tags: Option<serde_json::Value>,
227}
228impl CertificateBundle {
229    pub fn new() -> Self {
230        Self::default()
231    }
232}
233#[doc = "The certificate create parameters."]
234#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
235pub struct CertificateCreateParameters {
236    #[doc = "Management policy for a certificate."]
237    #[serde(default, skip_serializing_if = "Option::is_none")]
238    pub policy: Option<CertificatePolicy>,
239    #[doc = "The certificate management attributes."]
240    #[serde(default, skip_serializing_if = "Option::is_none")]
241    pub attributes: Option<CertificateAttributes>,
242    #[doc = "Application specific metadata in the form of key-value pairs."]
243    #[serde(default, skip_serializing_if = "Option::is_none")]
244    pub tags: Option<serde_json::Value>,
245}
246impl CertificateCreateParameters {
247    pub fn new() -> Self {
248        Self::default()
249    }
250}
251#[doc = "The certificate import parameters."]
252#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
253pub struct CertificateImportParameters {
254    #[doc = "Base64 encoded representation of the certificate object to import. This certificate needs to contain the private key."]
255    pub value: String,
256    #[doc = "If the private key in base64EncodedCertificate is encrypted, the password used for encryption."]
257    #[serde(default, skip_serializing_if = "Option::is_none")]
258    pub pwd: Option<String>,
259    #[doc = "Management policy for a certificate."]
260    #[serde(default, skip_serializing_if = "Option::is_none")]
261    pub policy: Option<CertificatePolicy>,
262    #[doc = "The certificate management attributes."]
263    #[serde(default, skip_serializing_if = "Option::is_none")]
264    pub attributes: Option<CertificateAttributes>,
265    #[doc = "Application specific metadata in the form of key-value pairs."]
266    #[serde(default, skip_serializing_if = "Option::is_none")]
267    pub tags: Option<serde_json::Value>,
268}
269impl CertificateImportParameters {
270    pub fn new(value: String) -> Self {
271        Self {
272            value,
273            pwd: None,
274            policy: None,
275            attributes: None,
276            tags: None,
277        }
278    }
279}
280#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
281pub struct CertificateInfoObject {
282    #[doc = "Certificates needed from customer"]
283    pub certificates: Vec<SecurityDomainJsonWebKey>,
284    #[doc = "Customer to specify the number of certificates (minimum 2 and maximum 10) to restore Security Domain"]
285    #[serde(default, skip_serializing_if = "Option::is_none")]
286    pub required: Option<i64>,
287}
288impl CertificateInfoObject {
289    pub fn new(certificates: Vec<SecurityDomainJsonWebKey>) -> Self {
290        Self {
291            certificates,
292            required: None,
293        }
294    }
295}
296#[doc = "The certificate issuer item containing certificate issuer metadata."]
297#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
298pub struct CertificateIssuerItem {
299    #[doc = "Certificate Identifier."]
300    #[serde(default, skip_serializing_if = "Option::is_none")]
301    pub id: Option<String>,
302    #[doc = "The issuer provider."]
303    #[serde(default, skip_serializing_if = "Option::is_none")]
304    pub provider: Option<String>,
305}
306impl CertificateIssuerItem {
307    pub fn new() -> Self {
308        Self::default()
309    }
310}
311#[doc = "The certificate issuer list result."]
312#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
313pub struct CertificateIssuerListResult {
314    #[doc = "A response message containing a list of certificate issuers in the key vault along with a link to the next page of certificate issuers."]
315    #[serde(
316        default,
317        deserialize_with = "azure_core::util::deserialize_null_as_default",
318        skip_serializing_if = "Vec::is_empty"
319    )]
320    pub value: Vec<CertificateIssuerItem>,
321    #[doc = "The URL to get the next set of certificate issuers."]
322    #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")]
323    pub next_link: Option<String>,
324}
325impl azure_core::Continuable for CertificateIssuerListResult {
326    type Continuation = String;
327    fn continuation(&self) -> Option<Self::Continuation> {
328        self.next_link.clone().filter(|value| !value.is_empty())
329    }
330}
331impl CertificateIssuerListResult {
332    pub fn new() -> Self {
333        Self::default()
334    }
335}
336#[doc = "The certificate issuer set parameters."]
337#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
338pub struct CertificateIssuerSetParameters {
339    #[doc = "The issuer provider."]
340    pub provider: String,
341    #[doc = "The credentials to be used for the certificate issuer."]
342    #[serde(default, skip_serializing_if = "Option::is_none")]
343    pub credentials: Option<IssuerCredentials>,
344    #[doc = "Details of the organization of the certificate issuer."]
345    #[serde(default, skip_serializing_if = "Option::is_none")]
346    pub org_details: Option<OrganizationDetails>,
347    #[doc = "The attributes of an issuer managed by the Key Vault service."]
348    #[serde(default, skip_serializing_if = "Option::is_none")]
349    pub attributes: Option<IssuerAttributes>,
350}
351impl CertificateIssuerSetParameters {
352    pub fn new(provider: String) -> Self {
353        Self {
354            provider,
355            credentials: None,
356            org_details: None,
357            attributes: None,
358        }
359    }
360}
361#[doc = "The certificate issuer update parameters."]
362#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
363pub struct CertificateIssuerUpdateParameters {
364    #[doc = "The issuer provider."]
365    #[serde(default, skip_serializing_if = "Option::is_none")]
366    pub provider: Option<String>,
367    #[doc = "The credentials to be used for the certificate issuer."]
368    #[serde(default, skip_serializing_if = "Option::is_none")]
369    pub credentials: Option<IssuerCredentials>,
370    #[doc = "Details of the organization of the certificate issuer."]
371    #[serde(default, skip_serializing_if = "Option::is_none")]
372    pub org_details: Option<OrganizationDetails>,
373    #[doc = "The attributes of an issuer managed by the Key Vault service."]
374    #[serde(default, skip_serializing_if = "Option::is_none")]
375    pub attributes: Option<IssuerAttributes>,
376}
377impl CertificateIssuerUpdateParameters {
378    pub fn new() -> Self {
379        Self::default()
380    }
381}
382#[doc = "The certificate item containing certificate metadata."]
383#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
384pub struct CertificateItem {
385    #[doc = "Certificate identifier."]
386    #[serde(default, skip_serializing_if = "Option::is_none")]
387    pub id: Option<String>,
388    #[doc = "The certificate management attributes."]
389    #[serde(default, skip_serializing_if = "Option::is_none")]
390    pub attributes: Option<CertificateAttributes>,
391    #[doc = "Application specific metadata in the form of key-value pairs."]
392    #[serde(default, skip_serializing_if = "Option::is_none")]
393    pub tags: Option<serde_json::Value>,
394    #[doc = "Thumbprint of the certificate."]
395    #[serde(default, skip_serializing_if = "Option::is_none")]
396    pub x5t: Option<String>,
397}
398impl CertificateItem {
399    pub fn new() -> Self {
400        Self::default()
401    }
402}
403#[doc = "The certificate list result."]
404#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
405pub struct CertificateListResult {
406    #[doc = "A response message containing a list of certificates in the key vault along with a link to the next page of certificates."]
407    #[serde(
408        default,
409        deserialize_with = "azure_core::util::deserialize_null_as_default",
410        skip_serializing_if = "Vec::is_empty"
411    )]
412    pub value: Vec<CertificateItem>,
413    #[doc = "The URL to get the next set of certificates."]
414    #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")]
415    pub next_link: Option<String>,
416}
417impl azure_core::Continuable for CertificateListResult {
418    type Continuation = String;
419    fn continuation(&self) -> Option<Self::Continuation> {
420        self.next_link.clone().filter(|value| !value.is_empty())
421    }
422}
423impl CertificateListResult {
424    pub fn new() -> Self {
425        Self::default()
426    }
427}
428#[doc = "The certificate merge parameters"]
429#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
430pub struct CertificateMergeParameters {
431    #[doc = "The certificate or the certificate chain to merge."]
432    pub x5c: Vec<String>,
433    #[doc = "The certificate management attributes."]
434    #[serde(default, skip_serializing_if = "Option::is_none")]
435    pub attributes: Option<CertificateAttributes>,
436    #[doc = "Application specific metadata in the form of key-value pairs."]
437    #[serde(default, skip_serializing_if = "Option::is_none")]
438    pub tags: Option<serde_json::Value>,
439}
440impl CertificateMergeParameters {
441    pub fn new(x5c: Vec<String>) -> Self {
442        Self {
443            x5c,
444            attributes: None,
445            tags: None,
446        }
447    }
448}
449#[doc = "A certificate operation is returned in case of asynchronous requests."]
450#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
451pub struct CertificateOperation {
452    #[doc = "The certificate id."]
453    #[serde(default, skip_serializing_if = "Option::is_none")]
454    pub id: Option<String>,
455    #[doc = "Parameters for the issuer of the X509 component of a certificate."]
456    #[serde(default, skip_serializing_if = "Option::is_none")]
457    pub issuer: Option<IssuerParameters>,
458    #[doc = "The certificate signing request (CSR) that is being used in the certificate operation."]
459    #[serde(default, skip_serializing_if = "Option::is_none")]
460    pub csr: Option<String>,
461    #[doc = "Indicates if cancellation was requested on the certificate operation."]
462    #[serde(default, skip_serializing_if = "Option::is_none")]
463    pub cancellation_requested: Option<bool>,
464    #[doc = "Status of the certificate operation."]
465    #[serde(default, skip_serializing_if = "Option::is_none")]
466    pub status: Option<String>,
467    #[doc = "The status details of the certificate operation."]
468    #[serde(default, skip_serializing_if = "Option::is_none")]
469    pub status_details: Option<String>,
470    #[doc = "The key vault server error."]
471    #[serde(default, skip_serializing_if = "Option::is_none")]
472    pub error: Option<Error>,
473    #[doc = "Location which contains the result of the certificate operation."]
474    #[serde(default, skip_serializing_if = "Option::is_none")]
475    pub target: Option<String>,
476    #[doc = "Identifier for the certificate operation."]
477    #[serde(default, skip_serializing_if = "Option::is_none")]
478    pub request_id: Option<String>,
479}
480impl CertificateOperation {
481    pub fn new() -> Self {
482        Self::default()
483    }
484}
485#[doc = "The certificate operation update parameters."]
486#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
487pub struct CertificateOperationUpdateParameter {
488    #[doc = "Indicates if cancellation was requested on the certificate operation."]
489    pub cancellation_requested: bool,
490}
491impl CertificateOperationUpdateParameter {
492    pub fn new(cancellation_requested: bool) -> Self {
493        Self { cancellation_requested }
494    }
495}
496#[doc = "Management policy for a certificate."]
497#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
498pub struct CertificatePolicy {
499    #[doc = "The certificate id."]
500    #[serde(default, skip_serializing_if = "Option::is_none")]
501    pub id: Option<String>,
502    #[doc = "Properties of the key pair backing a certificate."]
503    #[serde(default, skip_serializing_if = "Option::is_none")]
504    pub key_props: Option<KeyProperties>,
505    #[doc = "Properties of the key backing a certificate."]
506    #[serde(default, skip_serializing_if = "Option::is_none")]
507    pub secret_props: Option<SecretProperties>,
508    #[doc = "Properties of the X509 component of a certificate."]
509    #[serde(default, skip_serializing_if = "Option::is_none")]
510    pub x509_props: Option<X509CertificateProperties>,
511    #[doc = "Actions that will be performed by Key Vault over the lifetime of a certificate."]
512    #[serde(
513        default,
514        deserialize_with = "azure_core::util::deserialize_null_as_default",
515        skip_serializing_if = "Vec::is_empty"
516    )]
517    pub lifetime_actions: Vec<LifetimeAction>,
518    #[doc = "Parameters for the issuer of the X509 component of a certificate."]
519    #[serde(default, skip_serializing_if = "Option::is_none")]
520    pub issuer: Option<IssuerParameters>,
521    #[doc = "The certificate management attributes."]
522    #[serde(default, skip_serializing_if = "Option::is_none")]
523    pub attributes: Option<CertificateAttributes>,
524}
525impl CertificatePolicy {
526    pub fn new() -> Self {
527        Self::default()
528    }
529}
530#[doc = "The certificate restore parameters."]
531#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
532pub struct CertificateRestoreParameters {
533    #[doc = "The backup blob associated with a certificate bundle."]
534    pub value: String,
535}
536impl CertificateRestoreParameters {
537    pub fn new(value: String) -> Self {
538        Self { value }
539    }
540}
541#[doc = "The certificate update parameters."]
542#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
543pub struct CertificateUpdateParameters {
544    #[doc = "Management policy for a certificate."]
545    #[serde(default, skip_serializing_if = "Option::is_none")]
546    pub policy: Option<CertificatePolicy>,
547    #[doc = "The certificate management attributes."]
548    #[serde(default, skip_serializing_if = "Option::is_none")]
549    pub attributes: Option<CertificateAttributes>,
550    #[doc = "Application specific metadata in the form of key-value pairs."]
551    #[serde(default, skip_serializing_if = "Option::is_none")]
552    pub tags: Option<serde_json::Value>,
553}
554impl CertificateUpdateParameters {
555    pub fn new() -> Self {
556        Self::default()
557    }
558}
559#[doc = "The contact information for the vault certificates."]
560#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
561pub struct Contact {
562    #[doc = "Email address."]
563    #[serde(default, skip_serializing_if = "Option::is_none")]
564    pub email: Option<String>,
565    #[doc = "Name."]
566    #[serde(default, skip_serializing_if = "Option::is_none")]
567    pub name: Option<String>,
568    #[doc = "Phone number."]
569    #[serde(default, skip_serializing_if = "Option::is_none")]
570    pub phone: Option<String>,
571}
572impl Contact {
573    pub fn new() -> Self {
574        Self::default()
575    }
576}
577#[doc = "The contacts for the vault certificates."]
578#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
579pub struct Contacts {
580    #[doc = "Identifier for the contacts collection."]
581    #[serde(default, skip_serializing_if = "Option::is_none")]
582    pub id: Option<String>,
583    #[doc = "The contact list for the vault certificates."]
584    #[serde(
585        default,
586        deserialize_with = "azure_core::util::deserialize_null_as_default",
587        skip_serializing_if = "Vec::is_empty"
588    )]
589    pub contacts: Vec<Contact>,
590}
591impl Contacts {
592    pub fn new() -> Self {
593        Self::default()
594    }
595}
596#[doc = "Supported permissions for data actions."]
597#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
598#[serde(remote = "DataAction")]
599pub enum DataAction {
600    #[serde(rename = "Microsoft.KeyVault/managedHsm/keys/read/action")]
601    MicrosoftKeyVaultManagedHsmKeysReadAction,
602    #[serde(rename = "Microsoft.KeyVault/managedHsm/keys/write/action")]
603    MicrosoftKeyVaultManagedHsmKeysWriteAction,
604    #[serde(rename = "Microsoft.KeyVault/managedHsm/keys/deletedKeys/read/action")]
605    MicrosoftKeyVaultManagedHsmKeysDeletedKeysReadAction,
606    #[serde(rename = "Microsoft.KeyVault/managedHsm/keys/deletedKeys/recover/action")]
607    MicrosoftKeyVaultManagedHsmKeysDeletedKeysRecoverAction,
608    #[serde(rename = "Microsoft.KeyVault/managedHsm/keys/backup/action")]
609    MicrosoftKeyVaultManagedHsmKeysBackupAction,
610    #[serde(rename = "Microsoft.KeyVault/managedHsm/keys/restore/action")]
611    MicrosoftKeyVaultManagedHsmKeysRestoreAction,
612    #[serde(rename = "Microsoft.KeyVault/managedHsm/roleAssignments/delete/action")]
613    MicrosoftKeyVaultManagedHsmRoleAssignmentsDeleteAction,
614    #[serde(rename = "Microsoft.KeyVault/managedHsm/roleAssignments/read/action")]
615    MicrosoftKeyVaultManagedHsmRoleAssignmentsReadAction,
616    #[serde(rename = "Microsoft.KeyVault/managedHsm/roleAssignments/write/action")]
617    MicrosoftKeyVaultManagedHsmRoleAssignmentsWriteAction,
618    #[serde(rename = "Microsoft.KeyVault/managedHsm/roleDefinitions/read/action")]
619    MicrosoftKeyVaultManagedHsmRoleDefinitionsReadAction,
620    #[serde(rename = "Microsoft.KeyVault/managedHsm/roleDefinitions/write/action")]
621    MicrosoftKeyVaultManagedHsmRoleDefinitionsWriteAction,
622    #[serde(rename = "Microsoft.KeyVault/managedHsm/roleDefinitions/delete/action")]
623    MicrosoftKeyVaultManagedHsmRoleDefinitionsDeleteAction,
624    #[serde(rename = "Microsoft.KeyVault/managedHsm/keys/encrypt/action")]
625    MicrosoftKeyVaultManagedHsmKeysEncryptAction,
626    #[serde(rename = "Microsoft.KeyVault/managedHsm/keys/decrypt/action")]
627    MicrosoftKeyVaultManagedHsmKeysDecryptAction,
628    #[serde(rename = "Microsoft.KeyVault/managedHsm/keys/wrap/action")]
629    MicrosoftKeyVaultManagedHsmKeysWrapAction,
630    #[serde(rename = "Microsoft.KeyVault/managedHsm/keys/unwrap/action")]
631    MicrosoftKeyVaultManagedHsmKeysUnwrapAction,
632    #[serde(rename = "Microsoft.KeyVault/managedHsm/keys/sign/action")]
633    MicrosoftKeyVaultManagedHsmKeysSignAction,
634    #[serde(rename = "Microsoft.KeyVault/managedHsm/keys/verify/action")]
635    MicrosoftKeyVaultManagedHsmKeysVerifyAction,
636    #[serde(rename = "Microsoft.KeyVault/managedHsm/keys/create")]
637    MicrosoftKeyVaultManagedHsmKeysCreate,
638    #[serde(rename = "Microsoft.KeyVault/managedHsm/keys/delete")]
639    MicrosoftKeyVaultManagedHsmKeysDelete,
640    #[serde(rename = "Microsoft.KeyVault/managedHsm/keys/export/action")]
641    MicrosoftKeyVaultManagedHsmKeysExportAction,
642    #[serde(rename = "Microsoft.KeyVault/managedHsm/keys/release/action")]
643    MicrosoftKeyVaultManagedHsmKeysReleaseAction,
644    #[serde(rename = "Microsoft.KeyVault/managedHsm/keys/import/action")]
645    MicrosoftKeyVaultManagedHsmKeysImportAction,
646    #[serde(rename = "Microsoft.KeyVault/managedHsm/keys/deletedKeys/delete")]
647    MicrosoftKeyVaultManagedHsmKeysDeletedKeysDelete,
648    #[serde(rename = "Microsoft.KeyVault/managedHsm/securitydomain/download/action")]
649    MicrosoftKeyVaultManagedHsmSecuritydomainDownloadAction,
650    #[serde(rename = "Microsoft.KeyVault/managedHsm/securitydomain/download/read")]
651    MicrosoftKeyVaultManagedHsmSecuritydomainDownloadRead,
652    #[serde(rename = "Microsoft.KeyVault/managedHsm/securitydomain/upload/action")]
653    MicrosoftKeyVaultManagedHsmSecuritydomainUploadAction,
654    #[serde(rename = "Microsoft.KeyVault/managedHsm/securitydomain/upload/read")]
655    MicrosoftKeyVaultManagedHsmSecuritydomainUploadRead,
656    #[serde(rename = "Microsoft.KeyVault/managedHsm/securitydomain/transferkey/read")]
657    MicrosoftKeyVaultManagedHsmSecuritydomainTransferkeyRead,
658    #[serde(rename = "Microsoft.KeyVault/managedHsm/backup/start/action")]
659    MicrosoftKeyVaultManagedHsmBackupStartAction,
660    #[serde(rename = "Microsoft.KeyVault/managedHsm/restore/start/action")]
661    MicrosoftKeyVaultManagedHsmRestoreStartAction,
662    #[serde(rename = "Microsoft.KeyVault/managedHsm/backup/status/action")]
663    MicrosoftKeyVaultManagedHsmBackupStatusAction,
664    #[serde(rename = "Microsoft.KeyVault/managedHsm/restore/status/action")]
665    MicrosoftKeyVaultManagedHsmRestoreStatusAction,
666    #[serde(rename = "Microsoft.KeyVault/managedHsm/rng/action")]
667    MicrosoftKeyVaultManagedHsmRngAction,
668    #[serde(skip_deserializing)]
669    UnknownValue(String),
670}
671impl FromStr for DataAction {
672    type Err = value::Error;
673    fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
674        Self::deserialize(s.into_deserializer())
675    }
676}
677impl<'de> Deserialize<'de> for DataAction {
678    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
679    where
680        D: Deserializer<'de>,
681    {
682        let s = String::deserialize(deserializer)?;
683        let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s));
684        Ok(deserialized)
685    }
686}
687impl Serialize for DataAction {
688    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
689    where
690        S: Serializer,
691    {
692        match self {
693            Self::MicrosoftKeyVaultManagedHsmKeysReadAction => {
694                serializer.serialize_unit_variant("DataAction", 0u32, "Microsoft.KeyVault/managedHsm/keys/read/action")
695            }
696            Self::MicrosoftKeyVaultManagedHsmKeysWriteAction => {
697                serializer.serialize_unit_variant("DataAction", 1u32, "Microsoft.KeyVault/managedHsm/keys/write/action")
698            }
699            Self::MicrosoftKeyVaultManagedHsmKeysDeletedKeysReadAction => {
700                serializer.serialize_unit_variant("DataAction", 2u32, "Microsoft.KeyVault/managedHsm/keys/deletedKeys/read/action")
701            }
702            Self::MicrosoftKeyVaultManagedHsmKeysDeletedKeysRecoverAction => {
703                serializer.serialize_unit_variant("DataAction", 3u32, "Microsoft.KeyVault/managedHsm/keys/deletedKeys/recover/action")
704            }
705            Self::MicrosoftKeyVaultManagedHsmKeysBackupAction => {
706                serializer.serialize_unit_variant("DataAction", 4u32, "Microsoft.KeyVault/managedHsm/keys/backup/action")
707            }
708            Self::MicrosoftKeyVaultManagedHsmKeysRestoreAction => {
709                serializer.serialize_unit_variant("DataAction", 5u32, "Microsoft.KeyVault/managedHsm/keys/restore/action")
710            }
711            Self::MicrosoftKeyVaultManagedHsmRoleAssignmentsDeleteAction => {
712                serializer.serialize_unit_variant("DataAction", 6u32, "Microsoft.KeyVault/managedHsm/roleAssignments/delete/action")
713            }
714            Self::MicrosoftKeyVaultManagedHsmRoleAssignmentsReadAction => {
715                serializer.serialize_unit_variant("DataAction", 7u32, "Microsoft.KeyVault/managedHsm/roleAssignments/read/action")
716            }
717            Self::MicrosoftKeyVaultManagedHsmRoleAssignmentsWriteAction => {
718                serializer.serialize_unit_variant("DataAction", 8u32, "Microsoft.KeyVault/managedHsm/roleAssignments/write/action")
719            }
720            Self::MicrosoftKeyVaultManagedHsmRoleDefinitionsReadAction => {
721                serializer.serialize_unit_variant("DataAction", 9u32, "Microsoft.KeyVault/managedHsm/roleDefinitions/read/action")
722            }
723            Self::MicrosoftKeyVaultManagedHsmRoleDefinitionsWriteAction => {
724                serializer.serialize_unit_variant("DataAction", 10u32, "Microsoft.KeyVault/managedHsm/roleDefinitions/write/action")
725            }
726            Self::MicrosoftKeyVaultManagedHsmRoleDefinitionsDeleteAction => {
727                serializer.serialize_unit_variant("DataAction", 11u32, "Microsoft.KeyVault/managedHsm/roleDefinitions/delete/action")
728            }
729            Self::MicrosoftKeyVaultManagedHsmKeysEncryptAction => {
730                serializer.serialize_unit_variant("DataAction", 12u32, "Microsoft.KeyVault/managedHsm/keys/encrypt/action")
731            }
732            Self::MicrosoftKeyVaultManagedHsmKeysDecryptAction => {
733                serializer.serialize_unit_variant("DataAction", 13u32, "Microsoft.KeyVault/managedHsm/keys/decrypt/action")
734            }
735            Self::MicrosoftKeyVaultManagedHsmKeysWrapAction => {
736                serializer.serialize_unit_variant("DataAction", 14u32, "Microsoft.KeyVault/managedHsm/keys/wrap/action")
737            }
738            Self::MicrosoftKeyVaultManagedHsmKeysUnwrapAction => {
739                serializer.serialize_unit_variant("DataAction", 15u32, "Microsoft.KeyVault/managedHsm/keys/unwrap/action")
740            }
741            Self::MicrosoftKeyVaultManagedHsmKeysSignAction => {
742                serializer.serialize_unit_variant("DataAction", 16u32, "Microsoft.KeyVault/managedHsm/keys/sign/action")
743            }
744            Self::MicrosoftKeyVaultManagedHsmKeysVerifyAction => {
745                serializer.serialize_unit_variant("DataAction", 17u32, "Microsoft.KeyVault/managedHsm/keys/verify/action")
746            }
747            Self::MicrosoftKeyVaultManagedHsmKeysCreate => {
748                serializer.serialize_unit_variant("DataAction", 18u32, "Microsoft.KeyVault/managedHsm/keys/create")
749            }
750            Self::MicrosoftKeyVaultManagedHsmKeysDelete => {
751                serializer.serialize_unit_variant("DataAction", 19u32, "Microsoft.KeyVault/managedHsm/keys/delete")
752            }
753            Self::MicrosoftKeyVaultManagedHsmKeysExportAction => {
754                serializer.serialize_unit_variant("DataAction", 20u32, "Microsoft.KeyVault/managedHsm/keys/export/action")
755            }
756            Self::MicrosoftKeyVaultManagedHsmKeysReleaseAction => {
757                serializer.serialize_unit_variant("DataAction", 21u32, "Microsoft.KeyVault/managedHsm/keys/release/action")
758            }
759            Self::MicrosoftKeyVaultManagedHsmKeysImportAction => {
760                serializer.serialize_unit_variant("DataAction", 22u32, "Microsoft.KeyVault/managedHsm/keys/import/action")
761            }
762            Self::MicrosoftKeyVaultManagedHsmKeysDeletedKeysDelete => {
763                serializer.serialize_unit_variant("DataAction", 23u32, "Microsoft.KeyVault/managedHsm/keys/deletedKeys/delete")
764            }
765            Self::MicrosoftKeyVaultManagedHsmSecuritydomainDownloadAction => {
766                serializer.serialize_unit_variant("DataAction", 24u32, "Microsoft.KeyVault/managedHsm/securitydomain/download/action")
767            }
768            Self::MicrosoftKeyVaultManagedHsmSecuritydomainDownloadRead => {
769                serializer.serialize_unit_variant("DataAction", 25u32, "Microsoft.KeyVault/managedHsm/securitydomain/download/read")
770            }
771            Self::MicrosoftKeyVaultManagedHsmSecuritydomainUploadAction => {
772                serializer.serialize_unit_variant("DataAction", 26u32, "Microsoft.KeyVault/managedHsm/securitydomain/upload/action")
773            }
774            Self::MicrosoftKeyVaultManagedHsmSecuritydomainUploadRead => {
775                serializer.serialize_unit_variant("DataAction", 27u32, "Microsoft.KeyVault/managedHsm/securitydomain/upload/read")
776            }
777            Self::MicrosoftKeyVaultManagedHsmSecuritydomainTransferkeyRead => {
778                serializer.serialize_unit_variant("DataAction", 28u32, "Microsoft.KeyVault/managedHsm/securitydomain/transferkey/read")
779            }
780            Self::MicrosoftKeyVaultManagedHsmBackupStartAction => {
781                serializer.serialize_unit_variant("DataAction", 29u32, "Microsoft.KeyVault/managedHsm/backup/start/action")
782            }
783            Self::MicrosoftKeyVaultManagedHsmRestoreStartAction => {
784                serializer.serialize_unit_variant("DataAction", 30u32, "Microsoft.KeyVault/managedHsm/restore/start/action")
785            }
786            Self::MicrosoftKeyVaultManagedHsmBackupStatusAction => {
787                serializer.serialize_unit_variant("DataAction", 31u32, "Microsoft.KeyVault/managedHsm/backup/status/action")
788            }
789            Self::MicrosoftKeyVaultManagedHsmRestoreStatusAction => {
790                serializer.serialize_unit_variant("DataAction", 32u32, "Microsoft.KeyVault/managedHsm/restore/status/action")
791            }
792            Self::MicrosoftKeyVaultManagedHsmRngAction => {
793                serializer.serialize_unit_variant("DataAction", 33u32, "Microsoft.KeyVault/managedHsm/rng/action")
794            }
795            Self::UnknownValue(s) => serializer.serialize_str(s.as_str()),
796        }
797    }
798}
799#[doc = "A Deleted Certificate consisting of its previous id, attributes and its tags, as well as information on when it will be purged."]
800#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
801pub struct DeletedCertificateBundle {
802    #[serde(flatten)]
803    pub certificate_bundle: CertificateBundle,
804    #[doc = "The url of the recovery object, used to identify and recover the deleted certificate."]
805    #[serde(rename = "recoveryId", default, skip_serializing_if = "Option::is_none")]
806    pub recovery_id: Option<String>,
807    #[doc = "The time when the certificate is scheduled to be purged, in UTC"]
808    #[serde(rename = "scheduledPurgeDate", default, skip_serializing_if = "Option::is_none")]
809    pub scheduled_purge_date: Option<i64>,
810    #[doc = "The time when the certificate was deleted, in UTC"]
811    #[serde(rename = "deletedDate", default, skip_serializing_if = "Option::is_none")]
812    pub deleted_date: Option<i64>,
813}
814impl DeletedCertificateBundle {
815    pub fn new() -> Self {
816        Self::default()
817    }
818}
819#[doc = "The deleted certificate item containing metadata about the deleted certificate."]
820#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
821pub struct DeletedCertificateItem {
822    #[serde(flatten)]
823    pub certificate_item: CertificateItem,
824    #[doc = "The url of the recovery object, used to identify and recover the deleted certificate."]
825    #[serde(rename = "recoveryId", default, skip_serializing_if = "Option::is_none")]
826    pub recovery_id: Option<String>,
827    #[doc = "The time when the certificate is scheduled to be purged, in UTC"]
828    #[serde(rename = "scheduledPurgeDate", default, skip_serializing_if = "Option::is_none")]
829    pub scheduled_purge_date: Option<i64>,
830    #[doc = "The time when the certificate was deleted, in UTC"]
831    #[serde(rename = "deletedDate", default, skip_serializing_if = "Option::is_none")]
832    pub deleted_date: Option<i64>,
833}
834impl DeletedCertificateItem {
835    pub fn new() -> Self {
836        Self::default()
837    }
838}
839#[doc = "A list of certificates that have been deleted in this vault."]
840#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
841pub struct DeletedCertificateListResult {
842    #[doc = "A response message containing a list of deleted certificates in the vault along with a link to the next page of deleted certificates"]
843    #[serde(
844        default,
845        deserialize_with = "azure_core::util::deserialize_null_as_default",
846        skip_serializing_if = "Vec::is_empty"
847    )]
848    pub value: Vec<DeletedCertificateItem>,
849    #[doc = "The URL to get the next set of deleted certificates."]
850    #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")]
851    pub next_link: Option<String>,
852}
853impl azure_core::Continuable for DeletedCertificateListResult {
854    type Continuation = String;
855    fn continuation(&self) -> Option<Self::Continuation> {
856        self.next_link.clone().filter(|value| !value.is_empty())
857    }
858}
859impl DeletedCertificateListResult {
860    pub fn new() -> Self {
861        Self::default()
862    }
863}
864#[doc = "A DeletedKeyBundle consisting of a WebKey plus its Attributes and deletion info"]
865#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
866pub struct DeletedKeyBundle {
867    #[serde(flatten)]
868    pub key_bundle: KeyBundle,
869    #[doc = "The url of the recovery object, used to identify and recover the deleted key."]
870    #[serde(rename = "recoveryId", default, skip_serializing_if = "Option::is_none")]
871    pub recovery_id: Option<String>,
872    #[doc = "The time when the key is scheduled to be purged, in UTC"]
873    #[serde(rename = "scheduledPurgeDate", default, skip_serializing_if = "Option::is_none")]
874    pub scheduled_purge_date: Option<i64>,
875    #[doc = "The time when the key was deleted, in UTC"]
876    #[serde(rename = "deletedDate", default, skip_serializing_if = "Option::is_none")]
877    pub deleted_date: Option<i64>,
878}
879impl DeletedKeyBundle {
880    pub fn new() -> Self {
881        Self::default()
882    }
883}
884#[doc = "The deleted key item containing the deleted key metadata and information about deletion."]
885#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
886pub struct DeletedKeyItem {
887    #[serde(flatten)]
888    pub key_item: KeyItem,
889    #[doc = "The url of the recovery object, used to identify and recover the deleted key."]
890    #[serde(rename = "recoveryId", default, skip_serializing_if = "Option::is_none")]
891    pub recovery_id: Option<String>,
892    #[doc = "The time when the key is scheduled to be purged, in UTC"]
893    #[serde(rename = "scheduledPurgeDate", default, skip_serializing_if = "Option::is_none")]
894    pub scheduled_purge_date: Option<i64>,
895    #[doc = "The time when the key was deleted, in UTC"]
896    #[serde(rename = "deletedDate", default, skip_serializing_if = "Option::is_none")]
897    pub deleted_date: Option<i64>,
898}
899impl DeletedKeyItem {
900    pub fn new() -> Self {
901        Self::default()
902    }
903}
904#[doc = "A list of keys that have been deleted in this vault."]
905#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
906pub struct DeletedKeyListResult {
907    #[doc = "A response message containing a list of deleted keys in the vault along with a link to the next page of deleted keys"]
908    #[serde(
909        default,
910        deserialize_with = "azure_core::util::deserialize_null_as_default",
911        skip_serializing_if = "Vec::is_empty"
912    )]
913    pub value: Vec<DeletedKeyItem>,
914    #[doc = "The URL to get the next set of deleted keys."]
915    #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")]
916    pub next_link: Option<String>,
917}
918impl azure_core::Continuable for DeletedKeyListResult {
919    type Continuation = String;
920    fn continuation(&self) -> Option<Self::Continuation> {
921        self.next_link.clone().filter(|value| !value.is_empty())
922    }
923}
924impl DeletedKeyListResult {
925    pub fn new() -> Self {
926        Self::default()
927    }
928}
929#[doc = "A deleted SAS definition bundle consisting of its previous id, attributes and its tags, as well as information on when it will be purged."]
930#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
931pub struct DeletedSasDefinitionBundle {
932    #[serde(flatten)]
933    pub sas_definition_bundle: SasDefinitionBundle,
934    #[doc = "The url of the recovery object, used to identify and recover the deleted SAS definition."]
935    #[serde(rename = "recoveryId", default, skip_serializing_if = "Option::is_none")]
936    pub recovery_id: Option<String>,
937    #[doc = "The time when the SAS definition is scheduled to be purged, in UTC"]
938    #[serde(rename = "scheduledPurgeDate", default, skip_serializing_if = "Option::is_none")]
939    pub scheduled_purge_date: Option<i64>,
940    #[doc = "The time when the SAS definition was deleted, in UTC"]
941    #[serde(rename = "deletedDate", default, skip_serializing_if = "Option::is_none")]
942    pub deleted_date: Option<i64>,
943}
944impl DeletedSasDefinitionBundle {
945    pub fn new() -> Self {
946        Self::default()
947    }
948}
949#[doc = "The deleted SAS definition item containing metadata about the deleted SAS definition."]
950#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
951pub struct DeletedSasDefinitionItem {
952    #[serde(flatten)]
953    pub sas_definition_item: SasDefinitionItem,
954    #[doc = "The url of the recovery object, used to identify and recover the deleted SAS definition."]
955    #[serde(rename = "recoveryId", default, skip_serializing_if = "Option::is_none")]
956    pub recovery_id: Option<String>,
957    #[doc = "The time when the SAS definition is scheduled to be purged, in UTC"]
958    #[serde(rename = "scheduledPurgeDate", default, skip_serializing_if = "Option::is_none")]
959    pub scheduled_purge_date: Option<i64>,
960    #[doc = "The time when the SAS definition was deleted, in UTC"]
961    #[serde(rename = "deletedDate", default, skip_serializing_if = "Option::is_none")]
962    pub deleted_date: Option<i64>,
963}
964impl DeletedSasDefinitionItem {
965    pub fn new() -> Self {
966        Self::default()
967    }
968}
969#[doc = "The deleted SAS definition list result"]
970#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
971pub struct DeletedSasDefinitionListResult {
972    #[doc = "A response message containing a list of the deleted SAS definitions in the vault along with a link to the next page of deleted sas definitions"]
973    #[serde(
974        default,
975        deserialize_with = "azure_core::util::deserialize_null_as_default",
976        skip_serializing_if = "Vec::is_empty"
977    )]
978    pub value: Vec<DeletedSasDefinitionItem>,
979    #[doc = "The URL to get the next set of deleted SAS definitions."]
980    #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")]
981    pub next_link: Option<String>,
982}
983impl azure_core::Continuable for DeletedSasDefinitionListResult {
984    type Continuation = String;
985    fn continuation(&self) -> Option<Self::Continuation> {
986        self.next_link.clone().filter(|value| !value.is_empty())
987    }
988}
989impl DeletedSasDefinitionListResult {
990    pub fn new() -> Self {
991        Self::default()
992    }
993}
994#[doc = "A Deleted Secret consisting of its previous id, attributes and its tags, as well as information on when it will be purged."]
995#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
996pub struct DeletedSecretBundle {
997    #[serde(flatten)]
998    pub secret_bundle: SecretBundle,
999    #[doc = "The url of the recovery object, used to identify and recover the deleted secret."]
1000    #[serde(rename = "recoveryId", default, skip_serializing_if = "Option::is_none")]
1001    pub recovery_id: Option<String>,
1002    #[doc = "The time when the secret is scheduled to be purged, in UTC"]
1003    #[serde(rename = "scheduledPurgeDate", default, skip_serializing_if = "Option::is_none")]
1004    pub scheduled_purge_date: Option<i64>,
1005    #[doc = "The time when the secret was deleted, in UTC"]
1006    #[serde(rename = "deletedDate", default, skip_serializing_if = "Option::is_none")]
1007    pub deleted_date: Option<i64>,
1008}
1009impl DeletedSecretBundle {
1010    pub fn new() -> Self {
1011        Self::default()
1012    }
1013}
1014#[doc = "The deleted secret item containing metadata about the deleted secret."]
1015#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
1016pub struct DeletedSecretItem {
1017    #[serde(flatten)]
1018    pub secret_item: SecretItem,
1019    #[doc = "The url of the recovery object, used to identify and recover the deleted secret."]
1020    #[serde(rename = "recoveryId", default, skip_serializing_if = "Option::is_none")]
1021    pub recovery_id: Option<String>,
1022    #[doc = "The time when the secret is scheduled to be purged, in UTC"]
1023    #[serde(rename = "scheduledPurgeDate", default, skip_serializing_if = "Option::is_none")]
1024    pub scheduled_purge_date: Option<i64>,
1025    #[doc = "The time when the secret was deleted, in UTC"]
1026    #[serde(rename = "deletedDate", default, skip_serializing_if = "Option::is_none")]
1027    pub deleted_date: Option<i64>,
1028}
1029impl DeletedSecretItem {
1030    pub fn new() -> Self {
1031        Self::default()
1032    }
1033}
1034#[doc = "The deleted secret list result"]
1035#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
1036pub struct DeletedSecretListResult {
1037    #[doc = "A response message containing a list of the deleted secrets in the vault along with a link to the next page of deleted secrets"]
1038    #[serde(
1039        default,
1040        deserialize_with = "azure_core::util::deserialize_null_as_default",
1041        skip_serializing_if = "Vec::is_empty"
1042    )]
1043    pub value: Vec<DeletedSecretItem>,
1044    #[doc = "The URL to get the next set of deleted secrets."]
1045    #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")]
1046    pub next_link: Option<String>,
1047}
1048impl azure_core::Continuable for DeletedSecretListResult {
1049    type Continuation = String;
1050    fn continuation(&self) -> Option<Self::Continuation> {
1051        self.next_link.clone().filter(|value| !value.is_empty())
1052    }
1053}
1054impl DeletedSecretListResult {
1055    pub fn new() -> Self {
1056        Self::default()
1057    }
1058}
1059#[doc = "The deleted storage account item containing metadata about the deleted storage account."]
1060#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
1061pub struct DeletedStorageAccountItem {
1062    #[serde(flatten)]
1063    pub storage_account_item: StorageAccountItem,
1064    #[doc = "The url of the recovery object, used to identify and recover the deleted storage account."]
1065    #[serde(rename = "recoveryId", default, skip_serializing_if = "Option::is_none")]
1066    pub recovery_id: Option<String>,
1067    #[doc = "The time when the storage account is scheduled to be purged, in UTC"]
1068    #[serde(rename = "scheduledPurgeDate", default, skip_serializing_if = "Option::is_none")]
1069    pub scheduled_purge_date: Option<i64>,
1070    #[doc = "The time when the storage account was deleted, in UTC"]
1071    #[serde(rename = "deletedDate", default, skip_serializing_if = "Option::is_none")]
1072    pub deleted_date: Option<i64>,
1073}
1074impl DeletedStorageAccountItem {
1075    pub fn new() -> Self {
1076        Self::default()
1077    }
1078}
1079#[doc = "A deleted storage account bundle consisting of its previous id, attributes and its tags, as well as information on when it will be purged."]
1080#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
1081pub struct DeletedStorageBundle {
1082    #[serde(flatten)]
1083    pub storage_bundle: StorageBundle,
1084    #[doc = "The url of the recovery object, used to identify and recover the deleted storage account."]
1085    #[serde(rename = "recoveryId", default, skip_serializing_if = "Option::is_none")]
1086    pub recovery_id: Option<String>,
1087    #[doc = "The time when the storage account is scheduled to be purged, in UTC"]
1088    #[serde(rename = "scheduledPurgeDate", default, skip_serializing_if = "Option::is_none")]
1089    pub scheduled_purge_date: Option<i64>,
1090    #[doc = "The time when the storage account was deleted, in UTC"]
1091    #[serde(rename = "deletedDate", default, skip_serializing_if = "Option::is_none")]
1092    pub deleted_date: Option<i64>,
1093}
1094impl DeletedStorageBundle {
1095    pub fn new() -> Self {
1096        Self::default()
1097    }
1098}
1099#[doc = "The deleted storage account list result"]
1100#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
1101pub struct DeletedStorageListResult {
1102    #[doc = "A response message containing a list of the deleted storage accounts in the vault along with a link to the next page of deleted storage accounts"]
1103    #[serde(
1104        default,
1105        deserialize_with = "azure_core::util::deserialize_null_as_default",
1106        skip_serializing_if = "Vec::is_empty"
1107    )]
1108    pub value: Vec<DeletedStorageAccountItem>,
1109    #[doc = "The URL to get the next set of deleted storage accounts."]
1110    #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")]
1111    pub next_link: Option<String>,
1112}
1113impl azure_core::Continuable for DeletedStorageListResult {
1114    type Continuation = String;
1115    fn continuation(&self) -> Option<Self::Continuation> {
1116        self.next_link.clone().filter(|value| !value.is_empty())
1117    }
1118}
1119impl DeletedStorageListResult {
1120    pub fn new() -> Self {
1121        Self::default()
1122    }
1123}
1124#[doc = "The key vault server error."]
1125#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
1126pub struct Error {
1127    #[doc = "The error code."]
1128    #[serde(default, skip_serializing_if = "Option::is_none")]
1129    pub code: Option<String>,
1130    #[doc = "The error message."]
1131    #[serde(default, skip_serializing_if = "Option::is_none")]
1132    pub message: Option<String>,
1133    #[doc = "The key vault server error."]
1134    #[serde(default, skip_serializing_if = "Option::is_none")]
1135    pub innererror: Option<Box<Error>>,
1136}
1137impl Error {
1138    pub fn new() -> Self {
1139        Self::default()
1140    }
1141}
1142#[doc = "Full backup operation"]
1143#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
1144pub struct FullBackupOperation {
1145    #[doc = "Status of the backup operation."]
1146    #[serde(default, skip_serializing_if = "Option::is_none")]
1147    pub status: Option<String>,
1148    #[doc = "The status details of backup operation."]
1149    #[serde(rename = "statusDetails", default, skip_serializing_if = "Option::is_none")]
1150    pub status_details: Option<String>,
1151    #[doc = "The key vault server error."]
1152    #[serde(default, skip_serializing_if = "Option::is_none")]
1153    pub error: Option<Error>,
1154    #[doc = "The start time of the backup operation in UTC"]
1155    #[serde(rename = "startTime", default, skip_serializing_if = "Option::is_none")]
1156    pub start_time: Option<i64>,
1157    #[doc = "The end time of the backup operation in UTC"]
1158    #[serde(rename = "endTime", default, skip_serializing_if = "Option::is_none")]
1159    pub end_time: Option<i64>,
1160    #[doc = "Identifier for the full backup operation."]
1161    #[serde(rename = "jobId", default, skip_serializing_if = "Option::is_none")]
1162    pub job_id: Option<String>,
1163    #[doc = "The Azure blob storage container Uri which contains the full backup"]
1164    #[serde(rename = "azureStorageBlobContainerUri", default, skip_serializing_if = "Option::is_none")]
1165    pub azure_storage_blob_container_uri: Option<String>,
1166}
1167impl FullBackupOperation {
1168    pub fn new() -> Self {
1169        Self::default()
1170    }
1171}
1172#[doc = "The get random bytes request object."]
1173#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
1174pub struct GetRandomBytesRequest {
1175    #[doc = "The requested number of random bytes."]
1176    pub count: i32,
1177}
1178impl GetRandomBytesRequest {
1179    pub fn new(count: i32) -> Self {
1180        Self { count }
1181    }
1182}
1183#[doc = "The attributes of an issuer managed by the Key Vault service."]
1184#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
1185pub struct IssuerAttributes {
1186    #[doc = "Determines whether the issuer is enabled."]
1187    #[serde(default, skip_serializing_if = "Option::is_none")]
1188    pub enabled: Option<bool>,
1189    #[doc = "Creation time in UTC."]
1190    #[serde(default, skip_serializing_if = "Option::is_none")]
1191    pub created: Option<i64>,
1192    #[doc = "Last updated time in UTC."]
1193    #[serde(default, skip_serializing_if = "Option::is_none")]
1194    pub updated: Option<i64>,
1195}
1196impl IssuerAttributes {
1197    pub fn new() -> Self {
1198        Self::default()
1199    }
1200}
1201#[doc = "The issuer for Key Vault certificate."]
1202#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
1203pub struct IssuerBundle {
1204    #[doc = "Identifier for the issuer object."]
1205    #[serde(default, skip_serializing_if = "Option::is_none")]
1206    pub id: Option<String>,
1207    #[doc = "The issuer provider."]
1208    #[serde(default, skip_serializing_if = "Option::is_none")]
1209    pub provider: Option<String>,
1210    #[doc = "The credentials to be used for the certificate issuer."]
1211    #[serde(default, skip_serializing_if = "Option::is_none")]
1212    pub credentials: Option<IssuerCredentials>,
1213    #[doc = "Details of the organization of the certificate issuer."]
1214    #[serde(default, skip_serializing_if = "Option::is_none")]
1215    pub org_details: Option<OrganizationDetails>,
1216    #[doc = "The attributes of an issuer managed by the Key Vault service."]
1217    #[serde(default, skip_serializing_if = "Option::is_none")]
1218    pub attributes: Option<IssuerAttributes>,
1219}
1220impl IssuerBundle {
1221    pub fn new() -> Self {
1222        Self::default()
1223    }
1224}
1225#[doc = "The credentials to be used for the certificate issuer."]
1226#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
1227pub struct IssuerCredentials {
1228    #[doc = "The user name/account name/account id."]
1229    #[serde(default, skip_serializing_if = "Option::is_none")]
1230    pub account_id: Option<String>,
1231    #[doc = "The password/secret/account key."]
1232    #[serde(default, skip_serializing_if = "Option::is_none")]
1233    pub pwd: Option<String>,
1234}
1235impl IssuerCredentials {
1236    pub fn new() -> Self {
1237        Self::default()
1238    }
1239}
1240#[doc = "Parameters for the issuer of the X509 component of a certificate."]
1241#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
1242pub struct IssuerParameters {
1243    #[doc = "Name of the referenced issuer object or reserved names; for example, 'Self' or 'Unknown'."]
1244    #[serde(default, skip_serializing_if = "Option::is_none")]
1245    pub name: Option<String>,
1246    #[doc = "Certificate type as supported by the provider (optional); for example 'OV-SSL', 'EV-SSL'"]
1247    #[serde(default, skip_serializing_if = "Option::is_none")]
1248    pub cty: Option<String>,
1249    #[doc = "Indicates if the certificates generated under this policy should be published to certificate transparency logs."]
1250    #[serde(default, skip_serializing_if = "Option::is_none")]
1251    pub cert_transparency: Option<bool>,
1252}
1253impl IssuerParameters {
1254    pub fn new() -> Self {
1255        Self::default()
1256    }
1257}
1258#[doc = "As of http://tools.ietf.org/html/draft-ietf-jose-json-web-key-18"]
1259#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
1260pub struct JsonWebKey {
1261    #[doc = "Key identifier."]
1262    #[serde(default, skip_serializing_if = "Option::is_none")]
1263    pub kid: Option<String>,
1264    #[doc = "JsonWebKey Key Type (kty), as defined in https://tools.ietf.org/html/draft-ietf-jose-json-web-algorithms-40."]
1265    #[serde(default, skip_serializing_if = "Option::is_none")]
1266    pub kty: Option<json_web_key::Kty>,
1267    #[serde(
1268        default,
1269        deserialize_with = "azure_core::util::deserialize_null_as_default",
1270        skip_serializing_if = "Vec::is_empty"
1271    )]
1272    pub key_ops: Vec<String>,
1273    #[doc = "RSA modulus."]
1274    #[serde(default, skip_serializing_if = "Option::is_none")]
1275    pub n: Option<String>,
1276    #[doc = "RSA public exponent."]
1277    #[serde(default, skip_serializing_if = "Option::is_none")]
1278    pub e: Option<String>,
1279    #[doc = "RSA private exponent, or the D component of an EC private key."]
1280    #[serde(default, skip_serializing_if = "Option::is_none")]
1281    pub d: Option<String>,
1282    #[doc = "RSA private key parameter."]
1283    #[serde(default, skip_serializing_if = "Option::is_none")]
1284    pub dp: Option<String>,
1285    #[doc = "RSA private key parameter."]
1286    #[serde(default, skip_serializing_if = "Option::is_none")]
1287    pub dq: Option<String>,
1288    #[doc = "RSA private key parameter."]
1289    #[serde(default, skip_serializing_if = "Option::is_none")]
1290    pub qi: Option<String>,
1291    #[doc = "RSA secret prime."]
1292    #[serde(default, skip_serializing_if = "Option::is_none")]
1293    pub p: Option<String>,
1294    #[doc = "RSA secret prime, with p < q."]
1295    #[serde(default, skip_serializing_if = "Option::is_none")]
1296    pub q: Option<String>,
1297    #[doc = "Symmetric key."]
1298    #[serde(default, skip_serializing_if = "Option::is_none")]
1299    pub k: Option<String>,
1300    #[doc = "Protected Key, used with 'Bring Your Own Key'."]
1301    #[serde(default, skip_serializing_if = "Option::is_none")]
1302    pub key_hsm: Option<String>,
1303    #[doc = "Elliptic curve name. For valid values, see JsonWebKeyCurveName."]
1304    #[serde(default, skip_serializing_if = "Option::is_none")]
1305    pub crv: Option<json_web_key::Crv>,
1306    #[doc = "X component of an EC public key."]
1307    #[serde(default, skip_serializing_if = "Option::is_none")]
1308    pub x: Option<String>,
1309    #[doc = "Y component of an EC public key."]
1310    #[serde(default, skip_serializing_if = "Option::is_none")]
1311    pub y: Option<String>,
1312}
1313impl JsonWebKey {
1314    pub fn new() -> Self {
1315        Self::default()
1316    }
1317}
1318pub mod json_web_key {
1319    use super::*;
1320    #[doc = "JsonWebKey Key Type (kty), as defined in https://tools.ietf.org/html/draft-ietf-jose-json-web-algorithms-40."]
1321    #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
1322    #[serde(remote = "Kty")]
1323    pub enum Kty {
1324        #[serde(rename = "EC")]
1325        Ec,
1326        #[serde(rename = "EC-HSM")]
1327        EcHsm,
1328        #[serde(rename = "RSA")]
1329        Rsa,
1330        #[serde(rename = "RSA-HSM")]
1331        RsaHsm,
1332        #[serde(rename = "oct")]
1333        Oct,
1334        #[serde(rename = "oct-HSM")]
1335        OctHsm,
1336        #[serde(skip_deserializing)]
1337        UnknownValue(String),
1338    }
1339    impl FromStr for Kty {
1340        type Err = value::Error;
1341        fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
1342            Self::deserialize(s.into_deserializer())
1343        }
1344    }
1345    impl<'de> Deserialize<'de> for Kty {
1346        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1347        where
1348            D: Deserializer<'de>,
1349        {
1350            let s = String::deserialize(deserializer)?;
1351            let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s));
1352            Ok(deserialized)
1353        }
1354    }
1355    impl Serialize for Kty {
1356        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1357        where
1358            S: Serializer,
1359        {
1360            match self {
1361                Self::Ec => serializer.serialize_unit_variant("Kty", 0u32, "EC"),
1362                Self::EcHsm => serializer.serialize_unit_variant("Kty", 1u32, "EC-HSM"),
1363                Self::Rsa => serializer.serialize_unit_variant("Kty", 2u32, "RSA"),
1364                Self::RsaHsm => serializer.serialize_unit_variant("Kty", 3u32, "RSA-HSM"),
1365                Self::Oct => serializer.serialize_unit_variant("Kty", 4u32, "oct"),
1366                Self::OctHsm => serializer.serialize_unit_variant("Kty", 5u32, "oct-HSM"),
1367                Self::UnknownValue(s) => serializer.serialize_str(s.as_str()),
1368            }
1369        }
1370    }
1371    #[doc = "Elliptic curve name. For valid values, see JsonWebKeyCurveName."]
1372    #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
1373    #[serde(remote = "Crv")]
1374    pub enum Crv {
1375        #[serde(rename = "P-256")]
1376        P256,
1377        #[serde(rename = "P-384")]
1378        P384,
1379        #[serde(rename = "P-521")]
1380        P521,
1381        #[serde(rename = "P-256K")]
1382        P256k,
1383        #[serde(skip_deserializing)]
1384        UnknownValue(String),
1385    }
1386    impl FromStr for Crv {
1387        type Err = value::Error;
1388        fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
1389            Self::deserialize(s.into_deserializer())
1390        }
1391    }
1392    impl<'de> Deserialize<'de> for Crv {
1393        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1394        where
1395            D: Deserializer<'de>,
1396        {
1397            let s = String::deserialize(deserializer)?;
1398            let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s));
1399            Ok(deserialized)
1400        }
1401    }
1402    impl Serialize for Crv {
1403        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1404        where
1405            S: Serializer,
1406        {
1407            match self {
1408                Self::P256 => serializer.serialize_unit_variant("Crv", 0u32, "P-256"),
1409                Self::P384 => serializer.serialize_unit_variant("Crv", 1u32, "P-384"),
1410                Self::P521 => serializer.serialize_unit_variant("Crv", 2u32, "P-521"),
1411                Self::P256k => serializer.serialize_unit_variant("Crv", 3u32, "P-256K"),
1412                Self::UnknownValue(s) => serializer.serialize_str(s.as_str()),
1413            }
1414        }
1415    }
1416}
1417#[doc = "The attributes of a key managed by the key vault service."]
1418#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
1419pub struct KeyAttributes {
1420    #[serde(flatten)]
1421    pub attributes: Attributes,
1422    #[doc = "softDelete data retention days. Value should be >=7 and <=90 when softDelete enabled, otherwise 0."]
1423    #[serde(rename = "recoverableDays", default, skip_serializing_if = "Option::is_none")]
1424    pub recoverable_days: Option<i32>,
1425    #[doc = "Reflects the deletion recovery level currently in effect for keys in the current vault. If it contains 'Purgeable' the key can be permanently deleted by a privileged user; otherwise, only the system can purge the key, at the end of the retention interval."]
1426    #[serde(rename = "recoveryLevel", default, skip_serializing_if = "Option::is_none")]
1427    pub recovery_level: Option<key_attributes::RecoveryLevel>,
1428    #[doc = "Indicates if the private key can be exported. Release policy must be provided when creating the first version of an exportable key."]
1429    #[serde(default, skip_serializing_if = "Option::is_none")]
1430    pub exportable: Option<bool>,
1431    #[doc = "The underlying HSM Platform."]
1432    #[serde(rename = "hsmPlatform", default, skip_serializing_if = "Option::is_none")]
1433    pub hsm_platform: Option<String>,
1434}
1435impl KeyAttributes {
1436    pub fn new() -> Self {
1437        Self::default()
1438    }
1439}
1440pub mod key_attributes {
1441    use super::*;
1442    #[doc = "Reflects the deletion recovery level currently in effect for keys in the current vault. If it contains 'Purgeable' the key can be permanently deleted by a privileged user; otherwise, only the system can purge the key, at the end of the retention interval."]
1443    #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
1444    #[serde(remote = "RecoveryLevel")]
1445    pub enum RecoveryLevel {
1446        Purgeable,
1447        #[serde(rename = "Recoverable+Purgeable")]
1448        RecoverablePurgeable,
1449        Recoverable,
1450        #[serde(rename = "Recoverable+ProtectedSubscription")]
1451        RecoverableProtectedSubscription,
1452        #[serde(rename = "CustomizedRecoverable+Purgeable")]
1453        CustomizedRecoverablePurgeable,
1454        CustomizedRecoverable,
1455        #[serde(rename = "CustomizedRecoverable+ProtectedSubscription")]
1456        CustomizedRecoverableProtectedSubscription,
1457        #[serde(skip_deserializing)]
1458        UnknownValue(String),
1459    }
1460    impl FromStr for RecoveryLevel {
1461        type Err = value::Error;
1462        fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
1463            Self::deserialize(s.into_deserializer())
1464        }
1465    }
1466    impl<'de> Deserialize<'de> for RecoveryLevel {
1467        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1468        where
1469            D: Deserializer<'de>,
1470        {
1471            let s = String::deserialize(deserializer)?;
1472            let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s));
1473            Ok(deserialized)
1474        }
1475    }
1476    impl Serialize for RecoveryLevel {
1477        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1478        where
1479            S: Serializer,
1480        {
1481            match self {
1482                Self::Purgeable => serializer.serialize_unit_variant("RecoveryLevel", 0u32, "Purgeable"),
1483                Self::RecoverablePurgeable => serializer.serialize_unit_variant("RecoveryLevel", 1u32, "Recoverable+Purgeable"),
1484                Self::Recoverable => serializer.serialize_unit_variant("RecoveryLevel", 2u32, "Recoverable"),
1485                Self::RecoverableProtectedSubscription => {
1486                    serializer.serialize_unit_variant("RecoveryLevel", 3u32, "Recoverable+ProtectedSubscription")
1487                }
1488                Self::CustomizedRecoverablePurgeable => {
1489                    serializer.serialize_unit_variant("RecoveryLevel", 4u32, "CustomizedRecoverable+Purgeable")
1490                }
1491                Self::CustomizedRecoverable => serializer.serialize_unit_variant("RecoveryLevel", 5u32, "CustomizedRecoverable"),
1492                Self::CustomizedRecoverableProtectedSubscription => {
1493                    serializer.serialize_unit_variant("RecoveryLevel", 6u32, "CustomizedRecoverable+ProtectedSubscription")
1494                }
1495                Self::UnknownValue(s) => serializer.serialize_str(s.as_str()),
1496            }
1497        }
1498    }
1499}
1500#[doc = "A KeyBundle consisting of a WebKey plus its attributes."]
1501#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
1502pub struct KeyBundle {
1503    #[doc = "As of http://tools.ietf.org/html/draft-ietf-jose-json-web-key-18"]
1504    #[serde(default, skip_serializing_if = "Option::is_none")]
1505    pub key: Option<JsonWebKey>,
1506    #[doc = "The attributes of a key managed by the key vault service."]
1507    #[serde(default, skip_serializing_if = "Option::is_none")]
1508    pub attributes: Option<KeyAttributes>,
1509    #[doc = "Application specific metadata in the form of key-value pairs."]
1510    #[serde(default, skip_serializing_if = "Option::is_none")]
1511    pub tags: Option<serde_json::Value>,
1512    #[doc = "True if the key's lifetime is managed by key vault. If this is a key backing a certificate, then managed will be true."]
1513    #[serde(default, skip_serializing_if = "Option::is_none")]
1514    pub managed: Option<bool>,
1515    #[doc = "The policy rules under which the key can be exported."]
1516    #[serde(default, skip_serializing_if = "Option::is_none")]
1517    pub release_policy: Option<KeyReleasePolicy>,
1518}
1519impl KeyBundle {
1520    pub fn new() -> Self {
1521        Self::default()
1522    }
1523}
1524#[doc = "The key create parameters."]
1525#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
1526pub struct KeyCreateParameters {
1527    #[doc = "The type of key to create. For valid values, see JsonWebKeyType."]
1528    pub kty: key_create_parameters::Kty,
1529    #[doc = "The key size in bits. For example: 2048, 3072, or 4096 for RSA."]
1530    #[serde(default, skip_serializing_if = "Option::is_none")]
1531    pub key_size: Option<i32>,
1532    #[doc = "The public exponent for a RSA key."]
1533    #[serde(default, skip_serializing_if = "Option::is_none")]
1534    pub public_exponent: Option<i32>,
1535    #[serde(
1536        default,
1537        deserialize_with = "azure_core::util::deserialize_null_as_default",
1538        skip_serializing_if = "Vec::is_empty"
1539    )]
1540    pub key_ops: Vec<String>,
1541    #[doc = "The attributes of a key managed by the key vault service."]
1542    #[serde(default, skip_serializing_if = "Option::is_none")]
1543    pub attributes: Option<KeyAttributes>,
1544    #[doc = "Application specific metadata in the form of key-value pairs."]
1545    #[serde(default, skip_serializing_if = "Option::is_none")]
1546    pub tags: Option<serde_json::Value>,
1547    #[doc = "Elliptic curve name. For valid values, see JsonWebKeyCurveName."]
1548    #[serde(default, skip_serializing_if = "Option::is_none")]
1549    pub crv: Option<key_create_parameters::Crv>,
1550    #[doc = "The policy rules under which the key can be exported."]
1551    #[serde(default, skip_serializing_if = "Option::is_none")]
1552    pub release_policy: Option<KeyReleasePolicy>,
1553}
1554impl KeyCreateParameters {
1555    pub fn new(kty: key_create_parameters::Kty) -> Self {
1556        Self {
1557            kty,
1558            key_size: None,
1559            public_exponent: None,
1560            key_ops: Vec::new(),
1561            attributes: None,
1562            tags: None,
1563            crv: None,
1564            release_policy: None,
1565        }
1566    }
1567}
1568pub mod key_create_parameters {
1569    use super::*;
1570    #[doc = "The type of key to create. For valid values, see JsonWebKeyType."]
1571    #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
1572    #[serde(remote = "Kty")]
1573    pub enum Kty {
1574        #[serde(rename = "EC")]
1575        Ec,
1576        #[serde(rename = "EC-HSM")]
1577        EcHsm,
1578        #[serde(rename = "RSA")]
1579        Rsa,
1580        #[serde(rename = "RSA-HSM")]
1581        RsaHsm,
1582        #[serde(rename = "oct")]
1583        Oct,
1584        #[serde(rename = "oct-HSM")]
1585        OctHsm,
1586        #[serde(skip_deserializing)]
1587        UnknownValue(String),
1588    }
1589    impl FromStr for Kty {
1590        type Err = value::Error;
1591        fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
1592            Self::deserialize(s.into_deserializer())
1593        }
1594    }
1595    impl<'de> Deserialize<'de> for Kty {
1596        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1597        where
1598            D: Deserializer<'de>,
1599        {
1600            let s = String::deserialize(deserializer)?;
1601            let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s));
1602            Ok(deserialized)
1603        }
1604    }
1605    impl Serialize for Kty {
1606        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1607        where
1608            S: Serializer,
1609        {
1610            match self {
1611                Self::Ec => serializer.serialize_unit_variant("Kty", 0u32, "EC"),
1612                Self::EcHsm => serializer.serialize_unit_variant("Kty", 1u32, "EC-HSM"),
1613                Self::Rsa => serializer.serialize_unit_variant("Kty", 2u32, "RSA"),
1614                Self::RsaHsm => serializer.serialize_unit_variant("Kty", 3u32, "RSA-HSM"),
1615                Self::Oct => serializer.serialize_unit_variant("Kty", 4u32, "oct"),
1616                Self::OctHsm => serializer.serialize_unit_variant("Kty", 5u32, "oct-HSM"),
1617                Self::UnknownValue(s) => serializer.serialize_str(s.as_str()),
1618            }
1619        }
1620    }
1621    #[doc = "Elliptic curve name. For valid values, see JsonWebKeyCurveName."]
1622    #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
1623    #[serde(remote = "Crv")]
1624    pub enum Crv {
1625        #[serde(rename = "P-256")]
1626        P256,
1627        #[serde(rename = "P-384")]
1628        P384,
1629        #[serde(rename = "P-521")]
1630        P521,
1631        #[serde(rename = "P-256K")]
1632        P256k,
1633        #[serde(skip_deserializing)]
1634        UnknownValue(String),
1635    }
1636    impl FromStr for Crv {
1637        type Err = value::Error;
1638        fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
1639            Self::deserialize(s.into_deserializer())
1640        }
1641    }
1642    impl<'de> Deserialize<'de> for Crv {
1643        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1644        where
1645            D: Deserializer<'de>,
1646        {
1647            let s = String::deserialize(deserializer)?;
1648            let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s));
1649            Ok(deserialized)
1650        }
1651    }
1652    impl Serialize for Crv {
1653        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1654        where
1655            S: Serializer,
1656        {
1657            match self {
1658                Self::P256 => serializer.serialize_unit_variant("Crv", 0u32, "P-256"),
1659                Self::P384 => serializer.serialize_unit_variant("Crv", 1u32, "P-384"),
1660                Self::P521 => serializer.serialize_unit_variant("Crv", 2u32, "P-521"),
1661                Self::P256k => serializer.serialize_unit_variant("Crv", 3u32, "P-256K"),
1662                Self::UnknownValue(s) => serializer.serialize_str(s.as_str()),
1663            }
1664        }
1665    }
1666}
1667#[doc = "The export key parameters."]
1668#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
1669pub struct KeyExportParameters {
1670    #[doc = "As of http://tools.ietf.org/html/draft-ietf-jose-json-web-key-18"]
1671    #[serde(rename = "wrappingKey", default, skip_serializing_if = "Option::is_none")]
1672    pub wrapping_key: Option<JsonWebKey>,
1673    #[doc = "The export key encryption key identifier. This key MUST be a RSA key that supports encryption."]
1674    #[serde(rename = "wrappingKid", default, skip_serializing_if = "Option::is_none")]
1675    pub wrapping_kid: Option<String>,
1676    #[doc = "The encryption algorithm to use to protected the exported key material"]
1677    #[serde(default, skip_serializing_if = "Option::is_none")]
1678    pub enc: Option<key_export_parameters::Enc>,
1679}
1680impl KeyExportParameters {
1681    pub fn new() -> Self {
1682        Self::default()
1683    }
1684}
1685pub mod key_export_parameters {
1686    use super::*;
1687    #[doc = "The encryption algorithm to use to protected the exported key material"]
1688    #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
1689    #[serde(remote = "Enc")]
1690    pub enum Enc {
1691        #[serde(rename = "CKM_RSA_AES_KEY_WRAP")]
1692        CkmRsaAesKeyWrap,
1693        #[serde(rename = "RSA_AES_KEY_WRAP_256")]
1694        RsaAesKeyWrap256,
1695        #[serde(rename = "RSA_AES_KEY_WRAP_384")]
1696        RsaAesKeyWrap384,
1697        #[serde(skip_deserializing)]
1698        UnknownValue(String),
1699    }
1700    impl FromStr for Enc {
1701        type Err = value::Error;
1702        fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
1703            Self::deserialize(s.into_deserializer())
1704        }
1705    }
1706    impl<'de> Deserialize<'de> for Enc {
1707        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1708        where
1709            D: Deserializer<'de>,
1710        {
1711            let s = String::deserialize(deserializer)?;
1712            let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s));
1713            Ok(deserialized)
1714        }
1715    }
1716    impl Serialize for Enc {
1717        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1718        where
1719            S: Serializer,
1720        {
1721            match self {
1722                Self::CkmRsaAesKeyWrap => serializer.serialize_unit_variant("Enc", 0u32, "CKM_RSA_AES_KEY_WRAP"),
1723                Self::RsaAesKeyWrap256 => serializer.serialize_unit_variant("Enc", 1u32, "RSA_AES_KEY_WRAP_256"),
1724                Self::RsaAesKeyWrap384 => serializer.serialize_unit_variant("Enc", 2u32, "RSA_AES_KEY_WRAP_384"),
1725                Self::UnknownValue(s) => serializer.serialize_str(s.as_str()),
1726            }
1727        }
1728    }
1729}
1730#[doc = "The key import parameters."]
1731#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
1732pub struct KeyImportParameters {
1733    #[doc = "Whether to import as a hardware key (HSM) or software key."]
1734    #[serde(rename = "Hsm", default, skip_serializing_if = "Option::is_none")]
1735    pub hsm: Option<bool>,
1736    #[doc = "As of http://tools.ietf.org/html/draft-ietf-jose-json-web-key-18"]
1737    pub key: JsonWebKey,
1738    #[doc = "The attributes of a key managed by the key vault service."]
1739    #[serde(default, skip_serializing_if = "Option::is_none")]
1740    pub attributes: Option<KeyAttributes>,
1741    #[doc = "Application specific metadata in the form of key-value pairs."]
1742    #[serde(default, skip_serializing_if = "Option::is_none")]
1743    pub tags: Option<serde_json::Value>,
1744    #[doc = "The policy rules under which the key can be exported."]
1745    #[serde(default, skip_serializing_if = "Option::is_none")]
1746    pub release_policy: Option<KeyReleasePolicy>,
1747}
1748impl KeyImportParameters {
1749    pub fn new(key: JsonWebKey) -> Self {
1750        Self {
1751            hsm: None,
1752            key,
1753            attributes: None,
1754            tags: None,
1755            release_policy: None,
1756        }
1757    }
1758}
1759#[doc = "The key item containing key metadata."]
1760#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
1761pub struct KeyItem {
1762    #[doc = "Key identifier."]
1763    #[serde(default, skip_serializing_if = "Option::is_none")]
1764    pub kid: Option<String>,
1765    #[doc = "The attributes of a key managed by the key vault service."]
1766    #[serde(default, skip_serializing_if = "Option::is_none")]
1767    pub attributes: Option<KeyAttributes>,
1768    #[doc = "Application specific metadata in the form of key-value pairs."]
1769    #[serde(default, skip_serializing_if = "Option::is_none")]
1770    pub tags: Option<serde_json::Value>,
1771    #[doc = "True if the key's lifetime is managed by key vault. If this is a key backing a certificate, then managed will be true."]
1772    #[serde(default, skip_serializing_if = "Option::is_none")]
1773    pub managed: Option<bool>,
1774}
1775impl KeyItem {
1776    pub fn new() -> Self {
1777        Self::default()
1778    }
1779}
1780#[doc = "The key list result."]
1781#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
1782pub struct KeyListResult {
1783    #[doc = "A response message containing a list of keys in the key vault along with a link to the next page of keys."]
1784    #[serde(
1785        default,
1786        deserialize_with = "azure_core::util::deserialize_null_as_default",
1787        skip_serializing_if = "Vec::is_empty"
1788    )]
1789    pub value: Vec<KeyItem>,
1790    #[doc = "The URL to get the next set of keys."]
1791    #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")]
1792    pub next_link: Option<String>,
1793}
1794impl azure_core::Continuable for KeyListResult {
1795    type Continuation = String;
1796    fn continuation(&self) -> Option<Self::Continuation> {
1797        self.next_link.clone().filter(|value| !value.is_empty())
1798    }
1799}
1800impl KeyListResult {
1801    pub fn new() -> Self {
1802        Self::default()
1803    }
1804}
1805#[doc = "The key operation result."]
1806#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
1807pub struct KeyOperationResult {
1808    #[doc = "Key identifier"]
1809    #[serde(default, skip_serializing_if = "Option::is_none")]
1810    pub kid: Option<String>,
1811    #[serde(default, skip_serializing_if = "Option::is_none")]
1812    pub value: Option<String>,
1813    #[serde(default, skip_serializing_if = "Option::is_none")]
1814    pub iv: Option<String>,
1815    #[serde(default, skip_serializing_if = "Option::is_none")]
1816    pub tag: Option<String>,
1817    #[serde(default, skip_serializing_if = "Option::is_none")]
1818    pub aad: Option<String>,
1819}
1820impl KeyOperationResult {
1821    pub fn new() -> Self {
1822        Self::default()
1823    }
1824}
1825#[doc = "The key operations parameters."]
1826#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
1827pub struct KeyOperationsParameters {
1828    #[doc = "algorithm identifier"]
1829    pub alg: key_operations_parameters::Alg,
1830    pub value: String,
1831    #[doc = "Cryptographically random, non-repeating initialization vector for symmetric algorithms."]
1832    #[serde(default, skip_serializing_if = "Option::is_none")]
1833    pub iv: Option<String>,
1834    #[doc = "Additional data to authenticate but not encrypt/decrypt when using authenticated crypto algorithms."]
1835    #[serde(default, skip_serializing_if = "Option::is_none")]
1836    pub aad: Option<String>,
1837    #[doc = "The tag to authenticate when performing decryption with an authenticated algorithm."]
1838    #[serde(default, skip_serializing_if = "Option::is_none")]
1839    pub tag: Option<String>,
1840}
1841impl KeyOperationsParameters {
1842    pub fn new(alg: key_operations_parameters::Alg, value: String) -> Self {
1843        Self {
1844            alg,
1845            value,
1846            iv: None,
1847            aad: None,
1848            tag: None,
1849        }
1850    }
1851}
1852pub mod key_operations_parameters {
1853    use super::*;
1854    #[doc = "algorithm identifier"]
1855    #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
1856    #[serde(remote = "Alg")]
1857    pub enum Alg {
1858        #[serde(rename = "RSA-OAEP")]
1859        RsaOaep,
1860        #[serde(rename = "RSA-OAEP-256")]
1861        RsaOaep256,
1862        #[serde(rename = "RSA1_5")]
1863        Rsa15,
1864        #[serde(rename = "A128GCM")]
1865        A128gcm,
1866        #[serde(rename = "A192GCM")]
1867        A192gcm,
1868        #[serde(rename = "A256GCM")]
1869        A256gcm,
1870        #[serde(rename = "A128KW")]
1871        A128kw,
1872        #[serde(rename = "A192KW")]
1873        A192kw,
1874        #[serde(rename = "A256KW")]
1875        A256kw,
1876        #[serde(rename = "A128CBC")]
1877        A128cbc,
1878        #[serde(rename = "A192CBC")]
1879        A192cbc,
1880        #[serde(rename = "A256CBC")]
1881        A256cbc,
1882        #[serde(rename = "A128CBCPAD")]
1883        A128cbcpad,
1884        #[serde(rename = "A192CBCPAD")]
1885        A192cbcpad,
1886        #[serde(rename = "A256CBCPAD")]
1887        A256cbcpad,
1888        #[serde(skip_deserializing)]
1889        UnknownValue(String),
1890    }
1891    impl FromStr for Alg {
1892        type Err = value::Error;
1893        fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
1894            Self::deserialize(s.into_deserializer())
1895        }
1896    }
1897    impl<'de> Deserialize<'de> for Alg {
1898        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1899        where
1900            D: Deserializer<'de>,
1901        {
1902            let s = String::deserialize(deserializer)?;
1903            let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s));
1904            Ok(deserialized)
1905        }
1906    }
1907    impl Serialize for Alg {
1908        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1909        where
1910            S: Serializer,
1911        {
1912            match self {
1913                Self::RsaOaep => serializer.serialize_unit_variant("Alg", 0u32, "RSA-OAEP"),
1914                Self::RsaOaep256 => serializer.serialize_unit_variant("Alg", 1u32, "RSA-OAEP-256"),
1915                Self::Rsa15 => serializer.serialize_unit_variant("Alg", 2u32, "RSA1_5"),
1916                Self::A128gcm => serializer.serialize_unit_variant("Alg", 3u32, "A128GCM"),
1917                Self::A192gcm => serializer.serialize_unit_variant("Alg", 4u32, "A192GCM"),
1918                Self::A256gcm => serializer.serialize_unit_variant("Alg", 5u32, "A256GCM"),
1919                Self::A128kw => serializer.serialize_unit_variant("Alg", 6u32, "A128KW"),
1920                Self::A192kw => serializer.serialize_unit_variant("Alg", 7u32, "A192KW"),
1921                Self::A256kw => serializer.serialize_unit_variant("Alg", 8u32, "A256KW"),
1922                Self::A128cbc => serializer.serialize_unit_variant("Alg", 9u32, "A128CBC"),
1923                Self::A192cbc => serializer.serialize_unit_variant("Alg", 10u32, "A192CBC"),
1924                Self::A256cbc => serializer.serialize_unit_variant("Alg", 11u32, "A256CBC"),
1925                Self::A128cbcpad => serializer.serialize_unit_variant("Alg", 12u32, "A128CBCPAD"),
1926                Self::A192cbcpad => serializer.serialize_unit_variant("Alg", 13u32, "A192CBCPAD"),
1927                Self::A256cbcpad => serializer.serialize_unit_variant("Alg", 14u32, "A256CBCPAD"),
1928                Self::UnknownValue(s) => serializer.serialize_str(s.as_str()),
1929            }
1930        }
1931    }
1932}
1933#[doc = "Properties of the key pair backing a certificate."]
1934#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
1935pub struct KeyProperties {
1936    #[doc = "Indicates if the private key can be exported. Release policy must be provided when creating the first version of an exportable key."]
1937    #[serde(default, skip_serializing_if = "Option::is_none")]
1938    pub exportable: Option<bool>,
1939    #[doc = "The type of key pair to be used for the certificate."]
1940    #[serde(default, skip_serializing_if = "Option::is_none")]
1941    pub kty: Option<key_properties::Kty>,
1942    #[doc = "The key size in bits. For example: 2048, 3072, or 4096 for RSA."]
1943    #[serde(default, skip_serializing_if = "Option::is_none")]
1944    pub key_size: Option<i32>,
1945    #[doc = "Indicates if the same key pair will be used on certificate renewal."]
1946    #[serde(default, skip_serializing_if = "Option::is_none")]
1947    pub reuse_key: Option<bool>,
1948    #[doc = "Elliptic curve name. For valid values, see JsonWebKeyCurveName."]
1949    #[serde(default, skip_serializing_if = "Option::is_none")]
1950    pub crv: Option<key_properties::Crv>,
1951}
1952impl KeyProperties {
1953    pub fn new() -> Self {
1954        Self::default()
1955    }
1956}
1957pub mod key_properties {
1958    use super::*;
1959    #[doc = "The type of key pair to be used for the certificate."]
1960    #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
1961    #[serde(remote = "Kty")]
1962    pub enum Kty {
1963        #[serde(rename = "EC")]
1964        Ec,
1965        #[serde(rename = "EC-HSM")]
1966        EcHsm,
1967        #[serde(rename = "RSA")]
1968        Rsa,
1969        #[serde(rename = "RSA-HSM")]
1970        RsaHsm,
1971        #[serde(rename = "oct")]
1972        Oct,
1973        #[serde(rename = "oct-HSM")]
1974        OctHsm,
1975        #[serde(skip_deserializing)]
1976        UnknownValue(String),
1977    }
1978    impl FromStr for Kty {
1979        type Err = value::Error;
1980        fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
1981            Self::deserialize(s.into_deserializer())
1982        }
1983    }
1984    impl<'de> Deserialize<'de> for Kty {
1985        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1986        where
1987            D: Deserializer<'de>,
1988        {
1989            let s = String::deserialize(deserializer)?;
1990            let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s));
1991            Ok(deserialized)
1992        }
1993    }
1994    impl Serialize for Kty {
1995        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1996        where
1997            S: Serializer,
1998        {
1999            match self {
2000                Self::Ec => serializer.serialize_unit_variant("Kty", 0u32, "EC"),
2001                Self::EcHsm => serializer.serialize_unit_variant("Kty", 1u32, "EC-HSM"),
2002                Self::Rsa => serializer.serialize_unit_variant("Kty", 2u32, "RSA"),
2003                Self::RsaHsm => serializer.serialize_unit_variant("Kty", 3u32, "RSA-HSM"),
2004                Self::Oct => serializer.serialize_unit_variant("Kty", 4u32, "oct"),
2005                Self::OctHsm => serializer.serialize_unit_variant("Kty", 5u32, "oct-HSM"),
2006                Self::UnknownValue(s) => serializer.serialize_str(s.as_str()),
2007            }
2008        }
2009    }
2010    #[doc = "Elliptic curve name. For valid values, see JsonWebKeyCurveName."]
2011    #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
2012    #[serde(remote = "Crv")]
2013    pub enum Crv {
2014        #[serde(rename = "P-256")]
2015        P256,
2016        #[serde(rename = "P-384")]
2017        P384,
2018        #[serde(rename = "P-521")]
2019        P521,
2020        #[serde(rename = "P-256K")]
2021        P256k,
2022        #[serde(skip_deserializing)]
2023        UnknownValue(String),
2024    }
2025    impl FromStr for Crv {
2026        type Err = value::Error;
2027        fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
2028            Self::deserialize(s.into_deserializer())
2029        }
2030    }
2031    impl<'de> Deserialize<'de> for Crv {
2032        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2033        where
2034            D: Deserializer<'de>,
2035        {
2036            let s = String::deserialize(deserializer)?;
2037            let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s));
2038            Ok(deserialized)
2039        }
2040    }
2041    impl Serialize for Crv {
2042        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2043        where
2044            S: Serializer,
2045        {
2046            match self {
2047                Self::P256 => serializer.serialize_unit_variant("Crv", 0u32, "P-256"),
2048                Self::P384 => serializer.serialize_unit_variant("Crv", 1u32, "P-384"),
2049                Self::P521 => serializer.serialize_unit_variant("Crv", 2u32, "P-521"),
2050                Self::P256k => serializer.serialize_unit_variant("Crv", 3u32, "P-256K"),
2051                Self::UnknownValue(s) => serializer.serialize_str(s.as_str()),
2052            }
2053        }
2054    }
2055}
2056#[doc = "The release key parameters."]
2057#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
2058pub struct KeyReleaseParameters {
2059    #[doc = "The attestation assertion for the target of the key release."]
2060    pub target: String,
2061    #[doc = "A client provided nonce for freshness."]
2062    #[serde(default, skip_serializing_if = "Option::is_none")]
2063    pub nonce: Option<String>,
2064    #[doc = "The encryption algorithm to use to protected the exported key material"]
2065    #[serde(default, skip_serializing_if = "Option::is_none")]
2066    pub enc: Option<key_release_parameters::Enc>,
2067}
2068impl KeyReleaseParameters {
2069    pub fn new(target: String) -> Self {
2070        Self {
2071            target,
2072            nonce: None,
2073            enc: None,
2074        }
2075    }
2076}
2077pub mod key_release_parameters {
2078    use super::*;
2079    #[doc = "The encryption algorithm to use to protected the exported key material"]
2080    #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
2081    #[serde(remote = "Enc")]
2082    pub enum Enc {
2083        #[serde(rename = "CKM_RSA_AES_KEY_WRAP")]
2084        CkmRsaAesKeyWrap,
2085        #[serde(rename = "RSA_AES_KEY_WRAP_256")]
2086        RsaAesKeyWrap256,
2087        #[serde(rename = "RSA_AES_KEY_WRAP_384")]
2088        RsaAesKeyWrap384,
2089        #[serde(skip_deserializing)]
2090        UnknownValue(String),
2091    }
2092    impl FromStr for Enc {
2093        type Err = value::Error;
2094        fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
2095            Self::deserialize(s.into_deserializer())
2096        }
2097    }
2098    impl<'de> Deserialize<'de> for Enc {
2099        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2100        where
2101            D: Deserializer<'de>,
2102        {
2103            let s = String::deserialize(deserializer)?;
2104            let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s));
2105            Ok(deserialized)
2106        }
2107    }
2108    impl Serialize for Enc {
2109        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2110        where
2111            S: Serializer,
2112        {
2113            match self {
2114                Self::CkmRsaAesKeyWrap => serializer.serialize_unit_variant("Enc", 0u32, "CKM_RSA_AES_KEY_WRAP"),
2115                Self::RsaAesKeyWrap256 => serializer.serialize_unit_variant("Enc", 1u32, "RSA_AES_KEY_WRAP_256"),
2116                Self::RsaAesKeyWrap384 => serializer.serialize_unit_variant("Enc", 2u32, "RSA_AES_KEY_WRAP_384"),
2117                Self::UnknownValue(s) => serializer.serialize_str(s.as_str()),
2118            }
2119        }
2120    }
2121}
2122#[doc = "The policy rules under which the key can be exported."]
2123#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
2124pub struct KeyReleasePolicy {
2125    #[doc = "Content type and version of key release policy"]
2126    #[serde(rename = "contentType", default, skip_serializing_if = "Option::is_none")]
2127    pub content_type: Option<String>,
2128    #[doc = "Defines the mutability state of the policy. Once marked immutable, this flag cannot be reset and the policy cannot be changed under any circumstances."]
2129    #[serde(default, skip_serializing_if = "Option::is_none")]
2130    pub immutable: Option<bool>,
2131    #[doc = "Blob encoding the policy rules under which the key can be released. Blob must be base64 URL encoded."]
2132    #[serde(default, skip_serializing_if = "Option::is_none")]
2133    pub data: Option<String>,
2134}
2135impl KeyReleasePolicy {
2136    pub fn new() -> Self {
2137        Self::default()
2138    }
2139}
2140#[doc = "The release result, containing the released key."]
2141#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
2142pub struct KeyReleaseResult {
2143    #[doc = "A signed object containing the released key."]
2144    #[serde(default, skip_serializing_if = "Option::is_none")]
2145    pub value: Option<String>,
2146}
2147impl KeyReleaseResult {
2148    pub fn new() -> Self {
2149        Self::default()
2150    }
2151}
2152#[doc = "The key restore parameters."]
2153#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
2154pub struct KeyRestoreParameters {
2155    #[doc = "The backup blob associated with a key bundle."]
2156    pub value: String,
2157}
2158impl KeyRestoreParameters {
2159    pub fn new(value: String) -> Self {
2160        Self { value }
2161    }
2162}
2163#[doc = "Management policy for a key."]
2164#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
2165pub struct KeyRotationPolicy {
2166    #[doc = "The key policy id."]
2167    #[serde(default, skip_serializing_if = "Option::is_none")]
2168    pub id: Option<String>,
2169    #[doc = "Actions that will be performed by Key Vault over the lifetime of a key. For preview, lifetimeActions can only have two items at maximum: one for rotate, one for notify. Notification time would be default to 30 days before expiry and it is not configurable."]
2170    #[serde(
2171        rename = "lifetimeActions",
2172        default,
2173        deserialize_with = "azure_core::util::deserialize_null_as_default",
2174        skip_serializing_if = "Vec::is_empty"
2175    )]
2176    pub lifetime_actions: Vec<LifetimeActions>,
2177    #[doc = "The key rotation policy attributes."]
2178    #[serde(default, skip_serializing_if = "Option::is_none")]
2179    pub attributes: Option<KeyRotationPolicyAttributes>,
2180}
2181impl KeyRotationPolicy {
2182    pub fn new() -> Self {
2183        Self::default()
2184    }
2185}
2186#[doc = "The key rotation policy attributes."]
2187#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
2188pub struct KeyRotationPolicyAttributes {
2189    #[doc = "The expiryTime will be applied on the new key version. It should be at least 28 days. It will be in ISO 8601 Format. Examples: 90 days: P90D, 3 months: P3M, 48 hours: PT48H, 1 year and 10 days: P1Y10D"]
2190    #[serde(rename = "expiryTime", default, skip_serializing_if = "Option::is_none")]
2191    pub expiry_time: Option<String>,
2192    #[doc = "The key rotation policy created time in UTC."]
2193    #[serde(default, skip_serializing_if = "Option::is_none")]
2194    pub created: Option<i64>,
2195    #[doc = "The key rotation policy's last updated time in UTC."]
2196    #[serde(default, skip_serializing_if = "Option::is_none")]
2197    pub updated: Option<i64>,
2198}
2199impl KeyRotationPolicyAttributes {
2200    pub fn new() -> Self {
2201        Self::default()
2202    }
2203}
2204#[doc = "The key operations parameters."]
2205#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
2206pub struct KeySignParameters {
2207    #[doc = "The signing/verification algorithm identifier. For more information on possible algorithm types, see JsonWebKeySignatureAlgorithm."]
2208    pub alg: key_sign_parameters::Alg,
2209    pub value: String,
2210}
2211impl KeySignParameters {
2212    pub fn new(alg: key_sign_parameters::Alg, value: String) -> Self {
2213        Self { alg, value }
2214    }
2215}
2216pub mod key_sign_parameters {
2217    use super::*;
2218    #[doc = "The signing/verification algorithm identifier. For more information on possible algorithm types, see JsonWebKeySignatureAlgorithm."]
2219    #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
2220    #[serde(remote = "Alg")]
2221    pub enum Alg {
2222        #[serde(rename = "PS256")]
2223        Ps256,
2224        #[serde(rename = "PS384")]
2225        Ps384,
2226        #[serde(rename = "PS512")]
2227        Ps512,
2228        #[serde(rename = "RS256")]
2229        Rs256,
2230        #[serde(rename = "RS384")]
2231        Rs384,
2232        #[serde(rename = "RS512")]
2233        Rs512,
2234        #[serde(rename = "RSNULL")]
2235        Rsnull,
2236        #[serde(rename = "ES256")]
2237        Es256,
2238        #[serde(rename = "ES384")]
2239        Es384,
2240        #[serde(rename = "ES512")]
2241        Es512,
2242        #[serde(rename = "ES256K")]
2243        Es256k,
2244        #[serde(skip_deserializing)]
2245        UnknownValue(String),
2246    }
2247    impl FromStr for Alg {
2248        type Err = value::Error;
2249        fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
2250            Self::deserialize(s.into_deserializer())
2251        }
2252    }
2253    impl<'de> Deserialize<'de> for Alg {
2254        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2255        where
2256            D: Deserializer<'de>,
2257        {
2258            let s = String::deserialize(deserializer)?;
2259            let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s));
2260            Ok(deserialized)
2261        }
2262    }
2263    impl Serialize for Alg {
2264        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2265        where
2266            S: Serializer,
2267        {
2268            match self {
2269                Self::Ps256 => serializer.serialize_unit_variant("Alg", 0u32, "PS256"),
2270                Self::Ps384 => serializer.serialize_unit_variant("Alg", 1u32, "PS384"),
2271                Self::Ps512 => serializer.serialize_unit_variant("Alg", 2u32, "PS512"),
2272                Self::Rs256 => serializer.serialize_unit_variant("Alg", 3u32, "RS256"),
2273                Self::Rs384 => serializer.serialize_unit_variant("Alg", 4u32, "RS384"),
2274                Self::Rs512 => serializer.serialize_unit_variant("Alg", 5u32, "RS512"),
2275                Self::Rsnull => serializer.serialize_unit_variant("Alg", 6u32, "RSNULL"),
2276                Self::Es256 => serializer.serialize_unit_variant("Alg", 7u32, "ES256"),
2277                Self::Es384 => serializer.serialize_unit_variant("Alg", 8u32, "ES384"),
2278                Self::Es512 => serializer.serialize_unit_variant("Alg", 9u32, "ES512"),
2279                Self::Es256k => serializer.serialize_unit_variant("Alg", 10u32, "ES256K"),
2280                Self::UnknownValue(s) => serializer.serialize_str(s.as_str()),
2281            }
2282        }
2283    }
2284}
2285#[doc = "The key update parameters."]
2286#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
2287pub struct KeyUpdateParameters {
2288    #[doc = "Json web key operations. For more information on possible key operations, see JsonWebKeyOperation."]
2289    #[serde(
2290        default,
2291        deserialize_with = "azure_core::util::deserialize_null_as_default",
2292        skip_serializing_if = "Vec::is_empty"
2293    )]
2294    pub key_ops: Vec<String>,
2295    #[doc = "The attributes of a key managed by the key vault service."]
2296    #[serde(default, skip_serializing_if = "Option::is_none")]
2297    pub attributes: Option<KeyAttributes>,
2298    #[doc = "Application specific metadata in the form of key-value pairs."]
2299    #[serde(default, skip_serializing_if = "Option::is_none")]
2300    pub tags: Option<serde_json::Value>,
2301    #[doc = "The policy rules under which the key can be exported."]
2302    #[serde(default, skip_serializing_if = "Option::is_none")]
2303    pub release_policy: Option<KeyReleasePolicy>,
2304}
2305impl KeyUpdateParameters {
2306    pub fn new() -> Self {
2307        Self::default()
2308    }
2309}
2310#[doc = "The key vault error exception."]
2311#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
2312pub struct KeyVaultError {
2313    #[doc = "The key vault server error."]
2314    #[serde(default, skip_serializing_if = "Option::is_none")]
2315    pub error: Option<Error>,
2316}
2317impl azure_core::Continuable for KeyVaultError {
2318    type Continuation = String;
2319    fn continuation(&self) -> Option<Self::Continuation> {
2320        None
2321    }
2322}
2323impl KeyVaultError {
2324    pub fn new() -> Self {
2325        Self::default()
2326    }
2327}
2328#[doc = "The key verify parameters."]
2329#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
2330pub struct KeyVerifyParameters {
2331    #[doc = "The signing/verification algorithm. For more information on possible algorithm types, see JsonWebKeySignatureAlgorithm."]
2332    pub alg: key_verify_parameters::Alg,
2333    #[doc = "The digest used for signing."]
2334    pub digest: String,
2335    #[doc = "The signature to be verified."]
2336    pub value: String,
2337}
2338impl KeyVerifyParameters {
2339    pub fn new(alg: key_verify_parameters::Alg, digest: String, value: String) -> Self {
2340        Self { alg, digest, value }
2341    }
2342}
2343pub mod key_verify_parameters {
2344    use super::*;
2345    #[doc = "The signing/verification algorithm. For more information on possible algorithm types, see JsonWebKeySignatureAlgorithm."]
2346    #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
2347    #[serde(remote = "Alg")]
2348    pub enum Alg {
2349        #[serde(rename = "PS256")]
2350        Ps256,
2351        #[serde(rename = "PS384")]
2352        Ps384,
2353        #[serde(rename = "PS512")]
2354        Ps512,
2355        #[serde(rename = "RS256")]
2356        Rs256,
2357        #[serde(rename = "RS384")]
2358        Rs384,
2359        #[serde(rename = "RS512")]
2360        Rs512,
2361        #[serde(rename = "RSNULL")]
2362        Rsnull,
2363        #[serde(rename = "ES256")]
2364        Es256,
2365        #[serde(rename = "ES384")]
2366        Es384,
2367        #[serde(rename = "ES512")]
2368        Es512,
2369        #[serde(rename = "ES256K")]
2370        Es256k,
2371        #[serde(skip_deserializing)]
2372        UnknownValue(String),
2373    }
2374    impl FromStr for Alg {
2375        type Err = value::Error;
2376        fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
2377            Self::deserialize(s.into_deserializer())
2378        }
2379    }
2380    impl<'de> Deserialize<'de> for Alg {
2381        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2382        where
2383            D: Deserializer<'de>,
2384        {
2385            let s = String::deserialize(deserializer)?;
2386            let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s));
2387            Ok(deserialized)
2388        }
2389    }
2390    impl Serialize for Alg {
2391        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2392        where
2393            S: Serializer,
2394        {
2395            match self {
2396                Self::Ps256 => serializer.serialize_unit_variant("Alg", 0u32, "PS256"),
2397                Self::Ps384 => serializer.serialize_unit_variant("Alg", 1u32, "PS384"),
2398                Self::Ps512 => serializer.serialize_unit_variant("Alg", 2u32, "PS512"),
2399                Self::Rs256 => serializer.serialize_unit_variant("Alg", 3u32, "RS256"),
2400                Self::Rs384 => serializer.serialize_unit_variant("Alg", 4u32, "RS384"),
2401                Self::Rs512 => serializer.serialize_unit_variant("Alg", 5u32, "RS512"),
2402                Self::Rsnull => serializer.serialize_unit_variant("Alg", 6u32, "RSNULL"),
2403                Self::Es256 => serializer.serialize_unit_variant("Alg", 7u32, "ES256"),
2404                Self::Es384 => serializer.serialize_unit_variant("Alg", 8u32, "ES384"),
2405                Self::Es512 => serializer.serialize_unit_variant("Alg", 9u32, "ES512"),
2406                Self::Es256k => serializer.serialize_unit_variant("Alg", 10u32, "ES256K"),
2407                Self::UnknownValue(s) => serializer.serialize_str(s.as_str()),
2408            }
2409        }
2410    }
2411}
2412#[doc = "The key verify result."]
2413#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
2414pub struct KeyVerifyResult {
2415    #[doc = "True if the signature is verified, otherwise false."]
2416    #[serde(default, skip_serializing_if = "Option::is_none")]
2417    pub value: Option<bool>,
2418}
2419impl KeyVerifyResult {
2420    pub fn new() -> Self {
2421        Self::default()
2422    }
2423}
2424#[doc = "Action and its trigger that will be performed by Key Vault over the lifetime of a certificate."]
2425#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
2426pub struct LifetimeAction {
2427    #[doc = "A condition to be satisfied for an action to be executed."]
2428    #[serde(default, skip_serializing_if = "Option::is_none")]
2429    pub trigger: Option<Trigger>,
2430    #[doc = "The action that will be executed."]
2431    #[serde(default, skip_serializing_if = "Option::is_none")]
2432    pub action: Option<Action>,
2433}
2434impl LifetimeAction {
2435    pub fn new() -> Self {
2436        Self::default()
2437    }
2438}
2439#[doc = "Action and its trigger that will be performed by Key Vault over the lifetime of a key."]
2440#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
2441pub struct LifetimeActions {
2442    #[doc = "A condition to be satisfied for an action to be executed."]
2443    #[serde(default, skip_serializing_if = "Option::is_none")]
2444    pub trigger: Option<LifetimeActionsTrigger>,
2445    #[doc = "The action that will be executed."]
2446    #[serde(default, skip_serializing_if = "Option::is_none")]
2447    pub action: Option<LifetimeActionsType>,
2448}
2449impl LifetimeActions {
2450    pub fn new() -> Self {
2451        Self::default()
2452    }
2453}
2454#[doc = "A condition to be satisfied for an action to be executed."]
2455#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
2456pub struct LifetimeActionsTrigger {
2457    #[doc = "Time after creation to attempt to rotate. It only applies to rotate. It will be in ISO 8601 duration format. Example: 90 days : \"P90D\"  "]
2458    #[serde(rename = "timeAfterCreate", default, skip_serializing_if = "Option::is_none")]
2459    pub time_after_create: Option<String>,
2460    #[doc = "Time before expiry to attempt to rotate or notify. It will be in ISO 8601 duration format. Example: 90 days : \"P90D\""]
2461    #[serde(rename = "timeBeforeExpiry", default, skip_serializing_if = "Option::is_none")]
2462    pub time_before_expiry: Option<String>,
2463}
2464impl LifetimeActionsTrigger {
2465    pub fn new() -> Self {
2466        Self::default()
2467    }
2468}
2469#[doc = "The action that will be executed."]
2470#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
2471pub struct LifetimeActionsType {
2472    #[doc = "The type of the action. The value should be compared case-insensitively."]
2473    #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
2474    pub type_: Option<lifetime_actions_type::Type>,
2475}
2476impl LifetimeActionsType {
2477    pub fn new() -> Self {
2478        Self::default()
2479    }
2480}
2481pub mod lifetime_actions_type {
2482    use super::*;
2483    #[doc = "The type of the action. The value should be compared case-insensitively."]
2484    #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
2485    pub enum Type {
2486        Rotate,
2487        Notify,
2488    }
2489}
2490#[doc = "Details of the organization of the certificate issuer."]
2491#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
2492pub struct OrganizationDetails {
2493    #[doc = "Id of the organization."]
2494    #[serde(default, skip_serializing_if = "Option::is_none")]
2495    pub id: Option<String>,
2496    #[doc = "Details of the organization administrator."]
2497    #[serde(
2498        default,
2499        deserialize_with = "azure_core::util::deserialize_null_as_default",
2500        skip_serializing_if = "Vec::is_empty"
2501    )]
2502    pub admin_details: Vec<AdministratorDetails>,
2503}
2504impl OrganizationDetails {
2505    pub fn new() -> Self {
2506        Self::default()
2507    }
2508}
2509#[doc = "The pending certificate signing request result."]
2510#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
2511pub struct PendingCertificateSigningRequestResult {
2512    #[doc = "The pending certificate signing request as Base64 encoded string."]
2513    #[serde(default, skip_serializing_if = "Option::is_none")]
2514    pub value: Option<String>,
2515}
2516impl PendingCertificateSigningRequestResult {
2517    pub fn new() -> Self {
2518        Self::default()
2519    }
2520}
2521#[doc = "Role definition permissions."]
2522#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
2523pub struct Permission {
2524    #[doc = "Action permissions that are granted."]
2525    #[serde(
2526        default,
2527        deserialize_with = "azure_core::util::deserialize_null_as_default",
2528        skip_serializing_if = "Vec::is_empty"
2529    )]
2530    pub actions: Vec<String>,
2531    #[doc = "Action permissions that are excluded but not denied. They may be granted by other role definitions assigned to a principal."]
2532    #[serde(
2533        rename = "notActions",
2534        default,
2535        deserialize_with = "azure_core::util::deserialize_null_as_default",
2536        skip_serializing_if = "Vec::is_empty"
2537    )]
2538    pub not_actions: Vec<String>,
2539    #[doc = "Data action permissions that are granted."]
2540    #[serde(
2541        rename = "dataActions",
2542        default,
2543        deserialize_with = "azure_core::util::deserialize_null_as_default",
2544        skip_serializing_if = "Vec::is_empty"
2545    )]
2546    pub data_actions: Vec<DataAction>,
2547    #[doc = "Data action permissions that are excluded but not denied. They may be granted by other role definitions assigned to a principal."]
2548    #[serde(
2549        rename = "notDataActions",
2550        default,
2551        deserialize_with = "azure_core::util::deserialize_null_as_default",
2552        skip_serializing_if = "Vec::is_empty"
2553    )]
2554    pub not_data_actions: Vec<DataAction>,
2555}
2556impl Permission {
2557    pub fn new() -> Self {
2558        Self::default()
2559    }
2560}
2561#[doc = "The get random bytes response object containing the bytes."]
2562#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
2563pub struct RandomBytes {
2564    #[doc = "The bytes encoded as a base64url string."]
2565    pub value: String,
2566}
2567impl RandomBytes {
2568    pub fn new(value: String) -> Self {
2569        Self { value }
2570    }
2571}
2572#[doc = "Restore operation"]
2573#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
2574pub struct RestoreOperation {
2575    #[doc = "Status of the restore operation."]
2576    #[serde(default, skip_serializing_if = "Option::is_none")]
2577    pub status: Option<String>,
2578    #[doc = "The status details of restore operation."]
2579    #[serde(rename = "statusDetails", default, skip_serializing_if = "Option::is_none")]
2580    pub status_details: Option<String>,
2581    #[doc = "The key vault server error."]
2582    #[serde(default, skip_serializing_if = "Option::is_none")]
2583    pub error: Option<Error>,
2584    #[doc = "Identifier for the restore operation."]
2585    #[serde(rename = "jobId", default, skip_serializing_if = "Option::is_none")]
2586    pub job_id: Option<String>,
2587    #[doc = "The start time of the restore operation"]
2588    #[serde(rename = "startTime", default, skip_serializing_if = "Option::is_none")]
2589    pub start_time: Option<i64>,
2590    #[doc = "The end time of the restore operation"]
2591    #[serde(rename = "endTime", default, skip_serializing_if = "Option::is_none")]
2592    pub end_time: Option<i64>,
2593}
2594impl RestoreOperation {
2595    pub fn new() -> Self {
2596        Self::default()
2597    }
2598}
2599#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
2600pub struct RestoreOperationParameters {
2601    #[serde(rename = "sasTokenParameters")]
2602    pub sas_token_parameters: SasTokenParameter,
2603    #[doc = "The Folder name of the blob where the previous successful full backup was stored"]
2604    #[serde(rename = "folderToRestore")]
2605    pub folder_to_restore: String,
2606}
2607impl RestoreOperationParameters {
2608    pub fn new(sas_token_parameters: SasTokenParameter, folder_to_restore: String) -> Self {
2609        Self {
2610            sas_token_parameters,
2611            folder_to_restore,
2612        }
2613    }
2614}
2615#[doc = "Role Assignments"]
2616#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
2617pub struct RoleAssignment {
2618    #[doc = "The role assignment ID."]
2619    #[serde(default, skip_serializing_if = "Option::is_none")]
2620    pub id: Option<String>,
2621    #[doc = "The role assignment name."]
2622    #[serde(default, skip_serializing_if = "Option::is_none")]
2623    pub name: Option<String>,
2624    #[doc = "The role assignment type."]
2625    #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
2626    pub type_: Option<String>,
2627    #[doc = "Role assignment properties with scope."]
2628    #[serde(default, skip_serializing_if = "Option::is_none")]
2629    pub properties: Option<RoleAssignmentPropertiesWithScope>,
2630}
2631impl RoleAssignment {
2632    pub fn new() -> Self {
2633        Self::default()
2634    }
2635}
2636#[doc = "Role assignment create parameters."]
2637#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
2638pub struct RoleAssignmentCreateParameters {
2639    #[doc = "Role assignment properties."]
2640    pub properties: RoleAssignmentProperties,
2641}
2642impl RoleAssignmentCreateParameters {
2643    pub fn new(properties: RoleAssignmentProperties) -> Self {
2644        Self { properties }
2645    }
2646}
2647#[doc = "Role Assignments filter"]
2648#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
2649pub struct RoleAssignmentFilter {
2650    #[doc = "Returns role assignment of the specific principal."]
2651    #[serde(rename = "principalId", default, skip_serializing_if = "Option::is_none")]
2652    pub principal_id: Option<String>,
2653}
2654impl RoleAssignmentFilter {
2655    pub fn new() -> Self {
2656        Self::default()
2657    }
2658}
2659#[doc = "Role assignment list operation result."]
2660#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
2661pub struct RoleAssignmentListResult {
2662    #[doc = "Role assignment list."]
2663    #[serde(
2664        default,
2665        deserialize_with = "azure_core::util::deserialize_null_as_default",
2666        skip_serializing_if = "Vec::is_empty"
2667    )]
2668    pub value: Vec<RoleAssignment>,
2669    #[doc = "The URL to use for getting the next set of results."]
2670    #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")]
2671    pub next_link: Option<String>,
2672}
2673impl azure_core::Continuable for RoleAssignmentListResult {
2674    type Continuation = String;
2675    fn continuation(&self) -> Option<Self::Continuation> {
2676        self.next_link.clone().filter(|value| !value.is_empty())
2677    }
2678}
2679impl RoleAssignmentListResult {
2680    pub fn new() -> Self {
2681        Self::default()
2682    }
2683}
2684#[doc = "Role assignment properties."]
2685#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
2686pub struct RoleAssignmentProperties {
2687    #[doc = "The role definition ID used in the role assignment."]
2688    #[serde(rename = "roleDefinitionId")]
2689    pub role_definition_id: String,
2690    #[doc = "The principal ID assigned to the role. This maps to the ID inside the Active Directory. It can point to a user, service principal, or security group."]
2691    #[serde(rename = "principalId")]
2692    pub principal_id: String,
2693}
2694impl RoleAssignmentProperties {
2695    pub fn new(role_definition_id: String, principal_id: String) -> Self {
2696        Self {
2697            role_definition_id,
2698            principal_id,
2699        }
2700    }
2701}
2702#[doc = "Role assignment properties with scope."]
2703#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
2704pub struct RoleAssignmentPropertiesWithScope {
2705    #[doc = "The role scope."]
2706    #[serde(default, skip_serializing_if = "Option::is_none")]
2707    pub scope: Option<RoleScope>,
2708    #[doc = "The role definition ID."]
2709    #[serde(rename = "roleDefinitionId", default, skip_serializing_if = "Option::is_none")]
2710    pub role_definition_id: Option<String>,
2711    #[doc = "The principal ID."]
2712    #[serde(rename = "principalId", default, skip_serializing_if = "Option::is_none")]
2713    pub principal_id: Option<String>,
2714}
2715impl RoleAssignmentPropertiesWithScope {
2716    pub fn new() -> Self {
2717        Self::default()
2718    }
2719}
2720#[doc = "Role definition."]
2721#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
2722pub struct RoleDefinition {
2723    #[doc = "The role definition ID."]
2724    #[serde(default, skip_serializing_if = "Option::is_none")]
2725    pub id: Option<String>,
2726    #[doc = "The role definition name."]
2727    #[serde(default, skip_serializing_if = "Option::is_none")]
2728    pub name: Option<String>,
2729    #[doc = "The role definition type."]
2730    #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
2731    pub type_: Option<role_definition::Type>,
2732    #[doc = "Role definition properties."]
2733    #[serde(default, skip_serializing_if = "Option::is_none")]
2734    pub properties: Option<RoleDefinitionProperties>,
2735}
2736impl RoleDefinition {
2737    pub fn new() -> Self {
2738        Self::default()
2739    }
2740}
2741pub mod role_definition {
2742    use super::*;
2743    #[doc = "The role definition type."]
2744    #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
2745    #[serde(remote = "Type")]
2746    pub enum Type {
2747        #[serde(rename = "Microsoft.Authorization/roleDefinitions")]
2748        MicrosoftAuthorizationRoleDefinitions,
2749        #[serde(skip_deserializing)]
2750        UnknownValue(String),
2751    }
2752    impl FromStr for Type {
2753        type Err = value::Error;
2754        fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
2755            Self::deserialize(s.into_deserializer())
2756        }
2757    }
2758    impl<'de> Deserialize<'de> for Type {
2759        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2760        where
2761            D: Deserializer<'de>,
2762        {
2763            let s = String::deserialize(deserializer)?;
2764            let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s));
2765            Ok(deserialized)
2766        }
2767    }
2768    impl Serialize for Type {
2769        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2770        where
2771            S: Serializer,
2772        {
2773            match self {
2774                Self::MicrosoftAuthorizationRoleDefinitions => {
2775                    serializer.serialize_unit_variant("Type", 0u32, "Microsoft.Authorization/roleDefinitions")
2776                }
2777                Self::UnknownValue(s) => serializer.serialize_str(s.as_str()),
2778            }
2779        }
2780    }
2781}
2782#[doc = "Role definition create parameters."]
2783#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
2784pub struct RoleDefinitionCreateParameters {
2785    #[doc = "Role definition properties."]
2786    pub properties: RoleDefinitionProperties,
2787}
2788impl RoleDefinitionCreateParameters {
2789    pub fn new(properties: RoleDefinitionProperties) -> Self {
2790        Self { properties }
2791    }
2792}
2793#[doc = "Role Definitions filter"]
2794#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
2795pub struct RoleDefinitionFilter {
2796    #[doc = "Returns role definition with the specific name."]
2797    #[serde(rename = "roleName", default, skip_serializing_if = "Option::is_none")]
2798    pub role_name: Option<String>,
2799}
2800impl RoleDefinitionFilter {
2801    pub fn new() -> Self {
2802        Self::default()
2803    }
2804}
2805#[doc = "Role definition list operation result."]
2806#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
2807pub struct RoleDefinitionListResult {
2808    #[doc = "Role definition list."]
2809    #[serde(
2810        default,
2811        deserialize_with = "azure_core::util::deserialize_null_as_default",
2812        skip_serializing_if = "Vec::is_empty"
2813    )]
2814    pub value: Vec<RoleDefinition>,
2815    #[doc = "The URL to use for getting the next set of results."]
2816    #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")]
2817    pub next_link: Option<String>,
2818}
2819impl azure_core::Continuable for RoleDefinitionListResult {
2820    type Continuation = String;
2821    fn continuation(&self) -> Option<Self::Continuation> {
2822        self.next_link.clone().filter(|value| !value.is_empty())
2823    }
2824}
2825impl RoleDefinitionListResult {
2826    pub fn new() -> Self {
2827        Self::default()
2828    }
2829}
2830#[doc = "Role definition properties."]
2831#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
2832pub struct RoleDefinitionProperties {
2833    #[doc = "The role name."]
2834    #[serde(rename = "roleName", default, skip_serializing_if = "Option::is_none")]
2835    pub role_name: Option<String>,
2836    #[doc = "The role definition description."]
2837    #[serde(default, skip_serializing_if = "Option::is_none")]
2838    pub description: Option<String>,
2839    #[doc = "The role type."]
2840    #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
2841    pub type_: Option<role_definition_properties::Type>,
2842    #[doc = "Role definition permissions."]
2843    #[serde(
2844        default,
2845        deserialize_with = "azure_core::util::deserialize_null_as_default",
2846        skip_serializing_if = "Vec::is_empty"
2847    )]
2848    pub permissions: Vec<Permission>,
2849    #[doc = "Role definition assignable scopes."]
2850    #[serde(
2851        rename = "assignableScopes",
2852        default,
2853        deserialize_with = "azure_core::util::deserialize_null_as_default",
2854        skip_serializing_if = "Vec::is_empty"
2855    )]
2856    pub assignable_scopes: Vec<RoleScope>,
2857}
2858impl RoleDefinitionProperties {
2859    pub fn new() -> Self {
2860        Self::default()
2861    }
2862}
2863pub mod role_definition_properties {
2864    use super::*;
2865    #[doc = "The role type."]
2866    #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
2867    #[serde(remote = "Type")]
2868    pub enum Type {
2869        #[serde(rename = "AKVBuiltInRole")]
2870        AkvBuiltInRole,
2871        CustomRole,
2872        #[serde(skip_deserializing)]
2873        UnknownValue(String),
2874    }
2875    impl FromStr for Type {
2876        type Err = value::Error;
2877        fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
2878            Self::deserialize(s.into_deserializer())
2879        }
2880    }
2881    impl<'de> Deserialize<'de> for Type {
2882        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2883        where
2884            D: Deserializer<'de>,
2885        {
2886            let s = String::deserialize(deserializer)?;
2887            let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s));
2888            Ok(deserialized)
2889        }
2890    }
2891    impl Serialize for Type {
2892        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2893        where
2894            S: Serializer,
2895        {
2896            match self {
2897                Self::AkvBuiltInRole => serializer.serialize_unit_variant("Type", 0u32, "AKVBuiltInRole"),
2898                Self::CustomRole => serializer.serialize_unit_variant("Type", 1u32, "CustomRole"),
2899                Self::UnknownValue(s) => serializer.serialize_str(s.as_str()),
2900            }
2901        }
2902    }
2903}
2904#[doc = "The role scope."]
2905#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
2906#[serde(remote = "RoleScope")]
2907pub enum RoleScope {
2908    #[serde(rename = "/")]
2909    U2f,
2910    #[serde(rename = "/keys")]
2911    Keys,
2912    #[serde(skip_deserializing)]
2913    UnknownValue(String),
2914}
2915impl FromStr for RoleScope {
2916    type Err = value::Error;
2917    fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
2918        Self::deserialize(s.into_deserializer())
2919    }
2920}
2921impl<'de> Deserialize<'de> for RoleScope {
2922    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2923    where
2924        D: Deserializer<'de>,
2925    {
2926        let s = String::deserialize(deserializer)?;
2927        let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s));
2928        Ok(deserialized)
2929    }
2930}
2931impl Serialize for RoleScope {
2932    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2933    where
2934        S: Serializer,
2935    {
2936        match self {
2937            Self::U2f => serializer.serialize_unit_variant("RoleScope", 0u32, "/"),
2938            Self::Keys => serializer.serialize_unit_variant("RoleScope", 1u32, "/keys"),
2939            Self::UnknownValue(s) => serializer.serialize_str(s.as_str()),
2940        }
2941    }
2942}
2943#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
2944pub struct SasTokenParameter {
2945    #[doc = "Azure Blob storage container Uri"]
2946    #[serde(rename = "storageResourceUri")]
2947    pub storage_resource_uri: String,
2948    #[doc = "The SAS token pointing to an Azure Blob storage container"]
2949    #[serde(default, skip_serializing_if = "Option::is_none")]
2950    pub token: Option<String>,
2951    #[doc = "Indicates which authentication method should be used. If set to true, Managed HSM will use the configured user-assigned managed identity to authenticate with Azure Storage. Otherwise, a SAS token has to be specified."]
2952    #[serde(rename = "useManagedIdentity", default, skip_serializing_if = "Option::is_none")]
2953    pub use_managed_identity: Option<bool>,
2954}
2955impl SasTokenParameter {
2956    pub fn new(storage_resource_uri: String) -> Self {
2957        Self {
2958            storage_resource_uri,
2959            token: None,
2960            use_managed_identity: None,
2961        }
2962    }
2963}
2964#[doc = "The SAS definition management attributes."]
2965#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
2966pub struct SasDefinitionAttributes {
2967    #[doc = "the enabled state of the object."]
2968    #[serde(default, skip_serializing_if = "Option::is_none")]
2969    pub enabled: Option<bool>,
2970    #[doc = "Creation time in UTC."]
2971    #[serde(default, skip_serializing_if = "Option::is_none")]
2972    pub created: Option<i64>,
2973    #[doc = "Last updated time in UTC."]
2974    #[serde(default, skip_serializing_if = "Option::is_none")]
2975    pub updated: Option<i64>,
2976    #[doc = "softDelete data retention days. Value should be >=7 and <=90 when softDelete enabled, otherwise 0."]
2977    #[serde(rename = "recoverableDays", default, skip_serializing_if = "Option::is_none")]
2978    pub recoverable_days: Option<i32>,
2979    #[doc = "Reflects the deletion recovery level currently in effect for SAS definitions in the current vault. If it contains 'Purgeable' the SAS definition can be permanently deleted by a privileged user; otherwise, only the system can purge the SAS definition, at the end of the retention interval."]
2980    #[serde(rename = "recoveryLevel", default, skip_serializing_if = "Option::is_none")]
2981    pub recovery_level: Option<sas_definition_attributes::RecoveryLevel>,
2982}
2983impl SasDefinitionAttributes {
2984    pub fn new() -> Self {
2985        Self::default()
2986    }
2987}
2988pub mod sas_definition_attributes {
2989    use super::*;
2990    #[doc = "Reflects the deletion recovery level currently in effect for SAS definitions in the current vault. If it contains 'Purgeable' the SAS definition can be permanently deleted by a privileged user; otherwise, only the system can purge the SAS definition, at the end of the retention interval."]
2991    #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
2992    #[serde(remote = "RecoveryLevel")]
2993    pub enum RecoveryLevel {
2994        Purgeable,
2995        #[serde(rename = "Recoverable+Purgeable")]
2996        RecoverablePurgeable,
2997        Recoverable,
2998        #[serde(rename = "Recoverable+ProtectedSubscription")]
2999        RecoverableProtectedSubscription,
3000        #[serde(rename = "CustomizedRecoverable+Purgeable")]
3001        CustomizedRecoverablePurgeable,
3002        CustomizedRecoverable,
3003        #[serde(rename = "CustomizedRecoverable+ProtectedSubscription")]
3004        CustomizedRecoverableProtectedSubscription,
3005        #[serde(skip_deserializing)]
3006        UnknownValue(String),
3007    }
3008    impl FromStr for RecoveryLevel {
3009        type Err = value::Error;
3010        fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
3011            Self::deserialize(s.into_deserializer())
3012        }
3013    }
3014    impl<'de> Deserialize<'de> for RecoveryLevel {
3015        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3016        where
3017            D: Deserializer<'de>,
3018        {
3019            let s = String::deserialize(deserializer)?;
3020            let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s));
3021            Ok(deserialized)
3022        }
3023    }
3024    impl Serialize for RecoveryLevel {
3025        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3026        where
3027            S: Serializer,
3028        {
3029            match self {
3030                Self::Purgeable => serializer.serialize_unit_variant("RecoveryLevel", 0u32, "Purgeable"),
3031                Self::RecoverablePurgeable => serializer.serialize_unit_variant("RecoveryLevel", 1u32, "Recoverable+Purgeable"),
3032                Self::Recoverable => serializer.serialize_unit_variant("RecoveryLevel", 2u32, "Recoverable"),
3033                Self::RecoverableProtectedSubscription => {
3034                    serializer.serialize_unit_variant("RecoveryLevel", 3u32, "Recoverable+ProtectedSubscription")
3035                }
3036                Self::CustomizedRecoverablePurgeable => {
3037                    serializer.serialize_unit_variant("RecoveryLevel", 4u32, "CustomizedRecoverable+Purgeable")
3038                }
3039                Self::CustomizedRecoverable => serializer.serialize_unit_variant("RecoveryLevel", 5u32, "CustomizedRecoverable"),
3040                Self::CustomizedRecoverableProtectedSubscription => {
3041                    serializer.serialize_unit_variant("RecoveryLevel", 6u32, "CustomizedRecoverable+ProtectedSubscription")
3042                }
3043                Self::UnknownValue(s) => serializer.serialize_str(s.as_str()),
3044            }
3045        }
3046    }
3047}
3048#[doc = "A SAS definition bundle consists of key vault SAS definition details plus its attributes."]
3049#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
3050pub struct SasDefinitionBundle {
3051    #[doc = "The SAS definition id."]
3052    #[serde(default, skip_serializing_if = "Option::is_none")]
3053    pub id: Option<String>,
3054    #[doc = "Storage account SAS definition secret id."]
3055    #[serde(default, skip_serializing_if = "Option::is_none")]
3056    pub sid: Option<String>,
3057    #[doc = "The SAS definition token template signed with an arbitrary key.  Tokens created according to the SAS definition will have the same properties as the template."]
3058    #[serde(rename = "templateUri", default, skip_serializing_if = "Option::is_none")]
3059    pub template_uri: Option<String>,
3060    #[doc = "The type of SAS token the SAS definition will create."]
3061    #[serde(rename = "sasType", default, skip_serializing_if = "Option::is_none")]
3062    pub sas_type: Option<sas_definition_bundle::SasType>,
3063    #[doc = "The validity period of SAS tokens created according to the SAS definition."]
3064    #[serde(rename = "validityPeriod", default, skip_serializing_if = "Option::is_none")]
3065    pub validity_period: Option<String>,
3066    #[doc = "The SAS definition management attributes."]
3067    #[serde(default, skip_serializing_if = "Option::is_none")]
3068    pub attributes: Option<SasDefinitionAttributes>,
3069    #[doc = "Application specific metadata in the form of key-value pairs"]
3070    #[serde(default, skip_serializing_if = "Option::is_none")]
3071    pub tags: Option<serde_json::Value>,
3072}
3073impl SasDefinitionBundle {
3074    pub fn new() -> Self {
3075        Self::default()
3076    }
3077}
3078pub mod sas_definition_bundle {
3079    use super::*;
3080    #[doc = "The type of SAS token the SAS definition will create."]
3081    #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
3082    #[serde(remote = "SasType")]
3083    pub enum SasType {
3084        #[serde(rename = "account")]
3085        Account,
3086        #[serde(rename = "service")]
3087        Service,
3088        #[serde(skip_deserializing)]
3089        UnknownValue(String),
3090    }
3091    impl FromStr for SasType {
3092        type Err = value::Error;
3093        fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
3094            Self::deserialize(s.into_deserializer())
3095        }
3096    }
3097    impl<'de> Deserialize<'de> for SasType {
3098        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3099        where
3100            D: Deserializer<'de>,
3101        {
3102            let s = String::deserialize(deserializer)?;
3103            let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s));
3104            Ok(deserialized)
3105        }
3106    }
3107    impl Serialize for SasType {
3108        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3109        where
3110            S: Serializer,
3111        {
3112            match self {
3113                Self::Account => serializer.serialize_unit_variant("SasType", 0u32, "account"),
3114                Self::Service => serializer.serialize_unit_variant("SasType", 1u32, "service"),
3115                Self::UnknownValue(s) => serializer.serialize_str(s.as_str()),
3116            }
3117        }
3118    }
3119}
3120#[doc = "The SAS definition create parameters."]
3121#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
3122pub struct SasDefinitionCreateParameters {
3123    #[doc = "The SAS definition token template signed with an arbitrary key.  Tokens created according to the SAS definition will have the same properties as the template."]
3124    #[serde(rename = "templateUri")]
3125    pub template_uri: String,
3126    #[doc = "The type of SAS token the SAS definition will create."]
3127    #[serde(rename = "sasType")]
3128    pub sas_type: sas_definition_create_parameters::SasType,
3129    #[doc = "The validity period of SAS tokens created according to the SAS definition."]
3130    #[serde(rename = "validityPeriod")]
3131    pub validity_period: String,
3132    #[doc = "The SAS definition management attributes."]
3133    #[serde(default, skip_serializing_if = "Option::is_none")]
3134    pub attributes: Option<SasDefinitionAttributes>,
3135    #[doc = "Application specific metadata in the form of key-value pairs."]
3136    #[serde(default, skip_serializing_if = "Option::is_none")]
3137    pub tags: Option<serde_json::Value>,
3138}
3139impl SasDefinitionCreateParameters {
3140    pub fn new(template_uri: String, sas_type: sas_definition_create_parameters::SasType, validity_period: String) -> Self {
3141        Self {
3142            template_uri,
3143            sas_type,
3144            validity_period,
3145            attributes: None,
3146            tags: None,
3147        }
3148    }
3149}
3150pub mod sas_definition_create_parameters {
3151    use super::*;
3152    #[doc = "The type of SAS token the SAS definition will create."]
3153    #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
3154    #[serde(remote = "SasType")]
3155    pub enum SasType {
3156        #[serde(rename = "account")]
3157        Account,
3158        #[serde(rename = "service")]
3159        Service,
3160        #[serde(skip_deserializing)]
3161        UnknownValue(String),
3162    }
3163    impl FromStr for SasType {
3164        type Err = value::Error;
3165        fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
3166            Self::deserialize(s.into_deserializer())
3167        }
3168    }
3169    impl<'de> Deserialize<'de> for SasType {
3170        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3171        where
3172            D: Deserializer<'de>,
3173        {
3174            let s = String::deserialize(deserializer)?;
3175            let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s));
3176            Ok(deserialized)
3177        }
3178    }
3179    impl Serialize for SasType {
3180        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3181        where
3182            S: Serializer,
3183        {
3184            match self {
3185                Self::Account => serializer.serialize_unit_variant("SasType", 0u32, "account"),
3186                Self::Service => serializer.serialize_unit_variant("SasType", 1u32, "service"),
3187                Self::UnknownValue(s) => serializer.serialize_str(s.as_str()),
3188            }
3189        }
3190    }
3191}
3192#[doc = "The SAS definition item containing storage SAS definition metadata."]
3193#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
3194pub struct SasDefinitionItem {
3195    #[doc = "The storage SAS identifier."]
3196    #[serde(default, skip_serializing_if = "Option::is_none")]
3197    pub id: Option<String>,
3198    #[doc = "The storage account SAS definition secret id."]
3199    #[serde(default, skip_serializing_if = "Option::is_none")]
3200    pub sid: Option<String>,
3201    #[doc = "The SAS definition management attributes."]
3202    #[serde(default, skip_serializing_if = "Option::is_none")]
3203    pub attributes: Option<SasDefinitionAttributes>,
3204    #[doc = "Application specific metadata in the form of key-value pairs."]
3205    #[serde(default, skip_serializing_if = "Option::is_none")]
3206    pub tags: Option<serde_json::Value>,
3207}
3208impl SasDefinitionItem {
3209    pub fn new() -> Self {
3210        Self::default()
3211    }
3212}
3213#[doc = "The storage account SAS definition list result."]
3214#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
3215pub struct SasDefinitionListResult {
3216    #[doc = "A response message containing a list of SAS definitions along with a link to the next page of SAS definitions."]
3217    #[serde(
3218        default,
3219        deserialize_with = "azure_core::util::deserialize_null_as_default",
3220        skip_serializing_if = "Vec::is_empty"
3221    )]
3222    pub value: Vec<SasDefinitionItem>,
3223    #[doc = "The URL to get the next set of SAS definitions."]
3224    #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")]
3225    pub next_link: Option<String>,
3226}
3227impl azure_core::Continuable for SasDefinitionListResult {
3228    type Continuation = String;
3229    fn continuation(&self) -> Option<Self::Continuation> {
3230        self.next_link.clone().filter(|value| !value.is_empty())
3231    }
3232}
3233impl SasDefinitionListResult {
3234    pub fn new() -> Self {
3235        Self::default()
3236    }
3237}
3238#[doc = "The SAS definition update parameters."]
3239#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
3240pub struct SasDefinitionUpdateParameters {
3241    #[doc = "The SAS definition token template signed with an arbitrary key.  Tokens created according to the SAS definition will have the same properties as the template."]
3242    #[serde(rename = "templateUri", default, skip_serializing_if = "Option::is_none")]
3243    pub template_uri: Option<String>,
3244    #[doc = "The type of SAS token the SAS definition will create."]
3245    #[serde(rename = "sasType", default, skip_serializing_if = "Option::is_none")]
3246    pub sas_type: Option<sas_definition_update_parameters::SasType>,
3247    #[doc = "The validity period of SAS tokens created according to the SAS definition."]
3248    #[serde(rename = "validityPeriod", default, skip_serializing_if = "Option::is_none")]
3249    pub validity_period: Option<String>,
3250    #[doc = "The SAS definition management attributes."]
3251    #[serde(default, skip_serializing_if = "Option::is_none")]
3252    pub attributes: Option<SasDefinitionAttributes>,
3253    #[doc = "Application specific metadata in the form of key-value pairs."]
3254    #[serde(default, skip_serializing_if = "Option::is_none")]
3255    pub tags: Option<serde_json::Value>,
3256}
3257impl SasDefinitionUpdateParameters {
3258    pub fn new() -> Self {
3259        Self::default()
3260    }
3261}
3262pub mod sas_definition_update_parameters {
3263    use super::*;
3264    #[doc = "The type of SAS token the SAS definition will create."]
3265    #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
3266    #[serde(remote = "SasType")]
3267    pub enum SasType {
3268        #[serde(rename = "account")]
3269        Account,
3270        #[serde(rename = "service")]
3271        Service,
3272        #[serde(skip_deserializing)]
3273        UnknownValue(String),
3274    }
3275    impl FromStr for SasType {
3276        type Err = value::Error;
3277        fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
3278            Self::deserialize(s.into_deserializer())
3279        }
3280    }
3281    impl<'de> Deserialize<'de> for SasType {
3282        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3283        where
3284            D: Deserializer<'de>,
3285        {
3286            let s = String::deserialize(deserializer)?;
3287            let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s));
3288            Ok(deserialized)
3289        }
3290    }
3291    impl Serialize for SasType {
3292        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3293        where
3294            S: Serializer,
3295        {
3296            match self {
3297                Self::Account => serializer.serialize_unit_variant("SasType", 0u32, "account"),
3298                Self::Service => serializer.serialize_unit_variant("SasType", 1u32, "service"),
3299                Self::UnknownValue(s) => serializer.serialize_str(s.as_str()),
3300            }
3301        }
3302    }
3303}
3304#[doc = "The secret management attributes."]
3305#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
3306pub struct SecretAttributes {
3307    #[serde(flatten)]
3308    pub attributes: Attributes,
3309    #[doc = "softDelete data retention days. Value should be >=7 and <=90 when softDelete enabled, otherwise 0."]
3310    #[serde(rename = "recoverableDays", default, skip_serializing_if = "Option::is_none")]
3311    pub recoverable_days: Option<i32>,
3312    #[doc = "Reflects the deletion recovery level currently in effect for secrets in the current vault. If it contains 'Purgeable', the secret can be permanently deleted by a privileged user; otherwise, only the system can purge the secret, at the end of the retention interval."]
3313    #[serde(rename = "recoveryLevel", default, skip_serializing_if = "Option::is_none")]
3314    pub recovery_level: Option<secret_attributes::RecoveryLevel>,
3315}
3316impl SecretAttributes {
3317    pub fn new() -> Self {
3318        Self::default()
3319    }
3320}
3321pub mod secret_attributes {
3322    use super::*;
3323    #[doc = "Reflects the deletion recovery level currently in effect for secrets in the current vault. If it contains 'Purgeable', the secret can be permanently deleted by a privileged user; otherwise, only the system can purge the secret, at the end of the retention interval."]
3324    #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
3325    #[serde(remote = "RecoveryLevel")]
3326    pub enum RecoveryLevel {
3327        Purgeable,
3328        #[serde(rename = "Recoverable+Purgeable")]
3329        RecoverablePurgeable,
3330        Recoverable,
3331        #[serde(rename = "Recoverable+ProtectedSubscription")]
3332        RecoverableProtectedSubscription,
3333        #[serde(rename = "CustomizedRecoverable+Purgeable")]
3334        CustomizedRecoverablePurgeable,
3335        CustomizedRecoverable,
3336        #[serde(rename = "CustomizedRecoverable+ProtectedSubscription")]
3337        CustomizedRecoverableProtectedSubscription,
3338        #[serde(skip_deserializing)]
3339        UnknownValue(String),
3340    }
3341    impl FromStr for RecoveryLevel {
3342        type Err = value::Error;
3343        fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
3344            Self::deserialize(s.into_deserializer())
3345        }
3346    }
3347    impl<'de> Deserialize<'de> for RecoveryLevel {
3348        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3349        where
3350            D: Deserializer<'de>,
3351        {
3352            let s = String::deserialize(deserializer)?;
3353            let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s));
3354            Ok(deserialized)
3355        }
3356    }
3357    impl Serialize for RecoveryLevel {
3358        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3359        where
3360            S: Serializer,
3361        {
3362            match self {
3363                Self::Purgeable => serializer.serialize_unit_variant("RecoveryLevel", 0u32, "Purgeable"),
3364                Self::RecoverablePurgeable => serializer.serialize_unit_variant("RecoveryLevel", 1u32, "Recoverable+Purgeable"),
3365                Self::Recoverable => serializer.serialize_unit_variant("RecoveryLevel", 2u32, "Recoverable"),
3366                Self::RecoverableProtectedSubscription => {
3367                    serializer.serialize_unit_variant("RecoveryLevel", 3u32, "Recoverable+ProtectedSubscription")
3368                }
3369                Self::CustomizedRecoverablePurgeable => {
3370                    serializer.serialize_unit_variant("RecoveryLevel", 4u32, "CustomizedRecoverable+Purgeable")
3371                }
3372                Self::CustomizedRecoverable => serializer.serialize_unit_variant("RecoveryLevel", 5u32, "CustomizedRecoverable"),
3373                Self::CustomizedRecoverableProtectedSubscription => {
3374                    serializer.serialize_unit_variant("RecoveryLevel", 6u32, "CustomizedRecoverable+ProtectedSubscription")
3375                }
3376                Self::UnknownValue(s) => serializer.serialize_str(s.as_str()),
3377            }
3378        }
3379    }
3380}
3381#[doc = "A secret consisting of a value, id and its attributes."]
3382#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
3383pub struct SecretBundle {
3384    #[doc = "The secret value."]
3385    #[serde(default, skip_serializing_if = "Option::is_none")]
3386    pub value: Option<String>,
3387    #[doc = "The secret id."]
3388    #[serde(default, skip_serializing_if = "Option::is_none")]
3389    pub id: Option<String>,
3390    #[doc = "The content type of the secret."]
3391    #[serde(rename = "contentType", default, skip_serializing_if = "Option::is_none")]
3392    pub content_type: Option<String>,
3393    #[doc = "The secret management attributes."]
3394    #[serde(default, skip_serializing_if = "Option::is_none")]
3395    pub attributes: Option<SecretAttributes>,
3396    #[doc = "Application specific metadata in the form of key-value pairs."]
3397    #[serde(default, skip_serializing_if = "Option::is_none")]
3398    pub tags: Option<serde_json::Value>,
3399    #[doc = "If this is a secret backing a KV certificate, then this field specifies the corresponding key backing the KV certificate."]
3400    #[serde(default, skip_serializing_if = "Option::is_none")]
3401    pub kid: Option<String>,
3402    #[doc = "True if the secret's lifetime is managed by key vault. If this is a secret backing a certificate, then managed will be true."]
3403    #[serde(default, skip_serializing_if = "Option::is_none")]
3404    pub managed: Option<bool>,
3405}
3406impl SecretBundle {
3407    pub fn new() -> Self {
3408        Self::default()
3409    }
3410}
3411#[doc = "The secret item containing secret metadata."]
3412#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
3413pub struct SecretItem {
3414    #[doc = "Secret identifier."]
3415    #[serde(default, skip_serializing_if = "Option::is_none")]
3416    pub id: Option<String>,
3417    #[doc = "The secret management attributes."]
3418    #[serde(default, skip_serializing_if = "Option::is_none")]
3419    pub attributes: Option<SecretAttributes>,
3420    #[doc = "Application specific metadata in the form of key-value pairs."]
3421    #[serde(default, skip_serializing_if = "Option::is_none")]
3422    pub tags: Option<serde_json::Value>,
3423    #[doc = "Type of the secret value such as a password."]
3424    #[serde(rename = "contentType", default, skip_serializing_if = "Option::is_none")]
3425    pub content_type: Option<String>,
3426    #[doc = "True if the secret's lifetime is managed by key vault. If this is a key backing a certificate, then managed will be true."]
3427    #[serde(default, skip_serializing_if = "Option::is_none")]
3428    pub managed: Option<bool>,
3429}
3430impl SecretItem {
3431    pub fn new() -> Self {
3432        Self::default()
3433    }
3434}
3435#[doc = "The secret list result."]
3436#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
3437pub struct SecretListResult {
3438    #[doc = "A response message containing a list of secrets in the key vault along with a link to the next page of secrets."]
3439    #[serde(
3440        default,
3441        deserialize_with = "azure_core::util::deserialize_null_as_default",
3442        skip_serializing_if = "Vec::is_empty"
3443    )]
3444    pub value: Vec<SecretItem>,
3445    #[doc = "The URL to get the next set of secrets."]
3446    #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")]
3447    pub next_link: Option<String>,
3448}
3449impl azure_core::Continuable for SecretListResult {
3450    type Continuation = String;
3451    fn continuation(&self) -> Option<Self::Continuation> {
3452        self.next_link.clone().filter(|value| !value.is_empty())
3453    }
3454}
3455impl SecretListResult {
3456    pub fn new() -> Self {
3457        Self::default()
3458    }
3459}
3460#[doc = "Properties of the key backing a certificate."]
3461#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
3462pub struct SecretProperties {
3463    #[doc = "The media type (MIME type)."]
3464    #[serde(rename = "contentType", default, skip_serializing_if = "Option::is_none")]
3465    pub content_type: Option<String>,
3466}
3467impl SecretProperties {
3468    pub fn new() -> Self {
3469        Self::default()
3470    }
3471}
3472#[doc = "The secret restore parameters."]
3473#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
3474pub struct SecretRestoreParameters {
3475    #[doc = "The backup blob associated with a secret bundle."]
3476    pub value: String,
3477}
3478impl SecretRestoreParameters {
3479    pub fn new(value: String) -> Self {
3480        Self { value }
3481    }
3482}
3483#[doc = "The secret set parameters."]
3484#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
3485pub struct SecretSetParameters {
3486    #[doc = "The value of the secret."]
3487    pub value: String,
3488    #[doc = "Application specific metadata in the form of key-value pairs."]
3489    #[serde(default, skip_serializing_if = "Option::is_none")]
3490    pub tags: Option<serde_json::Value>,
3491    #[doc = "Type of the secret value such as a password."]
3492    #[serde(rename = "contentType", default, skip_serializing_if = "Option::is_none")]
3493    pub content_type: Option<String>,
3494    #[doc = "The secret management attributes."]
3495    #[serde(default, skip_serializing_if = "Option::is_none")]
3496    pub attributes: Option<SecretAttributes>,
3497}
3498impl SecretSetParameters {
3499    pub fn new(value: String) -> Self {
3500        Self {
3501            value,
3502            tags: None,
3503            content_type: None,
3504            attributes: None,
3505        }
3506    }
3507}
3508#[doc = "The secret update parameters."]
3509#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
3510pub struct SecretUpdateParameters {
3511    #[doc = "Type of the secret value such as a password."]
3512    #[serde(rename = "contentType", default, skip_serializing_if = "Option::is_none")]
3513    pub content_type: Option<String>,
3514    #[doc = "The secret management attributes."]
3515    #[serde(default, skip_serializing_if = "Option::is_none")]
3516    pub attributes: Option<SecretAttributes>,
3517    #[doc = "Application specific metadata in the form of key-value pairs."]
3518    #[serde(default, skip_serializing_if = "Option::is_none")]
3519    pub tags: Option<serde_json::Value>,
3520}
3521impl SecretUpdateParameters {
3522    pub fn new() -> Self {
3523        Self::default()
3524    }
3525}
3526#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
3527pub struct SecurityDomainJsonWebKey {
3528    #[doc = "Key identifier."]
3529    pub kid: String,
3530    #[doc = "JsonWebKey Key Type (kty), as defined in https://tools.ietf.org/html/draft-ietf-jose-json-web-algorithms-40. For Security Domain this value must be RSA."]
3531    pub kty: String,
3532    pub key_ops: Vec<String>,
3533    #[doc = "RSA modulus."]
3534    pub n: String,
3535    #[doc = "RSA public exponent."]
3536    pub e: String,
3537    #[doc = "X509 certificate chain parameter"]
3538    pub x5c: Vec<String>,
3539    #[doc = "Public Key Use Parameter. This is optional and if present must be enc."]
3540    #[serde(rename = "use", default, skip_serializing_if = "Option::is_none")]
3541    pub use_: Option<String>,
3542    #[doc = "X509 certificate SHA1 thumbprint. This is optional."]
3543    #[serde(default, skip_serializing_if = "Option::is_none")]
3544    pub x5t: Option<String>,
3545    #[doc = "X509 certificate SHA256 thumbprint."]
3546    #[serde(rename = "x5t#S256")]
3547    pub x5t_s256: String,
3548    #[doc = "Algorithm intended for use with the key."]
3549    pub alg: String,
3550}
3551impl SecurityDomainJsonWebKey {
3552    pub fn new(
3553        kid: String,
3554        kty: String,
3555        key_ops: Vec<String>,
3556        n: String,
3557        e: String,
3558        x5c: Vec<String>,
3559        x5t_s256: String,
3560        alg: String,
3561    ) -> Self {
3562        Self {
3563            kid,
3564            kty,
3565            key_ops,
3566            n,
3567            e,
3568            x5c,
3569            use_: None,
3570            x5t: None,
3571            x5t_s256,
3572            alg,
3573        }
3574    }
3575}
3576#[doc = "The Security Domain."]
3577#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
3578pub struct SecurityDomainObject {
3579    #[doc = "The Security Domain."]
3580    pub value: String,
3581}
3582impl SecurityDomainObject {
3583    pub fn new(value: String) -> Self {
3584        Self { value }
3585    }
3586}
3587#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
3588pub struct SecurityDomainOperationStatus {
3589    #[doc = "operation status"]
3590    #[serde(default, skip_serializing_if = "Option::is_none")]
3591    pub status: Option<security_domain_operation_status::Status>,
3592    #[serde(default, skip_serializing_if = "Option::is_none")]
3593    pub status_details: Option<String>,
3594}
3595impl SecurityDomainOperationStatus {
3596    pub fn new() -> Self {
3597        Self::default()
3598    }
3599}
3600pub mod security_domain_operation_status {
3601    use super::*;
3602    #[doc = "operation status"]
3603    #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
3604    pub enum Status {
3605        Success,
3606        InProgress,
3607        Failed,
3608    }
3609}
3610#[doc = "Selective Key Restore operation"]
3611#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
3612pub struct SelectiveKeyRestoreOperation {
3613    #[doc = "Status of the restore operation."]
3614    #[serde(default, skip_serializing_if = "Option::is_none")]
3615    pub status: Option<String>,
3616    #[doc = "The status details of restore operation."]
3617    #[serde(rename = "statusDetails", default, skip_serializing_if = "Option::is_none")]
3618    pub status_details: Option<String>,
3619    #[doc = "The key vault server error."]
3620    #[serde(default, skip_serializing_if = "Option::is_none")]
3621    pub error: Option<Error>,
3622    #[doc = "Identifier for the selective key restore operation."]
3623    #[serde(rename = "jobId", default, skip_serializing_if = "Option::is_none")]
3624    pub job_id: Option<String>,
3625    #[doc = "The start time of the restore operation"]
3626    #[serde(rename = "startTime", default, skip_serializing_if = "Option::is_none")]
3627    pub start_time: Option<i64>,
3628    #[doc = "The end time of the restore operation"]
3629    #[serde(rename = "endTime", default, skip_serializing_if = "Option::is_none")]
3630    pub end_time: Option<i64>,
3631}
3632impl SelectiveKeyRestoreOperation {
3633    pub fn new() -> Self {
3634        Self::default()
3635    }
3636}
3637#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
3638pub struct SelectiveKeyRestoreOperationParameters {
3639    #[serde(rename = "sasTokenParameters")]
3640    pub sas_token_parameters: SasTokenParameter,
3641    #[doc = "The Folder name of the blob where the previous successful full backup was stored"]
3642    pub folder: String,
3643}
3644impl SelectiveKeyRestoreOperationParameters {
3645    pub fn new(sas_token_parameters: SasTokenParameter, folder: String) -> Self {
3646        Self {
3647            sas_token_parameters,
3648            folder,
3649        }
3650    }
3651}
3652#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
3653pub struct Setting {
3654    #[doc = "The account setting to be updated"]
3655    pub name: String,
3656    #[doc = "The value of the pool setting."]
3657    pub value: String,
3658    #[doc = "The type specifier of the value."]
3659    #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
3660    pub type_: Option<setting::Type>,
3661}
3662impl Setting {
3663    pub fn new(name: String, value: String) -> Self {
3664        Self { name, value, type_: None }
3665    }
3666}
3667pub mod setting {
3668    use super::*;
3669    #[doc = "The type specifier of the value."]
3670    #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
3671    #[serde(remote = "Type")]
3672    pub enum Type {
3673        #[serde(rename = "boolean")]
3674        Boolean,
3675        #[serde(skip_deserializing)]
3676        UnknownValue(String),
3677    }
3678    impl FromStr for Type {
3679        type Err = value::Error;
3680        fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
3681            Self::deserialize(s.into_deserializer())
3682        }
3683    }
3684    impl<'de> Deserialize<'de> for Type {
3685        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3686        where
3687            D: Deserializer<'de>,
3688        {
3689            let s = String::deserialize(deserializer)?;
3690            let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s));
3691            Ok(deserialized)
3692        }
3693    }
3694    impl Serialize for Type {
3695        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3696        where
3697            S: Serializer,
3698        {
3699            match self {
3700                Self::Boolean => serializer.serialize_unit_variant("Type", 0u32, "boolean"),
3701                Self::UnknownValue(s) => serializer.serialize_str(s.as_str()),
3702            }
3703        }
3704    }
3705}
3706#[doc = "The settings list result."]
3707#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
3708pub struct SettingsListResult {
3709    #[doc = "A response message containing a list of account settings with their associated value."]
3710    #[serde(
3711        default,
3712        deserialize_with = "azure_core::util::deserialize_null_as_default",
3713        skip_serializing_if = "Vec::is_empty"
3714    )]
3715    pub settings: Vec<Setting>,
3716}
3717impl SettingsListResult {
3718    pub fn new() -> Self {
3719        Self::default()
3720    }
3721}
3722#[doc = "The storage account management attributes."]
3723#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
3724pub struct StorageAccountAttributes {
3725    #[doc = "the enabled state of the object."]
3726    #[serde(default, skip_serializing_if = "Option::is_none")]
3727    pub enabled: Option<bool>,
3728    #[doc = "Creation time in UTC."]
3729    #[serde(default, skip_serializing_if = "Option::is_none")]
3730    pub created: Option<i64>,
3731    #[doc = "Last updated time in UTC."]
3732    #[serde(default, skip_serializing_if = "Option::is_none")]
3733    pub updated: Option<i64>,
3734    #[doc = "softDelete data retention days. Value should be >=7 and <=90 when softDelete enabled, otherwise 0."]
3735    #[serde(rename = "recoverableDays", default, skip_serializing_if = "Option::is_none")]
3736    pub recoverable_days: Option<i32>,
3737    #[doc = "Reflects the deletion recovery level currently in effect for storage accounts in the current vault. If it contains 'Purgeable' the storage account can be permanently deleted by a privileged user; otherwise, only the system can purge the storage account, at the end of the retention interval."]
3738    #[serde(rename = "recoveryLevel", default, skip_serializing_if = "Option::is_none")]
3739    pub recovery_level: Option<storage_account_attributes::RecoveryLevel>,
3740}
3741impl StorageAccountAttributes {
3742    pub fn new() -> Self {
3743        Self::default()
3744    }
3745}
3746pub mod storage_account_attributes {
3747    use super::*;
3748    #[doc = "Reflects the deletion recovery level currently in effect for storage accounts in the current vault. If it contains 'Purgeable' the storage account can be permanently deleted by a privileged user; otherwise, only the system can purge the storage account, at the end of the retention interval."]
3749    #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
3750    #[serde(remote = "RecoveryLevel")]
3751    pub enum RecoveryLevel {
3752        Purgeable,
3753        #[serde(rename = "Recoverable+Purgeable")]
3754        RecoverablePurgeable,
3755        Recoverable,
3756        #[serde(rename = "Recoverable+ProtectedSubscription")]
3757        RecoverableProtectedSubscription,
3758        #[serde(rename = "CustomizedRecoverable+Purgeable")]
3759        CustomizedRecoverablePurgeable,
3760        CustomizedRecoverable,
3761        #[serde(rename = "CustomizedRecoverable+ProtectedSubscription")]
3762        CustomizedRecoverableProtectedSubscription,
3763        #[serde(skip_deserializing)]
3764        UnknownValue(String),
3765    }
3766    impl FromStr for RecoveryLevel {
3767        type Err = value::Error;
3768        fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
3769            Self::deserialize(s.into_deserializer())
3770        }
3771    }
3772    impl<'de> Deserialize<'de> for RecoveryLevel {
3773        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3774        where
3775            D: Deserializer<'de>,
3776        {
3777            let s = String::deserialize(deserializer)?;
3778            let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s));
3779            Ok(deserialized)
3780        }
3781    }
3782    impl Serialize for RecoveryLevel {
3783        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3784        where
3785            S: Serializer,
3786        {
3787            match self {
3788                Self::Purgeable => serializer.serialize_unit_variant("RecoveryLevel", 0u32, "Purgeable"),
3789                Self::RecoverablePurgeable => serializer.serialize_unit_variant("RecoveryLevel", 1u32, "Recoverable+Purgeable"),
3790                Self::Recoverable => serializer.serialize_unit_variant("RecoveryLevel", 2u32, "Recoverable"),
3791                Self::RecoverableProtectedSubscription => {
3792                    serializer.serialize_unit_variant("RecoveryLevel", 3u32, "Recoverable+ProtectedSubscription")
3793                }
3794                Self::CustomizedRecoverablePurgeable => {
3795                    serializer.serialize_unit_variant("RecoveryLevel", 4u32, "CustomizedRecoverable+Purgeable")
3796                }
3797                Self::CustomizedRecoverable => serializer.serialize_unit_variant("RecoveryLevel", 5u32, "CustomizedRecoverable"),
3798                Self::CustomizedRecoverableProtectedSubscription => {
3799                    serializer.serialize_unit_variant("RecoveryLevel", 6u32, "CustomizedRecoverable+ProtectedSubscription")
3800                }
3801                Self::UnknownValue(s) => serializer.serialize_str(s.as_str()),
3802            }
3803        }
3804    }
3805}
3806#[doc = "The storage account create parameters."]
3807#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
3808pub struct StorageAccountCreateParameters {
3809    #[doc = "Storage account resource id."]
3810    #[serde(rename = "resourceId")]
3811    pub resource_id: String,
3812    #[doc = "Current active storage account key name."]
3813    #[serde(rename = "activeKeyName")]
3814    pub active_key_name: String,
3815    #[doc = "whether keyvault should manage the storage account for the user."]
3816    #[serde(rename = "autoRegenerateKey")]
3817    pub auto_regenerate_key: bool,
3818    #[doc = "The key regeneration time duration specified in ISO-8601 format."]
3819    #[serde(rename = "regenerationPeriod", default, skip_serializing_if = "Option::is_none")]
3820    pub regeneration_period: Option<String>,
3821    #[doc = "The storage account management attributes."]
3822    #[serde(default, skip_serializing_if = "Option::is_none")]
3823    pub attributes: Option<StorageAccountAttributes>,
3824    #[doc = "Application specific metadata in the form of key-value pairs."]
3825    #[serde(default, skip_serializing_if = "Option::is_none")]
3826    pub tags: Option<serde_json::Value>,
3827}
3828impl StorageAccountCreateParameters {
3829    pub fn new(resource_id: String, active_key_name: String, auto_regenerate_key: bool) -> Self {
3830        Self {
3831            resource_id,
3832            active_key_name,
3833            auto_regenerate_key,
3834            regeneration_period: None,
3835            attributes: None,
3836            tags: None,
3837        }
3838    }
3839}
3840#[doc = "The storage account item containing storage account metadata."]
3841#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
3842pub struct StorageAccountItem {
3843    #[doc = "Storage identifier."]
3844    #[serde(default, skip_serializing_if = "Option::is_none")]
3845    pub id: Option<String>,
3846    #[doc = "Storage account resource Id."]
3847    #[serde(rename = "resourceId", default, skip_serializing_if = "Option::is_none")]
3848    pub resource_id: Option<String>,
3849    #[doc = "The storage account management attributes."]
3850    #[serde(default, skip_serializing_if = "Option::is_none")]
3851    pub attributes: Option<StorageAccountAttributes>,
3852    #[doc = "Application specific metadata in the form of key-value pairs."]
3853    #[serde(default, skip_serializing_if = "Option::is_none")]
3854    pub tags: Option<serde_json::Value>,
3855}
3856impl StorageAccountItem {
3857    pub fn new() -> Self {
3858        Self::default()
3859    }
3860}
3861#[doc = "The storage account key regenerate parameters."]
3862#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
3863pub struct StorageAccountRegenerteKeyParameters {
3864    #[doc = "The storage account key name."]
3865    #[serde(rename = "keyName")]
3866    pub key_name: String,
3867}
3868impl StorageAccountRegenerteKeyParameters {
3869    pub fn new(key_name: String) -> Self {
3870        Self { key_name }
3871    }
3872}
3873#[doc = "The storage account update parameters."]
3874#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
3875pub struct StorageAccountUpdateParameters {
3876    #[doc = "The current active storage account key name."]
3877    #[serde(rename = "activeKeyName", default, skip_serializing_if = "Option::is_none")]
3878    pub active_key_name: Option<String>,
3879    #[doc = "whether keyvault should manage the storage account for the user."]
3880    #[serde(rename = "autoRegenerateKey", default, skip_serializing_if = "Option::is_none")]
3881    pub auto_regenerate_key: Option<bool>,
3882    #[doc = "The key regeneration time duration specified in ISO-8601 format."]
3883    #[serde(rename = "regenerationPeriod", default, skip_serializing_if = "Option::is_none")]
3884    pub regeneration_period: Option<String>,
3885    #[doc = "The storage account management attributes."]
3886    #[serde(default, skip_serializing_if = "Option::is_none")]
3887    pub attributes: Option<StorageAccountAttributes>,
3888    #[doc = "Application specific metadata in the form of key-value pairs."]
3889    #[serde(default, skip_serializing_if = "Option::is_none")]
3890    pub tags: Option<serde_json::Value>,
3891}
3892impl StorageAccountUpdateParameters {
3893    pub fn new() -> Self {
3894        Self::default()
3895    }
3896}
3897#[doc = "A Storage account bundle consists of key vault storage account details plus its attributes."]
3898#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
3899pub struct StorageBundle {
3900    #[doc = "The storage account id."]
3901    #[serde(default, skip_serializing_if = "Option::is_none")]
3902    pub id: Option<String>,
3903    #[doc = "The storage account resource id."]
3904    #[serde(rename = "resourceId", default, skip_serializing_if = "Option::is_none")]
3905    pub resource_id: Option<String>,
3906    #[doc = "The current active storage account key name."]
3907    #[serde(rename = "activeKeyName", default, skip_serializing_if = "Option::is_none")]
3908    pub active_key_name: Option<String>,
3909    #[doc = "whether keyvault should manage the storage account for the user."]
3910    #[serde(rename = "autoRegenerateKey", default, skip_serializing_if = "Option::is_none")]
3911    pub auto_regenerate_key: Option<bool>,
3912    #[doc = "The key regeneration time duration specified in ISO-8601 format."]
3913    #[serde(rename = "regenerationPeriod", default, skip_serializing_if = "Option::is_none")]
3914    pub regeneration_period: Option<String>,
3915    #[doc = "The storage account management attributes."]
3916    #[serde(default, skip_serializing_if = "Option::is_none")]
3917    pub attributes: Option<StorageAccountAttributes>,
3918    #[doc = "Application specific metadata in the form of key-value pairs"]
3919    #[serde(default, skip_serializing_if = "Option::is_none")]
3920    pub tags: Option<serde_json::Value>,
3921}
3922impl StorageBundle {
3923    pub fn new() -> Self {
3924        Self::default()
3925    }
3926}
3927#[doc = "The storage accounts list result."]
3928#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
3929pub struct StorageListResult {
3930    #[doc = "A response message containing a list of storage accounts in the key vault along with a link to the next page of storage accounts."]
3931    #[serde(
3932        default,
3933        deserialize_with = "azure_core::util::deserialize_null_as_default",
3934        skip_serializing_if = "Vec::is_empty"
3935    )]
3936    pub value: Vec<StorageAccountItem>,
3937    #[doc = "The URL to get the next set of storage accounts."]
3938    #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")]
3939    pub next_link: Option<String>,
3940}
3941impl azure_core::Continuable for StorageListResult {
3942    type Continuation = String;
3943    fn continuation(&self) -> Option<Self::Continuation> {
3944        self.next_link.clone().filter(|value| !value.is_empty())
3945    }
3946}
3947impl StorageListResult {
3948    pub fn new() -> Self {
3949        Self::default()
3950    }
3951}
3952#[doc = "The secret restore parameters."]
3953#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
3954pub struct StorageRestoreParameters {
3955    #[doc = "The backup blob associated with a storage account."]
3956    pub value: String,
3957}
3958impl StorageRestoreParameters {
3959    pub fn new(value: String) -> Self {
3960        Self { value }
3961    }
3962}
3963#[doc = "The subject alternate names of a X509 object."]
3964#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
3965pub struct SubjectAlternativeNames {
3966    #[doc = "Email addresses."]
3967    #[serde(
3968        default,
3969        deserialize_with = "azure_core::util::deserialize_null_as_default",
3970        skip_serializing_if = "Vec::is_empty"
3971    )]
3972    pub emails: Vec<String>,
3973    #[doc = "Domain names."]
3974    #[serde(
3975        default,
3976        deserialize_with = "azure_core::util::deserialize_null_as_default",
3977        skip_serializing_if = "Vec::is_empty"
3978    )]
3979    pub dns_names: Vec<String>,
3980    #[doc = "User principal names."]
3981    #[serde(
3982        default,
3983        deserialize_with = "azure_core::util::deserialize_null_as_default",
3984        skip_serializing_if = "Vec::is_empty"
3985    )]
3986    pub upns: Vec<String>,
3987}
3988impl SubjectAlternativeNames {
3989    pub fn new() -> Self {
3990        Self::default()
3991    }
3992}
3993#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
3994pub struct TransferKey {
3995    #[doc = "Specifies the format of the transfer key"]
3996    #[serde(default, skip_serializing_if = "Option::is_none")]
3997    pub key_format: Option<String>,
3998    pub transfer_key: SecurityDomainJsonWebKey,
3999}
4000impl TransferKey {
4001    pub fn new(transfer_key: SecurityDomainJsonWebKey) -> Self {
4002        Self {
4003            key_format: None,
4004            transfer_key,
4005        }
4006    }
4007}
4008#[doc = "A condition to be satisfied for an action to be executed."]
4009#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
4010pub struct Trigger {
4011    #[doc = "Percentage of lifetime at which to trigger. Value should be between 1 and 99."]
4012    #[serde(default, skip_serializing_if = "Option::is_none")]
4013    pub lifetime_percentage: Option<i32>,
4014    #[doc = "Days before expiry to attempt renewal. Value should be between 1 and validity_in_months multiplied by 27. If validity_in_months is 36, then value should be between 1 and 972 (36 * 27)."]
4015    #[serde(default, skip_serializing_if = "Option::is_none")]
4016    pub days_before_expiry: Option<i32>,
4017}
4018impl Trigger {
4019    pub fn new() -> Self {
4020        Self::default()
4021    }
4022}
4023#[doc = "The update settings request object."]
4024#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
4025pub struct UpdateSettingRequest {
4026    #[doc = "The value of the pool setting."]
4027    pub value: String,
4028}
4029impl UpdateSettingRequest {
4030    pub fn new(value: String) -> Self {
4031        Self { value }
4032    }
4033}
4034#[doc = "Properties of the X509 component of a certificate."]
4035#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
4036pub struct X509CertificateProperties {
4037    #[doc = "The subject name. Should be a valid X509 distinguished Name."]
4038    #[serde(default, skip_serializing_if = "Option::is_none")]
4039    pub subject: Option<String>,
4040    #[doc = "The enhanced key usage."]
4041    #[serde(
4042        default,
4043        deserialize_with = "azure_core::util::deserialize_null_as_default",
4044        skip_serializing_if = "Vec::is_empty"
4045    )]
4046    pub ekus: Vec<String>,
4047    #[doc = "The subject alternate names of a X509 object."]
4048    #[serde(default, skip_serializing_if = "Option::is_none")]
4049    pub sans: Option<SubjectAlternativeNames>,
4050    #[doc = "Defines how the certificate's key may be used."]
4051    #[serde(
4052        default,
4053        deserialize_with = "azure_core::util::deserialize_null_as_default",
4054        skip_serializing_if = "Vec::is_empty"
4055    )]
4056    pub key_usage: Vec<String>,
4057    #[doc = "The duration that the certificate is valid in months."]
4058    #[serde(default, skip_serializing_if = "Option::is_none")]
4059    pub validity_months: Option<i32>,
4060}
4061impl X509CertificateProperties {
4062    pub fn new() -> Self {
4063        Self::default()
4064    }
4065}