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#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
7pub struct AccessPolicyCreateOrUpdateParameters {
8 pub properties: AccessPolicyResourceProperties,
9}
10impl AccessPolicyCreateOrUpdateParameters {
11 pub fn new(properties: AccessPolicyResourceProperties) -> Self {
12 Self { properties }
13 }
14}
15#[doc = "The response of the List access policies operation."]
16#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
17pub struct AccessPolicyListResponse {
18 #[doc = "Result of the List access policies operation."]
19 #[serde(
20 default,
21 deserialize_with = "azure_core::util::deserialize_null_as_default",
22 skip_serializing_if = "Vec::is_empty"
23 )]
24 pub value: Vec<AccessPolicyResource>,
25}
26impl AccessPolicyListResponse {
27 pub fn new() -> Self {
28 Self::default()
29 }
30}
31#[doc = "An object that represents a set of mutable access policy resource properties."]
32#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
33pub struct AccessPolicyMutableProperties {
34 #[doc = "An description of the access policy."]
35 #[serde(default, skip_serializing_if = "Option::is_none")]
36 pub description: Option<String>,
37 #[doc = "The list of roles the principal is assigned on the environment."]
38 #[serde(
39 default,
40 deserialize_with = "azure_core::util::deserialize_null_as_default",
41 skip_serializing_if = "Vec::is_empty"
42 )]
43 pub roles: Vec<String>,
44}
45impl AccessPolicyMutableProperties {
46 pub fn new() -> Self {
47 Self::default()
48 }
49}
50#[doc = "An access policy is used to grant users and applications access to the environment. Roles are assigned to service principals in Azure Active Directory. These roles define the actions the principal can perform through the Time Series Insights data plane APIs."]
51#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
52pub struct AccessPolicyResource {
53 #[serde(flatten)]
54 pub resource: Resource,
55 #[serde(default, skip_serializing_if = "Option::is_none")]
56 pub properties: Option<AccessPolicyResourceProperties>,
57}
58impl AccessPolicyResource {
59 pub fn new() -> Self {
60 Self::default()
61 }
62}
63#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
64pub struct AccessPolicyResourceProperties {
65 #[doc = "The objectId of the principal in Azure Active Directory."]
66 #[serde(rename = "principalObjectId", default, skip_serializing_if = "Option::is_none")]
67 pub principal_object_id: Option<String>,
68 #[doc = "An description of the access policy."]
69 #[serde(default, skip_serializing_if = "Option::is_none")]
70 pub description: Option<String>,
71 #[doc = "The list of roles the principal is assigned on the environment."]
72 #[serde(
73 default,
74 deserialize_with = "azure_core::util::deserialize_null_as_default",
75 skip_serializing_if = "Vec::is_empty"
76 )]
77 pub roles: Vec<String>,
78}
79impl AccessPolicyResourceProperties {
80 pub fn new() -> Self {
81 Self::default()
82 }
83}
84#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
85pub struct AccessPolicyUpdateParameters {
86 #[doc = "An object that represents a set of mutable access policy resource properties."]
87 #[serde(default, skip_serializing_if = "Option::is_none")]
88 pub properties: Option<AccessPolicyMutableProperties>,
89}
90impl AccessPolicyUpdateParameters {
91 pub fn new() -> Self {
92 Self::default()
93 }
94}
95#[doc = "Properties of an event source that reads events from an event broker in Azure."]
96#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
97pub struct AzureEventSourceProperties {
98 #[serde(flatten)]
99 pub event_source_common_properties: EventSourceCommonProperties,
100 #[doc = "The resource id of the event source in Azure Resource Manager."]
101 #[serde(rename = "eventSourceResourceId")]
102 pub event_source_resource_id: String,
103}
104impl AzureEventSourceProperties {
105 pub fn new(event_source_resource_id: String) -> Self {
106 Self {
107 event_source_common_properties: EventSourceCommonProperties::default(),
108 event_source_resource_id,
109 }
110 }
111}
112#[doc = "Contains information about an API error."]
113#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
114pub struct CloudError {
115 #[doc = "Describes a particular API error with an error code and a message."]
116 #[serde(default, skip_serializing_if = "Option::is_none")]
117 pub error: Option<CloudErrorBody>,
118}
119impl azure_core::Continuable for CloudError {
120 type Continuation = String;
121 fn continuation(&self) -> Option<Self::Continuation> {
122 None
123 }
124}
125impl CloudError {
126 pub fn new() -> Self {
127 Self::default()
128 }
129}
130#[doc = "Describes a particular API error with an error code and a message."]
131#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
132pub struct CloudErrorBody {
133 #[doc = "An error code that describes the error condition more precisely than an HTTP status code. Can be used to programmatically handle specific error cases."]
134 #[serde(default, skip_serializing_if = "Option::is_none")]
135 pub code: Option<String>,
136 #[doc = "A message that describes the error in detail and provides debugging information."]
137 #[serde(default, skip_serializing_if = "Option::is_none")]
138 pub message: Option<String>,
139 #[doc = "The target of the particular error (for example, the name of the property in error)."]
140 #[serde(default, skip_serializing_if = "Option::is_none")]
141 pub target: Option<String>,
142 #[doc = "Contains nested errors that are related to this error."]
143 #[serde(
144 default,
145 deserialize_with = "azure_core::util::deserialize_null_as_default",
146 skip_serializing_if = "Vec::is_empty"
147 )]
148 pub details: Vec<CloudErrorBody>,
149}
150impl CloudErrorBody {
151 pub fn new() -> Self {
152 Self::default()
153 }
154}
155#[doc = "Properties required to create any resource tracked by Azure Resource Manager."]
156#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
157pub struct CreateOrUpdateTrackedResourceProperties {
158 #[doc = "The location of the resource."]
159 pub location: String,
160 #[doc = "Key-value pairs of additional properties for the resource."]
161 #[serde(default, skip_serializing_if = "Option::is_none")]
162 pub tags: Option<serde_json::Value>,
163}
164impl CreateOrUpdateTrackedResourceProperties {
165 pub fn new(location: String) -> Self {
166 Self { location, tags: None }
167 }
168}
169#[doc = "Dimension of blobs, possibly be blob type or access tier."]
170#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
171pub struct Dimension {
172 #[doc = "Display name of dimension."]
173 #[serde(default, skip_serializing_if = "Option::is_none")]
174 pub name: Option<String>,
175 #[doc = "Display name of dimension."]
176 #[serde(rename = "displayName", default, skip_serializing_if = "Option::is_none")]
177 pub display_name: Option<String>,
178}
179impl Dimension {
180 pub fn new() -> Self {
181 Self::default()
182 }
183}
184#[doc = "Parameters supplied to the CreateOrUpdate Environment operation."]
185#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
186pub struct EnvironmentCreateOrUpdateParameters {
187 #[serde(flatten)]
188 pub create_or_update_tracked_resource_properties: CreateOrUpdateTrackedResourceProperties,
189 #[doc = "The sku determines the type of environment, either Gen1 (S1 or S2) or Gen2 (L1). For Gen1 environments the sku determines the capacity of the environment, the ingress rate, and the billing rate."]
190 pub sku: Sku,
191}
192impl EnvironmentCreateOrUpdateParameters {
193 pub fn new(create_or_update_tracked_resource_properties: CreateOrUpdateTrackedResourceProperties, sku: Sku) -> Self {
194 Self {
195 create_or_update_tracked_resource_properties,
196 sku,
197 }
198 }
199}
200#[doc = "The kind of the environment."]
201#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
202#[serde(tag = "kind")]
203pub enum EnvironmentCreateOrUpdateParametersUnion {
204 Gen1(Gen1EnvironmentCreateOrUpdateParameters),
205 Gen2(Gen2EnvironmentCreateOrUpdateParameters),
206}
207#[doc = "The response of the List Environments operation."]
208#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
209pub struct EnvironmentListResponse {
210 #[doc = "Result of the List Environments operation."]
211 #[serde(
212 default,
213 deserialize_with = "azure_core::util::deserialize_null_as_default",
214 skip_serializing_if = "Vec::is_empty"
215 )]
216 pub value: Vec<EnvironmentResourceUnion>,
217}
218impl EnvironmentListResponse {
219 pub fn new() -> Self {
220 Self::default()
221 }
222}
223#[doc = "An environment is a set of time-series data available for query, and is the top level Azure Time Series Insights resource."]
224#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
225pub struct EnvironmentResource {
226 #[serde(flatten)]
227 pub tracked_resource: TrackedResource,
228 #[doc = "The sku determines the type of environment, either Gen1 (S1 or S2) or Gen2 (L1). For Gen1 environments the sku determines the capacity of the environment, the ingress rate, and the billing rate."]
229 pub sku: Sku,
230}
231impl EnvironmentResource {
232 pub fn new(tracked_resource: TrackedResource, sku: Sku) -> Self {
233 Self { tracked_resource, sku }
234 }
235}
236#[doc = "The kind of the environment."]
237#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
238#[serde(tag = "kind")]
239pub enum EnvironmentResourceUnion {
240 Gen1(Gen1EnvironmentResource),
241 Gen2(Gen2EnvironmentResource),
242}
243#[doc = "Properties of the environment."]
244#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
245pub struct EnvironmentResourceProperties {
246 #[serde(flatten)]
247 pub resource_properties: ResourceProperties,
248 #[doc = "An id used to access the environment data, e.g. to query the environment's events or upload reference data for the environment."]
249 #[serde(rename = "dataAccessId", default, skip_serializing_if = "Option::is_none")]
250 pub data_access_id: Option<String>,
251 #[doc = "The fully qualified domain name used to access the environment data, e.g. to query the environment's events or upload reference data for the environment."]
252 #[serde(rename = "dataAccessFqdn", default, skip_serializing_if = "Option::is_none")]
253 pub data_access_fqdn: Option<String>,
254 #[doc = "An object that represents the status of the environment, and its internal state in the Time Series Insights service."]
255 #[serde(default, skip_serializing_if = "Option::is_none")]
256 pub status: Option<EnvironmentStatus>,
257}
258impl EnvironmentResourceProperties {
259 pub fn new() -> Self {
260 Self::default()
261 }
262}
263#[doc = "An object that contains the details about an environment's state."]
264#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
265pub struct EnvironmentStateDetails {
266 #[doc = "Contains the code that represents the reason of an environment being in a particular state. Can be used to programmatically handle specific cases."]
267 #[serde(default, skip_serializing_if = "Option::is_none")]
268 pub code: Option<String>,
269 #[doc = "A message that describes the state in detail."]
270 #[serde(default, skip_serializing_if = "Option::is_none")]
271 pub message: Option<String>,
272}
273impl EnvironmentStateDetails {
274 pub fn new() -> Self {
275 Self::default()
276 }
277}
278#[doc = "An object that represents the status of the environment, and its internal state in the Time Series Insights service."]
279#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
280pub struct EnvironmentStatus {
281 #[doc = "An object that represents the status of ingress on an environment."]
282 #[serde(default, skip_serializing_if = "Option::is_none")]
283 pub ingress: Option<IngressEnvironmentStatus>,
284 #[doc = "An object that represents the status of warm storage on an environment."]
285 #[serde(rename = "warmStorage", default, skip_serializing_if = "Option::is_none")]
286 pub warm_storage: Option<WarmStorageEnvironmentStatus>,
287}
288impl EnvironmentStatus {
289 pub fn new() -> Self {
290 Self::default()
291 }
292}
293#[doc = "Parameters supplied to the Update Environment operation."]
294#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
295pub struct EnvironmentUpdateParameters {
296 #[doc = "Key-value pairs of additional properties for the environment."]
297 #[serde(default, skip_serializing_if = "Option::is_none")]
298 pub tags: Option<serde_json::Value>,
299}
300impl EnvironmentUpdateParameters {
301 pub fn new() -> Self {
302 Self { tags: None }
303 }
304}
305#[doc = "The kind of the environment."]
306#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
307#[serde(tag = "kind")]
308pub enum EnvironmentUpdateParametersUnion {
309 Gen1(Gen1EnvironmentUpdateParameters),
310 Gen2(Gen2EnvironmentUpdateParameters),
311}
312#[doc = "Properties of the EventHub event source."]
313#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
314pub struct EventHubEventSourceCommonProperties {
315 #[serde(flatten)]
316 pub azure_event_source_properties: AzureEventSourceProperties,
317 #[doc = "The name of the service bus that contains the event hub."]
318 #[serde(rename = "serviceBusNamespace")]
319 pub service_bus_namespace: String,
320 #[doc = "The name of the event hub."]
321 #[serde(rename = "eventHubName")]
322 pub event_hub_name: String,
323 #[doc = "The name of the event hub's consumer group that holds the partitions from which events will be read."]
324 #[serde(rename = "consumerGroupName")]
325 pub consumer_group_name: String,
326 #[doc = "The name of the SAS key that grants the Time Series Insights service access to the event hub. The shared access policies for this key must grant 'Listen' permissions to the event hub."]
327 #[serde(rename = "keyName")]
328 pub key_name: String,
329}
330impl EventHubEventSourceCommonProperties {
331 pub fn new(
332 azure_event_source_properties: AzureEventSourceProperties,
333 service_bus_namespace: String,
334 event_hub_name: String,
335 consumer_group_name: String,
336 key_name: String,
337 ) -> Self {
338 Self {
339 azure_event_source_properties,
340 service_bus_namespace,
341 event_hub_name,
342 consumer_group_name,
343 key_name,
344 }
345 }
346}
347#[doc = "Parameters supplied to the Create or Update Event Source operation for an EventHub event source."]
348#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
349pub struct EventHubEventSourceCreateOrUpdateParameters {
350 #[serde(flatten)]
351 pub event_source_create_or_update_parameters: EventSourceCreateOrUpdateParameters,
352 #[doc = "Properties of the EventHub event source that are required on create or update requests."]
353 pub properties: EventHubEventSourceCreationProperties,
354}
355impl EventHubEventSourceCreateOrUpdateParameters {
356 pub fn new(
357 event_source_create_or_update_parameters: EventSourceCreateOrUpdateParameters,
358 properties: EventHubEventSourceCreationProperties,
359 ) -> Self {
360 Self {
361 event_source_create_or_update_parameters,
362 properties,
363 }
364 }
365}
366#[doc = "Properties of the EventHub event source that are required on create or update requests."]
367#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
368pub struct EventHubEventSourceCreationProperties {
369 #[serde(flatten)]
370 pub event_hub_event_source_common_properties: EventHubEventSourceCommonProperties,
371 #[doc = "The value of the shared access key that grants the Time Series Insights service read access to the event hub. This property is not shown in event source responses."]
372 #[serde(rename = "sharedAccessKey")]
373 pub shared_access_key: String,
374}
375impl EventHubEventSourceCreationProperties {
376 pub fn new(event_hub_event_source_common_properties: EventHubEventSourceCommonProperties, shared_access_key: String) -> Self {
377 Self {
378 event_hub_event_source_common_properties,
379 shared_access_key,
380 }
381 }
382}
383#[doc = "An object that represents a set of mutable EventHub event source resource properties."]
384#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
385pub struct EventHubEventSourceMutableProperties {
386 #[serde(flatten)]
387 pub event_source_mutable_properties: EventSourceMutableProperties,
388 #[doc = "The value of the shared access key that grants the Time Series Insights service read access to the event hub. This property is not shown in event source responses."]
389 #[serde(rename = "sharedAccessKey", default, skip_serializing_if = "Option::is_none")]
390 pub shared_access_key: Option<String>,
391}
392impl EventHubEventSourceMutableProperties {
393 pub fn new() -> Self {
394 Self::default()
395 }
396}
397#[doc = "An event source that receives its data from an Azure EventHub."]
398#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
399pub struct EventHubEventSourceResource {
400 #[serde(flatten)]
401 pub event_source_resource: EventSourceResource,
402 #[doc = "Properties of the EventHub event source resource."]
403 pub properties: EventHubEventSourceResourceProperties,
404}
405impl EventHubEventSourceResource {
406 pub fn new(event_source_resource: EventSourceResource, properties: EventHubEventSourceResourceProperties) -> Self {
407 Self {
408 event_source_resource,
409 properties,
410 }
411 }
412}
413#[doc = "Properties of the EventHub event source resource."]
414#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
415pub struct EventHubEventSourceResourceProperties {
416 #[serde(flatten)]
417 pub event_hub_event_source_common_properties: EventHubEventSourceCommonProperties,
418}
419impl EventHubEventSourceResourceProperties {
420 pub fn new(event_hub_event_source_common_properties: EventHubEventSourceCommonProperties) -> Self {
421 Self {
422 event_hub_event_source_common_properties,
423 }
424 }
425}
426#[doc = "Parameters supplied to the Update Event Source operation to update an EventHub event source."]
427#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
428pub struct EventHubEventSourceUpdateParameters {
429 #[serde(flatten)]
430 pub event_source_update_parameters: EventSourceUpdateParameters,
431 #[doc = "An object that represents a set of mutable EventHub event source resource properties."]
432 #[serde(default, skip_serializing_if = "Option::is_none")]
433 pub properties: Option<EventHubEventSourceMutableProperties>,
434}
435impl EventHubEventSourceUpdateParameters {
436 pub fn new(event_source_update_parameters: EventSourceUpdateParameters) -> Self {
437 Self {
438 event_source_update_parameters,
439 properties: None,
440 }
441 }
442}
443#[doc = "Properties of the event source."]
444#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
445pub struct EventSourceCommonProperties {
446 #[serde(flatten)]
447 pub resource_properties: ResourceProperties,
448 #[doc = "The event property that will be used as the event source's timestamp. If a value isn't specified for timestampPropertyName, or if null or empty-string is specified, the event creation time will be used."]
449 #[serde(rename = "timestampPropertyName", default, skip_serializing_if = "Option::is_none")]
450 pub timestamp_property_name: Option<String>,
451 #[doc = "An object that represents the local timestamp property. It contains the format of local timestamp that needs to be used and the corresponding timezone offset information. If a value isn't specified for localTimestamp, or if null, then the local timestamp will not be ingressed with the events."]
452 #[serde(rename = "localTimestamp", default, skip_serializing_if = "Option::is_none")]
453 pub local_timestamp: Option<LocalTimestamp>,
454 #[doc = "An object that contains the details about the starting point in time to ingest events."]
455 #[serde(rename = "ingressStartAt", default, skip_serializing_if = "Option::is_none")]
456 pub ingress_start_at: Option<IngressStartAtProperties>,
457}
458impl EventSourceCommonProperties {
459 pub fn new() -> Self {
460 Self::default()
461 }
462}
463#[doc = "Parameters supplied to the Create or Update Event Source operation."]
464#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
465pub struct EventSourceCreateOrUpdateParameters {
466 #[serde(flatten)]
467 pub create_or_update_tracked_resource_properties: CreateOrUpdateTrackedResourceProperties,
468 #[doc = "An object that represents the local timestamp property. It contains the format of local timestamp that needs to be used and the corresponding timezone offset information. If a value isn't specified for localTimestamp, or if null, then the local timestamp will not be ingressed with the events."]
469 #[serde(rename = "localTimestamp", default, skip_serializing_if = "Option::is_none")]
470 pub local_timestamp: Option<LocalTimestamp>,
471}
472impl EventSourceCreateOrUpdateParameters {
473 pub fn new(create_or_update_tracked_resource_properties: CreateOrUpdateTrackedResourceProperties) -> Self {
474 Self {
475 create_or_update_tracked_resource_properties,
476 local_timestamp: None,
477 }
478 }
479}
480#[doc = "The kind of the event source."]
481#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
482#[serde(tag = "kind")]
483pub enum EventSourceCreateOrUpdateParametersUnion {
484 #[serde(rename = "Microsoft.EventHub")]
485 MicrosoftEventHub(EventHubEventSourceCreateOrUpdateParameters),
486 #[serde(rename = "Microsoft.IoTHub")]
487 MicrosoftIoTHub(IoTHubEventSourceCreateOrUpdateParameters),
488}
489#[doc = "The response of the List EventSources operation."]
490#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
491pub struct EventSourceListResponse {
492 #[doc = "Result of the List EventSources operation."]
493 #[serde(
494 default,
495 deserialize_with = "azure_core::util::deserialize_null_as_default",
496 skip_serializing_if = "Vec::is_empty"
497 )]
498 pub value: Vec<EventSourceResourceUnion>,
499}
500impl EventSourceListResponse {
501 pub fn new() -> Self {
502 Self::default()
503 }
504}
505#[doc = "An object that represents a set of mutable event source resource properties."]
506#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
507pub struct EventSourceMutableProperties {
508 #[doc = "The event property that will be used as the event source's timestamp. If a value isn't specified for timestampPropertyName, or if null or empty-string is specified, the event creation time will be used."]
509 #[serde(rename = "timestampPropertyName", default, skip_serializing_if = "Option::is_none")]
510 pub timestamp_property_name: Option<String>,
511}
512impl EventSourceMutableProperties {
513 pub fn new() -> Self {
514 Self::default()
515 }
516}
517#[doc = "An environment receives data from one or more event sources. Each event source has associated connection info that allows the Time Series Insights ingress pipeline to connect to and pull data from the event source"]
518#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
519pub struct EventSourceResource {
520 #[serde(flatten)]
521 pub tracked_resource: TrackedResource,
522}
523impl EventSourceResource {
524 pub fn new(tracked_resource: TrackedResource) -> Self {
525 Self { tracked_resource }
526 }
527}
528#[doc = "The kind of the event source."]
529#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
530#[serde(tag = "kind")]
531pub enum EventSourceResourceUnion {
532 #[serde(rename = "Microsoft.EventHub")]
533 MicrosoftEventHub(EventHubEventSourceResource),
534 #[serde(rename = "Microsoft.IoTHub")]
535 MicrosoftIoTHub(IoTHubEventSourceResource),
536}
537#[doc = "Parameters supplied to the Update Event Source operation."]
538#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
539pub struct EventSourceUpdateParameters {
540 #[doc = "Key-value pairs of additional properties for the event source."]
541 #[serde(default, skip_serializing_if = "Option::is_none")]
542 pub tags: Option<serde_json::Value>,
543}
544impl EventSourceUpdateParameters {
545 pub fn new() -> Self {
546 Self { tags: None }
547 }
548}
549#[doc = "The kind of the event source."]
550#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
551#[serde(tag = "kind")]
552pub enum EventSourceUpdateParametersUnion {
553 #[serde(rename = "Microsoft.EventHub")]
554 MicrosoftEventHub(EventHubEventSourceUpdateParameters),
555 #[serde(rename = "Microsoft.IoTHub")]
556 MicrosoftIoTHub(IoTHubEventSourceUpdateParameters),
557}
558#[doc = "Parameters supplied to the Create or Update Environment operation for a Gen1 environment."]
559#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
560pub struct Gen1EnvironmentCreateOrUpdateParameters {
561 #[serde(flatten)]
562 pub environment_create_or_update_parameters: EnvironmentCreateOrUpdateParameters,
563 #[doc = "Properties used to create a Gen1 environment."]
564 pub properties: Gen1EnvironmentCreationProperties,
565}
566impl Gen1EnvironmentCreateOrUpdateParameters {
567 pub fn new(
568 environment_create_or_update_parameters: EnvironmentCreateOrUpdateParameters,
569 properties: Gen1EnvironmentCreationProperties,
570 ) -> Self {
571 Self {
572 environment_create_or_update_parameters,
573 properties,
574 }
575 }
576}
577#[doc = "Properties used to create a Gen1 environment."]
578#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
579pub struct Gen1EnvironmentCreationProperties {
580 #[doc = "ISO8601 timespan specifying the minimum number of days the environment's events will be available for query."]
581 #[serde(rename = "dataRetentionTime")]
582 pub data_retention_time: String,
583 #[doc = "The behavior the Time Series Insights service should take when the environment's capacity has been exceeded. If \"PauseIngress\" is specified, new events will not be read from the event source. If \"PurgeOldData\" is specified, new events will continue to be read and old events will be deleted from the environment. The default behavior is PurgeOldData."]
584 #[serde(rename = "storageLimitExceededBehavior", default, skip_serializing_if = "Option::is_none")]
585 pub storage_limit_exceeded_behavior: Option<gen1_environment_creation_properties::StorageLimitExceededBehavior>,
586 #[doc = "The list of event properties which will be used to partition data in the environment. Currently, only a single partition key property is supported."]
587 #[serde(
588 rename = "partitionKeyProperties",
589 default,
590 deserialize_with = "azure_core::util::deserialize_null_as_default",
591 skip_serializing_if = "Vec::is_empty"
592 )]
593 pub partition_key_properties: Vec<TimeSeriesIdProperty>,
594}
595impl Gen1EnvironmentCreationProperties {
596 pub fn new(data_retention_time: String) -> Self {
597 Self {
598 data_retention_time,
599 storage_limit_exceeded_behavior: None,
600 partition_key_properties: Vec::new(),
601 }
602 }
603}
604pub mod gen1_environment_creation_properties {
605 use super::*;
606 #[doc = "The behavior the Time Series Insights service should take when the environment's capacity has been exceeded. If \"PauseIngress\" is specified, new events will not be read from the event source. If \"PurgeOldData\" is specified, new events will continue to be read and old events will be deleted from the environment. The default behavior is PurgeOldData."]
607 #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
608 #[serde(remote = "StorageLimitExceededBehavior")]
609 pub enum StorageLimitExceededBehavior {
610 PurgeOldData,
611 PauseIngress,
612 #[serde(skip_deserializing)]
613 UnknownValue(String),
614 }
615 impl FromStr for StorageLimitExceededBehavior {
616 type Err = value::Error;
617 fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
618 Self::deserialize(s.into_deserializer())
619 }
620 }
621 impl<'de> Deserialize<'de> for StorageLimitExceededBehavior {
622 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
623 where
624 D: Deserializer<'de>,
625 {
626 let s = String::deserialize(deserializer)?;
627 let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s));
628 Ok(deserialized)
629 }
630 }
631 impl Serialize for StorageLimitExceededBehavior {
632 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
633 where
634 S: Serializer,
635 {
636 match self {
637 Self::PurgeOldData => serializer.serialize_unit_variant("StorageLimitExceededBehavior", 0u32, "PurgeOldData"),
638 Self::PauseIngress => serializer.serialize_unit_variant("StorageLimitExceededBehavior", 1u32, "PauseIngress"),
639 Self::UnknownValue(s) => serializer.serialize_str(s.as_str()),
640 }
641 }
642 }
643}
644#[doc = "An object that represents a set of mutable Gen1 environment resource properties."]
645#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
646pub struct Gen1EnvironmentMutableProperties {
647 #[doc = "ISO8601 timespan specifying the minimum number of days the environment's events will be available for query."]
648 #[serde(rename = "dataRetentionTime", default, skip_serializing_if = "Option::is_none")]
649 pub data_retention_time: Option<String>,
650 #[doc = "The behavior the Time Series Insights service should take when the environment's capacity has been exceeded. If \"PauseIngress\" is specified, new events will not be read from the event source. If \"PurgeOldData\" is specified, new events will continue to be read and old events will be deleted from the environment. The default behavior is PurgeOldData."]
651 #[serde(rename = "storageLimitExceededBehavior", default, skip_serializing_if = "Option::is_none")]
652 pub storage_limit_exceeded_behavior: Option<gen1_environment_mutable_properties::StorageLimitExceededBehavior>,
653}
654impl Gen1EnvironmentMutableProperties {
655 pub fn new() -> Self {
656 Self::default()
657 }
658}
659pub mod gen1_environment_mutable_properties {
660 use super::*;
661 #[doc = "The behavior the Time Series Insights service should take when the environment's capacity has been exceeded. If \"PauseIngress\" is specified, new events will not be read from the event source. If \"PurgeOldData\" is specified, new events will continue to be read and old events will be deleted from the environment. The default behavior is PurgeOldData."]
662 #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
663 #[serde(remote = "StorageLimitExceededBehavior")]
664 pub enum StorageLimitExceededBehavior {
665 PurgeOldData,
666 PauseIngress,
667 #[serde(skip_deserializing)]
668 UnknownValue(String),
669 }
670 impl FromStr for StorageLimitExceededBehavior {
671 type Err = value::Error;
672 fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
673 Self::deserialize(s.into_deserializer())
674 }
675 }
676 impl<'de> Deserialize<'de> for StorageLimitExceededBehavior {
677 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
678 where
679 D: Deserializer<'de>,
680 {
681 let s = String::deserialize(deserializer)?;
682 let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s));
683 Ok(deserialized)
684 }
685 }
686 impl Serialize for StorageLimitExceededBehavior {
687 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
688 where
689 S: Serializer,
690 {
691 match self {
692 Self::PurgeOldData => serializer.serialize_unit_variant("StorageLimitExceededBehavior", 0u32, "PurgeOldData"),
693 Self::PauseIngress => serializer.serialize_unit_variant("StorageLimitExceededBehavior", 1u32, "PauseIngress"),
694 Self::UnknownValue(s) => serializer.serialize_str(s.as_str()),
695 }
696 }
697 }
698}
699#[doc = "An environment is a set of time-series data available for query, and is the top level Azure Time Series Insights resource. Gen1 environments have data retention limits."]
700#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
701pub struct Gen1EnvironmentResource {
702 #[serde(flatten)]
703 pub environment_resource: EnvironmentResource,
704 #[doc = "Properties of the Gen1 environment."]
705 pub properties: Gen1EnvironmentResourceProperties,
706}
707impl Gen1EnvironmentResource {
708 pub fn new(environment_resource: EnvironmentResource, properties: Gen1EnvironmentResourceProperties) -> Self {
709 Self {
710 environment_resource,
711 properties,
712 }
713 }
714}
715#[doc = "Properties of the Gen1 environment."]
716#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
717pub struct Gen1EnvironmentResourceProperties {
718 #[serde(flatten)]
719 pub gen1_environment_creation_properties: Gen1EnvironmentCreationProperties,
720 #[serde(flatten)]
721 pub environment_resource_properties: EnvironmentResourceProperties,
722}
723impl Gen1EnvironmentResourceProperties {
724 pub fn new(gen1_environment_creation_properties: Gen1EnvironmentCreationProperties) -> Self {
725 Self {
726 gen1_environment_creation_properties,
727 environment_resource_properties: EnvironmentResourceProperties::default(),
728 }
729 }
730}
731#[doc = "Parameters supplied to the Update Environment operation to update a Gen1 environment."]
732#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
733pub struct Gen1EnvironmentUpdateParameters {
734 #[serde(flatten)]
735 pub environment_update_parameters: EnvironmentUpdateParameters,
736 #[doc = "The sku determines the type of environment, either Gen1 (S1 or S2) or Gen2 (L1). For Gen1 environments the sku determines the capacity of the environment, the ingress rate, and the billing rate."]
737 #[serde(default, skip_serializing_if = "Option::is_none")]
738 pub sku: Option<Sku>,
739 #[doc = "An object that represents a set of mutable Gen1 environment resource properties."]
740 #[serde(default, skip_serializing_if = "Option::is_none")]
741 pub properties: Option<Gen1EnvironmentMutableProperties>,
742}
743impl Gen1EnvironmentUpdateParameters {
744 pub fn new(environment_update_parameters: EnvironmentUpdateParameters) -> Self {
745 Self {
746 environment_update_parameters,
747 sku: None,
748 properties: None,
749 }
750 }
751}
752#[doc = "Parameters supplied to the Create or Update Environment operation for a Gen2 environment."]
753#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
754pub struct Gen2EnvironmentCreateOrUpdateParameters {
755 #[serde(flatten)]
756 pub environment_create_or_update_parameters: EnvironmentCreateOrUpdateParameters,
757 #[doc = "Properties used to create a Gen2 environment."]
758 pub properties: Gen2EnvironmentCreationProperties,
759}
760impl Gen2EnvironmentCreateOrUpdateParameters {
761 pub fn new(
762 environment_create_or_update_parameters: EnvironmentCreateOrUpdateParameters,
763 properties: Gen2EnvironmentCreationProperties,
764 ) -> Self {
765 Self {
766 environment_create_or_update_parameters,
767 properties,
768 }
769 }
770}
771#[doc = "Properties used to create a Gen2 environment."]
772#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
773pub struct Gen2EnvironmentCreationProperties {
774 #[doc = "The list of event properties which will be used to define the environment's time series id."]
775 #[serde(rename = "timeSeriesIdProperties")]
776 pub time_series_id_properties: Vec<TimeSeriesIdProperty>,
777 #[doc = "The storage configuration provides the connection details that allows the Time Series Insights service to connect to the customer storage account that is used to store the environment's data."]
778 #[serde(rename = "storageConfiguration")]
779 pub storage_configuration: Gen2StorageConfigurationInput,
780 #[doc = "The warm store configuration provides the details to create a warm store cache that will retain a copy of the environment's data available for faster query."]
781 #[serde(rename = "warmStoreConfiguration", default, skip_serializing_if = "Option::is_none")]
782 pub warm_store_configuration: Option<WarmStoreConfigurationProperties>,
783 #[doc = "This value can be set to 'enabled' to avoid breaking changes on existing customer resources and templates. If set to 'disabled', traffic over public interface is not allowed, and private endpoint connections would be the exclusive access method."]
784 #[serde(rename = "publicNetworkAccess", default, skip_serializing_if = "Option::is_none")]
785 pub public_network_access: Option<gen2_environment_creation_properties::PublicNetworkAccess>,
786 #[doc = "The list of private endpoint connections to the environment."]
787 #[serde(
788 rename = "privateEndpointConnections",
789 default,
790 deserialize_with = "azure_core::util::deserialize_null_as_default",
791 skip_serializing_if = "Vec::is_empty"
792 )]
793 pub private_endpoint_connections: Vec<PrivateEndpointConnection>,
794}
795impl Gen2EnvironmentCreationProperties {
796 pub fn new(time_series_id_properties: Vec<TimeSeriesIdProperty>, storage_configuration: Gen2StorageConfigurationInput) -> Self {
797 Self {
798 time_series_id_properties,
799 storage_configuration,
800 warm_store_configuration: None,
801 public_network_access: None,
802 private_endpoint_connections: Vec::new(),
803 }
804 }
805}
806pub mod gen2_environment_creation_properties {
807 use super::*;
808 #[doc = "This value can be set to 'enabled' to avoid breaking changes on existing customer resources and templates. If set to 'disabled', traffic over public interface is not allowed, and private endpoint connections would be the exclusive access method."]
809 #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
810 #[serde(remote = "PublicNetworkAccess")]
811 pub enum PublicNetworkAccess {
812 #[serde(rename = "enabled")]
813 Enabled,
814 #[serde(rename = "disabled")]
815 Disabled,
816 #[serde(skip_deserializing)]
817 UnknownValue(String),
818 }
819 impl FromStr for PublicNetworkAccess {
820 type Err = value::Error;
821 fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
822 Self::deserialize(s.into_deserializer())
823 }
824 }
825 impl<'de> Deserialize<'de> for PublicNetworkAccess {
826 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
827 where
828 D: Deserializer<'de>,
829 {
830 let s = String::deserialize(deserializer)?;
831 let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s));
832 Ok(deserialized)
833 }
834 }
835 impl Serialize for PublicNetworkAccess {
836 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
837 where
838 S: Serializer,
839 {
840 match self {
841 Self::Enabled => serializer.serialize_unit_variant("PublicNetworkAccess", 0u32, "enabled"),
842 Self::Disabled => serializer.serialize_unit_variant("PublicNetworkAccess", 1u32, "disabled"),
843 Self::UnknownValue(s) => serializer.serialize_str(s.as_str()),
844 }
845 }
846 }
847 impl Default for PublicNetworkAccess {
848 fn default() -> Self {
849 Self::Enabled
850 }
851 }
852}
853#[doc = "An object that represents a set of mutable Gen2 environment resource properties."]
854#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
855pub struct Gen2EnvironmentMutableProperties {
856 #[doc = "The storage configuration provides the connection details that allows the Time Series Insights service to connect to the customer storage account that is used to store the environment's data."]
857 #[serde(rename = "storageConfiguration", default, skip_serializing_if = "Option::is_none")]
858 pub storage_configuration: Option<Gen2StorageConfigurationMutableProperties>,
859 #[doc = "The warm store configuration provides the details to create a warm store cache that will retain a copy of the environment's data available for faster query."]
860 #[serde(rename = "warmStoreConfiguration", default, skip_serializing_if = "Option::is_none")]
861 pub warm_store_configuration: Option<WarmStoreConfigurationProperties>,
862}
863impl Gen2EnvironmentMutableProperties {
864 pub fn new() -> Self {
865 Self::default()
866 }
867}
868#[doc = "An environment is a set of time-series data available for query, and is the top level Azure Time Series Insights resource. Gen2 environments do not have set data retention limits."]
869#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
870pub struct Gen2EnvironmentResource {
871 #[serde(flatten)]
872 pub environment_resource: EnvironmentResource,
873 #[doc = "Properties of the Gen2 environment."]
874 pub properties: Gen2EnvironmentResourceProperties,
875}
876impl Gen2EnvironmentResource {
877 pub fn new(environment_resource: EnvironmentResource, properties: Gen2EnvironmentResourceProperties) -> Self {
878 Self {
879 environment_resource,
880 properties,
881 }
882 }
883}
884#[doc = "Properties of the Gen2 environment."]
885#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
886pub struct Gen2EnvironmentResourceProperties {
887 #[serde(flatten)]
888 pub environment_resource_properties: EnvironmentResourceProperties,
889 #[doc = "The list of event properties which will be used to define the environment's time series id."]
890 #[serde(rename = "timeSeriesIdProperties")]
891 pub time_series_id_properties: Vec<TimeSeriesIdProperty>,
892 #[doc = "The storage configuration provides the non-secret connection details about the customer storage account that is used to store the environment's data."]
893 #[serde(rename = "storageConfiguration")]
894 pub storage_configuration: Gen2StorageConfigurationOutput,
895 #[doc = "The warm store configuration provides the details to create a warm store cache that will retain a copy of the environment's data available for faster query."]
896 #[serde(rename = "warmStoreConfiguration", default, skip_serializing_if = "Option::is_none")]
897 pub warm_store_configuration: Option<WarmStoreConfigurationProperties>,
898 #[doc = "If 'enabled', public network access is allowed. If 'disabled', traffic over public interface is not allowed, and private endpoint connections would be the exclusive access method."]
899 #[serde(rename = "publicNetworkAccess", default, skip_serializing_if = "Option::is_none")]
900 pub public_network_access: Option<gen2_environment_resource_properties::PublicNetworkAccess>,
901 #[doc = "The list of private endpoint connections to the environment."]
902 #[serde(
903 rename = "privateEndpointConnections",
904 default,
905 deserialize_with = "azure_core::util::deserialize_null_as_default",
906 skip_serializing_if = "Vec::is_empty"
907 )]
908 pub private_endpoint_connections: Vec<PrivateEndpointConnection>,
909}
910impl Gen2EnvironmentResourceProperties {
911 pub fn new(time_series_id_properties: Vec<TimeSeriesIdProperty>, storage_configuration: Gen2StorageConfigurationOutput) -> Self {
912 Self {
913 environment_resource_properties: EnvironmentResourceProperties::default(),
914 time_series_id_properties,
915 storage_configuration,
916 warm_store_configuration: None,
917 public_network_access: None,
918 private_endpoint_connections: Vec::new(),
919 }
920 }
921}
922pub mod gen2_environment_resource_properties {
923 use super::*;
924 #[doc = "If 'enabled', public network access is allowed. If 'disabled', traffic over public interface is not allowed, and private endpoint connections would be the exclusive access method."]
925 #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
926 #[serde(remote = "PublicNetworkAccess")]
927 pub enum PublicNetworkAccess {
928 #[serde(rename = "enabled")]
929 Enabled,
930 #[serde(rename = "disabled")]
931 Disabled,
932 #[serde(skip_deserializing)]
933 UnknownValue(String),
934 }
935 impl FromStr for PublicNetworkAccess {
936 type Err = value::Error;
937 fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
938 Self::deserialize(s.into_deserializer())
939 }
940 }
941 impl<'de> Deserialize<'de> for PublicNetworkAccess {
942 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
943 where
944 D: Deserializer<'de>,
945 {
946 let s = String::deserialize(deserializer)?;
947 let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s));
948 Ok(deserialized)
949 }
950 }
951 impl Serialize for PublicNetworkAccess {
952 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
953 where
954 S: Serializer,
955 {
956 match self {
957 Self::Enabled => serializer.serialize_unit_variant("PublicNetworkAccess", 0u32, "enabled"),
958 Self::Disabled => serializer.serialize_unit_variant("PublicNetworkAccess", 1u32, "disabled"),
959 Self::UnknownValue(s) => serializer.serialize_str(s.as_str()),
960 }
961 }
962 }
963 impl Default for PublicNetworkAccess {
964 fn default() -> Self {
965 Self::Enabled
966 }
967 }
968}
969#[doc = "Parameters supplied to the Update Environment operation to update a Gen2 environment."]
970#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
971pub struct Gen2EnvironmentUpdateParameters {
972 #[serde(flatten)]
973 pub environment_update_parameters: EnvironmentUpdateParameters,
974 #[doc = "An object that represents a set of mutable Gen2 environment resource properties."]
975 #[serde(default, skip_serializing_if = "Option::is_none")]
976 pub properties: Option<Gen2EnvironmentMutableProperties>,
977}
978impl Gen2EnvironmentUpdateParameters {
979 pub fn new(environment_update_parameters: EnvironmentUpdateParameters) -> Self {
980 Self {
981 environment_update_parameters,
982 properties: None,
983 }
984 }
985}
986#[doc = "The storage configuration provides the connection details that allows the Time Series Insights service to connect to the customer storage account that is used to store the environment's data."]
987#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
988pub struct Gen2StorageConfigurationInput {
989 #[doc = "The name of the storage account that will hold the environment's Gen2 data."]
990 #[serde(rename = "accountName")]
991 pub account_name: String,
992 #[doc = "The value of the management key that grants the Time Series Insights service write access to the storage account. This property is not shown in environment responses."]
993 #[serde(rename = "managementKey")]
994 pub management_key: String,
995}
996impl Gen2StorageConfigurationInput {
997 pub fn new(account_name: String, management_key: String) -> Self {
998 Self {
999 account_name,
1000 management_key,
1001 }
1002 }
1003}
1004#[doc = "The storage configuration provides the connection details that allows the Time Series Insights service to connect to the customer storage account that is used to store the environment's data."]
1005#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
1006pub struct Gen2StorageConfigurationMutableProperties {
1007 #[doc = "The value of the management key that grants the Time Series Insights service write access to the storage account. This property is not shown in environment responses."]
1008 #[serde(rename = "managementKey")]
1009 pub management_key: String,
1010}
1011impl Gen2StorageConfigurationMutableProperties {
1012 pub fn new(management_key: String) -> Self {
1013 Self { management_key }
1014 }
1015}
1016#[doc = "The storage configuration provides the non-secret connection details about the customer storage account that is used to store the environment's data."]
1017#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
1018pub struct Gen2StorageConfigurationOutput {
1019 #[doc = "The name of the storage account that will hold the environment's Gen2 data."]
1020 #[serde(rename = "accountName")]
1021 pub account_name: String,
1022}
1023impl Gen2StorageConfigurationOutput {
1024 pub fn new(account_name: String) -> Self {
1025 Self { account_name }
1026 }
1027}
1028#[doc = "An object that represents the status of ingress on an environment."]
1029#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
1030pub struct IngressEnvironmentStatus {
1031 #[doc = "This string represents the state of ingress operations on an environment. It can be \"Disabled\", \"Ready\", \"Running\", \"Paused\" or \"Unknown\""]
1032 #[serde(default, skip_serializing_if = "Option::is_none")]
1033 pub state: Option<ingress_environment_status::State>,
1034 #[doc = "An object that contains the details about an environment's state."]
1035 #[serde(rename = "stateDetails", default, skip_serializing_if = "Option::is_none")]
1036 pub state_details: Option<EnvironmentStateDetails>,
1037}
1038impl IngressEnvironmentStatus {
1039 pub fn new() -> Self {
1040 Self::default()
1041 }
1042}
1043pub mod ingress_environment_status {
1044 use super::*;
1045 #[doc = "This string represents the state of ingress operations on an environment. It can be \"Disabled\", \"Ready\", \"Running\", \"Paused\" or \"Unknown\""]
1046 #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
1047 #[serde(remote = "State")]
1048 pub enum State {
1049 Disabled,
1050 Ready,
1051 Running,
1052 Paused,
1053 Unknown,
1054 #[serde(skip_deserializing)]
1055 UnknownValue(String),
1056 }
1057 impl FromStr for State {
1058 type Err = value::Error;
1059 fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
1060 Self::deserialize(s.into_deserializer())
1061 }
1062 }
1063 impl<'de> Deserialize<'de> for State {
1064 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1065 where
1066 D: Deserializer<'de>,
1067 {
1068 let s = String::deserialize(deserializer)?;
1069 let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s));
1070 Ok(deserialized)
1071 }
1072 }
1073 impl Serialize for State {
1074 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1075 where
1076 S: Serializer,
1077 {
1078 match self {
1079 Self::Disabled => serializer.serialize_unit_variant("State", 0u32, "Disabled"),
1080 Self::Ready => serializer.serialize_unit_variant("State", 1u32, "Ready"),
1081 Self::Running => serializer.serialize_unit_variant("State", 2u32, "Running"),
1082 Self::Paused => serializer.serialize_unit_variant("State", 3u32, "Paused"),
1083 Self::Unknown => serializer.serialize_unit_variant("State", 4u32, "Unknown"),
1084 Self::UnknownValue(s) => serializer.serialize_str(s.as_str()),
1085 }
1086 }
1087 }
1088}
1089#[doc = "An object that contains the details about the starting point in time to ingest events."]
1090#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
1091pub struct IngressStartAtProperties {
1092 #[doc = "The type of the ingressStartAt, It can be \"EarliestAvailable\", \"EventSourceCreationTime\", \"CustomEnqueuedTime\"."]
1093 #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
1094 pub type_: Option<ingress_start_at_properties::Type>,
1095 #[doc = "ISO8601 UTC datetime with seconds precision (milliseconds are optional), specifying the date and time that will be the starting point for Events to be consumed."]
1096 #[serde(default, skip_serializing_if = "Option::is_none")]
1097 pub time: Option<String>,
1098}
1099impl IngressStartAtProperties {
1100 pub fn new() -> Self {
1101 Self::default()
1102 }
1103}
1104pub mod ingress_start_at_properties {
1105 use super::*;
1106 #[doc = "The type of the ingressStartAt, It can be \"EarliestAvailable\", \"EventSourceCreationTime\", \"CustomEnqueuedTime\"."]
1107 #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
1108 #[serde(remote = "Type")]
1109 pub enum Type {
1110 EarliestAvailable,
1111 EventSourceCreationTime,
1112 CustomEnqueuedTime,
1113 #[serde(skip_deserializing)]
1114 UnknownValue(String),
1115 }
1116 impl FromStr for Type {
1117 type Err = value::Error;
1118 fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
1119 Self::deserialize(s.into_deserializer())
1120 }
1121 }
1122 impl<'de> Deserialize<'de> for Type {
1123 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1124 where
1125 D: Deserializer<'de>,
1126 {
1127 let s = String::deserialize(deserializer)?;
1128 let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s));
1129 Ok(deserialized)
1130 }
1131 }
1132 impl Serialize for Type {
1133 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1134 where
1135 S: Serializer,
1136 {
1137 match self {
1138 Self::EarliestAvailable => serializer.serialize_unit_variant("Type", 0u32, "EarliestAvailable"),
1139 Self::EventSourceCreationTime => serializer.serialize_unit_variant("Type", 1u32, "EventSourceCreationTime"),
1140 Self::CustomEnqueuedTime => serializer.serialize_unit_variant("Type", 2u32, "CustomEnqueuedTime"),
1141 Self::UnknownValue(s) => serializer.serialize_str(s.as_str()),
1142 }
1143 }
1144 }
1145}
1146#[doc = "Properties of the IoTHub event source."]
1147#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
1148pub struct IoTHubEventSourceCommonProperties {
1149 #[serde(flatten)]
1150 pub azure_event_source_properties: AzureEventSourceProperties,
1151 #[doc = "The name of the iot hub."]
1152 #[serde(rename = "iotHubName")]
1153 pub iot_hub_name: String,
1154 #[doc = "The name of the iot hub's consumer group that holds the partitions from which events will be read."]
1155 #[serde(rename = "consumerGroupName")]
1156 pub consumer_group_name: String,
1157 #[doc = "The name of the Shared Access Policy key that grants the Time Series Insights service access to the iot hub. This shared access policy key must grant 'service connect' permissions to the iot hub."]
1158 #[serde(rename = "keyName")]
1159 pub key_name: String,
1160}
1161impl IoTHubEventSourceCommonProperties {
1162 pub fn new(
1163 azure_event_source_properties: AzureEventSourceProperties,
1164 iot_hub_name: String,
1165 consumer_group_name: String,
1166 key_name: String,
1167 ) -> Self {
1168 Self {
1169 azure_event_source_properties,
1170 iot_hub_name,
1171 consumer_group_name,
1172 key_name,
1173 }
1174 }
1175}
1176#[doc = "Parameters supplied to the Create or Update Event Source operation for an IoTHub event source."]
1177#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
1178pub struct IoTHubEventSourceCreateOrUpdateParameters {
1179 #[serde(flatten)]
1180 pub event_source_create_or_update_parameters: EventSourceCreateOrUpdateParameters,
1181 #[doc = "Properties of the IoTHub event source that are required on create or update requests."]
1182 pub properties: IoTHubEventSourceCreationProperties,
1183}
1184impl IoTHubEventSourceCreateOrUpdateParameters {
1185 pub fn new(
1186 event_source_create_or_update_parameters: EventSourceCreateOrUpdateParameters,
1187 properties: IoTHubEventSourceCreationProperties,
1188 ) -> Self {
1189 Self {
1190 event_source_create_or_update_parameters,
1191 properties,
1192 }
1193 }
1194}
1195#[doc = "Properties of the IoTHub event source that are required on create or update requests."]
1196#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
1197pub struct IoTHubEventSourceCreationProperties {
1198 #[serde(flatten)]
1199 pub io_t_hub_event_source_common_properties: IoTHubEventSourceCommonProperties,
1200 #[doc = "The value of the Shared Access Policy key that grants the Time Series Insights service read access to the iot hub. This property is not shown in event source responses."]
1201 #[serde(rename = "sharedAccessKey")]
1202 pub shared_access_key: String,
1203}
1204impl IoTHubEventSourceCreationProperties {
1205 pub fn new(io_t_hub_event_source_common_properties: IoTHubEventSourceCommonProperties, shared_access_key: String) -> Self {
1206 Self {
1207 io_t_hub_event_source_common_properties,
1208 shared_access_key,
1209 }
1210 }
1211}
1212#[doc = "An object that represents a set of mutable IoTHub event source resource properties."]
1213#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
1214pub struct IoTHubEventSourceMutableProperties {
1215 #[serde(flatten)]
1216 pub event_source_mutable_properties: EventSourceMutableProperties,
1217 #[doc = "The value of the shared access key that grants the Time Series Insights service read access to the iot hub. This property is not shown in event source responses."]
1218 #[serde(rename = "sharedAccessKey", default, skip_serializing_if = "Option::is_none")]
1219 pub shared_access_key: Option<String>,
1220}
1221impl IoTHubEventSourceMutableProperties {
1222 pub fn new() -> Self {
1223 Self::default()
1224 }
1225}
1226#[doc = "An event source that receives its data from an Azure IoTHub."]
1227#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
1228pub struct IoTHubEventSourceResource {
1229 #[serde(flatten)]
1230 pub event_source_resource: EventSourceResource,
1231 #[doc = "Properties of the IoTHub event source resource."]
1232 pub properties: IoTHubEventSourceResourceProperties,
1233}
1234impl IoTHubEventSourceResource {
1235 pub fn new(event_source_resource: EventSourceResource, properties: IoTHubEventSourceResourceProperties) -> Self {
1236 Self {
1237 event_source_resource,
1238 properties,
1239 }
1240 }
1241}
1242#[doc = "Properties of the IoTHub event source resource."]
1243#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
1244pub struct IoTHubEventSourceResourceProperties {
1245 #[serde(flatten)]
1246 pub io_t_hub_event_source_common_properties: IoTHubEventSourceCommonProperties,
1247}
1248impl IoTHubEventSourceResourceProperties {
1249 pub fn new(io_t_hub_event_source_common_properties: IoTHubEventSourceCommonProperties) -> Self {
1250 Self {
1251 io_t_hub_event_source_common_properties,
1252 }
1253 }
1254}
1255#[doc = "Parameters supplied to the Update Event Source operation to update an IoTHub event source."]
1256#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
1257pub struct IoTHubEventSourceUpdateParameters {
1258 #[serde(flatten)]
1259 pub event_source_update_parameters: EventSourceUpdateParameters,
1260 #[doc = "An object that represents a set of mutable IoTHub event source resource properties."]
1261 #[serde(default, skip_serializing_if = "Option::is_none")]
1262 pub properties: Option<IoTHubEventSourceMutableProperties>,
1263}
1264impl IoTHubEventSourceUpdateParameters {
1265 pub fn new(event_source_update_parameters: EventSourceUpdateParameters) -> Self {
1266 Self {
1267 event_source_update_parameters,
1268 properties: None,
1269 }
1270 }
1271}
1272#[doc = "An object that represents the local timestamp property. It contains the format of local timestamp that needs to be used and the corresponding timezone offset information. If a value isn't specified for localTimestamp, or if null, then the local timestamp will not be ingressed with the events."]
1273#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
1274pub struct LocalTimestamp {
1275 #[doc = "An enum that represents the format of the local timestamp property that needs to be set."]
1276 #[serde(default, skip_serializing_if = "Option::is_none")]
1277 pub format: Option<local_timestamp::Format>,
1278 #[doc = "An object that represents the offset information for the local timestamp format specified. Should not be specified for LocalTimestampFormat - Embedded."]
1279 #[serde(rename = "timeZoneOffset", default, skip_serializing_if = "Option::is_none")]
1280 pub time_zone_offset: Option<local_timestamp::TimeZoneOffset>,
1281}
1282impl LocalTimestamp {
1283 pub fn new() -> Self {
1284 Self::default()
1285 }
1286}
1287pub mod local_timestamp {
1288 use super::*;
1289 #[doc = "An enum that represents the format of the local timestamp property that needs to be set."]
1290 #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
1291 #[serde(remote = "Format")]
1292 pub enum Format {
1293 Embedded,
1294 #[serde(skip_deserializing)]
1295 UnknownValue(String),
1296 }
1297 impl FromStr for Format {
1298 type Err = value::Error;
1299 fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
1300 Self::deserialize(s.into_deserializer())
1301 }
1302 }
1303 impl<'de> Deserialize<'de> for Format {
1304 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1305 where
1306 D: Deserializer<'de>,
1307 {
1308 let s = String::deserialize(deserializer)?;
1309 let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s));
1310 Ok(deserialized)
1311 }
1312 }
1313 impl Serialize for Format {
1314 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1315 where
1316 S: Serializer,
1317 {
1318 match self {
1319 Self::Embedded => serializer.serialize_unit_variant("Format", 0u32, "Embedded"),
1320 Self::UnknownValue(s) => serializer.serialize_str(s.as_str()),
1321 }
1322 }
1323 }
1324 #[doc = "An object that represents the offset information for the local timestamp format specified. Should not be specified for LocalTimestampFormat - Embedded."]
1325 #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
1326 pub struct TimeZoneOffset {
1327 #[doc = "The event property that will be contain the offset information to calculate the local timestamp. When the LocalTimestampFormat is Iana, the property name will contain the name of the column which contains IANA Timezone Name (eg: Americas/Los Angeles). When LocalTimestampFormat is Timespan, it contains the name of property which contains values representing the offset (eg: P1D or 1.00:00:00)"]
1328 #[serde(rename = "propertyName", default, skip_serializing_if = "Option::is_none")]
1329 pub property_name: Option<String>,
1330 }
1331 impl TimeZoneOffset {
1332 pub fn new() -> Self {
1333 Self::default()
1334 }
1335 }
1336}
1337#[doc = "The specification of an Azure Monitoring log."]
1338#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
1339pub struct LogSpecification {
1340 #[doc = "Log name."]
1341 #[serde(default, skip_serializing_if = "Option::is_none")]
1342 pub name: Option<String>,
1343 #[doc = "Log display name."]
1344 #[serde(rename = "displayName", default, skip_serializing_if = "Option::is_none")]
1345 pub display_name: Option<String>,
1346}
1347impl LogSpecification {
1348 pub fn new() -> Self {
1349 Self::default()
1350 }
1351}
1352#[doc = "Retention policy of a resource metric."]
1353#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
1354pub struct MetricAvailability {
1355 #[serde(rename = "timeGrain", default, skip_serializing_if = "Option::is_none")]
1356 pub time_grain: Option<String>,
1357 #[serde(rename = "blobDuration", default, skip_serializing_if = "Option::is_none")]
1358 pub blob_duration: Option<String>,
1359}
1360impl MetricAvailability {
1361 pub fn new() -> Self {
1362 Self::default()
1363 }
1364}
1365#[doc = "Metric specification of operation."]
1366#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
1367pub struct MetricSpecification {
1368 #[doc = "Name of metric specification."]
1369 #[serde(default, skip_serializing_if = "Option::is_none")]
1370 pub name: Option<String>,
1371 #[doc = "Display name of metric specification."]
1372 #[serde(rename = "displayName", default, skip_serializing_if = "Option::is_none")]
1373 pub display_name: Option<String>,
1374 #[doc = "Display description of metric specification."]
1375 #[serde(rename = "displayDescription", default, skip_serializing_if = "Option::is_none")]
1376 pub display_description: Option<String>,
1377 #[doc = "Unit could be Bytes or Count."]
1378 #[serde(default, skip_serializing_if = "Option::is_none")]
1379 pub unit: Option<String>,
1380 #[doc = "Dimensions of blobs, including blob type and access tier."]
1381 #[serde(
1382 default,
1383 deserialize_with = "azure_core::util::deserialize_null_as_default",
1384 skip_serializing_if = "Vec::is_empty"
1385 )]
1386 pub dimensions: Vec<Dimension>,
1387 #[doc = "Aggregation type could be Average."]
1388 #[serde(rename = "aggregationType", default, skip_serializing_if = "Option::is_none")]
1389 pub aggregation_type: Option<String>,
1390 #[doc = "Retention policies of a resource metric."]
1391 #[serde(
1392 default,
1393 deserialize_with = "azure_core::util::deserialize_null_as_default",
1394 skip_serializing_if = "Vec::is_empty"
1395 )]
1396 pub availabilities: Vec<MetricAvailability>,
1397 #[doc = "The category this metric specification belong to, could be Capacity."]
1398 #[serde(default, skip_serializing_if = "Option::is_none")]
1399 pub category: Option<String>,
1400 #[doc = "Account Resource Id."]
1401 #[serde(rename = "resourceIdDimensionNameOverride", default, skip_serializing_if = "Option::is_none")]
1402 pub resource_id_dimension_name_override: Option<String>,
1403}
1404impl MetricSpecification {
1405 pub fn new() -> Self {
1406 Self::default()
1407 }
1408}
1409#[doc = "A Time Series Insights REST API operation"]
1410#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
1411pub struct Operation {
1412 #[doc = "The name of the operation being performed on this particular object."]
1413 #[serde(default, skip_serializing_if = "Option::is_none")]
1414 pub name: Option<String>,
1415 #[doc = "Contains the localized display information for this particular operation / action."]
1416 #[serde(default, skip_serializing_if = "Option::is_none")]
1417 pub display: Option<operation::Display>,
1418 #[serde(default, skip_serializing_if = "Option::is_none")]
1419 pub origin: Option<String>,
1420 #[doc = "Properties of operation, include metric specifications."]
1421 #[serde(default, skip_serializing_if = "Option::is_none")]
1422 pub properties: Option<OperationProperties>,
1423}
1424impl Operation {
1425 pub fn new() -> Self {
1426 Self::default()
1427 }
1428}
1429pub mod operation {
1430 use super::*;
1431 #[doc = "Contains the localized display information for this particular operation / action."]
1432 #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
1433 pub struct Display {
1434 #[doc = "The localized friendly form of the resource provider name."]
1435 #[serde(default, skip_serializing_if = "Option::is_none")]
1436 pub provider: Option<String>,
1437 #[doc = "The localized friendly form of the resource type related to this action/operation."]
1438 #[serde(default, skip_serializing_if = "Option::is_none")]
1439 pub resource: Option<String>,
1440 #[doc = "The localized friendly name for the operation."]
1441 #[serde(default, skip_serializing_if = "Option::is_none")]
1442 pub operation: Option<String>,
1443 #[doc = "The localized friendly description for the operation."]
1444 #[serde(default, skip_serializing_if = "Option::is_none")]
1445 pub description: Option<String>,
1446 }
1447 impl Display {
1448 pub fn new() -> Self {
1449 Self::default()
1450 }
1451 }
1452}
1453#[doc = "Result of the request to list Time Series Insights operations. It contains a list of operations and a URL link to get the next set of results."]
1454#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
1455pub struct OperationListResult {
1456 #[doc = "List of Time Series Insights operations supported by the Microsoft.TimeSeriesInsights resource provider."]
1457 #[serde(
1458 default,
1459 deserialize_with = "azure_core::util::deserialize_null_as_default",
1460 skip_serializing_if = "Vec::is_empty"
1461 )]
1462 pub value: Vec<Operation>,
1463 #[doc = "URL to get the next set of operation list results if there are any."]
1464 #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")]
1465 pub next_link: Option<String>,
1466}
1467impl azure_core::Continuable for OperationListResult {
1468 type Continuation = String;
1469 fn continuation(&self) -> Option<Self::Continuation> {
1470 self.next_link.clone().filter(|value| !value.is_empty())
1471 }
1472}
1473impl OperationListResult {
1474 pub fn new() -> Self {
1475 Self::default()
1476 }
1477}
1478#[doc = "Properties of operation, include metric specifications."]
1479#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
1480pub struct OperationProperties {
1481 #[doc = "One property of operation, include metric specifications."]
1482 #[serde(rename = "serviceSpecification", default, skip_serializing_if = "Option::is_none")]
1483 pub service_specification: Option<ServiceSpecification>,
1484}
1485impl OperationProperties {
1486 pub fn new() -> Self {
1487 Self::default()
1488 }
1489}
1490#[doc = "The Private Endpoint resource."]
1491#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
1492pub struct PrivateEndpoint {
1493 #[doc = "The ARM identifier for Private Endpoint"]
1494 #[serde(default, skip_serializing_if = "Option::is_none")]
1495 pub id: Option<String>,
1496}
1497impl PrivateEndpoint {
1498 pub fn new() -> Self {
1499 Self::default()
1500 }
1501}
1502#[doc = "The Private Endpoint Connection resource."]
1503#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
1504pub struct PrivateEndpointConnection {
1505 #[serde(flatten)]
1506 pub resource: Resource,
1507 #[doc = "Properties of the PrivateEndpointConnectProperties."]
1508 #[serde(default, skip_serializing_if = "Option::is_none")]
1509 pub properties: Option<PrivateEndpointConnectionProperties>,
1510 #[doc = "The ARM identifier for Private Endpoint Connection"]
1511 #[serde(default, skip_serializing_if = "Option::is_none")]
1512 pub id: Option<String>,
1513}
1514impl PrivateEndpointConnection {
1515 pub fn new() -> Self {
1516 Self::default()
1517 }
1518}
1519#[doc = "List of private endpoint connection associated with the specified storage account"]
1520#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
1521pub struct PrivateEndpointConnectionListResult {
1522 #[doc = "Array of private endpoint connections"]
1523 #[serde(
1524 default,
1525 deserialize_with = "azure_core::util::deserialize_null_as_default",
1526 skip_serializing_if = "Vec::is_empty"
1527 )]
1528 pub value: Vec<PrivateEndpointConnection>,
1529}
1530impl PrivateEndpointConnectionListResult {
1531 pub fn new() -> Self {
1532 Self::default()
1533 }
1534}
1535#[doc = "Properties of the PrivateEndpointConnectProperties."]
1536#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
1537pub struct PrivateEndpointConnectionProperties {
1538 #[doc = "The current provisioning state."]
1539 #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")]
1540 pub provisioning_state: Option<PrivateEndpointConnectionProvisioningState>,
1541 #[doc = "The Private Endpoint resource."]
1542 #[serde(rename = "privateEndpoint", default, skip_serializing_if = "Option::is_none")]
1543 pub private_endpoint: Option<PrivateEndpoint>,
1544 #[doc = "A list of private links resource group ids"]
1545 #[serde(rename = "groupIds", default, skip_serializing_if = "Option::is_none")]
1546 pub group_ids: Option<PrivateEndpointGroupIds>,
1547 #[doc = "A collection of information about the state of the connection between service consumer and provider."]
1548 #[serde(rename = "privateLinkServiceConnectionState")]
1549 pub private_link_service_connection_state: PrivateLinkServiceConnectionState,
1550}
1551impl PrivateEndpointConnectionProperties {
1552 pub fn new(private_link_service_connection_state: PrivateLinkServiceConnectionState) -> Self {
1553 Self {
1554 provisioning_state: None,
1555 private_endpoint: None,
1556 group_ids: None,
1557 private_link_service_connection_state,
1558 }
1559 }
1560}
1561#[doc = "The current provisioning state."]
1562#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
1563#[serde(remote = "PrivateEndpointConnectionProvisioningState")]
1564pub enum PrivateEndpointConnectionProvisioningState {
1565 Succeeded,
1566 Creating,
1567 Deleting,
1568 Failed,
1569 #[serde(skip_deserializing)]
1570 UnknownValue(String),
1571}
1572impl FromStr for PrivateEndpointConnectionProvisioningState {
1573 type Err = value::Error;
1574 fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
1575 Self::deserialize(s.into_deserializer())
1576 }
1577}
1578impl<'de> Deserialize<'de> for PrivateEndpointConnectionProvisioningState {
1579 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1580 where
1581 D: Deserializer<'de>,
1582 {
1583 let s = String::deserialize(deserializer)?;
1584 let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s));
1585 Ok(deserialized)
1586 }
1587}
1588impl Serialize for PrivateEndpointConnectionProvisioningState {
1589 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1590 where
1591 S: Serializer,
1592 {
1593 match self {
1594 Self::Succeeded => serializer.serialize_unit_variant("PrivateEndpointConnectionProvisioningState", 0u32, "Succeeded"),
1595 Self::Creating => serializer.serialize_unit_variant("PrivateEndpointConnectionProvisioningState", 1u32, "Creating"),
1596 Self::Deleting => serializer.serialize_unit_variant("PrivateEndpointConnectionProvisioningState", 2u32, "Deleting"),
1597 Self::Failed => serializer.serialize_unit_variant("PrivateEndpointConnectionProvisioningState", 3u32, "Failed"),
1598 Self::UnknownValue(s) => serializer.serialize_str(s.as_str()),
1599 }
1600 }
1601}
1602pub type PrivateEndpointGroupIds = Vec<String>;
1603#[doc = "The private endpoint connection status."]
1604#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
1605#[serde(remote = "PrivateEndpointServiceConnectionStatus")]
1606pub enum PrivateEndpointServiceConnectionStatus {
1607 Pending,
1608 Approved,
1609 Rejected,
1610 #[serde(skip_deserializing)]
1611 UnknownValue(String),
1612}
1613impl FromStr for PrivateEndpointServiceConnectionStatus {
1614 type Err = value::Error;
1615 fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
1616 Self::deserialize(s.into_deserializer())
1617 }
1618}
1619impl<'de> Deserialize<'de> for PrivateEndpointServiceConnectionStatus {
1620 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1621 where
1622 D: Deserializer<'de>,
1623 {
1624 let s = String::deserialize(deserializer)?;
1625 let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s));
1626 Ok(deserialized)
1627 }
1628}
1629impl Serialize for PrivateEndpointServiceConnectionStatus {
1630 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1631 where
1632 S: Serializer,
1633 {
1634 match self {
1635 Self::Pending => serializer.serialize_unit_variant("PrivateEndpointServiceConnectionStatus", 0u32, "Pending"),
1636 Self::Approved => serializer.serialize_unit_variant("PrivateEndpointServiceConnectionStatus", 1u32, "Approved"),
1637 Self::Rejected => serializer.serialize_unit_variant("PrivateEndpointServiceConnectionStatus", 2u32, "Rejected"),
1638 Self::UnknownValue(s) => serializer.serialize_str(s.as_str()),
1639 }
1640 }
1641}
1642#[doc = "A private link resource"]
1643#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
1644pub struct PrivateLinkResource {
1645 #[serde(flatten)]
1646 pub resource: Resource,
1647 #[doc = "Properties of a private link resource."]
1648 #[serde(default, skip_serializing_if = "Option::is_none")]
1649 pub properties: Option<PrivateLinkResourceProperties>,
1650}
1651impl PrivateLinkResource {
1652 pub fn new() -> Self {
1653 Self::default()
1654 }
1655}
1656#[doc = "A list of private link resources"]
1657#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
1658pub struct PrivateLinkResourceListResult {
1659 #[doc = "Array of private link resources"]
1660 #[serde(
1661 default,
1662 deserialize_with = "azure_core::util::deserialize_null_as_default",
1663 skip_serializing_if = "Vec::is_empty"
1664 )]
1665 pub value: Vec<PrivateLinkResource>,
1666}
1667impl azure_core::Continuable for PrivateLinkResourceListResult {
1668 type Continuation = String;
1669 fn continuation(&self) -> Option<Self::Continuation> {
1670 None
1671 }
1672}
1673impl PrivateLinkResourceListResult {
1674 pub fn new() -> Self {
1675 Self::default()
1676 }
1677}
1678#[doc = "Properties of a private link resource."]
1679#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
1680pub struct PrivateLinkResourceProperties {
1681 #[doc = "The private link resource group id."]
1682 #[serde(rename = "groupId", default, skip_serializing_if = "Option::is_none")]
1683 pub group_id: Option<String>,
1684 #[doc = "The private link resource required member names."]
1685 #[serde(
1686 rename = "requiredMembers",
1687 default,
1688 deserialize_with = "azure_core::util::deserialize_null_as_default",
1689 skip_serializing_if = "Vec::is_empty"
1690 )]
1691 pub required_members: Vec<String>,
1692 #[doc = "The private link resource Private link DNS zone name."]
1693 #[serde(
1694 rename = "requiredZoneNames",
1695 default,
1696 deserialize_with = "azure_core::util::deserialize_null_as_default",
1697 skip_serializing_if = "Vec::is_empty"
1698 )]
1699 pub required_zone_names: Vec<String>,
1700}
1701impl PrivateLinkResourceProperties {
1702 pub fn new() -> Self {
1703 Self::default()
1704 }
1705}
1706#[doc = "A collection of information about the state of the connection between service consumer and provider."]
1707#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
1708pub struct PrivateLinkServiceConnectionState {
1709 #[doc = "The private endpoint connection status."]
1710 #[serde(default, skip_serializing_if = "Option::is_none")]
1711 pub status: Option<PrivateEndpointServiceConnectionStatus>,
1712 #[doc = "The reason for approval/rejection of the connection."]
1713 #[serde(default, skip_serializing_if = "Option::is_none")]
1714 pub description: Option<String>,
1715 #[doc = "A message indicating if changes on the service provider require any updates on the consumer."]
1716 #[serde(rename = "actionsRequired", default, skip_serializing_if = "Option::is_none")]
1717 pub actions_required: Option<String>,
1718}
1719impl PrivateLinkServiceConnectionState {
1720 pub fn new() -> Self {
1721 Self::default()
1722 }
1723}
1724#[doc = "Provisioning state of the resource."]
1725#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
1726#[serde(remote = "ProvisioningState")]
1727pub enum ProvisioningState {
1728 Accepted,
1729 Creating,
1730 Updating,
1731 Succeeded,
1732 Failed,
1733 Deleting,
1734 #[serde(skip_deserializing)]
1735 UnknownValue(String),
1736}
1737impl FromStr for ProvisioningState {
1738 type Err = value::Error;
1739 fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
1740 Self::deserialize(s.into_deserializer())
1741 }
1742}
1743impl<'de> Deserialize<'de> for ProvisioningState {
1744 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1745 where
1746 D: Deserializer<'de>,
1747 {
1748 let s = String::deserialize(deserializer)?;
1749 let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s));
1750 Ok(deserialized)
1751 }
1752}
1753impl Serialize for ProvisioningState {
1754 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1755 where
1756 S: Serializer,
1757 {
1758 match self {
1759 Self::Accepted => serializer.serialize_unit_variant("ProvisioningState", 0u32, "Accepted"),
1760 Self::Creating => serializer.serialize_unit_variant("ProvisioningState", 1u32, "Creating"),
1761 Self::Updating => serializer.serialize_unit_variant("ProvisioningState", 2u32, "Updating"),
1762 Self::Succeeded => serializer.serialize_unit_variant("ProvisioningState", 3u32, "Succeeded"),
1763 Self::Failed => serializer.serialize_unit_variant("ProvisioningState", 4u32, "Failed"),
1764 Self::Deleting => serializer.serialize_unit_variant("ProvisioningState", 5u32, "Deleting"),
1765 Self::UnknownValue(s) => serializer.serialize_str(s.as_str()),
1766 }
1767 }
1768}
1769#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
1770pub struct ReferenceDataSetCreateOrUpdateParameters {
1771 #[serde(flatten)]
1772 pub create_or_update_tracked_resource_properties: CreateOrUpdateTrackedResourceProperties,
1773 #[doc = "Properties used to create a reference data set."]
1774 pub properties: ReferenceDataSetCreationProperties,
1775}
1776impl ReferenceDataSetCreateOrUpdateParameters {
1777 pub fn new(
1778 create_or_update_tracked_resource_properties: CreateOrUpdateTrackedResourceProperties,
1779 properties: ReferenceDataSetCreationProperties,
1780 ) -> Self {
1781 Self {
1782 create_or_update_tracked_resource_properties,
1783 properties,
1784 }
1785 }
1786}
1787#[doc = "Properties used to create a reference data set."]
1788#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
1789pub struct ReferenceDataSetCreationProperties {
1790 #[doc = "The list of key properties for the reference data set."]
1791 #[serde(rename = "keyProperties")]
1792 pub key_properties: Vec<ReferenceDataSetKeyProperty>,
1793 #[doc = "The reference data set key comparison behavior can be set using this property. By default, the value is 'Ordinal' - which means case sensitive key comparison will be performed while joining reference data with events or while adding new reference data. When 'OrdinalIgnoreCase' is set, case insensitive comparison will be used."]
1794 #[serde(rename = "dataStringComparisonBehavior", default, skip_serializing_if = "Option::is_none")]
1795 pub data_string_comparison_behavior: Option<reference_data_set_creation_properties::DataStringComparisonBehavior>,
1796}
1797impl ReferenceDataSetCreationProperties {
1798 pub fn new(key_properties: Vec<ReferenceDataSetKeyProperty>) -> Self {
1799 Self {
1800 key_properties,
1801 data_string_comparison_behavior: None,
1802 }
1803 }
1804}
1805pub mod reference_data_set_creation_properties {
1806 use super::*;
1807 #[doc = "The reference data set key comparison behavior can be set using this property. By default, the value is 'Ordinal' - which means case sensitive key comparison will be performed while joining reference data with events or while adding new reference data. When 'OrdinalIgnoreCase' is set, case insensitive comparison will be used."]
1808 #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
1809 #[serde(remote = "DataStringComparisonBehavior")]
1810 pub enum DataStringComparisonBehavior {
1811 Ordinal,
1812 OrdinalIgnoreCase,
1813 #[serde(skip_deserializing)]
1814 UnknownValue(String),
1815 }
1816 impl FromStr for DataStringComparisonBehavior {
1817 type Err = value::Error;
1818 fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
1819 Self::deserialize(s.into_deserializer())
1820 }
1821 }
1822 impl<'de> Deserialize<'de> for DataStringComparisonBehavior {
1823 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1824 where
1825 D: Deserializer<'de>,
1826 {
1827 let s = String::deserialize(deserializer)?;
1828 let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s));
1829 Ok(deserialized)
1830 }
1831 }
1832 impl Serialize for DataStringComparisonBehavior {
1833 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1834 where
1835 S: Serializer,
1836 {
1837 match self {
1838 Self::Ordinal => serializer.serialize_unit_variant("DataStringComparisonBehavior", 0u32, "Ordinal"),
1839 Self::OrdinalIgnoreCase => serializer.serialize_unit_variant("DataStringComparisonBehavior", 1u32, "OrdinalIgnoreCase"),
1840 Self::UnknownValue(s) => serializer.serialize_str(s.as_str()),
1841 }
1842 }
1843 }
1844}
1845#[doc = "A key property for the reference data set. A reference data set can have multiple key properties."]
1846#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
1847pub struct ReferenceDataSetKeyProperty {
1848 #[doc = "The name of the key property."]
1849 #[serde(default, skip_serializing_if = "Option::is_none")]
1850 pub name: Option<String>,
1851 #[doc = "The type of the key property."]
1852 #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
1853 pub type_: Option<reference_data_set_key_property::Type>,
1854}
1855impl ReferenceDataSetKeyProperty {
1856 pub fn new() -> Self {
1857 Self::default()
1858 }
1859}
1860pub mod reference_data_set_key_property {
1861 use super::*;
1862 #[doc = "The type of the key property."]
1863 #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
1864 #[serde(remote = "Type")]
1865 pub enum Type {
1866 String,
1867 Double,
1868 Bool,
1869 DateTime,
1870 #[serde(skip_deserializing)]
1871 UnknownValue(String),
1872 }
1873 impl FromStr for Type {
1874 type Err = value::Error;
1875 fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
1876 Self::deserialize(s.into_deserializer())
1877 }
1878 }
1879 impl<'de> Deserialize<'de> for Type {
1880 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1881 where
1882 D: Deserializer<'de>,
1883 {
1884 let s = String::deserialize(deserializer)?;
1885 let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s));
1886 Ok(deserialized)
1887 }
1888 }
1889 impl Serialize for Type {
1890 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1891 where
1892 S: Serializer,
1893 {
1894 match self {
1895 Self::String => serializer.serialize_unit_variant("Type", 0u32, "String"),
1896 Self::Double => serializer.serialize_unit_variant("Type", 1u32, "Double"),
1897 Self::Bool => serializer.serialize_unit_variant("Type", 2u32, "Bool"),
1898 Self::DateTime => serializer.serialize_unit_variant("Type", 3u32, "DateTime"),
1899 Self::UnknownValue(s) => serializer.serialize_str(s.as_str()),
1900 }
1901 }
1902 }
1903}
1904#[doc = "The response of the List Reference Data Sets operation."]
1905#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
1906pub struct ReferenceDataSetListResponse {
1907 #[doc = "Result of the List Reference Data Sets operation."]
1908 #[serde(
1909 default,
1910 deserialize_with = "azure_core::util::deserialize_null_as_default",
1911 skip_serializing_if = "Vec::is_empty"
1912 )]
1913 pub value: Vec<ReferenceDataSetResource>,
1914}
1915impl ReferenceDataSetListResponse {
1916 pub fn new() -> Self {
1917 Self::default()
1918 }
1919}
1920#[doc = "A reference data set provides metadata about the events in an environment. Metadata in the reference data set will be joined with events as they are read from event sources. The metadata that makes up the reference data set is uploaded or modified through the Time Series Insights data plane APIs."]
1921#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
1922pub struct ReferenceDataSetResource {
1923 #[serde(flatten)]
1924 pub tracked_resource: TrackedResource,
1925 #[doc = "Properties of the reference data set."]
1926 #[serde(default, skip_serializing_if = "Option::is_none")]
1927 pub properties: Option<ReferenceDataSetResourceProperties>,
1928}
1929impl ReferenceDataSetResource {
1930 pub fn new(tracked_resource: TrackedResource) -> Self {
1931 Self {
1932 tracked_resource,
1933 properties: None,
1934 }
1935 }
1936}
1937#[doc = "Properties of the reference data set."]
1938#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
1939pub struct ReferenceDataSetResourceProperties {
1940 #[serde(flatten)]
1941 pub reference_data_set_creation_properties: ReferenceDataSetCreationProperties,
1942 #[serde(flatten)]
1943 pub resource_properties: ResourceProperties,
1944}
1945impl ReferenceDataSetResourceProperties {
1946 pub fn new(reference_data_set_creation_properties: ReferenceDataSetCreationProperties) -> Self {
1947 Self {
1948 reference_data_set_creation_properties,
1949 resource_properties: ResourceProperties::default(),
1950 }
1951 }
1952}
1953#[doc = "Parameters supplied to the Update Reference Data Set operation."]
1954#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
1955pub struct ReferenceDataSetUpdateParameters {
1956 #[doc = "Key-value pairs of additional properties for the reference data set."]
1957 #[serde(default, skip_serializing_if = "Option::is_none")]
1958 pub tags: Option<serde_json::Value>,
1959}
1960impl ReferenceDataSetUpdateParameters {
1961 pub fn new() -> Self {
1962 Self::default()
1963 }
1964}
1965#[doc = "Common fields that are returned in the response for all Azure Resource Manager resources"]
1966#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
1967pub struct Resource {
1968 #[doc = "Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}"]
1969 #[serde(default, skip_serializing_if = "Option::is_none")]
1970 pub id: Option<String>,
1971 #[doc = "The name of the resource"]
1972 #[serde(default, skip_serializing_if = "Option::is_none")]
1973 pub name: Option<String>,
1974 #[doc = "The type of the resource. E.g. \"Microsoft.Compute/virtualMachines\" or \"Microsoft.Storage/storageAccounts\""]
1975 #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
1976 pub type_: Option<String>,
1977}
1978impl Resource {
1979 pub fn new() -> Self {
1980 Self::default()
1981 }
1982}
1983#[doc = "Properties that are common to all tracked resources."]
1984#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
1985pub struct ResourceProperties {
1986 #[doc = "Provisioning state of the resource."]
1987 #[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_none")]
1988 pub provisioning_state: Option<ProvisioningState>,
1989 #[doc = "The time the resource was created."]
1990 #[serde(rename = "creationTime", default, with = "azure_core::date::rfc3339::option")]
1991 pub creation_time: Option<::time::OffsetDateTime>,
1992}
1993impl ResourceProperties {
1994 pub fn new() -> Self {
1995 Self::default()
1996 }
1997}
1998#[doc = "One property of operation, include metric specifications."]
1999#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
2000pub struct ServiceSpecification {
2001 #[doc = "Metric specifications of operation."]
2002 #[serde(
2003 rename = "metricSpecifications",
2004 default,
2005 deserialize_with = "azure_core::util::deserialize_null_as_default",
2006 skip_serializing_if = "Vec::is_empty"
2007 )]
2008 pub metric_specifications: Vec<MetricSpecification>,
2009 #[doc = "A list of Azure Monitoring log definitions."]
2010 #[serde(
2011 rename = "logSpecifications",
2012 default,
2013 deserialize_with = "azure_core::util::deserialize_null_as_default",
2014 skip_serializing_if = "Vec::is_empty"
2015 )]
2016 pub log_specifications: Vec<LogSpecification>,
2017}
2018impl ServiceSpecification {
2019 pub fn new() -> Self {
2020 Self::default()
2021 }
2022}
2023#[doc = "The sku determines the type of environment, either Gen1 (S1 or S2) or Gen2 (L1). For Gen1 environments the sku determines the capacity of the environment, the ingress rate, and the billing rate."]
2024#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
2025pub struct Sku {
2026 #[doc = "The name of this SKU."]
2027 pub name: sku::Name,
2028 #[doc = "The capacity of the sku. For Gen1 environments, this value can be changed to support scale out of environments after they have been created."]
2029 pub capacity: i32,
2030}
2031impl Sku {
2032 pub fn new(name: sku::Name, capacity: i32) -> Self {
2033 Self { name, capacity }
2034 }
2035}
2036pub mod sku {
2037 use super::*;
2038 #[doc = "The name of this SKU."]
2039 #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
2040 #[serde(remote = "Name")]
2041 pub enum Name {
2042 S1,
2043 S2,
2044 P1,
2045 L1,
2046 #[serde(skip_deserializing)]
2047 UnknownValue(String),
2048 }
2049 impl FromStr for Name {
2050 type Err = value::Error;
2051 fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
2052 Self::deserialize(s.into_deserializer())
2053 }
2054 }
2055 impl<'de> Deserialize<'de> for Name {
2056 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2057 where
2058 D: Deserializer<'de>,
2059 {
2060 let s = String::deserialize(deserializer)?;
2061 let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s));
2062 Ok(deserialized)
2063 }
2064 }
2065 impl Serialize for Name {
2066 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2067 where
2068 S: Serializer,
2069 {
2070 match self {
2071 Self::S1 => serializer.serialize_unit_variant("Name", 0u32, "S1"),
2072 Self::S2 => serializer.serialize_unit_variant("Name", 1u32, "S2"),
2073 Self::P1 => serializer.serialize_unit_variant("Name", 2u32, "P1"),
2074 Self::L1 => serializer.serialize_unit_variant("Name", 3u32, "L1"),
2075 Self::UnknownValue(s) => serializer.serialize_str(s.as_str()),
2076 }
2077 }
2078 }
2079}
2080#[doc = "The structure of the property that a time series id can have. An environment can have multiple such properties."]
2081#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
2082pub struct TimeSeriesIdProperty {
2083 #[doc = "The name of the property."]
2084 #[serde(default, skip_serializing_if = "Option::is_none")]
2085 pub name: Option<String>,
2086 #[doc = "The type of the property."]
2087 #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
2088 pub type_: Option<time_series_id_property::Type>,
2089}
2090impl TimeSeriesIdProperty {
2091 pub fn new() -> Self {
2092 Self::default()
2093 }
2094}
2095pub mod time_series_id_property {
2096 use super::*;
2097 #[doc = "The type of the property."]
2098 #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
2099 #[serde(remote = "Type")]
2100 pub enum Type {
2101 String,
2102 #[serde(skip_deserializing)]
2103 UnknownValue(String),
2104 }
2105 impl FromStr for Type {
2106 type Err = value::Error;
2107 fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
2108 Self::deserialize(s.into_deserializer())
2109 }
2110 }
2111 impl<'de> Deserialize<'de> for Type {
2112 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2113 where
2114 D: Deserializer<'de>,
2115 {
2116 let s = String::deserialize(deserializer)?;
2117 let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s));
2118 Ok(deserialized)
2119 }
2120 }
2121 impl Serialize for Type {
2122 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2123 where
2124 S: Serializer,
2125 {
2126 match self {
2127 Self::String => serializer.serialize_unit_variant("Type", 0u32, "String"),
2128 Self::UnknownValue(s) => serializer.serialize_str(s.as_str()),
2129 }
2130 }
2131 }
2132}
2133#[doc = "Time Series Insights resource that is tracked by Azure Resource Manager."]
2134#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
2135pub struct TrackedResource {
2136 #[serde(flatten)]
2137 pub resource: Resource,
2138 #[doc = "Resource location"]
2139 pub location: String,
2140 #[doc = "Resource tags"]
2141 #[serde(default, skip_serializing_if = "Option::is_none")]
2142 pub tags: Option<serde_json::Value>,
2143}
2144impl TrackedResource {
2145 pub fn new(location: String) -> Self {
2146 Self {
2147 resource: Resource::default(),
2148 location,
2149 tags: None,
2150 }
2151 }
2152}
2153#[doc = "An object that represents the status of warm storage on an environment."]
2154#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
2155pub struct WarmStorageEnvironmentStatus {
2156 #[doc = "An object that contains the status of warm storage properties usage."]
2157 #[serde(rename = "propertiesUsage", default, skip_serializing_if = "Option::is_none")]
2158 pub properties_usage: Option<WarmStoragePropertiesUsage>,
2159}
2160impl WarmStorageEnvironmentStatus {
2161 pub fn new() -> Self {
2162 Self::default()
2163 }
2164}
2165#[doc = "An object that contains the status of warm storage properties usage."]
2166#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
2167pub struct WarmStoragePropertiesUsage {
2168 #[doc = "This string represents the state of warm storage properties usage. It can be \"Ok\", \"Error\", \"Unknown\"."]
2169 #[serde(default, skip_serializing_if = "Option::is_none")]
2170 pub state: Option<warm_storage_properties_usage::State>,
2171 #[doc = "An object that contains the details about warm storage properties usage state."]
2172 #[serde(rename = "stateDetails", default, skip_serializing_if = "Option::is_none")]
2173 pub state_details: Option<WarmStoragePropertiesUsageStateDetails>,
2174}
2175impl WarmStoragePropertiesUsage {
2176 pub fn new() -> Self {
2177 Self::default()
2178 }
2179}
2180pub mod warm_storage_properties_usage {
2181 use super::*;
2182 #[doc = "This string represents the state of warm storage properties usage. It can be \"Ok\", \"Error\", \"Unknown\"."]
2183 #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
2184 #[serde(remote = "State")]
2185 pub enum State {
2186 Ok,
2187 Error,
2188 Unknown,
2189 #[serde(skip_deserializing)]
2190 UnknownValue(String),
2191 }
2192 impl FromStr for State {
2193 type Err = value::Error;
2194 fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
2195 Self::deserialize(s.into_deserializer())
2196 }
2197 }
2198 impl<'de> Deserialize<'de> for State {
2199 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2200 where
2201 D: Deserializer<'de>,
2202 {
2203 let s = String::deserialize(deserializer)?;
2204 let deserialized = Self::from_str(&s).unwrap_or(Self::UnknownValue(s));
2205 Ok(deserialized)
2206 }
2207 }
2208 impl Serialize for State {
2209 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2210 where
2211 S: Serializer,
2212 {
2213 match self {
2214 Self::Ok => serializer.serialize_unit_variant("State", 0u32, "Ok"),
2215 Self::Error => serializer.serialize_unit_variant("State", 1u32, "Error"),
2216 Self::Unknown => serializer.serialize_unit_variant("State", 2u32, "Unknown"),
2217 Self::UnknownValue(s) => serializer.serialize_str(s.as_str()),
2218 }
2219 }
2220 }
2221}
2222#[doc = "An object that contains the details about warm storage properties usage state."]
2223#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
2224pub struct WarmStoragePropertiesUsageStateDetails {
2225 #[doc = "A value that represents the number of properties used by the environment for S1/S2 SKU and number of properties used by Warm Store for PAYG SKU"]
2226 #[serde(rename = "currentCount", default, skip_serializing_if = "Option::is_none")]
2227 pub current_count: Option<i32>,
2228 #[doc = "A value that represents the maximum number of properties used allowed by the environment for S1/S2 SKU and maximum number of properties allowed by Warm Store for PAYG SKU."]
2229 #[serde(rename = "maxCount", default, skip_serializing_if = "Option::is_none")]
2230 pub max_count: Option<i32>,
2231}
2232impl WarmStoragePropertiesUsageStateDetails {
2233 pub fn new() -> Self {
2234 Self::default()
2235 }
2236}
2237#[doc = "The warm store configuration provides the details to create a warm store cache that will retain a copy of the environment's data available for faster query."]
2238#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
2239pub struct WarmStoreConfigurationProperties {
2240 #[doc = "ISO8601 timespan specifying the number of days the environment's events will be available for query from the warm store."]
2241 #[serde(rename = "dataRetention")]
2242 pub data_retention: String,
2243}
2244impl WarmStoreConfigurationProperties {
2245 pub fn new(data_retention: String) -> Self {
2246 Self { data_retention }
2247 }
2248}