azure-lite-rs 0.1.1

Lightweight HTTP client for Azure APIs
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
//! Types for the Azure CosmosDB API (v1).
//!
//! Auto-generated from the Azure ARM REST Specification.
//! **Do not edit manually** — modify the manifest and re-run codegen.

use serde::{Deserialize, Serialize};
use std::collections::HashMap;

/// The consistency policy for the Cosmos DB account.
///
/// **Azure API**: `cosmosdb.v1.ConsistencyPolicy`
/// **Reference**: <https://learn.microsoft.com/en-us/rest/api/cosmos-db-resource-provider//ConsistencyPolicy>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ConsistencyPolicy {
    /// The default consistency level (BoundedStaleness, ConsistentPrefix, Eventual, Session,
    /// Strong)
    pub default_consistency_level: String,

    /// When used with BoundedStaleness, represents the number of stale requests tolerated
    #[serde(skip_serializing_if = "Option::is_none")]
    pub max_staleness_prefix: Option<i64>,

    /// When used with BoundedStaleness, represents the time (seconds) of staleness tolerated
    #[serde(skip_serializing_if = "Option::is_none")]
    pub max_interval_in_seconds: Option<i32>,
}

impl ConsistencyPolicy {
    #[cfg(any(test, feature = "test-support"))]
    /// Create a fixture instance for testing.
    pub fn fixture() -> Self {
        Self {
            default_consistency_level: "test-default_consistency_level".into(),
            max_staleness_prefix: Some(100),
            max_interval_in_seconds: Some(100),
        }
    }
}

/// A region in which the Azure Cosmos DB database account is deployed.
///
/// **Azure API**: `cosmosdb.v1.Location`
/// **Reference**: <https://learn.microsoft.com/en-us/rest/api/cosmos-db-resource-provider//Location>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct Location {
    /// The name of the region
    #[serde(skip_serializing_if = "Option::is_none")]
    pub location_name: Option<String>,

    /// The status of the Cosmos DB account at the time the operation was called
    #[serde(skip_serializing_if = "Option::is_none")]
    pub provisioning_state: Option<String>,

    /// The failover priority of the region (0 = write region)
    #[serde(skip_serializing_if = "Option::is_none")]
    pub failover_priority: Option<i32>,

    /// Flag to indicate whether or not this region is an AvailabilityZone region
    #[serde(skip_serializing_if = "Option::is_none")]
    pub is_zone_redundant: Option<bool>,
}

impl Location {
    #[cfg(any(test, feature = "test-support"))]
    /// Create a fixture instance for testing.
    pub fn fixture() -> Self {
        Self {
            location_name: Some("test-location_name".into()),
            provisioning_state: Some("test-provisioning_state".into()),
            failover_priority: Some(100),
            is_zone_redundant: Some(false),
        }
    }
}

/// Properties for the database account.
///
/// **Azure API**: `cosmosdb.v1.DatabaseAccountProperties`
/// **Reference**: <https://learn.microsoft.com/en-us/rest/api/cosmos-db-resource-provider//DatabaseAccountProperties>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct DatabaseAccountProperties {
    /// The connection endpoint for the Cosmos DB database account
    #[serde(skip_serializing_if = "Option::is_none")]
    pub document_endpoint: Option<String>,

    /// The status of the Cosmos DB account at the time the operation was called
    #[serde(skip_serializing_if = "Option::is_none")]
    pub provisioning_state: Option<String>,

    /// The offer type for the Cosmos DB database account (Standard)
    #[serde(skip_serializing_if = "Option::is_none")]
    pub database_account_offer_type: Option<String>,

    /// The consistency policy for the Cosmos DB account
    #[serde(skip_serializing_if = "Option::is_none")]
    pub consistency_policy: Option<ConsistencyPolicy>,

    /// Enables automatic failover of the write region
    #[serde(skip_serializing_if = "Option::is_none")]
    pub enable_automatic_failover: Option<bool>,

    /// Enables the account to write in multiple locations
    #[serde(skip_serializing_if = "Option::is_none")]
    pub enable_multiple_write_locations: Option<bool>,
}

impl DatabaseAccountProperties {
    #[cfg(any(test, feature = "test-support"))]
    /// Create a fixture instance for testing.
    pub fn fixture() -> Self {
        Self {
            document_endpoint: Some("test-document_endpoint".into()),
            provisioning_state: Some("test-provisioning_state".into()),
            database_account_offer_type: Some("test-database_account_offer_type".into()),
            consistency_policy: Some(ConsistencyPolicy::fixture()),
            enable_automatic_failover: Some(false),
            enable_multiple_write_locations: Some(false),
        }
    }
}

