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 = "Available operations of the service"]
7#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
8pub struct AvailableOperations {
9 #[doc = "Collection of available operation details"]
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<OperationDetail>,
16 #[doc = "URL client should use to fetch the next page (per server side paging).\r\nIt's null for now, added for future use."]
17 #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")]
18 pub next_link: Option<String>,
19}
20impl azure_core::Continuable for AvailableOperations {
21 type Continuation = String;
22 fn continuation(&self) -> Option<Self::Continuation> {
23 None
24 }
25}
26impl AvailableOperations {
27 pub fn new() -> Self {
28 Self::default()
29 }
30}
31#[doc = "SKU properties of the Azure AD B2C tenant. Learn more about Azure AD B2C billing at [aka.ms/b2cBilling](https://aka.ms/b2cBilling)."]
32#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
33pub struct B2cResourceSku {
34 #[doc = "The name of the SKU for the tenant."]
35 #[serde(default, skip_serializing_if = "Option::is_none")]
36 pub name: Option<b2c_resource_sku::Name>,
37 #[doc = "The tier of the tenant."]
38 #[serde(default, skip_serializing_if = "Option::is_none")]
39 pub tier: Option<b2c_resource_sku::Tier>,
40}
41impl B2cResourceSku {
42 pub fn new() -> Self {
43 Self::default()
44 }
45}
46pub mod b2c_resource_sku {
47 use super::*;
48 #[doc = "The name of the SKU for the tenant."]
49 #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
50 #[serde(remote = "Name")]
51 pub enum Name {
52 Standard,
53 PremiumP1,
54 PremiumP2,
55 #[serde(skip_deserializing)]
56 UnknownValue(String),
57 }
58 impl FromStr for Name {
59 type Err = value::Error;
60 fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
61 Self::deserialize(s.into_deserializer())
62 }
63 }
64 impl<'de> Deserialize<'de> for Name {
65 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
66 where
67 D: Deserializer<'de>,
68 {
69 let s = String::deserialize(deserializer)?;
70 let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s));
71 Ok(deserialized)
72 }
73 }
74 impl Serialize for Name {
75 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
76 where
77 S: Serializer,
78 {
79 match self {
80 Self::Standard => serializer.serialize_unit_variant("Name", 0u32, "Standard"),
81 Self::PremiumP1 => serializer.serialize_unit_variant("Name", 1u32, "PremiumP1"),
82 Self::PremiumP2 => serializer.serialize_unit_variant("Name", 2u32, "PremiumP2"),
83 Self::UnknownValue(s) => serializer.serialize_str(s.as_str()),
84 }
85 }
86 }
87 #[doc = "The tier of the tenant."]
88 #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
89 #[serde(remote = "Tier")]
90 pub enum Tier {
91 A0,
92 #[serde(skip_deserializing)]
93 UnknownValue(String),
94 }
95 impl FromStr for Tier {
96 type Err = value::Error;
97 fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
98 Self::deserialize(s.into_deserializer())
99 }
100 }
101 impl<'de> Deserialize<'de> for Tier {
102 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
103 where
104 D: Deserializer<'de>,
105 {
106 let s = String::deserialize(deserializer)?;
107 let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s));
108 Ok(deserialized)
109 }
110 }
111 impl Serialize for Tier {
112 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
113 where
114 S: Serializer,
115 {
116 match self {
117 Self::A0 => serializer.serialize_unit_variant("Tier", 0u32, "A0"),
118 Self::UnknownValue(s) => serializer.serialize_str(s.as_str()),
119 }
120 }
121 }
122}
123#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
124pub struct B2cTenantResource {
125 #[doc = "The type of the B2C tenant resource."]
126 #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
127 pub type_: Option<b2c_tenant_resource::Type>,
128 #[doc = "SKU properties of the Azure AD B2C tenant. Learn more about Azure AD B2C billing at [aka.ms/b2cBilling](https://aka.ms/b2cBilling)."]
129 pub sku: B2cResourceSku,
130 #[doc = "Properties of the Azure AD B2C tenant Azure resource."]
131 #[serde(default, skip_serializing_if = "Option::is_none")]
132 pub properties: Option<B2cTenantResourceProperties>,
133 #[doc = "An identifier that represents the Azure AD B2C tenant resource."]
134 #[serde(default, skip_serializing_if = "Option::is_none")]
135 pub id: Option<String>,
136 #[doc = "The name of the Azure AD B2C tenant resource."]
137 #[serde(default, skip_serializing_if = "Option::is_none")]
138 pub name: Option<String>,
139 #[doc = "The location in which the resource is hosted and data resides. Can be one of 'United States', 'Europe', 'Asia Pacific', or 'Australia'. Refer to [this documentation](https://aka.ms/B2CDataResidency) for more information."]
140 pub location: String,
141 #[doc = "Resource Tags"]
142 #[serde(default, skip_serializing_if = "Option::is_none")]
143 pub tags: Option<serde_json::Value>,
144 #[doc = "Metadata pertaining to creation and last modification of the resource."]
145 #[serde(rename = "systemData", default, skip_serializing_if = "Option::is_none")]
146 pub system_data: Option<SystemData>,
147}
148impl B2cTenantResource {
149 pub fn new(sku: B2cResourceSku, location: String) -> Self {
150 Self {
151 type_: None,
152 sku,
153 properties: None,
154 id: None,
155 name: None,
156 location,
157 tags: None,
158 system_data: None,
159 }
160 }
161}
162pub mod b2c_tenant_resource {
163 use super::*;
164 #[doc = "The type of the B2C tenant resource."]
165 #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
166 #[serde(remote = "Type")]
167 pub enum Type {
168 #[serde(rename = "Microsoft.AzureActiveDirectory/b2cDirectories")]
169 MicrosoftAzureActiveDirectoryB2cDirectories,
170 #[serde(skip_deserializing)]
171 UnknownValue(String),
172 }
173 impl FromStr for Type {
174 type Err = value::Error;
175 fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
176 Self::deserialize(s.into_deserializer())
177 }
178 }
179 impl<'de> Deserialize<'de> for Type {
180 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
181 where
182 D: Deserializer<'de>,
183 {
184 let s = String::deserialize(deserializer)?;
185 let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s));
186 Ok(deserialized)
187 }
188 }
189 impl Serialize for Type {
190 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
191 where
192 S: Serializer,
193 {
194 match self {
195 Self::MicrosoftAzureActiveDirectoryB2cDirectories => {
196 serializer.serialize_unit_variant("Type", 0u32, "Microsoft.AzureActiveDirectory/b2cDirectories")
197 }
198 Self::UnknownValue(s) => serializer.serialize_str(s.as_str()),
199 }
200 }
201 }
202}
203#[doc = "The collection of Azure AD B2C tenant resources"]
204#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
205pub struct B2cTenantResourceList {
206 #[doc = "List of Azure AD B2C tenant resources"]
207 #[serde(
208 default,
209 deserialize_with = "azure_core::util::deserialize_null_as_default",
210 skip_serializing_if = "Vec::is_empty"
211 )]
212 pub value: Vec<B2cTenantResource>,
213}
214impl azure_core::Continuable for B2cTenantResourceList {
215 type Continuation = String;
216 fn continuation(&self) -> Option<Self::Continuation> {
217 None
218 }
219}
220impl B2cTenantResourceList {
221 pub fn new() -> Self {
222 Self::default()
223 }
224}
225#[doc = "Properties of the Azure AD B2C tenant Azure resource."]
226#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
227pub struct B2cTenantResourceProperties {
228 #[doc = "The billing configuration for the tenant."]
229 #[serde(rename = "billingConfig", default, skip_serializing_if = "Option::is_none")]
230 pub billing_config: Option<b2c_tenant_resource_properties::BillingConfig>,
231 #[doc = "An identifier of the Azure AD B2C tenant."]
232 #[serde(rename = "tenantId", default, skip_serializing_if = "Option::is_none")]
233 pub tenant_id: Option<String>,
234}
235impl B2cTenantResourceProperties {
236 pub fn new() -> Self {
237 Self::default()
238 }
239}
240pub mod b2c_tenant_resource_properties {
241 use super::*;
242 #[doc = "The billing configuration for the tenant."]
243 #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
244 pub struct BillingConfig {
245 #[doc = "The type of billing. Will be MAU for all new customers. If 'Auths', it can be updated to 'MAU'. Cannot be changed if value is 'MAU'. Learn more about Azure AD B2C billing at [aka.ms/b2cBilling](https://aka.ms/b2cbilling)."]
246 #[serde(rename = "billingType", default, skip_serializing_if = "Option::is_none")]
247 pub billing_type: Option<billing_config::BillingType>,
248 #[doc = "The data from which the billing type took effect"]
249 #[serde(rename = "effectiveStartDateUtc", default, skip_serializing_if = "Option::is_none")]
250 pub effective_start_date_utc: Option<String>,
251 }
252 impl BillingConfig {
253 pub fn new() -> Self {
254 Self::default()
255 }
256 }
257 pub mod billing_config {
258 use super::*;
259 #[doc = "The type of billing. Will be MAU for all new customers. If 'Auths', it can be updated to 'MAU'. Cannot be changed if value is 'MAU'. Learn more about Azure AD B2C billing at [aka.ms/b2cBilling](https://aka.ms/b2cbilling)."]
260 #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
261 #[serde(remote = "BillingType")]
262 pub enum BillingType {
263 #[serde(rename = "MAU")]
264 Mau,
265 Auths,
266 #[serde(skip_deserializing)]
267 UnknownValue(String),
268 }
269 impl FromStr for BillingType {
270 type Err = value::Error;
271 fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
272 Self::deserialize(s.into_deserializer())
273 }
274 }
275 impl<'de> Deserialize<'de> for BillingType {
276 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
277 where
278 D: Deserializer<'de>,
279 {
280 let s = String::deserialize(deserializer)?;
281 let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s));
282 Ok(deserialized)
283 }
284 }
285 impl Serialize for BillingType {
286 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
287 where
288 S: Serializer,
289 {
290 match self {
291 Self::Mau => serializer.serialize_unit_variant("BillingType", 0u32, "MAU"),
292 Self::Auths => serializer.serialize_unit_variant("BillingType", 1u32, "Auths"),
293 Self::UnknownValue(s) => serializer.serialize_str(s.as_str()),
294 }
295 }
296 }
297 }
298}
299#[doc = "The request body to update the Azure AD B2C tenant resource."]
300#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
301pub struct B2cTenantUpdateRequest {
302 #[doc = "SKU properties of the Azure AD B2C tenant. Learn more about Azure AD B2C billing at [aka.ms/b2cBilling](https://aka.ms/b2cBilling)."]
303 #[serde(default, skip_serializing_if = "Option::is_none")]
304 pub sku: Option<B2cResourceSku>,
305 #[doc = "Properties of the Azure AD B2C tenant Azure resource."]
306 #[serde(default, skip_serializing_if = "Option::is_none")]
307 pub properties: Option<B2cTenantResourceProperties>,
308 #[doc = "Resource Tags"]
309 #[serde(default, skip_serializing_if = "Option::is_none")]
310 pub tags: Option<serde_json::Value>,
311}
312impl B2cTenantUpdateRequest {
313 pub fn new() -> Self {
314 Self::default()
315 }
316}
317#[doc = "The information required to check the availability of the name for the tenant."]
318#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
319pub struct CheckNameAvailabilityRequestBody {
320 #[doc = "The domain name to check for availability."]
321 pub name: String,
322 #[doc = "Country code of Azure tenant (e.g. 'US'). Refer to [aka.ms/B2CDataResidency](https://aka.ms/B2CDataResidency) to see valid country codes and corresponding data residency locations. If you do not see a country code in an valid data residency location, choose one from the list."]
323 #[serde(rename = "countryCode")]
324 pub country_code: CountryCode,
325}
326impl CheckNameAvailabilityRequestBody {
327 pub fn new(name: String, country_code: CountryCode) -> Self {
328 Self { name, country_code }
329 }
330}
331#[doc = "An error response for a resource management request."]
332#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
333pub struct CloudError {
334 #[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.)"]
335 #[serde(default, skip_serializing_if = "Option::is_none")]
336 pub error: Option<ErrorResponse>,
337}
338impl azure_core::Continuable for CloudError {
339 type Continuation = String;
340 fn continuation(&self) -> Option<Self::Continuation> {
341 None
342 }
343}
344impl CloudError {
345 pub fn new() -> Self {
346 Self::default()
347 }
348}
349pub type CountryCode = String;
350#[doc = "These properties are used to create the Azure AD B2C tenant. These properties are not part of the Azure resource."]
351#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
352pub struct CreateTenantProperties {
353 #[doc = "The display name of the Azure AD B2C tenant."]
354 #[serde(rename = "displayName", default, skip_serializing_if = "Option::is_none")]
355 pub display_name: Option<String>,
356 #[doc = "Country code of Azure tenant (e.g. 'US'). Refer to [aka.ms/B2CDataResidency](https://aka.ms/B2CDataResidency) to see valid country codes and corresponding data residency locations. If you do not see a country code in an valid data residency location, choose one from the list."]
357 #[serde(rename = "countryCode", default, skip_serializing_if = "Option::is_none")]
358 pub country_code: Option<CountryCode>,
359}
360impl CreateTenantProperties {
361 pub fn new() -> Self {
362 Self::default()
363 }
364}
365#[doc = "The information needed to create the Azure AD B2C tenant and corresponding Azure resource, which is used for billing purposes."]
366#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
367pub struct CreateTenantRequestBody {
368 #[doc = "The location in which the resource is hosted and data resides. Can be one of 'United States', 'Europe', 'Asia Pacific', or 'Australia'. Refer to [this documentation](https://aka.ms/B2CDataResidency) for more information."]
369 pub location: String,
370 pub properties: create_tenant_request_body::Properties,
371 #[doc = "SKU properties of the Azure AD B2C tenant. Learn more about Azure AD B2C billing at [aka.ms/b2cBilling](https://aka.ms/b2cBilling)."]
372 pub sku: B2cResourceSku,
373 #[doc = "Resource Tags"]
374 #[serde(default, skip_serializing_if = "Option::is_none")]
375 pub tags: Option<serde_json::Value>,
376}
377impl CreateTenantRequestBody {
378 pub fn new(location: String, properties: create_tenant_request_body::Properties, sku: B2cResourceSku) -> Self {
379 Self {
380 location,
381 properties,
382 sku,
383 tags: None,
384 }
385 }
386}
387pub mod create_tenant_request_body {
388 use super::*;
389 #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
390 pub struct Properties {
391 #[doc = "These properties are used to create the Azure AD B2C tenant. These properties are not part of the Azure resource."]
392 #[serde(rename = "createTenantProperties", default, skip_serializing_if = "Option::is_none")]
393 pub create_tenant_properties: Option<CreateTenantProperties>,
394 }
395 impl Properties {
396 pub fn new() -> Self {
397 Self::default()
398 }
399 }
400}
401#[doc = "The resource management error additional info."]
402#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
403pub struct ErrorAdditionalInfo {
404 #[doc = "The additional info type."]
405 #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
406 pub type_: Option<String>,
407 #[doc = "The additional info."]
408 #[serde(default, skip_serializing_if = "Option::is_none")]
409 pub info: Option<serde_json::Value>,
410}
411impl ErrorAdditionalInfo {
412 pub fn new() -> Self {
413 Self::default()
414 }
415}
416#[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.)"]
417#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
418pub struct ErrorResponse {
419 #[doc = "The error code."]
420 #[serde(default, skip_serializing_if = "Option::is_none")]
421 pub code: Option<String>,
422 #[doc = "The error message."]
423 #[serde(default, skip_serializing_if = "Option::is_none")]
424 pub message: Option<String>,
425 #[doc = "The error target."]
426 #[serde(default, skip_serializing_if = "Option::is_none")]
427 pub target: Option<String>,
428 #[doc = "The error details."]
429 #[serde(
430 default,
431 deserialize_with = "azure_core::util::deserialize_null_as_default",
432 skip_serializing_if = "Vec::is_empty"
433 )]
434 pub details: Vec<ErrorResponse>,
435 #[doc = "The error additional info."]
436 #[serde(
437 rename = "additionalInfo",
438 default,
439 deserialize_with = "azure_core::util::deserialize_null_as_default",
440 skip_serializing_if = "Vec::is_empty"
441 )]
442 pub additional_info: Vec<ErrorAdditionalInfo>,
443}
444impl ErrorResponse {
445 pub fn new() -> Self {
446 Self::default()
447 }
448}
449#[doc = "Guest Usages Resource"]
450#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
451pub struct GuestUsagesResource {
452 #[doc = "An identifier that represents the Guest Usages resource."]
453 #[serde(default, skip_serializing_if = "Option::is_none")]
454 pub id: Option<String>,
455 #[doc = "The name of the Guest Usages resource."]
456 #[serde(default, skip_serializing_if = "Option::is_none")]
457 pub name: Option<String>,
458 #[doc = "The type of the Guest Usages resource."]
459 #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
460 pub type_: Option<String>,
461 #[doc = "Location of the Guest Usages resource."]
462 #[serde(default, skip_serializing_if = "Option::is_none")]
463 pub location: Option<String>,
464 #[doc = "Key-value pairs of additional resource provisioning properties."]
465 #[serde(default, skip_serializing_if = "Option::is_none")]
466 pub tags: Option<serde_json::Value>,
467 #[doc = "Guest Usages Resource Properties"]
468 #[serde(default, skip_serializing_if = "Option::is_none")]
469 pub properties: Option<GuestUsagesResourceProperties>,
470 #[doc = "Metadata pertaining to creation and last modification of the resource."]
471 #[serde(rename = "systemData", default, skip_serializing_if = "Option::is_none")]
472 pub system_data: Option<SystemData>,
473}
474impl GuestUsagesResource {
475 pub fn new() -> Self {
476 Self::default()
477 }
478}
479#[doc = "The collection of guest usages resources"]
480#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
481pub struct GuestUsagesResourceList {
482 #[doc = "List of guest usages resources"]
483 #[serde(
484 default,
485 deserialize_with = "azure_core::util::deserialize_null_as_default",
486 skip_serializing_if = "Vec::is_empty"
487 )]
488 pub value: Vec<GuestUsagesResource>,
489}
490impl azure_core::Continuable for GuestUsagesResourceList {
491 type Continuation = String;
492 fn continuation(&self) -> Option<Self::Continuation> {
493 None
494 }
495}
496impl GuestUsagesResourceList {
497 pub fn new() -> Self {
498 Self::default()
499 }
500}
501#[doc = "Guest Usages Resource for Patch"]
502#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
503pub struct GuestUsagesResourcePatch {
504 #[doc = "Key-value pairs of additional resource provisioning properties."]
505 #[serde(default, skip_serializing_if = "Option::is_none")]
506 pub tags: Option<serde_json::Value>,
507}
508impl GuestUsagesResourcePatch {
509 pub fn new() -> Self {
510 Self::default()
511 }
512}
513#[doc = "Guest Usages Resource Properties"]
514#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
515pub struct GuestUsagesResourceProperties {
516 #[doc = "An identifier for the tenant for which the resource is being created"]
517 #[serde(rename = "tenantId", default, skip_serializing_if = "Option::is_none")]
518 pub tenant_id: Option<String>,
519}
520impl GuestUsagesResourceProperties {
521 pub fn new() -> Self {
522 Self::default()
523 }
524}
525#[doc = "Describes the reason for the 'nameAvailable' value."]
526#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
527#[serde(remote = "NameAvailabilityReason")]
528pub enum NameAvailabilityReason {
529 AlreadyExists,
530 Invalid,
531 #[serde(skip_deserializing)]
532 UnknownValue(String),
533}
534impl FromStr for NameAvailabilityReason {
535 type Err = value::Error;
536 fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
537 Self::deserialize(s.into_deserializer())
538 }
539}
540impl<'de> Deserialize<'de> for NameAvailabilityReason {
541 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
542 where
543 D: Deserializer<'de>,
544 {
545 let s = String::deserialize(deserializer)?;
546 let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s));
547 Ok(deserialized)
548 }
549}
550impl Serialize for NameAvailabilityReason {
551 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
552 where
553 S: Serializer,
554 {
555 match self {
556 Self::AlreadyExists => serializer.serialize_unit_variant("NameAvailabilityReason", 0u32, "AlreadyExists"),
557 Self::Invalid => serializer.serialize_unit_variant("NameAvailabilityReason", 1u32, "Invalid"),
558 Self::UnknownValue(s) => serializer.serialize_str(s.as_str()),
559 }
560 }
561}
562#[doc = "Response of the CheckNameAvailability operation."]
563#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
564pub struct NameAvailabilityResponse {
565 #[doc = "Description of the reason if name is not available."]
566 #[serde(default, skip_serializing_if = "Option::is_none")]
567 pub message: Option<String>,
568 #[doc = "True if the name is available and can be used to create a new tenant. Otherwise false."]
569 #[serde(rename = "nameAvailable", default, skip_serializing_if = "Option::is_none")]
570 pub name_available: Option<bool>,
571 #[doc = "Describes the reason for the 'nameAvailable' value."]
572 #[serde(default, skip_serializing_if = "Option::is_none")]
573 pub reason: Option<NameAvailabilityReason>,
574}
575impl NameAvailabilityResponse {
576 pub fn new() -> Self {
577 Self::default()
578 }
579}
580#[doc = "Operation detail payload"]
581#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
582pub struct OperationDetail {
583 #[doc = "Name of the operation"]
584 #[serde(default, skip_serializing_if = "Option::is_none")]
585 pub name: Option<String>,
586 #[doc = "Indicates whether the operation is a data action"]
587 #[serde(rename = "isDataAction", default, skip_serializing_if = "Option::is_none")]
588 pub is_data_action: Option<bool>,
589 #[doc = "Operation display payload"]
590 #[serde(default, skip_serializing_if = "Option::is_none")]
591 pub display: Option<OperationDisplay>,
592 #[doc = "Origin of the operation"]
593 #[serde(default, skip_serializing_if = "Option::is_none")]
594 pub origin: Option<String>,
595}
596impl OperationDetail {
597 pub fn new() -> Self {
598 Self::default()
599 }
600}
601#[doc = "Operation display payload"]
602#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
603pub struct OperationDisplay {
604 #[doc = "Resource provider of the operation"]
605 #[serde(default, skip_serializing_if = "Option::is_none")]
606 pub provider: Option<String>,
607 #[doc = "Resource of the operation"]
608 #[serde(default, skip_serializing_if = "Option::is_none")]
609 pub resource: Option<String>,
610 #[doc = "Localized friendly name for the operation"]
611 #[serde(default, skip_serializing_if = "Option::is_none")]
612 pub operation: Option<String>,
613 #[doc = "Localized friendly description for the operation"]
614 #[serde(default, skip_serializing_if = "Option::is_none")]
615 pub description: Option<String>,
616}
617impl OperationDisplay {
618 pub fn new() -> Self {
619 Self::default()
620 }
621}
622#[doc = "Metadata pertaining to creation and last modification of the resource."]
623#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
624pub struct SystemData {
625 #[doc = "The identity that created the resource."]
626 #[serde(rename = "createdBy", default, skip_serializing_if = "Option::is_none")]
627 pub created_by: Option<String>,
628 #[doc = "The type of identity that created the resource."]
629 #[serde(rename = "createdByType", default, skip_serializing_if = "Option::is_none")]
630 pub created_by_type: Option<system_data::CreatedByType>,
631 #[doc = "The timestamp of resource creation (UTC)."]
632 #[serde(rename = "createdAt", default, with = "azure_core::date::rfc3339::option")]
633 pub created_at: Option<::time::OffsetDateTime>,
634 #[doc = "The identity that last modified the resource."]
635 #[serde(rename = "lastModifiedBy", default, skip_serializing_if = "Option::is_none")]
636 pub last_modified_by: Option<String>,
637 #[doc = "The type of identity that last modified the resource."]
638 #[serde(rename = "lastModifiedByType", default, skip_serializing_if = "Option::is_none")]
639 pub last_modified_by_type: Option<system_data::LastModifiedByType>,
640 #[doc = "The timestamp of resource last modification (UTC)"]
641 #[serde(rename = "lastModifiedAt", default, with = "azure_core::date::rfc3339::option")]
642 pub last_modified_at: Option<::time::OffsetDateTime>,
643}
644impl SystemData {
645 pub fn new() -> Self {
646 Self::default()
647 }
648}
649pub mod system_data {
650 use super::*;
651 #[doc = "The type of identity that created the resource."]
652 #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
653 #[serde(remote = "CreatedByType")]
654 pub enum CreatedByType {
655 User,
656 Application,
657 ManagedIdentity,
658 Key,
659 #[serde(skip_deserializing)]
660 UnknownValue(String),
661 }
662 impl FromStr for CreatedByType {
663 type Err = value::Error;
664 fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
665 Self::deserialize(s.into_deserializer())
666 }
667 }
668 impl<'de> Deserialize<'de> for CreatedByType {
669 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
670 where
671 D: Deserializer<'de>,
672 {
673 let s = String::deserialize(deserializer)?;
674 let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s));
675 Ok(deserialized)
676 }
677 }
678 impl Serialize for CreatedByType {
679 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
680 where
681 S: Serializer,
682 {
683 match self {
684 Self::User => serializer.serialize_unit_variant("CreatedByType", 0u32, "User"),
685 Self::Application => serializer.serialize_unit_variant("CreatedByType", 1u32, "Application"),
686 Self::ManagedIdentity => serializer.serialize_unit_variant("CreatedByType", 2u32, "ManagedIdentity"),
687 Self::Key => serializer.serialize_unit_variant("CreatedByType", 3u32, "Key"),
688 Self::UnknownValue(s) => serializer.serialize_str(s.as_str()),
689 }
690 }
691 }
692 #[doc = "The type of identity that last modified the resource."]
693 #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
694 #[serde(remote = "LastModifiedByType")]
695 pub enum LastModifiedByType {
696 User,
697 Application,
698 ManagedIdentity,
699 Key,
700 #[serde(skip_deserializing)]
701 UnknownValue(String),
702 }
703 impl FromStr for LastModifiedByType {
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 }
709 impl<'de> Deserialize<'de> for LastModifiedByType {
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 }
719 impl Serialize for LastModifiedByType {
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::User => serializer.serialize_unit_variant("LastModifiedByType", 0u32, "User"),
726 Self::Application => serializer.serialize_unit_variant("LastModifiedByType", 1u32, "Application"),
727 Self::ManagedIdentity => serializer.serialize_unit_variant("LastModifiedByType", 2u32, "ManagedIdentity"),
728 Self::Key => serializer.serialize_unit_variant("LastModifiedByType", 3u32, "Key"),
729 Self::UnknownValue(s) => serializer.serialize_str(s.as_str()),
730 }
731 }
732 }
733}