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 array of plan."]
7#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
8pub struct AllowedUpgradePlansResult {
9 #[doc = "The array of plans."]
10 #[serde(
11 default,
12 deserialize_with = "azure_core::util::deserialize_null_as_default",
13 skip_serializing_if = "Vec::is_empty"
14 )]
15 pub value: Vec<Plan>,
16}
17impl AllowedUpgradePlansResult {
18 pub fn new() -> Self {
19 Self::default()
20 }
21}
22#[doc = "Information about managed application."]
23#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
24pub struct Application {
25 #[serde(flatten)]
26 pub generic_resource: GenericResource,
27 #[doc = "The managed application properties."]
28 pub properties: ApplicationProperties,
29 #[doc = "Plan for the managed application."]
30 #[serde(default, skip_serializing_if = "Option::is_none")]
31 pub plan: Option<Plan>,
32 #[doc = "The kind of the managed application. Allowed values are MarketPlace and ServiceCatalog."]
33 pub kind: String,
34 #[doc = "Identity for the resource."]
35 #[serde(default, skip_serializing_if = "Option::is_none")]
36 pub identity: Option<Identity>,
37}
38impl Application {
39 pub fn new(properties: ApplicationProperties, kind: String) -> Self {
40 Self {
41 generic_resource: GenericResource::default(),
42 properties,
43 plan: None,
44 kind,
45 identity: None,
46 }
47 }
48}
49#[doc = "Managed application artifact."]
50#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
51pub struct ApplicationArtifact {
52 #[doc = "The managed application artifact name."]
53 pub name: ApplicationArtifactName,
54 #[doc = "The managed application artifact blob uri."]
55 pub uri: String,
56 #[doc = "The managed application artifact type."]
57 #[serde(rename = "type")]
58 pub type_: ApplicationArtifactType,
59}
60impl ApplicationArtifact {
61 pub fn new(name: ApplicationArtifactName, uri: String, type_: ApplicationArtifactType) -> Self {
62 Self { name, uri, type_ }
63 }
64}
65#[doc = "The managed application artifact name."]
66#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
67#[serde(remote = "ApplicationArtifactName")]
68pub enum ApplicationArtifactName {
69 NotSpecified,
70 ViewDefinition,
71 Authorizations,
72 CustomRoleDefinition,
73 #[serde(skip_deserializing)]
74 UnknownValue(String),
75}
76impl FromStr for ApplicationArtifactName {
77 type Err = value::Error;
78 fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
79 Self::deserialize(s.into_deserializer())
80 }
81}
82impl<'de> Deserialize<'de> for ApplicationArtifactName {
83 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
84 where
85 D: Deserializer<'de>,
86 {
87 let s = String::deserialize(deserializer)?;
88 let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s));
89 Ok(deserialized)
90 }
91}
92impl Serialize for ApplicationArtifactName {
93 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
94 where
95 S: Serializer,
96 {
97 match self {
98 Self::NotSpecified => serializer.serialize_unit_variant("ApplicationArtifactName", 0u32, "NotSpecified"),
99 Self::ViewDefinition => serializer.serialize_unit_variant("ApplicationArtifactName", 1u32, "ViewDefinition"),
100 Self::Authorizations => serializer.serialize_unit_variant("ApplicationArtifactName", 2u32, "Authorizations"),
101 Self::CustomRoleDefinition => serializer.serialize_unit_variant("ApplicationArtifactName", 3u32, "CustomRoleDefinition"),
102 Self::UnknownValue(s) => serializer.serialize_str(s.as_str()),
103 }
104 }
105}
106#[doc = "The managed application artifact type."]
107#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
108pub enum ApplicationArtifactType {
109 NotSpecified,
110 Template,
111 Custom,
112}
113#[doc = "The managed application provider authorization."]
114#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
115pub struct ApplicationAuthorization {
116 #[doc = "The provider's principal identifier. This is the identity that the provider will use to call ARM to manage the managed application resources."]
117 #[serde(rename = "principalId")]
118 pub principal_id: String,
119 #[doc = "The provider's role definition identifier. This role will define all the permissions that the provider must have on the managed application's container resource group. This role definition cannot have permission to delete the resource group."]
120 #[serde(rename = "roleDefinitionId")]
121 pub role_definition_id: String,
122}
123impl ApplicationAuthorization {
124 pub fn new(principal_id: String, role_definition_id: String) -> Self {
125 Self {
126 principal_id,
127 role_definition_id,
128 }
129 }
130}
131#[doc = "Managed application billing details definition."]
132#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
133pub struct ApplicationBillingDetailsDefinition {
134 #[doc = "The managed application resource usage Id."]
135 #[serde(rename = "resourceUsageId", default, skip_serializing_if = "Option::is_none")]
136 pub resource_usage_id: Option<String>,
137}
138impl ApplicationBillingDetailsDefinition {
139 pub fn new() -> Self {
140 Self::default()
141 }
142}
143#[doc = "The application client details to track the entity creating/updating the managed app resource."]
144#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
145pub struct ApplicationClientDetails {
146 #[doc = "The client Oid."]
147 #[serde(default, skip_serializing_if = "Option::is_none")]
148 pub oid: Option<String>,
149 #[doc = "The client Puid"]
150 #[serde(default, skip_serializing_if = "Option::is_none")]
151 pub puid: Option<String>,
152 #[doc = "The client application Id."]
153 #[serde(rename = "applicationId", default, skip_serializing_if = "Option::is_none")]
154 pub application_id: Option<String>,
155}
156impl ApplicationClientDetails {
157 pub fn new() -> Self {
158 Self::default()
159 }
160}
161#[doc = "Information about managed application definition."]
162#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
163pub struct ApplicationDefinition {
164 #[serde(flatten)]
165 pub generic_resource: GenericResource,
166 #[doc = "The managed application definition properties."]
167 pub properties: ApplicationDefinitionProperties,
168}
169impl ApplicationDefinition {
170 pub fn new(properties: ApplicationDefinitionProperties) -> Self {
171 Self {
172 generic_resource: GenericResource::default(),
173 properties,
174 }
175 }
176}
177#[doc = "Application definition artifact."]
178#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
179pub struct ApplicationDefinitionArtifact {
180 #[doc = "The managed application artifact name."]
181 pub name: ApplicationDefinitionArtifactName,
182 #[doc = "The managed application definition artifact blob uri."]
183 pub uri: String,
184 #[doc = "The managed application artifact type."]
185 #[serde(rename = "type")]
186 pub type_: ApplicationArtifactType,
187}
188impl ApplicationDefinitionArtifact {
189 pub fn new(name: ApplicationDefinitionArtifactName, uri: String, type_: ApplicationArtifactType) -> Self {
190 Self { name, uri, type_ }
191 }
192}
193#[doc = "The managed application artifact name."]
194#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
195#[serde(remote = "ApplicationDefinitionArtifactName")]
196pub enum ApplicationDefinitionArtifactName {
197 NotSpecified,
198 ApplicationResourceTemplate,
199 CreateUiDefinition,
200 MainTemplateParameters,
201 #[serde(skip_deserializing)]
202 UnknownValue(String),
203}
204impl FromStr for ApplicationDefinitionArtifactName {
205 type Err = value::Error;
206 fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
207 Self::deserialize(s.into_deserializer())
208 }
209}
210impl<'de> Deserialize<'de> for ApplicationDefinitionArtifactName {
211 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
212 where
213 D: Deserializer<'de>,
214 {
215 let s = String::deserialize(deserializer)?;
216 let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s));
217 Ok(deserialized)
218 }
219}
220impl Serialize for ApplicationDefinitionArtifactName {
221 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
222 where
223 S: Serializer,
224 {
225 match self {
226 Self::NotSpecified => serializer.serialize_unit_variant("ApplicationDefinitionArtifactName", 0u32, "NotSpecified"),
227 Self::ApplicationResourceTemplate => {
228 serializer.serialize_unit_variant("ApplicationDefinitionArtifactName", 1u32, "ApplicationResourceTemplate")
229 }
230 Self::CreateUiDefinition => serializer.serialize_unit_variant("ApplicationDefinitionArtifactName", 2u32, "CreateUiDefinition"),
231 Self::MainTemplateParameters => {
232 serializer.serialize_unit_variant("ApplicationDefinitionArtifactName", 3u32, "MainTemplateParameters")
233 }
234 Self::UnknownValue(s) => serializer.serialize_str(s.as_str()),
235 }
236 }
237}
238#[doc = "List of managed application definitions."]
239#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
240pub struct ApplicationDefinitionListResult {
241 #[doc = "The array of managed application definitions."]
242 #[serde(
243 default,
244 deserialize_with = "azure_core::util::deserialize_null_as_default",
245 skip_serializing_if = "Vec::is_empty"
246 )]
247 pub value: Vec<ApplicationDefinition>,
248 #[doc = "The URL to use for getting the next set of results."]
249 #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")]
250 pub next_link: Option<String>,
251}
252impl azure_core::Continuable for ApplicationDefinitionListResult {
253 type Continuation = String;
254 fn continuation(&self) -> Option<Self::Continuation> {
255 self.next_link.clone().filter(|value| !value.is_empty())
256 }
257}
258impl ApplicationDefinitionListResult {
259 pub fn new() -> Self {
260 Self::default()
261 }
262}
263#[doc = "Information about an application definition request."]
264#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
265pub struct ApplicationDefinitionPatchable {
266 #[doc = "Application definition tags"]
267 #[serde(default, skip_serializing_if = "Option::is_none")]
268 pub tags: Option<serde_json::Value>,
269}
270impl ApplicationDefinitionPatchable {
271 pub fn new() -> Self {
272 Self::default()
273 }
274}
275#[doc = "The managed application definition properties."]
276#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
277pub struct ApplicationDefinitionProperties {
278 #[doc = "The managed application lock level."]
279 #[serde(rename = "lockLevel")]
280 pub lock_level: ApplicationLockLevel,
281 #[doc = "The managed application definition display name."]
282 #[serde(rename = "displayName", default, skip_serializing_if = "Option::is_none")]
283 pub display_name: Option<String>,
284 #[doc = "A value indicating whether the package is enabled or not."]
285 #[serde(rename = "isEnabled", default, skip_serializing_if = "Option::is_none")]
286 pub is_enabled: Option<bool>,
287 #[doc = "The managed application provider authorizations."]
288 #[serde(
289 default,
290 deserialize_with = "azure_core::util::deserialize_null_as_default",
291 skip_serializing_if = "Vec::is_empty"
292 )]
293 pub authorizations: Vec<ApplicationAuthorization>,
294 #[doc = "The collection of managed application artifacts. The portal will use the files specified as artifacts to construct the user experience of creating a managed application from a managed application definition."]
295 #[serde(
296 default,
297 deserialize_with = "azure_core::util::deserialize_null_as_default",
298 skip_serializing_if = "Vec::is_empty"
299 )]
300 pub artifacts: Vec<ApplicationDefinitionArtifact>,
301 #[doc = "The managed application definition description."]
302 #[serde(default, skip_serializing_if = "Option::is_none")]
303 pub description: Option<String>,
304 #[doc = "The managed application definition package file Uri. Use this element"]
305 #[serde(rename = "packageFileUri", default, skip_serializing_if = "Option::is_none")]
306 pub package_file_uri: Option<String>,
307 #[doc = "The storage account id for bring your own storage scenario."]
308 #[serde(rename = "storageAccountId", default, skip_serializing_if = "Option::is_none")]
309 pub storage_account_id: Option<String>,
310 #[doc = "The inline main template json which has resources to be provisioned. It can be a JObject or well-formed JSON string."]
311 #[serde(rename = "mainTemplate", default, skip_serializing_if = "Option::is_none")]
312 pub main_template: Option<serde_json::Value>,
313 #[doc = "The createUiDefinition json for the backing template with Microsoft.Solutions/applications resource. It can be a JObject or well-formed JSON string."]
314 #[serde(rename = "createUiDefinition", default, skip_serializing_if = "Option::is_none")]
315 pub create_ui_definition: Option<serde_json::Value>,
316 #[doc = "Managed application notification policy."]
317 #[serde(rename = "notificationPolicy", default, skip_serializing_if = "Option::is_none")]
318 pub notification_policy: Option<ApplicationNotificationPolicy>,
319 #[doc = "Managed application locking policy."]
320 #[serde(rename = "lockingPolicy", default, skip_serializing_if = "Option::is_none")]
321 pub locking_policy: Option<ApplicationPackageLockingPolicyDefinition>,
322 #[doc = "Managed application deployment policy."]
323 #[serde(rename = "deploymentPolicy", default, skip_serializing_if = "Option::is_none")]
324 pub deployment_policy: Option<ApplicationDeploymentPolicy>,
325 #[doc = "Managed application management policy."]
326 #[serde(rename = "managementPolicy", default, skip_serializing_if = "Option::is_none")]
327 pub management_policy: Option<ApplicationManagementPolicy>,
328 #[doc = "The managed application provider policies."]
329 #[serde(
330 default,
331 deserialize_with = "azure_core::util::deserialize_null_as_default",
332 skip_serializing_if = "Vec::is_empty"
333 )]
334 pub policies: Vec<ApplicationPolicy>,
335}
336impl ApplicationDefinitionProperties {
337 pub fn new(lock_level: ApplicationLockLevel) -> Self {
338 Self {
339 lock_level,
340 display_name: None,
341 is_enabled: None,
342 authorizations: Vec::new(),
343 artifacts: Vec::new(),
344 description: None,
345 package_file_uri: None,
346 storage_account_id: None,
347 main_template: None,
348 create_ui_definition: None,
349 notification_policy: None,
350 locking_policy: None,
351 deployment_policy: None,
352 management_policy: None,
353 policies: Vec::new(),
354 }
355 }
356}
357#[doc = "Managed application deployment policy."]
358#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
359pub struct ApplicationDeploymentPolicy {
360 #[doc = "The deployment mode."]
361 #[serde(rename = "deploymentMode")]
362 pub deployment_mode: DeploymentMode,
363}
364impl ApplicationDeploymentPolicy {
365 pub fn new(deployment_mode: DeploymentMode) -> Self {
366 Self { deployment_mode }
367 }
368}
369#[doc = "Managed application Jit access policy."]
370#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
371pub struct ApplicationJitAccessPolicy {
372 #[doc = "Whether the JIT access is enabled."]
373 #[serde(rename = "jitAccessEnabled")]
374 pub jit_access_enabled: bool,
375 #[doc = "The Jit approval mode."]
376 #[serde(rename = "jitApprovalMode", default, skip_serializing_if = "Option::is_none")]
377 pub jit_approval_mode: Option<JitApprovalMode>,
378 #[doc = "The JIT approvers"]
379 #[serde(
380 rename = "jitApprovers",
381 default,
382 deserialize_with = "azure_core::util::deserialize_null_as_default",
383 skip_serializing_if = "Vec::is_empty"
384 )]
385 pub jit_approvers: Vec<JitApproverDefinition>,
386 #[doc = "The maximum duration JIT access is granted. This is an ISO8601 time period value."]
387 #[serde(rename = "maximumJitAccessDuration", default, skip_serializing_if = "Option::is_none")]
388 pub maximum_jit_access_duration: Option<String>,
389}
390impl ApplicationJitAccessPolicy {
391 pub fn new(jit_access_enabled: bool) -> Self {
392 Self {
393 jit_access_enabled,
394 jit_approval_mode: None,
395 jit_approvers: Vec::new(),
396 maximum_jit_access_duration: None,
397 }
398 }
399}
400#[doc = "List of managed applications."]
401#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
402pub struct ApplicationListResult {
403 #[doc = "The array of managed applications."]
404 #[serde(
405 default,
406 deserialize_with = "azure_core::util::deserialize_null_as_default",
407 skip_serializing_if = "Vec::is_empty"
408 )]
409 pub value: Vec<Application>,
410 #[doc = "The URL to use for getting the next set of results."]
411 #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")]
412 pub next_link: Option<String>,
413}
414impl azure_core::Continuable for ApplicationListResult {
415 type Continuation = String;
416 fn continuation(&self) -> Option<Self::Continuation> {
417 self.next_link.clone().filter(|value| !value.is_empty())
418 }
419}
420impl ApplicationListResult {
421 pub fn new() -> Self {
422 Self::default()
423 }
424}
425#[doc = "The managed application lock level."]
426#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
427pub enum ApplicationLockLevel {
428 CanNotDelete,
429 ReadOnly,
430 None,
431}
432#[doc = "The management mode."]
433#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
434#[serde(remote = "ApplicationManagementMode")]
435pub enum ApplicationManagementMode {
436 NotSpecified,
437 Unmanaged,
438 Managed,
439 #[serde(skip_deserializing)]
440 UnknownValue(String),
441}
442impl FromStr for ApplicationManagementMode {
443 type Err = value::Error;
444 fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
445 Self::deserialize(s.into_deserializer())
446 }
447}
448impl<'de> Deserialize<'de> for ApplicationManagementMode {
449 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
450 where
451 D: Deserializer<'de>,
452 {
453 let s = String::deserialize(deserializer)?;
454 let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s));
455 Ok(deserialized)
456 }
457}
458impl Serialize for ApplicationManagementMode {
459 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
460 where
461 S: Serializer,
462 {
463 match self {
464 Self::NotSpecified => serializer.serialize_unit_variant("ApplicationManagementMode", 0u32, "NotSpecified"),
465 Self::Unmanaged => serializer.serialize_unit_variant("ApplicationManagementMode", 1u32, "Unmanaged"),
466 Self::Managed => serializer.serialize_unit_variant("ApplicationManagementMode", 2u32, "Managed"),
467 Self::UnknownValue(s) => serializer.serialize_str(s.as_str()),
468 }
469 }
470}
471#[doc = "Managed application management policy."]
472#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
473pub struct ApplicationManagementPolicy {
474 #[doc = "The management mode."]
475 #[serde(default, skip_serializing_if = "Option::is_none")]
476 pub mode: Option<ApplicationManagementMode>,
477}
478impl ApplicationManagementPolicy {
479 pub fn new() -> Self {
480 Self::default()
481 }
482}
483#[doc = "Managed application notification endpoint."]
484#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
485pub struct ApplicationNotificationEndpoint {
486 #[doc = "The managed application notification endpoint uri."]
487 pub uri: String,
488}
489impl ApplicationNotificationEndpoint {
490 pub fn new(uri: String) -> Self {
491 Self { uri }
492 }
493}
494#[doc = "Managed application notification policy."]
495#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
496pub struct ApplicationNotificationPolicy {
497 #[doc = "The managed application notification endpoint."]
498 #[serde(rename = "notificationEndpoints")]
499 pub notification_endpoints: Vec<ApplicationNotificationEndpoint>,
500}
501impl ApplicationNotificationPolicy {
502 pub fn new(notification_endpoints: Vec<ApplicationNotificationEndpoint>) -> Self {
503 Self { notification_endpoints }
504 }
505}
506#[doc = "The application package contact information."]
507#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
508pub struct ApplicationPackageContact {
509 #[doc = "The contact name."]
510 #[serde(rename = "contactName", default, skip_serializing_if = "Option::is_none")]
511 pub contact_name: Option<String>,
512 #[doc = "The contact email."]
513 pub email: String,
514 #[doc = "The contact phone number."]
515 pub phone: String,
516}
517impl ApplicationPackageContact {
518 pub fn new(email: String, phone: String) -> Self {
519 Self {
520 contact_name: None,
521 email,
522 phone,
523 }
524 }
525}
526#[doc = "Managed application locking policy."]
527#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
528pub struct ApplicationPackageLockingPolicyDefinition {
529 #[doc = "The deny assignment excluded actions."]
530 #[serde(
531 rename = "allowedActions",
532 default,
533 deserialize_with = "azure_core::util::deserialize_null_as_default",
534 skip_serializing_if = "Vec::is_empty"
535 )]
536 pub allowed_actions: Vec<String>,
537 #[doc = "The deny assignment excluded data actions."]
538 #[serde(
539 rename = "allowedDataActions",
540 default,
541 deserialize_with = "azure_core::util::deserialize_null_as_default",
542 skip_serializing_if = "Vec::is_empty"
543 )]
544 pub allowed_data_actions: Vec<String>,
545}
546impl ApplicationPackageLockingPolicyDefinition {
547 pub fn new() -> Self {
548 Self::default()
549 }
550}
551#[doc = "The appliance package support URLs."]
552#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
553pub struct ApplicationPackageSupportUrls {
554 #[doc = "The public azure support URL."]
555 #[serde(rename = "publicAzure", default, skip_serializing_if = "Option::is_none")]
556 pub public_azure: Option<String>,
557 #[doc = "The government cloud support URL."]
558 #[serde(rename = "governmentCloud", default, skip_serializing_if = "Option::is_none")]
559 pub government_cloud: Option<String>,
560}
561impl ApplicationPackageSupportUrls {
562 pub fn new() -> Self {
563 Self::default()
564 }
565}
566#[doc = "Information about managed application."]
567#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
568pub struct ApplicationPatchable {
569 #[serde(flatten)]
570 pub generic_resource: GenericResource,
571 #[doc = "The managed application properties."]
572 #[serde(default, skip_serializing_if = "Option::is_none")]
573 pub properties: Option<ApplicationProperties>,
574 #[doc = "Plan for the managed application."]
575 #[serde(default, skip_serializing_if = "Option::is_none")]
576 pub plan: Option<PlanPatchable>,
577 #[doc = "The kind of the managed application. Allowed values are MarketPlace and ServiceCatalog."]
578 #[serde(default, skip_serializing_if = "Option::is_none")]
579 pub kind: Option<String>,
580 #[doc = "Identity for the resource."]
581 #[serde(default, skip_serializing_if = "Option::is_none")]
582 pub identity: Option<Identity>,
583}
584impl ApplicationPatchable {
585 pub fn new() -> Self {
586 Self::default()
587 }
588}
589#[doc = "Managed application policy."]
590#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
591pub struct ApplicationPolicy {
592 #[doc = "The policy name"]
593 #[serde(default, skip_serializing_if = "Option::is_none")]
594 pub name: Option<String>,
595 #[doc = "The policy definition Id."]
596 #[serde(rename = "policyDefinitionId", default, skip_serializing_if = "Option::is_none")]
597 pub policy_definition_id: Option<String>,
598 #[doc = "The policy parameters."]
599 #[serde(default, skip_serializing_if = "Option::is_none")]
600 pub parameters: Option<String>,
601}
602impl ApplicationPolicy {
603 pub fn new() -> Self {
604 Self::default()
605 }
606}
607#[doc = "The managed application properties."]
608#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
609pub struct ApplicationProperties {
610 #[doc = "The managed resource group Id."]
611 #[serde(rename = "managedResourceGroupId", default, skip_serializing_if = "Option::is_none")]
612 pub managed_resource_group_id: Option<String>,
613 #[doc = "The fully qualified path of managed application definition Id."]
614 #[serde(rename = "applicationDefinitionId", default, skip_serializing_if = "Option::is_none")]
615 pub application_definition_id: Option<String>,
616 #[doc = "Name and value pairs that define the managed application parameters. It can be a JObject or a well formed JSON string."]
617 #[serde(default, skip_serializing_if = "Option::is_none")]
618 pub parameters: Option<serde_json::Value>,
619 #[doc = "Name and value pairs that define the managed application outputs."]
620 #[serde(default, skip_serializing_if = "Option::is_none")]
621 pub outputs: Option<serde_json::Value>,
622 #[doc = "Provisioning status of the managed application."]
623 #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")]
624 pub provisioning_state: Option<ProvisioningState>,
625 #[doc = "Managed application billing details definition."]
626 #[serde(rename = "billingDetails", default, skip_serializing_if = "Option::is_none")]
627 pub billing_details: Option<ApplicationBillingDetailsDefinition>,
628 #[doc = "Managed application Jit access policy."]
629 #[serde(rename = "jitAccessPolicy", default, skip_serializing_if = "Option::is_none")]
630 pub jit_access_policy: Option<ApplicationJitAccessPolicy>,
631 #[doc = "The publisher tenant Id."]
632 #[serde(rename = "publisherTenantId", default, skip_serializing_if = "Option::is_none")]
633 pub publisher_tenant_id: Option<String>,
634 #[doc = "The read-only authorizations property that is retrieved from the application package."]
635 #[serde(
636 default,
637 deserialize_with = "azure_core::util::deserialize_null_as_default",
638 skip_serializing_if = "Vec::is_empty"
639 )]
640 pub authorizations: Vec<ApplicationAuthorization>,
641 #[doc = "The management mode."]
642 #[serde(rename = "managementMode", default, skip_serializing_if = "Option::is_none")]
643 pub management_mode: Option<ApplicationManagementMode>,
644 #[doc = "The application package contact information."]
645 #[serde(rename = "customerSupport", default, skip_serializing_if = "Option::is_none")]
646 pub customer_support: Option<ApplicationPackageContact>,
647 #[doc = "The appliance package support URLs."]
648 #[serde(rename = "supportUrls", default, skip_serializing_if = "Option::is_none")]
649 pub support_urls: Option<ApplicationPackageSupportUrls>,
650 #[doc = "The collection of managed application artifacts."]
651 #[serde(
652 default,
653 deserialize_with = "azure_core::util::deserialize_null_as_default",
654 skip_serializing_if = "Vec::is_empty"
655 )]
656 pub artifacts: Vec<ApplicationArtifact>,
657 #[doc = "The application client details to track the entity creating/updating the managed app resource."]
658 #[serde(rename = "createdBy", default, skip_serializing_if = "Option::is_none")]
659 pub created_by: Option<ApplicationClientDetails>,
660 #[doc = "The application client details to track the entity creating/updating the managed app resource."]
661 #[serde(rename = "updatedBy", default, skip_serializing_if = "Option::is_none")]
662 pub updated_by: Option<ApplicationClientDetails>,
663}
664impl ApplicationProperties {
665 pub fn new() -> Self {
666 Self::default()
667 }
668}
669#[doc = "The managed application properties."]
670#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
671pub struct ApplicationPropertiesPatchable {
672 #[doc = "The managed resource group Id."]
673 #[serde(rename = "managedResourceGroupId", default, skip_serializing_if = "Option::is_none")]
674 pub managed_resource_group_id: Option<String>,
675 #[doc = "The fully qualified path of managed application definition Id."]
676 #[serde(rename = "applicationDefinitionId", default, skip_serializing_if = "Option::is_none")]
677 pub application_definition_id: Option<String>,
678 #[doc = "Name and value pairs that define the managed application parameters. It can be a JObject or a well formed JSON string."]
679 #[serde(default, skip_serializing_if = "Option::is_none")]
680 pub parameters: Option<serde_json::Value>,
681 #[doc = "Name and value pairs that define the managed application outputs."]
682 #[serde(default, skip_serializing_if = "Option::is_none")]
683 pub outputs: Option<serde_json::Value>,
684 #[doc = "Provisioning status of the managed application."]
685 #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")]
686 pub provisioning_state: Option<ProvisioningState>,
687}
688impl ApplicationPropertiesPatchable {
689 pub fn new() -> Self {
690 Self::default()
691 }
692}
693#[doc = "The deployment mode."]
694#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
695#[serde(remote = "DeploymentMode")]
696pub enum DeploymentMode {
697 NotSpecified,
698 Incremental,
699 Complete,
700 #[serde(skip_deserializing)]
701 UnknownValue(String),
702}
703impl FromStr for DeploymentMode {
704 type Err = value::Error;
705 fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
706 Self::deserialize(s.into_deserializer())
707 }
708}
709impl<'de> Deserialize<'de> for DeploymentMode {
710 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
711 where
712 D: Deserializer<'de>,
713 {
714 let s = String::deserialize(deserializer)?;
715 let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s));
716 Ok(deserialized)
717 }
718}
719impl Serialize for DeploymentMode {
720 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
721 where
722 S: Serializer,
723 {
724 match self {
725 Self::NotSpecified => serializer.serialize_unit_variant("DeploymentMode", 0u32, "NotSpecified"),
726 Self::Incremental => serializer.serialize_unit_variant("DeploymentMode", 1u32, "Incremental"),
727 Self::Complete => serializer.serialize_unit_variant("DeploymentMode", 2u32, "Complete"),
728 Self::UnknownValue(s) => serializer.serialize_str(s.as_str()),
729 }
730 }
731}
732#[doc = "The resource management error additional info."]
733#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
734pub struct ErrorAdditionalInfo {
735 #[doc = "The additional info type."]
736 #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
737 pub type_: Option<String>,
738 #[doc = "The additional info."]
739 #[serde(default, skip_serializing_if = "Option::is_none")]
740 pub info: Option<serde_json::Value>,
741}
742impl ErrorAdditionalInfo {
743 pub fn new() -> Self {
744 Self::default()
745 }
746}
747#[doc = "The error detail."]
748#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
749pub struct ErrorDetail {
750 #[doc = "The error code."]
751 #[serde(default, skip_serializing_if = "Option::is_none")]
752 pub code: Option<String>,
753 #[doc = "The error message."]
754 #[serde(default, skip_serializing_if = "Option::is_none")]
755 pub message: Option<String>,
756 #[doc = "The error target."]
757 #[serde(default, skip_serializing_if = "Option::is_none")]
758 pub target: Option<String>,
759 #[doc = "The error details."]
760 #[serde(
761 default,
762 deserialize_with = "azure_core::util::deserialize_null_as_default",
763 skip_serializing_if = "Vec::is_empty"
764 )]
765 pub details: Vec<ErrorDetail>,
766 #[doc = "The error additional info."]
767 #[serde(
768 rename = "additionalInfo",
769 default,
770 deserialize_with = "azure_core::util::deserialize_null_as_default",
771 skip_serializing_if = "Vec::is_empty"
772 )]
773 pub additional_info: Vec<ErrorAdditionalInfo>,
774}
775impl ErrorDetail {
776 pub fn new() -> Self {
777 Self::default()
778 }
779}
780#[doc = "Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.)."]
781#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
782pub struct ErrorResponse {
783 #[doc = "The error detail."]
784 #[serde(default, skip_serializing_if = "Option::is_none")]
785 pub error: Option<ErrorDetail>,
786}
787impl azure_core::Continuable for ErrorResponse {
788 type Continuation = String;
789 fn continuation(&self) -> Option<Self::Continuation> {
790 None
791 }
792}
793impl ErrorResponse {
794 pub fn new() -> Self {
795 Self::default()
796 }
797}
798#[doc = "Resource information."]
799#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
800pub struct GenericResource {
801 #[serde(flatten)]
802 pub resource: Resource,
803 #[doc = "ID of the resource that manages this resource."]
804 #[serde(rename = "managedBy", default, skip_serializing_if = "Option::is_none")]
805 pub managed_by: Option<String>,
806 #[doc = "SKU for the resource."]
807 #[serde(default, skip_serializing_if = "Option::is_none")]
808 pub sku: Option<Sku>,
809}
810impl GenericResource {
811 pub fn new() -> Self {
812 Self::default()
813 }
814}
815#[doc = "Identity for the resource."]
816#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
817pub struct Identity {
818 #[doc = "The principal ID of resource identity."]
819 #[serde(rename = "principalId", default, skip_serializing_if = "Option::is_none")]
820 pub principal_id: Option<String>,
821 #[doc = "The tenant ID of resource."]
822 #[serde(rename = "tenantId", default, skip_serializing_if = "Option::is_none")]
823 pub tenant_id: Option<String>,
824 #[doc = "The identity type."]
825 #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
826 pub type_: Option<identity::Type>,
827 #[doc = "The list of user identities associated with the resource. The user identity dictionary key references will be resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'."]
828 #[serde(rename = "userAssignedIdentities", default, skip_serializing_if = "Option::is_none")]
829 pub user_assigned_identities: Option<serde_json::Value>,
830}
831impl Identity {
832 pub fn new() -> Self {
833 Self::default()
834 }
835}
836pub mod identity {
837 use super::*;
838 #[doc = "The identity type."]
839 #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
840 pub enum Type {
841 SystemAssigned,
842 UserAssigned,
843 #[serde(rename = "SystemAssigned, UserAssigned")]
844 SystemAssignedUserAssigned,
845 None,
846 }
847}
848#[doc = "The Jit approval mode."]
849#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
850#[serde(remote = "JitApprovalMode")]
851pub enum JitApprovalMode {
852 NotSpecified,
853 AutoApprove,
854 ManualApprove,
855 #[serde(skip_deserializing)]
856 UnknownValue(String),
857}
858impl FromStr for JitApprovalMode {
859 type Err = value::Error;
860 fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
861 Self::deserialize(s.into_deserializer())
862 }
863}
864impl<'de> Deserialize<'de> for JitApprovalMode {
865 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
866 where
867 D: Deserializer<'de>,
868 {
869 let s = String::deserialize(deserializer)?;
870 let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s));
871 Ok(deserialized)
872 }
873}
874impl Serialize for JitApprovalMode {
875 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
876 where
877 S: Serializer,
878 {
879 match self {
880 Self::NotSpecified => serializer.serialize_unit_variant("JitApprovalMode", 0u32, "NotSpecified"),
881 Self::AutoApprove => serializer.serialize_unit_variant("JitApprovalMode", 1u32, "AutoApprove"),
882 Self::ManualApprove => serializer.serialize_unit_variant("JitApprovalMode", 2u32, "ManualApprove"),
883 Self::UnknownValue(s) => serializer.serialize_str(s.as_str()),
884 }
885 }
886}
887#[doc = "JIT approver definition."]
888#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
889pub struct JitApproverDefinition {
890 #[doc = "The approver service principal Id."]
891 pub id: String,
892 #[doc = "The approver type."]
893 #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
894 pub type_: Option<jit_approver_definition::Type>,
895 #[doc = "The approver display name."]
896 #[serde(rename = "displayName", default, skip_serializing_if = "Option::is_none")]
897 pub display_name: Option<String>,
898}
899impl JitApproverDefinition {
900 pub fn new(id: String) -> Self {
901 Self {
902 id,
903 type_: None,
904 display_name: None,
905 }
906 }
907}
908pub mod jit_approver_definition {
909 use super::*;
910 #[doc = "The approver type."]
911 #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
912 #[serde(remote = "Type")]
913 pub enum Type {
914 #[serde(rename = "user")]
915 User,
916 #[serde(rename = "group")]
917 Group,
918 #[serde(skip_deserializing)]
919 UnknownValue(String),
920 }
921 impl FromStr for Type {
922 type Err = value::Error;
923 fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
924 Self::deserialize(s.into_deserializer())
925 }
926 }
927 impl<'de> Deserialize<'de> for Type {
928 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
929 where
930 D: Deserializer<'de>,
931 {
932 let s = String::deserialize(deserializer)?;
933 let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s));
934 Ok(deserialized)
935 }
936 }
937 impl Serialize for Type {
938 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
939 where
940 S: Serializer,
941 {
942 match self {
943 Self::User => serializer.serialize_unit_variant("Type", 0u32, "user"),
944 Self::Group => serializer.serialize_unit_variant("Type", 1u32, "group"),
945 Self::UnknownValue(s) => serializer.serialize_str(s.as_str()),
946 }
947 }
948 }
949}
950#[doc = "The JIT authorization policies."]
951#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
952pub struct JitAuthorizationPolicies {
953 #[doc = "The the principal id that will be granted JIT access."]
954 #[serde(rename = "principalId")]
955 pub principal_id: String,
956 #[doc = "The role definition id that will be granted to the Principal."]
957 #[serde(rename = "roleDefinitionId")]
958 pub role_definition_id: String,
959}
960impl JitAuthorizationPolicies {
961 pub fn new(principal_id: String, role_definition_id: String) -> Self {
962 Self {
963 principal_id,
964 role_definition_id,
965 }
966 }
967}
968#[doc = "Information about JIT request definition."]
969#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
970pub struct JitRequestDefinition {
971 #[serde(flatten)]
972 pub resource: Resource,
973 #[doc = "Information about JIT request properties"]
974 #[serde(default, skip_serializing_if = "Option::is_none")]
975 pub properties: Option<JitRequestProperties>,
976}
977impl JitRequestDefinition {
978 pub fn new() -> Self {
979 Self::default()
980 }
981}
982#[doc = "List of JIT requests."]
983#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
984pub struct JitRequestDefinitionListResult {
985 #[doc = "The array of Jit request definition."]
986 #[serde(
987 default,
988 deserialize_with = "azure_core::util::deserialize_null_as_default",
989 skip_serializing_if = "Vec::is_empty"
990 )]
991 pub value: Vec<JitRequestDefinition>,
992 #[doc = "The URL to use for getting the next set of results."]
993 #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")]
994 pub next_link: Option<String>,
995}
996impl JitRequestDefinitionListResult {
997 pub fn new() -> Self {
998 Self::default()
999 }
1000}
1001#[doc = "The JIT request metadata."]
1002#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
1003pub struct JitRequestMetadata {
1004 #[doc = "The origin request id."]
1005 #[serde(rename = "originRequestId", default, skip_serializing_if = "Option::is_none")]
1006 pub origin_request_id: Option<String>,
1007 #[doc = "The requestor id."]
1008 #[serde(rename = "requestorId", default, skip_serializing_if = "Option::is_none")]
1009 pub requestor_id: Option<String>,
1010 #[doc = "The publisher's tenant name."]
1011 #[serde(rename = "tenantDisplayName", default, skip_serializing_if = "Option::is_none")]
1012 pub tenant_display_name: Option<String>,
1013 #[doc = "The subject display name."]
1014 #[serde(rename = "subjectDisplayName", default, skip_serializing_if = "Option::is_none")]
1015 pub subject_display_name: Option<String>,
1016}
1017impl JitRequestMetadata {
1018 pub fn new() -> Self {
1019 Self::default()
1020 }
1021}
1022#[doc = "Information about JIT request."]
1023#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
1024pub struct JitRequestPatchable {
1025 #[doc = "Jit request tags"]
1026 #[serde(default, skip_serializing_if = "Option::is_none")]
1027 pub tags: Option<serde_json::Value>,
1028}
1029impl JitRequestPatchable {
1030 pub fn new() -> Self {
1031 Self::default()
1032 }
1033}
1034#[doc = "Information about JIT request properties"]
1035#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
1036pub struct JitRequestProperties {
1037 #[doc = "The parent application id."]
1038 #[serde(rename = "applicationResourceId")]
1039 pub application_resource_id: String,
1040 #[doc = "The publisher tenant id."]
1041 #[serde(rename = "publisherTenantId", default, skip_serializing_if = "Option::is_none")]
1042 pub publisher_tenant_id: Option<String>,
1043 #[doc = "The JIT authorization policies."]
1044 #[serde(rename = "jitAuthorizationPolicies")]
1045 pub jit_authorization_policies: Vec<JitAuthorizationPolicies>,
1046 #[doc = "The JIT scheduling policies."]
1047 #[serde(rename = "jitSchedulingPolicy")]
1048 pub jit_scheduling_policy: JitSchedulingPolicy,
1049 #[doc = "Provisioning status of the managed application."]
1050 #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")]
1051 pub provisioning_state: Option<ProvisioningState>,
1052 #[doc = "The JIT request state."]
1053 #[serde(rename = "jitRequestState", default, skip_serializing_if = "Option::is_none")]
1054 pub jit_request_state: Option<JitRequestState>,
1055 #[doc = "The application client details to track the entity creating/updating the managed app resource."]
1056 #[serde(rename = "createdBy", default, skip_serializing_if = "Option::is_none")]
1057 pub created_by: Option<ApplicationClientDetails>,
1058 #[doc = "The application client details to track the entity creating/updating the managed app resource."]
1059 #[serde(rename = "updatedBy", default, skip_serializing_if = "Option::is_none")]
1060 pub updated_by: Option<ApplicationClientDetails>,
1061}
1062impl JitRequestProperties {
1063 pub fn new(
1064 application_resource_id: String,
1065 jit_authorization_policies: Vec<JitAuthorizationPolicies>,
1066 jit_scheduling_policy: JitSchedulingPolicy,
1067 ) -> Self {
1068 Self {
1069 application_resource_id,
1070 publisher_tenant_id: None,
1071 jit_authorization_policies,
1072 jit_scheduling_policy,
1073 provisioning_state: None,
1074 jit_request_state: None,
1075 created_by: None,
1076 updated_by: None,
1077 }
1078 }
1079}
1080#[doc = "The JIT request state."]
1081#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
1082#[serde(remote = "JitRequestState")]
1083pub enum JitRequestState {
1084 NotSpecified,
1085 Pending,
1086 Approved,
1087 Denied,
1088 Failed,
1089 Canceled,
1090 Expired,
1091 Timeout,
1092 #[serde(skip_deserializing)]
1093 UnknownValue(String),
1094}
1095impl FromStr for JitRequestState {
1096 type Err = value::Error;
1097 fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
1098 Self::deserialize(s.into_deserializer())
1099 }
1100}
1101impl<'de> Deserialize<'de> for JitRequestState {
1102 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1103 where
1104 D: Deserializer<'de>,
1105 {
1106 let s = String::deserialize(deserializer)?;
1107 let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s));
1108 Ok(deserialized)
1109 }
1110}
1111impl Serialize for JitRequestState {
1112 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1113 where
1114 S: Serializer,
1115 {
1116 match self {
1117 Self::NotSpecified => serializer.serialize_unit_variant("JitRequestState", 0u32, "NotSpecified"),
1118 Self::Pending => serializer.serialize_unit_variant("JitRequestState", 1u32, "Pending"),
1119 Self::Approved => serializer.serialize_unit_variant("JitRequestState", 2u32, "Approved"),
1120 Self::Denied => serializer.serialize_unit_variant("JitRequestState", 3u32, "Denied"),
1121 Self::Failed => serializer.serialize_unit_variant("JitRequestState", 4u32, "Failed"),
1122 Self::Canceled => serializer.serialize_unit_variant("JitRequestState", 5u32, "Canceled"),
1123 Self::Expired => serializer.serialize_unit_variant("JitRequestState", 6u32, "Expired"),
1124 Self::Timeout => serializer.serialize_unit_variant("JitRequestState", 7u32, "Timeout"),
1125 Self::UnknownValue(s) => serializer.serialize_str(s.as_str()),
1126 }
1127 }
1128}
1129#[doc = "The JIT scheduling policies."]
1130#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
1131pub struct JitSchedulingPolicy {
1132 #[doc = "The JIT request scheduling type."]
1133 #[serde(rename = "type")]
1134 pub type_: JitSchedulingType,
1135 pub duration: String,
1136 #[doc = "The start time of the request."]
1137 #[serde(rename = "startTime", with = "azure_core::date::rfc3339")]
1138 pub start_time: ::time::OffsetDateTime,
1139}
1140impl JitSchedulingPolicy {
1141 pub fn new(type_: JitSchedulingType, duration: String, start_time: ::time::OffsetDateTime) -> Self {
1142 Self {
1143 type_,
1144 duration,
1145 start_time,
1146 }
1147 }
1148}
1149#[doc = "The JIT request scheduling type."]
1150#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
1151#[serde(remote = "JitSchedulingType")]
1152pub enum JitSchedulingType {
1153 NotSpecified,
1154 Once,
1155 Recurring,
1156 #[serde(skip_deserializing)]
1157 UnknownValue(String),
1158}
1159impl FromStr for JitSchedulingType {
1160 type Err = value::Error;
1161 fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
1162 Self::deserialize(s.into_deserializer())
1163 }
1164}
1165impl<'de> Deserialize<'de> for JitSchedulingType {
1166 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1167 where
1168 D: Deserializer<'de>,
1169 {
1170 let s = String::deserialize(deserializer)?;
1171 let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s));
1172 Ok(deserialized)
1173 }
1174}
1175impl Serialize for JitSchedulingType {
1176 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1177 where
1178 S: Serializer,
1179 {
1180 match self {
1181 Self::NotSpecified => serializer.serialize_unit_variant("JitSchedulingType", 0u32, "NotSpecified"),
1182 Self::Once => serializer.serialize_unit_variant("JitSchedulingType", 1u32, "Once"),
1183 Self::Recurring => serializer.serialize_unit_variant("JitSchedulingType", 2u32, "Recurring"),
1184 Self::UnknownValue(s) => serializer.serialize_str(s.as_str()),
1185 }
1186 }
1187}
1188#[doc = "List token request body."]
1189#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
1190pub struct ListTokenRequest {
1191 #[doc = "The authorization audience."]
1192 #[serde(rename = "authorizationAudience", default, skip_serializing_if = "Option::is_none")]
1193 pub authorization_audience: Option<String>,
1194 #[doc = "The user assigned identities."]
1195 #[serde(
1196 rename = "userAssignedIdentities",
1197 default,
1198 deserialize_with = "azure_core::util::deserialize_null_as_default",
1199 skip_serializing_if = "Vec::is_empty"
1200 )]
1201 pub user_assigned_identities: Vec<UserAssignedIdentity>,
1202}
1203impl ListTokenRequest {
1204 pub fn new() -> Self {
1205 Self::default()
1206 }
1207}
1208#[doc = "The managed identity token for the managed app resource."]
1209#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
1210pub struct ManagedIdentityToken {
1211 #[doc = "The requested access token."]
1212 #[serde(rename = "accessToken", default, skip_serializing_if = "Option::is_none")]
1213 pub access_token: Option<String>,
1214 #[doc = "The number of seconds the access token will be valid."]
1215 #[serde(rename = "expiresIn", default, skip_serializing_if = "Option::is_none")]
1216 pub expires_in: Option<String>,
1217 #[doc = "The timespan when the access token expires. This is represented as the number of seconds from epoch."]
1218 #[serde(rename = "expiresOn", default, skip_serializing_if = "Option::is_none")]
1219 pub expires_on: Option<String>,
1220 #[doc = "The timespan when the access token takes effect. This is represented as the number of seconds from epoch."]
1221 #[serde(rename = "notBefore", default, skip_serializing_if = "Option::is_none")]
1222 pub not_before: Option<String>,
1223 #[doc = "The aud (audience) the access token was request for. This is the same as what was provided in the listTokens request."]
1224 #[serde(rename = "authorizationAudience", default, skip_serializing_if = "Option::is_none")]
1225 pub authorization_audience: Option<String>,
1226 #[doc = "The Azure resource ID for the issued token. This is either the managed application ID or the user-assigned identity ID."]
1227 #[serde(rename = "resourceId", default, skip_serializing_if = "Option::is_none")]
1228 pub resource_id: Option<String>,
1229 #[doc = "The type of the token."]
1230 #[serde(rename = "tokenType", default, skip_serializing_if = "Option::is_none")]
1231 pub token_type: Option<String>,
1232}
1233impl ManagedIdentityToken {
1234 pub fn new() -> Self {
1235 Self::default()
1236 }
1237}
1238#[doc = "The array of managed identity tokens."]
1239#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
1240pub struct ManagedIdentityTokenResult {
1241 #[doc = "The array of managed identity tokens."]
1242 #[serde(
1243 default,
1244 deserialize_with = "azure_core::util::deserialize_null_as_default",
1245 skip_serializing_if = "Vec::is_empty"
1246 )]
1247 pub value: Vec<ManagedIdentityToken>,
1248}
1249impl ManagedIdentityTokenResult {
1250 pub fn new() -> Self {
1251 Self::default()
1252 }
1253}
1254#[doc = "Microsoft.Solutions operation"]
1255#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
1256pub struct Operation {
1257 #[doc = "Operation name: {provider}/{resource}/{operation}"]
1258 #[serde(default, skip_serializing_if = "Option::is_none")]
1259 pub name: Option<String>,
1260 #[doc = "The object that represents the operation."]
1261 #[serde(default, skip_serializing_if = "Option::is_none")]
1262 pub display: Option<operation::Display>,
1263}
1264impl Operation {
1265 pub fn new() -> Self {
1266 Self::default()
1267 }
1268}
1269pub mod operation {
1270 use super::*;
1271 #[doc = "The object that represents the operation."]
1272 #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
1273 pub struct Display {
1274 #[doc = "Service provider: Microsoft.Solutions"]
1275 #[serde(default, skip_serializing_if = "Option::is_none")]
1276 pub provider: Option<String>,
1277 #[doc = "Resource on which the operation is performed: Application, JitRequest, etc."]
1278 #[serde(default, skip_serializing_if = "Option::is_none")]
1279 pub resource: Option<String>,
1280 #[doc = "Operation type: Read, write, delete, etc."]
1281 #[serde(default, skip_serializing_if = "Option::is_none")]
1282 pub operation: Option<String>,
1283 }
1284 impl Display {
1285 pub fn new() -> Self {
1286 Self::default()
1287 }
1288 }
1289}
1290#[doc = "A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results."]
1291#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
1292pub struct OperationListResult {
1293 #[doc = "List of operations supported by the resource provider"]
1294 #[serde(
1295 default,
1296 deserialize_with = "azure_core::util::deserialize_null_as_default",
1297 skip_serializing_if = "Vec::is_empty"
1298 )]
1299 pub value: Vec<Operation>,
1300 #[doc = "URL to get the next set of operation list results (if there are any)."]
1301 #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")]
1302 pub next_link: Option<String>,
1303}
1304impl azure_core::Continuable for OperationListResult {
1305 type Continuation = String;
1306 fn continuation(&self) -> Option<Self::Continuation> {
1307 self.next_link.clone().filter(|value| !value.is_empty())
1308 }
1309}
1310impl OperationListResult {
1311 pub fn new() -> Self {
1312 Self::default()
1313 }
1314}
1315#[doc = "Plan for the managed application."]
1316#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
1317pub struct Plan {
1318 #[doc = "The plan name."]
1319 pub name: String,
1320 #[doc = "The publisher ID."]
1321 pub publisher: String,
1322 #[doc = "The product code."]
1323 pub product: String,
1324 #[doc = "The promotion code."]
1325 #[serde(rename = "promotionCode", default, skip_serializing_if = "Option::is_none")]
1326 pub promotion_code: Option<String>,
1327 #[doc = "The plan's version."]
1328 pub version: String,
1329}
1330impl Plan {
1331 pub fn new(name: String, publisher: String, product: String, version: String) -> Self {
1332 Self {
1333 name,
1334 publisher,
1335 product,
1336 promotion_code: None,
1337 version,
1338 }
1339 }
1340}
1341#[doc = "Plan for the managed application."]
1342#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
1343pub struct PlanPatchable {
1344 #[doc = "The plan name."]
1345 #[serde(default, skip_serializing_if = "Option::is_none")]
1346 pub name: Option<String>,
1347 #[doc = "The publisher ID."]
1348 #[serde(default, skip_serializing_if = "Option::is_none")]
1349 pub publisher: Option<String>,
1350 #[doc = "The product code."]
1351 #[serde(default, skip_serializing_if = "Option::is_none")]
1352 pub product: Option<String>,
1353 #[doc = "The promotion code."]
1354 #[serde(rename = "promotionCode", default, skip_serializing_if = "Option::is_none")]
1355 pub promotion_code: Option<String>,
1356 #[doc = "The plan's version."]
1357 #[serde(default, skip_serializing_if = "Option::is_none")]
1358 pub version: Option<String>,
1359}
1360impl PlanPatchable {
1361 pub fn new() -> Self {
1362 Self::default()
1363 }
1364}
1365#[doc = "Provisioning status of the managed application."]
1366#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
1367#[serde(remote = "ProvisioningState")]
1368pub enum ProvisioningState {
1369 NotSpecified,
1370 Accepted,
1371 Running,
1372 Ready,
1373 Creating,
1374 Created,
1375 Deleting,
1376 Deleted,
1377 Canceled,
1378 Failed,
1379 Succeeded,
1380 Updating,
1381 #[serde(skip_deserializing)]
1382 UnknownValue(String),
1383}
1384impl FromStr for ProvisioningState {
1385 type Err = value::Error;
1386 fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
1387 Self::deserialize(s.into_deserializer())
1388 }
1389}
1390impl<'de> Deserialize<'de> for ProvisioningState {
1391 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1392 where
1393 D: Deserializer<'de>,
1394 {
1395 let s = String::deserialize(deserializer)?;
1396 let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s));
1397 Ok(deserialized)
1398 }
1399}
1400impl Serialize for ProvisioningState {
1401 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1402 where
1403 S: Serializer,
1404 {
1405 match self {
1406 Self::NotSpecified => serializer.serialize_unit_variant("ProvisioningState", 0u32, "NotSpecified"),
1407 Self::Accepted => serializer.serialize_unit_variant("ProvisioningState", 1u32, "Accepted"),
1408 Self::Running => serializer.serialize_unit_variant("ProvisioningState", 2u32, "Running"),
1409 Self::Ready => serializer.serialize_unit_variant("ProvisioningState", 3u32, "Ready"),
1410 Self::Creating => serializer.serialize_unit_variant("ProvisioningState", 4u32, "Creating"),
1411 Self::Created => serializer.serialize_unit_variant("ProvisioningState", 5u32, "Created"),
1412 Self::Deleting => serializer.serialize_unit_variant("ProvisioningState", 6u32, "Deleting"),
1413 Self::Deleted => serializer.serialize_unit_variant("ProvisioningState", 7u32, "Deleted"),
1414 Self::Canceled => serializer.serialize_unit_variant("ProvisioningState", 8u32, "Canceled"),
1415 Self::Failed => serializer.serialize_unit_variant("ProvisioningState", 9u32, "Failed"),
1416 Self::Succeeded => serializer.serialize_unit_variant("ProvisioningState", 10u32, "Succeeded"),
1417 Self::Updating => serializer.serialize_unit_variant("ProvisioningState", 11u32, "Updating"),
1418 Self::UnknownValue(s) => serializer.serialize_str(s.as_str()),
1419 }
1420 }
1421}
1422#[doc = "Resource information."]
1423#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
1424pub struct Resource {
1425 #[doc = "Resource ID"]
1426 #[serde(default, skip_serializing_if = "Option::is_none")]
1427 pub id: Option<String>,
1428 #[doc = "Resource name"]
1429 #[serde(default, skip_serializing_if = "Option::is_none")]
1430 pub name: Option<String>,
1431 #[doc = "Resource type"]
1432 #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
1433 pub type_: Option<String>,
1434 #[doc = "Resource location"]
1435 #[serde(default, skip_serializing_if = "Option::is_none")]
1436 pub location: Option<String>,
1437 #[doc = "Resource tags"]
1438 #[serde(default, skip_serializing_if = "Option::is_none")]
1439 pub tags: Option<serde_json::Value>,
1440}
1441impl Resource {
1442 pub fn new() -> Self {
1443 Self::default()
1444 }
1445}
1446#[doc = "SKU for the resource."]
1447#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
1448pub struct Sku {
1449 #[doc = "The SKU name."]
1450 pub name: String,
1451 #[doc = "The SKU tier."]
1452 #[serde(default, skip_serializing_if = "Option::is_none")]
1453 pub tier: Option<String>,
1454 #[doc = "The SKU size."]
1455 #[serde(default, skip_serializing_if = "Option::is_none")]
1456 pub size: Option<String>,
1457 #[doc = "The SKU family."]
1458 #[serde(default, skip_serializing_if = "Option::is_none")]
1459 pub family: Option<String>,
1460 #[doc = "The SKU model."]
1461 #[serde(default, skip_serializing_if = "Option::is_none")]
1462 pub model: Option<String>,
1463 #[doc = "The SKU capacity."]
1464 #[serde(default, skip_serializing_if = "Option::is_none")]
1465 pub capacity: Option<i32>,
1466}
1467impl Sku {
1468 pub fn new(name: String) -> Self {
1469 Self {
1470 name,
1471 tier: None,
1472 size: None,
1473 family: None,
1474 model: None,
1475 capacity: None,
1476 }
1477 }
1478}
1479#[doc = "The JIT status."]
1480#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
1481#[serde(remote = "Status")]
1482pub enum Status {
1483 NotSpecified,
1484 Elevate,
1485 Remove,
1486 #[serde(skip_deserializing)]
1487 UnknownValue(String),
1488}
1489impl FromStr for Status {
1490 type Err = value::Error;
1491 fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
1492 Self::deserialize(s.into_deserializer())
1493 }
1494}
1495impl<'de> Deserialize<'de> for Status {
1496 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1497 where
1498 D: Deserializer<'de>,
1499 {
1500 let s = String::deserialize(deserializer)?;
1501 let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s));
1502 Ok(deserialized)
1503 }
1504}
1505impl Serialize for Status {
1506 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1507 where
1508 S: Serializer,
1509 {
1510 match self {
1511 Self::NotSpecified => serializer.serialize_unit_variant("Status", 0u32, "NotSpecified"),
1512 Self::Elevate => serializer.serialize_unit_variant("Status", 1u32, "Elevate"),
1513 Self::Remove => serializer.serialize_unit_variant("Status", 2u32, "Remove"),
1514 Self::UnknownValue(s) => serializer.serialize_str(s.as_str()),
1515 }
1516 }
1517}
1518#[doc = "The sub status."]
1519#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
1520#[serde(remote = "SubStatus")]
1521pub enum SubStatus {
1522 NotSpecified,
1523 Approved,
1524 Denied,
1525 Failed,
1526 Expired,
1527 Timeout,
1528 #[serde(skip_deserializing)]
1529 UnknownValue(String),
1530}
1531impl FromStr for SubStatus {
1532 type Err = value::Error;
1533 fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
1534 Self::deserialize(s.into_deserializer())
1535 }
1536}
1537impl<'de> Deserialize<'de> for SubStatus {
1538 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1539 where
1540 D: Deserializer<'de>,
1541 {
1542 let s = String::deserialize(deserializer)?;
1543 let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s));
1544 Ok(deserialized)
1545 }
1546}
1547impl Serialize for SubStatus {
1548 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1549 where
1550 S: Serializer,
1551 {
1552 match self {
1553 Self::NotSpecified => serializer.serialize_unit_variant("SubStatus", 0u32, "NotSpecified"),
1554 Self::Approved => serializer.serialize_unit_variant("SubStatus", 1u32, "Approved"),
1555 Self::Denied => serializer.serialize_unit_variant("SubStatus", 2u32, "Denied"),
1556 Self::Failed => serializer.serialize_unit_variant("SubStatus", 3u32, "Failed"),
1557 Self::Expired => serializer.serialize_unit_variant("SubStatus", 4u32, "Expired"),
1558 Self::Timeout => serializer.serialize_unit_variant("SubStatus", 5u32, "Timeout"),
1559 Self::UnknownValue(s) => serializer.serialize_str(s.as_str()),
1560 }
1561 }
1562}
1563#[doc = "Update access request definition."]
1564#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
1565pub struct UpdateAccessDefinition {
1566 #[doc = "The approver name."]
1567 #[serde(default, skip_serializing_if = "Option::is_none")]
1568 pub approver: Option<String>,
1569 #[doc = "The JIT request metadata."]
1570 pub metadata: JitRequestMetadata,
1571 #[doc = "The JIT status."]
1572 pub status: Status,
1573 #[doc = "The sub status."]
1574 #[serde(rename = "subStatus")]
1575 pub sub_status: SubStatus,
1576}
1577impl UpdateAccessDefinition {
1578 pub fn new(metadata: JitRequestMetadata, status: Status, sub_status: SubStatus) -> Self {
1579 Self {
1580 approver: None,
1581 metadata,
1582 status,
1583 sub_status,
1584 }
1585 }
1586}
1587pub type UserAssignedIdentity = String;
1588#[doc = "Represents the user assigned identity that is contained within the UserAssignedIdentities dictionary on ResourceIdentity"]
1589#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
1590pub struct UserAssignedResourceIdentity {
1591 #[doc = "The principal id of user assigned identity."]
1592 #[serde(rename = "principalId", default, skip_serializing_if = "Option::is_none")]
1593 pub principal_id: Option<String>,
1594 #[doc = "The tenant id of user assigned identity."]
1595 #[serde(rename = "tenantId", default, skip_serializing_if = "Option::is_none")]
1596 pub tenant_id: Option<String>,
1597}
1598impl UserAssignedResourceIdentity {
1599 pub fn new() -> Self {
1600 Self::default()
1601 }
1602}