/// An Azure Cosmos DB database account.
///
/// **Azure API**: `cosmosdb.v1.DatabaseAccount`
/// **Reference**: <https://learn.microsoft.com/en-us/rest/api/cosmos-db-resource-provider//DatabaseAccount>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct DatabaseAccount {
    /// Fully qualified resource ID
    #[serde(skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,

    /// The name of the resource
    #[serde(skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,

    /// The type of the resource
    #[serde(rename = "type")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub r#type: Option<String>,

    /// Resource location
    #[serde(skip_serializing_if = "Option::is_none")]
    pub location: Option<String>,

    /// Indicates the type of database account (GlobalDocumentDB, MongoDB, Parse)
    #[serde(skip_serializing_if = "Option::is_none")]
    pub kind: Option<String>,

    /// Resource tags
    #[serde(default)]
    #[serde(skip_serializing_if = "HashMap::is_empty")]
    pub tags: HashMap<String, String>,

    /// Account properties
    #[serde(skip_serializing_if = "Option::is_none")]
    pub properties: Option<DatabaseAccountProperties>,
}

impl DatabaseAccount {
    #[cfg(any(test, feature = "test-support"))]
    /// Create a fixture instance for testing.
    pub fn fixture() -> Self {
        Self {
            id: Some("test-id".into()),
            name: Some("test-database_account".into()),
            r#type: Some("test-type".into()),
            location: Some("test-location".into()),
            kind: Some("test-kind".into()),
            tags: Default::default(),
            properties: Some(DatabaseAccountProperties::fixture()),
        }
    }
}

/// The List operation response, that contains the database accounts and their properties.
///
/// **Azure API**: `cosmosdb.v1.DatabaseAccountListResult`
/// **Reference**: <https://learn.microsoft.com/en-us/rest/api/cosmos-db-resource-provider//DatabaseAccountListResult>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct DatabaseAccountListResult {
    /// List of database account and their properties
    #[serde(default)]
    #[serde(skip_serializing_if = "Vec::is_empty")]
    pub value: Vec<DatabaseAccount>,
}

impl DatabaseAccountListResult {
    #[cfg(any(test, feature = "test-support"))]
    /// Create a fixture instance for testing.
    pub fn fixture() -> Self {
        Self { value: vec![] }
    }
}

/// Properties to create and update Azure Cosmos DB database accounts.
///
/// **Azure API**: `cosmosdb.v1.DatabaseAccountCreateUpdateProperties`
/// **Reference**: <https://learn.microsoft.com/en-us/rest/api/cosmos-db-resource-provider//DatabaseAccountCreateUpdateProperties>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct DatabaseAccountCreateUpdateProperties {
    /// The offer type for the database (Standard)
    pub database_account_offer_type: String,

    /// The consistency policy for the Cosmos DB account
    #[serde(skip_serializing_if = "Option::is_none")]
    pub consistency_policy: Option<ConsistencyPolicy>,

    /// Enables automatic failover of the write region
    #[serde(skip_serializing_if = "Option::is_none")]
    pub enable_automatic_failover: Option<bool>,

    /// Enables the account to write in multiple locations
    #[serde(skip_serializing_if = "Option::is_none")]
    pub enable_multiple_write_locations: Option<bool>,
}

impl DatabaseAccountCreateUpdateProperties {
    #[cfg(any(test, feature = "test-support"))]
    /// Create a fixture instance for testing.
    pub fn fixture() -> Self {
        Self {
            database_account_offer_type: "test-database_account_offer_type".into(),
            consistency_policy: Some(ConsistencyPolicy::fixture()),
            enable_automatic_failover: Some(false),
            enable_multiple_write_locations: Some(false),
        }
    }
}

/// Parameters to create and update Cosmos DB database accounts.
///
/// **Azure API**: `cosmosdb.v1.DatabaseAccountCreateRequest`
/// **Reference**: <https://learn.microsoft.com/en-us/rest/api/cosmos-db-resource-provider//DatabaseAccountCreateRequest>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct DatabaseAccountCreateRequest {
    /// The location of the resource group to which the resource belongs
    pub location: String,

    /// Indicates the type of database account (GlobalDocumentDB, MongoDB, Parse)
    #[serde(skip_serializing_if = "Option::is_none")]
    pub kind: Option<String>,

    /// Resource tags
    #[serde(default)]
    #[serde(skip_serializing_if = "HashMap::is_empty")]
    pub tags: HashMap<String, String>,

    /// Properties for the database account
    pub properties: DatabaseAccountCreateUpdateProperties,
}

