azure_mgmt_trafficmanager/package_2018_03/
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 = "Parameters supplied to check Traffic Manager name operation."]
7#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
8pub struct CheckTrafficManagerRelativeDnsNameAvailabilityParameters {
9    #[doc = "The name of the resource."]
10    #[serde(default, skip_serializing_if = "Option::is_none")]
11    pub name: Option<String>,
12    #[doc = "The type of the resource."]
13    #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
14    pub type_: Option<String>,
15}
16impl CheckTrafficManagerRelativeDnsNameAvailabilityParameters {
17    pub fn new() -> Self {
18        Self::default()
19    }
20}
21#[doc = "An error returned by the Azure Resource Manager"]
22#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
23pub struct CloudError {
24    #[doc = "The content of an error returned by the Azure Resource Manager"]
25    #[serde(default, skip_serializing_if = "Option::is_none")]
26    pub error: Option<CloudErrorBody>,
27}
28impl azure_core::Continuable for CloudError {
29    type Continuation = String;
30    fn continuation(&self) -> Option<Self::Continuation> {
31        None
32    }
33}
34impl CloudError {
35    pub fn new() -> Self {
36        Self::default()
37    }
38}
39#[doc = "The content of an error returned by the Azure Resource Manager"]
40#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
41pub struct CloudErrorBody {
42    #[doc = "Error code"]
43    #[serde(default, skip_serializing_if = "Option::is_none")]
44    pub code: Option<String>,
45    #[doc = "Error message"]
46    #[serde(default, skip_serializing_if = "Option::is_none")]
47    pub message: Option<String>,
48    #[doc = "Error target"]
49    #[serde(default, skip_serializing_if = "Option::is_none")]
50    pub target: Option<String>,
51    #[doc = "Error details"]
52    #[serde(
53        default,
54        deserialize_with = "azure_core::util::deserialize_null_as_default",
55        skip_serializing_if = "Vec::is_empty"
56    )]
57    pub details: Vec<CloudErrorBody>,
58}
59impl CloudErrorBody {
60    pub fn new() -> Self {
61        Self::default()
62    }
63}
64#[doc = "The result of the request or operation."]
65#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
66pub struct DeleteOperationResult {
67    #[doc = "The result of the operation or request."]
68    #[serde(default, skip_serializing_if = "Option::is_none")]
69    pub boolean: Option<bool>,
70}
71impl DeleteOperationResult {
72    pub fn new() -> Self {
73        Self::default()
74    }
75}
76#[doc = "Class containing DNS settings in a Traffic Manager profile."]
77#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
78pub struct DnsConfig {
79    #[doc = "The relative DNS name provided by this Traffic Manager profile. This value is combined with the DNS domain name used by Azure Traffic Manager to form the fully-qualified domain name (FQDN) of the profile."]
80    #[serde(rename = "relativeName", default, skip_serializing_if = "Option::is_none")]
81    pub relative_name: Option<String>,
82    #[doc = "The fully-qualified domain name (FQDN) of the Traffic Manager profile. This is formed from the concatenation of the RelativeName with the DNS domain used by Azure Traffic Manager."]
83    #[serde(default, skip_serializing_if = "Option::is_none")]
84    pub fqdn: Option<String>,
85    #[doc = "The DNS Time-To-Live (TTL), in seconds. This informs the local DNS resolvers and DNS clients how long to cache DNS responses provided by this Traffic Manager profile."]
86    #[serde(default, skip_serializing_if = "Option::is_none")]
87    pub ttl: Option<i64>,
88}
89impl DnsConfig {
90    pub fn new() -> Self {
91        Self::default()
92    }
93}
94#[doc = "Class representing a Traffic Manager endpoint."]
95#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
96pub struct Endpoint {
97    #[serde(flatten)]
98    pub proxy_resource: ProxyResource,
99    #[doc = "Class representing a Traffic Manager endpoint properties."]
100    #[serde(default, skip_serializing_if = "Option::is_none")]
101    pub properties: Option<EndpointProperties>,
102}
103impl Endpoint {
104    pub fn new() -> Self {
105        Self::default()
106    }
107}
108#[doc = "Class representing a Traffic Manager endpoint properties."]
109#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
110pub struct EndpointProperties {
111    #[doc = "The Azure Resource URI of the of the endpoint. Not applicable to endpoints of type 'ExternalEndpoints'."]
112    #[serde(rename = "targetResourceId", default, skip_serializing_if = "Option::is_none")]
113    pub target_resource_id: Option<String>,
114    #[doc = "The fully-qualified DNS name or IP address of the endpoint. Traffic Manager returns this value in DNS responses to direct traffic to this endpoint."]
115    #[serde(default, skip_serializing_if = "Option::is_none")]
116    pub target: Option<String>,
117    #[doc = "The status of the endpoint. If the endpoint is Enabled, it is probed for endpoint health and is included in the traffic routing method."]
118    #[serde(rename = "endpointStatus", default, skip_serializing_if = "Option::is_none")]
119    pub endpoint_status: Option<endpoint_properties::EndpointStatus>,
120    #[doc = "The weight of this endpoint when using the 'Weighted' traffic routing method. Possible values are from 1 to 1000."]
121    #[serde(default, skip_serializing_if = "Option::is_none")]
122    pub weight: Option<i64>,
123    #[doc = "The priority of this endpoint when using the ‘Priority’ traffic routing method. Possible values are from 1 to 1000, lower values represent higher priority. This is an optional parameter.  If specified, it must be specified on all endpoints, and no two endpoints can share the same priority value."]
124    #[serde(default, skip_serializing_if = "Option::is_none")]
125    pub priority: Option<i64>,
126    #[doc = "Specifies the location of the external or nested endpoints when using the ‘Performance’ traffic routing method."]
127    #[serde(rename = "endpointLocation", default, skip_serializing_if = "Option::is_none")]
128    pub endpoint_location: Option<String>,
129    #[doc = "The monitoring status of the endpoint."]
130    #[serde(rename = "endpointMonitorStatus", default, skip_serializing_if = "Option::is_none")]
131    pub endpoint_monitor_status: Option<endpoint_properties::EndpointMonitorStatus>,
132    #[doc = "The minimum number of endpoints that must be available in the child profile in order for the parent profile to be considered available. Only applicable to endpoint of type 'NestedEndpoints'."]
133    #[serde(rename = "minChildEndpoints", default, skip_serializing_if = "Option::is_none")]
134    pub min_child_endpoints: Option<i64>,
135    #[doc = "The list of countries/regions mapped to this endpoint when using the ‘Geographic’ traffic routing method. Please consult Traffic Manager Geographic documentation for a full list of accepted values."]
136    #[serde(
137        rename = "geoMapping",
138        default,
139        deserialize_with = "azure_core::util::deserialize_null_as_default",
140        skip_serializing_if = "Vec::is_empty"
141    )]
142    pub geo_mapping: Vec<String>,
143    #[doc = "List of custom headers."]
144    #[serde(
145        rename = "customHeaders",
146        default,
147        deserialize_with = "azure_core::util::deserialize_null_as_default",
148        skip_serializing_if = "Vec::is_empty"
149    )]
150    pub custom_headers: Vec<serde_json::Value>,
151}
152impl EndpointProperties {
153    pub fn new() -> Self {
154        Self::default()
155    }
156}
157pub mod endpoint_properties {
158    use super::*;
159    #[doc = "The status of the endpoint. If the endpoint is Enabled, it is probed for endpoint health and is included in the traffic routing method."]
160    #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
161    #[serde(remote = "EndpointStatus")]
162    pub enum EndpointStatus {
163        Enabled,
164        Disabled,
165        #[serde(skip_deserializing)]
166        UnknownValue(String),
167    }
168    impl FromStr for EndpointStatus {
169        type Err = value::Error;
170        fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
171            Self::deserialize(s.into_deserializer())
172        }
173    }
174    impl<'de> Deserialize<'de> for EndpointStatus {
175        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
176        where
177            D: Deserializer<'de>,
178        {
179            let s = String::deserialize(deserializer)?;
180            let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s));
181            Ok(deserialized)
182        }
183    }
184    impl Serialize for EndpointStatus {
185        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
186        where
187            S: Serializer,
188        {
189            match self {
190                Self::Enabled => serializer.serialize_unit_variant("EndpointStatus", 0u32, "Enabled"),
191                Self::Disabled => serializer.serialize_unit_variant("EndpointStatus", 1u32, "Disabled"),
192                Self::UnknownValue(s) => serializer.serialize_str(s.as_str()),
193            }
194        }
195    }
196    #[doc = "The monitoring status of the endpoint."]
197    #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
198    #[serde(remote = "EndpointMonitorStatus")]
199    pub enum EndpointMonitorStatus {
200        CheckingEndpoint,
201        Online,
202        Degraded,
203        Disabled,
204        Inactive,
205        Stopped,
206        #[serde(skip_deserializing)]
207        UnknownValue(String),
208    }
209    impl FromStr for EndpointMonitorStatus {
210        type Err = value::Error;
211        fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
212            Self::deserialize(s.into_deserializer())
213        }
214    }
215    impl<'de> Deserialize<'de> for EndpointMonitorStatus {
216        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
217        where
218            D: Deserializer<'de>,
219        {
220            let s = String::deserialize(deserializer)?;
221            let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s));
222            Ok(deserialized)
223        }
224    }
225    impl Serialize for EndpointMonitorStatus {
226        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
227        where
228            S: Serializer,
229        {
230            match self {
231                Self::CheckingEndpoint => serializer.serialize_unit_variant("EndpointMonitorStatus", 0u32, "CheckingEndpoint"),
232                Self::Online => serializer.serialize_unit_variant("EndpointMonitorStatus", 1u32, "Online"),
233                Self::Degraded => serializer.serialize_unit_variant("EndpointMonitorStatus", 2u32, "Degraded"),
234                Self::Disabled => serializer.serialize_unit_variant("EndpointMonitorStatus", 3u32, "Disabled"),
235                Self::Inactive => serializer.serialize_unit_variant("EndpointMonitorStatus", 4u32, "Inactive"),
236                Self::Stopped => serializer.serialize_unit_variant("EndpointMonitorStatus", 5u32, "Stopped"),
237                Self::UnknownValue(s) => serializer.serialize_str(s.as_str()),
238            }
239        }
240    }
241}
242#[doc = "Class representing the properties of the Geographic hierarchy used with the Geographic traffic routing method."]
243#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
244pub struct GeographicHierarchyProperties {
245    #[doc = "Class representing a region in the Geographic hierarchy used with the Geographic traffic routing method."]
246    #[serde(rename = "geographicHierarchy", default, skip_serializing_if = "Option::is_none")]
247    pub geographic_hierarchy: Option<Region>,
248}
249impl GeographicHierarchyProperties {
250    pub fn new() -> Self {
251        Self::default()
252    }
253}
254#[doc = "Class which is a sparse representation of a Traffic Manager endpoint."]
255#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
256pub struct HeatMapEndpoint {
257    #[doc = "The ARM Resource ID of this Traffic Manager endpoint."]
258    #[serde(rename = "resourceId", default, skip_serializing_if = "Option::is_none")]
259    pub resource_id: Option<String>,
260    #[doc = "A number uniquely identifying this endpoint in query experiences."]
261    #[serde(rename = "endpointId", default, skip_serializing_if = "Option::is_none")]
262    pub endpoint_id: Option<i64>,
263}
264impl HeatMapEndpoint {
265    pub fn new() -> Self {
266        Self::default()
267    }
268}
269#[doc = "Class representing a Traffic Manager HeatMap."]
270#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
271pub struct HeatMapModel {
272    #[serde(flatten)]
273    pub proxy_resource: ProxyResource,
274    #[doc = "Class representing a Traffic Manager HeatMap properties."]
275    #[serde(default, skip_serializing_if = "Option::is_none")]
276    pub properties: Option<HeatMapProperties>,
277}
278impl HeatMapModel {
279    pub fn new() -> Self {
280        Self::default()
281    }
282}
283#[doc = "Class representing a Traffic Manager HeatMap properties."]
284#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
285pub struct HeatMapProperties {
286    #[doc = "The beginning of the time window for this HeatMap, inclusive."]
287    #[serde(rename = "startTime", default, with = "azure_core::date::rfc3339::option")]
288    pub start_time: Option<::time::OffsetDateTime>,
289    #[doc = "The ending of the time window for this HeatMap, exclusive."]
290    #[serde(rename = "endTime", default, with = "azure_core::date::rfc3339::option")]
291    pub end_time: Option<::time::OffsetDateTime>,
292    #[doc = "The endpoints used in this HeatMap calculation."]
293    #[serde(
294        default,
295        deserialize_with = "azure_core::util::deserialize_null_as_default",
296        skip_serializing_if = "Vec::is_empty"
297    )]
298    pub endpoints: Vec<HeatMapEndpoint>,
299    #[doc = "The traffic flows produced in this HeatMap calculation."]
300    #[serde(
301        rename = "trafficFlows",
302        default,
303        deserialize_with = "azure_core::util::deserialize_null_as_default",
304        skip_serializing_if = "Vec::is_empty"
305    )]
306    pub traffic_flows: Vec<TrafficFlow>,
307}
308impl HeatMapProperties {
309    pub fn new() -> Self {
310        Self::default()
311    }
312}
313#[doc = "Class containing endpoint monitoring settings in a Traffic Manager profile."]
314#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
315pub struct MonitorConfig {
316    #[doc = "The profile-level monitoring status of the Traffic Manager profile."]
317    #[serde(rename = "profileMonitorStatus", default, skip_serializing_if = "Option::is_none")]
318    pub profile_monitor_status: Option<monitor_config::ProfileMonitorStatus>,
319    #[doc = "The protocol (HTTP, HTTPS or TCP) used to probe for endpoint health."]
320    #[serde(default, skip_serializing_if = "Option::is_none")]
321    pub protocol: Option<monitor_config::Protocol>,
322    #[doc = "The TCP port used to probe for endpoint health."]
323    #[serde(default, skip_serializing_if = "Option::is_none")]
324    pub port: Option<i64>,
325    #[doc = "The path relative to the endpoint domain name used to probe for endpoint health."]
326    #[serde(default, skip_serializing_if = "Option::is_none")]
327    pub path: Option<String>,
328    #[doc = "The monitor interval for endpoints in this profile. This is the interval at which Traffic Manager will check the health of each endpoint in this profile."]
329    #[serde(rename = "intervalInSeconds", default, skip_serializing_if = "Option::is_none")]
330    pub interval_in_seconds: Option<i64>,
331    #[doc = "The monitor timeout for endpoints in this profile. This is the time that Traffic Manager allows endpoints in this profile to response to the health check."]
332    #[serde(rename = "timeoutInSeconds", default, skip_serializing_if = "Option::is_none")]
333    pub timeout_in_seconds: Option<i64>,
334    #[doc = "The number of consecutive failed health check that Traffic Manager tolerates before declaring an endpoint in this profile Degraded after the next failed health check."]
335    #[serde(rename = "toleratedNumberOfFailures", default, skip_serializing_if = "Option::is_none")]
336    pub tolerated_number_of_failures: Option<i64>,
337    #[doc = "List of custom headers."]
338    #[serde(
339        rename = "customHeaders",
340        default,
341        deserialize_with = "azure_core::util::deserialize_null_as_default",
342        skip_serializing_if = "Vec::is_empty"
343    )]
344    pub custom_headers: Vec<serde_json::Value>,
345    #[doc = "List of expected status code ranges."]
346    #[serde(
347        rename = "expectedStatusCodeRanges",
348        default,
349        deserialize_with = "azure_core::util::deserialize_null_as_default",
350        skip_serializing_if = "Vec::is_empty"
351    )]
352    pub expected_status_code_ranges: Vec<serde_json::Value>,
353}
354impl MonitorConfig {
355    pub fn new() -> Self {
356        Self::default()
357    }
358}
359pub mod monitor_config {
360    use super::*;
361    #[doc = "The profile-level monitoring status of the Traffic Manager profile."]
362    #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
363    #[serde(remote = "ProfileMonitorStatus")]
364    pub enum ProfileMonitorStatus {
365        CheckingEndpoints,
366        Online,
367        Degraded,
368        Disabled,
369        Inactive,
370        #[serde(skip_deserializing)]
371        UnknownValue(String),
372    }
373    impl FromStr for ProfileMonitorStatus {
374        type Err = value::Error;
375        fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
376            Self::deserialize(s.into_deserializer())
377        }
378    }
379    impl<'de> Deserialize<'de> for ProfileMonitorStatus {
380        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
381        where
382            D: Deserializer<'de>,
383        {
384            let s = String::deserialize(deserializer)?;
385            let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s));
386            Ok(deserialized)
387        }
388    }
389    impl Serialize for ProfileMonitorStatus {
390        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
391        where
392            S: Serializer,
393        {
394            match self {
395                Self::CheckingEndpoints => serializer.serialize_unit_variant("ProfileMonitorStatus", 0u32, "CheckingEndpoints"),
396                Self::Online => serializer.serialize_unit_variant("ProfileMonitorStatus", 1u32, "Online"),
397                Self::Degraded => serializer.serialize_unit_variant("ProfileMonitorStatus", 2u32, "Degraded"),
398                Self::Disabled => serializer.serialize_unit_variant("ProfileMonitorStatus", 3u32, "Disabled"),
399                Self::Inactive => serializer.serialize_unit_variant("ProfileMonitorStatus", 4u32, "Inactive"),
400                Self::UnknownValue(s) => serializer.serialize_str(s.as_str()),
401            }
402        }
403    }
404    #[doc = "The protocol (HTTP, HTTPS or TCP) used to probe for endpoint health."]
405    #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
406    #[serde(remote = "Protocol")]
407    pub enum Protocol {
408        #[serde(rename = "HTTP")]
409        Http,
410        #[serde(rename = "HTTPS")]
411        Https,
412        #[serde(rename = "TCP")]
413        Tcp,
414        #[serde(skip_deserializing)]
415        UnknownValue(String),
416    }
417    impl FromStr for Protocol {
418        type Err = value::Error;
419        fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
420            Self::deserialize(s.into_deserializer())
421        }
422    }
423    impl<'de> Deserialize<'de> for Protocol {
424        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
425        where
426            D: Deserializer<'de>,
427        {
428            let s = String::deserialize(deserializer)?;
429            let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s));
430            Ok(deserialized)
431        }
432    }
433    impl Serialize for Protocol {
434        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
435        where
436            S: Serializer,
437        {
438            match self {
439                Self::Http => serializer.serialize_unit_variant("Protocol", 0u32, "HTTP"),
440                Self::Https => serializer.serialize_unit_variant("Protocol", 1u32, "HTTPS"),
441                Self::Tcp => serializer.serialize_unit_variant("Protocol", 2u32, "TCP"),
442                Self::UnknownValue(s) => serializer.serialize_str(s.as_str()),
443            }
444        }
445    }
446}
447#[doc = "Class representing a Traffic Manager profile."]
448#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
449pub struct Profile {
450    #[serde(flatten)]
451    pub tracked_resource: TrackedResource,
452    #[doc = "Class representing the Traffic Manager profile properties."]
453    #[serde(default, skip_serializing_if = "Option::is_none")]
454    pub properties: Option<ProfileProperties>,
455}
456impl Profile {
457    pub fn new() -> Self {
458        Self::default()
459    }
460}
461#[doc = "The list Traffic Manager profiles operation response."]
462#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
463pub struct ProfileListResult {
464    #[doc = "Gets the list of Traffic manager profiles."]
465    #[serde(
466        default,
467        deserialize_with = "azure_core::util::deserialize_null_as_default",
468        skip_serializing_if = "Vec::is_empty"
469    )]
470    pub value: Vec<Profile>,
471}
472impl azure_core::Continuable for ProfileListResult {
473    type Continuation = String;
474    fn continuation(&self) -> Option<Self::Continuation> {
475        None
476    }
477}
478impl ProfileListResult {
479    pub fn new() -> Self {
480        Self::default()
481    }
482}
483#[doc = "Class representing the Traffic Manager profile properties."]
484#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
485pub struct ProfileProperties {
486    #[doc = "The status of the Traffic Manager profile."]
487    #[serde(rename = "profileStatus", default, skip_serializing_if = "Option::is_none")]
488    pub profile_status: Option<profile_properties::ProfileStatus>,
489    #[doc = "The traffic routing method of the Traffic Manager profile."]
490    #[serde(rename = "trafficRoutingMethod", default, skip_serializing_if = "Option::is_none")]
491    pub traffic_routing_method: Option<profile_properties::TrafficRoutingMethod>,
492    #[doc = "Class containing DNS settings in a Traffic Manager profile."]
493    #[serde(rename = "dnsConfig", default, skip_serializing_if = "Option::is_none")]
494    pub dns_config: Option<DnsConfig>,
495    #[doc = "Class containing endpoint monitoring settings in a Traffic Manager profile."]
496    #[serde(rename = "monitorConfig", default, skip_serializing_if = "Option::is_none")]
497    pub monitor_config: Option<MonitorConfig>,
498    #[doc = "The list of endpoints in the Traffic Manager profile."]
499    #[serde(
500        default,
501        deserialize_with = "azure_core::util::deserialize_null_as_default",
502        skip_serializing_if = "Vec::is_empty"
503    )]
504    pub endpoints: Vec<Endpoint>,
505    #[doc = "Indicates whether Traffic View is 'Enabled' or 'Disabled' for the Traffic Manager profile. Null, indicates 'Disabled'. Enabling this feature will increase the cost of the Traffic Manage profile."]
506    #[serde(rename = "trafficViewEnrollmentStatus", default, skip_serializing_if = "Option::is_none")]
507    pub traffic_view_enrollment_status: Option<profile_properties::TrafficViewEnrollmentStatus>,
508}
509impl ProfileProperties {
510    pub fn new() -> Self {
511        Self::default()
512    }
513}
514pub mod profile_properties {
515    use super::*;
516    #[doc = "The status of the Traffic Manager profile."]
517    #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
518    #[serde(remote = "ProfileStatus")]
519    pub enum ProfileStatus {
520        Enabled,
521        Disabled,
522        #[serde(skip_deserializing)]
523        UnknownValue(String),
524    }
525    impl FromStr for ProfileStatus {
526        type Err = value::Error;
527        fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
528            Self::deserialize(s.into_deserializer())
529        }
530    }
531    impl<'de> Deserialize<'de> for ProfileStatus {
532        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
533        where
534            D: Deserializer<'de>,
535        {
536            let s = String::deserialize(deserializer)?;
537            let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s));
538            Ok(deserialized)
539        }
540    }
541    impl Serialize for ProfileStatus {
542        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
543        where
544            S: Serializer,
545        {
546            match self {
547                Self::Enabled => serializer.serialize_unit_variant("ProfileStatus", 0u32, "Enabled"),
548                Self::Disabled => serializer.serialize_unit_variant("ProfileStatus", 1u32, "Disabled"),
549                Self::UnknownValue(s) => serializer.serialize_str(s.as_str()),
550            }
551        }
552    }
553    #[doc = "The traffic routing method of the Traffic Manager profile."]
554    #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
555    #[serde(remote = "TrafficRoutingMethod")]
556    pub enum TrafficRoutingMethod {
557        Performance,
558        Priority,
559        Weighted,
560        Geographic,
561        #[serde(skip_deserializing)]
562        UnknownValue(String),
563    }
564    impl FromStr for TrafficRoutingMethod {
565        type Err = value::Error;
566        fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
567            Self::deserialize(s.into_deserializer())
568        }
569    }
570    impl<'de> Deserialize<'de> for TrafficRoutingMethod {
571        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
572        where
573            D: Deserializer<'de>,
574        {
575            let s = String::deserialize(deserializer)?;
576            let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s));
577            Ok(deserialized)
578        }
579    }
580    impl Serialize for TrafficRoutingMethod {
581        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
582        where
583            S: Serializer,
584        {
585            match self {
586                Self::Performance => serializer.serialize_unit_variant("TrafficRoutingMethod", 0u32, "Performance"),
587                Self::Priority => serializer.serialize_unit_variant("TrafficRoutingMethod", 1u32, "Priority"),
588                Self::Weighted => serializer.serialize_unit_variant("TrafficRoutingMethod", 2u32, "Weighted"),
589                Self::Geographic => serializer.serialize_unit_variant("TrafficRoutingMethod", 3u32, "Geographic"),
590                Self::UnknownValue(s) => serializer.serialize_str(s.as_str()),
591            }
592        }
593    }
594    #[doc = "Indicates whether Traffic View is 'Enabled' or 'Disabled' for the Traffic Manager profile. Null, indicates 'Disabled'. Enabling this feature will increase the cost of the Traffic Manage profile."]
595    #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
596    #[serde(remote = "TrafficViewEnrollmentStatus")]
597    pub enum TrafficViewEnrollmentStatus {
598        Enabled,
599        Disabled,
600        #[serde(skip_deserializing)]
601        UnknownValue(String),
602    }
603    impl FromStr for TrafficViewEnrollmentStatus {
604        type Err = value::Error;
605        fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
606            Self::deserialize(s.into_deserializer())
607        }
608    }
609    impl<'de> Deserialize<'de> for TrafficViewEnrollmentStatus {
610        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
611        where
612            D: Deserializer<'de>,
613        {
614            let s = String::deserialize(deserializer)?;
615            let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s));
616            Ok(deserialized)
617        }
618    }
619    impl Serialize for TrafficViewEnrollmentStatus {
620        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
621        where
622            S: Serializer,
623        {
624            match self {
625                Self::Enabled => serializer.serialize_unit_variant("TrafficViewEnrollmentStatus", 0u32, "Enabled"),
626                Self::Disabled => serializer.serialize_unit_variant("TrafficViewEnrollmentStatus", 1u32, "Disabled"),
627                Self::UnknownValue(s) => serializer.serialize_str(s.as_str()),
628            }
629        }
630    }
631}
632#[doc = "The resource model definition for a ARM proxy resource. It will have everything other than required location and tags"]
633#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
634pub struct ProxyResource {
635    #[serde(flatten)]
636    pub resource: Resource,
637}
638impl ProxyResource {
639    pub fn new() -> Self {
640        Self::default()
641    }
642}
643#[doc = "Class representing a Traffic Manager HeatMap query experience properties."]
644#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
645pub struct QueryExperience {
646    #[doc = "The id of the endpoint from the 'endpoints' array which these queries were routed to."]
647    #[serde(rename = "endpointId")]
648    pub endpoint_id: i64,
649    #[doc = "The number of queries originating from this location."]
650    #[serde(rename = "queryCount")]
651    pub query_count: i64,
652    #[doc = "The latency experienced by queries originating from this location."]
653    #[serde(default, skip_serializing_if = "Option::is_none")]
654    pub latency: Option<f64>,
655}
656impl QueryExperience {
657    pub fn new(endpoint_id: i64, query_count: i64) -> Self {
658        Self {
659            endpoint_id,
660            query_count,
661            latency: None,
662        }
663    }
664}
665#[doc = "Class representing a region in the Geographic hierarchy used with the Geographic traffic routing method."]
666#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
667pub struct Region {
668    #[doc = "The code of the region"]
669    #[serde(default, skip_serializing_if = "Option::is_none")]
670    pub code: Option<String>,
671    #[doc = "The name of the region"]
672    #[serde(default, skip_serializing_if = "Option::is_none")]
673    pub name: Option<String>,
674    #[doc = "The list of Regions grouped under this Region in the Geographic Hierarchy."]
675    #[serde(
676        default,
677        deserialize_with = "azure_core::util::deserialize_null_as_default",
678        skip_serializing_if = "Vec::is_empty"
679    )]
680    pub regions: Vec<Region>,
681}
682impl Region {
683    pub fn new() -> Self {
684        Self::default()
685    }
686}
687#[doc = "The core properties of ARM resources"]
688#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
689pub struct Resource {
690    #[doc = "Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{resourceName}"]
691    #[serde(default, skip_serializing_if = "Option::is_none")]
692    pub id: Option<String>,
693    #[doc = "The name of the resource"]
694    #[serde(default, skip_serializing_if = "Option::is_none")]
695    pub name: Option<String>,
696    #[doc = "The type of the resource. Ex- Microsoft.Network/trafficManagerProfiles."]
697    #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
698    pub type_: Option<String>,
699}
700impl Resource {
701    pub fn new() -> Self {
702        Self::default()
703    }
704}
705#[doc = "The resource model definition for a ARM tracked top level resource"]
706#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
707pub struct TrackedResource {
708    #[serde(flatten)]
709    pub resource: Resource,
710    #[doc = "Resource tags."]
711    #[serde(default, skip_serializing_if = "Option::is_none")]
712    pub tags: Option<serde_json::Value>,
713    #[doc = "The Azure Region where the resource lives"]
714    #[serde(default, skip_serializing_if = "Option::is_none")]
715    pub location: Option<String>,
716}
717impl TrackedResource {
718    pub fn new() -> Self {
719        Self::default()
720    }
721}
722#[doc = "Class representing a Traffic Manager HeatMap traffic flow properties."]
723#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
724pub struct TrafficFlow {
725    #[doc = "The IP address that this query experience originated from."]
726    #[serde(rename = "sourceIp", default, skip_serializing_if = "Option::is_none")]
727    pub source_ip: Option<String>,
728    #[doc = "The approximate latitude that these queries originated from."]
729    #[serde(default, skip_serializing_if = "Option::is_none")]
730    pub latitude: Option<f64>,
731    #[doc = "The approximate longitude that these queries originated from."]
732    #[serde(default, skip_serializing_if = "Option::is_none")]
733    pub longitude: Option<f64>,
734    #[doc = "The query experiences produced in this HeatMap calculation."]
735    #[serde(
736        rename = "queryExperiences",
737        default,
738        deserialize_with = "azure_core::util::deserialize_null_as_default",
739        skip_serializing_if = "Vec::is_empty"
740    )]
741    pub query_experiences: Vec<QueryExperience>,
742}
743impl TrafficFlow {
744    pub fn new() -> Self {
745        Self::default()
746    }
747}
748#[doc = "Class representing the Geographic hierarchy used with the Geographic traffic routing method."]
749#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
750pub struct TrafficManagerGeographicHierarchy {
751    #[serde(flatten)]
752    pub proxy_resource: ProxyResource,
753    #[doc = "Class representing the properties of the Geographic hierarchy used with the Geographic traffic routing method."]
754    #[serde(default, skip_serializing_if = "Option::is_none")]
755    pub properties: Option<GeographicHierarchyProperties>,
756}
757impl TrafficManagerGeographicHierarchy {
758    pub fn new() -> Self {
759        Self::default()
760    }
761}
762#[doc = "Class representing a Traffic Manager Name Availability response."]
763#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
764pub struct TrafficManagerNameAvailability {
765    #[doc = "The relative name."]
766    #[serde(default, skip_serializing_if = "Option::is_none")]
767    pub name: Option<String>,
768    #[doc = "Traffic Manager profile resource type."]
769    #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
770    pub type_: Option<String>,
771    #[doc = "Describes whether the relative name is available or not."]
772    #[serde(rename = "nameAvailable", default, skip_serializing_if = "Option::is_none")]
773    pub name_available: Option<bool>,
774    #[doc = "The reason why the name is not available, when applicable."]
775    #[serde(default, skip_serializing_if = "Option::is_none")]
776    pub reason: Option<String>,
777    #[doc = "Descriptive message that explains why the name is not available, when applicable."]
778    #[serde(default, skip_serializing_if = "Option::is_none")]
779    pub message: Option<String>,
780}
781impl TrafficManagerNameAvailability {
782    pub fn new() -> Self {
783        Self::default()
784    }
785}