impl DatabaseAccountCreateRequest {
    #[cfg(any(test, feature = "test-support"))]
    /// Create a fixture instance for testing.
    pub fn fixture() -> Self {
        Self {
            location: "test-location".into(),
            kind: Some("test-kind".into()),
            tags: Default::default(),
            properties: DatabaseAccountCreateUpdateProperties::fixture(),
        }
    }
}

/// Cosmos DB SQL database resource object.
///
/// **Azure API**: `cosmosdb.v1.SqlDatabaseResource`
/// **Reference**: <https://learn.microsoft.com/en-us/rest/api/cosmos-db-resource-provider//SqlDatabaseResource>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct SqlDatabaseResource {
    /// Name of the Cosmos DB SQL database
    pub id: String,
}

impl SqlDatabaseResource {
    #[cfg(any(test, feature = "test-support"))]
    /// Create a fixture instance for testing.
    pub fn fixture() -> Self {
        Self {
            id: "test-id".into(),
        }
    }
}

/// The Cosmos DB SQL database resource.
///
/// **Azure API**: `cosmosdb.v1.SqlDatabaseGetPropertiesResource`
/// **Reference**: <https://learn.microsoft.com/en-us/rest/api/cosmos-db-resource-provider//SqlDatabaseGetPropertiesResource>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct SqlDatabaseGetPropertiesResource {
    /// Name of the Cosmos DB SQL database
    #[serde(skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,

    /// A system generated property that specified the addressable path of the collections
    #[serde(skip_serializing_if = "Option::is_none")]
    pub colls: Option<String>,

    /// A system generated property that specifies the addressable path of the users resource
    #[serde(skip_serializing_if = "Option::is_none")]
    pub users: Option<String>,
}

impl SqlDatabaseGetPropertiesResource {
    #[cfg(any(test, feature = "test-support"))]
    /// Create a fixture instance for testing.
    pub fn fixture() -> Self {
        Self {
            id: Some("test-id".into()),
            colls: Some("test-colls".into()),
            users: Some("test-users".into()),
        }
    }
}

/// The properties of an Azure Cosmos DB SQL database.
///
/// **Azure API**: `cosmosdb.v1.SqlDatabaseGetProperties`
/// **Reference**: <https://learn.microsoft.com/en-us/rest/api/cosmos-db-resource-provider//SqlDatabaseGetProperties>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct SqlDatabaseGetProperties {
    /// The resource of the SQL database
    #[serde(skip_serializing_if = "Option::is_none")]
    pub resource: Option<SqlDatabaseGetPropertiesResource>,
}

impl SqlDatabaseGetProperties {
    #[cfg(any(test, feature = "test-support"))]
    /// Create a fixture instance for testing.
    pub fn fixture() -> Self {
        Self {
            resource: Some(SqlDatabaseGetPropertiesResource::fixture()),
        }
    }
}

/// An Azure Cosmos DB SQL database.
///
/// **Azure API**: `cosmosdb.v1.SqlDatabaseGetResults`
/// **Reference**: <https://learn.microsoft.com/en-us/rest/api/cosmos-db-resource-provider//SqlDatabaseGetResults>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct SqlDatabaseGetResults {
    /// The unique resource identifier of the ARM resource
    #[serde(skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,

    /// The name of the ARM resource
    #[serde(skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,

    /// The type of Azure resource
    #[serde(rename = "type")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub r#type: Option<String>,

    /// The location of the resource group
    #[serde(skip_serializing_if = "Option::is_none")]
    pub location: Option<String>,

    /// Tags are a list of key-value pairs
    #[serde(default)]
    #[serde(skip_serializing_if = "HashMap::is_empty")]
    pub tags: HashMap<String, String>,

    /// The properties of an Azure Cosmos DB SQL database
    #[serde(skip_serializing_if = "Option::is_none")]
    pub properties: Option<SqlDatabaseGetProperties>,
}

impl SqlDatabaseGetResults {
    #[cfg(any(test, feature = "test-support"))]
    /// Create a fixture instance for testing.
    pub fn fixture() -> Self {
        Self {
            id: Some("test-id".into()),
            name: Some("test-sql_database_get_results".into()),
            r#type: Some("test-type".into()),
            location: Some("test-location".into()),
            tags: Default::default(),
            properties: Some(SqlDatabaseGetProperties::fixture()),
        }
    }
}

/// The List operation response, that contains the SQL databases and their properties.
///
/// **Azure API**: `cosmosdb.v1.SqlDatabaseListResult`
/// **Reference**: <https://learn.microsoft.com/en-us/rest/api/cosmos-db-resource-provider//SqlDatabaseListResult>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct SqlDatabaseListResult {
    /// List of SQL databases and their properties
    #[serde(default)]
    #[serde(skip_serializing_if = "Vec::is_empty")]
    pub value: Vec<SqlDatabaseGetResults>,
}

impl SqlDatabaseListResult {
    #[cfg(any(test, feature = "test-support"))]
    /// Create a fixture instance for testing.
    pub fn fixture() -> Self {
        Self { value: vec![] }
    }
}

/// Properties to create and update Azure Cosmos DB SQL database.
///
/// **Azure API**: `cosmosdb.v1.SqlDatabaseCreateUpdateProperties`
/// **Reference**: <https://learn.microsoft.com/en-us/rest/api/cosmos-db-resource-provider//SqlDatabaseCreateUpdateProperties>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct SqlDatabaseCreateUpdateProperties {
    /// The standard JSON format of a Cosmos DB SQL database
    pub resource: SqlDatabaseResource,
}

impl SqlDatabaseCreateUpdateProperties {
    #[cfg(any(test, feature = "test-support"))]
    /// Create a fixture instance for testing.
    pub fn fixture() -> Self {
        Self {
            resource: SqlDatabaseResource::fixture(),
        }
    }
}

/// Parameters to create and update Cosmos DB SQL database.
///
/// **Azure API**: `cosmosdb.v1.SqlDatabaseCreateRequest`
/// **Reference**: <https://learn.microsoft.com/en-us/rest/api/cosmos-db-resource-provider//SqlDatabaseCreateRequest>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct SqlDatabaseCreateRequest {
    /// The location of the resource group to which the resource belongs
    pub location: String,

    /// Tags are a list of key-value pairs
    #[serde(default)]
    #[serde(skip_serializing_if = "HashMap::is_empty")]
    pub tags: HashMap<String, String>,

    /// Properties to create and update Azure Cosmos DB SQL database
    pub properties: SqlDatabaseCreateUpdateProperties,
}

impl SqlDatabaseCreateRequest {
    #[cfg(any(test, feature = "test-support"))]
    /// Create a fixture instance for testing.
    pub fn fixture() -> Self {
        Self {
            location: "test-location".into(),
            tags: Default::default(),
            properties: SqlDatabaseCreateUpdateProperties::fixture(),
        }
    }
}

/// The configuration of the partition key to be used for partitioning data.
///
/// **Azure API**: `cosmosdb.v1.ContainerPartitionKey`
/// **Reference**: <https://learn.microsoft.com/en-us/rest/api/cosmos-db-resource-provider//ContainerPartitionKey>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ContainerPartitionKey {
    /// Indicates the kind of algorithm used for partitioning (Hash, Range, MultiHash)
    #[serde(skip_serializing_if = "Option::is_none")]
    pub kind: Option<String>,

    /// Version of the partition key definition
    #[serde(skip_serializing_if = "Option::is_none")]
    pub version: Option<i32>,
}

impl ContainerPartitionKey {
    #[cfg(any(test, feature = "test-support"))]
    /// Create a fixture instance for testing.
    pub fn fixture() -> Self {
        Self {
            kind: Some("test-kind".into()),
            version: Some(100),
        }
    }
}

/// Cosmos DB SQL container resource object.
///
/// **Azure API**: `cosmosdb.v1.SqlContainerResource`
/// **Reference**: <https://learn.microsoft.com/en-us/rest/api/cosmos-db-resource-provider//SqlContainerResource>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct SqlContainerResource {
    /// Name of the Cosmos DB SQL container
    pub id: String,

    /// The configuration of the partition key to be used for partitioning data
    #[serde(skip_serializing_if = "Option::is_none")]
    pub partition_key: Option<ContainerPartitionKey>,
}

impl SqlContainerResource {
    #[cfg(any(test, feature = "test-support"))]
    /// Create a fixture instance for testing.
    pub fn fixture() -> Self {
        Self {
            id: "test-id".into(),
            partition_key: Some(ContainerPartitionKey::fixture()),
        }
    }
}

/// The resource of the SQL container.
///
/// **Azure API**: `cosmosdb.v1.SqlContainerGetPropertiesResource`
/// **Reference**: <https://learn.microsoft.com/en-us/rest/api/cosmos-db-resource-provider//SqlContainerGetPropertiesResource>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct SqlContainerGetPropertiesResource {
    /// Name of the Cosmos DB SQL container
    #[serde(skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,

    /// The configuration of the partition key
    #[serde(skip_serializing_if = "Option::is_none")]
    pub partition_key: Option<ContainerPartitionKey>,
}

impl SqlContainerGetPropertiesResource {
    #[cfg(any(test, feature = "test-support"))]
    /// Create a fixture instance for testing.
    pub fn fixture() -> Self {
        Self {
            id: Some("test-id".into()),
            partition_key: Some(ContainerPartitionKey::fixture()),
        }
    }
}

/// The properties of an Azure Cosmos DB container.
///
/// **Azure API**: `cosmosdb.v1.SqlContainerGetProperties`
/// **Reference**: <https://learn.microsoft.com/en-us/rest/api/cosmos-db-resource-provider//SqlContainerGetProperties>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct SqlContainerGetProperties {
    /// The resource of the SQL container
    #[serde(skip_serializing_if = "Option::is_none")]
    pub resource: Option<SqlContainerGetPropertiesResource>,
}

impl SqlContainerGetProperties {
    #[cfg(any(test, feature = "test-support"))]
    /// Create a fixture instance for testing.
    pub fn fixture() -> Self {
        Self {
            resource: Some(SqlContainerGetPropertiesResource::fixture()),
        }
    }
}

/// An Azure Cosmos DB container.
///
/// **Azure API**: `cosmosdb.v1.SqlContainerGetResults`
/// **Reference**: <https://learn.microsoft.com/en-us/rest/api/cosmos-db-resource-provider//SqlContainerGetResults>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct SqlContainerGetResults {
    /// The unique resource identifier of the ARM resource
    #[serde(skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,

    /// The name of the ARM resource
    #[serde(skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,

    /// The type of Azure resource
    #[serde(rename = "type")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub r#type: Option<String>,

    /// The location of the resource group
    #[serde(skip_serializing_if = "Option::is_none")]
    pub location: Option<String>,

    /// Tags are a list of key-value pairs
    #[serde(default)]
    #[serde(skip_serializing_if = "HashMap::is_empty")]
    pub tags: HashMap<String, String>,

    /// The properties of an Azure Cosmos DB container
    #[serde(skip_serializing_if = "Option::is_none")]
    pub properties: Option<SqlContainerGetProperties>,
}

impl SqlContainerGetResults {
    #[cfg(any(test, feature = "test-support"))]
    /// Create a fixture instance for testing.
    pub fn fixture() -> Self {
        Self {
            id: Some("test-id".into()),
            name: Some("test-sql_container_get_results".into()),
            r#type: Some("test-type".into()),
            location: Some("test-location".into()),
            tags: Default::default(),
            properties: Some(SqlContainerGetProperties::fixture()),
        }
    }
}

/// The List operation response, that contains the containers and their properties.
///
/// **Azure API**: `cosmosdb.v1.SqlContainerListResult`
/// **Reference**: <https://learn.microsoft.com/en-us/rest/api/cosmos-db-resource-provider//SqlContainerListResult>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct SqlContainerListResult {
    /// List of containers and their properties
    #[serde(default)]
    #[serde(skip_serializing_if = "Vec::is_empty")]
    pub value: Vec<SqlContainerGetResults>,
}

impl SqlContainerListResult {
    #[cfg(any(test, feature = "test-support"))]
    /// Create a fixture instance for testing.
    pub fn fixture() -> Self {
        Self { value: vec![] }
    }
}

/// Properties to create and update Azure Cosmos DB container.
///
/// **Azure API**: `cosmosdb.v1.SqlContainerCreateUpdateProperties`
/// **Reference**: <https://learn.microsoft.com/en-us/rest/api/cosmos-db-resource-provider//SqlContainerCreateUpdateProperties>
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct SqlContainerCreateUpdateProperties {
    /// The standard JSON format of a Cosmos DB SQL container
    pub resource: SqlContainerResource,
}

impl SqlContainerCreateUpdateProperties {
    #[cfg(any(test, feature = "test-support"))]
    /// Create a fixture instance for testing.
    pub fn fixture() -> Self {
        Self {
            resource: SqlContainerResource::fixture(),
        }
    }
}